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:34 | shashlick | In a nutshell, make threadvar, initialize it for each thread separately, pass stuff around with channels |
00:45:48 | shashlick | Use spawn to kick off threads |
00:47:19 | shashlick | See autodup for how I got threads and async working together |
00:47:22 | shashlick | https://gist.github.com/genotrance/ef84e2ee7daab54c0a385e92c0a2757d |
00:51:14 | FromGitter | <zacharycarter> that's a great example :) |
00:57:47 | FromGitter | <zacharycarter> also - some very clean code shashlick |
00:58:21 | FromGitter | <zacharycarter> I never know how to name consts in Nim |
00:58:47 | FromGitter | <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:22 | xace | debugging 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:22 | xace | nvm, 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:42 | FromGitter | <kayabaNerve> Why was `queue` deprecated? |
02:43:54 | FromGitter | <kayabaNerve> I just found out about it when trying to shift a seq. |
02:44:24 | FromGitter | <kayabaNerve> Is the 'good' thing to do add an element and delete the first? |
02:49:29 | FromGitter | <zacharycarter> I didn't realize nim had a `queue` |
02:49:40 | FromGitter | <zacharycarter> I've only ever known about `dequeue` |
02:51:03 | FromGitter | <kayabaNerve> ... there's two of them? This is getting out of hand! |
02:51:55 | FromGitter | <kayabaNerve> (yeah yeah; the lines are flipped and it's "Now there are"; I cared more about the conversation the meme) |
02:52:29 | FromGitter | <kayabaNerve> @zacharycarter deques is a double ended queue module. |
02:52:40 | FromGitter | <kayabaNerve> I just wanted to shift a seq the proper way. I'm adding and deleteing. |
02:59:52 | FromGitter | <zacharycarter> I know |
03:00:07 | FromGitter | <zacharycarter> but I think you can use a seq like a queue, no? |
03:00:27 | FromGitter | <kayabaNerve> Yeah but I wanted to shift it lol |
03:00:36 | FromGitter | <kayabaNerve> That's why I was looking into queue for the proper/optimized way |
03:00:39 | FromGitter | <zacharycarter> oh |
03:00:43 | FromGitter | <kayabaNerve> Because that's what an old forum pot said |
03:01:06 | FromGitter | <zacharycarter> this one? https://forum.nim-lang.org/t/2552 ? |
03:01:51 | FromGitter | <kayabaNerve> Yeah |
03:02:34 | FromGitter | <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:45 | FromGitter | <zacharycarter> I understand the difference b/q a double ended queue and a regular queue |
03:03:00 | FromGitter | <zacharycarter> but I don't know how to write an optimized shift implementation for a sequence in Nim |
03:03:50 | FromGitter | <kayabaNerve> ... I just added and deleted 0 |
03:03:59 | FromGitter | <kayabaNerve> ``` epochs.add(newEpoch) ⏎ epochs.delete(0)``` [https://gitter.im/nim-lang/Nim?at=5bd3d59f069fca52a59e4175] |
03:04:35 | FromGitter | <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:37 | FromGitter | <zacharycarter> I mean - if that achieves what you want ¯\_(ツ)_/¯ |
03:04:44 | FromGitter | <kayabaNerve> You dropped this \\ |
03:04:53 | FromGitter | <zacharycarter> blame copyshrug |
03:04:58 | FromGitter | <kayabaNerve> Yeah. It's not intensive. It was more about being right then being fast. |
03:05:02 | FromGitter | <zacharycarter> gotcha |
03:05:53 | FromGitter | <kayabaNerve> I need more devs on this project lol |
03:06:03 | FromGitter | <kayabaNerve> Turns out there's not a lot of Nim coders out there |
03:06:52 | FromGitter | <kayabaNerve> \*a lot of available ones ⏎ \*a lot compared to C++ |
03:07:07 | FromGitter | <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:14 | FromGitter | <zacharycarter> and my mortgage is hopefully a fleeting thing |
03:07:26 | FromGitter | <zacharycarter> but... I can't find a good way to leave my job while I wait for my home to sell |
03:07:30 | FromGitter | <zacharycarter> so I'm stuck :( |
03:08:00 | FromGitter | <zacharycarter> at work - I've basically been relegated to writing Terraform / doing operations work |
03:08:37 | FromGitter | <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:38 | FromGitter | <zacharycarter> yay! |
03:09:19 | FromGitter | <zacharycarter> enterprise IT sucks - I will never work in this industry again |
03:09:49 | FromGitter | <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:05 | FromGitter | <kayabaNerve> I can pay in exposure! |
03:13:03 | FromGitter | <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:24 | FromGitter | <zacharycarter> I just want to make vidya games |
03:15:56 | FromGitter | <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:09 | FromGitter | <kayabaNerve> Nice |
03:16:37 | FromGitter | <zacharycarter> that probably makes no sense - unless you're familiar with the Rockstar controversy going on |
03:16:51 | FromGitter | <kayabaNerve> Yep. |
03:16:59 | FromGitter | <zacharycarter> well they were working their devs to death |
03:17:09 | FromGitter | <kayabaNerve> In Red Dead Redemption 2, cold weather shrinks the animal's... parts. |
03:17:17 | FromGitter | <zacharycarter> yeah |
03:17:18 | FromGitter | <kayabaNerve> But if you get to code it in Nim, #WorthIt |
03:17:24 | FromGitter | <zacharycarter> well - no |
03:17:37 | FromGitter | <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:45 | FromGitter | <kayabaNerve> I haven't heard about horrible dev policies beyond the usual crunch time. |
03:17:49 | FromGitter | <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:50 | shashlick | @zachcarter: thanks for the compliment! That was my initial few months with Nim so wasn't complying with any style |
03:18:03 | FromGitter | <kayabaNerve> Which is something almost every studio suffers from. |
03:18:11 | FromGitter | <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:15 | FromGitter | <zacharycarter> /rant |
03:18:34 | FromGitter | <zacharycarter> shashlick: it's very good code for someone that is new to Nim :) |
03:18:43 | FromGitter | <zacharycarter> @kayabaNerve very true |
03:19:05 | FromGitter | <kayabaNerve> I said I'd get a... developer beta of an open source app around next sunday. Then the TODO list grew. |
03:19:07 | FromGitter | <kayabaNerve> I am doing work. |
03:19:18 | shashlick | I'd like to post that project, never got around to it |
03:19:32 | shashlick | Got distracted with creating Nim wrappers and what not |
03:19:40 | FromGitter | <zacharycarter> :) |
03:19:52 | FromGitter | <zacharycarter> well I think your work is amazing and very fundamental to Nim's ecosystem |
03:20:02 | FromGitter | <zacharycarter> so don't stop, please |
03:20:04 | shashlick | I'm interested in adding image blur detection with opencv |
03:20:51 | shashlick | Might wrap opencv since dom96's wrapper depends on dlls |
03:20:59 | * | wildlander quit (Quit: Konversation terminated!) |
03:21:02 | shashlick | But the list is endless |
03:21:45 | FromGitter | <zacharycarter> very true |
03:21:53 | shashlick | That 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:47 | FromGitter | <zacharycarter> yeah - I dunno, that's a tough one |
03:25:01 | FromGitter | <zacharycarter> out of all the bindings I've made - nuklear has been by far the one that's been most used |
03:25:20 | FromGitter | <zacharycarter> but I mean - even small /tiny ones like libbearterminal, get used and contributed to |
03:25:41 | shashlick | Anyway, some day maybe |
03:25:59 | shashlick | I guess I should stick to wrappers I use and call it a day |
03:26:14 | FromGitter | <zacharycarter> that's been my philosophy |
03:26:27 | FromGitter | <zacharycarter> trying to extend Nim's ecosystem on your own is difficult |
03:26:31 | shashlick | But making wrappers is quite easy now for me |
03:26:45 | shashlick | So I do these other ones when someone asks here |
03:27:01 | FromGitter | <zacharycarter> well - we still lack a lot of really important wrappers / libs IMO |
03:27:24 | FromGitter | <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:46 | FromGitter | <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:06 | FromGitter | <zacharycarter> and then with web dev - as we talked about earlier briefly - Nim has no server GQL implementation |
03:28:27 | FromGitter | <zacharycarter> so I'm sure people are choosing typescript / golang / nodejs etc over Nim because of that |
03:28:48 | shashlick | Well I don't mind helping grow specific areas |
03:29:10 | FromGitter | <zacharycarter> I agree - but IMO - make sure it's also important to you |
03:29:11 | * | chemist69 joined #nim |
03:29:24 | FromGitter | <zacharycarter> because I think a lot of us have produced libraries / bindings to others that we thought people would use |
03:29:29 | shashlick | If there is a focused initiative, it will be effective |
03:29:33 | FromGitter | <zacharycarter> and then no one did - and then we get asked about them years later |
03:29:36 | FromGitter | <zacharycarter> yeah - exactly |
03:29:56 | FromGitter | <zacharycarter> that's what I've always thought we as a community - compared to Rust for instance - have been lacking |
03:29:58 | shashlick | Well honestly I code for fun so nothing is really important to me |
03:30:35 | shashlick | I like automating since I can't stand doing the same thing twice |
03:30:46 | FromGitter | <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:05 | shashlick | Well I kind of feel the same |
03:31:08 | FromGitter | <zacharycarter> well I think you're smart for that - it's something I don't do enough of |
03:31:24 | FromGitter | <zacharycarter> I've brought it up for graphql for instance |
03:31:29 | FromGitter | <zacharycarter> and AWS / GCP / Azure bindings etc |
03:31:31 | shashlick | Cause wrappers are much less appreciated than Nim native code |
03:31:42 | shashlick | Agreed it is more portable and can be used at compile time |
03:31:45 | FromGitter | <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:11 | shashlick | But I think it is a waste to sit and reimplement stuff |
03:32:28 | FromGitter | <zacharycarter> that's true |
03:32:40 | FromGitter | <zacharycarter> but like - no one is going to write a GraphQL implementation for Nim - besides the Nim community |
03:32:57 | FromGitter | <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:13 | FromGitter | <zacharycarter> and that's probably due, I imagine, to the small number of Nim devs there are in existence |
03:33:30 | FromGitter | <zacharycarter> but like - even amongst the game devs we have in the Nim community, most of us have different interests / goals |
03:33:32 | shashlick | That's getting better due to http://status.im |
03:33:57 | FromGitter | <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:29 | FromGitter | <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:39 | shashlick | But I've been quite frustrated with 0.19.0 and #head, everything is broken and hard to make backwards compatible |
03:34:44 | FromGitter | <zacharycarter> and then there are the majority of people using Nim for game programming, who are fine with SDL2 / allegro / etc |
03:34:52 | FromGitter | <zacharycarter> I haven't hit this yet |
03:35:19 | FromGitter | <zacharycarter> are you referring to the seq / string stuff? |
03:35:33 | FromGitter | <zacharycarter> I'll be right back - going to run to the store before it closess |
03:35:48 | shashlick | Well my goal has been to have these wrappers seamless to install and consume |
03:36:42 | shashlick | There have been a variety of issues |
03:36:54 | shashlick | Anyway, ttyl |
03:55:12 | * | stefanos82 joined #nim |
04:04:59 | * | dddddd quit (Remote host closed the connection) |
04:09:42 | FromGitter | <zacharycarter> back |
04:10:07 | FromGitter | <zacharycarter> shashlick: well - I think this is to be somewhat expected with a language pre 1.0 |
04:10:31 | FromGitter | <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:19 | FromGitter | <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:24 | FromGitter | <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:30 | shashlick | well, 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:40 | shashlick | as a lib builder, it is much harder since you have to offer backwards compatibility somehow |
05:02:47 | FromGitter | <zacharycarter> true |
05:03:41 | shashlick | but 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:36 | Araq | shashlick: morning, please share your frustrations with us |
05:06:12 | Araq | IMO the non-nil thing was totally worth it |
05:06:48 | FromGitter | <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:01 | shashlick | but 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:28 | shashlick | Araq: sorry, don't mean to stink up your Saturday morning 🙂 |
05:08:06 | shashlick | I 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:53 | shashlick | but I wonder how to reduce the pain and effort of maintaining the ecosystem |
05:08:57 | FromGitter | <zacharycarter> I guess it's time for me to go to bed :P |
05:09:35 | FromGitter | <zacharycarter> if folks in Europe are up now - it means I'm up too late |
05:09:45 | FromGitter | <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:08 | FromGitter | <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:41 | nc-x | What 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:38 | Araq | https://www.youtube.com/watch?v=yy8jQgmhbAU |
06:27:55 | * | narimiran joined #nim |
06:28:11 | FromGitter | <alehander42> ha, the guy is from a bg game company, neat |
06:39:18 | FromGitter | <alehander42> aos vs soa is an interesting problem, haven't heard of it outside of gamedev until now |
06:41:41 | FromGitter | <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:00 | Araq | I would solve with it a bunch of accessor templates |
06:42:29 | Araq | C++ lacking properties makes this a bit annoying with all its () |
06:46:51 | Araq | mutation 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:39 | FromGitter | <alehander42> yeah, I don't doubt in Nim this is achievable |
06:50:01 | FromGitter | <alehander42> I wondered how hard is it in C++ as I don't have so much xp with it |
06:50:17 | FromGitter | <alehander42> the `()` are a con indeed |
06:50:32 | Araq | but 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:12 | FromGitter | <alehander42> hm, this makes sense |
06:52:23 | FromGitter | <alehander42> but still, this would be very hardware-platform-specific |
06:52:38 | Araq | hmm the used addresses are 8, 16, 64, 72, 120, 128, try to see the pattern at runtime |
06:52:50 | FromGitter | <alehander42> so it's good to have this customizable somewhere in your own code |
06:53:01 | Araq | seems to be just a little oversight in today's hardware design |
06:53:48 | FromGitter | <alehander42> I agree |
06:55:35 | Araq | that's just a Column-oriented DBMS |
06:55:56 | Araq | very useful for sure but hasn't won everywhere |
06:56:05 | FromGitter | <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:29 | FromGitter | <alehander42> hardware progress trickles down slowly |
06:58:34 | FromGitter | <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:46 | Araq | hardware progress much faster than software |
07:00:32 | * | mech422__ joined #nim |
07:03:33 | * | mech422_ quit (Ping timeout: 252 seconds) |
07:04:40 | Araq | https://github.com/nim-lang/Nim/issues/7441 another try to get somebody involved who knows about Chinese |
07:11:21 | FromGitter | <technicallyagd> A problem only on Windows? |
07:11:33 | Araq | yup |
07:11:50 | Araq | Windows's Unicode/Console handling is a clusterfuck |
07:14:51 | FromGitter | <technicallyagd> lol because most developers on windows usually use an full fledged IDE? |
07:19:57 | * | Vladar joined #nim |
07:33:27 | FromGitter | <alehander42> Araq yes, but it trickles down slowly: you don't get your new CPU until you buy a new computer |
07:33:41 | FromGitter | <alehander42> but maybe people upgrade their computers more often than I think |
07:34:09 | Araq | smartphones don't age well |
07:34:51 | Araq | and progamers on PCs don't mind buying a new PC if it means a 6x out of the box performance improvement |
07:36:11 | Araq | or even a factor of 2 for non-threaded ordinary OOP-ish code would sell new PCs |
07:36:40 | Araq | but probably it's hard to redesign how cache lines work :-) |
07:36:49 | FromGitter | <alehander42> well, if the speedup is big enough, somebody would've done it if there is demand |
07:37:12 | FromGitter | <alehander42> you have to keep this moore law running somehow |
07:37:14 | Araq | well the data-driven design people argue that it has been overlooked |
07:37:31 | FromGitter | <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:30 | FromGitter | <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:46 | narimiran | first two :) |
08:57:46 | narimiran | first remove that "of" in matches, replace it with indents. of course :) |
08:58:42 | narimiran | btw, 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:07 | FromGitter | <alehander42> oh great, please open issues if you hit any bugs, that's exactly what I need to fix for 1.0 |
09:01:42 | narimiran | will do |
09:02:11 | FromGitter | <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:21 | FromGitter | <alehander42> es modules* |
09:03:00 | Araq | update py2nim first |
09:03:08 | Araq | so that it works with 0.19 |
09:03:16 | Araq | and then JS sourcemaps |
09:03:34 | narimiran | oh, it doesn't work with 0.19? then yeah, that should be the priority, definitely |
09:04:15 | narimiran | btw, Araq, will we see 0.19.2 soon? (let's say, after the hacktoberfest is over) |
09:05:04 | Araq | ask kaushalmodi |
09:05:43 | narimiran | @kaushalmodi will we see 0.19.2 soon? (let's say, after the hacktoberfest is over) |
09:08:21 | FromGitter | <alehander42> Araq, so about https://github.com/nim-lang/Nim/pull/7508#issuecomment-381313318 still OK for the bigger refactoring? |
09:12:51 | Araq | depends on what that means, I generally want every codegen to be an AST to AST transformation |
09:22:48 | FromGitter | <alehander42> I am not quite sure what I meant |
09:23:07 | FromGitter | <alehander42> but I guess that I wanted to build the sourcemap recursively while traversing the AST |
09:23:38 | FromGitter | <alehander42> so probably I planned on building it while generating the code |
09:24:01 | * | narimiran quit (Quit: Konversation terminated!) |
09:25:27 | FromGitter | <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:27 | FromGitter | <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:30 | FromGitter | <alehander42> yes, that was it |
09:28:16 | Araq | well that's my AST to AST transformation then |
09:28:55 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bd42fd7c7bf7c3662798311] |
09:42:00 | dom96 | oooh |
09:42:09 | * | wildlander joined #nim |
09:42:12 | dom96 | The Digital Ocean guys included us in their Hacktoberfest reminder email :D |
09:43:15 | * | narimiran joined #nim |
09:46:44 | narimiran | whoever 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:52 | dom96 | Yeah. Praise to that person... wait a minute, wasn't that you? :P |
09:51:18 | narimiran | wow, 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:21 | Araq | narimiran[m]: thanks, it is awesome :-) |
10:44:15 | FromGitter | <alehander42> nice, narimiran! |
10:44:58 | FromGitter | <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:12 | FromGitter | <mratsim> @alehander42 there is this SOA vs AOS vs AOSOA in scientific computing as well. |
11:39:44 | FromGitter | <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:25 | FromGitter | <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:36 | FromGitter | <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:29 | FromGitter | <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:48 | FromGitter | <tim-st> (I assume) |
12:36:55 | FromGitter | <alehander42> you can use a github url |
12:37:18 | FromGitter | <alehander42> git* |
12:37:52 | FromGitter | <tim-st> when I do this what would be the installed package name? |
12:38:39 | FromGitter | <tim-st> e.g. for `https://github.com/tim-st/nim-lzma` it would be `lzma` ? |
12:38:55 | FromGitter | <Vindaar> @tim-st yes |
12:39:06 | FromGitter | <tim-st> there are multiple packages named lzma |
12:39:48 | FromGitter | <tim-st> golang solves it by installing it to complete url |
12:44:29 | Araq | Nimble solves this by allowing complete URLs as dependencies |
12:44:55 | FromGitter | <tim-st> so I can do `import https://github.com/tim-st/nim-lzma` ? |
12:47:13 | dom96 | no, you put `requires https://github.com/tim-st/nim-lzma` in your .nimble file |
12:47:16 | dom96 | Then `import lzma` |
12:47:32 | dom96 | Compile using `nimble c ...` or `nimble build` and you'll get the right package |
12:47:53 | FromGitter | <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:08 | dom96 | Nimble passes the package paths to Nim |
12:48:23 | FromGitter | <tim-st> ok, perfect, thanks :) |
12:53:21 | FromGitter | <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:58 | FromGitter | <tim-st> it has same name and same version^^ |
12:56:13 | dom96 | yeah, that's tricky |
12:56:20 | dom96 | I would honestly suggest naming your package something else |
12:57:18 | FromGitter | <tim-st> yeah, but when there are more packages they will have same names |
12:57:29 | FromGitter | <tim-st> (I mean also regarding future) |
13:00:02 | FromGitter | <alehander42> I don't get it, do you use different versions of them in the same time |
13:00:33 | FromGitter | <alehander42> doesn't nimble has the option of per-project `.nimble/` pkgs? |
13:01:18 | FromGitter | <tim-st> I'm testing it at the moment if it actually works or not |
13:08:54 | FromGitter | <tim-st> no, it doesnt work... |
13:09:21 | FromGitter | <tim-st> try this to reproduce: |
13:09:28 | FromGitter | <tim-st> `nimble install https://github.com/ephja/lzma` |
13:09:41 | FromGitter | <tim-st> then: `nimble install https://github.com/tim-st/nim-zim@#nimble-same-name` |
13:31:09 | FromGitter | <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:40 | dom96 | https://github.com/nim-lang/Nim/blob/devel/lib/core/macrocache.nim |
13:34:45 | dom96 | You can use that |
13:35:44 | FromGitter | <yyyc514> " Starting with version 0.19 of Nim this is not directly supported anymore" |
13:35:46 | FromGitter | <yyyc514> nope |
13:36:01 | FromGitter | <yyyc514> oh wait |
13:36:15 | FromGitter | <yyyc514> not very clear |
13:37:11 | FromGitter | <yyyc514> i was trying to declare a proc with the data compileTime, should that not work? |
13:39:29 | FromGitter | <yyyc514> this doesn’t even necessarly need to cross module boundaries |
13:39:39 | FromGitter | <yyyc514> i’m trying to describe a data model then iterate over it |
13:44:39 | FromGitter | <yyyc514> it was working when i used a global const but now i’m trying to group things a bit better |
13:49:11 | FromGitter | <dawkot> Hello, does anyone know what could cause an error like this on a simple hello world program? |
13:49:19 | FromGitter | <dawkot> ```code paste, see link``` |
13:50:13 | FromGitter | <dawkot> https://pastebin.com/84G46ZF8 |
13:51:42 | FromGitter | <dawkot> oh, threads being enabled caused it |
13:52:25 | dom96 | yyyc514: heh, I read it the same way. Definitely needs to be reworded |
13:53:57 | FromGitter | <mratsim> @yyyc514 the macro should take a `macro foo(x: static YourType)` parameter |
13:54:25 | FromGitter | <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:24 | FromGitter | <yyyc514> @mratsim The type can vary, this is a ORM |
13:55:25 | FromGitter | <kaushalmodi> Hmm, why ask me for 0.19.2 release? :) |
13:55:28 | FromGitter | <yyyc514> macro loadAll*T (p: T) : untyped = |
13:55:46 | FromGitter | <yyyc514> @mratsim I need my own list the fields of the object contain extra internal fields |
13:55:58 | FromGitter | <yyyc514> that’s good to know though |
13:57:07 | FromGitter | <yyyc514> adding static just gets "Error: cannot generate VM code for T" |
13:57:23 | FromGitter | <mratsim> there is no generic macro |
13:57:32 | FromGitter | <mratsim> p: typed is what you want |
13:58:04 | FromGitter | <mratsim> and getTypeImpl(p) in the macro i guess |
13:58:49 | FromGitter | <kaushalmodi> Btw thanks @dom96 and @Araq for approving my `dumpLisp` PR. That was, I believe, my most serious contrib to Nim. |
13:58:59 | Araq | kaushalmodi: cause you're the automated builds man |
13:59:11 | dom96 | Awesome :) |
13:59:46 | FromGitter | <kaushalmodi> seriousness == non-doc loc |
14:00:00 | FromGitter | <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:30 | FromGitter | <mratsim> there is even an ORM example |
14:01:27 | FromGitter | <kaushalmodi> @Araq the builds seem to be working, except that it looks like I cannot uniquify the release archive names |
14:01:58 | Araq | what about the appveyor builds? |
14:02:06 | FromGitter | <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:19 | FromGitter | <yyyc514> @mratsim Ok that’s cool but i’m not sure how i’d use that |
14:02:37 | FromGitter | <kaushalmodi> I am looking only at Travis as I am not acquainted with Windows builds |
14:02:47 | FromGitter | <yyyc514> oh it it just saying they’d show up in the ASt? |
14:03:07 | FromGitter | <yyyc514> that i understand |
14:03:08 | FromGitter | <kaushalmodi> You said that you figured out some script issue that's failing Appveyor? |
14:10:55 | Araq | no I said my script is just wrong but I don't know how it is supposed to look like |
14:13:28 | FromGitter | <tim-st> what does nimbles error `Error: 'hg' not in PATH.` mean? |
14:15:37 | FromGitter | <tim-st> ok, it seems I need this https://www.mercurial-scm.org/ |
14:17:14 | narimiran | so, @kaushalmodi, 0.19.2 next weekend? :) |
14:19:38 | FromGitter | <kaushalmodi> I honestly haven't looked into Appveyor/Windows builds ever. |
14:20:34 | FromGitter | <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:40 | FromGitter | <yyyc514> if i include a import over and over what is the scope of top-level things declared? |
14:22:51 | FromGitter | <yyyc514> are they unique or the same for every file imported into? |
14:26:09 | FromGitter | <mratsim> if you import multiple time the same module it’s the same as importing it once |
14:26:44 | FromGitter | <dawkot> is it normal for nim to complain about expecting cstring where kstring is used? |
14:27:05 | FromGitter | <dawkot> code just works because both are the same when compiled to js target |
14:28:27 | FromGitter | <yyyc514> @mratsim but if i use a global variable for macro help effectively it’d be unique during the parsing, or no? |
14:28:40 | FromGitter | <yyyc514> ie `var currentModel {.compileTime} : string = “"` |
14:29:03 | FromGitter | <mratsim> in the imported modules? I don’t think so but i never tried |
14:29:12 | FromGitter | <alehander42> @yyyc514 I was also thinking of an orm last week, it will be interesting to compare |
14:29:28 | FromGitter | <yyyc514> well mine is pretty bare bones so far |
14:29:36 | FromGitter | <yyyc514> i just want to save/load/access fields :) |
14:29:40 | FromGitter | <alehander42> mine is thought-only so far |
14:30:25 | FromGitter | <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:45 | FromGitter | <yyyc514> in a macro if i type a string is there anyway to turn it into an enum value? |
14:31:11 | FromGitter | <yyyc514> i have an ident “dbSerial” and what I want is the actual dbSerial |
14:31:21 | FromGitter | <yyyc514> at compile time |
14:37:38 | FromGitter | <tim-st> is the following nimble syntax allowed? `requires "https://github.com/user/package@#branchname"` |
14:41:36 | dom96 | remove the @ |
14:42:13 | FromGitter | <tim-st> dom96: thanks, when I install @ head i always use the @ :\ |
14:43:36 | dom96 | The @ is only necessary on the command line |
14:44:05 | FromGitter | <tim-st> yeah, I realized that it doubles the @ in the required block |
14:45:27 | FromGitter | <tim-st> thanks, it works now. Now the final tests what happens with a newer same named version |
14:46:25 | FromGitter | <yyyc514> trying to do something simple like save a list of DbTypeKind at ocmpile time to a compile time variable |
14:49:23 | FromGitter | <yyyc514> building an ORM and web framework probably not a great first project learning nim lol |
14:50:29 | FromGitter | <alehander42> you're doing great! |
14:50:37 | FromGitter | <alehander42> :D we need some web framework competition |
14:51:55 | FromGitter | <yyyc514> so any idea how to turn “dbSerial” into dbSerial? |
14:52:37 | FromGitter | <alehander42> well, use a table |
14:52:42 | * | krux02 joined #nim |
14:53:15 | FromGitter | <yyyc514> ugh, is that the only way? |
14:53:54 | FromGitter | <yyyc514> something like `set_fields @["paste_id", “body”… ` easily works because it’s easy to turn strings into string in macros |
14:53:59 | FromGitter | <yyyc514> but not `set_types @[dbInt, dbVarchar,…` |
14:54:36 | FromGitter | <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:58 | FromGitter | <alehander42> well isn't this DbTypeKind just an enum with several values |
14:58:02 | FromGitter | <alehander42> this is the simplest |
14:58:13 | FromGitter | <yyyc514> right |
14:58:40 | FromGitter | <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:53 | FromGitter | <yyyc514> sounds ugh |
14:59:02 | FromGitter | <yyyc514> feel like i’m missing something |
15:01:10 | FromGitter | <alehander42> ok, you're right |
15:01:15 | FromGitter | <alehander42> if you know the enum type |
15:01:29 | FromGitter | <alehander42> it should be possible to map them with a helper macro |
15:01:40 | FromGitter | <alehander42> accessing the type as `typed` arg |
15:01:53 | FromGitter | <alehander42> it can iterate through the enum values |
15:02:04 | FromGitter | <alehander42> and check which of them has the same string repr |
15:02:13 | FromGitter | <alehander42> this should work for all enum types |
15:02:19 | FromGitter | <alehander42> i guess that's what json does |
15:02:24 | FromGitter | <yyyc514> well i think it’d be a proc running at compile time |
15:02:30 | FromGitter | <yyyc514> but yeah thanks to DbTypeKind(0) == string |
15:02:39 | FromGitter | <yyyc514> or at least $ works on it |
15:02:58 | FromGitter | <alehander42> well, that's actually even simpler indeed |
15:03:07 | FromGitter | <alehander42> great |
15:04:54 | FromGitter | <citycide> @yyyc514 I think maybe you need `parseEnum` from strutils? |
15:05:23 | FromGitter | <yyyc514> lol, does it already exist? looking |
15:05:53 | FromGitter | <yyyc514> lol |
15:05:54 | FromGitter | <yyyc514> great |
15:07:19 | FromGitter | <yyyc514> well and finally :) |
15:07:22 | FromGitter | <yyyc514> @citycide thanks! |
15:11:33 | FromGitter | <citycide> Sure thing |
15:11:58 | narimiran | nim doc throws an error when it gets to the line which is `#################` |
15:13:02 | narimiran | solved by having `# ###########`, but even still.... |
15:13:40 | FromGitter | <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:54 | FromGitter | <alehander42> oh parseEnum, cool ! |
15:14:56 | FromGitter | <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:04 | narimiran | also, nim doc somehow outputs "An alias for countup(a, b, 1)." as a documentation for one my function without any docstring! wtf? |
15:15:29 | FromGitter | <alehander42> narimiran `####` is a backdoor ! |
15:16:05 | FromGitter | <alehander42> Araq, it would be cool to make `-d:banksy`which destroys random parts of the source files instead of compiling |
15:16:51 | FromGitter | <kaushalmodi> narimiran: https://github.com/nim-lang/Nim/issues/9432 |
15:19:01 | Araq | yyyc514: look at Ormin for inspiration |
15:19:20 | narimiran | @kaushalmodi thanks, will write there too |
15:20:24 | FromGitter | <kaushalmodi> narimiran: yeah, you can add your minimal reproducible example there which could serve as another test case |
15:21:02 | FromGitter | <kaushalmodi> see my test case in https://github.com/nim-lang/Nim/issues/9432#issuecomment-431155362 |
15:21:28 | FromGitter | <yyyc514> yeah an ORM is a bit more than SQL satement generation :) |
15:21:40 | narimiran | i cannot have such a minimal (but working) example, unfortunately |
15:21:40 | FromGitter | <yyyc514> sql is the last of my problems right now :) |
15:26:05 | FromGitter | <alehander42> ormin is pretty nice, but I want to use my types as a base instead of the sql tables |
15:27:04 | FromGitter | <yyyc514> yeah i want to encode the db format in the code instead of loading it from the DB (ala rails) |
15:27:20 | dom96 | citycide: there is an http client regression in Nim 0.19.0 |
15:27:27 | dom96 | You might be hitting it there |
15:27:47 | * | vlad1777d_ joined #nim |
15:29:17 | FromGitter | <alehander42> I also want to try to use the repo pattern, I don't really want to reimplement activerecord |
15:31:20 | FromGitter | <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:34 | dom96 | In what way is it failing? |
15:32:22 | FromGitter | <citycide> https://ptpb.pw/bHZT |
15:35:32 | FromGitter | <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:03 | FromGitter | <citycide> thanks windows |
15:37:31 | shashlick | Must be nimsuggest |
15:37:47 | shashlick | Your editor still open? |
15:38:18 | FromGitter | <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:50 | shashlick | Well if you ran vscode and then switched with choosenim after the fact, it might still be using the devel binaries |
15:40:28 | FromGitter | <citycide> not sure, I've had code open for days :) |
15:41:13 | FromGitter | <citycide> dom96: repro still fails on devel |
15:41:35 | FromGitter | <citycide> I can file an issue |
15:41:37 | shashlick | dom96: 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:53 | FromGitter | <citycide> well not fails but it "succeeds" and doesn't have any output |
15:42:35 | narimiran | shashlick: https://github.com/dom96/choosenim/pull/95#issuecomment-432801256 |
15:43:50 | narimiran | but if we're doing 0.19.2 soon, it might be a nice timing to update choosenim too |
15:44:38 | shashlick | Well again I feel we can release more often |
15:45:03 | shashlick | Happy to help with releases if dom96 let's me know the process |
15:45:18 | shashlick | I think he builds on xp? |
15:48:16 | shashlick | Might need to look into musl to make life easier on Linux |
15:54:24 | * | nc-x joined #nim |
15:56:47 | nc-x | Araq: 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:44 | nc-x | And 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:52 | dom96 | shashlick: Yeah, I build on XP in a VM |
16:09:54 | dom96 | It's a pain |
16:10:40 | dom96 | I cycle between my projects and only release after I have had time to do some significant dev |
16:12:18 | shashlick | I'm happy to help with such stuff |
16:12:37 | shashlick | I feel choosenim should move faster since even minor improvements will help the community |
16:13:28 | shashlick | Say that binary build install PR, or perhaps a devel update with git pull rather than full rebuild |
16:13:32 | dom96 | Sure, all help welcome |
16:13:51 | dom96 | All I need to do is update a file in nim-lang.org |
16:13:55 | dom96 | when a release happens |
16:15:57 | dom96 | In fact, my travis config already uploads the binaries |
16:16:03 | dom96 | on a release |
16:16:23 | dom96 | Now that Travis supports Windows it may just be a case of turning that on |
16:16:28 | dom96 | PRs welcome :) |
16:16:44 | shashlick | Ok so when you get a chance, can you share your release process for both win and Lin |
16:17:32 | FromGitter | <alehander42> btw nice wrappers shashlick, I found only today the whole suite |
16:20:21 | dom96 | shashlick: There isn't much to it, I tag a release. Travis builds the Linux/OSX binaries for me. |
16:20:36 | dom96 | I build the Windows binary in a VM and package it up into a self-extracting .exe and .zip files |
16:20:47 | dom96 | Then I upload it to GitHub |
16:28:08 | FromGitter | <yyyc514> so if i want to instrument the DB stuff do i have to wrap all the library functions completely? |
16:29:00 | FromGitter | <yyyc514> or rewrite them? |
16:43:45 | FromGitter | <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:31 | FromGitter | <yyyc514> hmmm or maybe not |
16:49:29 | dom96 | are you writing an ORM? :O |
16:51:07 | FromGitter | <yyyc514> that’s the idea |
16:51:15 | FromGitter | <yyyc514> or the beginnings of one at least |
16:51:50 | dom96 | Awesome! |
16:52:17 | * | platoff joined #nim |
16:54:02 | dom96 | I'm not 100% sure about your question, but the macro cache is pretty flexible |
16:54:07 | dom96 | You should be able to use it for this |
16:54:15 | dom96 | What do you need the cache for though? |
16:58:22 | FromGitter | <yyyc514> right now trying to figure out simple stuff like a model keeping track of it’s fields and referencing them later |
17:05:31 | FromGitter | <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:45 | FromGitter | <yyyc514> so much uglier than like my find() which doesn’t need to be deferred |
17:08:42 | FromGitter | <yyyc514> actually grrr, find is referrings the same variables |
17:10:49 | FromGitter | <alehander42> are you asking about the db_ |
17:10:51 | FromGitter | <alehander42> modules? |
17:11:03 | FromGitter | <alehander42> it would be great to reuse them |
17:12:11 | FromGitter | <alehander42> but they basically help with connection and returning raw results |
17:12:13 | FromGitter | <yyyc514> looks like to add instrumenttion you’d have to copy and paste them and rewrite them |
17:12:27 | FromGitter | <alehander42> in my ORM I am planning on adding custom sql generators for each one |
17:12:38 | FromGitter | <alehander42> mostly sharing code |
17:14:07 | FromGitter | <alehander42> maybe I am not sure about which instrumentation are you talking |
17:16:58 | * | krux02 quit (Remote host closed the connection) |
17:18:29 | FromGitter | <alehander42> what would be your queries actually? e.g. insert |
17:21:17 | FromGitter | <yyyc514> huh? |
17:21:36 | FromGitter | <yyyc514> i want to instrument the queries, log them, time them, etc... |
17:22:01 | FromGitter | <alehander42> well, your code generates and executes the queries |
17:22:33 | FromGitter | <alehander42> I don't understand why would you need to rewrite the db_ modules |
17:22:42 | FromGitter | <yyyc514> so you can instrument them |
17:22:51 | FromGitter | <yyyc514> because they bury the SQL generation |
17:23:00 | FromGitter | <alehander42> eh? |
17:23:19 | FromGitter | <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:33 | FromGitter | <yyyc514> so there is no easy way to wrap the library |
17:24:51 | * | platoff quit (Ping timeout: 252 seconds) |
17:25:52 | FromGitter | <alehander42> huh, I just found db_common |
17:25:56 | FromGitter | <alehander42> useful |
17:26:17 | FromGitter | <alehander42> well, you can directly exec the dbFormat result? |
17:26:44 | FromGitter | <yyyc514> then you have to rewrite the insertID stuff :) |
17:28:04 | FromGitter | <alehander42> yeah, btw I used getRow(" ... ... RETURNING id")[0].parseInt for this |
17:28:06 | FromGitter | <alehander42> until now :D |
17:28:18 | FromGitter | <alehander42> but insertID is very simple |
17:28:33 | FromGitter | <alehander42> it's not perfect, but you can single-case it |
17:29:07 | * | kapil____ quit (Quit: Connection closed for inactivity) |
17:29:40 | FromGitter | <tim-st> Ideas? https://github.com/nim-lang/nimble/issues/573 |
17:29:56 | * | nsf quit (Quit: WeeChat 2.2) |
17:30:21 | FromGitter | <alehander42> I wonder more if dbQuote is robust enough |
17:30:35 | FromGitter | <alehander42> but if you have something that sanitizes args correctly |
17:31:00 | FromGitter | <alehander42> you can dbFormat with it, and then reuse the query |
17:32:12 | FromGitter | <alehander42> you can also directly PR the stdlib if this is not sufficient |
17:32:24 | FromGitter | <yyyc514> yeah i can’t do it like i want *blah* |
17:32:44 | FromGitter | <yyyc514> can’t use compiel tile variables in the model eacuse they get clobbered with multiple model |
17:32:55 | FromGitter | <yyyc514> if you have the source in the model module file itself |
17:33:21 | FromGitter | <yyyc514> maybe you have to generate it all with macros completely? |
17:33:24 | Araq | *cough* Ormin |
17:33:30 | FromGitter | <yyyc514> not helpful |
17:33:50 | Araq | it is, it asks the right questions and the implementation is pretty cool too |
17:34:13 | FromGitter | <yyyc514> i looked, it’s not really an ORM imho |
17:34:28 | FromGitter | <alehander42> it is an ORM of course |
17:34:30 | FromGitter | <yyyc514> i ant to declare typs and then Paste.find paste.destroy etc |
17:34:37 | FromGitter | <alehander42> this is just the rails orm |
17:34:48 | Araq | I don't care about terminology |
17:34:49 | FromGitter | <alehander42> there are a lot of ORM designs |
17:35:10 | FromGitter | <yyyc514> well i’m trying to write mine :) |
17:35:23 | FromGitter | <alehander42> great, but you're incorrect about ormin |
17:35:36 | Araq | Ormin is typesafe and has no overhead and it respects the DB technology |
17:35:56 | FromGitter | <yyyc514> i think i got too far without trying to do multi-model |
17:36:26 | * | hoijui joined #nim |
17:36:39 | Araq | I 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:59 | dom96 | Araq: why does strutils disable line trace? |
17:37:36 | dom96 | Is it just that the nimln() calls add too much overhead for such a heavily used module? |
17:38:46 | FromGitter | <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:07 | FromGitter | <alehander42> and I feel the foreign key thing is a moot point: even if you load them from a model |
17:39:16 | FromGitter | <alehander42> you still need to describe them somehow in a typesafe way |
17:39:20 | FromGitter | <alehander42> to map them to something |
17:40:26 | Araq | dom96: it's a mistake, the .push should only refer to cmpIgnoreStyle |
17:40:33 | dom96 | ahh, cool |
17:40:34 | Araq | but code got edited :P |
17:40:36 | dom96 | I'll make a PR |
17:40:41 | Araq | ok thanks. |
17:40:49 | dom96 | Can we also add an indicator for tracebacks? |
17:40:59 | dom96 | That the line number is missing because line tracing is off? |
17:41:08 | Araq | RFC: push/pop is error prone, replace with a pushPragma block |
17:41:28 | dom96 | Seeing `a8.nim (LF:OFF)` would already be much better than `a8.nim` |
17:41:38 | dom96 | Where even you have no idea whether it's a bug or not |
17:41:55 | Araq | use nimfix2 on every Nim codebase out there to patch your .push/pops |
17:42:02 | Araq | ok enough of this. |
17:42:22 | Araq | well if line info is turned off we don't know about LF:OFF |
17:42:39 | Araq | but maybe I'm not creative enough... |
17:43:33 | Araq | alehander42: maybe but I also have 'create index' statements that Ormin can simply ignore |
17:43:35 | dom96 | We're generating calls to nimfr anyway |
17:43:56 | Araq | huh, do we... |
17:44:12 | dom96 | yeah, otherwise why would there be an entry in the stack trace at all? |
17:44:22 | dom96 | Btw I'm getting "Error: {.pop.} without a corresponding {.push.}" :/ |
17:44:51 | FromGitter | <alehander42> well, this is an optimization which can be configured separately |
17:44:51 | dom96 | oh |
17:44:57 | FromGitter | <alehander42> (createIndex) |
17:44:57 | dom96 | it pops everything :( |
17:45:08 | FromGitter | <alehander42> we need a popBot |
17:46:02 | FromGitter | <alehander42> and I think foreign key relations can be described fine, but my plan includes using a `models:` macro anyway |
17:46:20 | Araq | alehander42: well model generation from Nim code can also be added to Ormin |
17:46:33 | dom96 | Oh right, it was a pop but really far down |
17:46:46 | FromGitter | <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:52 | Araq | I'm not opposed to it but Ormin is useful without it too |
17:47:37 | Araq | alehander42: "no" for now but I'll consider it after v1 |
17:47:44 | dom96 | I would definitely say "no" for now |
17:47:49 | dom96 | and possibly in future too |
17:49:48 | Araq | well I like the proposal, but it's just sugar we can live without |
17:50:06 | Araq | type sections are super unlispy though |
17:50:12 | Araq | and can be improved |
17:51:53 | FromGitter | <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:39 | Araq | too much Pascal influence plus type sections are special because only in them you are allowed to write cycles |
17:53:39 | FromGitter | <alehander42> yeah the macros might be too much for now (but each macro hook prevents some future backward incompatible changes) |
17:54:04 | FromGitter | <alehander42> I originally wanted to directly RFC a new `data` or `variant` keyword |
17:54:09 | FromGitter | <alehander42> but I thought macros have a better chance |
17:54:17 | FromGitter | <alehander42> ah yeah, the cycles |
17:56:27 | theelous3 | hi, 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:39 | theelous3 | wow I mangled that sentence |
17:56:40 | theelous3 | :D |
17:57:15 | FromGitter | <alehander42> you need a generic function |
17:58:26 | FromGitter | <alehander42> are the elements in the list with the same type ? |
17:58:35 | FromGitter | <tim-st> theelous3: proc test(s: seq) = echo s.len; test(@[1,2,3]) |
17:58:57 | theelous3 | well, 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:10 | theelous3 | at least the sequence section doesn't mention they have to all be of the same type |
17:59:11 | FromGitter | <tim-st> it must be the same type |
17:59:13 | theelous3 | ok |
17:59:40 | theelous3 | well, I don't understand the question then, of "are the elements the same type" |
17:59:44 | FromGitter | <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:58 | narimiran | theelous3: you cannot have @[1, 2.4, "foo"] |
18:00:12 | theelous3 | I gettcha |
18:00:25 | theelous3 | I could have a list of refs to different things of different types |
18:00:27 | theelous3 | but that's bad? |
18:00:35 | narimiran | btw, to get the last element of xs, you can just do xs[^1] |
18:00:40 | FromGitter | <tim-st> yes, the safety is gone then |
18:00:46 | theelous3 | :) |
18:01:07 | FromGitter | <tim-st> have a look at object variant, json or you can chose a better style to use same type seq |
18:01:08 | theelous3 | so by "generic" I can simply leave out the typing |
18:02:11 | FromGitter | <alehander42> not exactly, you can reuse the same function for different types |
18:02:17 | FromGitter | <alehander42> e.g. proc(e: seq[T]) |
18:02:35 | FromGitter | <alehander42> `proc fT (e: seq[T])` |
18:02:35 | * | elrood quit (Quit: Leaving) |
18:02:43 | FromGitter | <alehander42> can be called for |
18:02:46 | FromGitter | <alehander42> seq[int] |
18:02:48 | FromGitter | <alehander42> seq[float] |
18:02:51 | FromGitter | <alehander42> seq[whatever] |
18:03:08 | theelous3 | is T an actual thing here, meaning 'of whatever type'? |
18:03:15 | FromGitter | <alehander42> yes |
18:03:23 | FromGitter | <alehander42> but all the elements of the seq need to be the same T |
18:03:45 | FromGitter | <tim-st> and T has to be clear at compile time |
18:03:47 | theelous3 | so `proc lastElm(xs: seq) =` is not valid? |
18:04:01 | FromGitter | <tim-st> it is valid |
18:04:10 | FromGitter | <tim-st> but not for mixed seq like @[1, "abc"] |
18:04:30 | dom96 | I feel like you guys are going off on a tangent here |
18:04:32 | theelous3 | what is the difference between the seq[T] example and the bare seq |
18:04:35 | FromGitter | <alehander42> it means the same thing |
18:04:41 | FromGitter | <alehander42> it's just a shorter notation |
18:04:47 | theelous3 | ok :) |
18:04:52 | dom96 | `seq` is a typeclass |
18:04:55 | dom96 | It's not exactly the same |
18:05:05 | FromGitter | <alehander42> well, it's an initial explanation |
18:05:10 | FromGitter | <tim-st> [T] is more often used |
18:05:30 | dom96 | It's better to be more explicit with seq[T] |
18:05:33 | theelous3 | roger |
18:05:35 | dom96 | and most of us will use that notation |
18:05:48 | theelous3 | for my return type for lastElm, should I also use T? |
18:05:55 | FromGitter | <alehander42> yes |
18:05:59 | theelous3 | proc lastElm(xs: seq[T]): t = |
18:06:02 | theelous3 | like so |
18:06:09 | theelous3 | oops, T no t |
18:06:19 | FromGitter | <tim-st> proc lastElmT (xs: seq[T]): T = I think |
18:06:33 | theelous3 | seemsgood |
18:06:35 | dom96 | proc lastElm[T](xs: seq[T]): T |
18:06:41 | dom96 | FromGitter relay eats the brackets |
18:06:46 | narimiran | that's lastElm[T], theelous3, gitter strips brackets sometimes |
18:06:49 | FromGitter | <alehander42> no gitter also kills it |
18:06:54 | theelous3 | oh huh |
18:06:54 | FromGitter | <alehander42> you need to quote it |
18:07:17 | FromGitter | <alehander42> `proc lastElmT (xs: seq[T]): T` |
18:07:25 | theelous3 | what's the [T] between lastElm and (xs: seq[T]) there |
18:07:32 | theelous3 | ok |
18:07:34 | dom96 | That's the generic definition |
18:07:36 | FromGitter | <alehander42> it tells Nim T is a generic argument |
18:07:47 | dom96 | You can name it whatever you want |
18:07:50 | FromGitter | <tim-st> it's called generics^^ |
18:07:50 | theelous3 | ah, so T as a char |
18:07:51 | theelous3 | yeah |
18:08:02 | dom96 | proc lastElm[MySeqElem](xs: seq[MySeqElem]): MySeqElem |
18:08:07 | oprypin | FromGitter doesn't escape markdown, which can actually be useful, but then there's that |
18:08:18 | theelous3 | so I can put whatever there, like proc lastElm[XXX](xs: seq[XXX]): XXX = |
18:08:27 | oprypin | Gitter users need to be mindful not to edit messages, and IRC users need to be mindful about Markdown |
18:08:36 | dom96 | oprypin: I consider that a bug :P |
18:08:43 | FromGitter | <alehander42> wow the fromgitter guy himself |
18:08:54 | FromGitter | <alehander42> theeolous3 yep |
18:08:57 | theelous3 | sweet |
18:09:19 | theelous3 | T by convention though I take it |
18:09:30 | dom96 | yeah |
18:09:31 | theelous3 | what about multiple generics? |
18:09:41 | FromGitter | <tim-st> `[A, B]` |
18:09:44 | dom96 | T, U |
18:09:47 | theelous3 | I presume we don't start walking the alphabet from T? |
18:09:49 | theelous3 | or we do? |
18:10:00 | FromGitter | <alehander42> actually many people do |
18:10:14 | theelous3 | fair enough :D It'll improve my alphabet skills |
18:10:19 | dom96 | For some reason the convention is T, U, V |
18:10:26 | dom96 | or maybe T, V, U |
18:10:31 | FromGitter | <alehander42> no no no |
18:10:34 | FromGitter | <alehander42> T U V |
18:10:37 | theelous3 | if a cop ever asks me to start the alphabet at a strange location I'll blow him out of the water |
18:10:40 | dom96 | Feel free to use A, B, C too though |
18:10:47 | FromGitter | <alehander42> or maybe Т У Ф |
18:10:57 | theelous3 | unicode train picture |
18:10:59 | theelous3 | gottcha |
18:11:05 | theelous3 | pictures* |
18:11:10 | FromGitter | <alehander42> oh cmon man, doesn't irc support cyrillic |
18:11:25 | theelous3 | it does lol |
18:11:35 | theelous3 | I was just suggesting a language agnostic alternative |
18:11:47 | theelous3 | pictures of trains for clarity and inclusion |
18:12:03 | FromGitter | <alehander42> i am only happy when it trains |
18:13:04 | narimiran | purple train? |
18:14:59 | theelous3 | do people get upset if code is 4 spaced? |
18:15:17 | theelous3 | is the 2 space convention strong? |
18:15:21 | FromGitter | <alehander42> we just get sad |
18:15:21 | narimiran | much less than when i see space before a colon ;) |
18:15:35 | theelous3 | :D |
18:15:51 | narimiran | theelous3: give 2 spaces a try. do it for a week, and then (try to) go back ;) |
18:16:04 | dom96 | #2Spaces4Life |
18:16:14 | theelous3 | 4 life |
18:16:19 | dom96 | :P |
18:16:20 | FromGitter | <alehander42> EFFICIENCY |
18:16:23 | narimiran | now python looks to me s o m u c h i n d e n t e d |
18:16:33 | theelous3 | yeah I'm coming from python |
18:16:39 | dom96 | See how well that works? #4Spaces8Life just doesn't work :P |
18:16:49 | theelous3 | 8 life |
18:16:52 | theelous3 | seems fine |
18:16:55 | theelous3 | one short of a cat |
18:17:01 | FromGitter | <alehander42> now i am hungry again |
18:17:20 | theelous3 | have pizza en route to celebrate not being lazy and trying a new lang |
18:17:43 | FromGitter | <alehander42> the universe expands though, so after a while we'll have 2^12 spaces |
18:17:47 | FromGitter | <alehander42> cherish the moment |
18:17:51 | narimiran | theelous3: nice idea! i should give rust a try and order some pizza too! :D |
18:17:56 | theelous3 | :D |
18:18:03 | dom96 | #2Deep4Me :P |
18:18:19 | theelous3 | rust is nice. refs and borrowing is awesome, if a little weird to start |
18:18:20 | narimiran | gr8 m8 |
18:18:36 | theelous3 | i like the whole never-null thing |
18:18:42 | FromGitter | <alehander42> narimiran, you'll have an incredibly oxidized pizza |
18:18:49 | theelous3 | lol |
18:19:25 | theelous3 | how to mentions work across the gateway? does alehandder42 mention, or do I need to @ |
18:20:08 | narimiran | well, 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:12 | FromGitter | <alehander42> you need to `@` |
18:20:18 | theelous3 | ok :) |
18:20:31 | theelous3 | narimiran: the rust book is really nice |
18:21:06 | theelous3 | I think more langs should make a serious effort to have their own cannonical book in that style |
18:21:07 | FromGitter | <alehander42> narimiran I am trying to start a side project while binging brooklyn 99, do both |
18:21:36 | theelous3 | charles <3 |
18:21:49 | FromGitter | <alehander42> I almost starting using `you need to type one d you fucking punk` to theelous3 |
18:21:57 | FromGitter | <alehander42> holt really got crazy |
18:21:59 | dom96 | narimiran: nim of course |
18:22:12 | narimiran | dom96: the voice of reason ;) |
18:22:25 | theelous3 | @alehander42 one d? totally baffled lol |
18:22:29 | Araq | yeah 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:38 | FromGitter | <alehander42> theeolous3: i am incredibly confused by charles' culinary taste |
18:22:40 | dom96 | theelous3: You should check out my book :D |
18:22:51 | theelous3 | dom96: show me your... book |
18:23:02 | narimiran | shit theelous3, you summoned wild Araq! |
18:23:49 | FromGitter | <alehander42> Araq, we just need to build our own browser and bancrupt mozilla |
18:23:53 | theelous3 | official python tut was written with no funding and is, I think, quite a bit longer than the rust book |
18:24:01 | theelous3 | just needs a couple of people who care |
18:24:15 | theelous3 | and hello wild Araq |
18:24:31 | narimiran | theelous3: well, i did https://narimiran.github.io/nim-basics/ , but it is just the basic stuff, it needs "part 2" |
18:24:31 | theelous3 | just takes time is all |
18:24:46 | theelous3 | if it has any exercises, I'm sold |
18:25:04 | narimiran | it has exercises after some sections |
18:25:12 | theelous3 | I always end up defaulting to the haskell 99 problems (stolen from perl?) whenever I try something new |
18:25:14 | FromGitter | <alehander42> I always think building a simple project in a lang is a great way to start |
18:25:31 | FromGitter | <alehander42> I am too lazy for exercise problems |
18:25:34 | narimiran | to me, AoC is great tool for learning a new language |
18:25:54 | theelous3 | steep ramp up with AoC, props to you for the approach |
18:26:10 | dom96 | theelous3: http://book.picheta.me/ |
18:26:36 | dom96 | It costs money but it's a book :) |
18:26:44 | Araq | hi theelous3 welcome |
18:26:58 | theelous3 | thanks |
18:27:11 | dom96 | I do wish I could have negotiated a deal where I could keep the e-book open source |
18:27:16 | dom96 | Maybe someday |
18:28:59 | theelous3 | dom96: these are both yours? |
18:29:14 | dom96 | both? |
18:29:27 | theelous3 | oh sorry |
18:29:36 | theelous3 | different people linked things |
18:29:40 | theelous3 | thought you linked both |
18:29:50 | dom96 | It'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:15 | FromGitter | <alehander42> oh yesh |
18:30:17 | narimiran | krux couldn't have his 5 days of fame? :D |
18:30:21 | FromGitter | <alehander42> time to check all the stats |
18:30:32 | dom96 | brb food |
18:33:19 | theelous3 | "module import semantics" 1% |
18:33:24 | theelous3 | what a stickler |
18:52:37 | FromGitter | <tim-st> btw I read sizeof is compile time now? does it work for all types at compile time? |
18:54:46 | shashlick | @alehander42: thank you, very appreciated! |
18:55:22 | shashlick | @dom96: so looks like only choosenim for windows needs some automated releasing - I'll look into it |
18:55:54 | FromGitter | <dawkot> how do you silence "expected kstring but expected cstring" sort of errors? |
18:57:09 | shashlick | @dom96: do you think there any need to get choosenim built with musl? cc @kaushalmodi |
18:57:52 | FromGitter | <tim-st> sizeof seems to work :) https://gist.github.com/tim-st/f458b7c17c62d42e5b1197c5edf098eb |
18:58:07 | FromGitter | <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:27 | FromGitter | <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:45 | dom96 | dawkot: huh, kstring == cstring IIRC (on JS backend at least) |
19:09:18 | dom96 | shashlick: Yeah, musl would be helpful, there have been people who had trouble on distros with an older GLIBC |
19:09:20 | FromGitter | <yyyc514> is there a way to properly escape it? |
19:10:10 | FromGitter | <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:08 | theelous3 | what's a good paste service for nim? |
19:11:22 | FromGitter | <yyyc514> lol |
19:11:24 | FromGitter | <yyyc514> i’m working on one :) |
19:11:30 | dom96 | yyyc514: result.add(\nquote:\n) or something like this |
19:11:31 | FromGitter | <yyyc514> but that doesn’t help you right this sec |
19:11:40 | theelous3 | :D |
19:11:52 | dom96 | dawkot: It gives that as a warning? |
19:11:58 | dom96 | That seems incredibly strange |
19:12:01 | dom96 | Never seen that before |
19:12:54 | * | theelous3_ joined #nim |
19:13:51 | FromGitter | <yyyc514> dom96: youd’ think but i must be doing it wrong |
19:14:00 | FromGitter | <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:44 | FromGitter | <yyyc514> dom96: need quote do for some reason |
19:15:48 | FromGitter | <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:09 | dom96 | yyyc514: submit a bug for this please, I want us to get rid of this requirement (and the do notation in general) |
19:16:44 | dom96 | dawkot: that's an error though, it shouldn't compile anyway |
19:17:39 | FromGitter | <dawkot> @dom96: I think it just assumes the code will be compiles to c where kstring is string (right?) |
19:18:33 | dom96 | https://github.com/pragmagic/karax/blob/master/karax/kbase.nim#L4 |
19:21:07 | * | jsonfrost left #nim (#nim) |
19:22:39 | FromGitter | <tim-st> this one would allow clean go to nim source code translation :0 https://github.com/ReconfigureIO/goblin |
19:22:40 | FromGitter | <alehander42> ah I use this a lot in my code like `defaultstring` |
19:27:37 | FromGitter | <kaushalmodi> theelous3: paste service: ptpb.pw |
19:27:39 | FromGitter | <mratsim> @tim-st https://github.com/stefantalpalaru/golib-nim |
19:28:04 | FromGitter | <mratsim> and you can use the Go GC in Nim :p https://github.com/nim-lang/Nim/pull/2851 |
19:28:35 | FromGitter | <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:35 | FromGitter | <tim-st> @mratsim afaik this only implements the go language concepts, but doesnt allow using go source code |
19:28:57 | FromGitter | <tim-st> imagine just loading their crypto things |
19:29:21 | theelous3 | nice ty |
19:29:24 | FromGitter | <alehander42> @tim-st honestly, you'd be better off porting them |
19:29:38 | FromGitter | <tim-st> ^^ |
19:29:42 | FromGitter | <alehander42> but a go2nim tool can of course help with that |
19:29:44 | dom96 | Damn. moigagoo's karax tutorial is awesome https://moigagoo.svbtle.com/exploring-karax |
19:30:14 | FromGitter | <alehander42> great, karax really needs a site with a similar tutorial |
19:30:14 | FromGitter | <kaushalmodi> theelous3: If you use Emacs, there's a package supporting webpastes to arbitrary services |
19:30:21 | FromGitter | <tim-st> the go2nim ast translator would still need a translation of the "magic" elements from go |
19:30:28 | dom96 | yeah, we need promotional sites for Karax and Jester |
19:30:35 | FromGitter | <kaushalmodi> using that I just select the code, press key binding and I get the link |
19:30:36 | FromGitter | <alehander42> jester too, it's really strange to look at example files |
19:30:38 | FromGitter | <alehander42> yes |
19:30:40 | dom96 | Araq: Might be worth hiring someone to create a cool website for Karax |
19:31:12 | FromGitter | <alehander42> @tim-st well, this shouldn't be too hard compared to e.g. porting dynamic languages |
19:32:02 | FromGitter | <alehander42> can you give an example of hard to translate "magic" |
19:32:04 | FromGitter | <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:32 | FromGitter | <tim-st> there is nothing hard to translate in the magic, it's just manual work |
19:32:54 | FromGitter | <tim-st> I think most of them is covered by nim stdlib already likely all |
19:32:56 | FromGitter | <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:06 | FromGitter | <alehander42> at least to make more nim-ish API-s |
19:33:16 | FromGitter | <tim-st> no, it wouldnt require it |
19:33:26 | FromGitter | <alehander42> but then the lib will suck |
19:33:37 | FromGitter | <tim-st> because the ast is translated to nim ast and nim ast can dump to nim scource code in nim style |
19:33:40 | FromGitter | <tim-st> (I assume) |
19:33:41 | * | nsf joined #nim |
19:33:42 | FromGitter | <alehander42> compared to a pure nim solution |
19:34:00 | * | hoijui joined #nim |
19:34:22 | FromGitter | <tim-st> yes, a bit, like the interface type |
19:34:42 | FromGitter | <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:02 | FromGitter | <alehander42> so e.g. such a tool can do the hard job of translating all the algorithms and boring logic |
19:35:15 | FromGitter | <alehander42> but a human can still refine it a bit |
19:35:15 | FromGitter | <tim-st> yes, but I think the normal go api could be used then |
19:35:31 | FromGitter | <alehander42> at least that was our initial intention while working on py2nim |
19:35:42 | FromGitter | <tim-st> especially since go requires a main func |
19:36:01 | FromGitter | <tim-st> but it would be too much work ;) |
19:36:12 | FromGitter | <alehander42> yes, but what's considered a nice api in Go isn't always a nice api in nim (and reverse) |
19:36:20 | FromGitter | <alehander42> but of course, this is a secondary concern |
19:36:31 | FromGitter | <alehander42> having a way to somehow reuse/port code is always useful |
19:36:37 | FromGitter | <tim-st> yes, then it would need "wrappers" like from c code |
19:37:50 | FromGitter | <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:10 | FromGitter | <alehander42> but you imagine "A compiles B to B-NIM and then the development continues only in the Go original" |
19:38:35 | FromGitter | <alehander42> the second thing is more immediately useful |
19:39:13 | FromGitter | <alehander42> but I'd love if people maintain pure-nim ports/libs too |
19:40:08 | FromGitter | <tim-st> yes, though I dont know if it's legal at all to port a lib 1:1 :\ |
19:40:17 | FromGitter | <tim-st> regarding license |
19:40:57 | FromGitter | <alehander42> yeah, for some licenses it must be fine |
19:41:15 | FromGitter | <alehander42> it mostly influences the nim lib license |
19:41:41 | FromGitter | <alehander42> @arnetheduck probably knows more about this (licenses of ported libs) |
19:42:05 | FromGitter | <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:03 | theelous3 | is there a list / iterator comprehension syntax? |
19:46:21 | theelous3 | I see some old SO posts about a macro in future |
19:46:29 | theelous3 | that supported natively now? |
19:46:29 | FromGitter | <alehander42> @tim-st absolutely, those things are fun |
19:46:58 | narimiran | theelous3: there is but it is ugly |
19:47:05 | FromGitter | <kaushalmodi> theelous3: there's one in works (list/dict aka table/set comprehension): https://github.com/alehander42/comprehension |
19:47:08 | narimiran | better to use `map` and `filter` |
19:47:46 | theelous3 | can operators be used in a map? |
19:48:00 | theelous3 | as proc |
19:48:06 | theelous3 | nvm I'll just google it, being lazy |
19:48:06 | narimiran | yes |
19:48:17 | theelous3 | neato |
19:48:28 | narimiran | and for some sugar, see `mapIt` https://nim-lang.org/docs/sequtils.html#mapIt.t%2Ctyped%2Cuntyped |
19:49:01 | theelous3 | oh that's decent |
19:49:04 | FromGitter | <kaushalmodi> was going to say `mapIt` :) |
19:49:35 | FromGitter | <alehander42> yes, for now please use mapIt / filterIt |
19:49:47 | FromGitter | <alehander42> these days the comprehension lib will be ready too |
19:50:26 | narimiran | theelous3: 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:07 | FromGitter | <kaushalmodi> I had posted this about 2 days back; hope it is OK to post again: https://scripter.co/notes/nim/#mapit |
19:54:11 | dom96 | theelous3: you're supposed to use a for expression |
19:54:15 | * | stefanos82 quit (Quit: Quitting for now...) |
19:54:50 | dom96 | although I'm not sure that's been implemented heh |
19:54:52 | FromGitter | <alehander42> argh `~` just works with a `[]` `{}` `()` dsl so much better than `comp` |
19:55:21 | narimiran | @alehander42 post a snippet |
19:55:22 | * | Vladar quit (Remote host closed the connection) |
19:55:28 | dom96 | Araq: Where are we with for loop expressions? |
19:55:48 | narimiran | dom96: we have them for some time now |
19:55:49 | FromGitter | <kaushalmodi> @alehander42 My only worry is that `~` has already a lot of connotations |
19:55:56 | FromGitter | <kaushalmodi> "not", "matches" |
19:56:08 | dom96 | narimiran: got a link to an example handy? |
19:57:05 | FromGitter | <alehander42> https://gist.github.com/alehander42/3fd73a60f83ce381039b523e38a629fa |
19:57:17 | FromGitter | <yyyc514> https://gist.github.com/yyyc514/d52078db8013a43d90f839545a80ba7a why the heck is it expecting NimNode? |
19:57:30 | narimiran | dom96: Araq usually posts this when asked about it: https://github.com/nim-lang/Nim/blob/132eb31e32844a6cb312d9d33d62c522772548b9/tests/macros/tcollect.nim |
19:57:50 | FromGitter | <alehander42> @kaushalmodi yep, I don't like it too much, but symbols are easier to make it work with `[]` `{}` |
19:58:17 | dom96 | narimiran: thanks <3 |
19:58:22 | FromGitter | <kaushalmodi> what about `%`? |
19:58:22 | narimiran | @alehander42: what is (...) comprehension? tuple? |
19:58:34 | FromGitter | <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:37 | dom96 | I'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:55 | FromGitter | <alehander42> narimiran was originally all the comprehensions |
19:58:56 | theelous3_ | I was trying stuff like http://dpaste.com/3GJJC91 |
19:58:57 | theelous3_ | but eh, idk |
19:59:10 | FromGitter | <alehander42> in this idea is a seq one, but this is also not perfect I agree |
19:59:32 | FromGitter | <alehander42> I planned on `comp[..] / symbol[]` |
19:59:42 | FromGitter | <alehander42> but I thought people might expect an array? |
19:59:50 | narimiran | [x] seq, {x} set, {x: y} table |
20:00:03 | FromGitter | <kaushalmodi> @alehander42 ahem.. what about `🎜( ..)`, `🎜[ .. ]` |
20:00:03 | FromGitter | <alehander42> on the other hand people don't really use arrays like that often |
20:00:05 | dom96 | This is the first one I tried: https://gist.github.com/dom96/7e259733ac50356a0c8adf485014e4b3 |
20:00:09 | FromGitter | <kaushalmodi> you know .. *compose* |
20:00:19 | FromGitter | <kaushalmodi> vvcrrrlfuhnreecuigibugjkbiklfgcviktivbegtcdv |
20:00:35 | FromGitter | <alehander42> @kaushalmodi I see a weird rectangle :D |
20:00:40 | FromGitter | <kaushalmodi> oh |
20:00:49 | FromGitter | <kaushalmodi> i pasted https://emojipedia.org/beamed-ascending-musical-notes/ |
20:00:59 | FromGitter | <alehander42> @dom96 the problem is that people often expect dict/set comprehensions too |
20:01:33 | FromGitter | <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:52 | FromGitter | <alehander42> having a single name for all and somehow hinting what it is in its body |
20:01:58 | FromGitter | <kaushalmodi> why not just `lc`, `tc`, `sc`? |
20:02:02 | FromGitter | <alehander42> comp(for .. {element}) ⏎ comp(for .. {k: v}) |
20:02:13 | FromGitter | <alehander42> or having `comp[..] comp{} .. ` |
20:02:47 | FromGitter | <alehander42> @kaushalmodi those two letter names sound weird to me |
20:02:50 | FromGitter | <yyyc514> weird, “result” inside quote: doesn’t work right? |
20:02:54 | FromGitter | <alehander42> a lot like a misterious unix command |
20:02:55 | narimiran | @kaushalmodi: if we're being (too) pedantic, `lc` doesn't give you *list* ;) |
20:03:07 | FromGitter | <alehander42> yes and seq / set both use s |
20:03:13 | FromGitter | <kaushalmodi> hmmm |
20:03:43 | narimiran | use `!` ? |
20:04:39 | theelous3_ | does this make sense? sum((var i = 0; for x in xs: inc(i); i)) |
20:04:42 | FromGitter | <alehander42> it doesn't seem to work when I do a macro ! |
20:05:01 | FromGitter | <alehander42> but I can use `@@` |
20:05:06 | FromGitter | <alehander42> which sounds insane |
20:05:18 | narimiran | yeah, let's not go there please :D |
20:06:27 | FromGitter | <alehander42> theelous3 yes, you can also use for i, x in xs: i |
20:06:33 | FromGitter | <alehander42> you dont need enumerate |
20:06:35 | FromGitter | <alehander42> like python |
20:08:35 | narimiran | theelous3_: well, there's nothing to sum there, the result of the parenthesis is a number |
20:08:55 | FromGitter | <rayman22201> @dom96 thanks for community survey post! Nice to see the results! |
20:09:03 | dom96 | np :) |
20:09:12 | dom96 | I'm curious what you guys think about it too |
20:09:31 | dom96 | Analysing 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:01 | FromGitter | <alehander42> @narimiran @kaushalmodi we can also have <-{for e, f in a: 0} |
20:10:07 | FromGitter | <alehander42> sounds best to me from all the symbols |
20:10:35 | narimiran | but it doesn't make sense if there's a = before that |
20:10:39 | * | nsf quit (Quit: WeeChat 2.2) |
20:10:46 | narimiran | let a = <-{.....} |
20:11:42 | narimiran | if that was `let a <- {...}` i would be ok with it |
20:13:03 | theelous3_ | narimiran, heh, yeah |
20:14:43 | FromGitter | <alehander42> ok yeah |
20:14:51 | FromGitter | <alehander42> well then `comp[]` `comp{}` it is |
20:15:28 | FromGitter | <alehander42> and comp() can generate an iterator ?? |
20:15:30 | FromGitter | <kaushalmodi> final suggestion.. `seqC`, `tabC`, `setC` |
20:15:56 | FromGitter | <alehander42> my only worry is that overriding `{}` might somehow break something |
20:16:24 | FromGitter | <kaushalmodi> my above suggestion is to remember bracket remembering overhead (even though not much) |
20:16:32 | FromGitter | <kaushalmodi> set has {} association, but others don't |
20:16:38 | FromGitter | <mratsim> might somehow break something somewhat* |
20:16:44 | theelous3 | @alehander42 aye ty, just trying to do things awkwardly to learn :P |
20:17:04 | FromGitter | <kaushalmodi> with seqC, tabC, setC, it clear what type of comprehension it is |
20:17:14 | FromGitter | <kaushalmodi> and the usual () parens would be used |
20:17:24 | narimiran | @alehander42 iterator comp. would be nice indeed |
20:17:41 | FromGitter | <mratsim> I’m still always wondering in {‘foo’: 1, ‘bar’: 2}.toTable what does those `{}` mean and produce |
20:18:01 | FromGitter | <kaushalmodi> @mratsim +1 |
20:20:51 | FromGitter | <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:51 | FromGitter | ... results about wanting improved docs makes me feel somewhat vindicated for caring about that aspect of Nim :-P |
20:21:06 | FromGitter | <tim-st> @mratsim it produces [(k, v)] |
20:21:17 | FromGitter | <tim-st> (an array of kv tuples) |
20:21:50 | FromGitter | <alehander42> @kaushalmodi very hard for me to assess <name>C vs comp brackets |
20:22:46 | dom96 | rayman22201: 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:29 | FromGitter | <tim-st> should this compile? `proc matchesAllTypes(t: typed) = echo "matched!"` |
20:29:55 | FromGitter | <tim-st> `; 1.matchesAllTypes` |
20:30:49 | FromGitter | <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:44 | FromGitter | <alehander42> ok guys, a new temp version is on https://github.com/alehander42/comprehension |
20:56:10 | FromGitter | <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:17 | FromGitter | <alehander42> the only thing remaining is to decide the final api |
20:57:07 | FromGitter | <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:33 | FromGitter | <yyyc514> is there no way to do two deep macros without hitting `Error: 'export' is only allowed at top level`? |
21:05:48 | FromGitter | <yyyc514> @nothratal if you need to model nil you kind of need optionals |
21:06:04 | FromGitter | <yyyc514> like a database operation that might return a result or not |
21:10:47 | * | banc joined #nim |
21:12:08 | FromGitter | <nothratal> Sure, but where is the need if I can just check on nil? |
21:13:26 | FromGitter | <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:52 | FromGitter | <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:56 | FromGitter | <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:22 | FromGitter | <alehander42> @yyyc514 well the only important thing is that the final code should have export at top level |
21:15:51 | FromGitter | <yyyc514> yeah i got past that i was using NimNode when i wanted untyped |
21:16:11 | FromGitter | <yyyc514> now i’m tryign to shorten `result.add quote do:` |
21:17:48 | FromGitter | <yyyc514> man using string interpolation with macros is kind of crazy |
21:18:22 | FromGitter | <alehander42> try to keep macros readable haha |
21:18:34 | FromGitter | <alehander42> a lot of my macros started a bit messy |
21:18:59 | FromGitter | <alehander42> they require some additional comments/care :( |
21:19:58 | FromGitter | <yyyc514> could i use templates to shorten that somehow? |
21:20:06 | FromGitter | <yyyc514> the magic {} template syntax? |
21:20:33 | FromGitter | <alehander42> what is the magic `{}` ? |
21:20:47 | FromGitter | <alehander42> `{}` operator? |
21:21:03 | FromGitter | <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:16 | FromGitter | <alehander42> and it's very obvious what it does to nim devs |
21:21:40 | * | rlr joined #nim |
21:21:41 | FromGitter | <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:13 | FromGitter | <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:15 | FromGitter | <alehander42> honestly, I've never used this ^ |
21:23:28 | FromGitter | <alehander42> be careful where are you looking for examples |
21:23:39 | FromGitter | <alehander42> `expr` and `stmt` were older typeclasses |
21:24:06 | FromGitter | <alehander42> so basically I don't know about this `{}` if you find use for it, great |
21:25:09 | FromGitter | <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:20 | FromGitter | <yyyc514> vs trying to use some sort of generics |
21:36:36 | FromGitter | <alehander42> yeah, here you need the structure of the types |
21:39:00 | dom96 | Trying to remove a keyword from the Nim lexer feels like it's way harder than it should be |
21:44:01 | FromGitter | <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:46 | FromGitter | <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:10 | dom96 | Maybe everyone spelled it differently :) |
21:46:29 | FromGitter | <Epictek> maybe lol |
21:46:40 | theelous3 | with mapIt, does it literally look for "it" and replace "it" with the element, or is it some sort of positional thing? |
21:47:49 | theelous3 | (also, does map produce an iterator? or does it do all the work up front?) |
21:48:55 | FromGitter | <alehander42> dom96 which keyword *shakes nervously* |
21:49:03 | dom96 | `out` |
21:49:22 | dom96 | Trying my best to fix https://github.com/nim-lang/Nim/issues/6011 |
21:49:51 | FromGitter | <alehander42> ah, was it used for something in past |
21:50:11 | dom96 | Not as far as I know |
21:52:18 | dom96 | Araq: What's this magic in the lexer? |
21:53:28 | * | hoijui quit (Ping timeout: 264 seconds) |
21:53:55 | dom96 | I removed all signs of tkOut and the lexer is doing some weird shit with tkInt |
21:54:32 | Araq | dom96: well you need to touch wordrecg.nim too |
21:55:16 | Araq | keywords change so rarely that I never used more metaprogramming to solve this :P |
21:55:44 | Araq | also ... IMO 'out' should be kept as a keyword |
21:56:14 | dom96 | okay, so I need to add a new node kind then |
21:56:31 | Araq | why? |
21:56:38 | dom96 | since you've mapped tkOut to nkVar |
21:57:52 | FromGitter | <yyyc514> hmmmm |
21:57:56 | FromGitter | <yyyc514> what magic is & doing |
21:58:31 | Araq | hmmm |
21:59:04 | Araq | that's stupid, edit parser.nim and remove that |
22:00:42 | dom96 | still curious why my efforts failed in lexer |
22:01:50 | Araq | because there is a 2nd enum in wordrecg that needs to mirror the keywords |
22:01:59 | Araq | in the same order |
22:02:23 | Araq | wordrecg recognizes special words and then via arithmetic it's mapped to TTokKind |
22:02:39 | FromGitter | <alehander42> @yyyc514 `&stuff` is fmt from stformat , `a&b` is concat |
22:02:52 | Araq | doesn't win prizes but it is fast |
22:03:51 | dom96 | okay cool, I think I got it figured out :D |
22:04:53 | FromGitter | <yyyc514> i know |
22:05:06 | FromGitter | <yyyc514> &"{tableName}” is giving me tablename when tableName() itself doesn’t work |
22:06:49 | FromGitter | <yyyc514> so i’m lost as to what extra magic & is doing |
22:09:47 | FromGitter | <yyyc514> the comparable code is `echo "TABLENAME", type(p).tableName()` which confuses me |
22:18:51 | dom96 | Loving how people are just using markdown on the forum without care |
22:20:13 | * | PMunch joined #nim |
22:21:34 | Araq | maybe tableName is not callable |
22:22:03 | FromGitter | <yyyc514> ? |
22:22:23 | FromGitter | <yyyc514> my understanding is &{} would pull in things as if there were expressions |
22:22:35 | FromGitter | <yyyc514> so if {tableName} works why doesn’t tableNAme itself work naked |
22:30:49 | FromGitter | <yyyc514> and then it works in one method but not another, something is weird |
22:33:16 | FromGitter | <yyyc514> when you call something with paste.blah semantics does it change the scoping of certain things? |
22:33:58 | FromGitter | <yyyc514> it’s like insert(paste) has different internal scope than Paste.find |
22:34:25 | FromGitter | <yyyc514> insert has access to a constant defines in the paste module but `Paste.find` seems not to |
22:36:53 | FromGitter | <yyyc514> i don’t recall reading anything like taht in the manual |
22:40:09 | FromGitter | <yyyc514> https://gist.github.com/yyyc514/3d118d52a19af88c400cca80b8c2949a |
22:48:02 | FromGitter | <yyyc514> yes, `p.another(); Paste.another2()` seem to have different scoping |
22:48:09 | FromGitter | <yyyc514> they are both in the same module |
22:48:53 | FromGitter | <yyyc514> but another2 doesn’t have access to the const that i defined in paste module |
22:49:09 | FromGitter | <yyyc514> is that correct behavior? |
23:16:12 | * | darithorn quit () |