01:25:22 | * | rez quit (Quit: much snoozes...) |
01:41:41 | FromDiscord | <gogolxdong> What is the best multithread library for now? |
01:42:01 | FromDiscord | <gogolxdong> (edit) "What is the best multithread library ... for" added "in Nim" |
01:52:40 | FromDiscord | <Elegantbeef> taskpools/weave |
01:53:41 | * | derpydoo joined #nim |
01:56:21 | FromDiscord | <gogolxdong> What's the difference |
03:20:39 | * | arkurious quit (Quit: Leaving) |
04:15:11 | * | peterhil quit (Quit: WeeChat 3.8) |
05:11:20 | * | ltriant quit (Ping timeout: 255 seconds) |
05:16:50 | * | azimut quit (Ping timeout: 255 seconds) |
05:23:03 | * | rockcavera quit (Remote host closed the connection) |
05:56:46 | * | ltriant joined #nim |
06:01:28 | * | ltriant quit (Ping timeout: 246 seconds) |
07:23:09 | FromDiscord | <Require Support> sent a code paste, see https://play.nim-lang.org/#ix=4ojm |
07:23:47 | FromDiscord | <Require Support> (edit) "https://play.nim-lang.org/#ix=4ojm" => "https://play.nim-lang.org/#ix=4ojn" |
07:25:52 | * | kenran joined #nim |
07:34:09 | * | advesperacit joined #nim |
07:58:21 | * | ltriant joined #nim |
08:03:39 | FromDiscord | <4zv4l> is it possible to put picture in Nim doc ? |
08:03:40 | * | ltriant quit (Ping timeout: 260 seconds) |
08:04:22 | FromDiscord | <4zv4l> like in markdown for example↵`![pic](../pics/important_scheme.png)` |
08:05:01 | * | PMunch joined #nim |
08:11:19 | FromDiscord | <m4ul3r> In reply to @4zv4l "is it possible to": maybe, since it is rst? ↵under directives ↵https://docutils.sourceforge.io/docs/user/rst/quickref.html |
08:12:25 | FromDiscord | <m4ul3r> it is supported: https://nim-lang.org/docs/rst.html |
08:15:43 | FromDiscord | <4zv4l> perfect thanks !!! |
08:17:28 | FromDiscord | <4zv4l> sent a long message, see http://ix.io/4ojB |
08:18:05 | FromDiscord | <4zv4l> why rst over markdown tho ?↵or over asciidoc ? |
08:23:01 | FromDiscord | <ringabout> The Nim docgen has transferred to markdown favor on the devel. |
08:24:30 | FromDiscord | <4zv4l> because I tried the 'markdown way' for newline and it didn't seem to work↵I guess I can get used to rst anyway |
08:25:01 | * | junaid_ joined #nim |
08:25:37 | FromDiscord | <ringabout> It is markdown favor Nim documentation generator. Not every feature of Markdown work. PR is welcome. |
08:29:27 | * | junaid__ joined #nim |
08:30:34 | * | junaid_ quit (Ping timeout: 246 seconds) |
08:35:39 | FromDiscord | <Hourglass [She/Her]> Is it possible to pass a module namespace to a function? |
08:36:03 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://paste.rs/upl |
08:50:17 | FromDiscord | <Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "Oh yeah, I should": Anyone have more sensible ways to implement a plugin system? Lmao |
08:50:36 | FromDiscord | <Hourglass [She/Her]> I could just, not have a main project for it ig but that's not great |
08:51:08 | FromDiscord | <Hourglass [She/Her]> (edit) "project" => "object" |
09:03:57 | PMunch | What would be awesome is if we could actually just turn the module documentation into a markdown or rst document |
09:04:32 | PMunch | Hourglass_[She/Her], well you can pass it to a macro |
09:04:45 | PMunch | And then probably convert it into whatever you need in the macro and pass it on to a proc |
09:04:50 | PMunch | What are you actually trying to achieve? |
09:05:01 | * | junaid__ quit (Remote host closed the connection) |
09:06:59 | FromDiscord | <Hourglass [She/Her]> I was gonna answer the question but I don't think I'm gonna respond with what you actually mean/I'm gonna miss the actual question |
09:08:00 | FromDiscord | <Hourglass [She/Her]> Original answer: I'm trying to implement a plugin system that can depend on other plugins, these plugins would be compiled to shared libraries |
09:36:05 | PMunch | Right, but why would that require passing a module to a proc? |
09:36:31 | PMunch | I've done a plugin system in Nim before, one program loading a bunch of other Nim dynamic libraries |
09:43:43 | FromDiscord | <Hourglass [She/Her]> In reply to @PMunch "Right, but why would": That was a different idea I had, to compile all plugins into the server itself but then that's not what I want so |
09:48:43 | PMunch | Hourglass_[She/Her], this might be interesting to you: https://github.com/pmunch/webexperiment |
09:50:40 | PMunch | Basically trying to make something PHP-esque in Nim. If you edit the source files then Nim will automatically rebuild those sources to a dynamic library and replace it with the existing library so that the changes are live right away. |
09:51:14 | PMunch | It was written four years ago though, today I'd use gc:arc which plays much nicer with dynamic libraries |
09:55:07 | FromDiscord | <Hourglass [She/Her]> Looks interesting even if I'm not fully understanding it aha |
09:55:32 | FromDiscord | <Hourglass [She/Her]> In reply to @PMunch "It was written four": How does arc work when it comes to shared libraries exactly? I don't actually understand that aha |
09:55:59 | FromDiscord | <Hourglass [She/Her]> Since yepoleb was talking about how I'd likely need to link nimrtl, tho if arc doesn't need that, that's cool |
09:56:18 | PMunch | Basically it builds the files in `controller` and `views` into dynamic libraries, then loads them and adds file watchers to the original source files. If the source files changes then it rebuilds the dynamic library for that file and swaps out the old one. |
09:56:30 | PMunch | Yeah ARC doesn't need nimrtl |
09:57:05 | FromDiscord | <Hourglass [She/Her]> In reply to @PMunch "Yeah ARC doesn't need": Good to know |
09:57:26 | FromDiscord | <Hourglass [She/Her]> In reply to @PMunch "Basically it builds the": `views` seems to just be HTML tho? |
09:57:27 | PMunch | Not entirely sure how it works if you pass a Nim object across the dynamic library boundry though |
09:57:50 | PMunch | Oh and make sure that you call NimMain if you want to initialise global variables ;) |
09:57:54 | FromDiscord | <Hourglass [She/Her]> Does it embed the HTML into the controller file or something? |
09:58:30 | FromDiscord | <Hourglass [She/Her]> In reply to @PMunch "Not entirely sure how": That sounds like it'll be a pain to deal with |
09:59:01 | PMunch | Yes, the tmpls call in the route loads the HTML snippets as a template and fills out the fields starting with $ |
10:00:33 | * | ltriant joined #nim |
10:01:03 | FromDiscord | <enthus1ast> even with arc |
10:02:33 | FromDiscord | <enthus1ast> it would be interesting to know the limitations of cross dll boundaries |
10:02:47 | FromDiscord | <enthus1ast> but no idea if they're documented somewhere |
10:05:25 | * | ltriant quit (Ping timeout: 246 seconds) |
10:07:15 | FromDiscord | <Hourglass [She/Her]> In reply to @PMunch "Yes, the tmpls call": Ah alright then |
10:09:37 | * | jmdaemon quit (Ping timeout: 246 seconds) |
10:13:36 | * | azimut joined #nim |
10:16:58 | * | Guest35 joined #nim |
10:17:20 | * | Guest35 quit (Client Quit) |
10:17:39 | FromDiscord | <basilajith> Any benchmarks that anyone knows of where Nim's websocket module has been tested against Bun's? |
10:18:22 | * | randomuser464876 joined #nim |
10:20:43 | FromDiscord | <thedarkknightx> Migger |
11:03:47 | * | junaid_ joined #nim |
11:10:43 | FromDiscord | <enthus1ast> does nim devel + nimble has troubles with nimble develop ? |
11:10:50 | FromDiscord | <enthus1ast> it does not pick up my local packages |
11:11:14 | FromDiscord | <enthus1ast> when i then later require it and run with nimble |
11:11:16 | FromDiscord | <ringabout> In reply to @enthus1ast "does nim devel +": There is a new flag in the develop section |
11:11:26 | * | junaid_ quit (Remote host closed the connection) |
11:11:30 | FromDiscord | <enthus1ast> hu ok? |
11:12:00 | FromDiscord | <ringabout> > -g, --global - Creates an old style link file in the special links directory. It is read by Nim to be able to use global develop mode packages. Nimble uses it as a global develop file if a local one does not exist. |
11:12:11 | FromDiscord | <ringabout> https://github.com/nim-lang/nimble#nimble-develop |
11:13:17 | FromDiscord | <ringabout> I will add a changelog for it anyway. |
11:13:39 | FromDiscord | <ringabout> (edit) "I will add" => "It needs" |
11:14:19 | FromDiscord | <ringabout> here https://github.com/nim-lang/Nim/blob/devel/changelogs/changelog_2_0_0.md#tool-changes |
11:16:36 | FromDiscord | <enthus1ast> so without -g it should have create a file nimble.develop in my project dir? |
11:17:07 | FromDiscord | <ringabout> I think so, I never used `nimble develop` though. |
11:17:24 | FromDiscord | <enthus1ast> but it did not |
11:20:00 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4okk |
11:20:21 | FromDiscord | <ringabout> nimble version? |
11:20:57 | FromDiscord | <enthus1ast> Nim Compiler Version 1.9.1 [Windows\: amd64] |
11:21:09 | FromDiscord | <enthus1ast> nimble v0.14.0 compiled at 2023-02-09 01\:48\:53 |
11:21:41 | FromDiscord | <ringabout> What about `nimble develop --global`? |
11:21:59 | FromDiscord | <enthus1ast> yes --global works |
11:23:44 | FromDiscord | <enthus1ast> but it is not picked up by the other module |
11:23:48 | FromDiscord | <enthus1ast> other project |
11:24:00 | FromDiscord | <enthus1ast> this is bad \:) |
11:24:24 | Zevv | i'm having thesame problem for some weeks |
11:24:32 | Zevv | i'm now working around with with --path and other fun |
11:24:47 | Zevv | its probably just that I do not understand properly how it is supposed to wok |
11:24:49 | Zevv | work |
11:25:35 | FromDiscord | <ringabout> It is a simple bug https://github.com/nim-lang/nimble/blob/a0a12f475905028763186ffb2341b92e2d8b2547/src/nimblepkg/options.nim#L620 |
11:25:42 | FromDiscord | <ringabout> Adding "g" should suffice. |
11:25:58 | FromDiscord | <enthus1ast> ok this yes |
11:26:13 | FromDiscord | <enthus1ast> but it is not picked up by another module requireing this one module |
11:26:17 | FromDiscord | <enthus1ast> and run via nimble |
11:27:03 | FromDiscord | <enthus1ast> sent a long message, see http://ix.io/4okn |
11:29:19 | FromDiscord | <ringabout> I don't know how the new nimble works, its breaking changes has been discussed here https://forum.nim-lang.org/t/8404 |
11:35:01 | FromDiscord | <enthus1ast> no idea, it does not work |
11:35:26 | FromDiscord | <enthus1ast> i think it tries to download it from the web |
11:37:26 | FromDiscord | <enthus1ast> sent a long message, see https://paste.rs/LPn |
12:02:12 | * | ltriant joined #nim |
12:05:41 | FromDiscord | <Hourglass [She/Her]> Still unsure on how to structure my plugin system to be sane tbh |
12:06:56 | FromDiscord | <Hourglass [She/Her]> Gonna work on a plugin system separate from the server code so i can work in a minimal environment |
12:07:43 | * | ltriant quit (Ping timeout: 268 seconds) |
12:42:26 | * | ltriant joined #nim |
12:46:50 | * | kenran quit (Remote host closed the connection) |
12:47:07 | * | ltriant quit (Ping timeout: 246 seconds) |
13:04:44 | FromDiscord | <ShalokShalom> @Hourglass [She/Her] what exactly is unsure? |
13:05:16 | FromDiscord | <Hourglass [She/Her]> In reply to @ShalokShalom "<@909883978717204561> what exactly is": Wdym? Do you mean what I'm unsure about? |
13:05:43 | FromDiscord | <Hourglass [She/Her]> I figured out a solution to that now anyway |
13:06:10 | FromDiscord | <Hourglass [She/Her]> I'm gonna be using a macro to make it much nicer (imo) to use |
13:09:24 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4okW |
13:10:04 | FromDiscord | <Hourglass [She/Her]> It'll be in a shared library so I'd just need to loaded the so/dll file and access the appropriate values |
13:10:17 | FromDiscord | <Hourglass [She/Her]> I just need to experience macro hell~ |
13:11:55 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4okX |
13:12:35 | FromDiscord | <Yepoleb> Be careful, if you complain about macros he will come and help you |
13:13:26 | FromDiscord | <Hourglass [She/Her]> Assuming he is beef lmao |
13:13:51 | FromDiscord | <Yepoleb> Have you read the article? https://dev.to/beef331/demystification-of-macros-in-nim-13n8 |
13:16:11 | FromDiscord | <Hourglass [She/Her]> Yep I've read it before, doesn't hurt to give it a reread tho |
13:17:01 | FromDiscord | <Hourglass [She/Her]> Untyped macro time |
13:18:41 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4okY |
13:24:36 | FromDiscord | <sOkam!> ^ both look clean to me in this example. hard to say |
13:28:32 | FromDiscord | <Hourglass [She/Her]> Fair, I'll likely use semicolons then, shouldn't be too hard to change it to be an equality sign later on |
13:30:49 | FromDiscord | <Yepoleb> I prefer assignment, the first syntax makes it impossible to add type hints later |
13:33:39 | FromDiscord | <Hourglass [She/Her]> Type hints wouldn't be necessary nor supported, since the meta is strictly for loading and dependency tree stuff |
13:34:21 | FromDiscord | <Hourglass [She/Her]> It's defined at compile time too, so stuff like `readFile` wouldn't work (`staticRead` would tho, you'd need to read from a config file at compile time if you wanna do that) |
13:36:08 | FromDiscord | <Hourglass [She/Her]> Is it `const variable {.cdecl, exportc.} = Value`? |
13:37:40 | FromDiscord | <Yepoleb> cdecl is a calling convention for procedures, it does not apply to variables |
13:38:12 | FromDiscord | <Yepoleb> And exportc probably neither |
13:38:49 | FromDiscord | <Hourglass [She/Her]> In reply to @Yepoleb "cdecl is a calling": Ah |
13:39:10 | FromDiscord | <Hourglass [She/Her]> How would I unmangle a variable exported to C though |
13:39:32 | FromDiscord | <Yepoleb> Are they even mangled? |
13:39:45 | * | randomuser464876 quit (Quit: Client closed) |
13:41:13 | FromDiscord | <Hourglass [She/Her]> Yeah? I thought so? |
13:42:34 | FromDiscord | <Hourglass [She/Her]> `hellotest_1` |
13:42:39 | FromDiscord | <Hourglass [She/Her]> In the generated C code |
13:43:10 | FromDiscord | <Hourglass [She/Her]> File is `test.nim`, variable name is `hello` |
13:43:16 | FromDiscord | <Hourglass [She/Her]> Value is 7 |
13:44:03 | * | azimut quit (Remote host closed the connection) |
13:44:12 | FromDiscord | <Hourglass [She/Her]> `exportc` makes it be `hello` in the C code |
13:44:29 | FromDiscord | <Hourglass [She/Her]> So exportc does do something to variables, good to know lol |
13:44:40 | * | azimut joined #nim |
13:47:22 | FromDiscord | <Yepoleb> Good to know! |
13:49:22 | FromDiscord | <Hourglass [She/Her]> What's a sane way to tell the user "this isn't a valid name!"? |
13:49:29 | FromDiscord | <Hourglass [She/Her]> Is an exception suitable? |
13:52:43 | FromDiscord | <Hourglass [She/Her]> Idk what defect/error to even raise |
13:52:58 | FromDiscord | <Hourglass [She/Her]> It shouldn't be catchable so obviously a defect, but I don't want to make my own tbh |
13:53:04 | FromDiscord | <Hourglass [She/Her]> May need to do it anyway |
13:57:07 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4ol9 |
13:57:24 | FromDiscord | <Phil> : is for definition in this context for me, = for assignment |
13:57:27 | FromDiscord | <Rika> In reply to @Hourglass, When the Hour Strikes "It shouldn't be catchable": why shouldnt it be catchable? |
13:57:41 | FromDiscord | <Rika> what does it mean for something to have an invalid name? |
13:57:47 | FromDiscord | <Rika> like what kinda name is this |
13:59:20 | * | ltriant joined #nim |
13:59:29 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Is this an object": Object definition |
14:00:42 | * | rockcavera joined #nim |
14:01:21 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "Object definition": In that case I'd use `:`, simply because nim uses it for `A(x: y)` |
14:01:30 | FromDiscord | <Phil> Consistency in Syntax and all |
14:02:17 | FromDiscord | <Hourglass [She/Her]> sent a long message, see http://ix.io/4olb |
14:02:41 | FromDiscord | <Hourglass [She/Her]> There's more fields like `semver` which has a type of a triple int |
14:02:55 | FromDiscord | <Hourglass [She/Her]> `(int, int, int)` |
14:04:07 | * | ltriant quit (Ping timeout: 246 seconds) |
14:04:37 | FromDiscord | <Hourglass [She/Her]> I probably missed what you actually meant, didn't I 😅 |
14:06:21 | FromDiscord | <Hourglass [She/Her]> Help lmao |
14:06:30 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://paste.rs/Gwy |
14:06:49 | FromDiscord | <Hourglass [She/Her]> It's passing the node directly instead of expanding it like I want it to |
14:10:54 | FromDiscord | <Hourglass [She/Her]> I think I'm doing this completely wrong 💀 |
14:19:27 | FromDiscord | <Hourglass [She/Her]> Tbf Nim does have named tuples |
14:19:39 | FromDiscord | <Hourglass [She/Her]> But I might as well just use an object then |
14:20:03 | FromDiscord | <Hourglass [She/Her]> I don't even need the macro magic for this why did I overcomplicate this |
14:22:17 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4olh |
14:28:38 | FromDiscord | <Nerve> In reply to @Hourglass, When the Hour Strikes "I don't even need": tale as old as time |
14:28:53 | FromDiscord | <Nerve> between Lisp and Nim I've found precious few problems that couldn't be solved with simple procs/functions |
14:28:59 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4olj |
14:29:28 | FromDiscord | <Phil> Though I still only use them in very local contexts, the second stuff needs to be used by other modules I tend to swap to objects |
14:29:50 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "I mean, tuples *do*": That wouldn't be needed for me at all sooo meh |
14:29:58 | FromDiscord | <Phil> In that case, object it is |
14:32:01 | FromDiscord | <Hourglass [She/Her]> I just realised I need the plugin object to also hold a reference to the main server |
14:32:07 | FromDiscord | <Hourglass [She/Her]> I wonder if that's gonna crash and die |
14:33:40 | FromDiscord | <Hourglass [She/Her]> This is gonna be interesting |
14:37:20 | * | jmdaemon joined #nim |
14:38:29 | * | azimut_ joined #nim |
14:39:20 | * | azimut quit (Ping timeout: 255 seconds) |
14:55:34 | FromDiscord | <Hourglass [She/Her]> I'm assuming casting an object from a shared library to a type in the program is not gonna be safe so I'll need to use an unsafe cast? |
14:56:26 | FromDiscord | <Hourglass [She/Her]> Wait |
14:56:30 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "I'm assuming casting an": ... can you getaway with just doing a transformation? |
14:56:35 | FromDiscord | <Hourglass [She/Her]> There's no unsafe cast? |
14:56:35 | FromDiscord | <Phil> (edit) "getaway" => "get away" |
14:56:40 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "... can you get": Wdym? |
14:56:53 | * | azimut_ quit (Ping timeout: 255 seconds) |
14:57:11 | FromDiscord | <Hourglass [She/Her]> Just doing `Plugin(name: libplugin.name)` and stuff? |
14:57:31 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4olo |
14:57:56 | FromDiscord | <Hourglass [She/Her]> They're both the same type using the same code for the interface |
14:58:14 | FromDiscord | <Hourglass [She/Her]> (edit) "There's no ... unsafecast" added "such thing as an" | "cast?" => "cast oh" |
14:58:15 | * | azimut joined #nim |
14:58:16 | FromDiscord | <Phil> Ah, I assumed you were receiving a type from a c lib and needed to use it |
14:58:23 | FromDiscord | <Hourglass [She/Her]> Nah, it's a Nim lib |
14:58:31 | FromDiscord | <Hourglass [She/Her]> Using dynamic libraries for my plugin system :) |
14:59:33 | * | PMunch quit (Quit: Leaving) |
15:01:40 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4olw |
15:01:41 | FromDiscord | <Phil> I'm not sure what dynamic libraries means in that case, .so libs? |
15:01:45 | FromDiscord | <Hourglass [She/Her]> Yep |
15:01:51 | FromDiscord | <Hourglass [She/Her]> Shared libraries sorry |
15:03:21 | FromDiscord | <Phil> Huh, never dealt with loading a .so file produced by nim |
15:04:19 | FromDiscord | <Hourglass [She/Her]> Apparently with `refc` you'd need to link `nimrtl` manually |
15:04:30 | FromDiscord | <Phil> Personally I might still do a conversion step in there.↵The entire idea would be an "anti-corruption-layer".↵In a sense if the API of the lib changes, you don't need to update this entire project, just the conversion proc |
15:05:09 | FromDiscord | <Hourglass [She/Her]> `arc` apparently doesn't need that but I don't know how it'll play with references from the other side lol |
15:05:28 | FromDiscord | <Phil> The idea is about having a strict separation between "outside"-datatypes (received from others or sent to others) and "inside"-datatypes (used within your application) |
15:06:55 | FromDiscord | <Hourglass [She/Her]> Would the conversion step just copy all of the fields from the shared library's plugin metadata to the loader's side? |
15:07:46 | FromDiscord | <Phil> Depends, but possibly.↵It's a matter of debate at my workplace at which point one should introduce an ACL, from the get go or only when your inner data-model starts differing from the outside-data-model |
15:07:50 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "The idea is about": I still don't get what you mean by outside and inside datatypes in this context |
15:07:59 | FromDiscord | <Hourglass [She/Her]> ACL? |
15:08:05 | FromDiscord | <Phil> Anti-Corruption-Layer |
15:08:16 | FromDiscord | <Hourglass [She/Her]> Yeah just realised as soon as you sent that |
15:08:52 | * | jmdaemon quit (Ping timeout: 246 seconds) |
15:09:08 | FromDiscord | <Hourglass [She/Her]> I think it'd be better to implement it from the start if it's not difficult to structure your project around |
15:09:17 | FromDiscord | <Hourglass [She/Her]> Which it isn't for me and would probably be safer lol |
15:11:04 | FromDiscord | <Phil> "Outside" - code is all the code that is not directly part of this package.↵Mostly in that case it matters in webdev when you receive requests and send out responses and that shape may change over time.↵It can also be applied to data you may receive from other, larger libraries that are prone to change independently of you and may change their API to provide more features you may not need to make use of. |
15:11:23 | FromDiscord | <Phil> (edit) "package.↵Mostly" => "package, in a solo project basically "written by you".↵Mostly" |
15:11:59 | FromDiscord | <Phil> Its a tradeoff for "how many places do I need to change when this data-type changes" |
15:12:09 | FromDiscord | <Hourglass [She/Her]> Wait... How would I convert fields |
15:12:20 | FromDiscord | <Hourglass [She/Her]> I'd still have to cast to something |
15:12:21 | FromDiscord | <Phil> The very boring way |
15:12:30 | FromDiscord | <Phil> No casting, instantiate new object with data from first object |
15:12:42 | FromDiscord | <Phil> Tons of typing |
15:12:49 | FromDiscord | <Hourglass [She/Her]> But how do I get the data from the first object- |
15:12:53 | FromDiscord | <Hourglass [She/Her]> All I have is a pointer |
15:13:19 | FromDiscord | <Phil> Ohhhhh yeah that you won't get around.↵You'd have 2 types then:↵type 1 to cast your pointer to↵type 2 to convert the data from type 1 to |
15:13:32 | FromDiscord | <Hourglass [She/Her]> Seems redundant- |
15:13:32 | FromDiscord | <Phil> So if the lib changes, you update type 1 and the proc that converts from type 1 to type 2 |
15:13:35 | FromDiscord | <Phil> It is |
15:13:55 | FromDiscord | <Hourglass [She/Her]> I think in this case it'd actually be more beneficial to just, force the plugin to use the up-to-date API |
15:13:55 | FromDiscord | <Phil> That's why it is contentious over when to introduce it |
15:15:34 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4olA |
15:16:15 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "I think in this": Might want to think about which plugin versions "support" which versions of your main application ^^ |
15:17:04 | FromDiscord | <Phil> I have way too little clue about C to provide you a satisfactory answer for that |
15:17:18 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Might want to think": Wdym? |
15:17:18 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=4olA" => "https://play.nim-lang.org/#ix=4olB" |
15:17:34 | * | nyeaa49284230 quit (Read error: Connection reset by peer) |
15:17:44 | FromDiscord | <Hourglass [She/Her]> In reply to @Andreas "hi, does this proc": Are you trying to use the shared library where the C function is defined, in Nim? |
15:17:47 | FromDiscord | <Phil> Your reply indicated to me that there may be scenarios where a plugin might not work with a specific version of your main app |
15:17:56 | * | nyeaa49284230 joined #nim |
15:18:08 | FromDiscord | <Andreas> In reply to @Hourglass, When the Hour Strikes "Are you trying to": yes, thats what i'm trying.. |
15:18:52 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Your reply indicated to": There may be cases of that, but I don't think so, since i ideally shouldn't need to add any new fields the the plugin object itself (or well, any new fields that are meant to be used by the plugin itself) |
15:19:42 | FromDiscord | <Hourglass [She/Her]> In reply to @Andreas "yes, thats what i'm": https://nim-lang.org/docs/dynlib.html#examples-loading-a-simple-c-function |
15:19:47 | FromDiscord | <Phil> I mean, ime "shouldn't" has a decent chance of not surviving after a year 😛 |
15:20:11 | FromDiscord | <Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "https://nim-lang.org/docs/dynlib.html#examples-load": There's likely a better way to do it |
15:20:48 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "I mean, ime "shouldn't"": It'll be fineee, that's future Hourglass' job to worry about |
15:21:09 | FromDiscord | <Coachonko> How do you efficiently check if a file exists? |
15:21:12 | FromDiscord | <Phil> If it raised awareness of the potential issue in you then my job is done and I'm satisfied 😛 |
15:21:29 | FromDiscord | <Hourglass [She/Her]> In reply to @Coachonko "How do you efficiently": `fileExists` from the os module, I believe |
15:21:34 | FromDiscord | <Phil> efficiently? No clue,never performance checked it.↵Generally? `os.fileExists` |
15:21:44 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "If it raised awareness": Yeah you did xD |
15:21:45 | FromDiscord | <Coachonko> Sounds good enough |
15:21:47 | FromDiscord | <Coachonko> Thanks |
15:21:51 | FromDiscord | <Hourglass [She/Her]> 👍 |
15:35:05 | FromDiscord | <Andreas> In reply to @Hourglass, When the Hour Strikes "https://nim-lang.org/docs/dynlib.html#examples-load": thx, i tried to load the symbol from the shared-library via nim - that fails too ? The shared-lib is supposed to be loaded via the sqlite-cli-tool eg. `.load libmyext.dylib` |
15:35:07 | * | arkurious joined #nim |
15:35:45 | FromDiscord | <Hourglass [She/Her]> Sorry, I'm not super sure what you're trying to do |
15:36:03 | FromDiscord | <Hourglass [She/Her]> Maybe post on the forum and reddit too, someone will help whenever they have the time if they have the knowledge |
15:36:17 | FromDiscord | <Hourglass [She/Her]> I'm not super well-versed in shared library stuff |
15:37:56 | * | jmdaemon joined #nim |
15:40:17 | FromDiscord | <Hourglass [She/Her]> I'm struggling to figure out how to structure the plugin loading system |
15:40:54 | FromDiscord | <Hourglass [She/Her]> I don't know how I'm supposed to order all of the plugins in a way that dependencies don't clash, and to check if they match a version :p |
15:41:05 | FromDiscord | <Hourglass [She/Her]> Version matching is probably not as important and can be done after the initial ordering |
15:44:20 | FromDiscord | <Coachonko> Still learning basics here, excuse me. What's the easiest way to cast a `"false"` string to `false` bool? |
15:45:34 | FromDiscord | <Rika> strutils.parseBool |
15:46:21 | FromDiscord | <Coachonko> Thanks |
15:50:14 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "I don't know how": Just provide a proc in your plugins that throw an exception if the app-version doesn't match what they support, then iterate over a list of all your plugins and call that proc on all of them with your apps version 😛 |
15:50:18 | FromDiscord | <Coachonko> Conveniently I see a parseInt too |
15:50:23 | FromDiscord | <Coachonko> Thanks again Rika |
15:50:35 | FromDiscord | <Phil> In reply to @Coachonko "Conveniently I see a": Wait until I tell you of parseFloat 😛 |
15:50:48 | FromDiscord | <Coachonko> Please don't |
15:51:15 | FromDiscord | <Coachonko> Crap I think I need it eventually |
15:51:24 | FromDiscord | <Coachonko> Is it weird? |
15:52:27 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Just provide a proc": ...tbf, that is a valid idea lmao |
15:52:35 | FromDiscord | <Hourglass [She/Her]> Also much easier for me |
15:52:58 | FromDiscord | <Hourglass [She/Her]> I'll do that for now then lmao |
15:53:25 | FromDiscord | <Phil> In reply to @Coachonko "Is it weird?": Nah, was just making a joke |
15:53:59 | FromDiscord | <Hourglass [She/Her]> I still need to figure out how to order the plugins and prevent loops of dependencies having cyclic dependencies |
15:55:08 | FromDiscord | <Rika> make a graph and just check for cycles ig? |
15:55:24 | FromDiscord | <Hourglass [She/Her]> Yeah I don't know how that works so #research time |
15:55:27 | FromDiscord | <Rika> it works for small graphs which i assume youre not gonna have a thousand plugins |
15:56:42 | FromDiscord | <Hourglass [She/Her]> Probably not, but maybe 10-20 if it's implemented as expected :p |
15:56:51 | FromDiscord | <Hourglass [She/Her]> They shouldn't depend on eachother tho so that should be fine |
15:57:06 | FromDiscord | <Hourglass [She/Her]> (Maybe 1-2 will depend on some others but that's it) |
15:59:53 | FromDiscord | <Hourglass [She/Her]> Wait how about if two plugins both depend on another plugin |
16:00:06 | FromDiscord | <Hourglass [She/Her]> This is gonna be hell |
16:00:56 | * | ltriant joined #nim |
16:02:11 | * | jmdaemon quit (Ping timeout: 252 seconds) |
16:02:20 | FromDiscord | <Coachonko> I love the `Error: invalid indentation` |
16:05:55 | * | ltriant quit (Ping timeout: 246 seconds) |
16:07:33 | FromDiscord | <Coachonko> Alright so parseBool parses string to bool, how about bool to string? |
16:09:09 | FromDiscord | <Hourglass [She/Her]> Just do `$yourBool` |
16:09:34 | FromDiscord | <Hourglass [She/Her]> `$` means 'to string', I believe all primitives have it implemented |
16:09:38 | FromDiscord | <Hourglass [She/Her]> They should |
16:09:58 | * | dropkick joined #nim |
16:11:39 | * | jmdaemon joined #nim |
16:11:55 | FromDiscord | <Coachonko> Oooh ok I'll try thanks |
16:22:01 | * | dropkick quit (Ping timeout: 246 seconds) |
16:26:27 | * | rez joined #nim |
16:30:10 | FromDiscord | <firasuke> what's the standard way for coloring output? |
16:30:11 | FromDiscord | <Rika> In reply to @Hourglass, When the Hour Strikes "Wait how about if": welcome to dependency resolution |
16:30:26 | FromDiscord | <Rika> In reply to @firasuke "what's the standard way": terminal module |
16:31:09 | FromDiscord | <Hourglass [She/Her]> In reply to @Rika "welcome to dependency resolution": A friend suggested using a request system instead, which is a lot easier, at least with my code |
16:31:10 | FromDiscord | <Hourglass [She/Her]> Also, what's the signature for `NimMain`? |
16:31:16 | FromDiscord | <Hourglass [She/Her]> Does it accept any args or has a return value? |
16:34:09 | FromDiscord | <firasuke> In reply to @Rika "terminal module": styledEcho? ANSI Escape? |
16:38:28 | FromDiscord | <Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "Does it accept any": Seems like it doesn't, nice |
16:40:21 | FromDiscord | <AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=4om3 |
16:53:33 | * | beholders_eye joined #nim |
17:18:53 | FromDiscord | <firasuke> Can you implement a proc for a certain type, using `self`? also, how do you specify the width of the output for `echo` (example outputted word is only 4 characters long, but I want it to span 15 spaces and be left aligned) |
17:22:29 | * | beholders_eye quit (Ping timeout: 252 seconds) |
17:31:41 | FromDiscord | <Elegantbeef> Yes you make a parameter named 'self', yes you use `alignLeft` |
17:35:17 | * | beholders_eye joined #nim |
17:52:11 | * | jmdaemon quit (Ping timeout: 248 seconds) |
18:01:17 | * | beholders_eye quit (Ping timeout: 255 seconds) |
18:01:57 | FromDiscord | <firasuke> oh ok cool thanks |
18:02:33 | * | ltriant joined #nim |
18:05:19 | FromDiscord | <Hourglass [She/Her]> Oh heya beef, you exist again |
18:05:28 | FromDiscord | <Phil> That's a bold claim |
18:05:45 | FromDiscord | <Hourglass [She/Her]> Earlier I was trying to make a macro for something that a type fitted perfectly :p |
18:05:58 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "That's a bold claim": No, it's my claim :> |
18:06:12 | FromDiscord | <Phil> I feel like beef should have a slogan:↵"Make micros, not macros" |
18:08:36 | * | ltriant quit (Ping timeout: 255 seconds) |
18:11:47 | FromDiscord | <Elegantbeef> The rumours of my death have been greatly exaggerated |
18:11:57 | * | cfa joined #nim |
18:15:28 | FromDiscord | <Vindaar> @AmjadHD i won't really have time in the next couple of weeks. I'm not sure what's going on there. feel free to reopen the issue with your comment. I'll check it out once I have some free time again |
18:15:33 | cfa | hi folks |
18:15:33 | cfa | is there a way to parenthesise the following (one line) definition so that `e "abc"` is outside the proc body? |
18:15:36 | cfa | proc e(s: string) = echo(">", s, "<"); e "abc" |
18:16:00 | * | beholders_eye joined #nim |
18:17:11 | FromDiscord | <Phil> You want to do a single-line proc definition and hammer a second command behind it? |
18:18:20 | FromDiscord | <Phil> I'm... actually not sure, I never had to and honestly I as a ready would be hella confused if there were a way to do that |
18:18:25 | FromDiscord | <Phil> (edit) "ready" => "reader" |
18:18:29 | FromDiscord | <Elegantbeef> I swear that's what i say about micros |
18:18:50 | FromDiscord | <Phil> In reply to @Elegantbeef "I swear that's what": The slogan I wrote? |
18:18:58 | * | jmdaemon joined #nim |
18:19:00 | FromDiscord | <sOkam!> Doesn't sound possible 🤔↵Nim needs the indentation, and `;` only says "new line after this", not "new block after this" |
18:19:43 | FromDiscord | <firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4omJ |
18:20:02 | FromDiscord | <sOkam!> try with `block blabla: someting something; break blabla` but i also don't recommend doing that like ever. its extremely confusing, even for a oneliner |
18:21:52 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4omL |
18:23:05 | FromDiscord | <Phil> I'm not sure what stdout here is, you could possibly use `strformat` as in `fmt""" {parse["other_key"]}\n"""` |
18:23:35 | FromDiscord | <Rika> does it matter if there is a trailing space |
18:24:11 | * | beholders_eye quit (Ping timeout: 248 seconds) |
18:24:14 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4omM |
18:24:49 | cfa | Phil: yes, exactly -- i was trying to add a definition to the beginning of a one line nimscript --eval |
18:24:51 | FromDiscord | <Rika> assumes `table` is `Table` of course |
18:26:58 | cfa | sOkam!: yeah, the block approach just confuses things; perhaps one of the sugar arrow defs would work here |
18:29:05 | cfa | let e = (s: string) => echo(">", s, "<"); e "abc"; |
18:29:52 | cfa | i.e., $ nim --eval:'import std/sugar; let e = (s: string) => echo(">", s, "<"); e "abc"' |
18:29:55 | cfa | not too bad |
18:31:49 | FromDiscord | <firasuke> In reply to @Isofruit "You should be able": oh nice |
18:31:53 | FromDiscord | <firasuke> thanks |
18:48:39 | * | advesperacit quit (Ping timeout: 252 seconds) |
18:49:33 | * | advesperacit joined #nim |
18:54:56 | FromDiscord | <firasuke> can I use an if statement inside stdout.write arguments? |
18:56:16 | FromDiscord | <firasuke> ? |
18:56:18 | FromDiscord | <firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4omR |
19:03:36 | FromDiscord | <firasuke> also is it possible to store parsetoml result inside a tuple? |
19:06:08 | * | ltriant joined #nim |
19:08:05 | FromDiscord | <firasuke> I suppose I can use this: https://github.com/status-im/nim-toml-serialization ? |
19:11:12 | FromDiscord | <Phil> What does parseToml generate? A tuple can contain anything, so I don't see how you wouldn't be able to store in a tuple whatever nim-type a parsed-tomls gets turned into |
19:11:43 | FromDiscord | <Phil> I might be worried if the toml is gigantic (several MB), but that's it |
19:12:03 | * | ltriant quit (Ping timeout: 255 seconds) |
19:13:39 | FromDiscord | <Hourglass [She/Her]> For some reason, Nim can't see my `plugin` variable in the shared library ._. |
19:13:48 | FromDiscord | <Yandall> Is a good ORM for postgresdb out there? |
19:14:00 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4on3 |
19:14:01 | FromDiscord | <Hourglass [She/Her]> That's the code for it |
19:14:06 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "For some reason, Nim": I noticed that when I use dynlib stuff I'm always only using procs |
19:14:13 | FromDiscord | <Phil> Maybe procs is your only choice |
19:14:13 | FromDiscord | <firasuke> In reply to @Isofruit "What does parseToml generate?": parsetoml returns a TomlValueRef, I Want to store that into a tuple, because all the values are strings |
19:14:38 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4on4 |
19:14:49 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "I noticed that when": God I don't want getter and setters |
19:14:52 | FromDiscord | <Phil> In reply to @firasuke "parsetoml returns a TomlValueRef,": Ah, you want to not store the ref itself, you want to change the data in the TOmlValueRef to use tuples? |
19:14:58 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4on5 |
19:15:06 | FromDiscord | <Hourglass [She/Her]> I mean that's what loads the shared library |
19:15:15 | FromDiscord | <firasuke> In reply to @Isofruit "Ah, you want to": exactly, kinda like serialization, don't know if that's a good way to do it or not |
19:15:40 | FromDiscord | <Phil> I mean, what data are you storing in the toml? |
19:15:43 | FromDiscord | <Phil> Config? |
19:15:50 | FromDiscord | <firasuke> In reply to @Isofruit "I mean, what data": yes |
19:15:51 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Maybe procs is your": Docs said `Retrieves the address of a procedure/variable from lib. Returns nil if the symbol could not be found.` though ._. |
19:16:05 | FromDiscord | <Phil> In reply to @firasuke "yes": Are humans supposed to manipulate that file directly? |
19:16:12 | FromDiscord | <firasuke> In reply to @Isofruit "Are humans supposed to": no |
19:16:24 | FromDiscord | <Phil> In reply to @firasuke "no": Why not just make your life easy and write json then? |
19:16:43 | FromDiscord | <Phil> pretty trivial to (de)serialize, you can use either std/json or jsony, fast and easy |
19:16:46 | FromDiscord | <firasuke> hmmm humans may want to write such files |
19:17:24 | FromDiscord | <Phil> Is that the supposed "main-path" for your application or is it an edge-case? |
19:17:43 | FromDiscord | <firasuke> it's for a package format |
19:18:13 | FromDiscord | <firasuke> I found this: https://github.com/status-im/nim-toml-serialization |
19:18:33 | FromDiscord | <Phil> If I wanted that to be the main-road my users interact with my app - Use the friendliest most standard format possible↵If it's really just a courtesy or side-edge-feature that just needs to be better than nothing, json does the job. |
19:18:59 | FromDiscord | <Phil> As for toml deserialization etc., yeah ideally you have that stuff in a strictly typed nim-type, makes your life easier in your actual nim-code as that gives you guarantees |
19:19:08 | FromDiscord | <Phil> Like the guarantee that field x/y/z exists and has a certain value |
19:19:27 | FromDiscord | <Phil> (edit) "value" => "value, as otherwise deserialization should explode" |
19:19:33 | FromDiscord | <firasuke> yeah exactly |
19:19:40 | FromDiscord | <firasuke> ok I have some more questions |
19:19:44 | FromDiscord | <firasuke> please bare with me as I am new to Nim |
19:19:57 | FromDiscord | <firasuke> is it possible to use an if statement inside `stdout.write`? |
19:19:59 | FromDiscord | <Phil> Perfectly fine, just got to be aware I don't know every lib out there 😛 |
19:20:08 | FromDiscord | <firasuke> something like `stdout.write(if something: "hello" else: "world")` |
19:20:28 | FromDiscord | <firasuke> (edit) "something like `stdout.write(if something: "hello" else: "world")`" => "sent a code paste, see https://play.nim-lang.org/#ix=4on6" |
19:23:05 | FromDiscord | <Phil> It appears to be possible based on inim |
19:23:24 | FromDiscord | <Phil> Though I can't figure out where the heck inim writes the stdoutput to because I only ever see the first message |
19:23:42 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/YWW |
19:24:10 | FromDiscord | <Phil> Generally for small stuff like this and playing around, inim is really useful |
19:25:51 | FromDiscord | <Phil> But yeah, it should generally be possible in anything, as nim just evaluates the expression first before dumping its outcome into the proc (in this case the write proc) |
19:27:51 | FromDiscord | <firasuke> hmmm |
19:29:07 | * | beholders_eye joined #nim |
19:36:22 | FromDiscord | <Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "Docs said `Retrieves the": It doesn't even define a Nim main? |
19:37:15 | FromDiscord | <Hourglass [She/Her]> The hell? None of my procs are exported |
19:37:26 | FromDiscord | <Hourglass [She/Her]> In the shared library at least |
19:39:07 | FromDiscord | <Phil> Hmmm maybe they are just not under that name.↵I have literally nobody ever seen try to bind to a nim-based so |
19:39:14 | FromDiscord | <Phil> (edit) "Hmmm maybe they are just not under that name.↵I have literally nobody ever seen ... try" added "anyone" |
19:39:27 | FromDiscord | <Phil> Given that nim generates C I think it could very well be that the true proc names are different |
19:40:06 | FromDiscord | <Hourglass [She/Her]> I've used `exportc` on the variable and exported the procs with `exportc` and `cdecl` |
19:40:14 | FromDiscord | <Hourglass [She/Her]> Hold on, I'm gnna dive into nimcache |
19:41:03 | FromDiscord | <Phil> https://media.discordapp.net/attachments/371759389889003532/1076226789690589306/th.png |
19:42:08 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4on9 |
19:42:14 | FromDiscord | <Hourglass [She/Her]> So it's not defined in the outer scope? |
19:43:01 | * | Mister_Magister quit (Excess Flood) |
19:43:26 | * | Mister_Magister joined #nim |
19:44:06 | FromDiscord | <Phil> I am C-phobic so all I see is ancient egyptian |
19:44:16 | FromDiscord | <Phil> (edit) "I am C-phobic so all I see is ancient egyptian ... " added "hieroglyphs" |
19:45:01 | FromDiscord | <Hourglass [She/Her]> Wait there's also `static const NimStringV2 TMipcYmBC9bj9a1BW35ABoB1Kw_8 = {51, (NimStrPayload)&TMipcYmBC9bj9a1BW35ABoB1Kw_7};↵N_LIB_PRIVATE tyObject_PlugincolonObjectType_eE2tCWFVY09bYexC9avsm4dA plugin;` |
19:45:35 | FromDiscord | <Hourglass [She/Her]> So it's in the public scope |
19:45:44 | FromDiscord | <Hourglass [She/Her]> Wait why lib private |
19:46:00 | FromDiscord | <Elegantbeef> Dynlibs cannot have variables |
19:46:07 | FromDiscord | <Elegantbeef> You need to export getters/setters |
19:46:12 | FromDiscord | <Hourglass [She/Her]> ...ah |
19:46:19 | FromDiscord | <Hourglass [She/Her]> Would be nice if docs mentioned that |
19:46:37 | FromDiscord | <Elegantbeef> I'm presently playing around with a header generator 😄 |
19:47:02 | FromDiscord | <4zv4l> for big const array |
19:47:03 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1076228301909131304/image.png |
19:47:14 | FromDiscord | <4zv4l> for big const array↵is there a way to infer the size ? |
19:47:32 | FromDiscord | <Elegantbeef> What? |
19:47:37 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "Would be nice if": That would be nice! Though where would it go? |
19:47:39 | FromDiscord | <Elegantbeef> Use a seq if you do not know the size |
19:47:43 | FromDiscord | <Phil> Like, which docs exactly |
19:47:53 | FromDiscord | <4zv4l> In reply to @Elegantbeef "Use a seq if": but that's constant↵I don't want it to be on the heap |
19:48:04 | FromDiscord | <4zv4l> In reply to @Elegantbeef "Use a seq if": I know the size at compile time |
19:48:54 | FromDiscord | <Elegantbeef> constant seqs are not heap allocated |
19:49:02 | FromDiscord | <Elegantbeef> They're folded into a normal array |
19:49:09 | FromDiscord | <4zv4l> oh, I thought seq were always heap allocated |
19:49:36 | FromDiscord | <4zv4l> so if they're not `const` they will be heap allocated ? or that's the compiler that choose ? |
19:50:25 | FromDiscord | <4zv4l> `Seqs, abbreviated from “sequence”, provide dynamically expandable storage.`↵really sounds like heap allocation to me↵so I guess the compiler can optimize and put some seq as array if it sees it won't grow ? |
19:50:27 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "That would be nice!": Dynlib docs is a place that made me think it supported variables, literally here |
19:50:30 | FromDiscord | <Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "Docs said `Retrieves the": . |
19:50:42 | FromDiscord | <Elegantbeef> Seqs are always heap allocated if used at runtime |
19:50:46 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "Dynlibs cannot have variables": How about nimmain? |
19:51:12 | FromDiscord | <Elegantbeef> What about it? |
19:51:55 | FromDiscord | <Hourglass [She/Her]> Do I need to run it for shared libraries or nah? |
19:52:06 | FromDiscord | <Elegantbeef> You should to initalise and run all top level code |
19:52:12 | FromDiscord | <Hourglass [She/Her]> Probably yes if I want the shared library to be able to define it's own top level variables and stuff |
19:52:31 | FromDiscord | <Hourglass [She/Her]> Alright then! |
19:52:37 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4onb |
19:52:38 | FromDiscord | <Hourglass [She/Her]> Hopefully this won't go to shit |
19:52:51 | FromDiscord | <Elegantbeef> Why are you using seq here |
19:52:57 | FromDiscord | <Elegantbeef> just do `names = [...]` |
19:52:57 | FromDiscord | <4zv4l> well I wanted to use array |
19:53:02 | FromDiscord | <Elegantbeef> Like ....? |
19:53:09 | FromDiscord | <4zv4l> yeah but I need to tell the compiler those are cstring |
19:53:12 | FromDiscord | <4zv4l> instead of string |
19:53:20 | FromDiscord | <Elegantbeef> Why? |
19:53:30 | FromDiscord | <4zv4l> otherwise it tells me `indirect convertion...will be compiler error in the future..` |
19:53:42 | FromDiscord | <Elegantbeef> `cstring"myString"` |
19:53:57 | FromDiscord | <Elegantbeef> The first element tells the array how to sem the remainder of the array |
19:54:52 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4ond |
19:54:53 | FromDiscord | <4zv4l> doesn't look too bad |
19:55:06 | FromDiscord | <Hourglass [She/Her]> I think Beef is losing braincells- |
19:55:08 | FromDiscord | <Hourglass [She/Her]> Again- |
19:55:30 | FromDiscord | <Elegantbeef> `20u8` looks even better |
19:55:43 | FromDiscord | <Elegantbeef> Perhaps |
19:58:30 | FromDiscord | <4zv4l> In reply to @Elegantbeef "`20u8` looks even better": but it would break the consistency |
19:58:48 | FromDiscord | <Hourglass [She/Her]> Would a template that inserts the getter and setter (with the appropriate pragmas) be suitable? I'd imagine it'd be fine but |
19:58:49 | FromDiscord | <Elegantbeef> Who cares about consistency |
19:58:55 | FromDiscord | <4zv4l> In reply to @Elegantbeef "Who cares about consistency": I do |
19:59:02 | FromDiscord | <4zv4l> the code must look good |
19:59:03 | FromDiscord | <4zv4l> xD |
19:59:08 | FromDiscord | <4zv4l> look pleasing to look at |
19:59:13 | FromDiscord | <4zv4l> (edit) removed "look" |
19:59:27 | FromDiscord | <Hourglass [She/Her]> Also wonder if there's a way to make a 'dynamic'/generic getter/setter proc for anything within the dynlib's namespace |
19:59:34 | FromDiscord | <huantian> ok but like don't space align your `=` smh my head |
20:00:07 | FromDiscord | <Elegantbeef> I mean that's what my header generator would do 😄↵(@Hourglass [She/Her]) |
20:00:41 | FromDiscord | <⚶ Zeno> sup people↵↵is there nim equivalent of python's yield and .send ? or for lua ppl, `coroutine.yield` and `coroutine.resume` |
20:12:02 | FromDiscord | <Hourglass [She/Her]> My code still doesn't find any of my procs |
20:12:16 | FromDiscord | <Elegantbeef> did you `exportc, dynlib`? |
20:14:52 | FromDiscord | <Hourglass [She/Her]> ...ah, `dynlib` |
20:15:07 | * | beholders_eye quit (Ping timeout: 246 seconds) |
20:15:10 | FromDiscord | <Hourglass [She/Her]> I thought cdecl and exportc would've done it |
20:15:23 | FromDiscord | <Elegantbeef> That doesnt stop C's dead code elmination |
20:15:27 | FromDiscord | <Hourglass [She/Her]> Yep that works now- |
20:15:32 | FromDiscord | <Elegantbeef> It just exports to C and says "this is using cdecl" |
20:15:39 | FromDiscord | <Hourglass [She/Her]> Ah |
20:15:47 | FromDiscord | <Hourglass [She/Her]> Welp, it works now! Thanks Beef! |
20:17:47 | FromDiscord | <Hourglass [She/Her]> Now I can finally work on implementing this in my MC server code :p |
20:18:57 | * | kenran joined #nim |
20:25:23 | FromDiscord | <auxym> In reply to @⚶ Zeno "sup people is": Nim closure iterators might be of interest to you. Otherwise, the CPS library allows implementing all sorts of behaviors, including lua-like coroutines (they have an example of doing exactly that) |
20:25:38 | FromDiscord | <auxym> also https://nim-lang.org/docs/coro.html |
20:26:32 | FromDiscord | <⚶ Zeno> In reply to @auxym "Nim closure iterators might": thanks mate |
20:29:43 | FromDiscord | <Hourglass [She/Her]> Rate my shit plugin system using shared libraries: https://github.com/Yu-Vitaqua-fer-Chronos/nimpluginsystem |
20:32:44 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4oh9 |
20:33:13 | FromDiscord | <michaelb.eth> definitely not happening in older versions of Nim, does that seem like a bug? |
20:37:06 | FromDiscord | <firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4onk |
20:42:29 | FromDiscord | <Phil> Because you're using that "if" there as if it would copy paste your code in there |
20:42:36 | FromDiscord | <Phil> You have to treat it like an expression |
20:42:58 | FromDiscord | <Elegantbeef> There's a cast inside↵(@michaelb.eth) |
20:43:45 | FromDiscord | <Phil> In reply to @firasuke "Why does this not": See it more as if it were written like this:↵styledEcho styleBright, "Key :", resetStyle, (if true: fgGreen, "Yes" else: fgRed, "No")↵↵At which point you have an if-statement trying to return either `fgGreen, "Yes"` or `fgRed, "No"`, neither of these are valid nim syntax which is why it's throwing "invalid indentation"-errors |
20:44:49 | FromDiscord | <Phil> what you'd want is ↵`styledEcho styleBright, "Key :", resetStyle, if true: fgGreen else: fgRed, if true: "Yes" else: "No"`↵That is separate if statements, each returning a valid value |
20:45:36 | FromDiscord | <firasuke> hmmm I prefer if it were a single if statement |
20:47:21 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4onr |
20:47:27 | FromDiscord | <firasuke> oh ok |
20:47:33 | FromDiscord | <firasuke> thanks |
20:48:26 | FromDiscord | <firasuke> is there a better way to get a string value out of a parsed toml file table? `getStr(table["key"])`? |
20:48:37 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4ons |
20:48:52 | FromDiscord | <firasuke> In reply to @Isofruit "No worries. Personally I'd": cool |
20:48:55 | FromDiscord | <4zv4l> any idea how I can get a path to put the config file of my program in a common place for all users ? |
20:49:07 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4ons" => "https://play.nim-lang.org/#ix=4ont" |
20:49:22 | FromDiscord | <Phil> In reply to @4zv4l "any idea how I": You doing Linux or cross-plattform? |
20:50:01 | FromDiscord | <Phil> Eh, either way you'll have to do this research. There are generally OS-recommended folders for putting in configs... I'll be honest that I still have to go read up on which thiose were for linux |
20:50:13 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "There's a cast inside": sure, but the warning seems spurious, or am I missing something |
20:50:20 | FromDiscord | <Phil> I think /etc/<your-app-name> would be a valid choice (?) |
20:51:39 | FromDiscord | <Phil> In reply to @4zv4l "any idea how I": https://superuser.com/questions/631859/preferred-place-to-store-configuration-files-that-change-often↵For Linux on that front, I recall skimming over that a week ago |
20:53:21 | FromDiscord | <4zv4l> well that's for Windows |
20:53:29 | FromDiscord | <4zv4l> my manager told me to try using Registry Key |
20:53:31 | FromDiscord | <4zv4l> but idk |
20:54:15 | FromDiscord | <Phil> In reply to @firasuke "is there a better": I don't know if your toml-lib allows that, but that is the kind of reason why I typically prefer converting whatever config I have into a nim-type rather than an object variant like you're currently dealing with.↵↵Maybe the lib you're using has a proc for that to transform a parsed toml config into a proper nim type? |
20:54:16 | FromDiscord | <4zv4l> In reply to @Isofruit "I think /etc/<your-app-name> would": yeah on linux it would have been much easier to choose xD |
20:54:40 | FromDiscord | <Phil> https://softwareengineering.stackexchange.com/questions/160097/where-should-i-put-configuration-files |
20:54:42 | FromDiscord | <firasuke> In reply to @Isofruit "I don't know if": I'll double check that, thanks for all the help |
20:55:16 | FromDiscord | <Phil> In reply to @4zv4l "yeah on linux it": I mean, Linux has like... 4 places where you may expect config files |
20:55:39 | FromDiscord | <Phil> So I'm not sure about easier to choose 😛 |
20:56:01 | FromDiscord | <4zv4l> well I just found `env:PROGRAMDATA` |
20:56:04 | FromDiscord | <4zv4l> might be a good place |
20:56:43 | FromDiscord | <Hourglass [She/Her]> I hate writing comments but I'm doing this so I can actually read my code at a later point |
20:57:28 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "I hate writing comments": My secret plan of getting you to help me write docs for the nim ecosystem was foiled before it even began ! |
20:58:01 | FromDiscord | <Hourglass [She/Her]> Hm? |
20:59:08 | FromDiscord | <Phil> I was just trying to make a joke since you wrote you didn't like comments for documenting stuff, which I'm currently writing a fuckton off for owlkettle |
20:59:29 | FromDiscord | <Hourglass [She/Her]> Aah fair |
20:59:57 | FromDiscord | <Hourglass [She/Her]> I'm going through my proof-of-concept plugin loader and plopping comments there now so it's not undecipherable in a month |
21:00:38 | FromDiscord | <Phil> I recommend generally proc-comments.↵If it's not a proc-comment, you can outsource it into a private proc with proc comments 😛 |
21:00:45 | FromDiscord | <Phil> (edit) "proc-comments.↵If" => "proc-doc-comments.↵If" |
21:01:16 | FromDiscord | <Hourglass [She/Her]> proc doc comments? |
21:01:45 | * | kenran` joined #nim |
21:01:55 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4ony |
21:02:03 | * | kenran` quit (Remote host closed the connection) |
21:02:33 | FromDiscord | <Hourglass [She/Her]> Ah yeah I'm doing that |
21:04:41 | * | kenran quit (Ping timeout: 252 seconds) |
21:08:12 | FromDiscord | <4zv4l> how do I know if I put too many comments ?↵I have more comments than actual code↵but it's `complex?` and since my manager wanna be sure it's easy to maintain later (since I asked to make it in Nim) I feel like I have to make it clear what the code does |
21:08:50 | * | ltriant joined #nim |
21:09:04 | FromDiscord | <Hourglass [She/Her]> I mean, does it help explain what the code is doing? |
21:09:11 | FromDiscord | <Hourglass [She/Her]> If it doesn't: That's to many |
21:09:17 | FromDiscord | <Hourglass [She/Her]> (edit) "to" => "too" |
21:09:40 | FromDiscord | <4zv4l> it helps, definitely help |
21:09:58 | FromDiscord | <4zv4l> it is more than explaining the code↵it's explaining the feature actually at the same time |
21:10:04 | FromDiscord | <Phil> In reply to @4zv4l "how do I know": Really depends. I mean, look at Snorlogue, that thing is like ~50% doc-comments, but it also is a library |
21:10:37 | FromDiscord | <Phil> For your application it depends. It might be that you're writing comments because your code isn't nicely readable and could use better variable names.↵Or you could restructure your code to better match your thought process on how things should happen |
21:11:17 | FromDiscord | <Phil> A "comment-smell" could be that you're documenting irrelevant implementation-details instead of the high-level idea what the proc is supposed to do |
21:11:22 | FromDiscord | <Hourglass [She/Her]> In reply to @4zv4l "it is more than": Then I say it's fine |
21:12:53 | FromDiscord | <Hourglass [She/Her]> Would it be smarter to create a new library for handling Minecraft-related things (like `VarInt` parsing) so it could be published on Nimble? |
21:13:22 | FromDiscord | <Phil> I'd say so, assuming you set it up with proper CI, comments and docs 😛 |
21:13:34 | * | ltriant quit (Ping timeout: 246 seconds) |
21:13:55 | FromDiscord | <Phil> In the long-term I do plan on e.g. publishing my commands that interact with nimble in a separate library so that others can use it and so I can force myself to have a very strictly defined API there |
21:14:40 | * | xet7 joined #nim |
21:14:55 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "I'd say so, assuming": Yeah I'll work on doing that then once I finally dive into the protocol stuff because I've been working on the structure of my server core for a while, more than the actual logic behind it :p |
21:15:07 | FromDiscord | <Hourglass [She/Her]> But hey, at least I have a satisfactory plugin loading system! |
21:15:41 | FromDiscord | <Hourglass [She/Her]> Also: I struggle with keeping myself focused on a goal f- (In this case, writing tests, comments, docs and examples) |
21:15:49 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "Yeah I'll work on": I can relate. I got sidetracked by figuring out how to e.g. parse nimble files for 3 days straight and now I'm getting sidetracked into properly figuring out what owlkettle can do and stuff |
21:15:55 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4onD |
21:16:27 | FromDiscord | <Hourglass [She/Her]> Oh yeah, there are generators for making packet info and stuff... I should automate them and wrap it into Nim |
21:16:40 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "I can relate. I": F that's fair |
21:16:52 | FromDiscord | <Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "Oh yeah, there are": (For Minecraft packets) |
21:19:04 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4onE |
21:20:24 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4onG |
21:21:10 | FromDiscord | <Phil> Could maybe garnish that with a doc comment of `## adds a new file logger to the global set of handlers` or sth |
21:23:06 | FromDiscord | <Phil> (edit) "handlers`" => "handlers. Logs to file in the binaries directory`" | "sth" => "sth." |
21:23:59 | FromDiscord | <4zv4l> thank you for the feedback↵I'll change that one and try to be more concise↵↵the previous code they made had no comments and I had lot of struggle to understand it, maybe that's why I add a lot now |
21:24:55 | FromDiscord | <Phil> In reply to @4zv4l "thank you for the": That's perfectly fair. And It's not like I'm perfect either, it may just help to take a step back and always think about what the idea for the proc is. ↵Not what you're telling it to do, but conceptually speaking what is the task this proc must perform |
21:25:06 | FromDiscord | <Phil> I'm not sure if that expresses well what I'm trying to say |
21:27:51 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4onI |
21:28:11 | FromDiscord | <Phil> In which case you'll see quite some parallels to your ones, maybe even "worse" in a sense since it does include a technical detail about the pattern of the log-file |
21:30:02 | FromDiscord | <Phil> All depends on the idea.↵If you start documenting that you're calling service X to do something, you're going to far.↵Saying"Fetches and parses Profiles from github.com" is fine again |
21:30:17 | FromDiscord | <Phil> Though the "parses" may be redundant |
21:32:32 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4onL |
21:33:06 | FromDiscord | <Phil> > ## `WM_CLIPBOARDUPDATE` will be set ↵Why would I, as a user of that proc, care about that comment? |
21:33:19 | FromDiscord | <4zv4l> that's for the dev |
21:33:24 | FromDiscord | <Phil> The rest is really good, kudos on that, just this line in particular |
21:33:29 | FromDiscord | <4zv4l> that code isn't supposed to get out of the company |
21:33:43 | FromDiscord | <4zv4l> those comments are for the ones who will have to maintain it later |
21:33:46 | FromDiscord | <4zv4l> I guess |
21:33:51 | FromDiscord | <Elegantbeef> I mean that's an assert if i've ever seen one |
21:34:03 | FromDiscord | <Elegantbeef> if you ever have a comment that says "will" or "should" that's an assert |
21:34:06 | FromDiscord | <Phil> You use asserts as a kind of doc-comment? |
21:34:22 | * | NimEventer joined #nim |
21:34:22 | NimEventer | New question by Philipp Doerner: How do I access parsing of .nimble files from the nimble package?, see https://stackoverflow.com/questions/75426013/how-do-i-access-parsing-of-nimble-files-from-the-nimble-package |
21:34:23 | NimEventer | New post on r/nim by Mmiguel6288: inspection capabilities in nim secret?, see https://reddit.com/r/nim/comments/114cwnf/inspection_capabilities_in_nim_secret/ |
21:34:32 | FromDiscord | <Elegantbeef> I use asserts to inform programmers things should be specifically X |
21:34:33 | FromDiscord | <Phil> Holy shit Nimeventer |
21:34:37 | FromDiscord | <Yardanico> yep |
21:34:41 | FromDiscord | <Phil> Yaaaaaaaaaard |
21:34:42 | FromDiscord | <Elegantbeef> As the good lord intended |
21:34:44 | FromDiscord | <Phil> Long time no read! |
21:34:50 | FromDiscord | <4zv4l> In reply to @Elegantbeef "I use asserts to": what do you mean ? |
21:34:53 | FromDiscord | <Elegantbeef> Who the fuck is this guy |
21:34:59 | FromDiscord | <Yardanico> who knows |
21:35:19 | FromDiscord | <Elegantbeef> If you have a comment that says `x will be set` i'd do `x != nil` |
21:35:22 | FromDiscord | <Elegantbeef> `assert x != nil` specfically |
21:35:27 | FromDiscord | <Elegantbeef> Asserts are code documentation as much as a comment iis |
21:35:41 | FromDiscord | <Yardanico> now nimeventer runs on the nim vps that's running ircord and nimbot, sadly I still have to cross-compile myself since it's running ubuntu 16.04 that's kind ancient at this point :) |
21:35:53 | FromDiscord | <Yardanico> and others have access to that vps too |
21:36:05 | FromDiscord | <Elegantbeef> just statically link musl 😛 |
21:36:09 | FromDiscord | <Phil> In reply to @Elegantbeef "I use asserts to": Hmm so `assert` not just as a way to get technical guarantees, but also as a way to communicate with reading programmers that x/y must be true/have happened as part of something else being done |
21:36:20 | FromDiscord | <Elegantbeef> Of course |
21:36:24 | FromDiscord | <Elegantbeef> They're compiled out of release |
21:36:26 | FromDiscord | <Phil> What does musl have to do with that? |
21:36:29 | FromDiscord | <Elegantbeef> So there is no reason not to use them |
21:36:32 | FromDiscord | <Yardanico> In reply to @Elegantbeef "*just statically link musl*": need ssl |
21:36:39 | FromDiscord | <4zv4l> `WM_CLIPBOARDUPDATE` is an event the app will get in the `GetMessage` loop↵if that might help |
21:36:42 | FromDiscord | <Elegantbeef> Musl libc can be statically compiled which means you do not rely on the systems libc |
21:37:11 | FromDiscord | <Phil> I understand that much, was more of why tell yard that, like what's so bad about deploying dynamically linked? |
21:37:13 | FromDiscord | <Yardanico> since nimeventer does requests to the forum, reddit, stackoverflow, and posts to discord, telegram, irc (irc doesn't need ssl) |
21:37:31 | FromDiscord | <Yardanico> In reply to @Isofruit "I understand that much,": I mean i have to cross-compile exactly because the VPS is running an older version of glibc |
21:37:34 | FromDiscord | <4zv4l> anytime the content of the clipboard is modified, you get the event `WM_CLIPBOARDUPATE` and since I got a lot of `recursion` because of that in my `dll` I try to be sure they know that if they call that function from my hook they might make the computer explode |
21:37:38 | FromDiscord | <Yardanico> so the binary I compile normally won't run on it |
21:37:47 | FromDiscord | <Yardanico> because binary depends on glibc newer than the one vps has |
21:38:05 | FromDiscord | <Yardanico> statically linking is a solution, but statically linking openssl/libressl can be annoying, so I'll be just using the same zig cc trick like I do with ircord |
21:38:09 | FromDiscord | <Yardanico> does ircord even work still? |
21:38:14 | FromDiscord | <jmgomez> hey guys, can you bindSym a symbol available at the instantiation context but defined in another module? |
21:38:15 | FromDiscord | <Yardanico> ah right it does, nimeventer just showed that |
21:38:29 | FromDiscord | <Phil> In reply to @Yardanico "I mean i have": Ohhhhhhh, VPS running on an older glibc version was the info I was missing, thanks for clearing that one up |
21:38:38 | FromDiscord | <Yardanico> yeah, ubuntu 16.04 |
21:39:42 | FromDiscord | <Phil> are all ssl libs taking forever to compile or just openssl? |
21:39:55 | FromDiscord | <Phil> I recall when I first played around with statically linking musl it took over an hour |
21:40:03 | FromDiscord | <4zv4l> In reply to @4zv4l "well those are the": if I use↵`assert EmptyClipboard() == TRUE`↵it will throw an exception right ? it won't just return false |
21:40:17 | FromDiscord | <Phil> (edit) "I recall when I first played around with statically linking musl it took over an hour ... " added "to make a static openssl thingy" |
21:40:39 | FromDiscord | <Phil> In reply to @4zv4l "if I use `assert": It will return an exception for debug builds |
21:40:54 | FromDiscord | <Elegantbeef> It will panic |
21:40:57 | FromDiscord | <Yardanico> In reply to @Isofruit "are all ssl libs": it's quite fast if you have a lot of threads to compile, it just might be non-straightforward, static linking is a bit mroe annoying in general |
21:41:44 | FromDiscord | <jmgomez> In reply to @jmgomez "hey guys, can you": seems like the macro needs to have access to the module |
21:41:46 | FromDiscord | <Yardanico> (edit) "mroe" => "more " |
21:41:46 | FromDiscord | <Phil> This laptop only has the 4, so not a ton to work with ^^' |
21:41:48 | FromDiscord | <ElegantBeef> Bridge is fun |
21:41:55 | FromDiscord | <Yardanico> wow, beef on discord |
21:41:57 | FromDiscord | <Yardanico> what a rare sight |
21:42:03 | FromDiscord | <ElegantBeef> Only when the bridge diededs |
21:42:09 | FromDiscord | <Yardanico> matrix bridge diededd? |
21:42:18 | FromDiscord | <ElegantBeef> Yea |
21:42:22 | FromDiscord | <ElegantBeef> One day the t2bot bridge will not |
21:42:28 | FromDiscord | <Elegantbeef> Like yes it's technically a exception, but let's not pretend it's not a panic |
21:42:30 | FromDiscord | <Elegantbeef> Ah bridge is fun |
21:42:33 | * | cfa left #nim (#nim) |
21:42:51 | * | ltriant joined #nim |
21:43:05 | FromDiscord | <ElegantBeef> given that the bridge dropped my spaghetti https://media.discordapp.net/attachments/371759389889003532/1076257503513424012/image.png |
21:43:27 | FromDiscord | <Yardanico> yeah, I just use zig cc for that cross-compilation |
21:43:36 | FromDiscord | <Yardanico> just copied my ircord script I used for that |
21:43:42 | FromDiscord | <Yardanico> <https://github.com/Yardanico/nimeventer/blob/master/zig-compile-vps.sh> |
21:43:52 | FromDiscord | <ElegantBeef> Just use enthu's zigcc package 😛 |
21:43:57 | FromDiscord | <Yardanico> that's what I'm doing, yes |
21:44:02 | FromDiscord | <Yardanico> but I need to pass some args to zigcc |
21:44:04 | FromDiscord | <Elegantbeef> Are we back online?! |
21:44:15 | FromDiscord | <Yardanico> set glibc to 2.24 and disable undefined sanitizer coz zig has it on by default |
21:44:17 | FromDiscord | <Yardanico> and it hates refc |
21:44:25 | FromDiscord | <Yardanico> ah right this binary is with orc |
21:44:27 | FromDiscord | <Yardanico> still :) |
21:44:32 | FromDiscord | <Phil> In reply to @ElegantBeef "given that the bridge": I mean, due to what I learned about cross-compiling with zigcc whenever I run into the scenario "that needs an older glibc version" I just read up the stack-overflow I wrote ages ago on how to do it with enthus' package |
21:45:07 | FromDiscord | <Elegantbeef> Sure but static musl is just another option for some programs |
21:45:08 | FromDiscord | <Elegantbeef> Not really suggested though |
21:45:25 | FromDiscord | <Phil> And this, ladies and gentlemen, is why I write these questions, so I can forget the specifics |
21:45:34 | FromDiscord | <Phil> (edit) "And this, ladies and gentlemen, is why I write these questions, so I can forget the specifics ... " added "and just need to recall that I made a question for that" |
21:45:58 | FromDiscord | <Elegantbeef> I thought it was cause you cannot even remember your name on good days |
21:46:39 | FromDiscord | <Phil> I have to remember that one because SO keeps deleting my questions where I want to write that down |
21:47:45 | * | ltriant quit (Ping timeout: 255 seconds) |
21:48:06 | om3ga | Hi! Is it ok when using standard alloc (I mean without specifying --d:useMalloc), the sequence, after its element was deleted not reduces residual ram usage? |
21:48:46 | om3ga | when I specify this compiler option, then ram usage is less |
21:49:00 | * | ltriant joined #nim |
21:49:17 | FromDiscord | <Elegantbeef> Nim's default allocator does not release memory to the OS |
21:49:58 | om3ga | ah.. was this made for specific reason? (I know I should read manual of memory model) |
21:50:23 | FromDiscord | <Phil> It's faster to reuse memory you already have than give back and request again |
21:50:46 | FromDiscord | <Phil> At least that's what I know of the reasoning for it so far |
21:51:04 | FromDiscord | <Phil> (edit) "far" => "far, mandatory disclaimer I'm not terribly well educated on allocators" |
21:51:13 | FromDiscord | <Elegantbeef> Requesting memory from the OS is slow |
21:51:45 | om3ga | Thanks! |
21:52:03 | om3ga | now it makes sense for me, thanks a lot |
21:53:49 | * | ltriant quit (Ping timeout: 252 seconds) |
22:02:48 | * | ltriant joined #nim |
22:06:05 | FromDiscord | <Hourglass [She/Her]> I'm genuinely not sure how to structure my server at this point |
22:06:38 | * | advesperacit quit () |
22:07:28 | FromDiscord | <Hourglass [She/Her]> I want to be able to compile the plugins into shared libraries but I'm most definitely gonna need a custom task for that |
22:07:52 | FromDiscord | <Hourglass [She/Her]> Also debating on if I should move plugins out to a separate repo or if bundling it into the same repo is fine |
22:15:02 | FromDiscord | <Hourglass [She/Her]> https://github.com/Yu-Vitaqua-fer-Chronos/Nimberite/tree/develop current project structure |
22:15:24 | FromDiscord | <Phil> Generally in the same repo is fine I'd say, but write yourself nimble tasks to compile them separately |
22:15:50 | FromDiscord | <Phil> make it very clear in your repo structure that src is split between main application and plugins |
22:16:03 | FromDiscord | <Phil> Make sure that none of your plugins share any code.↵Duplicate code between them if you have to |
22:16:23 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "make it very clear": Hm that isn't done currently |
22:16:41 | FromDiscord | <Phil> What you're going for is a distributed application in a sense |
22:17:15 | FromDiscord | <Phil> Well, no, that name makes no sense, "split" application...? |
22:17:43 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Make sure that none": No code shared between plugins or no code shared with the core? With the plugins, if I want to share code, I'd just make another plugin which contains the code I want to use in bth locations and make it a dependency |
22:18:09 | FromDiscord | <Elegantbeef> The beauty is that you can make nim modules for any shared code |
22:18:20 | FromDiscord | <Elegantbeef> And it can all be in the same project if needed |
22:18:22 | FromDiscord | <Phil> Not sure, the point is that from what I'm gathering you might want to make sure that your plugins are independently upgradable |
22:18:53 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Not sure, the point": From eachother (for the most part)? Yep, from the core? Not really |
22:19:12 | FromDiscord | <Phil> In reply to @Elegantbeef "The beauty is that": The issue is that shared modules like that may lead to mess if one plugin needs behaviour A but not exactly so juuuuust a little bit weaked and the other needs it just a bit tweaked differently |
22:19:25 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "From eachother (for the": From each other. Every plugin should only be coupled to the core application and nothing else |
22:19:40 | FromDiscord | <Elegantbeef> No it's not, that's why we have generic interfaces and the like↵(@Phil) |
22:19:51 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "From each other. Every": Excluding the obvious plugin dependency system? |
22:19:52 | FromDiscord | <Phil> Because if you start sharing code that means changing that shared code does not only affect that one plugin, it can also affect the other one |
22:20:13 | FromDiscord | <Hourglass [She/Her]> (edit) "In reply to @Isofruit "From each other. Every": Excluding the obvious plugin dependency system? ... " added "(which i did make with this in mind :p)" |
22:20:23 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Because if you start": Yeah I get that |
22:20:55 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "Excluding the obvious plugin": I'm not fully sure what that entails, if it's a way for your core application to deal with plugins I'd say it's part of core |
22:22:26 | FromDiscord | <Hourglass [She/Her]> Now... Time to work on custom nimble build tasks ;) |
22:23:18 | FromDiscord | <Phil> In reply to @Elegantbeef "No it's not, that's": I disagree on that one.↵Say I want a string representation of a number somewhere, but due to technical reasons one plugin must have it as "0.00", the other as "0.0".↵From the code I've seen outside of nim so far my experience has been that it's a lot less hassle to treat parts of the ecosystem that should be independent as actually independent from the get go. |
22:23:18 | * | derpydoo quit (Read error: Connection reset by peer) |
22:23:39 | FromDiscord | <Elegantbeef> I'd say use distincts |
22:23:43 | FromDiscord | <Elegantbeef> And problem solved |
22:23:53 | FromDiscord | <Elegantbeef> I'm not saying tightly bundle parts of your package together |
22:24:10 | FromDiscord | <Phil> It's one of the few ideas that I actually agree with from DDD, split contexts very explicitly to make sure you think of data one way in one plugin and in another way in another plugin |
22:24:12 | FromDiscord | <Elegantbeef> I'm saying parts can be shared in modules and if you need to change behaviour you can use generics or static procedures |
22:24:21 | FromDiscord | <Elegantbeef> Nim has methods of not tightly packing content |
22:26:37 | FromDiscord | <Phil> I don't really see that working out in the long term. But I've also only written nim code for a year now, so not that much chance to see the effects of that in the long-term |
22:26:43 | FromDiscord | <Phil> (edit) "I don't really see that working out in the long term. But I've also only written nim code for a year now, so not that much chance to see the effects of that in the long-term ... " added "in nim explicitly" |
22:26:44 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "I disagree on that": Couldn't you just implement two different `$` procs? |
22:27:01 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "Couldn't you just implement": Yeah but then why is that code in the shared module with a generic? |
22:27:02 | FromDiscord | <Hourglass [She/Her]> In each plugin |
22:27:49 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Yeah but then why": You wouldn't need to do that |
22:27:54 | FromDiscord | <Hourglass [She/Her]> Ig this example is limited |
22:29:07 | FromDiscord | <Phil> Actually, I just realized, do you want to be able to upgrade your plugins independently of your main application? |
22:29:55 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Actually, I just realized,": Wdym? Like, any changes to the core would need a rebuild of the project? Or? |
22:30:06 | FromDiscord | <Hourglass [She/Her]> (edit) "project?" => "plugins?" |
22:31:16 | FromDiscord | <Phil> More that, maybe you want to expand a plugin to add more features to it or sth (I don't fully have an understanding on what a plugin entails and what scope it has).↵Do you want to upgrade a version-number on your main package because you added a feature or fixed a bug on a plugin? |
22:31:29 | FromDiscord | <Phil> (edit) "plugin?" => "plugin, even though nothing changed in the main app?" |
22:34:27 | FromDiscord | <Hourglass [She/Her]> 1) Yep, plugins should be able to be updated without updating the main application (Ignoring breaking changes)↵↵2) No, if I edit a plugin and the main app had no changes, then the main app stays at the same semver it was on before |
22:34:54 | FromDiscord | <Phil> In that case separate repositories for each plugin may make sense |
22:35:03 | FromDiscord | <Phil> Independent versioning |
22:35:20 | FromDiscord | <Hourglass [She/Her]> Each plugin independently sounds like a mess haha |
22:35:42 | FromDiscord | <Hourglass [She/Her]> Considering there'll be... A lot of plugins adding different functionality |
22:35:49 | FromDiscord | <Phil> Totally fair. You could also contemplate a super-repository setup or sth |
22:36:00 | FromDiscord | <Phil> Question, could you define the scope of a plugin for me? |
22:36:04 | FromDiscord | <Hourglass [She/Her]> A super-repo for all plugins is a good idea |
22:36:19 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Question, could you define": Only if you define what you mean by scope :p |
22:36:20 | FromDiscord | <Phil> Because for me that's inherently like 500+ loc at the lowest with a ton of complex functionality each time |
22:37:37 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "Only if you define": Scope is the "size" of the task your plugin is trying to solve.↵Like Snorlogue is a plugin for prologue, it solves the question of : "How do I simply get an admin interface for my prologue application without having to write my own?" |
22:37:37 | FromDiscord | <Hourglass [She/Her]> Also I have no idea how a super repo for Nimble would look at all- |
22:38:41 | FromDiscord | <Phil> Snorlogue as a plugin is around 2k loc for example |
22:39:21 | FromDiscord | <Phil> But if you're interpreting it more like prologue interprets a middleware, then that can also be a single file with 10 lines of code in it |
22:39:32 | FromDiscord | <Phil> (edit) "it" => "it.↵That would be indeed silly to have completely separate" |
22:40:40 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Scope is the "size"": Well... if I'm understanding your question properly, ideally the server does the bare-minimum, so stuff like networking for each MC version is all done by plugins implementing that for each plugin↵↵Basically, the server just does the bootstrapping, it starts a connection sure, but as soon as it can be passed off to a plugin, it does so |
22:40:45 | FromDiscord | <Hourglass [She/Her]> Does that make sense? |
22:43:13 | FromDiscord | <Phil> Yeah, to a degree, I'm trying to figure out how I'd split that tbh because you basically have a main app as a barebones plattform upon which plugins do all the business stuff |
22:43:30 | FromDiscord | <Hourglass [She/Her]> Maybe this is related? I'm struggling to understand the question mainly because I'm dumb but I'm gonna be implementing stuff in it's own plugin that follows the type of feature and the version it came in, so.. Some plugins could be `blocks-x.y.z`, `logic-x.y.z` and `networking-x.y.z` |
22:43:53 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Yeah, to a degree,": Yeah that's basically it |
22:46:14 | FromDiscord | <Phil> I think Django did this kind of stuff in a sense where some "plugins" (the auth stuff) was basically moved into the main repos.↵So it could be regarded as Django having one set of plugins in the core repos as the most "important" plugins that you're most likely going to need and the rest is outside of Django.↵Another viable way could then be to have a repository representing an entire group of plugins |
22:46:29 | FromDiscord | <Phil> But that can also get messy |
22:46:34 | FromDiscord | <Hourglass [She/Her]> Hm... |
22:49:45 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oo4 |
22:50:44 | FromDiscord | <Hourglass [She/Her]> The shared libraries were gonna have a more sane name when compiled obviously :p |
22:52:33 | FromDiscord | <Hourglass [She/Her]> So `l1_8_9` would be `1-8_combat-logic.soo` |
22:52:39 | FromDiscord | <Hourglass [She/Her]> (edit) "`l1_8_9`" => "`l1_8_9.nim`" |
22:52:45 | FromDiscord | <Hourglass [She/Her]> (edit) "`1-8_combat-logic.soo`" => "`1-8_combat-logic.so`" |
22:52:53 | FromDiscord | <Hourglass [She/Her]> (Or `dll` for windows) |
22:53:27 | FromDiscord | <Hourglass [She/Her]> (edit) "`1-8_combat-logic.so`" => "`1-8-9_combat-logic.so`" |
22:53:43 | FromDiscord | <Hourglass [She/Her]> (edit) "`l1_8_9.nim`" => "`cl1_8_9.nim`" |
22:54:04 | FromDiscord | <Phil> I can't fully get a grip of the project obviously, from what I'm seeing at this point I'd think of either grouping my plugins in packages that people would almost certainly want to use together (assuming there are not multiple combinations of that), or alternatively split them into some other way that makes sense, like maybe all networking plugins go together in a package or sth |
22:54:31 | FromDiscord | <Phil> But at that point I'll have to capitulate that I didn't have to set up such a project structure myself yet |
22:54:33 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4oo6 |
22:54:52 | FromDiscord | <Phil> One where the core app and the plugins are developed by one person etc. |
22:55:03 | FromDiscord | <Hourglass [She/Her]> Fair |
22:55:04 | FromDiscord | <Hourglass [She/Her]> Hm... |
22:55:17 | FromDiscord | <Hourglass [She/Her]> I could always change how I approach the design later on, right? |
22:55:45 | FromDiscord | <Hourglass [She/Her]> I'm struggling to think of how I'd group combat tbh |
22:56:16 | FromDiscord | <Hourglass [She/Her]> Should it have it's own repo? Or include it into logic? Rn there's only two combat systems, but there's rumours of a third one |
22:56:22 | FromDiscord | <Hourglass [She/Her]> But hm yeah that fits under logic |
22:56:32 | FromDiscord | <Hourglass [She/Her]> Maybe an organisation for this would be a good idea |
22:56:39 | FromDiscord | <Elegantbeef> You're attempting to design a project layout for a project that has no code |
22:56:39 | FromDiscord | <Elegantbeef> Make code then refactor to what makes sense |
22:56:44 | FromDiscord | <Phil> yes-ish. Some things may make that harder e.g. if you have shared code between plugins and you start splitting them out into separate packages then you might need to copy paste the shared modules, which may either work nicely because both use exactly 100% of the module-procs , or less nicely if they didn't and now each package has libs with procs in it you're no longer using |
22:57:27 | FromDiscord | <jtv> I've been keeping my mouth shut but was thinking the same thing. Don't over-engineer, learn from writing then refactor |
22:57:30 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "You're attempting to design": You see, the issue I'm trying to avoid is me having code but then it being an undecipherable unsorted mess, which is a common issue :p |
22:57:51 | FromDiscord | <Elegantbeef> Well you need to do that cause you need to learn what sticks |
22:58:12 | FromDiscord | <Elegantbeef> Spending all this time designing layout before writing doesnt give you any knowledge in what feels good or is needed to write |
22:58:25 | FromDiscord | <Hourglass [She/Her]> Yeah fair enough, ig i'll just start writing and once I get to a point where there's more plugins and stuff, I'll split it based on that |
22:58:31 | FromDiscord | <jtv> Yeah, I re-organize my repos often as things mature. Most people do |
22:58:49 | FromDiscord | <Elegantbeef> Planning this all without any practical insight means you're trying to solve issues that you do not know will arise or make problems that wouldn't otherwise |
22:58:54 | FromDiscord | <Hourglass [She/Her]> But now... How do I make a nimble task to compile the plugin lmao |
22:59:17 | FromDiscord | <Elegantbeef> https://github.com/beef331/wasm3/blob/master/wasm3.nimble#L20-L23 |
22:59:19 | FromDiscord | <Hourglass [She/Her]> All I need is something like `nimble buildPlugin path/to/file` |
22:59:25 | FromDiscord | <jtv> Why do you even need a plugin system yet? If you've got modular code, and nobody else is writing things that need dynamic loading?? |
22:59:26 | FromDiscord | <Elegantbeef> As always there's a wasm3 reference to it |
22:59:38 | FromDiscord | <Phil> Also perfectly fair advice, there's this nice saying of "Let the pattern emerge by itself" |
23:00:35 | FromDiscord | <Hourglass [She/Her]> In reply to @jtv "Why do you even": The modular code is made with the plugin system, the idea is to just let the users drag and drop what they want |
23:00:58 | FromDiscord | <guttural666> should this be part of some new version as a standard rn? https://media.discordapp.net/attachments/371759389889003532/1076277104108384266/image.png |
23:01:18 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "As always there's a": That'd do all files... Unless I can rely on nim cache? |
23:03:28 | * | ltriant quit (Ping timeout: 246 seconds) |
23:06:08 | FromDiscord | <BobBBob> In reply to @guttural666 "should this be part": c? did you mean col? |
23:06:24 | FromDiscord | <BobBBob> because if you're trying to do something like python enumerate that should work |
23:06:33 | FromDiscord | <guttural666> In reply to @BobBBob "c? did you mean": sorry yes, but I just mean std/enumerate as standard |
23:07:31 | FromDiscord | <guttural666> thought I read something |
23:07:58 | FromDiscord | <BobBBob> yeah you dont need enumerate, it should just werk |
23:09:07 | FromDiscord | <guttural666> what I thought too, but I'm on 1.6.10. and it does seem to complain about it constantly |
23:09:18 | FromDiscord | <guttural666> looping over enums I think it was |
23:09:31 | FromDiscord | <Phil> You don't need it, but I personally prefer it as its explicit, nobody would expect that you implicitly also get the index without it |
23:09:44 | FromDiscord | <Phil> Unless you know about that nim quirk ahead of time |
23:11:20 | FromDiscord | <Elegantbeef> Well enumerate is `pairs` but for iterators |
23:11:20 | FromDiscord | <Elegantbeef> `for i, x in arr` calls `.pairs` implicitly |
23:11:21 | FromDiscord | <Elegantbeef> You can just you know modify the task and use a config 😄↵(@Hourglass [She/Her]) |
23:11:40 | FromDiscord | <guttural666> In reply to @BobBBob "yeah you dont need": https://media.discordapp.net/attachments/371759389889003532/1076279793978458223/image.png |
23:12:06 | FromDiscord | <Elegantbeef> Yes |
23:12:09 | FromDiscord | <Elegantbeef> Like i said it's just a pairs iterator |
23:12:28 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "You can just you": Yeah I figured xD |
23:12:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4oob |
23:13:13 | FromDiscord | <BobBBob> oh yeah it doesnt work for enums huh |
23:13:38 | FromDiscord | <Elegantbeef> Now you do not need `enumerate` |
23:14:27 | FromDiscord | <guttural666> In reply to @Elegantbeef "Like i said it's": oh sorry, didn't realize that was for me okay |
23:15:00 | FromDiscord | <guttural666> aight |
23:15:17 | FromDiscord | <guttural666> thanks |
23:17:24 | FromDiscord | <Hourglass [She/Her]> If I cmpile with `--app:lib`, does Nim automatically append the extension type when I do `--out:path/to/file`? |
23:18:22 | FromDiscord | <Hourglass [She/Her]> (I'm giving the shared library a human-readable name) |
23:18:49 | FromDiscord | <Hourglass [She/Her]> (edit) "name)" => "name and want it to be outputted in a build folder)" |
23:20:06 | FromDiscord | <Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "If I cmpile with": It doesn't :p |
23:21:43 | FromDiscord | <Hourglass [She/Her]> Easy fix |
23:56:54 | * | derpydoo joined #nim |