01:04:07 | * | _0x00 joined #nim |
01:13:04 | FromDiscord | <jos7388> is there a good text shaping library for nim |
01:13:08 | FromDiscord | <jos7388> i saw pixie has support for it |
01:13:14 | FromDiscord | <jos7388> i'm using naylib right now and.. it kinda sucks i might switch to pixie |
01:13:31 | FromDiscord | <jos7388> oh wait pixie doens't look suitable for games |
01:13:54 | FromDiscord | <jos7388> cpu based? |
01:13:55 | FromDiscord | <jos7388> ye |
01:14:02 | FromDiscord | <jos7388> i think i should use both together |
01:15:04 | FromDiscord | <Elegantbeef> Yea render with pixie, send it to a texture atlas |
01:15:09 | FromDiscord | <Elegantbeef> It's what I do for text in my GUI |
01:33:57 | FromDiscord | <jos7388> ok here's a cute thing i do at work |
01:34:04 | FromDiscord | <jos7388> i have a bash script that searches my codebase for TODOs |
01:34:18 | FromDiscord | <jos7388> and just keeps it in a file |
01:34:34 | FromDiscord | <jos7388> could i make a todo macro that uses the AST to get context about the feature? like so i could sort my TODOs by module and stuff |
01:34:54 | FromDiscord | <jos7388> i love nim!! |
01:35:00 | FromDiscord | <Elegantbeef> You could make a macro that is \`todo\: "Do this thing"\~ |
01:35:25 | FromDiscord | <Elegantbeef> Then have a `emitTodos` that writes all your todos to a file |
01:36:14 | FromDiscord | <Elegantbeef> Don't even need a macro really |
01:38:28 | FromDiscord | <jos7388> i loooooove nim!! |
01:39:37 | FromDiscord | <jos7388> one thing that's really nice about nim's whitespace sensitive syntax is i don't really feel like i need a linter |
01:45:20 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4DIj for instance |
01:47:06 | FromDiscord | <Elegantbeef> Could also emit a `{.hint` or `{.warning` inside |
01:59:03 | * | krux02_ joined #nim |
01:59:04 | * | krux02_ quit (Client Quit) |
02:01:36 | FromDiscord | <jos7388> wow you can have compile time globals? |
02:02:12 | FromDiscord | <jos7388> doesn’t that make incremental compilation impossible or |
02:02:42 | FromDiscord | <jos7388> idk |
02:03:09 | FromDiscord | <Elegantbeef> macrocache does exist to have a IC friendly table |
02:03:21 | FromDiscord | <Elegantbeef> That just requires using macros instead of the templates/procs |
02:05:29 | FromDiscord | <jos7388> I knew it |
02:05:49 | FromDiscord | <jos7388> nim is crazy!!!! |
02:12:59 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Yea render with pixie,": Wdym render with Pixie? What would Pixie be used for in a game? Just text? Or |
02:13:46 | FromDiscord | <jos7388> ui only probably |
02:13:50 | FromDiscord | <Chronos [She/Her]> Yeah that's the only usecase I can see but tbf that is pretty good |
02:13:59 | FromDiscord | <Elegantbeef> Exactly |
02:14:02 | FromDiscord | <Chronos [She/Her]> Or for svg rendering too ig? |
02:14:08 | FromDiscord | <jos7388> it’s pretty common to build an atlas on the CPU and render it using the GPU |
02:14:20 | FromDiscord | <jos7388> if you use RenderDoc in a Valve game you’ll see Panorama does that |
02:14:28 | FromDiscord | <Chronos [She/Her]> That'd be useful in a character creator thing using svgs |
02:14:38 | FromDiscord | <jos7388> and it even generates 100% duplicate atlas entries for duplicate text strings |
02:14:44 | FromDiscord | <jos7388> panorama sucks ass!! |
02:15:15 | FromDiscord | <Chronos [She/Her]> In reply to @jos7388 "it’s pretty common to": Wait so loading images with Pixie too? How would you send it to an atlas though? I'm guessing pre-defined length and width and then making Raylib read from that? |
02:15:45 | FromDiscord | <jos7388> I haven’t done anything yet with pixie |
02:15:54 | FromDiscord | <jos7388> for now I’m just doing my own basic text wrapping |
02:16:02 | FromDiscord | <jos7388> but when I add drop shadows etc I might use pixie |
02:16:07 | FromDiscord | <jos7388> and that’s the approach yeah |
02:16:27 | FromDiscord | <Chronos [She/Her]> Yeah fair |
02:16:36 | FromDiscord | <jos7388> giant atlas on the GPU, render to a buffer on the CPU, copy from CPU to GPU to update giant atlas |
02:16:45 | FromDiscord | <Elegantbeef> I do not actually build the atlas on the cpu |
02:16:56 | FromDiscord | <Elegantbeef> I build the atlas on the gpu but render characters on the cpu |
02:17:05 | FromDiscord | <Chronos [She/Her]> Huh why? |
02:17:07 | FromDiscord | <jos7388> you do packing on the GPU? |
02:17:07 | FromDiscord | <Elegantbeef> I then blit the texture to the atlas texture |
02:17:23 | FromDiscord | <Elegantbeef> Cause why would I continually upload a texture whenever I add a character |
02:17:40 | FromDiscord | <jos7388> ye I’d still consider that building the atlas on the CPU |
02:17:45 | FromDiscord | <jos7388> just doing incremental updates |
02:18:03 | FromDiscord | <jos7388> when u say on the GPU it sounds like u mean atlas packing in a compute shader |
02:18:08 | FromDiscord | <jos7388> which sounds insane |
02:18:15 | FromDiscord | <Elegantbeef> Well it's blitted on the gpu and the atlas is a handle on the cpu, so i wouldnt really call it cpu based 😄 |
02:18:33 | FromDiscord | <jos7388> all the packing logic is done on the CPU though right |
02:18:44 | FromDiscord | <Elegantbeef> The layout logic is done on the cpu yes |
02:18:54 | FromDiscord | <jos7388> yeah that’s probably the same approach I’ll use too |
02:18:54 | FromDiscord | <Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/atlasser.nim if you want to see the source |
02:18:58 | FromDiscord | <jos7388> it makes a lot of sense |
02:19:04 | FromDiscord | <jos7388> thanks maybe I’ll steal it |
02:19:11 | FromDiscord | <Elegantbeef> I mean it's meant to be reused |
02:19:23 | FromDiscord | <Elegantbeef> It's a very basic atlas though |
02:19:23 | FromDiscord | <jos7388> wow that is very tiny |
02:19:39 | FromDiscord | <Elegantbeef> It just splits x then y, recursively |
02:19:50 | FromDiscord | <jos7388> I once read an article that demonstrated that even with like super complex bin packing algorithms, you get like only a 5% increase in efficiency |
02:20:06 | FromDiscord | <jos7388> I am really interested in virtual texturing tho |
02:20:40 | FromDiscord | <jos7388> bindless textures are such a killer feature but still, lacking support on web and mobile |
02:20:48 | FromDiscord | <jos7388> I’m sick of packing atlases |
02:20:54 | FromDiscord | <jos7388> I just wish bindless was available everywhere |
02:21:00 | FromDiscord | <Chronos [She/Her]> Bindless? |
02:21:37 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1141557414525681725/image.png |
02:21:39 | FromDiscord | <jos7388> basically just mark textures as “resident” on the GPU, then you can use them as if they were pointers |
02:22:03 | FromDiscord | <Elegantbeef> Not the most efficient algo |
02:22:03 | FromDiscord | <Elegantbeef> Favours moving to the right, due to the order rects are added |
02:22:08 | FromDiscord | <Elegantbeef> Eh bindless textures are a great idea until you actually use them |
02:22:19 | FromDiscord | <jos7388> what’s bad about them |
02:22:23 | FromDiscord | <jos7388> I never actually used them |
02:22:29 | FromDiscord | <Elegantbeef> No debugging tooling and weird artifacts |
02:22:45 | FromDiscord | <Elegantbeef> I used them before atlasing and ran into a massive issue of artifacting |
02:23:03 | FromDiscord | <Elegantbeef> Screenshot\_2023-05-11\_13-27-28.png https://media.discordapp.net/attachments/371759389889003532/1141557776296984686/Screenshot_2023-05-11_13-27-28.png |
02:23:12 | FromDiscord | <Chronos [She/Her]> In reply to @jos7388 "basically just mark textures": Hm |
02:23:32 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Screenshot\_2023-05-11\_13-27-28.png": Oh yikes |
02:23:44 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1141557949936963584/image.png |
02:24:14 | FromDiscord | <Elegantbeef> Renderdoc not being usable is not a good state to be in |
02:24:29 | FromDiscord | <Elegantbeef> So as nice as bindless textures are, I do not suggest using them |
02:24:50 | FromDiscord | <jos7388> interesting |
02:25:07 | FromDiscord | <jos7388> in Vulkan it’s probably much better, since the feature is much simpler |
02:25:34 | FromDiscord | <jos7388> it’s not actually bindless, just supports tons of textures bound at once, and then another feature bit to index them arbitrarily in shaders |
02:25:49 | FromDiscord | <jos7388> problem is that feature bit is again only really available on desktop class GPUs |
02:25:58 | FromDiscord | <jos7388> idk |
02:26:05 | FromDiscord | <jos7388> it’s been a while since I did any GPU programming so |
02:26:12 | FromDiscord | <jos7388> I am probably quite wrong about modern bottlenecks |
02:26:20 | FromDiscord | <Elegantbeef> Well if it works in vulkan with renderdoc then use it, but if it doesnt it's such a pain |
02:27:07 | FromDiscord | <jos7388> right now I’m just using raylib’s immediate mode renderer lol |
02:27:14 | FromDiscord | <jos7388> one day I hope to write a really nice renderer |
02:27:25 | FromDiscord | <jos7388> but no time for that 🙂 |
02:27:41 | FromDiscord | <jos7388> you know Minecraft uses immediate mode still I think?? |
02:27:49 | FromDiscord | <jos7388> mind blowing |
02:40:12 | * | _0x00 quit (Ping timeout: 240 seconds) |
02:58:21 | FromDiscord | <Chronos [She/Her]> They use lwjgl right? Also what's the diff with immediate mode and whatever? |
03:19:40 | FromDiscord | <jos7388> immediate mode is a deprecated API that is exposed by opengl |
03:21:05 | FromDiscord | <jos7388> basically instead of packing vertex data into buffers and submitting them in a single call, you call functions procedurally to define your vertex data |
03:21:32 | FromDiscord | <jos7388> like drawing a tri looks like `glBegin(); glVertex(0, 0, 0); glVertex(...); glVertex(...); glEnd();` |
03:21:41 | FromDiscord | <jos7388> (edit) "like drawing a tri ... looks" added "in immediate mode" |
03:22:06 | FromDiscord | <jos7388> drawing a tri using newer api looks like `tri = [0, 0, 0, ..., ...]; drawMesh(tri);` |
03:22:10 | FromDiscord | <jos7388> i guess that's the key difference |
03:22:34 | FromDiscord | <jos7388> former is much more taxing on the CPU |
03:22:52 | FromDiscord | <jos7388> cos in the latter, you can reuse `tri` |
03:31:23 | FromDiscord | <Chronos [She/Her]> Ah |
05:42:50 | * | junaid__ joined #nim |
05:50:04 | * | junaid__ quit (Quit: leaving) |
05:57:17 | * | dithpri joined #nim |
06:09:06 | * | ntat joined #nim |
06:18:40 | NimEventer | New Nimble package! getpodia - Extract Podia sites courses data, see https://github.com/thisago/getpodia |
06:23:10 | * | advesperacit joined #nim |
06:24:27 | FromDiscord | <eb442a17a2aaee577399ca9e38eb67b5> how do i reverse an array in nim |
06:26:03 | advesperacit | https://nim-lang.org/docs/algorithm.html#reverse%2CopenArray%5BT%5D |
06:26:09 | FromDiscord | <Phil> In reply to @eb442a17a2aaee577399ca9e38eb67b5 "how do i reverse": You can use the reverse proc from std/algorithm https://nim-lang.org/docs/algorithm.html#reverse%2CopenArray%5BT%5D↵↵Generally for searching, going to the nim docs and searching for words in the search bar on the left has proven pretty useful |
06:26:50 | FromDiscord | <Phil> (edit) "In reply to @eb442a17a2aaee577399ca9e38eb67b5 "how do i reverse": You can use the reverse proc from std/algorithm https://nim-lang.org/docs/algorithm.html#reverse%2CopenArray%5BT%5D↵↵Generally ... forsearching:" added "a useful tip" | "searching, going" => "searching: Going" | "useful" => "useful.↵Helps me out basically daily, right up until I forget to do it and beef tells me I don't read docs" |
06:27:10 | FromDiscord | <Phil> (edit) "In reply to @eb442a17a2aaee577399ca9e38eb67b5 "how do i reverse": You can use the reverse proc from std/algorithm https://nim-lang.org/docs/algorithm.html#reverse%2CopenArray%5BT%5D↵↵Generally a useful tip for searching: Going to the nim docs and searching for words in the search bar on the left has proven pretty useful.↵Helps me out basically daily, right up until I forget to do it ... and" added "one time" |
06:27:11 | FromDiscord | <Elegantbeef> Well do you?! |
06:27:22 | FromDiscord | <Phil> I do! You just don't notice all the other times! |
06:27:24 | dithpri | lord is this noisy lol |
06:28:11 | FromDiscord | <huantian> why would you search yourself when you can just ask beef |
06:28:42 | FromDiscord | <Elegantbeef> Ah inverted survivor bias |
06:29:39 | FromDiscord | <huantian> how is this inverted surivor bais? |
06:29:42 | FromDiscord | <huantian> basi |
06:29:44 | FromDiscord | <huantian> iabie |
06:30:04 | FromDiscord | <toma400> Is tuple immutable in Nim? |
06:30:05 | FromDiscord | <Elegantbeef> Bsia |
06:30:05 | FromDiscord | <Elegantbeef> Siab |
06:30:05 | FromDiscord | <Elegantbeef> Bais |
06:30:18 | FromDiscord | <Elegantbeef> Why would a specific type be immutable but no other type |
06:31:11 | FromDiscord | <Elegantbeef> It's inverted survivor bias cause I assume he never reads docs cause when he asks a question and I point him to the docs it implies he doesn't read them |
06:31:39 | FromDiscord | <Elegantbeef> Tuples are mutable just like any other type |
06:32:55 | FromDiscord | <huantian> to be more broad, tuples, like objects, are mutable if you have them in a `var` |
06:33:08 | FromDiscord | <huantian> but if you have one stored in a `let`, then you can't mutate them\ |
06:33:11 | FromDiscord | <Elegantbeef> I didnt know you were a broad |
06:33:19 | FromDiscord | <huantian> im usually wide |
06:33:40 | FromDiscord | <Elegantbeef> We're awful |
06:36:22 | FromDiscord | <huantian> that's the reason I stick around this community↵and not other programming lang communities 😛 |
06:36:35 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DJi |
06:37:15 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4DJi" => "https://play.nim-lang.org/#ix=4DJj" |
06:37:20 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4DJj" => "https://play.nim-lang.org/#ix=4DJk" |
06:38:08 | FromDiscord | <Phil> In reply to @huantian "but if you have": I wish that were also true for ref-types |
06:38:39 | FromDiscord | <Phil> Flipping "immutability for ref means only immutability of the ref, not whatever its contents are" |
06:39:08 | FromDiscord | <huantian> immutability in general is an interesting thing |
06:39:24 | FromDiscord | <huantian> because often times it feels like it can be situational when I want something to be immutable |
06:39:33 | FromDiscord | <huantian> do i want to decide this per object usage? |
06:39:37 | FromDiscord | <huantian> per type? |
06:39:38 | * | PMunch joined #nim |
06:39:39 | FromDiscord | <huantian> per field? |
06:39:45 | FromDiscord | <toma400> sent a code paste, see https://play.nim-lang.org/#ix=4DJl |
06:39:54 | FromDiscord | <Phil> Define "expandable" ? |
06:39:59 | FromDiscord | <Phil> Oh as in add more shit |
06:40:01 | FromDiscord | <huantian> maybe I want to it to be mutable until a certain point |
06:40:07 | FromDiscord | <toma400> In reply to @isofruit "Oh as in add": Yeah, like seq |
06:40:13 | FromDiscord | <Phil> Yeah that is not the case, a tuple is like a type in that regard, you just define it on the fly |
06:40:27 | FromDiscord | <toma400> Is there type that is expandable hash, but doesn't require only one strict type? |
06:40:46 | FromDiscord | <Elegantbeef> Nim is statically typed there is no way to dynamically add types to a value |
06:40:54 | FromDiscord | <Phil> Unless |
06:40:55 | FromDiscord | <Elegantbeef> You need to use object variants or inheritance |
06:41:04 | FromDiscord | <Phil> Unless |
06:41:16 | FromDiscord | <Phil> You do some really evil pointer shit that you really shouldn't |
06:41:36 | FromDiscord | <Elegantbeef> Even if you do evil pointer shit that does not add the ability of more types |
06:41:39 | FromDiscord | <Phil> Which comes out to being basically what an object variant is but unsafe and worse and harder to read |
06:41:53 | FromDiscord | <toma400> I'm not experienced enough to make pointer stuff, also not sure if it's wise idea for my project when I basically use recursive unpacking of values x) |
06:42:25 | FromDiscord | <Phil> Generally I'd say go for object variants but that's because I have not become a fan of OO type strategies |
06:44:15 | FromDiscord | <toma400> The issue with object variants is that they need to be unpacked, and so my whole premise behind "unpacking JsonNode" makes no sense, as I would exchange one harsh format into another |
06:44:16 | FromDiscord | <Elegantbeef> Variants are better indeed |
06:44:24 | FromDiscord | <Elegantbeef> It's even better not to need to make runtime types |
06:45:10 | FromDiscord | <Phil> In reply to @toma400 "The issue with object": Do you plan on accepting JSONNode whose format you do not know and perform actions on it? |
06:45:18 | FromDiscord | <Phil> (edit) "JSONNode" => "JSON" |
06:45:19 | FromDiscord | <toma400> However it may be also that what I try to achieve is not really possible without some real evil magic and I should let Nim be Nim and not try to make Python out of it |
06:45:40 | FromDiscord | <toma400> In reply to @isofruit "Do you plan on": Kinda, yeah |
06:45:46 | FromDiscord | <Elegantbeef> Variants do have their place, but the question is more, what are you doing that needs this |
06:46:14 | FromDiscord | <Elegantbeef> You can get a long way not using any runtime dispatch |
06:46:30 | FromDiscord | <Phil> In reply to @toma400 "Kinda, yeah": So basically you have an algo to scan an unknown JSON file for key-things to trigger actions on your end |
06:47:05 | * | rockcavera quit (Remote host closed the connection) |
06:49:19 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DJo |
06:49:37 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4DJo" => "https://play.nim-lang.org/#ix=4DJp" |
06:49:44 | FromDiscord | <Elegantbeef> Though I'd not suggest using std/json |
06:50:16 | FromDiscord | <Elegantbeef> Atleast if you care about performance, using JsonNodes for this isnt that wise |
06:50:17 | FromDiscord | <Phil> Eh, for interactions with an unknown json structure I honestly am not aware of another alternative.↵It's alright, it provides a suitable object variant and iterators |
06:50:24 | FromDiscord | <Elegantbeef> Again though we have no clue what you're really doing, just want you want to do |
06:51:01 | FromDiscord | <Elegantbeef> Well Phil it's not even that I dislike the module, it's just it has `ref`s which means your needlessly making it a bit slower |
06:51:02 | FromDiscord | <Phil> If it's a known json-structure parsing the JSON to a nim object directly, doing your mutations and parsing that back to JSON is the more sane way to go of course. |
06:51:22 | FromDiscord | <arathanis> is `jsony` the recommendation for json parsing> |
06:51:27 | FromDiscord | <arathanis> (edit) "parsing>" => "parsing?" |
06:51:42 | FromDiscord | <Phil> I would recommend it at least |
06:51:43 | FromDiscord | <Elegantbeef> I generally just use the stdlib |
06:51:43 | FromDiscord | <Elegantbeef> I don't parse json much |
06:52:11 | FromDiscord | <Phil> If you know your JSON layout beforehand, jsony is the way to go imo, direct JSON --> Nim object deserialization |
06:52:19 | FromDiscord | <Elegantbeef> I do know people tend to like using JsonNodes for their variant types, which I find 'off' due to the fact they're `ref Node` |
06:52:45 | FromDiscord | <Elegantbeef> Meh std and jsony offer the same functionality with conversion, though jsony does not work on streams iirc |
06:53:03 | FromDiscord | <Phil> In reply to @Elegantbeef "Well Phil it's not": While true, the best software is the one that exists and if they can save a day of development time by not having to implement their own json parsing and this is not the hot part of the code, it's worth it. |
06:53:25 | FromDiscord | <Elegantbeef> Are we even sure they're using json parsing? |
06:53:35 | FromDiscord | <Elegantbeef> It sounded like they were just representing values using JsonNodes to me |
06:53:44 | FromDiscord | <Phil> I hope they are, otherwise using JsonNode is confusing |
06:53:51 | FromDiscord | <Phil> @toma400 ? |
06:54:06 | FromDiscord | <Elegantbeef> I mean it's a premade variant that can represent every type |
06:54:25 | FromDiscord | <Elegantbeef> Plus there are procedures to convert from and to it |
06:54:39 | FromDiscord | <Elegantbeef> So it's pretty easy to pickup, but less than ideal due to the pointers |
06:54:39 | FromDiscord | <Phil> Yeah but that's also bad because imo you should want it to only represent the types that you want for your usecase |
06:55:11 | FromDiscord | <Elegantbeef> And if your use case has undetermined compiletime types? 😛 |
06:55:26 | FromDiscord | <Elegantbeef> I've seen atleast one person use JsonNode for a signal api |
06:55:59 | FromDiscord | <Phil> In reply to @Elegantbeef "And if your use": That wording doesn't evoke any explicit code-examples I could think of, anything more explicit? |
06:57:08 | FromDiscord | <Phil> Oh like storing a type `proc(x: JsonNode)` for signalling procs so you can deal with all sorts of cases? |
06:57:22 | FromDiscord | <Phil> (edit) "Oh like storing a type `proc(x: JsonNode)` for signalling procs ... so" added "in a hashtable" |
06:57:24 | * | dithpri quit (Ping timeout: 246 seconds) |
06:57:28 | FromDiscord | <Elegantbeef> Sorta |
06:57:50 | FromDiscord | <Phil> I'd literally store pointers and infer the type later based on how the signal is called before I'd get that idea |
06:58:09 | FromDiscord | <Elegantbeef> You use `JsonNode` as a type erasure and it allows you to store a bunch of procedures of different types together |
06:58:15 | FromDiscord | <Phil> Using JsonNode there feels like using a hammer for a screw. Can work but feels wrong |
06:58:23 | FromDiscord | <Elegantbeef> "how the signal is called" |
06:58:28 | FromDiscord | <Elegantbeef> That's sorta the point though |
06:59:05 | FromDiscord | <Phil> In reply to @Elegantbeef ""how the signal is": Typically I call signals from within generic procs.↵The type the generic procs get called with tend to determine the types that should be in the signal procs |
06:59:19 | FromDiscord | <Elegantbeef> Signals operate on variants cause the entire api is dynamic |
06:59:45 | * | dithpri joined #nim |
07:00:14 | FromDiscord | <Elegantbeef> Not that your way doesnt work, but it's also not the first thing that jumps to people's mind |
07:00:29 | FromDiscord | <Phil> Huh, I found it obvious, good to know |
07:00:44 | FromDiscord | <Phil> I guess the JSONNode version is safer, kinda |
07:00:52 | FromDiscord | <Phil> But also doesn't feel clean... hmmm |
07:00:58 | FromDiscord | <Elegantbeef> Using a macro to call a cast a pointer to a desried type isnt the sanest approach as it's wholly unsafe |
07:01:10 | FromDiscord | <Elegantbeef> One wrong argument count or position and boom hidden error |
07:01:44 | FromDiscord | <Phil> Oi, no macro was involved in the storing and casting of that pointer |
07:01:53 | FromDiscord | <Elegantbeef> Though one could store arity and the types of the fields like I've shown before |
07:02:10 | FromDiscord | <Elegantbeef> Right you're manually casting it instead of `myProc.invoke(a, b, c, returnType = void)` |
07:02:40 | FromDiscord | <Elegantbeef> Or `myProc.invoke[: void](a, b, c)` |
07:03:02 | FromDiscord | <Phil> Literally generating the type to cast to at compile-time based on generic types↵` type TempProc = proc (connection: DbConn, modelInstance: T) {.nimcall.}` |
07:03:04 | FromDiscord | <toma400> sent a code paste, see https://play.nim-lang.org/#ix=4DJs |
07:03:41 | FromDiscord | <toma400> And as for use of std/json, I try to make Nim-native module, so I'm probably sticking to it considering it's still std |
07:03:57 | FromDiscord | <Elegantbeef> Right phil but the entire point of a signal system is you dynamically subscribe types to a list |
07:04:39 | FromDiscord | <Elegantbeef> so you need some a type erasure have `Table[string, pointer]` |
07:05:11 | FromDiscord | <Elegantbeef> which means when you do `signalHandler.invokeSignal["name"](...)` |
07:05:22 | FromDiscord | <Elegantbeef> You need to give it a type to invoke |
07:05:42 | FromDiscord | <Elegantbeef> I guess that'd be `signalHandler["name"].invoke(...)` |
07:06:08 | FromDiscord | <Elegantbeef> Are you going to manually cast every type you invoke a signal, or provide a macro to invoke you singal |
07:06:08 | FromDiscord | <Elegantbeef> signal\ |
07:06:11 | FromDiscord | <Phil> In reply to @toma400 "I did exactly that,": Sounds like you just need to recursively traverse a JSONNode tree scanning for JObjects-fields with a specific name |
07:06:26 | FromDiscord | <Elegantbeef> What are the possible values of `possiblyInt`? |
07:07:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DJt |
07:07:37 | FromDiscord | <Elegantbeef> That's a fine api that you could write |
07:07:47 | FromDiscord | <Elegantbeef> Or just a `tryGet[int]("myStr", 0)` |
07:08:19 | FromDiscord | <Elegantbeef> Don't even really need the `[int]` part since the default field would supply the value in case of failure |
07:11:40 | FromDiscord | <toma400> sent a code paste, see https://play.nim-lang.org/#ix=4DJu |
07:11:48 | FromDiscord | <toma400> (I'm sorry for some very bad code here, I'm just conceptualising) |
07:12:08 | FromDiscord | <Elegantbeef> Return should be a `seq[T]` |
07:12:17 | FromDiscord | <Elegantbeef> You can only return a single type |
07:12:21 | FromDiscord | <Phil> Wait, you even know that it's only one layer deep? |
07:12:24 | FromDiscord | <Elegantbeef> If the nodes don't match you error |
07:12:53 | FromDiscord | <Elegantbeef> Otherwise you use `seq[JsonNode]` and do not parse it |
07:13:10 | FromDiscord | <Elegantbeef> You're after dynamic structs, which is pretty annoying to do in a statically typed language for obvious reasons |
07:13:20 | FromDiscord | <Elegantbeef> I'd suggest you go back to the drawing board myself 😄 |
07:13:30 | FromDiscord | <toma400> In reply to @Elegantbeef "Return should be a": This results in loss of keys, right? |
07:13:55 | FromDiscord | <Elegantbeef> Anything that isn't homogenous yes |
07:15:40 | FromDiscord | <toma400> That was what I was afraid of, dang 😓 but yeah, as much as I love statically typed langs, this is that one back pain I always have with them, JSON-like files are annoying |
07:16:13 | FromDiscord | <toma400> In reply to @isofruit "Wait, you even know": I did double recursion, however not sure if this is valid considering Nim doesn't like cyclic references |
07:16:15 | FromDiscord | <Elegantbeef> What are you actually trying to do |
07:16:24 | FromDiscord | <Elegantbeef> Nim i fine with cyclical reference |
07:16:27 | FromDiscord | <Elegantbeef> is\ |
07:17:04 | FromDiscord | <toma400> In reply to @Elegantbeef "What are you actually": Basically load JSON values on the fly, with dynamically set type |
07:17:13 | FromDiscord | <toma400> Which sounds stupid even now when I write it |
07:17:27 | FromDiscord | <Elegantbeef> Ok but to what end |
07:17:38 | FromDiscord | <Elegantbeef> Like what are you actually doing with the json data |
07:18:03 | * | dithpri quit (Ping timeout: 246 seconds) |
07:18:24 | * | azimut quit (Ping timeout: 246 seconds) |
07:19:17 | FromDiscord | <Elegantbeef> Could you make an `array[JsonNodeKind, seq[JsonNodeObj]]`? |
07:20:00 | * | dithpri joined #nim |
07:20:15 | FromDiscord | <Elegantbeef> One would imagine you're attempting to apply logic to data stored in the json |
07:23:15 | FromDiscord | <arnetheduck> In reply to @jviega "<@449019668296892420> Don't know if": "the art of not including useful information while making subjective statements" |
07:23:22 | FromDiscord | <toma400> I was trying to get values without using JsonNode, so like having procedure that uses JsonNodes once, but then I have simple data to work with↵But then, considering how much uncomfortable it gets with Nim, I think making proc that returns JsonNode which I need to later unpack by `getType()` is probably... just smoother? And less tedious to think of |
07:23:51 | FromDiscord | <toma400> I mean, it's probably the best of "make things simpler for myself" that doesn't make this "week of research task" in the same time |
07:24:09 | FromDiscord | <toma400> I guess it'd help if I weren't so newbie at programming still |
07:24:44 | FromDiscord | <Phil> In reply to @toma400 "I was trying to": So in the end you wanted to resolve the JsonNode situation by putting whatever is in there into a variable that may be type A but also type B? |
07:25:40 | FromDiscord | <toma400> In reply to @isofruit "So in the end": Exactly that ❤️ |
07:25:43 | FromDiscord | <Phil> Because if you can tell me that regardless of if there's a number, a boolean, a float or whatever in there, you want a string in the end, that's possible.↵Always wanting a number is also possible.↵Wanting a variable that may be 2 types or more at once, that one isn't possible and while it is possible in python, it leads to hidden bugs there donw the line |
07:25:55 | FromDiscord | <Phil> (edit) "donw" => "down" |
07:26:16 | FromDiscord | <Phil> Nim kind of forces you to deal with all scenarios via forcing you to deal with JsonNode |
07:26:21 | FromDiscord | <Elegantbeef> I mean it is possible Phil but it requires using methods and inheritance 😄 |
07:26:24 | FromDiscord | <Phil> (edit) "Nim kind of forces you to deal with all scenarios ... via" added "that value may be" |
07:26:29 | FromDiscord | <toma400> In reply to @isofruit "Because if you can": Thank you, I guess I needed to get my intuition here clarified |
07:26:35 | FromDiscord | <Phil> In reply to @Elegantbeef "I mean it is": We don't talk about dynamic dispatch in this channel! |
07:27:21 | * | tam joined #nim |
07:27:25 | FromDiscord | <toma400> (edit) "clarified" => "clarified, since I kinda knew it may be against Nim's principles" |
07:27:31 | FromDiscord | <toma400> (edit) "In reply to @isofruit "Because if you can": Thank you, I guess I needed to get my intuition here clarified, since I kinda knew it may be against Nim's ... principles" added "core" |
07:28:26 | FromDiscord | <Phil> In reply to @toma400 "Thank you, I guess": Yeh, it's a catch 22.↵Either I can allow you to have a variable that you can't know at runtime which type it is (python) but then you'll also have to eat it when somebody passes you a string where you expect an int.↵Or I force you to know which type it is (nim with its fairly strict static typing), but then you'll also tell me how to deal with every type this variable might be anytime you |
07:29:00 | FromDiscord | <Phil> (edit) "In reply to @toma400 "Thank you, I guess": Yeh, it's" => "sent" | "catch 22.↵Either I can allow you to have a variable that you can't know at runtime which type it is (python) but then you'll also have to eat it when somebody passes you a string where you expect an int.↵Or I force you to know which type it is (nim with its fairly strict static typing), but then you'll also tell me how to deal with every type this variable m |
07:29:17 | FromDiscord | <Elegantbeef> "fairly strict" is an oxymoron |
07:30:12 | FromDiscord | <Phil> In reply to @Elegantbeef ""fairly strict" is an": I contrasted that in my mind against java which also has static typing but everything's an Object so basically you can still do all the shit you want, just pass on Object and do cast operations as you want.↵It's a horrible way to do things imo, it's just more lenient in terms of typing. |
07:30:24 | FromDiscord | <Phil> (edit) "on" => "as an" |
07:30:41 | FromDiscord | <Phil> I guess the typing is the same, it's just that java circumvents a lot of it via inheritance |
07:31:00 | FromDiscord | <Elegantbeef> There it is! |
07:31:19 | FromDiscord | <Phil> The typing felt in practice is still different and that's the point 😛 |
07:32:04 | FromDiscord | <System64 ~ Flandre Scarlet> Is it a problem to send passwords through Netty? |
07:32:35 | FromDiscord | <Elegantbeef> It's udp without any encryption |
07:32:49 | FromDiscord | <System64 ~ Flandre Scarlet> well, so that's dangerous |
07:32:50 | FromDiscord | <Phil> If netty is HTTPS - no. If it is HTTP - yes |
07:32:59 | FromDiscord | <System64 ~ Flandre Scarlet> Netty is UDP |
07:33:07 | FromDiscord | <Phil> In that case, bleh |
07:33:17 | FromDiscord | <System64 ~ Flandre Scarlet> yeah, it's a problem |
07:33:24 | FromDiscord | <Elegantbeef> It's a game oriented package |
07:33:31 | FromDiscord | <toma400> sent a code paste, see https://play.nim-lang.org/#ix=4DJw |
07:34:09 | FromDiscord | <Elegantbeef> Encrypting video game net traffic makes very little sense |
07:34:16 | * | PMunch_ joined #nim |
07:34:38 | * | PMunch quit (Killed (NickServ (GHOST command used by PMunch_))) |
07:34:42 | * | PMunch_ is now known as PMunch |
07:34:59 | FromDiscord | <Phil> sent a long message, see http://ix.io/4DJx |
07:35:28 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Encrypting video game net": yeah |
07:35:49 | FromDiscord | <Phil> I assume the PW is for registering or sth? |
07:35:55 | FromDiscord | <Phil> In that case why not use HTTP for that part specifically? |
07:36:04 | FromDiscord | <Phil> Well, https |
07:36:38 | FromDiscord | <System64 ~ Flandre Scarlet> Registering / login uses that for the form at the very begining |
07:37:23 | FromDiscord | <System64 ~ Flandre Scarlet> does Jester supports HTTPS? |
07:37:54 | FromDiscord | <Elegantbeef> You'd hope a webserver in 2023 would support https |
07:38:37 | FromDiscord | <Phil> sent a long message, see http://ix.io/4DJz |
07:39:13 | FromDiscord | <Phil> (edit) "http://ix.io/4DJz" => "http://ix.io/4DJA" |
07:39:22 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
07:39:38 | FromDiscord | <Phil> And typically you set it up so that the User --> Reverse Proxy Server part is covered by HTTPS |
07:40:05 | FromDiscord | <Phil> There's tooling such as certbot + letsencrypt that should make that setup somewhat easy, there's a good amount of guides on those out there in all shapes and forms |
07:40:37 | FromDiscord | <System64 ~ Flandre Scarlet> Ah alright so I need to setup something outside of the server itself |
07:41:44 | FromDiscord | <Phil> outside the application server to be specific.↵In terms of terminology:↵You'll have the machine this all runs on.↵That will run your reverse proxy server as well as your application server (you can of course have them on separate machines as well but that makes the setup more complicated). |
07:42:00 | FromDiscord | <Phil> (edit) "on.↵That" => "on, that one you could feasably also call "the server".↵That" |
07:42:18 | FromDiscord | <System64 ~ Flandre Scarlet> Ah alright↵I'll do that later if I have time |
07:42:31 | FromDiscord | <Phil> Check, done that song and dance before, happy to help as needed |
07:42:40 | FromDiscord | <Phil> (edit) "Check, done that song and dance ... before," added "with setting up HTTPS" |
07:43:14 | FromDiscord | <System64 ~ Flandre Scarlet> Done or not, it should be interesting to say I should use HTTPS in my report |
07:43:27 | FromDiscord | <Phil> Though honestly there's guides out there that are far better at explaining it than I am |
07:44:20 | FromDiscord | <Phil> ALrighty, work calls, away I go |
07:44:41 | FromDiscord | <System64 ~ Flandre Scarlet> Alright! Good luck! |
07:46:47 | PMunch | If you're setting up a server using Nim I would suggest this article: https://peterme.net/setting-up-a-nim-server-for-dummies.html |
07:47:06 | PMunch | Takes you through the whole HTTPS reverse proxy stuff, as well as a bunch of other things |
07:52:48 | FromDiscord | <System64 ~ Flandre Scarlet> Oh nice, Monocypher not being compatible with Nim 2 |
07:58:37 | FromDiscord | <System64 ~ Flandre Scarlet> Is there a Nim package for that kind of scheme? https://media.discordapp.net/attachments/371759389889003532/1141642222081671229/250px-Public_key_encryption.png |
08:00:05 | PMunch | Public private encryption? |
08:00:21 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah |
08:00:55 | FromDiscord | <System64 ~ Flandre Scarlet> More visible here https://media.discordapp.net/attachments/371759389889003532/1141642803332522044/image.png |
08:02:02 | PMunch | That's the exact same image isn't it? |
08:03:12 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah it is↵But the previous one was hard to read |
08:03:13 | PMunch | I guess the libsodium wrappers would have something for this |
08:03:49 | PMunch | Hmm, must be some IRC/Discord shenanigans, the image I got was perfectly fine to read |
08:08:48 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright↵Will check libsodium |
08:10:05 | * | tam quit (Ping timeout: 245 seconds) |
08:16:09 | * | dithpri quit (Ping timeout: 246 seconds) |
08:36:44 | * | krux02 quit (Remote host closed the connection) |
08:39:25 | * | tam joined #nim |
08:44:00 | * | tam quit (Ping timeout: 246 seconds) |
08:56:08 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4DJL |
09:06:24 | FromDiscord | <System64 ~ Flandre Scarlet> wait, didn't I just did an End To End encryption? |
09:07:36 | FromDiscord | <dersnof> sent a code paste, see https://play.nim-lang.org/#ix=4DJT |
09:07:38 | FromDiscord | <dersnof> can someone explain me this snippet |
09:07:54 | FromDiscord | <dersnof> (edit) "https://play.nim-lang.org/#ix=4DJT" => "https://play.nim-lang.org/#ix=4DJU" |
09:11:10 | * | tam joined #nim |
09:11:32 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DJW |
09:13:06 | FromDiscord | <dersnof> In reply to @isofruit "Okay, IIRC you're aware": yeah kind of, heap was the one deleted after process ended right |
09:13:12 | FromDiscord | <Phil> sent a long message, see http://ix.io/4DJY |
09:13:28 | FromDiscord | <Phil> (edit) "http://ix.io/4DJY" => "http://ix.io/4DJZ" |
09:13:31 | FromDiscord | <dersnof> so we dont use [] never |
09:14:40 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DK0 |
09:14:44 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4DK0" => "https://play.nim-lang.org/#ix=4DK1" |
09:15:08 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4DK1" => "https://play.nim-lang.org/#ix=4DK2" |
09:15:13 | FromDiscord | <Elegantbeef> whew phil corrected that |
09:15:17 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4DK2" => "https://play.nim-lang.org/#ix=4DK3" |
09:15:38 | * | tam quit (Ping timeout: 246 seconds) |
09:15:45 | FromDiscord | <Elegantbeef> Nim has primitive auto dereferencing on fields, so `ptr T` and `ref T` field access do not require `[]` |
09:16:05 | FromDiscord | <Phil> I actually have no clue why the iterators can't do the unreffing for you the same as the assignments do |
09:16:39 | FromDiscord | <Elegantbeef> It needs a nil check before hand but aside from that it of course can |
09:16:40 | FromDiscord | <Phil> I assume it is to make something explicit that has performance indications or something, but in what sense and why does it matter? |
09:16:42 | FromDiscord | <Elegantbeef> It just isnt implemented |
09:17:01 | FromDiscord | <Phil> ... I assumed there to be more thought behind the omission than that |
09:20:04 | FromDiscord | <Phil> One sec, I'll ask in internals just to triple check |
09:20:12 | FromDiscord | <Elegantbeef> Lol |
09:20:33 | FromDiscord | <Elegantbeef> It's a magic so it's more work to implement the compilation logic and code generation then "Just use `[]` lmao" |
09:21:02 | FromDiscord | <Phil> Ohh I haven't worked with iterators a lot, I thought it was just literally `use [] in iterator` |
09:21:19 | FromDiscord | <Phil> with some when clauses thrown in for when it's a ref type |
09:21:20 | FromDiscord | <Elegantbeef> Remember that it's a compiler magic |
09:21:22 | FromDiscord | <Elegantbeef> It's not that it's an iterator |
09:21:36 | FromDiscord | <Elegantbeef> Magics have to be supported on in code generation phases |
09:22:05 | FromDiscord | <Phil> Check, so it's basically a "The cost of this minor syntax smoothening is not worth the effort" |
09:22:13 | FromDiscord | <Phil> (edit) "the effort"" => "it"" |
09:24:49 | * | xet7 quit (Quit: Leaving) |
09:26:52 | FromDiscord | <dersnof> In reply to @isofruit "You do, but only": oh okay |
09:27:06 | FromDiscord | <dersnof> sent a code paste, see https://play.nim-lang.org/#ix=4DK9 |
09:27:08 | FromDiscord | <dersnof> wasnt ref object pointer syntax |
09:27:15 | FromDiscord | <dersnof> how it did use as object |
09:27:49 | FromDiscord | <jmgomez> sent a long message, see http://ix.io/4DKa |
09:27:53 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DKb |
09:28:00 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4DKb" => "https://play.nim-lang.org/#ix=4DKc" |
09:28:04 | FromDiscord | <dersnof> but its object 🤔 |
09:28:14 | FromDiscord | <Phil> It's ref object, reference = fancy pointer |
09:28:38 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4DKc" => "https://play.nim-lang.org/#ix=4DKd" |
09:29:07 | FromDiscord | <Phil> It explicitly states "This is a reference, but the data that it leads to on the heap is a Person" |
09:29:27 | FromDiscord | <dersnof> huh. this went bit over my head 🤔 |
09:29:50 | FromDiscord | <dersnof> Didnt know objects are pointers |
09:30:55 | FromDiscord | <Phil> They aren't.↵↵ref objects are pointers.↵normal objects aren't |
09:31:16 | FromDiscord | <dersnof> Oh why we marked as ref object here |
09:31:35 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DKf |
09:31:54 | FromDiscord | <Phil> No clue, I don't know in which context that example comes from |
09:32:29 | FromDiscord | <dersnof> Its from Nim tutorial part 2 |
09:32:47 | FromDiscord | <dersnof> it says |
09:32:49 | FromDiscord | <dersnof> Inheritance in Nim is entirely optional. To enable inheritance with runtime type information the object needs to inherit from RootObj. This can be done directly, or indirectly by inheriting from an object that inherits from RootObj. Usually types with inheritance are also marked as ref types even though this isn't strictly enforced. To check at runtime if an object is of a certain type, the of operator can be used. |
09:34:43 | * | tam joined #nim |
09:36:16 | FromDiscord | <Phil> In reply to @dersnof "Inheritance in Nim is": Ah, basically: ↵Inheritance works always when you do↵`object of RootObj`, regardless of if it's a ref object or not.↵ElegantBeef might have a clue why inheritance for value objects is a bad idea, but I assume some behaviour arises from it that is deeply undesireable in general, which is why most of the time types with inheritance are ref-types |
09:38:28 | FromDiscord | <dersnof> ah okay 😄 |
09:39:10 | * | tam quit (Ping timeout: 246 seconds) |
09:46:06 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4DKi |
10:03:33 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DKr |
10:03:59 | FromDiscord | <Phil> So you can enter into that string basically everything you can enter after a WHERE keyword in an sql statement |
10:04:54 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
10:06:05 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4DKv |
10:06:28 | * | tam joined #nim |
10:06:41 | FromDiscord | <Phil> Like, you want to close the connection rather than return it to the connection pool? |
10:06:54 | FromDiscord | <Phil> Or do you just want to return the connection to the connection pool? |
10:07:33 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "Or do you just": it's a netty connection here |
10:07:51 | FromDiscord | <Phil> I know nothing of netty so no idea |
10:08:51 | FromDiscord | <yaarb> btw if you r interested in reverse proxy , look at caddy ( it's the easiest one to setup & it manage https cert for you ) |
10:09:12 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @yaarb "btw if you r": Will have a look, thanks! |
10:09:50 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "I know nothing of": and is there a data structure where you only can put unique items in it, |
10:09:51 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "it," => "it?" |
10:11:36 | * | tam quit (Ping timeout: 260 seconds) |
10:14:49 | FromDiscord | <Phil> In reply to @sys64 "and is there a": As in you want to make sure that a certain column is unique? |
10:15:01 | FromDiscord | <Phil> (edit) "In reply to @sys64 "and is there a": As in you want to make sure that a certain column ... is" added "of your database table" |
10:19:04 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "As in you want": No, just to remove the item↵Like an hashmap or something |
10:20:05 | FromDiscord | <Phil> I mean, sets allow you to not have duplicates |
10:20:25 | FromDiscord | <System64 ~ Flandre Scarlet> Oh, thanks |
10:20:30 | FromDiscord | <Phil> https://nim-lang.org/docs/sets.html↵HashSet |
10:21:26 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DKz |
10:21:36 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4DKz" => "https://play.nim-lang.org/#ix=4DKA" |
10:25:43 | FromDiscord | <System64 ~ Flandre Scarlet> Oh nice, and if you want to delete "Potato"? |
10:26:24 | FromDiscord | <System64 ~ Flandre Scarlet> Oh, pop |
10:27:16 | FromDiscord | <Phil> Nah, that removes a random key |
10:27:30 | FromDiscord | <Phil> You want to remove a specific one, use `excl`.↵`incl`= include↵`excl` = exclude |
10:27:36 | FromDiscord | <Phil> Mathy terms |
10:29:10 | * | tam joined #nim |
10:33:32 | * | tam quit (Ping timeout: 240 seconds) |
10:37:11 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright, makes sense |
10:38:10 | advesperacit | Anyone noticed any problems with threadpools? It appears sync doesn't release intermittently for me.. I can see all threads printing their log messages from the finally statement that I've wrapped them in, but the main thread doesn't move past sync to exit |
10:40:52 | FromDiscord | <Phil> I'm not tall enough to write multithreaded code, so no idea |
10:41:23 | FromDiscord | <Phil> (Referencing the meme of mozilla's office having the "You must be this tall to write concurrent code"-meme |
10:41:29 | FromDiscord | <Phil> (edit) "code"-meme" => "code"-picture)" |
10:43:15 | advesperacit | a reckless disregard for your own future pain and suffering is a fine substitute for height |
10:44:24 | NimEventer | New thread by Hobbyman: Potential users, see https://forum.nim-lang.org/t/10414 |
10:47:29 | FromDiscord | <kyre58> Hey. Complete newb here. Got VSCodium, Nim, and dimscord on macOS. Getting these error highlights. Any way to get rid of them? https://media.discordapp.net/attachments/371759389889003532/1141684720602710036/image.png |
10:49:07 | FromDiscord | <heysokam> @kyre58 did you try to compile yet? |
10:49:18 | FromDiscord | <heysokam> i feel like it might be `dimscord` package missing in your install |
10:49:24 | FromDiscord | <heysokam> (edit) "i feel like it might be `dimscord` package missing in your install ... " added "🤔" |
10:50:14 | FromDiscord | <kyre58> Yeah lol, all good now. |
10:52:34 | * | dithpri joined #nim |
11:02:55 | * | tam joined #nim |
11:02:58 | FromDiscord | <System64 ~ Flandre Scarlet> what happens if you run 100 threads on a 8 cores CPU?↵does it switch quickly between threads? |
11:07:35 | * | tam quit (Ping timeout: 245 seconds) |
11:10:13 | FromDiscord | <System64 ~ Flandre Scarlet> Makes sense https://media.discordapp.net/attachments/371759389889003532/1141690436801540136/image.png |
11:19:57 | FromDiscord | <nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4DKU |
11:28:41 | PMunch | nnsee, what does `nim --version` say? |
11:29:31 | FromDiscord | <nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4DL0 |
11:29:36 | * | ntat quit (Quit: leaving) |
11:29:51 | FromDiscord | <ieltan> Hi guys, I was wondering if there is a way to extend an object at compile time ? (like, without using inheritance `ref object of X`) |
11:30:21 | PMunch | nnsee, hmm strange |
11:30:42 | PMunch | ieltan, well that's kinda what inheritance does.. |
11:31:01 | PMunch | (with normal objects, ref objects are a bit different) |
11:31:07 | FromDiscord | <ieltan> Ah, so there's no way around that ... |
11:31:26 | PMunch | You could of course write a macro which gets the implementation for a type and create a new type which adds fields |
11:31:33 | PMunch | Not sure what exactly you're trying to achieve |
11:32:11 | FromDiscord | <ieltan> In reply to @PMunch "(with normal objects, ref": You mean `object of` ? |
11:32:22 | PMunch | Yeah |
11:33:28 | FromDiscord | <ieltan> In reply to @PMunch "Not sure what exactly": What i'm trying to achieve is to allow users of a library to cache data using their own types instead of forcing them to use nim's hashtables |
11:33:40 | FromDiscord | <ieltan> and also allow them to specify custom fields |
11:33:52 | FromDiscord | <ieltan> but im not sure if that's possible, maybe with concepts ? |
11:34:10 | FromDiscord | <nnsee> In reply to @PMunch "<@961485620075720734>, hmm strange": i nuked my `~/.nimble` directory and bootstrapped using choosenim from scratch and it seems to work now |
11:34:14 | PMunch | Uhm, that didn't really make it any more clear.. |
11:34:14 | FromDiscord | <nnsee> no clue what happened there |
11:34:16 | FromDiscord | <nnsee> but thanks anyways |
11:34:20 | PMunch | Maybe use generic types? |
11:34:40 | PMunch | nnsee, probably you had an older version of chronicles installed |
11:34:42 | FromDiscord | <ieltan> In reply to @PMunch "Uhm, that didn't really": Sorry 😅 |
11:34:48 | PMunch | Or chronos, or whichever library it was :P |
11:35:43 | FromDiscord | <nnsee> i did explicitly set `chronicles.git#head` as well, but maybe I had an older version of some other sub-dependency |
11:35:45 | * | tam joined #nim |
11:36:43 | NimEventer | New thread by LokeX: Nim Side-Effects, see https://forum.nim-lang.org/t/10415 |
11:40:51 | * | tam quit (Ping timeout: 260 seconds) |
11:57:13 | FromDiscord | <enthus1ast> Have you encountered issues with osproc.waitForExit (linux) that occasionally raises "Invalid Argument" ? |
11:58:04 | FromDiscord | <enthus1ast> i periodically call executables and it works \~98% of time but \~2% it raises this |
12:03:35 | FromDiscord | <enthus1ast> its also not easy to follow through my code, i try if i can isolate the issue .... |
12:04:25 | FromDiscord | <jviega> I just directly call waitpid or wait3 and never have an issue |
12:05:26 | FromDiscord | <enthus1ast> thank you i'll try this as a workaround |
12:05:46 | FromDiscord | <enthus1ast> (if i cannot find the reason) |
12:07:58 | * | tam joined #nim |
12:12:28 | * | tam quit (Ping timeout: 248 seconds) |
12:14:14 | FromDiscord | <Chronos [She/Her]> What if I made something to crappily parse grammar- |
12:14:44 | FromDiscord | <Chronos [She/Her]> Like a poor woman's PEG grammar |
12:16:28 | FromDiscord | <Chronos [She/Her]> Eh, too much effort for now really |
12:18:18 | FromDiscord | <Chronos [She/Her]> What type of OOP does Nim use? |
12:21:19 | FromDiscord | <enthus1ast> @Chronos [She/Her]\: This might answer your questions\: https://nim-lang.org/docs/tut2.html#object-oriented-programming |
12:21:38 | * | xet7 joined #nim |
12:24:05 | * | tam joined #nim |
12:27:52 | * | cm quit (Ping timeout: 246 seconds) |
12:28:11 | * | cm joined #nim |
12:28:34 | * | tam quit (Ping timeout: 246 seconds) |
12:33:59 | FromDiscord | <Chronos [She/Her]> Yep that works, thanks! |
12:39:12 | NimEventer | New Nimble package! websitegenerator - Static html and css generator., see https://github.com/nirokay/websitegenerator |
12:40:41 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4DLb |
12:44:49 | FromDiscord | <enthus1ast> try `request.body` |
12:45:02 | FromDiscord | <enthus1ast> https://github.com/dom96/jester#request-object |
12:58:43 | * | tam joined #nim |
13:00:31 | * | lucasta joined #nim |
13:00:52 | * | Mister_Magister quit (Ping timeout: 240 seconds) |
13:00:53 | * | Mister_Magister_ joined #nim |
13:03:08 | * | tam quit (Ping timeout: 248 seconds) |
13:04:21 | * | Mister_Magister_ is now known as Mister_Magister |
13:13:59 | FromDiscord | <System64 ~ Flandre Scarlet> It works, thanks! |
13:14:58 | * | tam joined #nim |
13:15:53 | FromDiscord | <enthus1ast> i can reproduce the Invalid argument crash |
13:15:55 | FromDiscord | <enthus1ast> \:/ |
13:16:09 | FromDiscord | <enthus1ast> can you try as well ? |
13:17:04 | FromDiscord | <enthus1ast> sent a long message, see http://ix.io/4DLs |
13:17:27 | * | PMunch quit (Quit: Leaving) |
13:19:15 | * | tam quit (Ping timeout: 245 seconds) |
13:21:27 | FromDiscord | <enthus1ast> i've removed all echos for less noise |
13:25:40 | * | junaid_ joined #nim |
13:29:46 | NimEventer | New thread by enthus1ast: Strange osproc.waitForExit crash, see https://forum.nim-lang.org/t/10416 |
13:35:57 | * | rockcavera joined #nim |
13:48:48 | * | tam joined #nim |
13:53:43 | * | tam quit (Ping timeout: 258 seconds) |
13:58:59 | * | junaid_ quit (Remote host closed the connection) |
13:59:36 | * | xet7 quit (Quit: Leaving) |
14:01:44 | * | junaid_ joined #nim |
14:18:02 | * | azimut joined #nim |
14:22:45 | * | tam joined #nim |
14:23:53 | FromDiscord | <jos7388> huh i'm confused |
14:24:00 | FromDiscord | <jos7388> why do object fields have to be marked var? |
14:24:06 | FromDiscord | <jos7388> shouldn't var be viral |
14:24:42 | FromDiscord | <jos7388> i have to make two variants of a type if i want it to be mutable/immutable in different contexts? |
14:29:07 | * | tam quit (Ping timeout: 245 seconds) |
14:34:47 | FromDiscord | <jos7388> actually i think i just got confused |
14:35:37 | FromDiscord | <jos7388> i think the actual issue is that `items` doesn't return a mutable iterator |
14:35:48 | FromDiscord | <jos7388> i was trying to do `for var x in someSeq` |
14:35:50 | FromDiscord | <enthus1ast> there is mitems |
14:36:05 | FromDiscord | <jos7388> that works |
14:36:06 | FromDiscord | <jos7388> thanks! |
14:36:37 | FromDiscord | <enthus1ast> usually you mark the parameters of a proc var |
14:37:11 | FromDiscord | <enthus1ast> https://play.nim-lang.org/#ix=4DLT |
14:37:21 | FromDiscord | <jos7388> ye |
14:37:33 | FromDiscord | <jos7388> i thought it was rust style where you can have a pattern in the `for _ in x` position |
14:37:45 | FromDiscord | <jos7388> and a valid pattern would be `var x` |
14:37:48 | FromDiscord | <jos7388> i think thats how it works anyway |
14:38:14 | FromDiscord | <jos7388> but mitems works!! |
14:40:32 | FromDiscord | <enthus1ast> btw, its defined here\: https://github.com/nim-lang/Nim/blob/037f536e7ee25c4baf23dff8a4525825c506442c/lib/system/iterators.nim#L44 |
14:45:11 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4DLX |
14:45:54 | FromDiscord | <jmgomez> (edit) "https://play.nim-lang.org/#ix=4DLX" => "https://play.nim-lang.org/#ix=4DLY" |
14:48:11 | FromDiscord | <Phil> M for mutable |
14:54:02 | FromDiscord | <juan_carlos> B for bug |
14:54:09 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4DM2 |
14:54:23 | FromDiscord | <heysokam> (edit) "https://play.nim-lang.org/#ix=4DM2" => "https://play.nim-lang.org/#ix=4DM3" |
14:54:32 | * | junaid_ quit (Remote host closed the connection) |
14:54:40 | FromDiscord | <heysokam> why is order changed? |
14:55:20 | FromDiscord | <heysokam> i assume there is some other rule to find the positions of symbols, other than insertion order?↵is that why? 🤔 |
14:57:32 | * | ntat joined #nim |
14:59:28 | FromDiscord | <jmgomez> By convention, imagine what a mess it would be if you change the order for `Infix` but `Call` reminds as it is |
15:00:04 | * | tam_ joined #nim |
15:02:37 | FromDiscord | <jos7388> i dont even see why children are ordered at all, why not just access them by name |
15:02:43 | FromDiscord | <jviega> The operator is ->, the things it operates on are nodes underneath it |
15:03:10 | FromDiscord | <jviega> I meant to say "are typically" |
15:03:26 | FromDiscord | <jviega> But it's fine, it's clear what's going on |
15:03:41 | FromDiscord | <jviega> It's a pretty reasonable way to handle it from a compiler's point of view |
15:04:08 | FromDiscord | <heysokam> im not critizising anything, im trying to understand how to interpret the ast inside a macro, thats all |
15:04:20 | FromDiscord | <jviega> Most compilers would give you: |
15:04:25 | FromDiscord | <heysokam> (edit) "macro," => "NimNode proc," |
15:04:34 | FromDiscord | <heysokam> so i can iterate through the things, to be able to debug what's there and whats not |
15:05:07 | FromDiscord | <jviega> sent a code paste, see https://play.nim-lang.org/#ix=4DMf |
15:05:27 | FromDiscord | <jviega> So being more explicit that it was from an infix operator, and having the operator come first is totally understandable and fine |
15:06:07 | FromDiscord | <heysokam> is there somewhere that i can see what the shape of all options look like? |
15:06:20 | FromDiscord | <heysokam> or do i have to figure out ways to do each thing manually? |
15:06:23 | FromDiscord | <enthus1ast> in the macros module |
15:06:27 | FromDiscord | <jos7388> is there a reason that operators are expressed like that in the AST though? i am genuinely curious |
15:06:49 | FromDiscord | <jos7388> normally i would just see 3 fields, lhs, rhs, and op |
15:06:57 | FromDiscord | <jos7388> what's the advantage of exposing them as a list? |
15:07:01 | FromDiscord | <jos7388> (edit) "exposing" => "expressing" |
15:07:06 | FromDiscord | <jviega> Probably so they can allow for user-defined infix operators without having to dynamically come up w/ new node types |
15:07:28 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4DMh |
15:07:29 | FromDiscord | <heysokam> that's why i was asking to begin with |
15:07:31 | FromDiscord | <jos7388> that makes sense i guess |
15:07:35 | FromDiscord | <jviega> `op` is essentially an enumeration for them |
15:07:48 | FromDiscord | <jos7388> i wonder if it's it's something lisp does too |
15:07:51 | FromDiscord | <jviega> So think of Infix as an "other (infix)" and then you know the first arg is the operator |
15:08:31 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4DMi |
15:08:51 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4DMj |
15:09:03 | FromDiscord | <heysokam> do i do the same for the proc? |
15:09:24 | FromDiscord | <enthus1ast> yes |
15:09:30 | * | dithpri quit (Ping timeout: 246 seconds) |
15:09:33 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4DMk |
15:09:40 | FromDiscord | <heysokam> ah thats why |
15:09:55 | FromDiscord | <heysokam> so how do I pass the function to a proc such that I get all of the same information? |
15:11:29 | FromDiscord | <enthus1ast> mh i don't know if this is possible (if i get you right) |
15:11:29 | FromDiscord | <enthus1ast> maybe have a look how dumpTree (if not a magic) is implemented |
15:11:32 | * | dithpri joined #nim |
15:12:51 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4DMq |
15:14:01 | FromDiscord | <heysokam> I'm just trying to understand how to start reporting what I have to console, to be able to parse the symbol tree inside the proc |
15:14:12 | FromDiscord | <heysokam> (edit) "I'm just trying to understand how to start reporting what I have to console, to be able to parse the ... symbol" added "nim's" |
15:15:03 | FromDiscord | <heysokam> basically confused by my own obtusity, i understand that much. but just trying to get unstuck |
15:21:55 | FromDiscord | <.maverk> nim compiled to bytecode or machine code ???? |
15:23:34 | FromDiscord | <heysokam> <@&371760044473319454> 👆 maybe? name is sketchy |
15:24:42 | FromDiscord | <Phil> They're fine for now, no overly suspicious behaviour has been identified as of now |
15:24:54 | FromDiscord | <heysokam> kk |
15:24:55 | FromDiscord | <.maverk> 😇 |
15:25:08 | FromDiscord | <nervecenter> In reply to @.maverk "nim compiled to bytecode": machine code |
15:25:21 | FromDiscord | <Phil> The name really doesn't help though mirai |
15:25:24 | FromDiscord | <.maverk> In reply to @nervecenter "machine code": but it is compiled to c first |
15:25:27 | FromDiscord | <.maverk> ??? |
15:25:32 | FromDiscord | <.maverk> that is not native |
15:25:33 | FromDiscord | <nervecenter> Which is compiled to machine code |
15:25:51 | FromDiscord | <nervecenter> The compiled program you run is a native executable |
15:25:51 | FromDiscord | <.maverk> hmmmm this is an intermediate compilition |
15:25:51 | FromDiscord | <bostonboston> ^ |
15:25:58 | FromDiscord | <.maverk> which is technically not native |
15:26:03 | FromDiscord | <nervecenter> semantics |
15:26:07 | FromDiscord | <heysokam> In reply to @.maverk "but it is compiled": https://peterme.net/is-nim-a-transpiler.html there you go |
15:26:10 | FromDiscord | <Phil> Technically the output in the end is a binary |
15:26:15 | FromDiscord | <Phil> Thus native |
15:26:15 | FromDiscord | <heysokam> answer, it is native, and it is a compiler |
15:26:43 | FromDiscord | <.maverk> In reply to @isofruit "Technically the output in": c compiles directly to binary |
15:26:52 | FromDiscord | <.maverk> but nim to c and then binary |
15:26:56 | FromDiscord | <heysokam> and C is the IR of nim |
15:27:10 | FromDiscord | <heysokam> the IR is not relevant, only the result |
15:27:12 | FromDiscord | <nervecenter> this is arguing semantics and not really useful |
15:27:12 | FromDiscord | <.maverk> it broke my heart |
15:27:33 | FromDiscord | <heysokam> (edit) "the IR is not relevant, only the ... resultis" added "result. and the" | "result. and theresult ... " added "is native binaries" |
15:28:24 | FromDiscord | <bostonboston> No different than any other IR |
15:28:24 | FromDiscord | <heysokam> How can I report in console everything that a `thing :typed` argument contains in its tree? |
15:28:45 | FromDiscord | <Phil> In reply to @.maverk "but nim to c": C compiles to assembly, now nothing is native |
15:29:03 | FromDiscord | <.maverk> In reply to @isofruit "C compiles to assembly,": no that means native |
15:29:22 | FromDiscord | <.maverk> it produces and object file |
15:29:27 | FromDiscord | <heysokam> In reply to @.maverk "no that means native": asm is a platform-dependent IR, not a `native` anything |
15:30:23 | FromDiscord | <jaar23> sent a code paste, see https://play.nim-lang.org/#ix=4DMA |
15:30:56 | FromDiscord | <.maverk> In reply to @heysokam "asm is a platform-dependent": well it compiles to c and then assembly and then binary |
15:31:35 | FromDiscord | <heysokam> In reply to @.maverk "well it compiles to": then zig is not native either, because it compiles to ZIR -> LLVM IR -> asm -> binary |
15:31:54 | FromDiscord | <heysokam> what you say is nonsense semantical interpretation, pardon my forwardness |
15:32:09 | FromDiscord | <heysokam> the important part is the output, not the IR |
15:32:27 | FromDiscord | <.maverk> In reply to @heysokam "then zig is not": i am making a compiler in assembly |
15:32:29 | FromDiscord | <.maverk> so |
15:32:45 | FromDiscord | <.maverk> this is what i understand about intermediates compilitions |
15:43:52 | FromDiscord | <spoon__> nim docs stuck in light mode after 2.0 |
15:44:28 | FromDiscord | <spoon__> even changing from "use os" to "dark" it still doesn't work |
15:44:30 | FromDiscord | <Phil> Known bug, fix pushed and deployed, waiting for new release |
15:44:37 | FromDiscord | <spoon__> gotcha |
15:46:13 | FromDiscord | <Phil> Basically there's a fixed js file already on the server, the html just doesn't call it. And for technical reasons I have no understanding of as I am not on team compiler that can only happen on new release |
15:54:30 | * | lucasta quit (Remote host closed the connection) |
15:54:51 | * | lucasta joined #nim |
16:11:24 | FromDiscord | <toma400> Is there any Nim method to get screen size (width, height)? |
16:21:03 | FromDiscord | <griffith1deadly> In reply to @toma400 "Is there any Nim": system api |
16:27:03 | * | tam_ quit (Ping timeout: 246 seconds) |
16:30:57 | FromDiscord | <ShalokShalom (ShalokShalom)> you can use DarkReader↵(@spoon) |
16:36:41 | * | lucasta quit (Remote host closed the connection) |
16:40:26 | FromDiscord | <Phil> Oh wow, PFP change |
16:54:33 | * | tam joined #nim |
17:00:09 | * | tam quit (Ping timeout: 246 seconds) |
17:50:18 | FromDiscord | <jos7388> hmm i'm trying to implement layout for a UI library i'm writing |
17:50:34 | FromDiscord | <jos7388> i'd like layout to occur async, so i'm trying to separate all the state for it |
17:51:46 | FromDiscord | <jos7388> is there something like an Expando in nim? |
17:53:06 | FromDiscord | <Phil> Like a what now? |
17:57:27 | * | fireglow joined #nim |
17:59:46 | * | tam joined #nim |
18:13:23 | FromDiscord | <ShalokShalom (ShalokShalom)> If you mean me, thats probably because I am logged in via the Gitter implementation of Matrix↵(@Phil) |
18:13:44 | FromDiscord | <Phil> I did, the mysterious ways of matrix! |
18:27:49 | NimEventer | New question by mar-tina: Passing nsview pointer between objc and nim using nim ffi, see https://stackoverflow.com/questions/76924214/passing-nsview-pointer-between-objc-and-nim-using-nim-ffi |
18:45:28 | * | rockcavera quit (Read error: Connection reset by peer) |
18:45:49 | * | rockcavera joined #nim |
18:45:49 | * | rockcavera quit (Changing host) |
18:45:49 | * | rockcavera joined #nim |
18:50:22 | * | tam quit (Ping timeout: 245 seconds) |
18:52:09 | * | ntat quit (Quit: leaving) |
18:56:06 | NimEventer | New thread by nimian: Kubernetes operator in Nim?, see https://forum.nim-lang.org/t/10417 |
19:25:48 | * | junaid_ joined #nim |
19:28:28 | * | tam joined #nim |
19:35:41 | * | tam quit (Ping timeout: 260 seconds) |
19:37:01 | * | xet7 joined #nim |
19:37:52 | FromDiscord | <eb442a17a2aaee577399ca9e38eb67b5> Nim helped me figure out windows api, but I don't need it anymore because of the detection rate |
19:38:06 | FromDiscord | <eb442a17a2aaee577399ca9e38eb67b5> C++ is better for me now |
19:38:38 | termer | Detection rate? |
19:41:05 | * | xet7 quit (Remote host closed the connection) |
19:44:17 | FromDiscord | <Phil> Antivirus I assume |
19:46:17 | termer | I guess in insulated from this by not using Windows |
19:46:30 | termer | *I'm insulated |
19:47:12 | termer | Someone made a virus in Nim and now the retards making the antivirus definitions flag everything Nim as malware |
19:47:31 | termer | really frustrating |
19:47:51 | * | junaid_ quit (Remote host closed the connection) |
19:50:51 | Amun-Ra | I'm not on wintendo neither but I played a little with win32api and av never triggered |
19:52:52 | FromDiscord | <heysokam> Is there a way to alias the result value so that it can be changed with a different name? |
19:53:17 | FromDiscord | <heysokam> (edit) "name?" => "name, with no syntax changes?" |
19:54:08 | Amun-Ra | something like x = 2; y = x; y = 3 changes x? |
19:54:16 | FromDiscord | <heysokam> ye |
19:54:35 | FromDiscord | <heysokam> but for the resulting value of a proc, without having to do `[]` everywhere |
19:54:56 | Amun-Ra | refs? |
19:55:14 | FromDiscord | <heysokam> yeah but question is -how- 🙂 |
19:55:35 | FromDiscord | <heysokam> tried with `ptr string` but it doesn't work |
19:55:46 | FromDiscord | <heysokam> (edit) "work" => "work, needs to be dereferenced or functions fail" |
19:59:35 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4DOb |
20:04:38 | FromDiscord | <kyre58> sent a long message, see http://ix.io/4DOe |
20:05:18 | FromDiscord | <movrax> It’s zsh, not bash |
20:05:53 | FromDiscord | <movrax> Make a .zshrc file |
20:06:26 | FromDiscord | <Phil> aye, the apple shell by default is zshell, not bash |
20:06:59 | FromDiscord | <Phil> functionally identical for most purposes, but different .rc files |
20:07:14 | Amun-Ra | heysokam: https://play.nim-lang.org/#ix=4DOg |
20:07:56 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @termer "Someone made a virus": I'm annoyed about this because I wrote a synth in Nim |
20:08:47 | termer | People should be angry at the AV companies more than anything |
20:09:08 | termer | accessing win32 APIs isn't a crime, and neither is having NimMain in your program |
20:10:12 | * | Jjp137 quit (Quit: Leaving) |
20:11:36 | * | Jjp137 joined #nim |
20:11:56 | FromDiscord | <heysokam> In reply to @Amun-Ra "<@186489007247589376>: https://play.nim-lang.org/#i": missing the point. the idea is this:↵https://play.nim-lang.org/#ix=4DOg |
20:12:02 | FromDiscord | <kyre58> sent a code paste, see https://play.nim-lang.org/#ix=4DOh |
20:14:00 | FromDiscord | <heysokam> @Daniel Belmes 👆 do you know about this one? first time install on mac, following instructions |
20:14:16 | FromDiscord | <heysokam> (edit) "one? first" => "one from @kyre58?↵first" |
20:14:26 | FromDiscord | <heysokam> (edit) "@Daniel Belmes 👆 do you know about this one from @kyre58?↵first time install on mac, following instructions ... " added "from manual" |
20:15:35 | FromDiscord | <Daniel Belmes> In reply to @heysokam "<@92096085773815808> 👆 do you": reading |
20:16:08 | FromDiscord | <heysokam> his path is not being exported because its zsh not bash |
20:16:14 | FromDiscord | <heysokam> (edit) "his ... path" added "nimble" |
20:17:21 | FromDiscord | <Daniel Belmes> In reply to @kyre58 "Thanks. Now I’m getting:": I believe you have a typo somewhere in line 1 of your zsh |
20:17:24 | FromDiscord | <Daniel Belmes> (edit) "zsh" => "zshrc" |
20:19:50 | FromDiscord | <kyre58> In reply to @homicidalburger "I believe you have": I do. |
20:19:54 | FromDiscord | <kyre58> :PokemonAlolanVulpixFacepalm: |
20:20:18 | FromDiscord | <kyre58> Working now :PokemonPikachuPat: |
20:20:39 | FromDiscord | <heysokam> In reply to @kyre58 "Working now <:PokemonPikachuPat:1139481445262446642": https://stackoverflow.com/questions/11530090/adding-a-new-entry-to-the-path-variable-in-zsh#18077919 |
20:20:40 | FromDiscord | <Daniel Belmes> In reply to @kyre58 "Working now <:PokemonPikachuPat:1139481445262446642": when you have time and wanna pimp your shell I recommend https://ohmyz.sh/ 🙂 |
20:20:57 | FromDiscord | <heysokam> In reply to @homicidalburger "when you have time": bruh, xonsh is gold |
20:21:01 | FromDiscord | <heysokam> why even sh syntax |
20:21:11 | FromDiscord | <Daniel Belmes> auto suggestions save so much time |
20:21:12 | FromDiscord | <Daniel Belmes> I love them |
20:21:13 | FromDiscord | <heysokam> python. we are nim ppl! |
20:21:33 | FromDiscord | <Daniel Belmes> (edit) "save" => "saves" |
20:21:34 | FromDiscord | <heysokam> In reply to @homicidalburger "auto suggestions saves so": yeah, but imagine your shell being literal python, not just some crappy sh 70s lang |
20:22:05 | FromDiscord | <Daniel Belmes> In reply to @heysokam "yeah, but imagine your": very good point... |
20:22:13 | FromDiscord | <Daniel Belmes> does it have auto suggestions |
20:22:19 | FromDiscord | <kyre58> In reply to @homicidalburger "when you have time": I just use terminal to copy paste commands from the internertz |
20:22:23 | FromDiscord | <heysokam> i meant _also_↵because autocomplete is legendary in xonsh |
20:22:48 | FromDiscord | <heysokam> (edit) "_also_↵because" => "_also_ python↵because" |
20:23:08 | FromDiscord | <Daniel Belmes> In reply to @heysokam "<@92096085773815808> i meant _also_": Well I am hopefully getting a new work laptop soon. I'll try Xonsh |
20:23:18 | FromDiscord | <heysokam> bash feels so clunky after being used to xonsh when I have to open it 😄 |
20:23:35 | FromDiscord | <heysokam> (edit) "bash ... feels" added "and any sh syntax" |
20:26:43 | FromDiscord | <Elegantbeef> @Phil value based inheritance is not really bad, just you need to know what you're doing. Since there is no pointer indirection |
20:27:24 | FromDiscord | <Phil> Yeah but like... what's the actual behaviour change?↵Is it just that you suddenly no longer have a many-to-one relationship between your refs and your data? |
20:27:43 | FromDiscord | <Elegantbeef> You cannot store the data homogenously, conversions are lossy |
20:27:55 | FromDiscord | <heysokam> thinking about shells, `nimsh` when? 🤔 |
20:28:07 | FromDiscord | <Phil> In reply to @Elegantbeef "You cannot store the": Assume I have no idea what that means |
20:28:16 | FromDiscord | <heysokam> (edit) "when?" => "#when?" |
20:28:31 | FromDiscord | <Elegantbeef> `seq[Base]` is invalid for non refs |
20:28:33 | FromDiscord | <Phil> In reply to @heysokam "thinking about shells, `nimsh`": Why use nimsh when you can just write your scripts in nimscript to call home to bash but with much saner syntax |
20:28:54 | FromDiscord | <Phil> ~~Okay yes you need a compiler but still!~~ |
20:28:54 | FromDiscord | <Elegantbeef> `var b: Base = Base Child()` removes fields |
20:29:02 | FromDiscord | <heysokam> In reply to @isofruit "Why use nimsh when": yeah but how do you execute them? |
20:29:37 | FromDiscord | <Elegantbeef> You ship an interpreter that is nimscript |
20:29:40 | FromDiscord | <heysokam> because running scripts usually means `nim script.nims` and also completely losing access to a ton of features of a proper shell |
20:30:03 | FromDiscord | <Phil> In reply to @heysokam "because running scripts usually": If you have access to `exec` to call the underlying bash shell, you can do whatever you want |
20:30:23 | FromDiscord | <Phil> But without having to deal with whatever bash thinks counts for an if clause or a for-loop |
20:30:41 | FromDiscord | <Phil> Unless you want to write your script that way, in which case, more power to you |
20:30:54 | FromDiscord | <Elegantbeef> You do `nimsh myfile` |
20:30:56 | FromDiscord | <heysokam> the idea is to get rid of bash |
20:30:57 | FromDiscord | <Phil> Also easier time using variables, even across scripts |
20:30:59 | FromDiscord | <Elegantbeef> You can ship the Nim VM as a self contained program |
20:31:24 | FromDiscord | <heysokam> In reply to @Elegantbeef "You can ship the": my point is the shell interpreter being the actual nimsh itself, not calling for it in bash |
20:31:41 | FromDiscord | <Phil> I mostly just shrug because for me nimscript is already the superior alternative for any kind of build-script.↵I don't really have other scripting needs outside of that |
20:31:52 | FromDiscord | <heysokam> placing it in /usr/bin and replacing it with `chsh /usr/bin/minsh` |
20:31:59 | FromDiscord | <Elegantbeef> Right and you can ship the nimvm as the interpreter and not use bash |
20:32:19 | FromDiscord | <heysokam> am i explaining my idea so bad? 😔 |
20:32:24 | FromDiscord | <Phil> sOkam's point there was that the nimvm with libs does not have as much tooling as bash |
20:32:45 | FromDiscord | <heysokam> nimsh would be an absolute and complete and total replacement for bash (or any form of sh syntax) with proper nim |
20:32:47 | FromDiscord | <Phil> My counter was "well you can use bash tooling as necessary but leave the ugly bash syntax behind for the most part" |
20:33:15 | FromDiscord | <Elegantbeef> How doesnt it you can define your own operators and the like |
20:33:15 | FromDiscord | <Elegantbeef> It'd be a usable shell it wouldnt be bash or sh compatible |
20:33:19 | FromDiscord | <heysokam> want bash? just `$ bash` inside nimsh |
20:33:23 | FromDiscord | <Phil> But that doesn't count for him while for me it's completely okay.↵I mostly don't want to deal with bash-syntax constructs because they're ugly to read, he wants to replace the shell and all utils |
20:33:30 | FromDiscord | <heysokam> like i do iwth xonsh at the moment |
20:34:15 | FromDiscord | <heysokam> In reply to @Elegantbeef "It'd be a usable": not if you have a set prefix that just calls for `execShellCmd` |
20:34:54 | FromDiscord | <heysokam> `mycommand` read with nimsh normally↵`!mycommand` sent to a `execShellCmd("command")` |
20:35:06 | FromDiscord | <Elegantbeef> Who said you'd do that |
20:35:07 | FromDiscord | <Elegantbeef> I didnt |
20:35:15 | FromDiscord | <Phil> I did, I am to blame |
20:35:20 | FromDiscord | <Elegantbeef> A unary operator isnt good enough |
20:35:24 | FromDiscord | <heysokam> Im talking about replacing bash completely |
20:35:31 | FromDiscord | <Elegantbeef> Right as am i |
20:35:45 | FromDiscord | <heysokam> whatever, it was a silly idea. lets not debate about fictional dreams 🙈 |
20:36:01 | FromDiscord | <Elegantbeef> There really isnt any debate |
20:36:14 | FromDiscord | <Elegantbeef> You can use the nimvm and hook into any procedure you want and expose it to the 'shell' |
20:36:42 | FromDiscord | <heysokam> but can you make nimvm the only shell active in memory in the system? |
20:36:59 | FromDiscord | <heysokam> because right now i have xonsh, but it opens inside bash first |
20:37:06 | FromDiscord | <Elegantbeef> Can you write a shell that does that? |
20:37:07 | FromDiscord | <Elegantbeef> If so, yes |
20:37:33 | FromDiscord | <heysokam> `write a shell that`... well, that was the nimsh idea to begin with |
20:38:02 | FromDiscord | <Elegantbeef> Well yea you have to write all the plumbing to make it a valid shell, but that's required for any shell |
20:38:18 | FromDiscord | <Elegantbeef> Otherwise it's just use nimscript's interop and make your procedures for your features you want |
20:38:31 | FromDiscord | <heysokam> then im not really understanding what you argumenting 🙈 |
20:38:44 | FromDiscord | <heysokam> because that's what i said at the very beginning |
20:39:33 | FromDiscord | <Elegantbeef> I'm not arguing |
20:39:48 | FromDiscord | <Elegantbeef> I'm saying that this is totally doable without shelling out with `execShellCmd` |
20:40:04 | FromDiscord | <Elegantbeef> The only issue is that due to being inside nimscript it's a bit iffy on dispatching |
20:40:34 | FromDiscord | <heysokam> In reply to @Elegantbeef "I'm saying that this": ahhh i see what you mean |
20:48:00 | FromDiscord | <heysokam> @ElegantBeouf https://play.nim-lang.org/#ix=4DOg did you see this question from earlier?↵maybe you can confirm if its doable at all, or just not possible without changing syntax |
20:49:03 | FromDiscord | <heysokam> oh wait waht, my version got delete |
20:49:06 | FromDiscord | <heysokam> (edit) "delete" => "deleted" |
20:49:31 | FromDiscord | <jos7388> huh why doesn’t that work |
20:49:44 | FromDiscord | <jos7388> shouldn’t it print the same value since you return a ref |
20:50:48 | FromDiscord | <heysokam> https://play.nim-lang.org/#ix=4DOx |
20:51:10 | FromDiscord | <heysokam> In reply to @jos7388 "shouldn’t it print the": because the web deleted my code, since i didn't press "share ix" to update it |
20:51:35 | FromDiscord | <jos7388> I’m confused why ur original example didn’t have ref semantics tho |
20:51:39 | FromDiscord | <jos7388> might have misread |
20:52:05 | FromDiscord | <jos7388> oh ignore me, I misread. It does behave as a ref type |
20:52:54 | FromDiscord | <heysokam> In reply to @jos7388 "oh ignore me, I": idk about the broken link. that was from amunra, and he did post correct referencing code↵but he missed the point I was making. the correct one is: https://play.nim-lang.org/#ix=4DOx |
20:55:16 | FromDiscord | <jos7388> ye makes more sense |
20:55:47 | FromDiscord | <heysokam> the goal is to be able to alias `result`, because in this one context it does makes the code more readable |
20:56:22 | FromDiscord | <heysokam> i know i can just do `return code`... but was just asking if there is a way around it |
20:58:32 | FromDiscord | <Elegantbeef> `byaddr` in `std/decls` |
20:59:42 | FromDiscord | <Elegantbeef> Alternatively make a proc that calls a proc with `code: var string` |
21:01:59 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4DOC |
21:02:36 | FromDiscord | <Elegantbeef> no |
21:03:03 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DOD |
21:04:06 | FromDiscord | <heysokam> is what I wrote not legal code? |
21:04:13 | FromDiscord | <heysokam> or would do something incorrect? |
21:04:15 | FromDiscord | <Elegantbeef> Of course not |
21:04:23 | FromDiscord | <Elegantbeef> You're taking an immutable value and raising it to mutable |
21:04:32 | FromDiscord | <heysokam> because the idea is to have a general purpose tool, not do that aliasing for every single function ever |
21:04:42 | FromDiscord | <Elegantbeef> Plus nim does not have aliasing |
21:04:45 | FromDiscord | <Elegantbeef> Just use byaddr |
21:05:33 | FromDiscord | <Elegantbeef> `var a = someVarReturnType(arg)` copies to `a` |
21:05:33 | FromDiscord | <Elegantbeef> When Nim has views implemented it'll eventually work that you can do `var a: var T = somVarReturn(arg)` |
21:05:58 | FromDiscord | <Elegantbeef> It's wholly unsafe with present Nim as there is no insurance of lifetimes |
21:06:08 | FromDiscord | <heysokam> i see |
21:06:24 | FromDiscord | <Elegantbeef> say you do `var a: var int = mySeq[^1]; mySeq.add [10, 20, 30]` |
21:06:54 | FromDiscord | <heysokam> seeing the `byaddr` comment, i think i will just use `return code` 🤷♂️ |
21:06:55 | FromDiscord | <Elegantbeef> Without a borrow checker that's valid and means you're unlikely to be pointing at the sequence in the end |
21:07:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DOE |
21:07:44 | FromDiscord | <heysokam> but that needs to exist in every file, and cannot be part of a std extension or anything |
21:08:06 | FromDiscord | <heysokam> i'd rather just return the generated value, unless its extremely heavy on memory |
21:08:26 | FromDiscord | <heysokam> (edit) "value," => "variable (instead or result = ...)," |
21:17:42 | * | tam joined #nim |
21:27:26 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DOJ |
21:35:02 | FromDiscord | <heysokam> that involves a huge indent block for everything |
21:35:08 | FromDiscord | <heysokam> goal is to just reference/alias |
21:35:13 | FromDiscord | <Elegantbeef> Also clearly aliases and is reusable |
21:35:23 | FromDiscord | <heysokam> but no biggie, just return the temp val and #done |
21:36:23 | FromDiscord | <Elegantbeef> Time for an rfc of "When a named tuple is used as a return type it's fields are injected symbols in the procedure's scope" |
21:36:35 | FromDiscord | <Elegantbeef> `proc doThing(): tuple[code: string]` 😄 |
21:37:10 | FromDiscord | <movrax> I just withdrew $1k from my bank account |
21:37:17 | FromDiscord | <movrax> It really hurt seeing it |
21:37:48 | FromDiscord | <Elegantbeef> Wrong discord i take iit |
21:37:50 | FromDiscord | <movrax> Yep |
21:37:54 | FromDiscord | <movrax> That was a mistake |
21:38:09 | FromDiscord | <Elegantbeef> We forgive you |
21:38:10 | FromDiscord | <graveflo> I was about to ask if you wc LOL |
21:38:13 | FromDiscord | <Elegantbeef> But irc will never unsee it |
21:38:19 | FromDiscord | <movrax> Crap |
21:38:25 | FromDiscord | <movrax> Oh well |
21:38:51 | FromDiscord | <Elegantbeef> Time to relax and write Nim now |
21:41:05 | termer | I just took a massive shit |
21:41:13 | termer | It really hurt seeing it flush |
21:41:19 | termer | oops wrong channel |
21:41:24 | FromDiscord | <Elegantbeef> Termer this is the write chat though |
21:41:24 | * | advesperacit quit () |
21:41:26 | FromDiscord | <Elegantbeef> right\ |
21:41:31 | FromDiscord | <Elegantbeef> We deal with a lot of shit here |
21:41:38 | termer | hehehe hoohoohoo |
21:56:45 | * | tam quit (Ping timeout: 246 seconds) |
22:00:59 | * | tam joined #nim |
22:15:05 | * | jmdaemon joined #nim |
22:30:04 | * | tam quit (Ping timeout: 248 seconds) |
22:33:31 | FromDiscord | <wick3dr0se> Is there an epoch seconds proc? Trying to check time and then compare it as a variable later |
22:33:43 | FromDiscord | <wick3dr0se> Or better approach ig |
22:35:12 | FromDiscord | <Elegantbeef> `std/monotimes` is better for benchmarking |
22:39:01 | * | krux02 joined #nim |
22:42:01 | FromDiscord | <wick3dr0se> Well really idk what would be the best solution and idt what I'm trting rn is going to work. I made a rawMode() proc that accepts vmin and vtime arguments. Using it to create a readChar() implementation that closes immediately on input without enter. It works perfectly but I can't get vtime to handle the timeout correctly. Specifying 10 to vtime should wait 10 seconds for input and close if it doesnt receive it, if I'm right.. |
22:43:33 | FromDiscord | <wick3dr0se> Just making my own type of non-blocking getch. I was working on it in the past but never finished |
23:17:02 | * | xet7 joined #nim |
23:28:31 | FromDiscord | <dersnof> I wonder what would be usage of JS output feature of Nim |
23:28:56 | FromDiscord | <Elegantbeef> Outputting JS to use in places you'd use JS |
23:30:20 | FromDiscord | <m4ul3r> `--opt:size` happens at the nim compile step at not at the gcc one correct? |
23:30:33 | FromDiscord | <Elegantbeef> Nope |
23:32:08 | FromDiscord | <m4ul3r> I'm testing with and without --opt:size and comparing the cache's json - That's where I should see the gcc switches correct? |
23:49:17 | * | xet7 quit (Remote host closed the connection) |
23:57:45 | * | xet7 joined #nim |