<< 07-10-2023 >>

00:11:01FromDiscord<sOkam! 🫐> yeah i resorted to seq just because the array vers was failing
00:18:28FromDiscord<wick3dr0se> Is there a way to pass a url of a png without downloading it to disk? I want to pass the png image, not the url itself
00:20:12FromDiscord<sOkam! 🫐> In reply to @wick3dr0se "Is there a way": what do you mean by "pass"? pass to where from where?
00:24:04FromDiscord<Elegantbeef> Leroize you just made me play with converters + concepts and made me crash the compiler!
00:25:04FromDiscord<Elegantbeef> leorize even πŸ˜„
00:25:05FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4Ilv
00:25:05FromDiscord<Elegantbeef> I wanted to not need to call `toUint8` here but `converter`s explode the compiler
00:25:06FromDiscord<Elegantbeef> Well the converter + concepts seem to
00:25:34FromDiscord<leorize> I guess it couldn't figure out how to handle recursive conversion induced by concepts matching
00:25:50FromDiscord<Elegantbeef> There shouldnt be any recursive conversions
00:26:13FromDiscord<wick3dr0se> In reply to @heysokam "what do you mean": From DALL-E image create endpoint to DALL-E image create edit endpoint
00:26:32FromDiscord<wick3dr0se> My imageGen proc outputs a url which contains the png image
00:26:51FromDiscord<leorize> on playground it doesn't seem to crash without the call
00:27:02FromDiscord<leorize> it doesn't compile either but that's something else \:P
00:27:02FromDiscord<Elegantbeef> uhh
00:27:13FromDiscord<Elegantbeef> It locks the compiler
00:27:21FromDiscord<Elegantbeef> When using `converter`
00:27:47FromDiscord<leorize> ah only now I noticed that you're not using converter
00:28:34FromDiscord<leorize> https://play.nim-lang.org/#ix=4Ilw \<- nothing is happening with this
00:29:03FromDiscord<Elegantbeef> Well yea you need to tell it to use the converter
00:29:11FromDiscord<Elegantbeef> and once you do that you crash the compiler quickly
00:29:41FromDiscord<sOkam! 🫐> In reply to @wick3dr0se "From DALL-E image create": that doesn't really tell me much, since i don't know how your app communicates with dalle
00:29:57FromDiscord<wick3dr0se> https://github.com/wick3dr0se/openai-nim
00:30:04FromDiscord<wick3dr0se> I commented where I am struggling
00:30:38FromDiscord<leorize> got the repro, I guess time for a bug report
00:30:41FromDiscord<sOkam! 🫐> im not gonna read that lib just to answer the question, my man πŸ˜¦β†΅you can explain the problem better and im sure everyone here will be able to help (including me)
00:31:04FromDiscord<wick3dr0se> Its 3 procs. I think it would be much easier if you did
00:31:08FromDiscord<Elegantbeef> I was going to fix it, but the compiler is just trying to print a mismatch so fixing it seems hellish
00:31:42FromDiscord<wick3dr0se> Like 80 SLOC
00:32:26FromDiscord<wick3dr0se> Its hard to explain what I want exactly because thats the issue. Idk exactly what I need to do
00:32:50FromDiscord<sOkam! 🫐> i still don't understand the problem, because you really didn't explain what you want to do
00:32:56FromDiscord<wick3dr0se> I checked Python and JS implementations of the API but they don't directly translate to Nim
00:33:02FromDiscord<sOkam! 🫐> its not about reading it or not, its about explaining the issue so that people can help
00:33:24FromDiscord<sOkam! 🫐> code is not self-explanatory
00:33:24FromDiscord<wick3dr0se> I want to pass a png to the API request. Currently it's a url of a png
00:33:34FromDiscord<sOkam! 🫐> whats the format of that png?
00:34:05FromDiscord<sOkam! 🫐> oh you said so, its a png. and what does your interface require as input?
00:34:10FromDiscord<sOkam! 🫐> (edit) "oh you said so, its a png. and what does your ... interface" added "target"
00:34:16FromDiscord<wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4Ilx
00:34:18FromDiscord<sOkam! 🫐> (edit) "png." => "url."
00:34:33FromDiscord<wick3dr0se> The body expects a png image. I am passing the url to that proc
00:35:02FromDiscord<sOkam! 🫐> In reply to @wick3dr0se "The body expects a": but you just said that your png is just an url
00:35:18FromDiscord<sOkam! 🫐> and your body expects the actual bytes of the image? is that so?
00:35:22FromDiscord<wick3dr0se> It is a url of a png image generated by DALL-E
00:35:33FromDiscord<wick3dr0se> Well it says in the API it only accepts a png image
00:35:44FromDiscord<wick3dr0se> But I dont want to download it to disk
00:35:48FromDiscord<wick3dr0se> Just to pass it back to edit
00:35:58FromDiscord<sOkam! 🫐> how are you going to read it if you don't download it?
00:36:17FromDiscord<wick3dr0se> I'm not knowledgable enough to know lol
00:36:30FromDiscord<sOkam! 🫐> well, then your question has nothing to do with dalle or pngs
00:36:56FromDiscord<wick3dr0se> My buddy who is, said that the url is raw bytes and that it could be passed somehow directly but Idk wtf hes talking about
00:36:56FromDiscord<sOkam! 🫐> the questions in reality is:↡`How to readFile from an url instead of from the disk?`
00:37:04FromDiscord<sOkam! 🫐> (edit) "questions" => "question"
00:37:15FromDiscord<wick3dr0se> Yea but half the battle of finding answers is not knowing what to look for
00:37:51FromDiscord<sOkam! 🫐> In reply to @wick3dr0se "My buddy who is,": i mean, an url is technically bytes, because its a string
00:38:14FromDiscord<sOkam! 🫐> if he meant the stream of data from said url thats very different
00:38:30FromDiscord<wick3dr0se> Ok heres a scenario.. Like I want to use it in my Discord bot. I dont want to download the image to the server everytime someome makes an edit request
00:38:31FromDiscord<sOkam! 🫐> (edit) "the question in reality is:↡`How to readFile from an url ... instead" added "into memory"
00:39:27FromDiscord<sOkam! 🫐> yeah, well, the image needs to go into your app, and then up into the api again... if the target api itself does not have the ability to download that url itself
00:39:50FromDiscord<wick3dr0se> sent a long message, see http://ix.io/4Ily
00:40:20FromDiscord<sOkam! 🫐> that is still downloading it, really
00:40:41FromDiscord<wick3dr0se> So is the way I'm doing it valid?
00:40:49FromDiscord<sOkam! 🫐> idk if the http module has that feature, the docs for it should tell↡but in any case, that would still be downloading the data
00:41:15FromDiscord<wick3dr0se> My concern was that it wouldnt work with Discord downloading it.. The API cost money and I dont want to endlessly test it
00:41:22FromDiscord<sOkam! 🫐> In reply to @wick3dr0se "So is the way": im not saying its valid or invalid. I'm just mentioning that you said you don't want to download it... but you also need the bytes inside your app
00:41:45FromDiscord<sOkam! 🫐> if that's not whats going on, then i don't understand your problem, because the explanation is a bit lacking in info. so would be expected
00:43:30FromDiscord<wick3dr0se> Well from what your saying downloading is the only choice I have. So since learning that now then I suppose its what I have to do. I believe my approach does that but I may have to switch to downloadFile..
00:44:25FromDiscord<wick3dr0se> At this point anything that works is what matters. If it makes a png get passed back to that request, I am happy
00:47:24FromDiscord<sOkam! 🫐> @wick3dr0se i think your confusion and/or not knowing what to do in this situation is coming from a lack of understanding and mental models for how to deal with inputs/outputs in programming in general
00:47:49FromDiscord<sOkam! 🫐> at least it feels that way, because of the way you explained the problem initially
00:48:07FromDiscord<wick3dr0se> Yea thats about right
00:48:31FromDiscord<wick3dr0se> I would just Google it if I knew how
00:49:09FromDiscord<wick3dr0se> These are learning projects
00:51:42FromDiscord<sOkam! 🫐> sent a long message, see http://ix.io/4IlC
00:52:22FromDiscord<sOkam! 🫐> (edit) "http://ix.io/4IlC" => "https://paste.rs/t8J5P"
00:53:14FromDiscord<sOkam! 🫐> inputs/outputs are always data of some type, that is true for all programming in general, and that data needs to be compatible if you are going to connect it into another input (a function, or an api, etc)
00:54:36FromDiscord<sOkam! 🫐> sent a long message, see http://ix.io/4IlD
00:55:12FromDiscord<wick3dr0se> I'm far from technical but that makes sense. I was hoping I could just send it from one endpoint to the next but my initial thought was downlosding it and sending it as an actual png with something like open(). I have tampered with files verrrry few times and few as in like 2. And that was in C. Nim is the first programming language I'm trying to write shit I'll actually use in
00:55:39FromDiscord<sOkam! 🫐> In reply to @wick3dr0se "I'm far from technical": nim has `readFile` that does the reading automatically
00:56:07FromDiscord<wick3dr0se> Thats what I used. I guess it should work. Not sure what my errors are then but I'll check it out soon
00:56:18FromDiscord<sOkam! 🫐> just to compare it to that `open()` you mention, because nim has an actual stdlib (unlike C) πŸ™‚
00:56:32FromDiscord<sOkam! 🫐> C's stdlib is as raw barebones as it gets, lol
00:57:25FromDiscord<wick3dr0se> My output is a url (string), yes. And I need to accept a url into that proc and do the conversion to png within, if that makes more sense
00:57:31FromDiscord<sOkam! 🫐> what does your target api expect?
00:58:14FromDiscord<wick3dr0se> I can code you any bash script but dont ask me why it works or wtf anything means. I just slap stuff together
00:58:23FromDiscord<wick3dr0se> png
00:58:27FromDiscord<sOkam! 🫐> but how
00:58:53FromDiscord<sOkam! 🫐> png how, as a url that the api will download?↡as a stream of bytes?↡how exactly
00:59:08FromDiscord<sOkam! 🫐> outputs are not just ambiguous data types, they need to have an exact format
00:59:50FromDiscord<wick3dr0se> sent a long message, see http://ix.io/4IlF
00:59:56FromDiscord<wick3dr0se> Thats the image field required by the API
01:00:14FromDiscord<sOkam! 🫐> does it ask you for width/height properties?
01:00:14FromDiscord<wick3dr0se> Ima just download it and pass it, its fine
01:00:33FromDiscord<wick3dr0se> Not for input, only for output
01:00:52FromDiscord<wick3dr0se> sent a long message, see http://ix.io/4IlI
01:00:55FromDiscord<sOkam! 🫐> so that string is actually a `bytebuffer`, am i understanding?
01:01:12FromDiscord<wick3dr0se> Has to be.. Thats how Python does it
01:01:24FromDiscord<wick3dr0se> But idk much about that to try and explain anything
01:01:35FromDiscord<sOkam! 🫐> kk. and i understand your target has no way to download images by itself, right?
01:02:00FromDiscord<sOkam! 🫐> if you give it a url, does it download it? or does it require the bytebuffer instead
01:02:19FromDiscord<sOkam! 🫐> there might be a different api function for it (maybe)
01:03:04FromDiscord<wick3dr0se> Not without handling it internally. I cant pass a url directly to it or it errors out. It should require the bytebuffer as you mentioned which I think is what my buddy is getting at
01:04:10FromDiscord<sOkam! 🫐> right, yeah. and your buddy is probably very used to low-level coding, and its telling you about downstreamed bytebuffers as if they were nothing difficult to reason about or learn πŸ€·β€β™‚οΈ
01:06:49FromDiscord<sOkam! 🫐> @wick3dr0se do you -need- the data to not go into the disk of where your app is running?↡because if you don't, the process will be a crap-ton easier
01:07:24FromDiscord<wick3dr0se> Yea he works at Microsoft and speaks gibberish
01:07:53FromDiscord<wick3dr0se> I probably dont require that. My only reasoning was the Discord bot. I was worried it wouldnt download to a server if I decide to host it or something
01:08:02FromDiscord<wick3dr0se> My experience is little with stuff like this
01:08:28FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4IlJ
01:08:34FromDiscord<sOkam! 🫐> pseudocode, ofc
01:09:22FromDiscord<sOkam! 🫐> In reply to @wick3dr0se "I probably dont require": downloading to file is the same as downloading to memory. only difference is in disk usage, not in data streamed↡so that sounds like you probably don't need to worry about it at all
01:09:25FromDiscord<wick3dr0se> Thanks a lot.. Sorry for the confusion
01:09:46FromDiscord<wick3dr0se> As usual I'm overcomplicating things
01:09:49FromDiscord<sOkam! 🫐> no worries, programming can be difficult to reason about. and nobody teaches reasoning, only coding ⚰️
01:10:06FromDiscord<sOkam! 🫐> programming is reasoning, not punching code. but that is explained very little
01:10:49FromDiscord<sOkam! 🫐> @wick3dr0se https://www.youtube.com/watch?v=azcrPFhaY9k BIG recommend. this helped me massively when I started
01:11:07FromDiscord<wick3dr0se> Lol no kidding. I've learned a shit load especially last few weeks. Decides to write a Discord bot and then needed AI in it and Nim (that I could find) has no decent OpenAI module
01:11:29FromDiscord<sOkam! 🫐> In reply to @wick3dr0se "Lol no kidding. I've": waelcome to codinggs πŸ™ˆ
01:11:46FromDiscord<sOkam! 🫐> every damn project turns out overcomplex like that, like 99% of the time
01:12:05FromDiscord<wick3dr0se> Thats why I was also hoping someone might see it, have the knowledge and wanna contribute it. Most people like to keep things to themselves tho
01:12:08FromDiscord<sOkam! 🫐> we humans suck at understanding the actual complexity of what we have in front of us
01:13:03FromDiscord<wick3dr0se> Lmao its a serious struggle. I have some addiction to the pain of learnjng things the hard way too. Like in bash I write TUI's in pure bash instead of using ncurses.. Idk why I do these things to myself
01:17:23FromDiscord<sOkam! 🫐> this is turning into #offtopic, but don't know if you knew that if you say "Bash syntax" three times at night in front of a mirror you summon a demon πŸ™‚
01:19:28termerwick3rdr0se You can create your own OpenAI client pretty easily
01:19:32termerIt's just HTTP
01:19:39termerat least the parts of the API that you need
01:19:45termerI assume you only need GPT
01:25:14FromDiscord<wick3dr0se> In reply to @termer "wick3rdr0se You can create": Yea they appear to all be POST request. I havent had an issue implementing anything other than this image edit shit. But I plan to keep it public so anyone can use it. No point in everyone writing their own
01:29:02FromDiscord<wick3dr0se> You have to put a card on file tho to use an API key. It does charge so I doubt many want to write it themselves. If anyone feels like contributing and wants to further the module or help me learn new stuff, feel free to contribute. All I do is write open source shit, so it'll stay there and be maintained. My team will eventually pick it up with me
01:56:30termerThey used to give out free credits without CC, not sure if they still do
02:47:40*rockcavera quit (Read error: Connection reset by peer)
02:48:00*rockcavera joined #nim
02:48:00*rockcavera quit (Changing host)
02:48:00*rockcavera joined #nim
03:02:05*azimut_ joined #nim
03:02:39*azimut quit (Ping timeout: 252 seconds)
04:21:18*nyeaa4928423010 quit (Read error: Connection reset by peer)
04:21:46*nyeaa4928423010 joined #nim
04:27:21*tiorock joined #nim
04:27:21*tiorock quit (Changing host)
04:27:21*tiorock joined #nim
04:27:21*rockcavera is now known as Guest406
04:27:21*tiorock is now known as rockcavera
04:29:34*Guest406 quit (Ping timeout: 272 seconds)
05:16:15*derpydoo joined #nim
06:58:00FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4ImN
06:59:40FromDiscord<Phil> I'm currently in the experimental phase for my code so I just look for what goes, not if it's basically the necronomicon
06:59:49FromDiscord<Phil> (edit) "goes," => "goes to achieve the structure I want,"
07:00:03FromDiscord<odexine> In reply to @isofruit "Question, why does this": wdym "why does this work"?
07:00:06FromDiscord<odexine> what's the mysterious part
07:00:16FromDiscord<odexine> it's also pretty cursed
07:00:43FromDiscord<odexine> also no you cannot ref-ify a value without a copy
07:01:06FromDiscord<Phil> But I wanna though....
07:01:19FromDiscord<Elegantbeef> Too bad heap allocate and move it
07:01:28FromDiscord<Elegantbeef> `ref` is a gc'd data type, a `ptr` is not
07:02:07FromDiscord<Elegantbeef> In the above you have not provided a reason not to use `var int`
07:02:12FromDiscord<Phil> In reply to @odexine "what's the mysterious part": The mysterious part is that by the time it reaches echo, a is A(num: 5).↡Even though I'd assume 5 is a value type and thus my entire addr bit was my first assumption to not work at all, that was me throwing dumb code around
07:02:33FromDiscord<Phil> In reply to @Elegantbeef "In the above you": Imagine to5 is in fact a proc that generates an owlkettle widget which wishes to capture x in a callback
07:02:51FromDiscord<Phil> Try that with var int and you get:↡`'fieldValue' is of type <var float> which cannot be captured as it would violate memory safety, declared here: /home/philipp/dev/owlkettle/owlkettle/autoform.nim(35, 33); using '-d:nimNoLentIterators' helps in some cases. Consider using a <ref var float> which can be captured.`
07:03:14FromDiscord<odexine> when you do `for field, value in a[].fieldPairs` value is expanded into `a[].<field name>`
07:03:41FromDiscord<odexine> fieldpairs is a compile time loop expansion
07:06:08FromDiscord<Elegantbeef> Right you cannot capture `var T` as that can exist on the stack
07:06:08FromDiscord<Elegantbeef> If you know it's not on the stack and is a safe pointer you can just capture the address
07:06:35FromDiscord<Elegantbeef> Or if you know the value stays alive for long enough
07:10:24FromDiscord<Phil> In reply to @Elegantbeef "If you know it's": I can't know that ahead of time.↡I can't know the fields on `A` basically and must assume that some of them will be value types
07:10:37FromDiscord<Elegantbeef> You should just force using `ref T`
07:10:43FromDiscord<Elegantbeef> `ref T` fields can be captured
07:14:52FromDiscord<Phil> sent a long message, see http://ix.io/4ImR
07:15:25FromDiscord<Phil> (edit) "http://ix.io/4ImR" => "http://ix.io/4ImT"
07:16:11FromDiscord<Elegantbeef> All your procs have to 'thunk' the field access so you have to pass appstate everywhere
07:17:57FromDiscord<Phil> Yeah I feared that =/↡So I can't get rid of AppState and generating expressions from there... I wonder if I can assign a callback to a widget instead of declaring the callback on the widget
07:18:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ImU
07:19:13FromDiscord<Elegantbeef> Otherwise you can force all fields on the object to be references
07:21:28FromDiscord<Elegantbeef> For instance
07:21:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ImV
07:24:30FromDiscord<Phil> I don't think I want to limit owlkettle users like that for fields on their general `<Widget>State` just for this feature.↡However, I think I found a different approach:↡I just realized I can pass the changed proc as a parameter and that should work just fine!
07:24:58*nyeaa4928423010 quit (Read error: Connection reset by peer)
07:25:13*nyeaa4928423010 joined #nim
07:26:33FromDiscord<Elegantbeef> I don't even know what feature you're talking about
07:26:53FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4In0
07:26:56FromDiscord<Elegantbeef> "Generate a form" meaning you want to automate making inspectors?
07:27:12FromDiscord<Phil> In reply to @Elegantbeef ""Generate a form" meaning": Somewhat, for the most part it's for playing around with the examples in an easier fashion
07:27:27FromDiscord<Phil> Allows you to manipulate the widget fields at runtime to see what they can do
07:27:28FromDiscord<Elegantbeef> You could use a template to achieve this
07:28:34FromDiscord<Phil> I've had trouble with templates for the gui section of owlkettle before so I didn't try that, hmmm
07:30:09FromDiscord<Phil> Basically here a small example on what the goal is for owlkettle examples https://media.discordapp.net/attachments/371759389889003532/1160116842728271923/Screencast_from_2023-10-07_09-27-43.webm?ex=65337e01&is=65210901&hm=008fdf47189aad2c774e1692a01907f3b329572426363dd89868bb9897675ba6&
07:30:33FromDiscord<Phil> Generating a form came out of "Wow, I am writing a lot of forms currently, that is very annoying"
07:30:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4In1
07:32:30FromDiscord<Elegantbeef> Using templates gives you over-loadable dispatch, so you can make each UI element per type and there should not be any issues
07:34:01FromDiscord<Elegantbeef> It should not be much different to writing a serialisation library in Nim
07:34:22FromDiscord<Elegantbeef> define a template for all your primitives and then one for `tuple or object` and then you have like 99% of your objects working
07:34:31FromDiscord<Phil> I have done neither before and I'm trying to translate your example into how I would implement that for generating forms for owlkettle ^^'
07:34:37FromDiscord<Elegantbeef> still need `distinct` and friends
07:34:51FromDiscord<Elegantbeef> Replace my code with a `gui: ...` block
07:35:23FromDiscord<Elegantbeef> Same with the `makeInspector[T: ref]` proc
07:35:28FromDiscord<Elegantbeef> Each template handles generating it's own tree that goes under your form
07:35:50FromDiscord<Elegantbeef> Arguably the entry proc should be a template aswell
07:36:38FromDiscord<Elegantbeef> If unclear why templates over procs it's so the `fields` iterator does not do `paramter.field` it'll always be `a.b.c.d.e.f`
07:37:35FromDiscord<Elegantbeef> As such you do not have any issue with the capturing as it's directly on the root ref object
07:37:38FromDiscord<mihara_ichirou> sent a code paste, see https://play.nim-lang.org/#ix=4In2
07:38:02FromDiscord<mihara_ichirou> (edit)
07:38:31FromDiscord<Elegantbeef> You can just do `{.cast(gcSafe).} : echo "token ", token`
07:39:19FromDiscord<Elegantbeef> If this is not multi-threaded you can do `--threads:off`
07:39:47FromDiscord<Phil> In reply to @Elegantbeef "As such you do": I'll eat first and hack away at a reimplementation based on templates in the hopes of it working.↡If it does, that would be pretty fire
07:40:03FromDiscord<Elegantbeef> Well I know a guy if you get stuck
07:40:13*blop_ quit (Ping timeout: 252 seconds)
07:40:23FromDiscord<Elegantbeef> But it's nearing his bed time
07:40:53FromDiscord<mihara_ichirou> In reply to @Elegantbeef "You can just do": Yes, but a) this time it's actually multithreaded, b) wait, can I do this just for the one statement that uses the variable and leave the rest of the proc untouched?
07:41:00FromDiscord<Elegantbeef> Yes
07:41:19FromDiscord<Elegantbeef> Anything under that ugly as sin cast pragma is no longer considered for gcsafety
07:41:37FromDiscord<Phil> In reply to @Elegantbeef "Well I know a": It's fine, it's more likely that I'll have all the kinks worked out be this evening anyway
07:42:10FromDiscord<Elegantbeef> Well make sure it's reusable
07:42:28FromDiscord<Elegantbeef> I can see an automatic inspector very useful for things like brushes in an art program
07:42:39FromDiscord<mihara_ichirou> In reply to @Elegantbeef "Anything under that ugly": Yay, that worked. Still, this seems extremely crude, and there should be a legit way to do it.
07:43:08FromDiscord<Phil> Ah you mean reuseable as in useable for owlkettle users
07:43:37FromDiscord<Elegantbeef> Could even implement user defined pragmas for things like slider ranges πŸ˜›
07:43:38FromDiscord<Phil> That's the long haul for this feature. Step 1 is make the examples decent.↡Step 2 make a "playground" feature
07:44:03FromDiscord<odexine> In reply to @mihara_ichirou "Yay, that worked. Still,": it would probably be better not to use globals
07:44:06FromDiscord<Phil> Where users can just get inspectors for their own stuff
07:45:25FromDiscord<mihara_ichirou> In reply to @odexine "it would probably be": Sure, and what should I use if I can't pass a parameter into the proc (because whatever library actually calls it does not let me) ?
07:46:20FromDiscord<Elegantbeef> I was nearing towards implementing that auto inspector, but then remembered I often use object variants so it's hell on earth πŸ˜„
07:47:03FromDiscord<Elegantbeef> For my own GUI stuff not for owlkettle
07:47:08FromDiscord<Phil> I mean, conceptually I think it's doable (?)
07:47:39FromDiscord<Elegantbeef> Well object variants arent the worse it's also my complex requirements
07:47:44FromDiscord<Phil> Generate a list of fields each possible variant has at compiletime, when you encounter the variant check its kind and generate a form based on that?
07:47:47FromDiscord<Elegantbeef> Like only always walkable tiles should show a text entry field
07:48:10FromDiscord<Phil> (edit) "kind" => "kind, select the right list of fields (well fieldNames more like)"
07:48:16FromDiscord<Elegantbeef> Only tiles that are always walkable should also have a drop down for placables
07:49:37FromDiscord<Elegantbeef> I mean `field`s iterators work on variants so it's not that bad, but I also do want selective logic for things
07:57:22FromDiscord<Phil> In reply to @Elegantbeef "I mean `field`s iterators": Question about your template approach again
07:57:36FromDiscord<Phil> So the template returns a proc that generates the widget? Is that the approach?
07:58:16FromDiscord<Elegantbeef> No
07:58:22FromDiscord<Elegantbeef> The template returns the `gui:` block
07:58:43FromDiscord<Elegantbeef> I set result to be a proc to demonstrate it was infact a closure
08:02:01FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4In4
08:02:29FromDiscord<Elegantbeef> Yes that
08:02:36FromDiscord<Elegantbeef> Right owlkettle is untyped
08:02:51FromDiscord<Elegantbeef> Untyped macros suuuuuck πŸ˜„
08:03:13FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4In5
08:03:33FromDiscord<Elegantbeef> Well then try returning a proc
08:04:01FromDiscord<Phil> As in `template toFormField(fieldValue: typed, fieldName: static string): proc(): Widget =`?
08:04:14FromDiscord<Elegantbeef> Right
08:05:33FromDiscord<Elegantbeef> I don't recall if that's valid
08:06:05FromDiscord<Phil> Nope, triggers the same error, it just refuses to have a `gui` block inside a `template`
08:06:16FromDiscord<Elegantbeef> It's not the gui block inside the template
08:06:22FromDiscord<Elegantbeef> It's the fact that gui is an untyped macro
08:07:08FromDiscord<Elegantbeef> A proc call inside gui should be a widget name
08:09:39FromDiscord<Elegantbeef> This is the issue with `untyped` and why araq what's to remove it
08:10:08FromDiscord<Elegantbeef> wants\
08:11:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4In8
08:11:25FromDiscord<Phil> Though I guess I should push fieldName as a template parameter
08:12:36FromDiscord<Elegantbeef> That works but it'll fall apart for anything like `((x, y: int),)`
08:12:51FromDiscord<Elegantbeef> Atleast from what i can tell
08:12:56FromDiscord<Elegantbeef> also your template has no return type
08:13:13FromDiscord<Elegantbeef> also why such an ugly `return`
08:13:17FromDiscord<Elegantbeef> `= state.numberFIeld(fieldName)` πŸ˜›
08:15:08FromDiscord<Phil> Becuase I want numberField to work for both the expressions `state.getField(fieldName) ` as well as `state.getField(fieldName)[index]`
08:15:25FromDiscord<Phil> I just want to throw in the expressiont hat generates the direct field access on state and insert that into the code-block that generates the widget
08:15:31FromDiscord<Phil> (edit) "expressiont hat" => "expression that"
08:18:02FromDiscord<Elegantbeef> Ugh it's a shame about the gui macro, no real pluggable way to do this
08:35:55FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Ine
08:37:25*azimut_ quit (Ping timeout: 252 seconds)
08:44:23FromDiscord<Elegantbeef> Right like i said
08:44:43FromDiscord<Elegantbeef> It does not compose
08:44:43FromDiscord<Elegantbeef> You need to generate this using a macro
08:45:35FromDiscord<Phil> Yeah I give up there, that's starting into macro on macro action where one of those macros is the entire gui-dsl of owlkettle and that seems too large for me to wrap my head around
08:47:17FromDiscord<Elegantbeef> Just cross your fingers and hope for removal of `untyped` πŸ˜„
08:47:38FromDiscord<Phil> My macro skills are firmly in the "Can write his own macro and understand semi-simple macros" category, not "Can understand an entire DSL that was written in a style unlike his own" category
08:53:56FromDiscord<vindaar> How are untyped identifiers supposed to work if `untyped` macros were removed, anyway? Would we grow a `nnkUntypedIdent` kind of node that a macro argument of `untyped` would use?
08:54:16FromDiscord<Elegantbeef> `nnkIdent` would appear if there was no symbol
08:54:29FromDiscord<Elegantbeef> `nnkSymChoice` would appear if there was a symbol
08:55:33FromDiscord<vindaar> I guess that could work
09:03:53FromDiscord<Phil> I wonder how my nim knowledge stacks up at this point, given the points of comparisons I've got "decisively average" seems fitting
09:04:11FromDiscord<Elegantbeef> But that's my knowledge level
09:04:54FromDiscord<Phil> Bah, you are decisively above average.↡At the lowest I give you "average of above average"
09:09:26FromDiscord<mratsim> In reply to @ezquerra "Blame <@570268431522201601> πŸ™‚": blame Fortran
09:12:30*junaid_ joined #nim
09:17:58*Zevv joined #nim
09:23:47FromDiscord<mratsim> https://lemire.me/blog/2023/10/07/web-server-hello-world-benchmark-go-vs-node-js-vs-nim-vs-bun/
09:42:51FromDiscord<leetnewb> is it reasonable to compare a standard library http server to httpbeast?
09:53:18FromDiscord<Phil> Given that I have trouble seeing "fairness" in benchmark, eh.
09:53:25FromDiscord<Phil> (edit) "benchmark," => "benchmarks, my response is"
09:58:02FromDiscord<0ffh> In reply to @mratsim "https://lemire.me/blog/2023/10/07/web-server-hello-": Lol, yeah just saw it on HN.
09:58:02FromDiscord<0ffh> https://news.ycombinator.com/item?id=37799331
09:58:21FromDiscord<0ffh> Came here to post, but....
09:58:27FromDiscord<0ffh> second! πŸ˜‚
10:01:42FromDiscord<0ffh> In reply to @isofruit "Given that I have": Totally with you, but in a way I think it might be nice advertisement.↡The conclusion is more or less "If you want an easy time coding, this is what you get. I wanted to try C++, but it was so painful that I couldn't be bothered."
10:03:16FromDiscord<0ffh> Sound like an endorsement in a way.
10:03:25FromDiscord<0ffh> Sounds like an endorsement in a way.
10:07:05FromDiscord<Phil> In reply to @0ffh "Totally with you, but": I mean I agree, but I actually get annoyed by it
10:07:17FromDiscord<Phil> Because every benchmark immediately becomes a reputation battle
10:07:48FromDiscord<Phil> And given that you can optimize the crap out of everything given the right tools, it becomes a battle of who is willing to burn the most amount of time to optimize memory moves and copies etc.
10:08:32FromDiscord<Phil> Which means ultimately it comes down to who has the largest community (assuming you have the baseline tools to control memory etc.).
10:09:03FromDiscord<Phil> (edit) "etc.)." => "etc.).↡Because benchmark code is rarely ever about "this is the naive implementation", it is "Who gets the most roided out implementation just shy of writing highly optimized assembly""
10:09:23FromDiscord<0ffh> In reply to @isofruit "Which means ultimately it": You're quite right there, that's part of the charm of this one. It's just "Let's solve this in the most easy way and see what comes off it."
10:09:23FromDiscord<Phil> (edit) "Which means ultimately it comes down to who has the largest community (assuming you have the baseline tools to control memory etc.).↡Because benchmark code is rarely ever about "this is the naive implementation", it is "Who gets the most roided out implementation ... just" added "making use of every highly advanced language feature"
10:10:38FromDiscord<0ffh> So in a way, it takes productivity into account.
10:11:10FromDiscord<0ffh> Even emphasizes it.
10:11:45FromDiscord<ezquerra> Is `proc loadLibPattern(pattern: string; globalSymbols = false)` supposed to work on Windows?
10:12:00FromDiscord<ezquerra> That is, is it possible to pass a pattern to the dynlib pragma on windows?
10:12:45FromDiscord<ezquerra> For example, you have a dll that might or might not start with "lib", can you use a dynlib pattern to find the dll in both cases?
10:14:51FromDiscord<0ffh> In reply to @isofruit "Which means ultimately it": Oh, maybe I didn't quite get your point there! πŸ˜… ↡Of course your point stands insofar as all the optimization effort doesn't really go away, but is just shifted to the library implementation.
10:17:23FromDiscord<0ffh> (But even though, I find it hard to imagine Go code that's faster than Nim. Gross algorithmic misconduct excluded.)
11:10:06*gshumway quit (Quit: .)
11:12:09FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4InH
11:15:20*gshumway joined #nim
11:17:54FromDiscord<demotomohiro> In reply to @user2m "I'm using the autome": https://nim-lang.org/docs/exitprocs.html↡Or you can use defer
11:23:57*gshumway quit (Quit: .)
11:24:15*gshumway joined #nim
11:26:39*gshumway quit (Client Quit)
11:27:27*junaid_ quit (Remote host closed the connection)
11:28:56FromDiscord<saint._._.> In reply to @isofruit "Which means ultimately it": Benchmarks have to be about looking at the code too. I feel it’s useful if people can make the case of how easy it is to write whatever case the benchmark test is.
11:29:25FromDiscord<saint._._.> (edit) "Benchmarks have" => "A somewhat useful benchmark has"
11:31:48*gshumway joined #nim
11:47:14*junaid_ joined #nim
13:29:19NimEventerNew thread by sls1005: Details about procedures and their pointers, see https://forum.nim-lang.org/t/10533
13:48:30FromDiscord<nnsee> In reply to @leetnewb "is it reasonable to": it doesn't matter either way, microbenchmarks like this are all meaningless
13:48:51FromDiscord<nnsee> but I see that's already been discussed here
13:53:54*junaid_ quit (Remote host closed the connection)
13:56:56*junaid_ joined #nim
14:17:10*antranigv quit (Read error: Connection reset by peer)
14:17:26*antranigv_ joined #nim
15:10:48*antranigv_ is now known as antranigv
15:12:17FromDiscord<mratsim> In reply to @nnsee "it doesn't matter either": A full http server is not really a microbenchmark though
15:36:53Zevvlast time I checked https://github.com/disruptek/httpleast was about 5x faster than httpbeast and mummy. but it is indeed just a microbenchmark
15:37:56Zevvbecause it's far from a "Full HTTP server"
16:25:30NimEventerNew thread by lou15b: Effects of calls to Garbage Collector when using ARC/ORC?, see https://forum.nim-lang.org/t/10534
17:03:42*derpydoo quit (Read error: Connection reset by peer)
17:23:37*azimut joined #nim
17:32:44*azimut quit (Remote host closed the connection)
17:33:03*azimut joined #nim
17:52:00*tiorock joined #nim
17:52:00*tiorock quit (Changing host)
17:52:00*tiorock joined #nim
17:52:00*rockcavera quit (Killed (copper.libera.chat (Nickname regained by services)))
17:52:00*tiorock is now known as rockcavera
17:52:30*derpydoo joined #nim
18:49:14*junaid_ quit (Remote host closed the connection)
19:09:19FromDiscord<luxurymode> sent a code paste, see https://play.nim-lang.org/#ix=4IpN
19:12:22FromDiscord<guttural666> I did this with a variant type before
19:12:34FromDiscord<nang4403> Hi
19:13:06FromDiscord<fakecrafter> @luxurymode yeah I'm also using it right now and it seems legit
19:13:50FromDiscord<guttural666> In reply to @luxurymode "I'm pretty new to": you can take a look at this, keep in mind that I'm a Nim noob and this is not finished: https://gitlab.com/hansdampfinger666/abap_modern/-/blob/main/src/lexer_types.nim?ref_type=heads
19:14:31FromDiscord<luxurymode> In reply to @guttural666 "you can take a": oh awesome, thanks a lot
19:14:51FromDiscord<luxurymode> In reply to @fakecrafter "<@389604138943643649> yeah I'm also": "it" being the book or Nim? πŸ™‚
19:14:52FromDiscord<guttural666> In reply to @luxurymode "oh awesome, thanks a": TokenData is the variable data part, I think that's what you mean
19:15:18FromDiscord<fakecrafter> i meant the enum object variants
19:15:25FromDiscord<luxurymode> ah gotcha
19:15:51FromDiscord<fakecrafter> I think they're really cool and useful. at least i can imagine so
19:16:13FromDiscord<luxurymode> In reply to @guttural666 "TokenData is the variable": Thanks. I think that's right. Assuming my current understanding of what the author intended in the book I'm going through is correct in the first place...
19:17:39FromDiscord<guttural666> In reply to @luxurymode "Thanks. I think that's": I'm rewriting this rn and I dumbed everything down to just Token(kind: enum, str: string) and I just use the string, if there is original content (meaning user defined identifiers or numbers etc.), probably depends on your needs
19:18:30FromDiscord<luxurymode> In reply to @guttural666 "I'm rewriting this rn": right
19:18:39FromDiscord<guttural666> but I just want to tokenize and parse and correct code etc. for interpretation etc. you'd probably need properly typed fields
19:21:39*azimut quit (Ping timeout: 252 seconds)
19:22:04FromDiscord<luxurymode> sent a code paste, see https://play.nim-lang.org/#ix=4IpQ
19:22:58FromDiscord<luxurymode> identifier refers to, for example, if you have `var a = ...` `a = b` then `b` is an identifier?
19:24:13FromDiscord<guttural666> a and b would be yeah
19:24:14FromDiscord<luxurymode> or am I way off πŸ˜†
19:24:25*azimut joined #nim
19:24:30FromDiscord<guttural666> string probably means a string literal like 'hello'
19:24:37FromDiscord<fakecrafter> sent a code paste, see https://play.nim-lang.org/#ix=4IpT
19:24:40FromDiscord<guttural666> number likewise a 1212
19:24:40FromDiscord<luxurymode> In reply to @guttural666 "string probably means a": right
19:25:39FromDiscord<luxurymode> I think what I'm unclear on is if I use a discrimated union here, then I really have to have a `case` for each and every one of my `TokenType`s right?
19:25:46*xet7 quit (Remote host closed the connection)
19:26:13FromDiscord<luxurymode> sent a code paste, see https://play.nim-lang.org/#ix=4IpU
19:26:48FromDiscord<guttural666> In reply to @fakecrafter "does anyone have a": unsure if it's possible to do that from "outside", I am currently just counting the line breaks I encounter while reading the file (see strutils.NewLines)
19:26:51FromDiscord<luxurymode> sent a code paste, see https://play.nim-lang.org/#ix=4IpV
19:28:00FromDiscord<guttural666> (edit) "strutils.NewLines)" => "strutils.NewLines)↡which can either be done by reading the file into memory beforehand with readFile and then looping over the chars or you could read the file line by line and count the lines"
19:29:09*xet7 joined #nim
19:29:33FromDiscord<fakecrafter> yeah kinda thought of that
19:29:51FromDiscord<fakecrafter> but thx
19:31:33FromDiscord<guttural666> In reply to @luxurymode "I think I was": normally the left hand side (mystring) is considered an identifier and the right hand side a string literal in this example code (analogous for numbers):↡var mystring = "This is my string"↡var myint = 1
19:32:42FromDiscord<luxurymode> In reply to @guttural666 "normally the left hand": right
19:33:06FromDiscord<guttural666> (edit) "In reply to @luxurymode "I think I was": normally the left hand side (mystring) is considered an identifier and the right hand side ... a" added "(This is my string)"
19:36:56*nyeaa4928423010 quit (Ping timeout: 255 seconds)
19:38:09*mal`` quit (Quit: Leaving)
19:39:12FromDiscord<guttural666> In reply to @fakecrafter "yeah kinda thought of": anybody know how to restart the Lsp in Vim? nimlsp just exits as soon as I open a Nim file it seems https://media.discordapp.net/attachments/371759389889003532/1160300311911604325/image.png?ex=653428df&is=6521b3df&hm=2a60f86ba10ca46f017614c232d8e507fb986a03a94741a1ff6a8c34c5f79e39&
19:39:46FromDiscord<fakecrafter> I use emacs lol
19:42:20FromDiscord<nnsee> In reply to @guttural666 "anybody know how to": depends entirely on your lsp plugin
19:43:08FromDiscord<nnsee> but maybe try `:e`
19:44:45*azimut quit (Ping timeout: 252 seconds)
19:44:49FromDiscord<luxurymode> In reply to @guttural666 "anybody know how to": depends on the lsp client you're using, like with coc.nvim it's `:CocRestart`. Other than that `:q` and reopen Vim is the best I got lol
19:44:57*Zevv left #nim (#nim)
19:45:15FromDiscord<guttural666> In reply to @nnsee "depends entirely on your": nimlsp by Peter
19:45:42FromDiscord<guttural666> In reply to @luxurymode "depends on the lsp": PC restart now πŸ˜„
19:45:58FromDiscord<luxurymode> In reply to @guttural666 "PC restart now πŸ˜„": lmao. Just get a new computer altogether
19:45:58*azimut joined #nim
19:46:39*xet7 quit (Remote host closed the connection)
19:47:06FromDiscord<luxurymode> In reply to @guttural666 "nimlsp by Peter": I think they meant like are you using vim-lsp, for example
19:47:20FromDiscord<luxurymode> not which lang server itself
19:48:57*nyeaa4928423010 joined #nim
19:50:01*xet7 joined #nim
19:50:07FromDiscord<guttural666> I'm relatively clueless in this matter, I just installed nimlsp through nimble, I do have CoC installed, but I didn't have to configure the LSP through CocConfig, it just kinda worked with the guide on the nimlsp github page
19:52:32FromDiscord<luxurymode> In reply to @guttural666 "I'm relatively clueless in": you and me both
19:53:51FromDiscord<guttural666> dunno what happened, nimlsp did work in Vim lately, just updated my plugins, nothing, still just nimlsp: exited
19:54:04FromDiscord<guttural666> god, I don't want to go back to MS Code
19:54:08FromDiscord<guttural666> (again)
20:04:12*mal`` joined #nim
20:12:36FromDiscord<guttural666> In reply to @luxurymode "you and me both": just shot you a pn, dunno if that arrived
20:19:02FromDiscord<Chronos [She/Her]> Is code contained within `runnableExamples` blocks ran during doc generation to ensure it's correct?
20:19:27FromDiscord<Chronos [She/Her]> In reply to @guttural666 "just shot you a": Unrelated but Anarchist?
20:24:28FromDiscord<nnsee> In reply to @chronos.vitaqua "Is code contained within": this seems like it would be very easy to test :p
20:24:52FromDiscord<Chronos [She/Her]> True but I am also multitasking rn by writing good docs for my code-
21:19:33*xet7 quit (Remote host closed the connection)
21:42:27FromDiscord<Chronos [She/Her]> Procrastination on writing code by writing docs now that I can release them automatically on new tag release
21:42:56FromDiscord<Chronos [She/Her]> I'm gonna mass-update my stuff on Nimble to link to the doc pages :p
21:43:27*xet7 joined #nim
21:55:19FromDiscord<guttural666> any easy way to create a set from the array above at compile time without writing it by hand? https://media.discordapp.net/attachments/371759389889003532/1160334564594561054/image.png?ex=653448c6&is=6521d3c6&hm=deee0697e9a07fe49eeaa003d1e42f77dcc3e840b649940817796e1eb8b41be0&
22:00:07FromDiscord<Chronos [She/Her]> In reply to @guttural666 "any easy way to": https://nim-lang.org/docs/sets.html this may help ya o7
22:02:13FromDiscord<Chronos [She/Her]> Rn I'm wondering if I should make my ULID impl fallback to using the `random` module instead of `sysrand` in the very unlikely chance it isn't available, since the spec does say 'secure source of randomness if available'
22:04:43FromDiscord<guttural666> In reply to @chronos.vitaqua "https://nim-lang.org/docs/sets.html this may help": don't think a hash set is warranted with <100 elements
22:06:20FromDiscord<Chronos [She/Her]> Doesn't seem like any other option rip
22:09:03FromDiscord<sOkam! 🫐> In reply to @guttural666 "don't think a hash": if you need an ordinal set, then take the TokenKinds and turn them into a set at compiletime either with a `compiletime` proc or with a `static: ...` block
22:09:32FromDiscord<sOkam! 🫐> aka by looping through your array and `result.incl kind`
22:10:53FromDiscord<sOkam! 🫐> also, you should probably do `array[TokenKind, char]`.... instead of tuples like its not nim what you are writing πŸ™‚
22:11:30FromDiscord<sOkam! 🫐> enum arrays are a thing, and a really useful one
22:12:14FromDiscord<guttural666> what type would those bad boys be in the [] in array[TokenKind, char]?
22:12:24FromDiscord<guttural666> anonymous tuple?
22:12:29FromDiscord<sOkam! 🫐> no, just chars
22:12:36FromDiscord<sOkam! 🫐> chars in an array indexed by your tuple
22:13:03FromDiscord<sOkam! 🫐> enums are an ordinal type, and they can be used to index arrays like any other number
22:13:51FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "Rn I'm wondering if": Locking it behind a compiletime define
22:14:09FromDiscord<Chronos [She/Her]> Also would make my library work on js ig
22:15:33FromDiscord<guttural666> In reply to @heysokam "enums are an ordinal": is this what this kind of initialization is? I was very confused when I saw something like this in my old code (lol) and sifting through Mastering Nim didn't make it clearer: https://media.discordapp.net/attachments/371759389889003532/1160339660913004554/image.png?ex=65344d85&is=6521d885&hm=d8c6d34b5a8142dac211c9864503a180c7687c521487d1b78d51a2dcb9f73d8b&
22:16:31FromDiscord<Elegantbeef> Yes that is
22:16:45FromDiscord<Elegantbeef> you also can just do `const pls: array[YourEnum, char] = [Bleh: 'a', Meh: 'b']`
22:18:48FromDiscord<guttural666> very cool, I think I understand, is there a technical name for this so I can reference it in docs?
22:19:34FromDiscord<guttural666> In reply to @Elegantbeef "you also can just": don't quite understand that, doesn't Bleh have to be an int ord(YourEnum)
22:19:54FromDiscord<Elegantbeef> Nope
22:19:55FromDiscord<Elegantbeef> Nim has enum indexed arrays
22:19:55FromDiscord<Elegantbeef> It internally does all that inanity for you
22:20:05FromDiscord<Elegantbeef> Not that there is any inanity to do
22:20:25FromDiscord<Elegantbeef> Enums are just named integers
22:20:32FromDiscord<guttural666> In reply to @Elegantbeef "Enums are just named": indeed
22:23:41FromDiscord<guttural666> okay this is really good, I just wrote all this mapping shit down to have the string representation of my tokens (some have string representations some are single chars that I want to compare to my Lexer.current_char etc.) πŸ‘Œ https://media.discordapp.net/attachments/371759389889003532/1160341704277233664/image.png?ex=65344f6c&is=6521da6c&hm=e37d80b2f714f697d2ec29ac7b25e110d362b166a0e76df9b25c15f6f5d1a66d&
22:24:01FromDiscord<Elegantbeef> You don't need the kind
22:24:20FromDiscord<Elegantbeef> You've just made an array with a tuple
22:24:57FromDiscord<guttural666> exactly and accessing those vals is crap
22:25:02FromDiscord<Chronos [She/Her]> Making a type for that seems better tbh
22:25:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Iqr
22:25:33FromDiscord<Chronos [She/Her]> It most likely won't ever be an issue, but
22:25:34FromDiscord<Elegantbeef> Then you can use `parseEnum` or you own macro to parse the enums
22:26:54FromDiscord<guttural666> In reply to @Elegantbeef "Also you can just": that is what I had previously but I always had to deal with converting substrings str[from..to] to chars etc.
22:27:26FromDiscord<Elegantbeef> use an proc that has `openArray[char]`
22:27:52FromDiscord<Elegantbeef> I don't get the issue of slicing
22:28:24FromDiscord<guttural666> we talked about this before πŸ˜„ I'll have to do some reading on that
22:28:31FromDiscord<guttural666> thanks!
22:47:13FromDiscord<guttural666> how do I get the idx out again when looping? https://media.discordapp.net/attachments/371759389889003532/1160347629633404929/image.png?ex=653454f1&is=6521dff1&hm=758866496ec00b3545db2647943994e292c7d142fd49c4f3f51304d14a3604d3&
22:47:31FromDiscord<Elegantbeef> `for x, y in z.pairs`
22:47:35FromDiscord<guttural666> right
22:50:25FromDiscord<guttural666> and accessing the enum by index again? https://media.discordapp.net/attachments/371759389889003532/1160348431768883270/image.png?ex=653455b0&is=6521e0b0&hm=216a3107d49be374534eed744c1ee2d6399ddbe3e2046b60fe5eebe61368ff57&
22:51:02FromDiscord<sOkam! 🫐> In reply to @guttural666 "and accessing the enum": `TokenKind(idx)`
22:51:08FromDiscord<sOkam! 🫐> remember, enums are just integers
22:51:18FromDiscord<guttural666> yesss, nice
22:51:21FromDiscord<guttural666> thanks
22:51:49FromDiscord<guttural666> yeah, just expected the index access as with arrays and sequences
22:52:07FromDiscord<Elegantbeef> idx is already a TokenKind
22:52:13FromDiscord<Elegantbeef> There is no need to convert
22:52:44FromDiscord<sOkam! 🫐> explicit is clearer to read, though
22:53:08FromDiscord<guttural666> yeah, just realized, so idx is a bad name
22:53:28FromDiscord<Elegantbeef> It's already declared as an enum indexed array they only way to get more explicit is to add swearing
22:53:45FromDiscord<sOkam! 🫐> you should probably do `for kind, token in keywords`... and just `result = kind`
22:53:54FromDiscord<guttural666> now we're cooking https://media.discordapp.net/attachments/371759389889003532/1160349310827905084/image.png?ex=65345681&is=6521e181&hm=b81f056c51cdbfc5c685252886938fb3f02009eb4a2fd6b817e137fb8e756829&
22:54:06FromDiscord<sOkam! 🫐> yeah exactly
22:54:08FromDiscord<Elegantbeef> `return kind`
22:54:15FromDiscord<Elegantbeef> No reason for using result if you're just going to return
22:54:34FromDiscord<guttural666> I know, all WIP
22:55:25FromDiscord<guttural666> Nim is awesome
23:17:16FromDiscord<sOkam! 🫐> 100%
23:17:43FromDiscord<sOkam! 🫐> the readability tools of this lang are top of the game, by a big margin
23:25:28FromDiscord<user2m> does std/paths still exist? https://nim-lang.org/docs/paths.html#%2F%2CPath%2CPath
23:25:52FromDiscord<user2m> `import std/paths` yields an error on nim 1.16.12
23:26:33FromDiscord<user2m> ahh ok I se it's v 2.0 only
23:28:46FromDiscord<sOkam! 🫐> In reply to @user2m "`import std/paths` yields an": it was introduced in 2.0↡you -could- use it in 1.16.... but you have to pull about 5k-6k lines of dependency code (i did it, and it worked while i was waiting for 2.0)↡if you must use that old version, its doable. but its tedious, not worth the effort unless you really plan on sticking to that old vers for a while
23:34:26FromDiscord<user2m> In reply to @heysokam "it was introduced in": nahh this works fine for me https://github.com/achesak/nim-pythonpathlib
23:34:45FromDiscord<user2m> In reply to @heysokam "it was introduced in": I don't know why but i've only ever had trouble with 2.0 so I try ntot o use it
23:35:11FromDiscord<user2m> In reply to @heysokam "it was introduced in": no issues with 1.16.12 tho . ill have to migrate evntually tho
23:37:41FromDiscord<sOkam! 🫐> In reply to @user2m "I don't know why": you must be using outdated libs, i guess? πŸ€”
23:37:46FromDiscord<luxurymode> Why is nimpretty the only tool without a link here? https://nim-lang.org/docs/tools.html 😒 Is it because it's defunct?
23:39:05FromDiscord<user2m> In reply to @heysokam "you must be using": some of the js backend stuff breaks in 2.0
23:39:21FromDiscord<luxurymode> In reply to @luxurymode "Why is nimpretty the": hrm, nevermind. Looks like I have automatically, I guess standard with choosenim
23:40:01FromDiscord<sOkam! 🫐> In reply to @luxurymode "hrm, nevermind. Looks like": yep, it comes with nim, just like nimble and nimsuggest
23:40:11NimEventerNew thread by giaco: Nim vs cppfront as C++ frontend, see https://forum.nim-lang.org/t/10535
23:58:12*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in)
23:59:40*xutaxkamay joined #nim