00:51:53 | FromDiscord | <Forest> Question, how do i try and attempt to understand the absolutely dreadful futhark code generated? Lmao |
00:52:15 | FromDiscord | <Elegantbeef> You dont, you write the code as it was C and never look at it unless you run into a bug |
00:52:20 | FromDiscord | <Elegantbeef> It's a really big pain spot for futhark imo |
00:53:17 | FromDiscord | <Forest> Rip, need to make clean nim-like bindings for it |
00:54:05 | FromDiscord | <leorize> you can wrap the wrapped C api generated from futhark |
00:54:16 | FromDiscord | <Elegantbeef> Yea i alrready mentioned that twice now |
00:54:49 | FromDiscord | <leorize> you can look at https://github.com/alaviss/kmod for something that does that, though with a different (now unmaintained) project |
00:54:51 | FromDiscord | <Forest> In reply to @leorize "you can wrap the": Yeah that's what we're doing |
00:54:59 | FromDiscord | <Forest> But it's just messy as fuck to understand lmao |
00:55:07 | FromDiscord | <Elegantbeef> It is indeed |
00:55:25 | FromDiscord | <Elegantbeef> The output of c2nim is much more concrete but also requires more work |
00:55:34 | FromDiscord | <Forest> Thanks aha |
00:55:38 | FromDiscord | <Forest> In reply to @Elegantbeef "The output of c2nim": Yeahhh fair |
00:55:54 | FromDiscord | <Forest> Wgpu will be a pain to get full coverage for tbh.. |
00:55:57 | FromDiscord | <Elegantbeef> There's also that wasmedge program for reference aswell |
00:56:08 | FromDiscord | <Forest> Oh yeah, how do nim projects generate docs? |
00:56:16 | FromDiscord | <Forest> Seen em before but idk how they work |
00:56:20 | FromDiscord | <Elegantbeef> `nim doc` |
00:56:41 | FromDiscord | <Elegantbeef> All `##` are doc comments and are included in the generated docs |
00:58:08 | FromDiscord | <Forest> Ah thanks! |
00:58:12 | FromDiscord | <Forest> On the same line as the code? |
00:58:26 | FromDiscord | <Forest> Do multiline also work with `##[ ]##` or? |
00:58:32 | FromDiscord | <Elegantbeef> Yes |
00:58:41 | FromDiscord | <Elegantbeef> Depends on what the thing is but generally next or same line is fine |
00:58:58 | FromDiscord | <Forest> Sweet, thanks! |
00:59:06 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/docgen.html |
01:00:09 | FromDiscord | <Forest> Thanks! |
01:14:24 | * | pch quit (Read error: Connection reset by peer) |
01:15:42 | FromDiscord | <Tuatarian> are there any possible issues that could arise from using `type u8 = uint8` ? |
01:15:53 | FromDiscord | <Tuatarian> I'm getting kinda annoying having to type out the 5 letters each time |
01:15:59 | FromDiscord | <Elegantbeef> No there isnt |
01:16:03 | FromDiscord | <Elegantbeef> That's what type aliases are there for |
01:17:04 | * | pch joined #nim |
01:21:24 | FromDiscord | <!Patitotective> In reply to @iWonderAboutTuatara "are there any possible": use `byte` |
01:21:37 | FromDiscord | <!Patitotective> 4 letters only lmao |
01:22:40 | FromDiscord | <Elegantbeef> Alternatively stop tying uint8 so much |
01:25:53 | FromDiscord | <Tuatarian> I kinda need to since refactoring :( |
01:29:29 | FromDiscord | <Elegantbeef> I dont see why you need to type it a lot |
01:29:46 | FromDiscord | <Elegantbeef> Like how many functions are you making |
01:33:38 | FromDiscord | <Tuatarian> I have a pretty good number of functions |
01:33:53 | FromDiscord | <Tuatarian> it's mostly because refactoring though |
02:11:56 | FromDiscord | <Forest> What would be the best way to write `WGPUNativeSType` in Nim? |
02:12:05 | FromDiscord | <Forest> Also, what does S Type even mean? Lmao |
02:12:10 | FromDiscord | <Forest> Don't think understand C well |
02:12:18 | FromDiscord | <Elegantbeef> Read the webgpu docs then |
02:13:31 | FromDiscord | <Forest> There's no docs for WGPU-Native |
02:13:54 | FromDiscord | <Forest> Also, it's different to `WebGPU`, based on the standard but it's it's own thing |
02:18:51 | FromDiscord | <Elegantbeef> Refer to the C source then |
02:19:32 | FromDiscord | <Forest> Doesn't explain what it does |
02:19:50 | FromDiscord | <Forest> Just says it starts at 6 to prevent collisions |
02:23:24 | pch | what languages can nim be sent through? |
02:23:40 | FromDiscord | <Prestige> What do you mean? |
02:23:54 | FromDiscord | <Elegantbeef> Think they mean what backends does it have |
02:23:55 | FromDiscord | <Elegantbeef> C/C++/JS/Nimscript |
02:23:57 | pch | I am writing an OS and do not want it to be C-first, but I like nim too much to do all of my opening userspace work without it easy |
02:24:02 | pch | aw crap |
02:24:07 | pch | was hoping to see like |
02:24:11 | pch | pascal, fortran, or erlang |
02:24:12 | pch | or something |
02:24:12 | FromDiscord | <Elegantbeef> There is also nlvm |
02:24:15 | FromDiscord | <Elegantbeef> Which uses llvm |
02:24:23 | pch | great! no. |
02:24:24 | FromDiscord | <Elegantbeef> Well use pascal + nim |
02:24:34 | pch | pascal + nim, but like |
02:24:45 | pch | do I need to set up C early to use nim early there |
02:24:55 | pch | or can I use nim, through pascal instead of through C |
02:25:15 | FromDiscord | <Forest> You'll need to use C |
02:25:25 | FromDiscord | <Forest> Unless ya create a pascal backend for Nim lmao |
02:25:30 | FromDiscord | <Elegantbeef> Nim and pascal share a lot so time to make a pascal backend for Nim |
02:25:31 | pch | everything I have to explicitly get working to start using what I like to use is another step of anguish setting up to actually do work |
02:25:44 | pch | yeah i like |
02:25:46 | pch | dont want to do that |
02:25:50 | pch | not right now anyways |
02:26:12 | FromDiscord | <Elegantbeef> So then just use a pascal that makes you happy then use Nim where you can |
02:26:17 | pch | i guess ill skip nim until i have C compat going later |
02:34:12 | FromDiscord | <Bubblie> how do I check for whether the os nim is running on is windows mac or linux? |
02:34:30 | FromDiscord | <Elegantbeef> `defined(linux)` |
02:39:13 | * | arkurious quit (Quit: Leaving) |
02:50:18 | * | CyberTailor quit (Remote host closed the connection) |
02:51:54 | * | CyberTailor joined #nim |
02:55:11 | FromDiscord | <Forest> What's the preferred case for functions? Camelcase? |
02:55:28 | FromDiscord | <Forest> (is camelcase `newFunctionFive`?) |
02:55:31 | FromDiscord | <huantian> cameCase yes |
02:55:33 | FromDiscord | <Elegantbeef> Lowercase camelCase yes |
02:55:47 | FromDiscord | <Forest> Thanks! And uppercase camelcase for types then? |
02:56:09 | FromDiscord | <Elegantbeef> Yes |
02:56:23 | FromDiscord | <Forest> Sweet |
02:58:02 | * | xcodz-dot joined #nim |
03:01:47 | * | xcodz-dot quit (Client Quit) |
03:01:57 | * | Onionhammer quit (Quit: The Lounge - https://thelounge.chat) |
03:03:12 | * | xcodz-dot joined #nim |
03:03:59 | * | Onionhammer joined #nim |
03:04:29 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=46Yr |
03:05:43 | FromDiscord | <Elegantbeef> You make procedures to create objects or use constructors |
03:08:17 | FromDiscord | <Bubblie> constructors? is there anything on them? |
03:08:23 | xcodz-dot | Is their a way to create custom constructors of a user defined object type? Like `proc Color(): Color` because currently I have to use `proc newColor(): Color` |
03:09:17 | FromDiscord | <Elegantbeef> the convention i like is `proc init(_: typedesc[Color]): Color = ...` |
03:09:23 | FromDiscord | <Elegantbeef> You then do `Color.init()` |
03:10:00 | FromDiscord | <Forest> In reply to @Elegantbeef "the convention i like": That looks so nice wtf |
03:10:07 | xcodz-dot | thanks |
03:10:23 | FromDiscord | <Bubblie> Ah |
03:10:40 | xcodz-dot | only if i had known that earlier I would have had to refactor hundreds of lines |
03:10:50 | xcodz-dot | wouldnt* |
03:11:36 | FromDiscord | <Elegantbeef> And of course for ref object you can do `new` instead |
03:12:03 | FromDiscord | <huantian> I hope your Color isn't a ref object š |
03:12:21 | FromDiscord | <Elegantbeef> I've seen worse huan |
03:14:00 | xcodz-dot | No, I am writing a SDL2 wrapper so I am keeping complexity under the hood |
03:14:12 | xcodz-dot | so that the user doesn't have to deal with it |
03:17:19 | FromDiscord | <Rainbow Asteroids> In reply to @Elegantbeef "You then do `Color.init()`": That looks cool, but I feel like it's a bit misleading. It implies there are Java-like classes in Nim, even though there isn't. And wouldn't `T.new()` shadow the `new` proc in `system`? |
03:17:37 | FromDiscord | <Forest> In reply to @xcodz-dot "so that the user": Oh same here but for wgpu |
03:17:57 | FromDiscord | <Elegantbeef> It's really not |
03:17:59 | FromDiscord | <Elegantbeef> Yes it does but you can do `system.new(Type)` if you need that one |
03:22:27 | xcodz-dot | I have been doing some research recently and is there any way that I can evaluate nimscript in my project? |
03:22:53 | * | ingy left #nim (WeeChat 2.8) |
03:22:54 | FromDiscord | <Elegantbeef> Yes |
03:23:03 | xcodz-dot | please |
03:23:19 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimscripter is the easiest way |
03:25:14 | FromDiscord | <Elegantbeef> The jackass that runs that repo is really bad at documenting |
03:25:15 | FromDiscord | <Elegantbeef> So i guess have fun solving that |
03:26:41 | xcodz-dot | well, for the mast minute, i am questioning my choice of using it or not |
03:27:03 | xcodz-dot | I probabbly would keep it on hold for another month until I am thorough with nim |
03:27:25 | FromDiscord | <Elegantbeef> What are you after though? |
03:27:44 | FromDiscord | <Elegantbeef> This is where i sell you on wasm š |
03:29:32 | xcodz-dot | I am after... learning. |
03:30:08 | xcodz-dot | Oh no no no no, wasm is scary |
03:30:39 | xcodz-dot | I was trying out rust before this but their memory management, although considered revolutionary is pain in the a** |
03:30:46 | FromDiscord | <Elegantbeef> But wasm is just glorious |
03:30:50 | FromDiscord | <Elegantbeef> Any language that supports wasm to script programs! |
03:30:59 | FromDiscord | <Elegantbeef> Wasm is honestly not that bad |
03:31:10 | xcodz-dot | nice, but nim supports js? that makes js support superior? |
03:31:16 | FromDiscord | <Elegantbeef> Sadly there is no Nim native runtime yet |
03:31:29 | xcodz-dot | how do you really bind to native functions with wasm? |
03:31:32 | FromDiscord | <spoon> native runtime? |
03:31:32 | FromDiscord | <Elegantbeef> If you're doing webdev but wasm is more than for webdev |
03:31:38 | xcodz-dot | rust gave me a hard time |
03:31:46 | FromDiscord | <Elegantbeef> Depends on the runtime |
03:31:47 | FromDiscord | <Forest> In reply to @spoon "native runtime?": No JS runtime written in Nim |
03:31:57 | FromDiscord | <Elegantbeef> wasm runtime\ |
03:32:04 | FromDiscord | <Elegantbeef> I've used wasmedge and it's relatively simple |
03:32:24 | FromDiscord | <Rainbow Asteroids> In reply to @Elegantbeef "What are you after": lets say I'm trying to write an extensible program. would that be a use case of wasm? |
03:32:32 | FromDiscord | <Elegantbeef> Yes |
03:32:42 | xcodz-dot | hmm, bye (I am a student and have to attend online classes) |
03:32:43 | FromDiscord | <Rainbow Asteroids> has any Nim project done this? |
03:32:44 | FromDiscord | <Elegantbeef> If you want runtime scripting that's wasm territory |
03:32:50 | * | xcodz-dot left #nim (Leaving) |
03:32:52 | FromDiscord | <Elegantbeef> Buh bye |
03:33:01 | FromDiscord | <Elegantbeef> I've personally toyed with wasm scripting yes |
03:33:13 | FromDiscord | <Elegantbeef> https://github.com/beef331/aiarena is an example project |
03:33:27 | FromDiscord | <spoon> is nimscript ready for any sort of game mod work? or is lua a better pick |
03:33:40 | FromDiscord | <Elegantbeef> Wasm is better than both š |
03:33:49 | FromDiscord | <Elegantbeef> But lua is probably better than nimscript |
03:33:58 | FromDiscord | <spoon> assumed so |
03:34:00 | FromDiscord | <Elegantbeef> It's faster and made to be embedded |
03:34:10 | FromDiscord | <spoon> would love to see nimscript reach that point |
03:34:13 | FromDiscord | <Elegantbeef> Wasm is the best as it allows using any language |
03:34:37 | FromDiscord | <Tuatarian> I have a function `func contains(i : SomeInteger, b : Board) : bool = ...` |
03:34:41 | FromDiscord | <Elegantbeef> I will whore out using wasm for scripting programs until the end of time |
03:34:50 | FromDiscord | <Tuatarian> and I call `z notin b...` |
03:35:01 | FromDiscord | <Tuatarian> but it gives an issue where the order of the params is reversed |
03:35:03 | FromDiscord | <Tuatarian> and I see the issue |
03:35:04 | FromDiscord | <Elegantbeef> `not system.contains(b, a)` |
03:35:06 | FromDiscord | <Tuatarian> now that I have posted it |
03:35:15 | FromDiscord | <Tuatarian> contains proc is for whatever reason |
03:35:19 | FromDiscord | <Tuatarian> specified in the reverse order |
03:35:29 | FromDiscord | <Elegantbeef> `a.contains(b)` |
03:35:33 | FromDiscord | <Elegantbeef> It's specified correctly |
03:35:34 | FromDiscord | <Tuatarian> wasm has pretty garbage debugging |
03:35:40 | FromDiscord | <spoon> might use wasm for other things that are not the thing i'm currently doing |
03:35:53 | FromDiscord | <Elegantbeef> how does wasm have pretty garbage debugging |
03:35:57 | FromDiscord | <Tuatarian> contains puts the container first |
03:35:57 | FromDiscord | <Elegantbeef> It's literally down to the runtime you're using |
03:36:14 | FromDiscord | <Tuatarian> debugging the wasm itself is a pretty terrible experience from what I remember |
03:36:17 | FromDiscord | <Elegantbeef> It's specified in the correct order |
03:36:31 | FromDiscord | <Elegantbeef> I dont get why it would be that terrible |
03:36:34 | FromDiscord | <spoon> you mean writing in wasm directly? |
03:36:42 | FromDiscord | <Tuatarian> `a in b` checks if item a is in container b |
03:36:49 | FromDiscord | <Elegantbeef> yes |
03:36:53 | FromDiscord | <Tuatarian> contains has the container come first though |
03:37:01 | FromDiscord | <Tuatarian> which I disagree with conceptually |
03:37:06 | FromDiscord | <Elegantbeef> Yes cause `a.contains(b)` |
03:37:07 | * | xcodz-dot joined #nim |
03:37:20 | FromDiscord | <Tuatarian> good point |
03:37:25 | FromDiscord | <Elegantbeef> `in` is a template that makes `contains` more expressive |
03:37:28 | FromDiscord | <Tuatarian> great point |
03:37:34 | FromDiscord | <Elegantbeef> If you dont like it, dont use it |
03:37:37 | FromDiscord | <Tuatarian> yes I have no response to that |
03:37:43 | FromDiscord | <Tuatarian> very good point about `a.contains(b)` |
03:37:51 | xcodz-dot | I missed some conversation, what happened? |
03:38:03 | FromDiscord | <Elegantbeef> nothing |
03:38:11 | FromDiscord | <Tuatarian> but I mostly us `in`, so I didn't realize this for a bit |
03:38:29 | FromDiscord | <Elegantbeef> Nim has some nice shortcuts for the common solution |
03:39:15 | FromDiscord | <Elegantbeef> `<` `<=` `>=` `!=` `in` `notin` `not` are all just templates for the corresponding calls |
03:39:34 | FromDiscord | <Elegantbeef> Only having to implement half the problem is nice |
03:46:15 | FromDiscord | <Forest> How expensive is it converting Nim types to C types? |
03:46:30 | FromDiscord | <Forest> (int to cint, string to cstring, float to cfloat, etc) |
03:46:33 | FromDiscord | <Elegantbeef> It doesnt |
03:46:40 | xcodz-dot | zero overhead |
03:47:06 | xcodz-dot | nim stores string just like how cstring does to make it a zero overhead situation |
03:49:02 | FromDiscord | <Forest> Sweet |
03:49:07 | FromDiscord | <Forest> Thanks! |
03:54:06 | xcodz-dot | So I looked at the logs and got confused, `a in b` == `b.contains(a)`? |
03:55:03 | FromDiscord | <Elegantbeef> yes |
03:55:14 | xcodz-dot | thanks |
03:58:39 | xcodz-dot | has anyone written a bare metal os in nim? |
03:59:04 | FromDiscord | <Elegantbeef> https://github.com/dom96/nimkernel |
04:05:53 | xcodz-dot | how tf someone managed to write a kernel in just that many lines? Last time I wrote a kernel in rust, it went way above 400 lines |
04:06:08 | xcodz-dot | Does it support GC? |
04:06:15 | xcodz-dot | or ref objects? |
04:06:22 | FromDiscord | <Elegantbeef> Using arc yes |
04:06:34 | xcodz-dot | now, what is arc? |
04:06:43 | FromDiscord | <Elegantbeef> RAII like memory management |
04:07:00 | xcodz-dot | n wat is RAII? |
04:07:22 | FromDiscord | <Elegantbeef> C++ move semantics and scope based memory management |
04:07:28 | FromDiscord | <Elegantbeef> C++ like\ |
04:07:35 | FromDiscord | <Elegantbeef> How rust manages memory practically |
04:08:07 | xcodz-dot | I quit. I would never in my life ever touch rust memory management again. |
04:08:58 | FromDiscord | <Elegantbeef> Nim isnt Rust |
04:09:16 | FromDiscord | <Elegantbeef> Nim doesnt force ownership on you |
04:10:40 | FromDiscord | <Elegantbeef> Unlike Rust with arc Nim copies when it cannot move |
04:10:50 | FromDiscord | <Elegantbeef> It's a much more programmer friendly system |
04:10:56 | xcodz-dot | oh |
04:10:59 | FromDiscord | <Elegantbeef> The assumption is you know what you're doing |
04:11:15 | xcodz-dot | well, that sounds cozy |
04:11:36 | xcodz-dot | you have no idea, how rust can take the life out of you |
04:11:59 | FromDiscord | <Elegantbeef> Using Arc/Orc is pretty much like using refc |
04:12:22 | FromDiscord | <Elegantbeef> It should be mostly indistinguishable minus the features of the scoped based memory management making it more deterministic |
04:13:05 | xcodz-dot | And, how do one support gc in that environment? like am I suppose to do some manual work? |
04:13:57 | FromDiscord | <Elegantbeef> It's scoped based memory management so as long as you dont have cyclical types at the end of a procedure call all the memory allocated will be freed |
04:14:12 | FromDiscord | <Elegantbeef> All the memory that should be freed\ |
04:14:29 | xcodz-dot | an example of cyclical types? |
04:14:31 | FromDiscord | <Elegantbeef> It's basically just auto insertion of `free` calls |
04:14:40 | FromDiscord | <Elegantbeef> A type that references itself |
04:14:46 | xcodz-dot | k |
04:14:59 | FromDiscord | <Elegantbeef> Arc does not have any way to detect/deallocate cycles so they leak |
04:15:08 | FromDiscord | <Elegantbeef> Orc is Arc + Cycle collector |
04:15:12 | xcodz-dot | hmm, thanks |
04:18:32 | FromDiscord | <riceman> Hey, I would love some help here - i'm pretty stuck. Trying to use winim to do some networking stuff. Does anyone know what this second object is? (`[(stuff)]`): https://media.discordapp.net/attachments/371759389889003532/1006053773707321355/unknown.png |
04:19:24 | * | xcodz-dot quit (Quit: Leaving) |
04:19:37 | FromDiscord | <riceman> Based on the win32 documentation, this should be a 2 dimensional array, like a spreadsheet. However, I can't seem to work out how to properly access values from any other rows than the one you see above. |
04:20:52 | FromDiscord | <riceman> The "Entries" part is the number of rows that should exist in that second object, but I have had 0 luck finding the reality where those rows truly do exist. |
04:21:10 | FromDiscord | <Elegantbeef> It's an array of tuples or an array of objects |
04:23:04 | FromDiscord | <riceman> Thanks for answering, I was worried no one was on! š Do you know of any examples that depict accessing arrays of objects in Nim? Quick googling right now isn't turning up much (though I'm sure I can find something) |
04:23:23 | FromDiscord | <Elegantbeef> The magical thing is looking at the Nim code and the procedure that you called's definition |
04:23:25 | FromDiscord | <Elegantbeef> Giving random outputs isnt a way for anyone to help you |
04:24:26 | FromDiscord | <Elegantbeef> Accessing arrays is just `myArray[index]` |
04:25:11 | FromDiscord | <riceman> of course, that makes sense. Here's the code:āµhttps://play.nim-lang.org/#ix=46Yy |
04:25:19 | FromDiscord | <!Patitotective> In reply to @riceman "Thanks for answering, I": search engines are bad at indexing nim documentation .sk |
04:25:24 | FromDiscord | <!Patitotective> (edit) ".sk" => "š š" |
04:26:54 | FromDiscord | <Rainbow Asteroids> but he was asking and extremely basic question... |
04:27:00 | FromDiscord | <riceman> In reply to @Elegantbeef "Accessing arrays is just": I'm sure I'm missing something super obvious, but I haven't had any luck there. For instance, I can access the individual items seen in the output above, but I can't actually find a way to iterate through rows vertically. |
04:27:34 | FromDiscord | <Rainbow Asteroids> what is this win32 function you're talking about |
04:28:03 | FromDiscord | <Forest> Futhark is so bloated wth... Why is it so bloated? |
04:28:04 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46Yz |
04:28:20 | FromDiscord | <Elegantbeef> To support the features it has |
04:28:27 | FromDiscord | <Forest> Like, the generated code is so massive |
04:28:31 | FromDiscord | <Forest> In reply to @Elegantbeef "To support the features": Ah |
04:29:00 | FromDiscord | <!Patitotective> In reply to @Forest "Like, the generated code": _PRs welcome_ |
04:29:14 | FromDiscord | <Forest> I need to work on a small tool to automate renaming functions to be more idiomatic |
04:29:32 | FromDiscord | <Forest> Like `wgpuCommandBufferDrop` to `commandBufferDrop` automatically |
04:29:34 | FromDiscord | <Elegantbeef> You do know futhark has a rename callback |
04:29:40 | FromDiscord | <Forest> ...what? |
04:29:48 | FromDiscord | <Elegantbeef> > If you want to implement more complex renaming you can use the renameCallback directive and pass in a callback function that takes the original name, a string denoting what kind of identifier this is, and an optional string denoting which object or procedure this identifier occurs in, and which returns a new string. This callback will be inserted into the renaming logic and will be called on the original C identifier before all the |
04:29:54 | FromDiscord | <Elegantbeef> RTFM |
04:30:17 | FromDiscord | <Forest> I skimmed past that |
04:30:20 | FromDiscord | <Forest> I am so dumb |
04:30:25 | FromDiscord | <Elegantbeef> `proc myCallback(name, kind, place: string): string` |
04:30:26 | FromDiscord | <Forest> Thank you, this'll be a life saver |
04:30:28 | FromDiscord | <riceman> @ElegantBeef Thanks for the answer! I think something must be going wrong in my usage of winim, because it doesn't appear that there are any rows. Hmm... I saw this before and thought I must have been doing something wrong https://media.discordapp.net/attachments/371759389889003532/1006056776900292699/unknown.png |
04:30:55 | FromDiscord | <Elegantbeef> You're iterating too far |
04:32:22 | FromDiscord | <Forest> In reply to @Elegantbeef "`proc myCallback(name, kind, place:": Now i gotta figure out how to make it all uniform and follow camelcase (wasn't there a library for this a while ago?) |
04:32:34 | FromDiscord | <!Patitotective> ~~pmunch really likes long text ngl~~ |
04:34:27 | * | xcodz-dot joined #nim |
04:35:53 | FromDiscord | <riceman> Ah, the iterator was correct but the object within wasn't. With that fixed, there seem to be some type errors. Is a typecast the correct way to go about dealing with this?āµhttps://play.nim-lang.org/#ix=46YA |
04:36:10 | FromDiscord | <riceman> Thanks a million for the guidance, by the way. I have been at this for hours! |
04:38:10 | FromDiscord | <Elegantbeef> No a typecast is not the correct way |
04:38:21 | FromDiscord | <Elegantbeef> You're attempting to index an object |
04:39:38 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46YB |
04:40:15 | FromDiscord | <riceman> Ah, that's the code that outputted the above "index 1 not in 0 .. 0" |
04:40:36 | FromDiscord | <Elegantbeef> https://github.com/khchen/winim/blob/bda7de3b63f4644183a2b70cb9163b61e2320f12/winim/inc/iphlpapi.nim#L315-L325 |
04:40:39 | FromDiscord | <Elegantbeef> Look at the type defs |
04:41:14 | FromDiscord | <Forest> https://github.com/PMunch/futhark/blob/master/src/opir.nim#L27 poking around, what is this- |
04:41:25 | FromDiscord | <Forest> Nim calling convention? |
04:41:53 | FromDiscord | <Elegantbeef> Cmon people RTFM! |
04:42:01 | FromDiscord | <Forest> #google |
04:42:09 | FromDiscord | <Elegantbeef> No |
04:42:25 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#types-procedural-type |
04:43:03 | FromDiscord | <Forest> Yeah google took me to that page |
04:43:21 | FromDiscord | <Forest> (after using find to get the keywords) |
04:43:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46YC |
04:43:57 | FromDiscord | <Elegantbeef> It does exceed the buffer though |
04:45:20 | FromDiscord | <Elegantbeef> Should be `0..<` of course |
04:45:24 | FromDiscord | <Elegantbeef> I was testing |
04:45:50 | FromDiscord | <riceman> If it returns 122 and says buffer exceed, the returned data is inaccurate, unfortunately |
04:46:00 | FromDiscord | <Elegantbeef> Yes i know |
04:46:11 | FromDiscord | <Elegantbeef> I'm not on windows so i cannot properly test the code |
04:46:22 | FromDiscord | <Elegantbeef> I get stack overflow issues if i incrrease `ulSize` |
04:47:14 | FromDiscord | <riceman> Ah, if I increase ulSize, it gets the appropriate TcpTable2 data but returns the "index 1 not in 0 .. 0" error message. |
04:47:31 | FromDiscord | <Elegantbeef> how many `dwNumEntires` do you get? |
04:47:43 | FromDiscord | <riceman> The correct amount, about 250 |
04:48:04 | FromDiscord | <Elegantbeef> That array is only capable of holding a single element |
04:48:09 | FromDiscord | <Elegantbeef> `Any_Size` is 1 |
04:48:46 | FromDiscord | <Elegantbeef> Oh god |
04:48:48 | xcodz-dot | I am infact on windows, want me to test? |
04:48:59 | FromDiscord | <Elegantbeef> No i see the stupidity |
04:49:19 | FromDiscord | <Elegantbeef> Windows defined that table as a `MIB_TCPROW2 table[ANY_SIZE];` which is what the nim library imported it as |
04:49:41 | FromDiscord | <Elegantbeef> But it seems `table` is an `ptr UncheckedArray[MibTcpRow2]` actually |
04:50:31 | FromDiscord | <riceman> aha, so is that a winim issue? I was beating my head against the wall |
04:50:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46YD |
04:50:52 | FromDiscord | <Elegantbeef> No it's a windows issue really |
04:51:19 | FromDiscord | <Elegantbeef> Like i said it's `MIB_TCPROW2 table[ANY_SIZE];`, but the docs sayāµ> A pointer to a table of TCP connections implemented as an array of MIB\_TCPROW2 structures. |
04:52:04 | FromDiscord | <Elegantbeef> Shit sorry that's supposed to be `table.table[0].addr` |
04:53:05 | FromDiscord | <Elegantbeef> Are you following https://docs.microsoft.com/en-us/windows/win32/api/tcpmib/ns-tcpmib-mib_tcptable2#examples ? |
04:53:21 | FromDiscord | <riceman> Yep, that was what I was porting. |
04:53:42 | FromDiscord | <riceman> sent a code paste, see https://play.nim-lang.org/#ix=46YE |
04:53:45 | FromDiscord | <riceman> the table.table is throwing it off |
04:53:49 | FromDiscord | <Elegantbeef> Yes i wasnt writing the entire variable name |
04:53:55 | FromDiscord | <Elegantbeef> That variable name is atrocious |
04:54:03 | FromDiscord | <riceman> ah š |
04:55:45 | FromDiscord | <Elegantbeef> that's a nasty API |
04:56:05 | FromDiscord | <riceman> Yes, it's been painville. |
04:56:26 | FromDiscord | <riceman> To confirm, you're saying it should be `pTcpTable.table[0].addr`? |
04:56:27 | FromDiscord | <Elegantbeef> it abuses a static C array for no reason really |
04:56:41 | FromDiscord | <Elegantbeef> Correct |
04:56:54 | FromDiscord | <riceman> (19, 14) Error: undeclared identifier: 'table'āµ: ( |
04:57:37 | FromDiscord | <riceman> believe it or not, this is a heavily used windows API for network tables. Rough intro to win32 api for me |
04:57:40 | FromDiscord | <Elegantbeef> You've done something wrong |
04:58:02 | FromDiscord | <Elegantbeef> You have another `table.table` somewhere i asssume |
04:58:18 | FromDiscord | <Elegantbeef> Yea i mean this is just a badly written apiāµ(@riceman) |
04:58:37 | FromDiscord | <Elegantbeef> They make it more confusing by using a static sized array, for no reason |
04:58:55 | FromDiscord | <riceman> OMG! IT WORKS! I owe you my life. |
04:59:14 | FromDiscord | <Elegantbeef> Well while you owe me something might i suggest installing a real OS š |
04:59:40 | FromDiscord | <riceman> haha! I'm a native linux user but I have to use Windows for work, sadly. It's been a rough transition! |
04:59:43 | FromDiscord | <Elegantbeef> https://github.com/khchen/winim/blob/bda7de3b63f4644183a2b70cb9163b61e2320f12/winim/inc/winerror.nim#L87 also their errors exist |
05:00:01 | FromDiscord | <riceman> Ah, perfect. I hadn't found that in my googling, thank you! |
05:00:02 | FromDiscord | <Elegantbeef> I mean if you had to deal with any code like the above i'd believe you |
05:00:07 | FromDiscord | <Elegantbeef> Dont google |
05:00:13 | FromDiscord | <Elegantbeef> Search the repo directly |
05:00:25 | FromDiscord | <Elegantbeef> Search engines suck, github search is ok, and searching locally is the best |
05:00:44 | xcodz-dot | Google should prolly provide api for sites to become more discoverable |
05:00:45 | FromDiscord | <Bubblie> is there any example of the renameCallback being used? |
05:00:49 | FromDiscord | <Bubblie> in futhark that is |
05:01:07 | FromDiscord | <Elegantbeef> Bubblie look at my wasmedge library |
05:01:09 | FromDiscord | <riceman> I'll start using that as my first line of attack. Thanks a ton, I really appreciate it. |
05:01:23 | FromDiscord | <Elegantbeef> No problem |
05:01:30 | FromDiscord | <Elegantbeef> I'm still just in awe at that api |
05:02:09 | FromDiscord | <Elegantbeef> Why the hell dont they just do `MibTcpRow2` and have another `MibTcpRow2` field, it's the same semantics but much much more clear |
05:02:41 | FromDiscord | <riceman> Wait until you see the undocumented windows APIs. I think it gets much darker than this... |
05:02:50 | FromDiscord | <Elegantbeef> I'm good |
05:02:56 | FromDiscord | <Bubblie> In reply to @Elegantbeef "Bubblie look at my": okay |
05:03:00 | FromDiscord | <Bubblie> thank you :) |
05:03:04 | FromDiscord | <Elegantbeef> I cant stand this stupidity of weakly typed/unchecked code |
05:03:09 | FromDiscord | <Elegantbeef> It's just so dumb |
05:04:17 | FromDiscord | <riceman> Dumb indeed. Thanks again for your help, I'm headed to bed. Have a good evening! |
05:04:23 | FromDiscord | <Elegantbeef> Buh bye |
05:04:32 | FromDiscord | <Elegantbeef> Why did i have to see this code, it offends me so much |
05:06:03 | FromDiscord | <flywind> Do you think it is gonna to submit the sample to windows defender? https://github.com/quantimnot/nim_windows_defender/blob/master/.github/workflows/windows_defender.yml |
05:06:09 | FromDiscord | <flywind> (edit) removed "to" |
05:07:33 | FromDiscord | <Elegantbeef> I'd wager it sends the signature to MS but no clue |
05:07:35 | FromDiscord | <flywind> I can add something like this to our CI. |
05:07:52 | xcodz-dot | riceman is going to bed while I just woke up an hour ago in the morning |
05:08:47 | FromDiscord | <flywind> In reply to @Elegantbeef "I'd wager it sends": Anyway I will add a cron everyday somewhere. |
05:23:23 | FromDiscord | <!&luke> I'm wrapping an api, and I'm only 6/57 endpoints throughš |
05:23:29 | FromDiscord | <!&luke> This will take a while |
05:25:35 | xcodz-dot | I am wrapping sdl2 with pygame like api and I have barely managed to create a empty window |
05:26:21 | FromDiscord | <!&luke> Is it more efficient to write testes while wrapping, or after wrapping |
05:28:39 | xcodz-dot | probabbly during wrapping so you find out bugs instantly rather afterwards where you are forced to search through whole codebase |
05:29:02 | xcodz-dot | but chads like me do not write tests |
05:29:14 | xcodz-dot | ;) |
05:45:02 | * | xcodz-dot quit (Quit: Leaving) |
06:13:08 | FromDiscord | <Elegantbeef> You cant test code you cannot runāµ(@!&luke) |
06:23:00 | * | pch is now known as disso_peach |
06:47:31 | * | om3ga quit (Ping timeout: 252 seconds) |
07:19:28 | FromDiscord | <Freakwill (William Song)> I want to generate a fixed-length array randomly. I use `collect(for _ in 1..3: rand(1))` and try to convert it to an array which is not easy. Dose there exist some direct way to achieve it? |
07:23:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46Zg |
07:27:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46Zh |
07:32:04 | FromDiscord | <Zectbumo> In reply to @xcodz-dot "I am wrapping sdl2": for fun or why not use nimgame https://nimble.directory/pkg/nimgame2 |
07:40:30 | FromDiscord | <Freakwill (William Song)> thanks a lot |
08:18:58 | * | attah quit (Ping timeout: 240 seconds) |
08:19:03 | * | def- quit (Quit: -) |
08:19:15 | * | def- joined #nim |
08:22:54 | * | attah joined #nim |
08:34:19 | FromDiscord | <Bung> I've developed a gui app on windows 11, based on webgui , my app use local file resources , js css etc. but when I move exe to other location , it still works , does it means I dont need bundle static resource to exe ? |
08:35:04 | FromDiscord | <enthus1ast> browsercache maybe? |
08:35:28 | FromDiscord | <Bung> oh, maybe or app level cache ? |
08:35:53 | FromDiscord | <Bung> so I indeed need bundle these resources. |
08:38:08 | * | rockcavera quit (Remote host closed the connection) |
08:46:54 | FromDiscord | <enthus1ast> which webgui do you have used? |
08:49:28 | FromDiscord | <Bung> https://github.com/juancarlospaco/webgui 0.9.0 the master branch doesn't even show page |
08:50:34 | FromDiscord | <Bung> also I use local modification version , see my last PR |
09:19:13 | FromDiscord | <d4rckh> Is there any alternative for rust's clap in nim? |
09:20:14 | * | CyberTailor quit (Remote host closed the connection) |
09:20:39 | FromDiscord | <Elegantbeef> cligen, argparse, there are a bunch of CLI parsers |
09:28:09 | FromDiscord | <Elegantbeef> Annoyingly you cannot get doc comments from the type after the code |
09:28:34 | FromDiscord | <Elegantbeef> I was thinking about trying to do something similar but doc comments are not in macros |
09:36:19 | FromDiscord | <EyeCon> In reply to @Elegantbeef "cligen, argparse, there are": Also therapist: https://bitbucket.org/maxgrenderjones/therapist/src/master/ |
09:38:56 | FromDiscord | <Bung> can i make proc body call readFile or staticRead depends on caller whether use `static:` |
09:39:46 | FromDiscord | <Elegantbeef> No you can take a `static bool` as a parameter |
09:41:41 | FromDiscord | <Bung> okay, thanks |
09:44:08 | NimEventer | New thread by Drkameleon: How to use Github's actions/cache with Nim?, see https://forum.nim-lang.org/t/9354 |
09:59:37 | * | attah quit (Ping timeout: 245 seconds) |
10:04:21 | * | attah joined #nim |
10:51:40 | * | wallabra_ joined #nim |
10:53:01 | * | wallabra quit (Ping timeout: 268 seconds) |
10:53:18 | * | wallabra_ is now known as wallabra |
10:59:22 | FromDiscord | <Forest> Heya so I'm using a rename callback on futhark and most things seem to work, but some things like `Wgpushaderdefine" still show up when I'm trying to remove the prefix |
11:00:09 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=4701 |
11:04:15 | FromDiscord | <mischa_u> Your first replace is overwritten. By the 2nd `else: name` when it doesn't matches against the 3rd prefix |
11:04:32 | FromDiscord | <mischa_u> (edit) "overwritten. By" => "overwritten by" |
11:06:10 | FromDiscord | <Forest> Aah that makes sense |
11:06:13 | FromDiscord | <Forest> Thanks! |
11:08:50 | FromDiscord | <Forest> It's not automatically using Camelcase and that's annoying- |
11:52:10 | FromDiscord | <krisppurg> Is there a reason why does sometimes `stream.readStr(...)` take longer on windows when reading from an `outputStream` from a `Process`? |
11:55:12 | FromDiscord | <Phil> In reply to @krisppurg "Is there a reason": Longer than what? |
11:55:25 | FromDiscord | <Phil> Or just that it sometimes takes long in general? |
11:56:42 | FromDiscord | <krisppurg> it sometimes take long like 1 second or >100ms |
12:15:21 | FromDiscord | <krisppurg> In reply to @Isofruit "Or just that it": either long in general ig |
12:20:50 | FromDiscord | <noiryuh> sent a code paste, see https://play.nim-lang.org/#ix=470h |
12:27:58 | FromDiscord | <Shiba> where is stdlib_tables.nim located ? |
12:27:59 | FromDiscord | <Rika> Nim doesnāt have the concept of const pointer from C++ so itās a copy |
12:32:53 | FromDiscord | <noiryuh> In reply to @Rika "Nim doesnāt have the": it's not from C++ |
12:33:16 | FromDiscord | <noiryuh> but thanks |
12:34:04 | FromDiscord | <noiryuh> welp, i'm trying using https://github.com/treeform/pixie in C |
12:35:08 | FromDiscord | <noiryuh> but the `pixie_read_image(path: char)` (probably from `proc pixie_read_image(path: cstring)`)āµit's a mutable string |
12:35:33 | FromDiscord | <noiryuh> (edit) "string" => "string, for file path" |
12:35:47 | FromDiscord | <noiryuh> (edit) "cstring)`)āµit's" => "cstring) {.exportc.}`)āµit's" |
12:38:26 | FromDiscord | <noiryuh> sent a code paste, see https://play.nim-lang.org/#ix=470n |
12:39:46 | * | oz joined #nim |
12:40:15 | * | oz is now known as Guest7938 |
12:40:23 | FromDiscord | <noiryuh> so i just want to make sure i could use `const char` without any trouble |
12:46:42 | FromDiscord | <Rika> In reply to @noiryuh "it's not from C++": Iām forgetful of what C has or doesnāt |
12:56:02 | FromDiscord | <mersenne> How would I write a micro/picokernel in nim, and use gnu grub as the bootloader? |
12:57:32 | FromDiscord | <Rika> Thatās very broad |
13:08:54 | FromDiscord | <Shiba> In reply to @Shiba "where is stdlib_tables.nim located": ! |
13:24:33 | FromDiscord | <auxym> huh? why? depends on your OS anyways and your installation method (choosenim etc) |
13:25:42 | FromDiscord | <auxym> and I think the file is just called tables.nim |
13:36:15 | FromDiscord | <Professor Actual Factual> sent a long message, see http://ix.io/470F |
13:37:04 | FromDiscord | <Professor Actual Factual> (edit) "http://ix.io/470F" => "http://ix.io/470G" |
13:45:44 | FromDiscord | <auxym> never heard of that. The nim compiler always does dead code elimination though? so whatever you don't use isn't included in the final binary |
13:47:40 | * | arkurious joined #nim |
13:50:49 | FromDiscord | <mersenne> In reply to @Rika "Thatās very broad": So I mean write a small kernel in Nim, in place of a language like C or Cpp. |
13:51:02 | * | jmdaemon quit (Ping timeout: 240 seconds) |
13:51:57 | FromDiscord | <Rika> Yeah, thatās still very broad; you can basically follow a kernel tutorial for C but do it in Nim |
13:52:18 | FromDiscord | <Rika> If you have questions whilst doing so then please ask those instead because itās hard to tell you how to do such a big task |
13:52:45 | FromDiscord | <Rika> There are already some kernels in Nim |
13:52:56 | FromDiscord | <Rika> I donāt remember the name but a quick search on GitHub should suffice |
14:01:14 | NimEventer | New post on r/nim by Mibuna: OSDev in Nim, see https://reddit.com/r/nim/comments/wj9l8t/osdev_in_nim/ |
14:08:39 | * | Guest7938 is now known as om3ga |
14:23:29 | FromDiscord | <auxym> @mersenne have you seen Rika's suggestion of searching github? https://github.com/dom96/nimkernel |
14:44:39 | * | rockcavera joined #nim |
14:44:39 | * | rockcavera quit (Changing host) |
14:44:39 | * | rockcavera joined #nim |
14:53:55 | * | xcodz-dot joined #nim |
14:55:45 | xcodz-dot | how does one write windows specific code? is there some sort of template? |
14:59:47 | FromDiscord | <Rika> Thereās a define flag āwhen defined windows:ā I think? |
15:02:13 | FromDiscord | <!&luke> sent a code paste, see https://play.nim-lang.org/#ix=471b |
15:02:37 | FromDiscord | <!&luke> Replace the echo with what you want to do |
15:03:02 | FromDiscord | <leorize> use `when defined(windows)` for compile-time selection |
15:05:34 | xcodz-dot | thanks! and what are the keywords for mac, linux and all other supported platforms? |
15:06:10 | * | derpydoo joined #nim |
15:06:37 | FromDiscord | <leorize> there is a 1\:1 mapping between `--os:` and those symbols |
15:06:53 | FromDiscord | <leorize> `macosx` for mac, `linux` for linux, etc. |
15:07:33 | FromDiscord | <leorize> some "broader" symbols\: `posix` for POSIX-like OS (incl. linux, mac, bsd) and `bsd` for any BSD |
15:22:14 | * | xcodz-dot quit (Ping timeout: 255 seconds) |
15:35:23 | * | xcodz-dot joined #nim |
15:37:11 | xcodz-dot | exit |
15:37:14 | * | xcodz-dot quit (Client Quit) |
15:39:54 | FromDiscord | <Rika> this isnt your shell's input š |
15:58:35 | FromDiscord | <Forest> Is there a way to tell Futhark to keep the original casing of the header files? |
16:14:01 | NimEventer | New post on r/nim by Ok_World__: My first Nim project - qwatcher, see https://reddit.com/r/nim/comments/wjcube/my_first_nim_project_qwatcher/ |
16:16:49 | FromDiscord | <Rika> cool |
16:19:43 | FromDiscord | <Forest> :p |
16:27:29 | FromDiscord | <Forest> In reply to @Forest "Is there a way": Anyone? |
16:28:07 | FromDiscord | <Forest> Ig i could use a custom rule then use manual rename calls after for lower case to custom cased |
16:28:12 | FromDiscord | <Forest> Camelcased |
16:40:27 | FromDiscord | <Shiba> its takes me 10 seconds to compile my project |
16:41:11 | FromDiscord | <Shiba> is there anything useless i can remove from those standard libaries to speed this |
16:41:15 | FromDiscord | <Shiba> im gonna try |
16:41:20 | FromDiscord | <Shiba> (edit) "this" => "this?" |
16:44:06 | * | vicecea quit (Remote host closed the connection) |
16:44:35 | * | vicecea joined #nim |
17:20:03 | FromDiscord | <planetis> Last time I checked it used the .nimcache directory and created a random name for each run. So maybe remove that logic? |
17:37:10 | FromDiscord | <Phil> Trying to wrap my head around how norm converts types and man it isn't easy |
17:39:34 | FromDiscord | <flywind> Which part is hard? |
17:41:12 | FromDiscord | <Phil> I'm trying to basically "convert" it's "fromRowPos" proc into something that could work with normal objects instead of a Model type (because I want a utility proc that accepts raw sql, executes it and converts the object into a random object-type given by the user)āµāµHowever, that proc does bonkers stuff with optionals and recursion that runs into additional issues when you start wanting to use normal objects, one sec |
17:41:29 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/Cij |
17:42:28 | FromDiscord | <Phil> Now, for some elaboration:āµ`isModel` is a proc that works on `Option[ModelType]` as well as `ModelType`, so keep that in mind.āµ`model` is a proc that will implicitly convert any value of type `ModelType` into a value of type `Option[ModelType` (the `some` version) |
17:44:08 | FromDiscord | <flywind> What's your modified version? |
17:44:16 | FromDiscord | <Phil> And the proc expects to receive an object that it can fill.āµYou also have to keep in mind that there's essentially 2 things that can be nil:āµEither a column-value from the row can be nil (`row[pos].kind == dvkNull`) OR the `value` may be another field of type `Model` which might be nil, in that case you want to not fil it. |
17:47:24 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=471S |
17:48:51 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=471T |
17:49:52 | FromDiscord | <Phil> The first issue for this is that I have no func that covers `string` for now, which can be fixedāµBut there's also int, float and bool and it's a bit weird to define the same proc 5 times |
17:50:08 | FromDiscord | <flywind> `typeof(value).isObject()` shoud be `isObject(T)` |
17:50:40 | FromDiscord | <flywind> And add a overload for `isObject` should work: `func isObject[T](val: T): bool = false` |
17:50:48 | FromDiscord | <Phil> fromRawPos is not a generic so it doesn't have a T |
17:51:19 | FromDiscord | <flywind> (edit) "`isObject(T)`" => "`isObject(value)`" |
17:52:03 | FromDiscord | <Phil> Wait, god damnit was I trapped in my entire thinking of wanting to have things compiletime when moigagoo did all his things at runtime |
17:52:14 | FromDiscord | <flywind> `typeof(value)` returns `typedesc` not the actual value |
17:52:24 | FromDiscord | <Phil> Which is likely why I went "typeof" because I used that a lot in the other features I added to norm where I moved as much as I could into compiletime |
17:52:46 | FromDiscord | <Phil> Though for now I just want to have something that works and can refactor stuff into compiletime when I get there |
17:52:56 | FromDiscord | <flywind> if `typeof(value)` is object or `typeof(value)` is ref can probably work too. |
17:53:07 | FromDiscord | <flywind> (edit) "if" => "``if" | "is" => "``āµis" |
17:53:14 | FromDiscord | <flywind> (edit) "`typeof(value)`" => "`typeof(value)`:" |
17:53:27 | FromDiscord | <flywind> (edit) "`typeof(value)`:" => "`typeof(value)` is ref:" |
17:53:33 | FromDiscord | <flywind> (edit) "``āµis ref can" => "``āµcan" |
17:53:43 | FromDiscord | <Phil> For now I'm only covering the case of the object being a value type, ref type would need me de-referencing for the fieldpairs iterator |
17:53:46 | FromDiscord | <flywind> (edit) "`typeof(value)`" => "typeof(value)" | "`typeof(value)`" => "typeof(value)" |
18:00:46 | FromDiscord | <Phil> Do we have some sort of pretty-print proc? |
18:01:00 | FromDiscord | <Phil> Like python's pretty print module? |
18:03:27 | FromDiscord | <flywind> I use repr everything, treeform probably has a pretty print module irrc |
18:03:36 | FromDiscord | <flywind> (edit) "I use repr ... everything," added "to print" |
18:03:58 | FromDiscord | <Phil> In reply to @flywind "I use repr to": I'd pretty much love a pretty print of a repr of an array |
18:04:27 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=471Y |
18:04:34 | FromDiscord | <flywind> https://github.com/treeform/print |
18:05:09 | FromDiscord | <Phil> I am smart, if you don't use repr with print it even does the indentation really well |
18:09:46 | FromDiscord | <Forest> What's the nim alternative to `shutil.which` from Python? It tries to get the full path of the binary from checking in the path |
18:14:34 | FromDiscord | <Forest> getAppDir gets the current executable, not the name of the executable i need bta |
18:14:36 | FromDiscord | <Forest> Btw |
18:14:45 | FromDiscord | <Sabena Sema> probably `os.findExe` |
18:14:50 | FromDiscord | <Forest> Thanks! |
18:28:50 | FromDiscord | <Sabena Sema> was programming in julia for a bit and wow, nim's macro system is so, so much better |
18:29:06 | FromDiscord | <Sabena Sema> the whole multi-stage semantic analysis makes things so much more useful |
18:32:17 | FromDiscord | <Rika> Mind elaborating whatās wrong with Julia in this sense? |
18:32:28 | FromDiscord | <Rika> Most of us arenāt familiar with Julia |
18:32:44 | FromDiscord | <Sabena Sema> macros in julia operate only on the syntax tree, before any semantic analysis |
18:32:51 | FromDiscord | <Sabena Sema> so the input has no type information at all |
18:33:36 | FromDiscord | <Sabena Sema> and the macro can't make any decisions based on the types (well, it sorta can, it can "eval" in the calling module's global scope to figure out type information, but obviously this isn't great for performance) |
18:35:43 | FromDiscord | <Sabena Sema> sent a code paste, see https://play.nim-lang.org/#ix=4725 |
18:35:45 | FromDiscord | <Sabena Sema> because the macro can't access the names of the fields! |
18:35:51 | FromDiscord | <Rika> Fun |
18:37:03 | FromDiscord | <Sabena Sema> the "reason" for this is that if macros could have access to the types then type analysis is no longer really "one step" since macros could generate yet more types |
18:37:21 | FromDiscord | <Sabena Sema> oh, wait, I think the above example might be possible with generated functions |
18:37:48 | FromDiscord | <Sabena Sema> but generated functions are macros that define the _body_ of an actual function, so they can't mess with the calling scope |
18:52:01 | * | kenran joined #nim |
19:02:00 | FromDiscord | <Forest> Is there a bot that uses the outputted json from nimdocs to let ya search through them within discord or? |
19:02:23 | FromDiscord | <Forest> If not, I'll need to work on it |
19:02:35 | FromDiscord | <Rika> Why though just asking |
19:02:38 | FromDiscord | <leorize> `nim jsondoc`, the output is horrendous, though |
19:03:14 | FromDiscord | <Forest> In reply to @Rika "Why though just asking": More convenient and searching via google is tedious and generally bleh |
19:03:21 | FromDiscord | <Forest> In reply to @leorize "`nim jsondoc`, the output": Hm |
19:03:57 | FromDiscord | <Forest> Also, funni |
19:03:59 | FromDiscord | <Rika> Iām at the point where when I think of a proc I immediately can tell what module itās in so |
19:04:09 | FromDiscord | <Rika> At least for commonly used procs |
19:04:10 | FromDiscord | <Rika> Xd |
19:04:52 | FromDiscord | <Forest> Fair |
19:05:39 | FromDiscord | <Forest> How do i make nimble generate the docs? |
19:05:48 | FromDiscord | <Forest> For projects such as the Nim repo itself lmao |
19:06:04 | * | jmdaemon joined #nim |
19:07:12 | FromDiscord | <leorize> `nim doc --outdir:html --project /path/to/your/entry/file.nim` |
19:07:33 | FromDiscord | <Forest> Thanks! |
19:07:35 | FromDiscord | <leorize> you can repeat that command for every entry files you have, they will be linked together |
19:08:30 | FromDiscord | <Forest> It has no specific entry file uh |
19:08:31 | FromDiscord | <leorize> here is how I generate mine in CI in case you're interested\: https://github.com/alaviss/nim-sys/blob/0830710e5b9743215ab8511e8cf5ff503c6860d9/.github/workflows/ci.yml#L76-L89 |
19:08:33 | FromDiscord | <Forest> For compiler |
19:08:41 | FromDiscord | <leorize> for Nim itself, `./koch docs` |
19:08:52 | FromDiscord | <Forest> Ooh thanks! |
19:09:15 | FromDiscord | <Forest> In reply to @leorize "for Nim itself, `./koch": Need to create docs in the form of json specifically, unless you're suggesting i parse the html instead? |
19:09:21 | FromDiscord | <leorize> the compiler entry file is `compiler/nim.nim`, if you ever need to generate that by hand |
19:09:38 | FromDiscord | <leorize> check out `tools/kochdocs.nim`, it's the code that drives `./koch docs` |
19:09:51 | FromDiscord | <Forest> Aah thank you! |
19:15:50 | * | kenran quit (Quit: WeeChat info:version) |
19:28:44 | FromDiscord | <Sabena Sema> In reply to @Forest "More convenient and searching": the doc index is generally good for searching, although it would be nice to have some more organization in the docs |
19:30:43 | FromDiscord | <Forest> Fair |
19:30:52 | FromDiscord | <Forest> Would still be nice for a way to do it in discord |
19:31:20 | FromDiscord | <leorize> the index is available as `<module>.idx` on Nim documentation site |
19:31:31 | FromDiscord | <leorize> a bot to search through it is certainly possible |
19:32:32 | FromDiscord | <Sabena Sema> more output formats for the index would be neat |
19:32:41 | FromDiscord | <Sabena Sema> a devhelp2 index would be cool |
19:32:53 | FromDiscord | <Forest> Oh hm that'd be sweet then |
19:34:59 | FromDiscord | <leorize> oh lol I just did a quick test on the doc page |
19:35:14 | FromDiscord | <leorize> turns out the search box fetches theindex.html then search based on it |
19:35:23 | FromDiscord | <leorize> I thought it used the `idx` files |
19:37:09 | FromDiscord | <Sabena Sema> does chronos use iocp on windows and uring on linux? |
19:37:11 | FromDiscord | <Sabena Sema> or is it epoll? |
19:37:13 | * | def- quit (Quit: -) |
19:37:17 | FromDiscord | <Sabena Sema> or god forbid select!? |
19:37:25 | * | def- joined #nim |
19:37:40 | FromDiscord | <leorize> epoll |
19:38:07 | FromDiscord | <Sabena Sema> does it have a thread pool for like file opening and closing? |
19:39:44 | FromDiscord | <Forest> Ah rip |
19:39:49 | FromDiscord | <leorize> a quick skim shows that it doesn't support regular files at all |
19:40:36 | FromDiscord | <Sabena Sema> ah |
19:51:53 | FromDiscord | <Sabena Sema> tbf tokio is kinda the main thing drawing me toward rust, though idk if it's actually faster than say, libuv with the uring backend |
19:52:18 | FromDiscord | <Sabena Sema> I really wanna see an async runtime designed from the ground up for only completion queue based APIs |
19:52:18 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=472j |
19:52:55 | FromDiscord | <leorize> I was working on that, but school got in the way \:P |
19:53:09 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=472j" => "https://play.nim-lang.org/#ix=472k" |
19:53:32 | FromDiscord | <leorize> https://github.com/alaviss/nim-sys/pull/24 \<- you can see this for a sockets implementation |
19:55:45 | FromDiscord | <Sabena Sema> that looks like it uses epoll tho |
19:55:53 | FromDiscord | <Sabena Sema> although it adapts it to a more queue based api |
19:57:08 | FromDiscord | <leorize> the goal is\: stuff done inside async has to be the same as stuff done outside async |
19:57:20 | FromDiscord | <Sabena Sema> like the same API? |
19:58:27 | FromDiscord | <leorize> yea |
19:58:59 | FromDiscord | <Sabena Sema> yeah, I've never quite understood why the APIs are ever different (assuming you're using state-machine type coroutines) |
19:59:36 | FromDiscord | <leorize> the idea of completion interface is that\: if stuff can't be done now, it would be queued and you will only get the final result |
19:59:40 | FromDiscord | <lantos> @dom96 hey could you please help me with gaining access to my forum account peterm tried to yesterday but the email password reset isn't working |
19:59:41 | FromDiscord | <Sabena Sema> Like it's quite different code, but I don't see why you couldn't make each "suspend point" a synchronous call instead |
20:00:50 | FromDiscord | <Sabena Sema> In reply to @leorize "the idea of completion": sure, but if I want async IO I really want everything to be queued (to allow reordering, if nothing else) |
20:02:24 | FromDiscord | <leorize> that's a different model and can be easily built on top of my design \:P |
20:02:44 | FromDiscord | <Sabena Sema> for the stuff that the kernel doesn't know how to do async I usually do want a thread pool (notably if only the IO ops happen on the pool you don't get into trouble with threadpool work spawning other threadpool in situations where that spawn isn't a tail call |
20:03:03 | FromDiscord | <Sabena Sema> actually: I think I lot of io_uring ops are implemented by just doing them in a kernel threadpool |
20:03:26 | FromDiscord | <Sabena Sema> this still saves you syscalls and some memory though |
20:04:39 | FromDiscord | <Forest> How do i delete a node from a json node? |
20:05:28 | FromDiscord | <leorize> there should be a `delete` proc or smt |
20:05:31 | FromDiscord | <Forest> I have a json file which is an array containing dictionaries (tables?) and i need to delete a few of them from the table |
20:05:36 | FromDiscord | <Forest> In reply to @leorize "there should be a": That's only for strings |
20:05:47 | FromDiscord | <Forest> https://nim-lang.org/docs/json.html#delete%2CJsonNode%2Cstring |
20:05:51 | FromDiscord | <Forest> The error i gotv |
20:05:52 | FromDiscord | <Forest> : |
20:06:15 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=472q |
20:06:31 | FromDiscord | <leorize> oh, you need to know the key |
20:06:41 | FromDiscord | <leorize> otherwise, the only way is to build a new JsonNode without that node |
20:06:58 | FromDiscord | <Forest> Rip fair enough, thanks! |
20:09:13 | FromDiscord | <leorize> it's easier to implement for the most partāµ(@Sabena Sema) |
20:10:01 | FromDiscord | <Sabena Sema> yeah |
20:10:03 | FromDiscord | <dom96> In reply to @lantos "<@132595483838251008> hey could you": can't PM you |
20:10:35 | FromDiscord | <Sabena Sema> and most languages dont let you customize how async suspend points work quite like nim |
20:10:36 | FromDiscord | <leorize> in Nim there is no native closure iterator chaining for example, so something like `Future` is required |
20:11:12 | FromDiscord | <Sabena Sema> wait what? cant closure iterators include other closure iterators in their closures? |
20:11:14 | FromDiscord | <leorize> lua and kotlin are pretty much on top of this |
20:11:32 | FromDiscord | <Sabena Sema> or do you mean chaining based on tail calls |
20:12:15 | FromDiscord | <leorize> we don't have `yield` like in JS, though I suppose you can do a `for-loop` chaināµ(@Sabena Sema) |
20:13:07 | NimEventer | New thread by Loge: Fidget - vmath - vector graphics undeclared identifier, see https://forum.nim-lang.org/t/9355 |
20:14:00 | FromDiscord | <leorize> but even that is inflexible, lua and kotlin design allow a much better composition interface for suspended routine |
20:14:24 | FromDiscord | <leorize> for example, a suspension can be triggered at any point in the call chain, you can `async -> "non"-async -> async` and the chaining will be seamless |
20:16:25 | FromDiscord | <leorize> and well, you can also `async -> async` chain, which is non-trivial for closure iterator without a backing structure (in this case `Future`) |
20:17:33 | FromDiscord | <dom96> In reply to @Sabena Sema "I really wanna see": why? |
20:19:15 | FromDiscord | <Sabena Sema> In reply to @leorize "and well, you can": isnāt the backing structure mostly to store the parameters? That isnāt additional overhead over other languages, they just do that implicitly |
20:20:07 | FromDiscord | <Sabena Sema> In reply to @dom96 "why?": mostly curious how it might look |
20:20:26 | FromDiscord | <Sabena Sema> probably the same if the api was state-machine coroutines |
20:23:34 | FromDiscord | <dom96> The reason I ask is because I would consider the asyncdispatch API to be "completion queue based", though maybe I'm misunderstanding what you mean by "completion queue based" |
20:23:52 | FromDiscord | <leorize> you need to store the chain to resume as well, the differences are minor, but it's kinda like this\:āµā In closure for-chaining, resuming means\: `resume -@Sabena Sema) |
20:24:18 | FromDiscord | <leorize> asyncdispatch is mostly callbacks, and it's not consistent as well |
20:25:38 | FromDiscord | <Sabena Sema> In reply to @leorize "you need to store": hmm is this because the activation record for a closure iterator is, in fact, a normal stack frame? |
20:27:19 | FromDiscord | <leorize> yea, and you're forced to walk the stack from top on every resume |
20:28:17 | FromDiscord | <leorize> and since this stuff is implemented using heap-allocated objects, it become a pointer chasing fest for the CPU |
20:28:33 | FromDiscord | <Sabena Sema> can you thunk through some assembly that manipulates the stack pointer and return address? |
20:28:58 | FromDiscord | <leorize> you don't need to do that, you just have to make control transfer a thing |
20:29:04 | FromDiscord | <Sabena Sema> its pretty hard to avoid heap allocated objects for the state |
20:29:30 | FromDiscord | <leorize> you can't avoid the heap, but you can avoid chasing the chain to resume |
20:29:44 | FromDiscord | <Sabena Sema> In reply to @leorize "you don't need to": I mean isnt āmaking it a thingā just having the compiler do those manipulations for you? |
20:29:51 | FromDiscord | <Sabena Sema> yeah |
20:30:23 | FromDiscord | <leorize> pretty much, that's why JS have syntax dedicated for that |
20:30:31 | FromDiscord | <leorize> expressing intent is always preferable |
20:31:04 | FromDiscord | <Sabena Sema> not to mention allowing the optimizer to see through the resume |
20:32:55 | FromDiscord | <leorize> \<plug\> you might be interested in cps if you're looking for a scheme designed for composition of routines instead of fancy pausable iterators \</plug\> |
20:35:28 | FromDiscord | <Sabena Sema> this doesnāt just apply to yield right? you can get the bad behavior by just awaiting some function that itself awaits |
20:36:09 | FromDiscord | <Sabena Sema> In reply to @leorize "\<plug\> you might be": I donāt really understand the difference tbh, except that cps is a lib impl |
20:36:37 | FromDiscord | <Sabena Sema> like async functions are just fancy iterators, thats how they work |
20:36:40 | FromDiscord | <leorize> await chain is the hack for control flow transfer |
20:37:11 | FromDiscord | <Sabena Sema> it wont do that for simple nesting? |
20:37:54 | FromDiscord | <leorize> in Nim for example `await` yields `Future[T]` of `thirdClosure`, then `secondClosure` appends its continuation code to that Future and yield it, and so on |
20:38:23 | FromDiscord | <leorize> then when the Future is resumed, it runs from `thirdClosure -> .. -> firstClosure` |
20:39:29 | FromDiscord | <exelotl> I like ucontext-based coroutines tbh: https://github.com/zevv/nimcoro |
20:39:50 | FromDiscord | <exelotl> they're truly colourless, like the ones in Lua |
20:41:46 | FromDiscord | <exelotl> with the upcoming .forbids pragma it should be possible to ensure that you never accidentally yield from non-coroutine code too: https://github.com/nim-lang/Nim/pull/20050 |
20:42:00 | FromDiscord | <leorize> sent a long message, see http://ix.io/472E |
20:42:25 | FromDiscord | <huantian> cps looks cool I gotta try it |
20:42:31 | FromDiscord | <Sabena Sema> In reply to @exelotl "I like ucontext-based coroutines": ucontext is horrible and should essentially never be used |
20:42:42 | FromDiscord | <leorize> we tried too \:P https://github.com/nim-works/cps/blob/master/examples/coroutine.nimāµ(@exelotl) |
20:42:50 | FromDiscord | <Sabena Sema> you gotta reimplement the whole runtime for it |
20:43:24 | FromDiscord | <Sabena Sema> and they are really not much faster at all than OS threads, esp on linux (where you can use cgroups to prevent starvation) |
20:43:48 | FromDiscord | <Sabena Sema> they were important back when there was the BKL around the scheduler |
20:43:55 | FromDiscord | <Sabena Sema> but that is long gone |
20:46:19 | FromDiscord | <exelotl> right, I actually don't know the implications of ucontext on the desktop, I'm simply using a bare metal implementation of it in my GBA game for cutscene & dialogue scripting |
20:47:15 | FromDiscord | <exelotl> i.e. I have a coroutine which needs to run once in a frame, and that's it |
20:48:09 | FromDiscord | <Sabena Sema> yeah, tbh they arenāt _that_ bad if you only ever resume on the same thread as you suspended |
20:50:25 | FromDiscord | <Sabena Sema> you also do save some memory, I forget how big kernel stacks are on linux but its a few k |
20:50:34 | FromDiscord | <Sabena Sema> and they are not allocated on-demand |
20:53:24 | * | pech joined #nim |
20:54:49 | * | def-- joined #nim |
20:55:10 | * | via__ joined #nim |
20:56:07 | * | mahlon_ joined #nim |
20:56:16 | * | oz` joined #nim |
20:57:23 | * | MightyJoe joined #nim |
20:57:37 | * | __________ joined #nim |
20:58:09 | * | emery joined #nim |
20:58:43 | * | oprypin_ joined #nim |
21:02:16 | * | def- quit (*.net *.split) |
21:02:16 | * | arkurious quit (*.net *.split) |
21:02:17 | * | disso_peach quit (*.net *.split) |
21:02:17 | * | _________ quit (*.net *.split) |
21:02:17 | * | ehmry quit (*.net *.split) |
21:02:19 | * | via_ quit (*.net *.split) |
21:02:19 | * | ox quit (*.net *.split) |
21:02:19 | * | FromDiscord quit (*.net *.split) |
21:02:19 | * | def-- is now known as def- |
21:02:23 | * | fallback quit (Ping timeout: 240 seconds) |
21:02:23 | * | derpydoo quit (Ping timeout: 240 seconds) |
21:02:23 | * | mahlon quit (Ping timeout: 240 seconds) |
21:02:54 | * | FromDiscord joined #nim |
21:05:52 | * | fallback joined #nim |
21:06:17 | * | oprypin quit (Ping timeout: 240 seconds) |
21:06:17 | * | cyraxjoe quit (Ping timeout: 240 seconds) |
21:07:17 | * | arkurious joined #nim |
21:09:10 | * | __________ quit (Quit: Reconnecting) |
21:09:28 | * | _________ joined #nim |
21:12:49 | FromDiscord | <Forest> Anyone know why i could be getting this error? |
21:12:52 | FromDiscord | <Forest> https://hastebin.com/ebujayekab.nim |
21:12:55 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=472H |
21:13:11 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=472I |
21:13:18 | FromDiscord | <Forest> Same code as the file, just copy and pasted into the channel |
21:13:27 | FromDiscord | <Forest> (edit) |
21:14:28 | FromDiscord | <Forest> Anyone interested in the actual repo can look at https://github.com/Mythical-Forest-Collective/NGPU-Bindings |
21:16:17 | FromDiscord | <dom96> directory not writeable? i.e. permission problems |
21:18:25 | FromDiscord | <Forest> It should be writable, that's what I don't understand rip |
21:18:35 | FromDiscord | <Forest> It's running in Termux |
21:19:45 | FromDiscord | <leorize> isn't the issue that the file could not be found for `readFile`? |
21:20:12 | FromDiscord | <Forest> Hm maybe... |
21:20:52 | FromDiscord | <Forest> The cache dir is definitely read |
21:24:08 | FromDiscord | <leorize> I'm pretty sure your problem is in that conditional for copying |
21:24:08 | FromDiscord | <leorize> looks like the path you have is the full path, it won't start with `opir_` but rather `cache/opir_` or something |
21:25:44 | FromDiscord | <Forest> Aaaah that makes sense |
21:26:09 | FromDiscord | <Forest> Thanks aha, that makes sense lmao |
21:30:48 | FromDiscord | <Forest> That was fixed! |
21:30:52 | FromDiscord | <Forest> Now though, getting this: |
21:31:01 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=472L |
21:34:05 | FromDiscord | <leorize> I'm pretty sure the iterator is called `items()` |
21:34:27 | FromDiscord | <Forest> Aah okay, thanks! |
21:34:55 | FromDiscord | <Forest> Same issue anyway |
21:36:53 | FromDiscord | <leorize> the problem could be that your node is an Object node and not an Array node |
21:37:27 | FromDiscord | <leorize> do you have a sample of the json file? |
21:37:30 | FromDiscord | <Forest> Possibly? |
21:38:03 | FromDiscord | <Forest> In reply to @Forest "Anyone interested in the": Oh yeah, it's absolutely massive though so i recommend looking at the GitHub repo for the smaller one |
21:38:09 | FromDiscord | <Forest> In the releases, `output.json` |
21:41:27 | FromDiscord | <Forest> Snippet |
21:41:30 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=472P |
21:43:09 | FromDiscord | <leorize> looks like the matrix bridge is lagging again... |
21:43:24 | FromDiscord | <leorize> I guess your only option now is to print the parsed node to see what it is |
21:44:24 | FromDiscord | <Forest> Ah fair |
21:44:32 | FromDiscord | <Forest> In reply to @leorize "I guess your only": Alright, that'll be uh, very big |
21:44:54 | FromDiscord | <Forest> I'll hard code this json in for now |
21:46:35 | FromDiscord | <leorize> you can start with `echo jnode.kind` \:P |
21:46:52 | * | Goodbye_Vincent1 joined #nim |
21:48:09 | FromDiscord | <Forest> Aight |
21:48:29 | * | \u joined #nim |
21:49:04 | FromDiscord | <leorize> sent a code paste, see https://play.nim-lang.org/#ix=472R |
21:49:16 | FromDiscord | <leorize> maybe everything is just in this one field of the object and that's all you need to access |
21:50:09 | FromDiscord | <Forest> It's likely gonna be an array because of how the file is organised |
21:50:32 | FromDiscord | <Forest> The jnode kind is `JArray` |
21:50:33 | * | tanami_ joined #nim |
21:51:00 | FromDiscord | <leorize> top ten reasons why having stacktrace would save a lot of time... |
21:51:16 | FromDiscord | <Forest> Is there a way to show the stacktrace? :p |
21:51:22 | * | notchris_ joined #nim |
21:51:23 | FromDiscord | <Forest> Is it --stacktrace:on? |
21:51:26 | FromDiscord | <leorize> don't build it with release \:P |
21:51:28 | FromDiscord | <Forest> Idk just guessing+ |
21:51:30 | FromDiscord | <Forest> Ooooh |
21:51:58 | FromDiscord | <leorize> I guess your problem is in that for loop |
21:52:25 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=472S |
21:52:32 | FromDiscord | <Forest> In reply to @leorize "I guess your problem": Yeah it definitely is, crashes after one iteration |
21:53:12 | FromDiscord | <leorize> ah, there is the problem |
21:53:27 | * | laintree joined #nim |
21:53:33 | FromDiscord | <leorize> `contains()` when used on a node check if the node have the given key |
21:53:41 | * | fallback quit (Ping timeout: 272 seconds) |
21:53:43 | FromDiscord | <leorize> you need to `getStr` to unwrap that node into a string first |
21:54:16 | * | neceve joined #nim |
21:54:19 | FromDiscord | <Forest> Aaah okay, thanks aha, sorry for wasting ya time |
21:55:08 | * | Goodbye_Vincent quit (Ping timeout: 240 seconds) |
21:55:08 | * | tanami quit (Ping timeout: 240 seconds) |
21:55:08 | * | notchris quit (Ping timeout: 240 seconds) |
21:55:08 | * | madprops quit (Ping timeout: 240 seconds) |
21:55:08 | * | meowray quit (Ping timeout: 240 seconds) |
21:55:09 | * | lain quit (Ping timeout: 240 seconds) |
21:55:09 | * | Goodbye_Vincent1 is now known as Goodbye_Vincent |
21:55:09 | * | notchris_ is now known as notchris |
21:55:27 | FromDiscord | <Forest> Sweet it works! Thanks! |
21:55:37 | * | madprops joined #nim |
21:55:37 | * | madprops quit (Changing host) |
21:55:37 | * | madprops joined #nim |
21:55:40 | FromDiscord | <Forest> Is there also a way to save the JSON as a prettyprinted string?- |
21:55:43 | FromDiscord | <Forest> For indentation |
21:57:06 | FromDiscord | <leorize> `pretty()` |
21:57:07 | FromDiscord | <leorize> the packed form uses less space, though |
21:57:10 | FromDiscord | <leorize> use that if you don't need human to read it |
21:57:14 | FromDiscord | <Forest> Thanks! |
21:57:36 | FromDiscord | <Forest> In reply to @leorize "use that if you": Fair enough, just thinking it may be useful to read the file in situations we need to debug it |
22:05:02 | FromDiscord | <tomByrer> Is there a Nim lib for Chrome DevTools Protocol (eg 'headless Chrome browser')?āµāµI'm used to Puppeteer & Playwright (JS) for this, but need more speed & less memory. Thought about using Go or Rust at first, but willing to try out Nim if there's already a lib wrapper for that API. |
22:06:12 | * | fallback joined #nim |
22:07:30 | * | tiorock joined #nim |
22:07:30 | * | tiorock quit (Changing host) |
22:07:30 | * | tiorock joined #nim |
22:07:30 | * | rockcavera quit (Killed (erbium.libera.chat (Nickname regained by services))) |
22:07:30 | * | tiorock is now known as rockcavera |
22:08:13 | FromDiscord | <leorize> https://nimble.directory/ \<- this would be the best place to look for such tools |
22:08:24 | FromDiscord | <leorize> though I couldn't find anything with my few cursory searches |
22:13:04 | * | krux02 joined #nim |
22:22:58 | FromDiscord | <dom96> In reply to @tomByrer "Is there a Nim": https://github.com/dom96/webdriver https://github.com/halonium/halonium |
22:26:46 | FromDiscord | <dom96> doubt you'll see more speed and less memory though tbh |
22:38:31 | * | neceve quit (Ping timeout: 268 seconds) |
23:11:21 | FromDiscord | <Forest> How do i prevent futhark from adding anything like `enum` to the names? |
23:11:42 | FromDiscord | <Forest> I just want the lowercased names with `_` and `` removed, that's it |
23:16:15 | FromDiscord | <hotdog> In reply to @Forest "How do i prevent": I think it adds enum when thereās a name collision iirc |
23:16:38 | FromDiscord | <hotdog> You can provide a rename callback to have your own renaming mechanism |
23:17:15 | FromDiscord | <Forest> In reply to @hotdog "I think it adds": Does it? Huh |
23:17:34 | FromDiscord | <Forest> In reply to @hotdog "You can provide a": I'm gonna have to remove all those renamed functions then bleh |
23:20:49 | FromDiscord | <hotdog> In reply to @Forest "Does it? Huh": Yeah from the futhark readme - āsome identifiers might collide the name will then further have the kind appended,ā |
23:20:57 | FromDiscord | <hotdog> Check the section on renaming |
23:21:19 | FromDiscord | <Forest> Ah okay, thanks |
23:21:30 | FromDiscord | <!Patitotective> beef would say "RTFM" |
23:21:56 | FromDiscord | <hotdog> In reply to @Forest "Ah okay, thanks": No prob |
23:22:31 | FromDiscord | <Forest> In reply to @Patitotective "beef would say "RTFM"": Lmao probably for good reason |
23:23:06 | FromDiscord | <Forest> Wonder if i can get futhark to spit out a list of the renamed objects with a mapping to the original names |
23:38:29 | FromDiscord | <Forest> > If you want to rename an object or a field you can use the rename directive. Simply put rename <from>, <to> along with your other options. <from> can be either just an object name (before any other renaming) as a string or ident, or a field in the format <object>.<field> both the original C names either as two identifiers, or the whole thing as a single string.āµāµSo the original C name is what we should use for `from` to rename it? |
23:38:36 | FromDiscord | <Forest> Brain is dying but i must get it complete lmao |
23:38:54 | FromDiscord | <Elegantbeef> https://github.com/beef331/wasmedge_playground/blob/master/src/wasmedge.nim#L5-L29 |
23:39:11 | FromDiscord | <Elegantbeef> the `name` you get is the verbatim name iirc |
23:39:25 | FromDiscord | <Elegantbeef> You can do `echo name` to see |
23:39:46 | FromDiscord | <Forest> Verbatim name? |
23:39:54 | FromDiscord | <Elegantbeef> The C name |
23:40:08 | FromDiscord | <Forest> I'm not using the callback now, just using the `rename` field |
23:40:18 | FromDiscord | <Forest> In reply to @Elegantbeef "The C name": Thank fucking god i was so dumb |
23:40:33 | FromDiscord | <Forest> This is a piece of cake now, i thought it had to be something else specifically |
23:42:37 | FromDiscord | <Elegantbeef> This is the downside of futhark it's fully too difficult to see what the generated code looks like |
23:42:59 | FromDiscord | <Elegantbeef> Oh huantian i reasoned a second method of unexpanded macros in error messages |
23:43:26 | FromDiscord | <Elegantbeef> It's more likely to being accepted but still isnt ideal |
23:43:39 | FromDiscord | <Forest> Yeah understandable |
23:43:45 | FromDiscord | <Forest> In reply to @Elegantbeef "It's more likely to": Fair |
23:43:53 | FromDiscord | <Elegantbeef> What? |
23:44:25 | FromDiscord | <huantian> ooh what is it? |
23:44:44 | FromDiscord | <Elegantbeef> Dumbly storing a `Table[PNode, PNode]` on the `PContext` š |
23:51:47 | FromDiscord | <huantian> hmmm |
23:52:03 | FromDiscord | <huantian> I mean it sounds like it should work fine |
23:52:20 | FromDiscord | <Elegantbeef> https://github.com/beef331/Nim/commit/5ede9a2223b621ad7d6fba8d5b8249a16a9d25a2 |
23:52:28 | FromDiscord | <Elegantbeef> Yea it's much better for memory than the other method |
23:53:56 | FromDiscord | <Elegantbeef> I really cant think of any other way of doing this with the current compiler design |