00:08:55 | * | azimut quit (Ping timeout: 240 seconds) |
00:35:39 | * | spacelucy joined #nim |
00:57:50 | FromDiscord | <sOkam! 🫐> https://github.com/beef331/nimscripter#getting-global-variables-from-nimscript↵@ElegantBeef would this get variables from modules/packages that are imported by the code? |
00:59:06 | FromDiscord | <Elegantbeef> Nope |
00:59:24 | FromDiscord | <Elegantbeef> You can only access top level globals in the module you compile afaik |
01:01:15 | FromDiscord | <sOkam! 🫐> will it fail to load if an import is missing? |
01:02:10 | FromDiscord | <sOkam! 🫐> I'm trying to solve a chicken or egg problem, and if it doesn't crash on import it would literally solve the entire issue |
01:03:45 | FromDiscord | <sOkam! 🫐> (edit) "import" => "missing imports" |
01:04:11 | FromDiscord | <Elegantbeef> That API is there to statically ensure they're there |
01:05:11 | FromDiscord | <sOkam! 🫐> what does that mean? |
01:05:30 | FromDiscord | <sOkam! 🫐> will it crash or will it work? |
01:07:21 | FromDiscord | <Elegantbeef> Though I think the developer of it introduced `Option[T]` for if the symbol is not there |
01:07:23 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimscripter/blob/master/src/nimscripter/variables.nim#L12-L19 Yep |
01:07:25 | FromDiscord | <Elegantbeef> The thing is it only gets globals from the script you compiled afaik |
01:07:27 | FromDiscord | <Elegantbeef> I do not think the VM lets you do things like `getGlobal("someModule.bleh")` |
01:08:19 | FromDiscord | <sOkam! 🫐> that's not what I mean |
01:08:40 | FromDiscord | <Elegantbeef> I do not know what you're proposing |
01:08:41 | FromDiscord | <Elegantbeef> If the entry module does not have the symbol you cannot access it afaik |
01:08:48 | FromDiscord | <sOkam! 🫐> let me get to the computer and write an example with a proper keyboard |
01:10:12 | FromDiscord | <Elegantbeef> I assume then you mean "Will it error if a symbol is not in the top level module" |
01:10:19 | FromDiscord | <Elegantbeef> And the answer is `Option[T]` will not error |
01:10:22 | FromDiscord | <sOkam! 🫐> not a symbol |
01:10:24 | FromDiscord | <sOkam! 🫐> an import |
01:10:55 | FromDiscord | <Elegantbeef> That API is for accessing global variables, what does imports have to do with it |
01:11:08 | FromDiscord | <sOkam! 🫐> writing, sec |
01:16:39 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html> |
01:17:17 | FromDiscord | <sOkam! 🫐> My worry is if nimscripter will just crash on me if they have arbitrary imports that i do not need at all↵i just care about their variables, that's all |
01:17:41 | FromDiscord | <sOkam! 🫐> (edit) "all↵i" => "all, and do not provide on my stdlib because its not mandatory↵i" |
01:17:53 | FromDiscord | <Elegantbeef> Like I said afaik you can only access the top level variables declared in their script |
01:18:00 | FromDiscord | <Elegantbeef> So imported variables do not change anything |
01:18:03 | FromDiscord | <sOkam! 🫐> that doesn't answer the question |
01:18:07 | FromDiscord | <Elegantbeef> It does |
01:18:16 | FromDiscord | <Elegantbeef> Cause you literally cannot access `confy.cfg.verbose` |
01:18:31 | FromDiscord | <sOkam! 🫐> no it doesn't! its earlier than that! because im asking about parsing failure |
01:18:53 | FromDiscord | <sOkam! 🫐> will it fail when parsing the file because it has imports that I don't care about? |
01:19:21 | FromDiscord | <Elegantbeef> This is not a parsing issue |
01:19:32 | FromDiscord | <sOkam! 🫐> or do you mean that it won't even access `verbose = on` because its not declared in there? |
01:19:43 | FromDiscord | <Elegantbeef> Is the user accessing modules not in your import path? |
01:19:52 | FromDiscord | <Elegantbeef> If the user is importing modules not in their import path it's invalid nimscript |
01:20:22 | FromDiscord | <sOkam! 🫐> its arbitrary, they might be doing anything that nim can do. and i don't care about what they do, only about a very specific set of variables that they can reassign |
01:20:23 | FromDiscord | <Elegantbeef> No different to doing `import pkg/nimib` with `--noNimblePath` and not supplying a `--nimblePath` arg |
01:20:44 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "If the user is": they will have them, obviously |
01:20:51 | FromDiscord | <sOkam! 🫐> but I don't. and i don't care about those |
01:21:20 | FromDiscord | <sOkam! 🫐> they might be defining values for their configuration of confy, and i just need -that-. i coudln't care less about what they do in there |
01:21:31 | FromDiscord | <Elegantbeef> I do not follow if the user is importing modules, they're in their path and you do not care about them... where is there to error |
01:21:42 | FromDiscord | <sOkam! 🫐> because of nimscripter |
01:21:43 | FromDiscord | <Elegantbeef> The thing is that `confy.cfg` is not accessible with `cfg` from nimscripter |
01:21:48 | FromDiscord | <sOkam! 🫐> you say you need to provide an stdlib |
01:21:50 | FromDiscord | <sOkam! 🫐> and etc |
01:21:54 | FromDiscord | <Elegantbeef> Nimscripter does not do anything but call `nim -e` |
01:22:02 | FromDiscord | <Elegantbeef> Well it does a bit more |
01:22:10 | FromDiscord | <sOkam! 🫐> I do not and cannot provide the entire nim ecosystem jsut to read a couple of configuration variables |
01:22:14 | FromDiscord | <Elegantbeef> But in practice it's really just `nim -e` as a library not using CLI |
01:22:26 | FromDiscord | <Elegantbeef> Well then nimscripter is not for you to use here |
01:22:46 | FromDiscord | <Elegantbeef> For nimscripter to work you need to provide a nim stdlib path that allows running the program |
01:23:07 | FromDiscord | <sOkam! 🫐> yeah but I won't be running it |
01:23:16 | FromDiscord | <sOkam! 🫐> i guess I need to parse the file directly |
01:23:19 | FromDiscord | <Elegantbeef> If you arent running it why are you using nimscripter? |
01:23:22 | FromDiscord | <sOkam! 🫐> and get and modify a raw ast |
01:23:33 | FromDiscord | <Elegantbeef> Look at how Atlas does it |
01:23:40 | FromDiscord | <Elegantbeef> It might be helpful |
01:23:41 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "If you arent running": because I thought you might have an existing solution instead of having to parse and manipulate an ast |
01:24:05 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "Look at how Atlas": what does atlas do for this exactly? i dont follow |
01:24:24 | FromDiscord | <Elegantbeef> I think it parses nimble files for deps |
01:24:30 | FromDiscord | <Elegantbeef> It might evaluate them |
01:24:32 | FromDiscord | <Elegantbeef> I do not recall |
01:24:57 | FromDiscord | <sOkam! 🫐> but i don't need evaluation, just the variables I pre-determined |
01:25:10 | FromDiscord | <sOkam! 🫐> if they don't override, i don't care about the code |
01:25:24 | FromDiscord | <sOkam! 🫐> i guess parsing+ast reading is the only solution |
01:28:31 | FromDiscord | <sOkam! 🫐> TL;DR: I'm just trying to get rid of this entire file, and all of its code duplication, by providing my own compiled binary that does `confy build` and reads `srcDir/"build.nim"`, gets its values, compiles it and runs it↵https://github.com/heysokam/confy/blob/master/src/confy/nims.nim |
01:29:23 | FromDiscord | <sOkam! 🫐> the user can define their project configuration/setup in that file, so I need to make sure I use their config, not my hardcoded default values |
01:31:20 | FromDiscord | <Elegantbeef> > but i don't need evaluation, just the variables I pre-determined↵Like i said I do not know if it evaluates nimscript |
01:31:53 | FromDiscord | <Elegantbeef> Though what's the benefit of defining these variables like this if you do not want to evaluate |
01:33:08 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "Though what's the benefit": you might want your project to be built with verbose mode, or with your `srcDir = "code"` not my defaults, etc |
01:34:21 | FromDiscord | <Elegantbeef> Right, but why use Nim for configuration |
01:34:23 | FromDiscord | <sOkam! 🫐> but I think I see your point. with no evaluation the user cannot do anything with the variables other than set them to values directly |
01:34:27 | FromDiscord | <Elegantbeef> If you are ignoring evaluative capabillities |
01:35:06 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "Right, but why use": because I don't want to use nimscript myself, and have to duplicate all of my code just to call their app↵so was thinking of getting rid of all of my nimscript ducktaped code, and just call their file and their config |
01:35:50 | FromDiscord | <Elegantbeef> I'd say use toml or another file type then |
01:36:04 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "I'd say use toml": thats an extra file, that's not really needed |
01:36:13 | FromDiscord | <sOkam! 🫐> so i would introduce a file to get rid of a file |
01:36:53 | FromDiscord | <Elegantbeef> Then make a static library and build their Nim file as an executable 😄 |
01:36:59 | FromDiscord | <Elegantbeef> sorry dynamic library |
01:37:09 | FromDiscord | <sOkam! 🫐> wdym? |
01:37:40 | FromDiscord | <Elegantbeef> Confy loads their Nim config generator, their config generator access your loaded `libconfy` sets stuff then you access that from your `confy` program |
01:37:59 | FromDiscord | <sOkam! 🫐> whats a config generator? |
01:38:15 | FromDiscord | <Elegantbeef> It'd be the nim program that sets the config for the file |
01:38:35 | FromDiscord | <sOkam! 🫐> for what file? |
01:38:39 | FromDiscord | <sOkam! 🫐> im confused |
01:39:44 | FromDiscord | <sOkam! 🫐> they have a "builder app". its a regular nim file that will be compiled as a program, and executes their compilation process in however way they decided to do so↵that builder app -could- have some configuration values in there, but i don't know if they override variables or not |
01:39:45 | * | kristjansson joined #nim |
01:39:49 | FromDiscord | <Elegantbeef> I don't know the design here |
01:39:50 | FromDiscord | <Elegantbeef> I assumed this was a standalone file |
01:39:52 | FromDiscord | <Elegantbeef> But now it sounds like it's their entry file |
01:39:54 | FromDiscord | <Elegantbeef> Which makes it sound even more cursed |
01:39:57 | FromDiscord | <sOkam! 🫐> no |
01:40:03 | FromDiscord | <sOkam! 🫐> its an app acting as a script |
01:40:06 | FromDiscord | <Elegantbeef> Right there we go |
01:40:12 | FromDiscord | <sOkam! 🫐> but its not a script, its a full app |
01:40:17 | FromDiscord | <Elegantbeef> the builder app would be the config generator |
01:40:21 | FromDiscord | <sOkam! 🫐> ah kk |
01:40:48 | FromDiscord | <sOkam! 🫐> then↵> config loads their builder app↵what do you mean by this? this is what I'm trying to solve |
01:41:35 | FromDiscord | <sOkam! 🫐> (edit) "config" => "confy" |
01:43:33 | FromDiscord | <Elegantbeef> `confy` starts and loads lib confy. It compiles their build app as a dynamic library, it loads that and calls it's main. The builder sets the variables, then you just access them from `confy` |
01:43:52 | FromDiscord | <Elegantbeef> `libconfy` stores all the configs in a shared state instead of inside the Nim `confy` module |
01:44:45 | FromDiscord | <sOkam! 🫐> hmm, whats the difference between loading their builder app main as a shared lib... and building into a native app directly and running it? |
01:44:52 | FromDiscord | <sOkam! 🫐> wouldn't it just compile their project? |
01:45:02 | FromDiscord | <Elegantbeef> You'd share `libconfy` between `confy` and the `builder` |
01:45:15 | FromDiscord | <sOkam! 🫐> if yes, then I could just `execShellcmd("nim c -r theirfile.nim") |
01:45:17 | FromDiscord | <Elegantbeef> So all global variables in `libconfy` would be accessible to `confy` |
01:45:17 | FromDiscord | <sOkam! 🫐> (edit) "theirfile.nim")" => "theirfile.nim")`" |
01:45:46 | FromDiscord | <Elegantbeef> So if in their builder they do `cfg.someVar = true` inside `confy` you'd also be able to do `cfg.someVar` and it'd be true |
01:46:00 | FromDiscord | <Elegantbeef> since dynamic libraries are loaded once unless using funky apis |
01:46:33 | FromDiscord | <sOkam! 🫐> but they could run arbitrary code in there, and thats the point |
01:46:44 | FromDiscord | <Elegantbeef> What's the issue if they run arbitrary code? |
01:46:52 | FromDiscord | <sOkam! 🫐> i don't care about their main or their code, just the configuration variables, so I can kickstart their own app |
01:47:00 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "What's the issue if": their main |
01:47:13 | FromDiscord | <Elegantbeef> Don't they tell confy what to do and it then does it? |
01:47:13 | FromDiscord | <sOkam! 🫐> you said you run their main, I don't want to or don't need to |
01:47:19 | FromDiscord | <sOkam! 🫐> hell no |
01:47:28 | FromDiscord | <sOkam! 🫐> they define what to do themselves, thats the point of confy |
01:48:04 | FromDiscord | <sOkam! 🫐> the builder app just imports confy for ease of use, and ergonomics, but they define how to build and when to do so |
01:48:25 | FromDiscord | <Elegantbeef> So then what does confy need to know? |
01:48:43 | FromDiscord | <sOkam! 🫐> my confy command just needs their config options, thats all |
01:49:00 | FromDiscord | <sOkam! 🫐> i could ignore their configuration to build their builder, but the point is trying to respect that |
01:49:27 | FromDiscord | <sOkam! 🫐> right now they have to build their builder themselves with a nimscript file, and i have a layer of ducktaped duplicated code to support that |
01:49:49 | FromDiscord | <sOkam! 🫐> Ideally I would transfer all that code away from nimscript into my own tiny app that reads their config values and does the same |
01:51:31 | FromDiscord | <Elegantbeef> You could force the paradigm that they have a `proc build()` and `proc config()`, but yea there is nothing else I can suggest |
01:51:43 | FromDiscord | <Elegantbeef> I do not particularly enjoy this suggested paradigm 😄 |
01:51:51 | FromDiscord | <Elegantbeef> Well confy's paradigm rather |
01:52:12 | FromDiscord | <sOkam! 🫐> why not? what problem do you see? maybe i could improve it based on that |
01:53:03 | FromDiscord | <Elegantbeef> I do not understand what confy adds really |
01:53:18 | FromDiscord | <sOkam! 🫐> for nim, little. if thats your perspective, then that might be the issue |
01:53:24 | FromDiscord | <sOkam! 🫐> for C/C++.... it adds a LOT |
01:53:55 | FromDiscord | <sOkam! 🫐> for nim just allows for easy to setup and configure cross-compilation and address sanitizing |
01:54:07 | FromDiscord | <sOkam! 🫐> (edit) "configure" => "configuring of" |
01:54:59 | FromDiscord | <sOkam! 🫐> its like calling `nim c -r clangexe="zigcc" ....` with the configuration options that you define and a simple syntax |
01:56:42 | FromDiscord | <sOkam! 🫐> i take care of giving you a proper zigcc setup, passing zigcc the correct `-target=OS-ARCH`, passing it values so itdoesnt crash on nim code↵its ease of use, not revolutionary things |
01:56:53 | FromDiscord | <sOkam! 🫐> (edit) "i take care of giving you a proper zigcc setup, passing zigcc the correct `-target=OS-ARCH`, passing it values so itdoesnt crash on nim code↵its ease of use, not revolutionary ... things" added "new" |
01:57:33 | FromDiscord | <sOkam! 🫐> (edit) "setup," => "binary, downloading the latest zig version (or not, if you decide to use the sytem zig binary)," |
01:58:19 | FromDiscord | <Elegantbeef> Well at the very least a `proc config` would allow you to compile their build app and then run their `config`, recompile their build app then run again |
01:58:29 | FromDiscord | <Elegantbeef> calling `NimMain()` on second run |
01:59:09 | FromDiscord | <Elegantbeef> Though I'd still probably prefer just using a toml file to config builds |
01:59:25 | FromDiscord | <sOkam! 🫐> so you mean you would be required to store the configuration commands into the `config()` function, instead of at root, to avoid calling main? |
01:59:49 | FromDiscord | <Elegantbeef> But I'm very much the epitome of non real programmer 😄 |
01:59:55 | FromDiscord | <Elegantbeef> Correct |
02:00:23 | FromDiscord | <Elegantbeef> Plus it also moves you towards a world where you use any language to config! |
02:00:24 | FromDiscord | <sOkam! 🫐> hmm that creates a potential bug-creating situation, but I see what you mean |
02:01:32 | FromDiscord | <Elegantbeef> In the future you could use any system language if you embrace the system library approach! 😄 |
02:01:45 | FromDiscord | <sOkam! 🫐> ah i see your point now |
02:03:01 | FromDiscord | <sOkam! 🫐> its a cool idea, but sounds like feature-bloat in the context of confy↵i already had to spend 30h the other week to cleanup the mess I made myself by trying to support arbitrary compilers 🙈 |
02:03:47 | FromDiscord | <sOkam! 🫐> its a really cool idea, though |
02:24:55 | * | yae quit (Ping timeout: 260 seconds) |
02:30:38 | * | jmdaemon joined #nim |
02:36:37 | FromDiscord | <Robyn [She/Her]> Honestly I really wish I had a project to do with WASM in Nim |
02:37:55 | FromDiscord | <Robyn [She/Her]> As stupid as this sounds, is it possible to overload/override Nim's import handler? Out of curiosity |
02:38:01 | FromDiscord | <Robyn [She/Her]> Assuming no? |
02:38:19 | FromDiscord | <Robyn [She/Her]> `wasImport` macro, here we go |
02:47:29 | FromDiscord | <Elegantbeef> "import handler"? |
02:50:59 | FromDiscord | <Elegantbeef> @Chronos [She/Her] |
02:52:18 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef ""import handler"?": Like Python's import hooks |
02:52:42 | FromDiscord | <Elegantbeef> You do not realise how unhelpful that is |
02:56:32 | FromDiscord | <Robyn [She/Her]> I do not :P↵↵Python import hooks are basically ways to add custom import behaviour, for example, importing JS files in Python |
02:56:38 | FromDiscord | <Robyn [She/Her]> I don't have any other way to describe it |
03:10:51 | * | kristjansson quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
03:11:06 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "Honestly I really wish": you mean a project idea? |
03:12:38 | FromDiscord | <sOkam! 🫐> @pmunch what does `opir` do with macros?↵is their code exported to the json, or is it pre-processed by clang and only the output gets to the json file? |
03:14:02 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "you mean a project": Yep |
03:16:01 | FromDiscord | <sOkam! 🫐> @Chronos [She/Her] make a game? |
03:16:28 | FromDiscord | <sOkam! 🫐> if the answer to that is the problem, then the problem is not really wasm 🤷♂️ |
03:16:42 | FromDiscord | <sOkam! 🫐> (edit) "the problem," => "not clear," |
03:27:06 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "<@524288464422830095> make a game?": With wasm4? Hm... |
03:27:19 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "With wasm4? Hm...": ? |
03:27:48 | FromDiscord | <Robyn [She/Her]> Wasm4 is a fantasy console which runs games written in/compiled to wasm |
03:28:04 | FromDiscord | <sOkam! 🫐> in whatever way you may prefer |
03:58:35 | * | kristjansson joined #nim |
05:31:36 | * | spacelucy quit (Quit: WeeChat 4.1.2) |
05:32:21 | * | spacelucy joined #nim |
05:33:52 | * | spacelucy quit (Client Quit) |
05:34:14 | * | spacelucy joined #nim |
05:38:02 | * | spacelucy quit (Client Quit) |
05:38:21 | * | spacelucy joined #nim |
06:03:53 | * | spacelucy quit (Quit: WeeChat 4.1.2) |
06:53:14 | * | derpydoo quit (Read error: Connection reset by peer) |
07:11:55 | * | kristjansson quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:33:48 | * | derpydoo joined #nim |
09:08:10 | NimEventer | New thread by sls1005: The bool type, see https://forum.nim-lang.org/t/10817 |
09:28:58 | * | azimut joined #nim |
09:42:26 | * | yae joined #nim |
10:14:43 | * | yae quit (Ping timeout: 255 seconds) |
10:34:21 | * | derpydoo quit (Quit: derpydoo) |
10:36:33 | * | kristjansson joined #nim |
10:37:10 | * | kristjansson quit (Client Quit) |
11:05:32 | FromDiscord | <asakura44> hello |
11:16:10 | FromDiscord | <odexine> hello |
11:28:28 | FromDiscord | <Phil> Cheers |
11:40:55 | FromDiscord | <griffith1deadly> hello |
12:21:56 | * | jmdaemon quit (Ping timeout: 268 seconds) |
12:23:59 | NimEventer | New thread by mratsim: Arraymancer - 2023-12-31 - Overview of longstanding missing features, see https://forum.nim-lang.org/t/10818 |
12:30:08 | FromDiscord | <morlinbrot> Hi guys, interesting language you've got there, I'm trying it out just now. I'm building a doubly linked list using std/options, now I've come across a blocker\: How do I instantiate & assign a "generic none"? My list has a `head` of type `Option[Node[T]]` and in the `pop` method I'm trying to remove the last node and break up the ties to the previous node and the, e.g. `previousNode.next = none` - how can I do this? |
12:33:23 | FromDiscord | <Phil> previousNode.next = none(T) |
12:34:52 | FromDiscord | <morlinbrot> Oh, right. More precisely `previousNode.next = none(Node[T])` seems to be working |
12:35:14 | FromDiscord | <Phil> Ah right, node itself was the generic.↵But aye, that's how it goes |
12:35:31 | FromDiscord | <morlinbrot> Didn't see this before because I tried this but the LSP throws some errors but it compiles... 🤔 |
12:37:18 | FromDiscord | <Phil> I will admit that during my own coding I disable nimsuggest entirely. The compiler is a far better source of error messages |
12:37:46 | FromDiscord | <Phil> My workflow tends to be to compile (depending on the project also run) on save |
12:38:50 | FromDiscord | <Phil> You can also do nim check instead on save which is far faster since it only runs the nim compiler itself over the code, not any of the later backend toolchains (e.g. GCC or Clang) |
12:38:55 | FromDiscord | <morlinbrot> Ah, ok. Also, it seems it works after restarting the LSP |
12:39:16 | FromDiscord | <morlinbrot> Ah, interesting, will try!↵(@Phil) |
12:40:03 | FromDiscord | <morlinbrot> Speaking of, is there some kind of `watch` command for the compiler? I didn't see anything with that name but maybe there's some way to make it happen? |
12:41:21 | FromDiscord | <Phil> You mean auto-recompile on save pretty much? |
12:41:34 | FromDiscord | <morlinbrot> Yup |
12:41:51 | FromDiscord | <Phil> Not that I know of, however IDEs tend to provide functionality for that to take care of it |
12:42:13 | FromDiscord | <Phil> VsCode has its task json and intellij has some settings somewhere hidden deep inside their monstrosity of config settings |
12:43:36 | FromDiscord | <morlinbrot> Yea, I'm using the helix editor with a terminal to the side |
12:43:38 | FromDiscord | <Phil> If you're after it only recompiling/checking the bits of the code that were saved - then what you're referring to is incremental compilation which is being worked on.↵But for the most part that is just for speeding up compilation and relevant particularly for larger projects |
12:43:47 | FromDiscord | <Phil> (edit) "saved" => "changed" |
12:43:48 | FromDiscord | <morlinbrot> Guess I'll have to use something like `nodemon` or similar |
12:45:16 | FromDiscord | <Phil> Apparently running commands on save is a feature being worked on in helix, huh |
12:45:21 | FromDiscord | <morlinbrot> Or better `watchexec` is what I meant |
12:46:09 | FromDiscord | <morlinbrot> Yea, I was just quite deep into that for TS/Prettier/ESLint for web dev but it's not quite there yet↵(@Phil) |
12:47:13 | FromDiscord | <morlinbrot> Also, IIRC, that wouldn't really help for actually running the program (in a terminal). I'm spoiled by Rust's cargo which has `cargo watch` - that's just super convenient! |
12:48:09 | FromDiscord | <nnsee> wait what? helix doesn't have autocmds? |
12:48:21 | FromDiscord | <nnsee> that's actually kind of a dealbreaker |
12:52:51 | FromDiscord | <rakgew> does helix have an embedded scripting language?↵( on micro I do this kind of extra logic like compile\_on\_save, nimble\_release\_on\_save with lua and a hotkeybinding ) |
12:54:05 | FromDiscord | <Phil> https://nim-lang.org/docs/nimc.html↵Here is an overview over the available modes of the compiler and its million switches |
12:56:06 | FromDiscord | <morlinbrot> sent a code paste, see https://play.nim-lang.org/#ix=html> |
12:57:04 | FromDiscord | <nnsee> In reply to @morlinbrot "Not sure if this": can you get it to run on saving the buffer? |
12:59:10 | FromDiscord | <morlinbrot> Regarding the scripting lang, they're working on it, it's going to be based on the scheme-like steel language |
13:02:18 | FromDiscord | <morlinbrot> You can configure a `codeActionsOnSave` if your LSP supports it, I'm not exactly sure what the status of that is though. For my use case of using it with ESLint it wasn't yet functional↵(@nnsee) |
13:02:47 | FromDiscord | <Elias> sent a code paste, see https://play.nim-lang.org/#ix=html> |
13:04:01 | FromDiscord | <Elias> (edit) |
13:04:24 | FromDiscord | <Phil> In reply to @Elias "Hello. Can someone": You can ditch the vars.↵These are necessary for types of parameters and for variables, not for types themselves |
13:05:26 | FromDiscord | <Phil> A field on an instance of a type (or a field on a field on that instance) is always mutable if the instance itself is mutable |
13:05:44 | FromDiscord | <Elias> Nice |
13:05:48 | FromDiscord | <Phil> So basically ` bodies: seq[Body]` |
13:06:19 | FromDiscord | <Elias> And the problem just disappeared... |
13:06:22 | FromDiscord | <Elias> thank you :)) |
13:06:32 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
13:07:33 | FromDiscord | <Elias> Huh? How does that work if the body is a "let"? |
13:07:38 | FromDiscord | <Elias> Thought var a |
13:07:56 | FromDiscord | <Phil> Because universe is a var and thus all fields inside of it are accessible (that includes all sub-fields) |
13:09:06 | FromDiscord | <Phil> If you want to keep some fields hidden, then you want to experiment with not exporting some fields.↵E.g. if you don't export the "mass" field on body, then accessing that field in a different nim module is impossible. |
13:10:25 | FromDiscord | <Elias> So making a datastructura a var recursively makes everything inside itself mutable (given that the fields are exposed or there are methods)? |
13:10:33 | FromDiscord | <Elias> (edit) "datastructura" => "datastructure" |
13:10:49 | FromDiscord | <Elias> (in a sense) |
13:11:26 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
13:13:54 | FromDiscord | <Elias> Aaaj, so the thing in the fields only dictates accessibility outside this module? |
13:13:58 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
13:14:02 | FromDiscord | <Elias> (edit) "Aaaj," => "Aaah," |
13:15:25 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
13:15:32 | FromDiscord | <Elias> (edit) "Aaah, so the thing in the fields only dictates accessibility outside this module? ... " added "(nim file)" |
13:16:13 | FromDiscord | <Elias> Ok |
13:16:27 | FromDiscord | <Elias> That is nice |
13:17:08 | FromDiscord | <Phil> (edit) |
13:17:21 | FromDiscord | <Elias> And it made a lot more sense to me now. I thought of it in a public/private sense regardless of modules because of javabrain. |
13:18:03 | FromDiscord | <Phil> Fair 😄↵The "viewscopes" here are a bit simpler than in java land.↵Something is either public or private. There is no "package private" or the like |
13:18:59 | FromDiscord | <Phil> This also has a drawback:↵If you need something to be defined in module A inside of module B, you must make it public even if other modules shouldn't have access to it.↵You can experiment with using include there, but honestly include is tricky to get right and I generally not recommend dealing with it |
13:20:38 | FromDiscord | <Elias> I see that one. But can't you get away with making a method? |
13:21:13 | FromDiscord | <Elias> (given that the something is a type) |
13:22:04 | FromDiscord | <Phil> Kind of, keep in mind any way to access thing X inside of module A is always available to everybody importing the module, not just module B |
13:23:22 | FromDiscord | <Phil> Include is an exception here because include is literally copy pasting module A into module B.↵Which means you now have all symbols defined in module A twice - one set in module A and a second set in module B.↵And both are not compatible, so using moduleB.SomeType with a proc of module A will cause the most confusing compilation errors |
13:23:58 | FromDiscord | <Phil> The only way this doesn't end in desaster is if you structure your application so nobody ever imports module A and only module B |
13:24:14 | FromDiscord | <gyatsoyt> Why don't people invent some packages for nim ? |
13:24:37 | FromDiscord | <Phil> I don't understand the question. |
13:24:51 | FromDiscord | <gyatsoyt> Umm libraries |
13:24:53 | FromDiscord | <Phil> There's plenty packages for nim, but I assume you know that so that's not what you mean. |
13:25:10 | FromDiscord | <gyatsoyt> In reply to @isofruit "There's plenty packages for": Yes there are |
13:25:13 | FromDiscord | <gyatsoyt> Plenty of them |
13:25:28 | FromDiscord | <gyatsoyt> But I mean by some specific development tools |
13:25:37 | FromDiscord | <gyatsoyt> Like yk python community is very big |
13:25:58 | FromDiscord | <gyatsoyt> So if you want to develop anything you can find packages related to your project in like no time |
13:26:19 | FromDiscord | <gyatsoyt> For ex:- imagine you want to develop a game you have pygame,tkinter etc |
13:26:23 | FromDiscord | <gyatsoyt> It's just an example |
13:26:30 | FromDiscord | <Phil> In reply to @gyatsoyt "But I mean by": nph was released recently. Nimibook as an external doc tool exists. |
13:26:46 | FromDiscord | <gyatsoyt> There are many other lesser known development area where very less people work |
13:26:47 | FromDiscord | <Phil> And there's gaming libs in nim as well as bindings to e.g. UE |
13:27:06 | FromDiscord | <gyatsoyt> In reply to @isofruit "And there's gaming libs": I was giving examples ik there are gaming libs |
13:27:12 | FromDiscord | <gyatsoyt> In nim |
13:27:21 | FromDiscord | <gyatsoyt> In reply to @isofruit "nph was released recently.": Hmm |
13:27:29 | FromDiscord | <gyatsoyt> Where can I know about this more? |
13:27:38 | FromDiscord | <Phil> But doesn't then your question more boil down to "Why does nim not have as many packages as python for all sorts of areas?" |
13:27:59 | FromDiscord | <gyatsoyt> In reply to @isofruit "But doesn't then your": Ya you can understand it like that |
13:28:05 | FromDiscord | <Phil> As neither tkinter nor pygame are devtools, they are libs |
13:28:21 | FromDiscord | <Phil> In reply to @gyatsoyt "Ya you can understand": Have you considered the orders of magnitude in size difference between the two languages 😄 ? |
13:28:27 | FromDiscord | <gyatsoyt> I am talking about libs |
13:28:33 | FromDiscord | <gyatsoyt> In reply to @isofruit "Have you considered the": Ikkk |
13:28:40 | FromDiscord | <gyatsoyt> Python is too big |
13:29:59 | FromDiscord | <Phil> It's not like there's no development. mratsim recently updated arraymancer, I'm working on ThreadButler which is a more simple way to do actor-based multithreading, beef recently got mocking down pat and I think made a package out of that, owlkettle has seen pretty decent chunks in feature and documentation scope |
13:30:45 | FromDiscord | <Phil> Those are all just examples. It just makes little sense to compare the amount of development output between nim and python.↵You wouldn't compare the output between Rust and python either |
13:30:57 | FromDiscord | <Phil> One community is a tad larger than the other |
13:34:44 | FromDiscord | <Phil> Of the top of my head the only communities that really rival python are JS and Java in terms of size |
13:35:31 | * | junaid_ joined #nim |
13:51:38 | * | junaid_ quit (Remote host closed the connection) |
14:15:35 | FromDiscord | <michaelb.eth> JS will likely always dominate in terms of community size because it’s everywhere the web is and more places besides |
14:27:50 | FromDiscord | <nnsee> I feel like Java and Python are fairly comparable |
14:37:16 | FromDiscord | <Phil> Trying to provide options for both chronicles and std/logging is.... a thing |
14:37:45 | FromDiscord | <Phil> Honestly I think I'm starting to prefer chronicles, but it feels wrong to force that choice upon users |
14:41:53 | FromDiscord | <Elias> In reply to @isofruit "Honestly I think I'm": Checked out chronicles just now. Looked nice |
14:42:21 | FromDiscord | <bigcatnova> `Error: cannot 'importc' variable at compile time; createDirectoryW` ? `os` i can't find an answer |
14:42:37 | FromDiscord | <Phil> In reply to @Elias "Checked out chronicles just": Particularly for multithreaded applications it is simply a superior choice because it↵1) Does not raise exceptions during logging unlike std/logging which can be a serious problem↵2) Includes thread id in the log messages by default |
14:43:44 | FromDiscord | <Phil> In reply to @bigcatnova "`Error: cannot 'importc' variable": Heyho, generally a more elaborate question is better since I start having to pull out my crystal ball and guess what you mean.↵I still have no idea what your issues is here, but the problem most definitely is that you're trying to do something at compile-time that uses createDirectory which is only available at runtime |
14:44:05 | FromDiscord | <Phil> So you either have a const assignment that makes a createDirectory call somewhere or a static block. |
14:44:53 | FromDiscord | <bigcatnova> In reply to @isofruit "Heyho, generally a more": i'm trying to use this: `discard existsOrCreateDir(savePath)` which works fine on my other pc but wont on this when i try to compile. |
14:45:17 | FromDiscord | <Phil> Are you calling the proc that contains this line at compileTime? |
14:45:45 | FromDiscord | <Phil> Basically a code example would help massively here |
14:47:20 | FromDiscord | <bigcatnova> sent a code paste, see https://play.nim-lang.org/#ix=html> |
14:47:46 | FromDiscord | <Phil> const is your problem there. |
14:48:03 | FromDiscord | <Phil> const leads to `getSaveDir` being called when you create the binary, not when you run the binary. |
14:48:08 | FromDiscord | <Phil> That is not possible |
14:48:13 | FromDiscord | <bigcatnova> i dont really understand the problem |
14:48:18 | FromDiscord | <bigcatnova> pretty new to nim |
14:48:25 | FromDiscord | <bigcatnova> only a few months in |
14:49:06 | FromDiscord | <Phil> Alrighty, so there's generally 2 things with compiled programs:↵You can do some computation when you create the binary, so when you turn your nim file into a binary.↵And you can do computation when somebody runs the binary, aka when you double click on it |
14:49:39 | FromDiscord | <Phil> The first is called "compileTime"↵The other is "runTime"↵If you change saveDir to "let" for example, this will work |
14:51:18 | FromDiscord | <Phil> nim has 3 words for declaring variables:↵1) let: a variable that only exists at runtime when somebody executes the binary. The variable can not be changed↵2) var: a mutable variable that only exists at runtime when somebody executes the binary.↵3) const: A compile-time variable that is immutable (there are more complicated things going on but effectively that's it) |
14:51:44 | FromDiscord | <bigcatnova> In reply to @isofruit "nim has 3 words": ohhh |
14:51:47 | FromDiscord | <bigcatnova> that really helps |
14:52:24 | FromDiscord | <Phil> by running `const saveDir = getSaveDir()` you're telling nim to do this when you create the binary.↵When you later e.g. send that binary to a user of yours and they execute that binary, the call to getSaveDir() will not happen, because it was done at compileTime aka when building the binary |
14:52:32 | FromDiscord | <bigcatnova> In reply to @isofruit "by running `const saveDir": gotcha |
14:52:46 | FromDiscord | <bigcatnova> so `let` is basically a runtime const |
14:52:49 | FromDiscord | <Phil> Yes |
14:52:53 | FromDiscord | <bigcatnova> thanks |
14:53:01 | FromDiscord | <Phil> let is equivalent to JS const if you're familiar with JS |
14:53:08 | FromDiscord | <bigcatnova> yea |
14:53:19 | FromDiscord | <Phil> JS has no equivalent to nim's const.↵And nim's "var" is equivalent to JS "let" |
14:54:59 | FromDiscord | <Elias> Tried adding chronicles to my nimble file and then this happened. Any idea what it means @Phil? https://media.discordapp.net/attachments/371759389889003532/1191031758221746296/chronicles.png?ex=65a3f5c3&is=659180c3&hm=34e0c2886b3f4ce7fa03ad2f02459d2ae7f4ca76b109cf3a07cb5d7dfd6abcdb& |
14:55:39 | FromDiscord | <Phil> In reply to @Elias "Tried adding chronicles to": I assume you installed nim from your distro instead of via choosenim? |
14:55:48 | FromDiscord | <Elias> should be choosenim |
14:55:59 | FromDiscord | <Elias> (aur I think) |
14:56:02 | FromDiscord | <Phil> Then I'm slightly confused that it's giving you nightly builds |
14:56:17 | FromDiscord | <Phil> I mean, for reference, the current stable version of nim is 2.0.2 |
14:56:32 | FromDiscord | <Phil> You sure you did choosenim stable? |
14:56:39 | FromDiscord | <Elias> further back I specifically chose nighty builds because I needed some bleeding edge feature I no longer use |
14:56:53 | FromDiscord | <Elias> long time ago |
14:56:59 | FromDiscord | <Phil> Ah, that'd explain it |
14:57:22 | FromDiscord | <Phil> You can upgrade if you want. Or at least jump to the latest stable 1.6 patch version ^^ |
14:57:46 | FromDiscord | <Phil> Otherwise debugging what is potentially a 1+ year old nightly build bug is a bit difficult ^^ |
14:58:17 | FromDiscord | <Elias> Uhum, I did not think about the nim version I was using https://media.discordapp.net/attachments/371759389889003532/1191032587435638804/mybad.png?ex=65a3f689&is=65918189&hm=f5fc9839023c84f59dba61115de86035bbbb7e2ef5aff3b61c80fcd765c27593& |
14:58:22 | FromDiscord | <Phil> Though generally this does look like a compiler error |
14:58:42 | FromDiscord | <Phil> choosenim update stable or choosenim stable update, I tend to forget the order |
14:58:56 | FromDiscord | <Elias> yup |
14:59:05 | FromDiscord | <Elias> Think that might solve it |
14:59:46 | FromDiscord | <Phil> Either that or you can check out 1.6.18, that should containg necessary bug fixes if necessary |
14:59:54 | FromDiscord | <Phil> (edit) "containg" => "contain" |
15:00:01 | FromDiscord | <Elias> I see no reasons to not stay on newest |
15:00:17 | FromDiscord | <Phil> It's not like the jump to 2.0 is massive, it mostly broke a few DB packages because a package was moved out of std into its own project |
15:01:17 | FromDiscord | <Elias> Ok. I am picking up on a project I started a good year ago or something. |
15:01:19 | FromDiscord | <Elias> What |
15:01:50 | FromDiscord | <Elias> https://media.discordapp.net/attachments/371759389889003532/1191033477462761583/build_failed.png?ex=65a3f75d&is=6591825d&hm=bf8e2112e058ec45c508c8130ba7764886a94bde0d9cc1a54141a776b3e42275& |
15:02:05 | FromDiscord | <Elias> Litterally same error |
15:02:11 | FromDiscord | <Phil> I am still surprised its giving you nightlies |
15:02:15 | FromDiscord | <Phil> Mind sharing your nimble file? |
15:04:00 | FromDiscord | <Elias> sent a code paste, see https://play.nim-lang.org/#ix=html> |
15:04:26 | FromDiscord | <Phil> And this is blowing up on nimble install? |
15:04:36 | FromDiscord | <Phil> And only with the addition of chronicles in the requires? |
15:04:40 | FromDiscord | <Elias> nimble ruin |
15:04:46 | FromDiscord | <Elias> (edit) "ruin" => "run" |
15:05:09 | FromDiscord | <Elias> In reply to @isofruit "And only with the": yes |
15:05:18 | FromDiscord | <Elias> and importing it several places |
15:07:41 | FromDiscord | <Phil> Iiiiiii do not follow how that one popped up |
15:07:55 | FromDiscord | <Elias> mystery |
15:08:14 | FromDiscord | <Phil> Trying to wrap my head around it how a specific usage of chronicles could possibly blow up the compiler, but without a minimal example that blows up I don't think I can say anything about this |
15:08:37 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
15:08:47 | FromDiscord | <Elias> I'll try removing it to check I have not done something |
15:08:51 | Amun-Ra | (can'tsee the nimble file) but… do you have something custom in nim.cfg in .config/nim/ or anywhere along the path? |
15:09:56 | FromDiscord | <Phil> For Amun-Ra in the hopes that IRC does at least get images https://media.discordapp.net/attachments/371759389889003532/1191035516183904327/image.png?ex=65a3f943&is=65918443&hm=933a96dea21c6a7e55978c28af1906bc00f323bcccc411561402a6707bfb14a8& |
15:10:17 | Amun-Ra | yes, images work |
15:10:44 | Amun-Ra | hmm |
15:12:40 | FromDiscord | <Elias> In reply to @Amun-Ra "(can'tsee the nimble file)": have some flags in a (project) nim.cfg, but not user-wide |
15:13:14 | FromDiscord | <Elias> https://media.discordapp.net/attachments/371759389889003532/1191036347645956260/flags.png?ex=65a3fa09&is=65918509&hm=fda3023e93584eb5847f3512e3b421e61b7a53325048d6fc7641aae6962cf220& |
15:13:15 | Amun-Ra | I'd try to comment as much code as possible and retry run, then move forward with uncommenting and see when this errors starts to appear |
15:13:38 | FromDiscord | <Phil> Basically: Figure out a minimal example ^^ |
15:14:01 | Amun-Ra | I found another koch error yesterday that way (js target, iterators returned by a proc) |
15:14:54 | Amun-Ra | I haven't filed a bug report yet |
15:15:02 | FromDiscord | <Elias> In reply to @Amun-Ra "I'd try to comment": The error literally went away from commenting out in nimble file and all imports (havent started using it yet) |
15:15:42 | FromDiscord | <Elias> In reply to @isofruit "Basically: Figure out a": Will do |
15:15:50 | Amun-Ra | try to comment the actual code |
15:18:47 | * | lucasta joined #nim |
15:19:02 | FromDiscord | <Elias> Can you give me a quick reminder on how to compile single files?↵`nim -o potato -c a.nim` did not work |
15:19:23 | Amun-Ra | nim c single/file.nim? |
15:19:39 | FromDiscord | <Elias> thanks |
15:20:05 | Amun-Ra | you can use 'nim check' also |
15:20:22 | FromDiscord | <Elias> sent a long message, see <!doctype html> |
15:20:36 | Amun-Ra | I'm not sure whether it'll trigger the error like 'c' |
15:23:48 | FromDiscord | <Elias> For some reason it just works now |
15:24:06 | Amun-Ra | what changed? |
15:24:18 | Amun-Ra | (we don't see long messages on irc, too) |
15:24:54 | FromDiscord | <Elias> First tried adding chronicles to my nimble file again and importing into main file and debugging "potato". Just works |
15:25:16 | FromDiscord | <Elias> No idea why. Have not altered toolchain version or anything |
15:25:46 | Amun-Ra | sometimes recompiling all the files by adding -f helps |
15:25:58 | FromDiscord | <Elias> Will remember that one |
15:27:01 | Amun-Ra | (-f, --forceBuild:on|off force rebuilding of all modules) |
15:27:51 | FromDiscord | <Elias> But, one thing I never really got. When configuring a logger, how do I use it project wide? Just import the package in all modules requiring logging and it bears reference to the same logging module configured in the root module of the project? |
15:28:25 | Amun-Ra | yes |
15:28:41 | FromDiscord | <Elias> Nice, then I don't think any more about it |
15:28:43 | Amun-Ra | you only initialize a logger in your "main" |
15:29:05 | Amun-Ra | and just call log procs anywhere else |
15:32:55 | FromDiscord | <Phil> std/logging is in fact a tad more tedious in how you need to define your logger there |
15:33:24 | FromDiscord | <Phil> First instantiate it, then add it to a global handler, and that logger only is available for that one thread |
15:33:36 | FromDiscord | <Phil> (edit) "First instantiate it, then add it to a global handler, and that logger only is available for that one thread ... " added "where you added the handler" |
15:40:34 | * | derpydoo joined #nim |
15:40:35 | FromDiscord | <asviest> Do you think this colors is looks okay ? https://media.discordapp.net/attachments/371759389889003532/1191043230809202758/nir_playing.png?ex=65a40072&is=65918b72&hm=6eb5312617099864c6bc72762b143cf46e7216ff8dfe421f584aa6a516fb347b& |
15:41:34 | FromDiscord | <Phil> Not for me personally, I find the colors used are too easy to gloss over |
15:45:54 | Amun-Ra | that font resembles me old terminals |
15:46:36 | * | disso-peach joined #nim |
15:50:25 | FromDiscord | <asviest> It's a cool retro term console with Terminus font |
15:57:38 | Amun-Ra | I was going to say this has cool-retro-term vibes |
16:18:14 | FromDiscord | <Phil> I think I might just give up on providing options for both chronicles and std/logging.↵The question now more becomes if threadbutler uses entirely std/logging or chronicles |
16:18:43 | FromDiscord | <odexine> In reply to @isofruit "I think I might": Why on the give up decision? |
16:21:15 | FromDiscord | <Phil> Chronicles relies on a static string statement followed by assignment NimNodes because under the hood their "logging procs" are templates that ultimately call a macro that transforms those assignments↵↵Either I cut down chronicles to the capabilities of std/logging, which means no assignments, then I'm stuck with static string and thus can't have runtime values in logging statements.↵Or I know provide a similar wrapper for std/logging |
16:21:26 | FromDiscord | <Phil> (edit) "similar wrapper" => "similartemplate/macro syntax" |
16:21:31 | FromDiscord | <Phil> (edit) "know" => "now" |
16:30:44 | FromDiscord | <Elias> How exactly do I set these configurations @Phil? Is it just a global variable or something? I want to try out textblocks https://media.discordapp.net/attachments/371759389889003532/1191055854905086062/chronicles.png?ex=65a40c34&is=65919734&hm=f24014d2a091be75100d9973ab009914b3b0166a6d8dfd1e34b21bfc632743e8& |
16:33:35 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
16:34:17 | FromDiscord | <Phil> -d == --define for flags btw.↵It's a way to define variable values from the CLI and allow for fairly flexible compiler-flags |
16:34:47 | FromDiscord | <Phil> We use that mechanism e.g. in owlkettle to compile in/out various widgets that are only available for certain adwaita versions |
16:46:04 | FromDiscord | <Elias> In reply to @isofruit "We use that mechanism": Aj, thank you. So a -d flag is essentially the same as a -D flag for C compilers? |
16:46:11 | FromDiscord | <Elias> (edit) "Aj," => "Ah," |
16:46:17 | FromDiscord | <Phil> No clue, don't know C |
16:46:20 | FromDiscord | <Elias> Ok |
16:53:27 | FromDiscord | <Elias> This did it btw: `-d:"chronicles_sinks=textblocks[stdout]"` added it to my nim.cfg file |
16:57:58 | FromDiscord | <scipio_nl> https://media.discordapp.net/attachments/371759389889003532/1191062706124496916/image.png?ex=65a41296&is=65919d96&hm=b9558039e81545b06eeb28427e644e572a07590a05fcedea411d4eda70013a3f& |
16:58:23 | FromDiscord | <scipio_nl> Wouldn't it be an idea to be more active on Twitter? Even v2.0 hasn't been announced |
16:58:31 | FromDiscord | <scipio_nl> There is also "Twitter Communities" now |
16:59:36 | FromDiscord | <scipio_nl> https://media.discordapp.net/attachments/371759389889003532/1191063116759433377/image.png?ex=65a412f7&is=65919df7&hm=e3cb13a5146ce23abbd4e4c0a08b5020d6b2d6107384156a2fd5e46fc0b49465& |
17:05:11 | * | flouer joined #nim |
17:06:57 | FromDiscord | <Phil> In reply to @scipio_nl "Wouldn't it be an": I'll check the status of that with the others. |
17:10:08 | FromDiscord | <scipio_nl> Who's managing the Twitter account? |
17:10:13 | FromDiscord | <scipio_nl> @Phil |
17:10:36 | FromDiscord | <Phil> That is a general mess of a situation that I won't go deeper into |
17:11:13 | FromDiscord | <Phil> Nothing dramatic, just a bit of "who has what" going on |
17:11:53 | * | flouer quit (Quit: Leaving) |
17:12:15 | * | flouer joined #nim |
17:12:15 | * | flouer quit (Client Quit) |
17:12:25 | * | flouer_ joined #nim |
17:14:14 | FromDiscord | <bigcatnova> what is recommended for basic string formatting? |
17:14:16 | * | lucasta quit (Quit: Leaving) |
17:14:30 | FromDiscord | <bigcatnova> (edit) "what is recommended for basic string formatting? ... " added "`ex. fmt`" |
17:15:29 | FromDiscord | <Phil> Honestly I use fmt most of the time because it reminds me of python f-strings |
17:16:35 | FromDiscord | <Phil> others use `&"{myvar} sometext"` because its shorter |
17:16:47 | FromDiscord | <Phil> The differences there are nuanced enough to not matter |
17:25:27 | Amun-Ra | I usually do not use &/fmt because of {.push raises: [].} at the beginning of every file |
17:25:54 | FromDiscord | <scipio_nl> In reply to @isofruit "That is a general": There is so much more we can do with that. I've befriended Carson Gross via Twitter/Discord for example - HTMX. He built up an immense following and awareness, including on Github from there |
17:27:38 | FromDiscord | <scipio_nl> There's also "influencers" like thePrimeagen who tweet about tech and stream on Twitch etc... Brings massive attention |
17:27:57 | FromDiscord | <scipio_nl> https://media.discordapp.net/attachments/371759389889003532/1191070249697693957/image.png?ex=65a4199c&is=6591a49c&hm=4a3b2127bcb6789d11a59de1315f0ac1db82a510cc36ac00e0d301839476bf1b& |
17:28:20 | FromDiscord | <Prestige> I think that dude hates Nim lol |
17:28:21 | FromDiscord | <scipio_nl> ^^ he actually did bring on Nim in one stream or so |
17:29:23 | FromDiscord | <scipio_nl> Well via him and others OCaml got quite a lot of attention and new devs trying it out |
17:29:31 | FromDiscord | <scipio_nl> In reply to @avahe "I think that dude": I dont think so, why? |
17:29:56 | FromDiscord | <Phil> In reply to @scipio_nl "There is so much": I mean, I'm aware. But you're also dealing with limited resources asking people to run it in their spare time. |
17:30:00 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "Wouldn't it be an": Honestly I'd prefer Nim on Mastodon, then using a bot to tweet Mastodon posts on Twitter |
17:30:26 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "The differences there are": Escape characters don't work with `fmt` which is unfortunate |
17:31:08 | FromDiscord | <scipio_nl> In reply to @isofruit "I mean, I'm aware.": That is no different for other projects |
17:31:52 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=html> |
17:32:15 | FromDiscord | <user2m> (edit) |
17:32:21 | FromDiscord | <Phil> In reply to @scipio_nl "That is no different": That's cool for the other projects that they found people to sacrifice their spare time for it. |
17:33:40 | FromDiscord | <Phil> You won't find me disagreeing with you about the utility of it for the record.↵There just right now is not a person behind it and nobody that sees themselves in the role of doing nim PR |
17:33:48 | FromDiscord | <scipio_nl> No need to get uptight. It's obvious a sensitive topic |
17:33:58 | FromDiscord | <huantian> In reply to @user2m "anyone know why this": You need to explicitly make your anonymous proc a closure with the closure pragma |
17:34:07 | FromDiscord | <huantian> Idk why it doesn’t automatically convert it here |
17:34:22 | FromDiscord | <scipio_nl> In reply to @isofruit "You won't find me": I might. |
17:34:45 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=html> |
17:34:49 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "Escape characters don't work": thats what `&"yourstring"` is for |
17:34:56 | FromDiscord | <sOkam! 🫐> (edit) "`&"yourstring"`" => "`&"yourstring\n"`" |
17:35:02 | FromDiscord | <Robyn [She/Her]> I know, that's why I use `&` instead |
17:35:20 | FromDiscord | <huantian> In reply to @user2m "tried that as well": Uh huhhhh right man I can’t remember what I did to fix this |
17:35:23 | FromDiscord | <Robyn [She/Her]> Phil said the differences mostly don't matter, but they do :P |
17:35:36 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=html> |
17:35:42 | FromDiscord | <Phil> I still stand by that they mostly don't matter 😛 |
17:35:57 | FromDiscord | <huantian> Maybe this is a different issue then, not the one I was thinking about |
17:36:10 | FromDiscord | <scipio_nl> In reply to @isofruit "You won't find me": The main crux is probably that Nim isn't being run as a corporation with healthy business models. |
17:36:19 | FromDiscord | <user2m> (edit) |
17:36:35 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "Phil said the differences": ah sry↵i was commenting on the "unfortunate", since fmt accepting escape characters would make escape character impossible to pass to a string that is meant to endup in a file, for example |
17:36:51 | FromDiscord | <user2m> (edit) |
17:37:01 | FromDiscord | <sOkam! 🫐> so "unfortunate" is more like "my compiler would not work at all, so definitely fortunate 100%" type of thing 🙈 |
17:37:06 | FromDiscord | <Robyn [She/Her]> That's fine dw haha |
17:38:32 | FromDiscord | <scipio_nl> I stumbled onto Nim close to 2 years ago, took some distance because of being in doubt how "the complex situation" would influence my own investments in it, in terms of ROI. But I absolutely love it and am still figuring out what exactly is causing the mess. |
17:39:35 | FromDiscord | <scipio_nl> In reply to @chronos.vitaqua "Escape characters don't work": I mean, issues like these ... I'm sure this would get addressed in Rust with their 2-week release cycle. @Phil |
17:40:21 | FromDiscord | <scipio_nl> There's a business cycle involved with OSS languages: if there's not enough momentum with devs, there are no jobs, and if there are no jobs why would devs commit to it. |
17:40:22 | FromDiscord | <huantian> It probably wouldn’t since it would break backwards compat lol |
17:40:25 | FromDiscord | <sOkam! 🫐> In reply to @scipio_nl "I mean, issues like": that is not an issue. that is a feature. how is "fmt" being different than "&" for different usecases an "issue"? |
17:40:34 | FromDiscord | <sOkam! 🫐> or am i missing the point? |
17:41:23 | FromDiscord | <scipio_nl> You are missing the point yes, if @Chronos [She/Her] calls it "unfortunate" and you call it a "feature" then there's a discussion about it to be had. Leaving that unaddressed is not a healthy sign. |
17:42:02 | FromDiscord | <sOkam! 🫐> the unaddressed sign is a misunderstanding of its use |
17:42:18 | FromDiscord | <sOkam! 🫐> which is documented in the manual |
17:43:16 | FromDiscord | <scipio_nl> No, a misunderstanding is that you _assume_ that people know exactly where to look for something they might not even know it's an issue to look into. |
17:44:34 | FromDiscord | <sOkam! 🫐> @scipio_nl literal first thing described in the manual https://media.discordapp.net/attachments/371759389889003532/1191074434166034432/image.png?ex=65a41d82&is=6591a882&hm=583fbf5398aa55b90e8b9596d05ec2cc6ff58ffa937ab563a0d750f95029a767& |
17:44:55 | FromDiscord | <scipio_nl> So you're basically suggesting @Chronos [She/Her] needs to read better? |
17:44:56 | FromDiscord | <sOkam! 🫐> if you want to find holes making the nim ship sink... take a poke at tooling, which is a real big issue↵or at finding out why nim is being picked as a "toy" language, not a real one |
17:45:09 | FromDiscord | <scipio_nl> I mean, she calls it "unfortunate" but in essence you blame her for not reading? |
17:45:53 | FromDiscord | <scipio_nl> Save me some time, why is Nim called a Toy Language then? |
17:46:07 | FromDiscord | <sOkam! 🫐> In reply to @scipio_nl "I mean, she calls": im just saying that you are looking at a tiny micro issue and trying to shine a light on how that reflects the state of the lang... but that issue is solved in the very manual and other issues are unmanaged for years |
17:46:17 | FromDiscord | <sOkam! 🫐> In reply to @scipio_nl "Save me some time,": that's what I would love to know too |
17:46:40 | FromDiscord | <sOkam! 🫐> why is the ecosystem so full of dead abandoned libraries, made by people in a weekend/week and forgotten |
17:46:55 | FromDiscord | <sOkam! 🫐> I would really love to know what happens with retention there |
17:47:39 | FromDiscord | <sOkam! 🫐> i'm not a marketing guy, so I woudn't be able to know |
17:47:44 | FromDiscord | <scipio_nl> That is what I have been addressing from the getgo myself, yes |
17:47:49 | FromDiscord | <scipio_nl> In reply to @heysokam "i'm not a marketing": I am |
17:48:47 | FromDiscord | <scipio_nl> Well, I am an M.Sc. in "Industrial Management" which includes that. And a self-taught programmer, serial-entrepreneur in tech. Mostly having managed devs, but moving more towards the engineering parts now. |
17:49:19 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "I mean, issues like": It's intentional behaviour, just slightly annoying when I first came from Python |
17:49:26 | FromDiscord | <Robyn [She/Her]> Nim isn't Python though, so it's fine |
17:50:07 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "if you want to": Yeah tooling is the biggest issue that needs to be solved |
17:50:29 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "So you're basically suggesting": Tbf, I do, but it's not an issue so dw aha |
17:51:02 | FromDiscord | <sOkam! 🫐> sent a long message, see <!doctype html> |
17:51:16 | FromDiscord | <sOkam! 🫐> (edit) |
17:51:56 | FromDiscord | <sOkam! 🫐> all those things have been argued for the image of nim... but there must be something else happening |
17:52:08 | FromDiscord | <scipio_nl> The abandoned repos is a huge issue. |
17:52:12 | FromDiscord | <sOkam! 🫐> because in isolation you could take a pick at them, but in full context they really fall apart |
17:52:34 | FromDiscord | <sOkam! 🫐> In reply to @scipio_nl "The abandoned repos is": > The abandoned repos is a huge <symptom>↵ftfy |
17:52:54 | FromDiscord | <sOkam! 🫐> its a symptom of an underlying issue that is not being solved |
17:52:58 | FromDiscord | <scipio_nl> But in all fairness @Phil when on Twitter nobody takes the time to f%^&cking announce v2 in a f^&(cking tweet, then what do you expect about being called a toy language? |
17:53:05 | FromDiscord | <sOkam! 🫐> what is the issue there? that's what I would love to know |
17:53:20 | FromDiscord | <scipio_nl> https://media.discordapp.net/attachments/371759389889003532/1191076641041031278/image.png?ex=65a41f90&is=6591aa90&hm=a8dc922d4cbd0195d8c4679d7fe6b9cebe8efc1841e112b2808642138dc481b1& |
17:53:23 | FromDiscord | <scipio_nl> This cannot be real |
17:53:44 | FromDiscord | <scipio_nl> I think I even tweeted about that some time ago |
17:53:53 | FromDiscord | <sOkam! 🫐> In reply to @scipio_nl "But in all fairness": this is a very fair argument. nim's marketing is beyond lacking |
17:54:01 | FromDiscord | <scipio_nl> Including DM;ing the primeagen or tsoding or both, I forgot |
17:55:09 | FromDiscord | <Phil> In reply to @scipio_nl "But in all fairness": I expect nothing.↵I am a dude that sacrifices spare time to also look over the discord because there were a lot of bots at the time.↵I am poking at whether something can be done about the twitter situation.↵I'm not going to become a key organizer, that's not in the cards, I don't have that kind of time as a working adult. |
17:55:24 | FromDiscord | <tomexmachina> In reply to @scipio_nl "The abandoned repos is": I actually just popped in to ask if I should stay away from whats his name who got banned's repos |
17:55:45 | FromDiscord | <scipio_nl> In reply to @heysokam "this is a very": I _also_ have to be honest here: the Nim community in here is fucking world class: this feels like home. The way answers in here are being given split second by for example @Phil and @ElegantBeef is not seen anywhere else. That is something to put into the spotlights. |
17:55:57 | FromDiscord | <sOkam! 🫐> 10000% |
17:55:59 | FromDiscord | <sOkam! 🫐> agreed |
17:56:09 | NimEventer | New thread by freeflow: Reinstallation woes, see https://forum.nim-lang.org/t/10820 |
17:56:41 | FromDiscord | <Phil> In reply to @tomexmachina "I actually just popped": Honestly depends.↵If they're still doing work on it, why not?↵Personally I don't, but that is because I generally keep my dependencies low if I can |
17:56:43 | FromDiscord | <tomexmachina> In reply to @tomexmachina "I actually just popped": dom96 repos that is |
17:56:57 | FromDiscord | <Phil> In reply to @tomexmachina "dom96 repos that is": Oh I though disruptek xD |
17:57:27 | FromDiscord | <tomexmachina> was just browsing through nimble (it's been a while), and I haven't used 2.0 yet |
17:57:48 | FromDiscord | <Phil> In that case depends on the repo I think.↵His webdriver isn't really an all that complicated project.↵Jester is, but I'm not sure how much development that's seeing |
17:58:08 | FromDiscord | <scipio_nl> What is wrong with Dom96? I'm re-reading Dominik's book this weekend and I like it a lot, it's filled with positive energy too |
17:58:09 | FromDiscord | <Phil> And I'm really not aware of other big projects of his that are in his hand |
17:58:23 | FromDiscord | <Phil> In reply to @scipio_nl "What is wrong with": The stuff he wrote is alright, he's just no longer active |
17:58:39 | FromDiscord | <systemonia> We can replace Httpbeast with httpx, right? |
17:58:44 | FromDiscord | <scipio_nl> He is in my Discord friend list somewhere, Dom |
17:58:44 | FromDiscord | <systemonia> or std/asynchttpserver |
17:59:28 | FromDiscord | <Phil> Prologue uses those so yeah.↵HappyX also uses jester under the hood I think (no guarantees!) and their developer is absolutely crazy productive |
17:59:47 | FromDiscord | <tomexmachina> In reply to @isofruit "The stuff he wrote": specifically, I was looking for GUI libs. I think he made one though I could be misremembering |
18:00:02 | FromDiscord | <systemonia> No it uses asynchttpserver by default |
18:00:08 | FromDiscord | <scipio_nl> In reply to @isofruit "I expect nothing. I": That is a matter of organization and from there on, funding. Nobody expects any volunteer to do more more more. |
18:00:21 | FromDiscord | <scipio_nl> But as "organization" is _has to be expected_ |
18:00:52 | FromDiscord | <scipio_nl> If Nim can't even commit to proper communication and organization, then why would any (new) dev be expected to commit to Nim? |
18:00:53 | FromDiscord | <Phil> In reply to @tomexmachina "specifically, I was looking": Huh, I'm really not aware of one. |
18:00:55 | FromDiscord | <scipio_nl> ☝️ |
18:01:14 | FromDiscord | <tomexmachina> In reply to @isofruit "Huh, I'm really not": yeah, I was misremembering. It was nimx I was thinking of |
18:01:50 | FromDiscord | <sOkam! 🫐> In reply to @scipio_nl "What is wrong with": I don't keep up, and im not interested in, the drama of anything. But my far-away-distanced skewed perception was that somebody got mad, and there was bad energy thrown around.↵By whom or in which way I couldn't care less. But that might give some perspective |
18:03:40 | FromDiscord | <tomexmachina> In reply to @heysokam "I don't keep up,": idk what it was all about, though via context clues it sounded perhaps political. idc. Engineering transcends such things for me but if he doesn't want to use the lang anymore over it, so be it. the code will go on. |
18:04:17 | FromDiscord | <scipio_nl> In reply to @heysokam "I don't keep up,": But does what I wrote alreadty answer your question about why it;s being called a toy language? I dont think it's about language technicals, but more about (lack of) organization |
18:04:35 | FromDiscord | <scipio_nl> (edit) "alreadty" => "already" | " it;s" => "it's" | "dont" => "don't" | "organization" => "organization." |
18:05:43 | FromDiscord | <scipio_nl> Right now in here there are 619 users "online", which is not "nothing". It has potential even. But usually the same ~10 people are chatting in here. |
18:05:47 | FromDiscord | <sOkam! 🫐> sent a long message, see <!doctype html> |
18:05:54 | FromDiscord | <tomexmachina> In reply to @scipio_nl "But does what I": I think bad marketing might have something to do with it. You need to get the youtubers hooked |
18:06:36 | FromDiscord | <scipio_nl> In reply to @heysokam "if `gooey` by beef,": LOL Beef recommended Owlkettle to me just 2 days ago |
18:06:52 | FromDiscord | <sOkam! 🫐> In reply to @scipio_nl "But does what I": you mean because of the organizational weakness? yeah that could explain quite a lot |
18:07:27 | FromDiscord | <tomexmachina> In reply to @tomexmachina "I think bad marketing": which probably means nim coders being guests on streams. Some nim veteran should ping theprimagen |
18:08:30 | FromDiscord | <sOkam! 🫐> In reply to @scipio_nl "Right now in here": yep, the retention problem is big. ive been a regular for a while, and most of what you see is people that come and go |
18:09:14 | FromDiscord | <tomexmachina> In reply to @heysokam "yep, the retention problem": I am guilty of this behavior. To answer why, idk. I'll have to think about it. |
18:09:36 | FromDiscord | <scipio_nl> I mentioned this ( https://www.youtube.com/watch?v=rC4FCS-oMpg ) already yesterday, MakePad (Rust), by my friend Rik Arends. Here on RustNL. But apparently Nim couldn't find energy to organize a _virtual conference_ in 2023? |
18:10:27 | FromDiscord | <sOkam! 🫐> In reply to @tomexmachina "I am guilty of": yeah, that's what I'm trying to bring a point on. whatever its causing this, its causing everything |
18:10:36 | FromDiscord | <sOkam! 🫐> including the state of the ecosystem |
18:11:35 | FromDiscord | <tomexmachina> In reply to @heysokam "including the state of": is there a website for searching nimble? |
18:11:40 | FromDiscord | <sOkam! 🫐> scipio point on the leadership+marketing strategy could be the best answer i've seen so far↵if you look at zig, the fastest growing lang i've seen in my life... this very thing is their biggest damn strength |
18:11:53 | FromDiscord | <scipio_nl> In reply to @heysokam "yep, the retention problem": The 619 people in there - including myself - chose to STAY there. I've been in here for a full year (I expected longer) but went away for a bit. But we didn't leave the server. There is still potential |
18:12:03 | FromDiscord | <sOkam! 🫐> In reply to @tomexmachina "is there a website": there is the nimble directory, but there are a ton more packages that don't even reach nimble |
18:12:33 | FromDiscord | <Phil> In reply to @tomexmachina "is there a website": nimble.directory |
18:12:46 | FromDiscord | <scipio_nl> In reply to @isofruit "nimble.directory": Did you have to google that? 😉 |
18:12:58 | FromDiscord | <sOkam! 🫐> i would have had to lol |
18:13:05 | FromDiscord | <sOkam! 🫐> (edit) "lol" => "lol. haha" |
18:13:13 | FromDiscord | <Phil> In reply to @scipio_nl "Did you have to": Nope, funny thing is I don't even use it as `nimble search <pkgname>` is faster and more convenient 😛 |
18:13:17 | FromDiscord | <tomexmachina> https://nimble.directory <-- should be on front-page of nim-lang.org |
18:13:54 | FromDiscord | <sOkam! 🫐> In reply to @tomexmachina "https://nimble.directory <-- should be": should be part of the nim website itself, if we are completely fair |
18:13:58 | FromDiscord | <tomexmachina> my biz partner is always talking about fathomability, which annoys the crap out of me but he's not wrong |
18:14:04 | FromDiscord | <scipio_nl> Okay okay, but compare that to https://crates.io/ |
18:14:13 | FromDiscord | <sOkam! 🫐> true, fair point |
18:14:16 | NimEventer | New thread by ASVI: Why Nim allowing asm stmt at js ? , see https://forum.nim-lang.org/t/10821 |
18:14:47 | FromDiscord | <scipio_nl> In reply to @tomexmachina "https://nimble.directory <-- should be": And not a book Mastering Nim you can't even download a pirated copy because it's not digital. |
18:15:03 | FromDiscord | <scipio_nl> What is the goal there? To sell books? Or to have a language that thrives? |
18:15:16 | FromDiscord | <tomexmachina> I think youtube is more effective than books |
18:15:28 | FromDiscord | <scipio_nl> Bill Gates knew damn well every illegal Windows copy would become a paying customer at some point left or right |
18:16:30 | FromDiscord | <tomexmachina> another thing would be cool trending projects on github |
18:16:55 | FromDiscord | <tomexmachina> recent LLM stuff provides an avenue to making that happen with relatively low effort |
18:17:15 | FromDiscord | <sOkam! 🫐> @scipio_nl you seem comfortable with marketing ideas in general↵please consider making an [RFC] for this topic so an actionable conversation could start within the leadership |
18:17:33 | FromDiscord | <sOkam! 🫐> im not convinced they hang around here in #main all that much |
18:17:59 | FromDiscord | <Phil> In reply to @heysokam "im not convinced they": I can confirm this statement |
18:18:03 | FromDiscord | <tomexmachina> speaking of LLMs, what do we have in the way of running transformers? |
18:18:12 | FromDiscord | <sOkam! 🫐> In reply to @tomexmachina "another thing would be": `bun` made a big impact for the growth of zig |
18:18:15 | FromDiscord | <sOkam! 🫐> for sure |
18:18:48 | FromDiscord | <sOkam! 🫐> but its not the only reason. that's just a sidekick to their stellar marketing and leadership presence |
18:19:03 | FromDiscord | <Phil> And I'd state RFC + a forum topic bringing up the RFC to make sure it reaches both those looking in the nim repo of the RFC and regular forum users |
18:20:12 | FromDiscord | <tomexmachina> https://github.com/sinkingsugar/nimtorch this is sad |
18:20:57 | FromDiscord | <scipio_nl> In reply to @heysokam "<@376004371256836096> you seem comfortable": At this specific moment I am by far too much Nim N00b for that discussion in terms of language technicalities. But in terms of entrepreneurship, communication, marketing, "BizDev", social networking... Sure.↵↵But the main gist is the lack of a Nim Foundation. |
18:21:08 | FromDiscord | <scipio_nl> https://media.discordapp.net/attachments/371759389889003532/1191083635860832397/image.png?ex=65a42614&is=6591b114&hm=8df5ec1db78c894deb45d109c5ec4b7596c9dce6bd2e8c1c231758f29cf0d01e& |
18:21:11 | FromDiscord | <scipio_nl> there you have what is missing |
18:21:20 | FromDiscord | <scipio_nl> Perfect tag line too |
18:21:30 | FromDiscord | <scipio_nl> Foundation, working groups, not a one man show. |
18:21:33 | FromDiscord | <sOkam! 🫐> In reply to @scipio_nl "At this specific moment": you bringing up these ideas in a well written form would be more than what anyone else here can do |
18:21:41 | FromDiscord | <sOkam! 🫐> even if you lack the depth of understanding |
18:22:05 | FromDiscord | <tomexmachina> Nim Foundation. Just jack the whole thing. It will work even better for seeming to jack it |
18:22:25 | FromDiscord | <sOkam! 🫐> Zig has a foundation too |
18:22:32 | FromDiscord | <tomexmachina> exactly |
18:22:59 | FromDiscord | <scipio_nl> Good software is built by happy, well supported people↵↵☝️ It really as simple as that. |
18:23:36 | FromDiscord | <scipio_nl> That's why Nim is being called a toy language @sOkam! 🫐 , I can't explain it simpler. Well, I can, that is what I seem to be good at 😁 |
18:23:42 | FromDiscord | <sOkam! 🫐> `simple != easy`, but yes pretty much 🙂 |
18:26:14 | FromDiscord | <sOkam! 🫐> In reply to @scipio_nl "That's why Nim is": it does seem to check out↵vala, which is similar to a lang im making, does not have this leadership infrastructure either... and one could argue they get the same "toy language" feel from outsiders |
18:27:13 | FromDiscord | <sOkam! 🫐> it seems that having that infrastructure in place gives a topic a subconciously more trustworthy perspective |
18:27:47 | FromDiscord | <scipio_nl> In reply to @heysokam "you bringing up these": A well written document also requires research. An hour ago we almost got into a quarrel on how/where escaping was a feature or a bug in the fmt macro. Imagine how I'd make @_araq feel who's been at Nim since 2005 when some dude from The Netherlands who hasn't yet fully read his pirated copy of "Nim in Action" telling him how to properly run the show. |
18:27:59 | FromDiscord | <sOkam! 🫐> it also happened to me with sports leadership (i used to be a high perf coach)↵ill keep the thought around, it seems to explain quite a lot from quite a lot of perspectives |
18:28:53 | FromDiscord | <tomexmachina> There are some other avenues as well. Invading other languages' packge repos is another. For instance, there's a python package I think is about to blow up called Socketify, which I have started using. |
18:30:00 | FromDiscord | <sOkam! 🫐> In reply to @tomexmachina "There are some other": but what if you reach 1_000_000 people, and the retention is horrid↵you would still be at the same spot you are right now, or even worse because you ruined a lot of your reputation |
18:30:10 | FromDiscord | <scipio_nl> In reply to @heysokam "it also happened to": It is very interesting tho why we are all this passionate about Nim succeeding. Can you answer me from the opposite direction why you are passionate about Nim? |
18:30:15 | FromDiscord | <sOkam! 🫐> i don't think the problem is reach per-se. I think its more about the retention |
18:30:35 | FromDiscord | <sOkam! 🫐> In reply to @scipio_nl "It is very interesting": from the opposite direction? |
18:30:56 | FromDiscord | <scipio_nl> Toy language, other direction: why do you love Nim? |
18:31:10 | FromDiscord | <tomexmachina> In reply to @scipio_nl "A well written document": I think retention is largely a dependency issue. If socketify was wrapping a Nim package, I'd be retained. |
18:31:14 | FromDiscord | <scipio_nl> What is GOOOOOD about it? |
18:32:01 | FromDiscord | <scipio_nl> What makes all of you stick to Nim dispite all abandoned repos, lacking tooling, zero jobs, no organization, and worst of all being alled a toy language? 😉 |
18:32:18 | FromDiscord | <scipio_nl> (edit) "alled" => "called" |
18:33:24 | FromDiscord | <user2m> In reply to @scipio_nl "What makes all of": 😂 |
18:33:33 | FromDiscord | <systemonia> In reply to @scipio_nl "What makes all of": Because its fun to program in. |
18:33:41 | FromDiscord | <tomexmachina> In reply to @scipio_nl "What makes all of": I don't rly stick to it. I come back to it when I want a lot of performance out of less lines of code and fun to write. |
18:34:13 | FromDiscord | <sOkam! 🫐> In reply to @scipio_nl "Toy language, other direction:": systems lang, easy as F to use, easy as F to prototype with, the design decisions make a crap ton of sense, performance is top of the line, best metaprogramming in the industry |
18:34:16 | FromDiscord | <tomexmachina> and idk why I don't stick to it more. I haven't figured that out yet. |
18:34:16 | FromDiscord | <sOkam! 🫐> for me that makes it a perfect replacement for tasks where C and manual memory management is overkill↵as a more general opinion _(im biased towards manually managed code for irrelevant reasons)_ I think Nim is the perfect replacement for C, if you don't care about staying in nim↵zig is a bit better for keeping zig in the sidelines of C, but the difference is minimal |
18:34:28 | FromDiscord | <systemonia> Writing in Nim is an actually enjoyable experience unlike writing in C where everything could spontaneously combust. Thats why I like Nim. |
18:34:50 | FromDiscord | <sOkam! 🫐> yeah strict typing is definitely another big one |
18:35:03 | FromDiscord | <user2m> In reply to @scipio_nl "What makes all of": honestly the developer prodcutivity in nim is imo unmatched. I used to be very python heavy then before I knew it I was doing everything in nim, planning on releasing a yt series soon called "Nim for solo devs" nim just makes it easy to get very far very fast |
18:35:08 | FromDiscord | <Phil> In reply to @scipio_nl "What makes all of": It is accessible in a way no other low level programming language is to me, particularly on the lower level stuff |
18:35:52 | FromDiscord | <sOkam! 🫐> 👆 +100 on that |
18:36:16 | FromDiscord | <Phil> I would like to note that I am a webdev and somehow I am finding myself writing a package implementing an actor model using code-generating macros with tons of validation.↵That is the kind of thing that just does not happen elsewhere with way more of a learning curve from what I've seen |
18:37:50 | FromDiscord | <tomexmachina> part of it is surely dead packages. As soon as I get the idea to come back to Nim for something, I know that a lot of the packages I look at might be untouched for a long time. This gives me a bad emotional response, and then I think to myself "Well, I don't really need the added performance and types. It just would have been nice. I'll just prototype this in python instead" |
18:38:01 | FromDiscord | <scipio_nl> I came to Nim because this financial (crypto) charting app, written in Rust, was so fucked up fast & stable, but I have a hard time learning Rust and seeing Nim's syntax immediately "clicked" for me. https://media.discordapp.net/attachments/371759389889003532/1191087884627878020/image.png?ex=65a42a09&is=6591b509&hm=50b6b4adeafd44a59f05ba06634e0b8a6c7ec280a55b56cd0e3ebe51acfa0bcf& |
18:38:34 | FromDiscord | <scipio_nl> i.e. so I basically want to build this in Nim because I like it more 😉 |
18:38:58 | FromDiscord | <michaelb.eth> In reply to @scipio_nl "What is GOOOOOD about": Nim is an expert’s tool, it can serve noobs decently well, but almost all the design decisions are focused on providing a tool to systems programming experts who don’t want to fuss with C/++ but want good compat with C/++ |
18:39:33 | FromDiscord | <scipio_nl> ^^^ interesting remarks @michaelb.eth |
18:39:51 | FromDiscord | <michaelb.eth> well, it’s true |
18:39:53 | FromDiscord | <Phil> ~~I do not have the balls to call myself an expert so I'm unsure about that statement~~ |
18:40:03 | FromDiscord | <scipio_nl> In reply to @michaelb.eth "Nim is an expert’s": What makes Nim an expert tool where it's plugged a general purpose language? |
18:41:10 | FromDiscord | <michaelb.eth> it may be plugged that way, but an expert’s tool is still its nature |
18:41:50 | FromDiscord | <tomexmachina> In reply to @scipio_nl "What makes Nim an": noobs look to packages to close that gap. this might be a perpetual cycle which causes package maintainers to lose interest in maintaining packages in the first place. So maybe there's a threshold of community engagement which must be reached before it reaches an equilibrium. |
18:42:06 | FromDiscord | <michaelb.eth> In reply to @isofruit "~~I do not have": you’re an aspiring one, to be sure |
18:42:31 | FromDiscord | <scipio_nl> https://media.discordapp.net/attachments/371759389889003532/1191089017459048468/image.png?ex=65a42b17&is=6591b617&hm=1beb4defbb6a51e9a52a27a7bd0fafdbcb19247b6b48d83831c3eaec8b8404f8& |
18:42:51 | FromDiscord | <scipio_nl> This is the Tauri Discord server, even one project within a language has a working group |
18:44:45 | FromDiscord | <scipio_nl> In reply to @tomexmachina "noobs look to packages": That is definitely the case. I saw Nim being called a "glue language" somewhere irrc, but where is the glue within the Nim dev community? |
18:44:49 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
18:45:07 | FromDiscord | <scipio_nl> (edit) "irrc," => "iirc," |
18:45:25 | FromDiscord | <Phil> I don't get it with chronicles in my minimal examples but I do when I try to add a compiler-switch in my log.nim to jump between std/logging and chronicles |
18:45:28 | FromDiscord | <tomexmachina> idk what a glue language is |
18:45:40 | FromDiscord | <tomexmachina> glue stick what together? |
18:46:01 | FromDiscord | <scipio_nl> well, the meta programming probably, and binding |
18:46:50 | FromDiscord | <scipio_nl> It is highly interesting in this discussion NIm is being called a toy language by one and an expert language by another |
18:46:57 | FromDiscord | <michaelb.eth> In reply to @isofruit "On a more nim": naive reading: something went wrong w.r.t. compile-time vs. runtime |
18:48:28 | FromDiscord | <systemonia> In reply to @scipio_nl "It is highly interesting": Well its from two different perspectives |
18:49:36 | FromDiscord | <Phil> In reply to @michaelb.eth "naive reading: something went": hmmmmmmm this is inside of a generic, maybe chronicles doesn't like being used in generics |
18:52:22 | FromDiscord | <systemonia> id love to help but metaprogramming fries my brain |
18:53:52 | FromDiscord | <Phil> if it were just a metaprogramming issue I think I'd be able to handle it |
18:59:19 | FromDiscord | <scipio_nl> In reply to @tomexmachina "noobs look to packages": I don't think "packages" only exist to simplify a technical challenge. They're also building blocks to solve complexer tasks. |
19:00:35 | FromDiscord | <scipio_nl> It's also interesting why specifically Python has such an immense module ecosystem and is being used for AI projects a lot, despite being relatively slow. |
19:00:55 | FromDiscord | <scipio_nl> Nim has the potential - in essence - to become the de facto AI language. |
19:00:59 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "This is the Tauri": Rust is also a much bigger and actively developed language more than Nim |
19:01:12 | FromDiscord | <scipio_nl> ^^^ and how did that happen??? |
19:01:22 | FromDiscord | <Robyn [She/Her]> Nim has only a handful of main contributors afaik, but Rust is constantly getting contributions |
19:01:35 | * | disso-peach quit (Ping timeout: 245 seconds) |
19:01:47 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "^^^ and how did": Rust promises things such as memory safety but also being low level, which intrigued many people |
19:02:10 | FromDiscord | <Robyn [She/Her]> Nim is advertised as a general purpose language that can do everything that C can, so people tend to think it's just C with extra steps |
19:02:16 | FromDiscord | <scipio_nl> The first response I get often when I show Rust code to my friends "it looks alien" |
19:03:00 | FromDiscord | <scipio_nl> In reply to @chronos.vitaqua "Nim is advertised as": I don't think the problem lies within how Nim is advertised |
19:03:22 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "I don't think the": What do you think the issue is, then? |
19:03:35 | FromDiscord | <Robyn [She/Her]> It could also be Araq being sorta aggressive/hostile to people |
19:03:54 | FromDiscord | <Robyn [She/Her]> ~~Also that drama with him being ignorant on pronouns~~ |
19:04:11 | FromDiscord | <Robyn [She/Her]> Nim is such a nice language but probably probably are driven away because of that, partly |
19:04:19 | FromDiscord | <Robyn [She/Her]> It always comes up when I suggest Nim to friends |
19:04:56 | FromDiscord | <Robyn [She/Her]> Especially since all of my friends are queer or an ally |
19:05:50 | FromDiscord | <Langosta> In my experience, people are just comfortable with whatever langs are widely used/developed. Its hard to make a case when they're already expanding into go, rust, or sticking with C. |
19:06:16 | FromDiscord | <scipio_nl> I already mentioned how I think about the situation with Araq's communication. But that does not explain ( a ) developer enthusiasm (go find Nim devs that hate the language!) vs ( b ) abandoned repos. |
19:06:52 | FromDiscord | <scipio_nl> You could argue people stick around despite Araq's hostility, but not to a point where any Nim repo gained notable traction. On anything really. |
19:06:57 | FromDiscord | <Robyn [She/Her]> In reply to @alendrik "In my experience, people": That's definitely an issue ngl |
19:07:15 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "You could argue people": I wouldn't of touched Nim if I knew his opinions beforehand tbf |
19:07:31 | FromDiscord | <scipio_nl> In reply to @alendrik "In my experience, people": I disagree, go see how OCaml is doing on Twitter and Discord. |
19:07:56 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "I already mentioned how": Maybe because all of Nim's uses are filled by other languages that are more popular, and companies don't typically look for Nim devs? |
19:08:34 | FromDiscord | <scipio_nl> In reply to @chronos.vitaqua "Maybe because all of": If that were the case Rust would have never gotten traction |
19:08:49 | FromDiscord | <scipio_nl> "Are-we-X-yet" |
19:08:54 | FromDiscord | <scipio_nl> That implies "no" |
19:09:00 | FromDiscord | <scipio_nl> Still it gets there |
19:09:05 | FromDiscord | <scipio_nl> Because of ORGANIZATION |
19:09:08 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "If that were the": Rust provided absolute memory safety |
19:09:28 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "Because of ORGANIZATION": Nim definitely could do with more organisation I agree |
19:09:56 | FromDiscord | <scipio_nl> Why is Zig getting traction bu tnot Nim then? |
19:10:00 | FromDiscord | <Robyn [She/Her]> But that requires more people being willing to step up and take an active role, which people are either too busy to do, or not motivated to do |
19:10:05 | FromDiscord | <scipio_nl> (edit) "bu tnot" => "but not" |
19:10:49 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "Why is Zig getting": Advertised as a better C, with seamless interop with C (better than Nim, which requires some glue), while also still being quite familiar even for C devs |
19:11:27 | FromDiscord | <scipio_nl> I have personally not spoken with Araq yet, but I am intrigued into having a proper conversation with him. You'd say a founder (called "inventor" on the Nim website, I mean ... errrr) has an interest in seeing his creation succeed, which in the case of a programming language means developers and products being used. |
19:12:06 | FromDiscord | <Robyn [She/Her]> I've had a few interactions and he's always been civil, but on the forum he can be a tad hostile to newbies |
19:13:19 | FromDiscord | <scipio_nl> In reply to @chronos.vitaqua "I've had a few": I;d think more than twice before posting a forum question under my real name tbh |
19:13:35 | FromDiscord | <Langosta> In reply to @scipio_nl "I disagree, go see": To be clear, the idea isnt that nim doesnt provide any benefits/innovation. ↵↵The main problem i've seen is that other, more widely supprted languages, have a consistency and quality that nim doesnt. Nim is still seen as a toy language by many. Poor documentation (in terms of using them), Adhoc syntax/rules, and such |
19:13:49 | FromDiscord | <Langosta> This is coming more from speaking to people of the security background |
19:14:01 | FromDiscord | <Langosta> So it may be different for different industries |
19:14:17 | FromDiscord | <scipio_nl> what qualities do you miss? |
19:14:37 | FromDiscord | <Langosta> dev UX seems to be a big thing pushing people away from what I've seen |
19:15:13 | FromDiscord | <Langosta> The combination of frustrations across multiple components of nim, from docs, to contribution, personalities, and all of that |
19:16:22 | FromDiscord | <scipio_nl> personalities, multiple? |
19:16:45 | FromDiscord | <scipio_nl> The solution is a foundation |
19:17:04 | FromDiscord | <scipio_nl> Not a one man show. It will fail 100% of the time. Get organized. |
19:20:30 | FromDiscord | <Robyn [She/Her]> Nim docs are a tad annoying to be honest, but they're manageable, I don't know enough about HTML and CSS to fix them up |
19:20:42 | FromDiscord | <Robyn [She/Her]> In reply to @alendrik "The combination of frustrations": Yeaaah |
19:21:08 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "personalities, multiple?": I know Araq has driven away quite a few people, including dom96 who I think was a co-founder? |
19:22:48 | FromDiscord | <alex.boisvert> sent a long message, see <!doctype html> |
19:22:55 | FromDiscord | <scipio_nl> https://media.discordapp.net/attachments/371759389889003532/1191099174318522528/image.png?ex=65a4348c&is=6591bf8c&hm=7ef900c522cbe26f4a0cd7c9b9eac982a68958e00c90ac3b47fa36466a18e8df& |
19:23:21 | FromDiscord | <scipio_nl> what is the story with this logo? Who has the idea to place a golden crown to their name and then expect wide adoption? |
19:23:35 | FromDiscord | <Robyn [She/Her]> I have no idea about the crown honestly |
19:23:59 | FromDiscord | <Robyn [She/Her]> In reply to @alex.boisvert "The fact that Nim": Yeah that's definitely true |
19:24:54 | FromDiscord | <alex.boisvert> The crown is a reference to Kind Nimrod -- Nimrod was previously the name of the language. |
19:25:10 | FromDiscord | <scipio_nl> In reply to @alex.boisvert "The fact that Nim": This seems to be general consensus, at least I've heard nobody say otherwise. |
19:25:34 | FromDiscord | <scipio_nl> In reply to @alex.boisvert "The crown is a": And Nimrod was a King (Kind is a typo I assume?) |
19:26:13 | FromDiscord | <alex.boisvert> Sorry, yes King |
19:26:53 | FromDiscord | <scipio_nl> Nimrod has other associations too which is probably why "marketing and communication" isn't the founders' (multiple) forte? |
19:27:19 | FromDiscord | <scipio_nl> That still doesn;t answer my question btw, why pick a name of a King |
19:27:28 | FromDiscord | <michaelb.eth> In reply to @scipio_nl "Nimrod has other associations": only by accident of history |
19:27:37 | FromDiscord | <alex.boisvert> Indeed, which is why the language/project was renamed to Nim, it removes one of the marketing barrier |
19:27:44 | FromDiscord | <scipio_nl> Narcissistic tendencies don't often sit well with the general public if you aspire mass adoption |
19:29:04 | FromDiscord | <scipio_nl> In reply to @alex.boisvert "Indeed, which is why": So "marketing" is indeed being perceived as important, why else change a name |
19:29:38 | FromDiscord | <scipio_nl> You could also reason "Fuck them, we stick with the name Nimrod", which at least displays principles |
19:31:34 | FromDiscord | <alex.boisvert> I don't think marketing is the primary reason why Nim isn't more popular. People come to Nim but they don't stick around for various reasons, the main one being the overall value proposition with respect to other language ecosystems. Marketing can only help bring people in, it doesn't help retain people. |
19:31:54 | FromDiscord | <scipio_nl> No matter how you put it, Nim is an interesting business case. The devs clearly love the language, meaning there is extreme competent intelligence behind it, yet it fails completely in organization and communication/marketing. |
19:32:25 | FromDiscord | <scipio_nl> In reply to @alex.boisvert "I don't think marketing": That does not explain other new languages succeeding. |
19:32:47 | FromDiscord | <scipio_nl> Especially not where Nim could in essence stand on the C shoulders with its interoperability |
19:34:46 | FromDiscord | <michaelb.eth> In reply to @scipio_nl "No matter how you": Maybe that;s okay? I mean maybe it's okay for Nim to be what it is (a superior alternative to C/++ for those who don't wnat/need "to go full borrow-checker", like Rust) |
19:35:10 | FromDiscord | <michaelb.eth> (edit) "is (a" => "is: a" | "Rust)" => "Rust" |
19:37:04 | FromDiscord | <alex.boisvert> Other languages offer something more compelling than Nim. Nim still has too many rough edges. There is certainly sweet spots where Nim can shine but as a general purpose language, it's still not there yet for most use-cases. The concurrency story is weak, the GC story is still iffy (bugs in ARC/ORC/async). Nobody wants to build on a shaky foundation. |
19:37:16 | FromDiscord | <Phil> Okay so after many pains I managed to bring something together for log messages |
19:37:46 | FromDiscord | <alex.boisvert> (edit) "is" => "are" |
19:37:52 | FromDiscord | <scipio_nl> concurrency is an issue indeed, but I understand @Phil is addressing that? |
19:38:26 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
19:39:37 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
19:40:46 | FromDiscord | <Phil> Malebolgia, weave and status/nim-taskpools all address the "Move a subtask into another thread" problem.↵Though none of them are particularly easy on the eyes for absolute beginners or shine in their docs (imo). |
19:41:18 | FromDiscord | <Phil> But the packages I've seen for actors are something else. Looked at them and understood basically none of them. |
19:44:34 | FromDiscord | <alex.boisvert> The multi-threading story is pretty much "share nothing"; it's not a selling point. Disabling atomic RC is basically a hack and it's unclear if/how it will be supported. This is the problem -- Nim just hasn't settled on its multi-threading model. You can't build an ecosystem around "pick your GC" and "everybody does it differently" |
19:46:51 | FromDiscord | <scipio_nl> No that is the exact opposite of Zig's "there should only be one obvious way to do something" |
19:49:12 | FromDiscord | <scipio_nl> In reply to @alex.boisvert "The multi-threading story is": Then why do you stick around Nim? You're the first person I encountered in here with technical criticism |
19:49:16 | FromDiscord | <Langosta> In reply to @isofruit "Malebolgia, weave and status/nim-taskpools": hownis malebolgia? It seems cool |
19:49:37 | FromDiscord | <Langosta> (edit) "hownis" => "how is" |
19:50:26 | FromDiscord | <Phil> In reply to @alex.boisvert "The multi-threading story is": That honestly doesn't seem like a bad architectural point, no?↵Shared mutable state as root of all evil and all that.↵You can build something pretty workable with just channels and createThread without too much hassle |
19:51:20 | FromDiscord | <Phil> Not that I'm an expert on multi-threading, but the architectural model that I've seen everywhere, including C, were always to outsource stuff into separate threads and use e.g. message passing (GTK has a queue whose name I forgot for that) |
19:53:32 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
19:54:03 | FromDiscord | <Phil> (edit) |
19:54:33 | FromDiscord | <Robyn [She/Her]> In reply to @alex.boisvert "The multi-threading story is": Arc isn't atomic by default |
19:54:47 | FromDiscord | <Robyn [She/Her]> You have to use `-mm:atomicArc` for yhat |
19:54:53 | FromDiscord | <alex.boisvert> @scipio_nl I'm more or less lurking nowadays. I'm using other languages primarily (Scala, Typescript, Python, Rust). I'm still holding hope for Nim, as it think it's a language that has an interesting combination of features, but I've reached the position that I can't commit to Nim until it becomes more mature and figures out what it wants to be when it grows up. I have a few small personal Nim projects that I maintain but not |
19:55:52 | FromDiscord | <Phil> Honestly the actor model for multithreading is one I could grok the easiest. It just seems so intuitive from a webdev perspective |
19:55:55 | FromDiscord | <michaelb.eth> In reply to @scipio_nl "Then why do you": re: "first pesron", well maybe you haven't around long enough and/or asked the right questions |
19:59:40 | FromDiscord | <scipio_nl> In reply to @michaelb.eth "re: "first pesron", well": I think I'm pretty good at asking questions but it's definitely my time-spent in here |
20:01:33 | FromDiscord | <alex.boisvert> In reply to @chronos.vitaqua "You have to use": @Chronos [She/Her] Yes, sorry I wrote this wrong. I meant it to mean "disabling the (thread-)local RC optimization" -- I see this as a optimization which isn't helpful to the wider ecosystem. The default should be atomicArc because its safer IMO. This should be an optimization if you know you aren't sharing anything. |
20:02:01 | FromDiscord | <scipio_nl> I toyed with Nim a day or two, chatted in here, almost pissed my pants laughing at the communication style on the Nim forum, and then decided that even tho Nim feels extremely good / at home, if it cannot grow a decent developer following and organize, it has zero chance of becoming commercially viable.↵But maybe Nim needs me, who knows. I keep getting attracted to it, like you I was lurking. |
20:03:22 | FromDiscord | <scipio_nl> In reply to @michaelb.eth "re: "first pesron", well": But I can't agree with something being an expert language, whatever that even means. |
20:03:47 | FromDiscord | <Robyn [She/Her]> In reply to @alex.boisvert "<@524288464422830095> Yes, sorry I": Ah fair |
20:05:08 | FromDiscord | <leorize> @Phil have you managed more with CPS? we do have an actors library \:p |
20:05:45 | FromDiscord | <Phil> In reply to @leorize "<@180601887916163073> have you managed": I have not because that explainer just about blew my brains out ^^'↵The entire idea of writing my own scheduler "felt" like it was a topic so large I didn't have the foundations to tackle it |
20:06:03 | FromDiscord | <alex.boisvert> The problem is that without atomic ARC you can't share any refs, not even refs to immutable/non-mutating values. There are many situations where you'd want to do that in the kinds of apps that I write (web services), such as sharing configuration objects, caching, etc. |
20:06:18 | FromDiscord | <Phil> And I assume you're talking about the syndicated actors lib?↵Because that was the only other actors lib (that wasn't abandoned) that I'm aware of |
20:06:43 | FromDiscord | <Phil> And the spec of syndicated actors alone gave me a migraine trying to understand it |
20:07:18 | FromDiscord | <leorize> I'm talking about zevv's↵(@Phil) |
20:07:39 | FromDiscord | <Phil> Giving me once more the feeling that what I'm writing is an actors lib but "for dummies".↵Which still feels legitimate because my focus is more simplicity and ease of use without requiring to understand a lot of concepts than anything else |
20:08:30 | FromDiscord | <alex.boisvert> I believe Nim should have multi-threading-friendly data structures that can point to immutable data. These data structures would be mutable, and written by experts (using ptrs, locks, atomics, etc.) But precluding sharing immutable data is too much of a restriction, IMO. |
20:08:42 | FromDiscord | <Phil> In reply to @leorize "I'm talking about zevv's": I don't think I have a link to that one, doesn't show up when searching for the actor keyword in the nimble list |
20:09:10 | FromDiscord | <leorize> you know how we feel about nimble \:p |
20:09:17 | FromDiscord | <leorize> https://github.com/zevv/actors |
20:09:42 | FromDiscord | <Phil> In reply to @leorize "you know how we": I mean yeah but a central package list is for searchability.↵I'm not asking you guys to use nimble, but if there's one place to find packages its there. |
20:09:51 | FromDiscord | <leorize> examples are in the tests folder |
20:09:58 | FromDiscord | <Phil> Not like you must have nimble to use that json file |
20:10:07 | FromDiscord | <leorize> it's called nimph, which calls GitHub API directly↵(@Phil) |
20:10:48 | FromDiscord | <leorize> disruptek's disbot provides this service in IRC but it's banned here so \:p |
20:10:58 | FromDiscord | <Phil> In reply to @leorize "it's called nimph, which": Seeing zevv using hatch I now at least don't feel bad about my naming sense being the only bad thing |
20:11:17 | FromDiscord | <Phil> about my naming sense being the only one that's bad |
20:12:06 | FromDiscord | <Phil> In reply to @leorize "it's called nimph, which": Okay, neat, but also I would like for something to set up channels for message passing and automated routing to procs that do message handling ^^ |
20:12:52 | FromDiscord | <leorize> mpmc channels\: https://github.com/nim-works/loony |
20:12:57 | FromDiscord | <JJ> btw leorize do you know if `git nim` is still of interest to disruptek |
20:13:11 | FromDiscord | <Phil> It does feel nice though that I seemingly had very similar ideas here, just different wording and I provided a lot more code-generation tools surrounding it (at least from what I see in the quickstart bits) |
20:13:17 | FromDiscord | <JJ> it doesn't work with 2.0.0 and broke somewhat with previous versions i believe |
20:13:38 | FromDiscord | <Phil> In reply to @leorize "mpmc channels\: https://github.com/nim-works/loony": What is MPMC? |
20:13:58 | FromDiscord | <leorize> if you open an issue he would help you↵(@JJ) |
20:14:16 | FromDiscord | <Phil> Because I'm getting "Microprocessor and microcontrollers" |
20:14:23 | FromDiscord | <leorize> he's pretty into that gitnim, but not many uses it |
20:14:31 | FromDiscord | <leorize> multi producers & multi consumers↵(@Phil) |
20:14:53 | FromDiscord | <Phil> ~~I swear, people, this is why we don't use abbreviations before we defined them elsewhere~~ |
20:14:59 | FromDiscord | <JJ> cool, i'll try to get replicatable problems then |
20:15:33 | FromDiscord | <leorize> these are very well-defined terms for channels \:p |
20:15:43 | FromDiscord | <JJ> In reply to @isofruit "~~I swear, people, this": it's a problem in the entire field of computer science 😛 |
20:16:06 | FromDiscord | <Phil> In reply to @leorize "these are very well-defined": Sure, unless you're new and need to google them. I'm of the opinion that you should even first define FIFO before you start using it |
20:16:20 | FromDiscord | <JJ> see: ADTs among other acronyms |
20:16:51 | FromDiscord | <Phil> Which isn't really hard, just write the first occurrence as "First-in-First-out (FIFO)" and then you can keep using it as that, it's not hard but makes it infinitely less disruptive when you're entering and trying to wrap your head around things. |
20:16:59 | FromDiscord | <leorize> disruptek's insideout is a pretty fully-featured package for concurrency\: https://github.com/disruptek/insideout if you're interested |
20:17:18 | FromDiscord | <Robyn [She/Her]> In reply to @omentic "it's a problem in": Laughs in Doctors |
20:17:37 | FromDiscord | <leorize> balls uses it\: https://github.com/disruptek/balls/tree/v4 |
20:18:08 | FromDiscord | <Phil> ... I swear am I the only one writing both reference docs and introduction docs |
20:19:01 | FromDiscord | <leorize> most of these are experiments, which is why they're rather light on docs |
20:19:16 | FromDiscord | <leorize> for some of them nim crashes trying to generate docs so there is that |
20:19:31 | FromDiscord | <Phil> This makes it feel to me like basically this is a weeks worth of studying source code and computer science algos |
20:20:11 | FromDiscord | <Phil> Okay, let me see if I am far enough in my knowledge to grasp any of ti |
20:20:29 | FromDiscord | <leorize> and writing queues for continuations is actually really simple |
20:21:31 | FromDiscord | <leorize> here's a "threadpool" to ease you in\: https://github.com/nim-works/cps/blob/master/examples/threadpool.nim |
20:21:32 | FromDiscord | <Phil> I mean, given your earlier statement that a continuation is just an object and not even a generic object, then putting it through a threading/channels.Chan or system.Channel seems easy |
20:22:00 | FromDiscord | <Phil> So not even any need to define a queue, just make the continuation a ref object to avoid copies and use threadings/channels |
20:23:59 | FromDiscord | <leorize> loony is pretty much made for that purpose |
20:24:00 | FromDiscord | <leorize> for something that waits on FDs like asyncdispatch, you can read this one\: https://github.com/alaviss/nim-sys/blob/master/src/sys/private/ioqueue_linux.nim |
20:24:02 | FromDiscord | <leorize> I made it a point to document the internals intensively, so maybe that'll help |
20:24:57 | FromDiscord | <Phil> Async? Oh you mean working in an async manner through continuations? |
20:25:34 | FromDiscord | <Phil> Because basic async support in my actors was as easy as adding "poll" to the while-loop (and a never-ending timer before the while-loop starts so poll doesn't throw errors) |
20:26:06 | FromDiscord | <leorize> the queue lifecycle is basically\: store continuations in a queue/seq/etc., then when they are ready to be run, take them out and use `trampoline` to resume execution |
20:26:25 | * | xet7 quit (Remote host closed the connection) |
20:27:23 | FromDiscord | <leorize> you can do the same thing here↵(@Phil) |
20:27:42 | FromDiscord | <Phil> Okay before we're jumping because my CPS fundamentals are still rather basic (as in, I get the concept but not the implementations or rather have no decent mental models for applying it), back to the threadpool.nim example.↵↵So "pool" in threadpool nim isn't really a threadpool, it is a continuation pool, right? |
20:27:59 | FromDiscord | <Phil> Given the naming I was kinda expecting that to be the pool of threads, not of continuations |
20:28:35 | FromDiscord | <Phil> So just checking to be certain I'm getting my understanding right |
20:29:01 | FromDiscord | <leorize> the user-facing part of my queue is this\: https://alaviss.github.io/nim-sys/ioqueue.html#poll%2Cseq%5BContinuation%5D |
20:29:03 | FromDiscord | <Phil (he/him)> Okay one sec I'm jumping to fractal, the delay is killing me |
20:29:05 | FromDiscord | <Phil (he/him)> sent a long message, see <!doctype html> |
20:29:23 | FromDiscord | <leorize> it is a threadpool |
20:29:25 | FromDiscord | <Phil (he/him)> Wow, now the messages are coming through |
20:29:42 | FromDiscord | <Phil (he/him)> Wait, how is it a threadpool? It is a seq of continuations with a lock? |
20:30:09 | FromDiscord | <Phil (he/him)> I regard continuations as packages of work that threads call over and over again, not as threads themselves, is that the wrong understanding? |
20:30:35 | FromDiscord | <leorize> yep, see the `Pool` object and `work` |
20:30:37 | FromDiscord | <Phil (he/him)> Well, not a seq of continuations, a queue of continuations with a lock, but the point stands |
20:31:00 | FromDiscord | <leorize> that's the correct understanding |
20:31:22 | FromDiscord | <leorize> the `work()` function spawns threads then each of them consume work from the queue |
20:31:24 | FromDiscord | <Phil (he/him)> thread pragma, one sec, reading through nim docs because I so rarely use it |
20:31:38 | FromDiscord | <leorize> `{.thread.}` is just `{.gcsafe.}` |
20:32:10 | FromDiscord | <leorize> why it is not written the other way around is beyond me |
20:32:12 | FromDiscord | <Phil (he/him)> Ah, readability annotation that this will be used to run in a separate thread |
20:34:57 | om3ga | Happy new year everybody! |
20:35:57 | FromDiscord | <Phil (he/him)> sent a long message, see <!doctype html> |
20:36:27 | FromDiscord | <Phil (he/him)> Because the break in line 42 should break the while-loop, right? |
20:37:53 | FromDiscord | <leorize> i'm not sure why myself \:p |
20:37:57 | FromDiscord | <leorize> zevv wrote that one |
20:38:25 | FromDiscord | <leorize> dismissed is just a `nil` continuation |
20:38:39 | FromDiscord | <Phil (he/him)> Because that's mildly confusing. The thread is supposed to work through an unknown number of continuations and somehow a random continuations dismissal can cause it to break its while-loop? |
20:40:48 | FromDiscord | <Phil (he/him)> Okay, lets assume I understood that.So the work proc orchestrates all of it, spawns a pool of N threads to work through the work-pool and joins them all together in the end, essentially that is the proc you'd call from the main thread, that main thread then goes to sleep until the program/the continuation work ends |
20:40:49 | FromDiscord | <leorize> we'll check back on you next year xd |
20:40:51 | FromDiscord | <Phil (he/him)> All you future people, it's still over 2h away for me ^^↵(<@709044657232936960_om3ga=5b=49=52=43=5d>) |
20:41:10 | FromDiscord | <Phil (he/him)> Then you have a jield proc to... add continuations to the queue?↵Why yield? |
20:41:45 | FromDiscord | <Phil (he/him)> Why not "sendContinuation" or something, where/what does the jield proc yield? |
20:41:46 | FromDiscord | <leorize> ah, it's a cpsMagic |
20:42:20 | FromDiscord | <leorize> as the name might have suggested you, it's similar to an iterator yield |
20:43:39 | FromDiscord | <leorize> basically it pauses a continuation and push it to the queue |
20:43:41 | FromDiscord | <Phil (he/him)> This may hurt me here because iterators are another one of my weakspots as I, in my 2 years, never had to write one ^^' |
20:43:42 | FromDiscord | <leorize> it's just something used for that particular example \:p |
20:43:45 | FromDiscord | <Phil (he/him)> So a cps proc can push itself onto a CPS proc from inside the CPS itself |
20:43:50 | FromDiscord | <Phil (he/him)> \CPS queue |
20:43:56 | FromDiscord | <Phil (he/him)> Well, Continuation queue |
20:44:13 | FromDiscord | <leorize> yea, that's like the whole reason behind cps \:p |
20:44:15 | FromDiscord | <Phil (he/him)> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1191119526750855270): So a cps proc can push itself onto a CPS proc from inside the Continuation proc itself |
20:44:39 | FromDiscord | <leorize> you can pause execution and while paused you can decide what to do with the next step of the execution |
20:44:58 | FromDiscord | <Phil (he/him)> I honestly always thought of it more like CPS defining themselves as packages of work and you have external procs pushing it into queues to be executed elsewhere |
20:45:03 | FromDiscord | <leorize> I don't think I could top this explainer, so I'll refer it to you\: https://github.com/nim-works/cps/tree/master/tutorial#a-more-elaborate-example-cooperative-scheduling |
20:45:24 | FromDiscord | <Phil (he/him)> And not that CPS themselves organize their own execution |
20:46:47 | FromDiscord | <leorize> if you want to do that you'd have to pause the continuation somehow \:p |
20:47:09 | FromDiscord | <leorize> and since it is the cps proc that determine where to be paused, we could just do all the queuing job there |
20:47:55 | FromDiscord | <Phil (he/him)> So basically a CPS proc is both executing work as well as organizing where its work is being executed, doing basically both jobs inside so that the outside has an easier time not having to organize it |
20:48:10 | FromDiscord | <leorize> yep |
20:48:33 | FromDiscord | <leorize> this is different from green threads in that execution is cooperative and not preemptative |
20:48:56 | FromDiscord | <leorize> or rather this is one side of a green threads implementation |
20:50:49 | FromDiscord | <Phil (he/him)> ... I just wanted an actor implementation that is flexible enough for most/all commong usecases and suddenly I find myself knee deep in defining virtual threads (green threads were VM thread stuff IIRC, right?) |
20:51:04 | FromDiscord | <Phil (he/him)> Okay so slow is the continuation we put in the workpool |
20:51:46 | FromDiscord | <Phil (he/him)> and with yield we define the point where it may move off the main-thread into the work-pool ...? |
20:51:57 | FromDiscord | <Phil (he/him)> Well, jield |
20:52:11 | FromDiscord | <leorize> move off the running thread, not main thread |
20:52:41 | FromDiscord | <Elegantbeef> @scipio_nl I opened up matrix seen "I also have to be honest here\: the Nim community in here is fucking..." and was like well this is going to be a rant 😄 |
20:53:16 | FromDiscord | <Phil (he/him)> In this example that's always the main thread right? since slow only gets called from the main thread (or does whelp do magic here that it may be called from like a bajillion different threads) ? |
20:53:25 | FromDiscord | <leorize> `whelp` is used to /not/ start a continuation after creation, so we could queue it right away |
20:53:38 | FromDiscord | <leorize> (great name, we know) |
20:53:58 | FromDiscord | <Phil (he/him)> It's fine, its comforting that I am in this group of people whose naming sense sucks |
20:53:59 | FromDiscord | <Phil (he/him)> \:-D |
20:54:17 | FromDiscord | <Elegantbeef> Well it's more you cannot overload `yield` in the manner they'd want |
20:54:24 | FromDiscord | <Phil (he/him)> Okay so basically slow has 2 "breakpoints" |
20:54:48 | FromDiscord | <Phil (he/him)> one is directly before it executes, which is done using whelp, so that you have the continuation object without executing its first section between the start and the yield |
20:54:53 | FromDiscord | <Phil (he/him)> The second is the yield |
20:55:08 | FromDiscord | <leorize> exactly |
20:56:03 | FromDiscord | <Phil (he/him)> And this way we instantiate all our continuations on the main thread and dump them in the pool, and later after the pool is filled we spawn the working pool and work through the continuations in parallel |
20:56:32 | FromDiscord | <Phil (he/him)> Since filling the pool and working through it is not done in parallel (in this example) as far as I understand |
20:56:45 | FromDiscord | <leorize> yep |
20:56:57 | FromDiscord | <leorize> we keep it simple that way |
20:57:12 | FromDiscord | <Phil (he/him)> jield seems so universal, is that a predefined proc? |
20:57:21 | FromDiscord | <leorize> nope |
20:57:40 | FromDiscord | <Phil (he/him)> Ah because you can't know the pool instance and the management around it |
20:57:48 | FromDiscord | <leorize> yea |
20:58:43 | FromDiscord | <Elegantbeef> I know you guys are talking, but I'm pretty chuffed about this |
20:58:50 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1191123321119571988/image.png?ex=65a44b09&is=6591d609&hm=e362ad71119cefb4784bea6bd245e8bd5f4d2754fb9cc080566476cafb219446& |
20:59:27 | FromDiscord | <Phil (he/him)> So the way this scheduling works is basically always one thread takes one tasks and trampolines it to completion and only then takes the next one.As a noob in the CPS/multithreading sphere - What about taking a Continuation, executing it one step, then dropping it back into the end of the queue and popping the next Continuation, basically working through continuations more "evenly"? |
21:00:17 | FromDiscord | <Phil (he/him)> ... let me google what chuffed means |
21:00:27 | FromDiscord | <leorize> you can't, because continuations are cooperative |
21:00:29 | FromDiscord | <Elegantbeef> Happy, or pleased with ones self |
21:01:04 | FromDiscord | <Phil (he/him)> Wait did you just fully automate generating header files for nim modules? |
21:01:07 | FromDiscord | <Elegantbeef> Though in certain UK dialects also the exact opposite |
21:01:08 | FromDiscord | <leorize> in fact the trampoline only exist because we don't have guaranteed tail-call optimization in Nim |
21:01:27 | FromDiscord | <Elegantbeef> I did make a header generator that is plugable in user code, yes |
21:01:49 | FromDiscord | <Elegantbeef> Notice how it include `stdint` and `stdbool` |
21:01:59 | FromDiscord | <Elegantbeef> Sorry it does not include stdbool |
21:01:59 | FromDiscord | <Phil (he/him)> I may be imagining this because of my lack of knowledge.↵How "real" is the risk of all threads getting blocked thus by Continuations that just take a long time to execute? |
21:02:01 | FromDiscord | <leorize> looks pretty neat |
21:02:30 | FromDiscord | <leorize> that will 100% happen |
21:02:56 | FromDiscord | <Elegantbeef> It's all pluggable so for any type you want to overload you can implement `toTypeDef(_: typedesc[YourType]): string` and `toCType(_: typedesc[YourType], name: string, isProc: bool): string` |
21:03:14 | FromDiscord | <Phil (he/him)> As in, that is super likely and a weakness that other multithreading approaches have as well?↵I mean, actually does async also have that problem? |
21:03:30 | FromDiscord | <Elegantbeef> Async does have that problem |
21:03:38 | FromDiscord | <Elegantbeef> Also that's not multi threaded problem 😄 |
21:03:47 | FromDiscord | <leorize> the only thing that doesn't have that problem is called `go` |
21:04:19 | FromDiscord | <Elegantbeef> Nim's async blocks until you get to a "leg" which is `poll` `drain` `yield` or any other mechanism that calls the cpu sharing |
21:05:08 | FromDiscord | <leorize> this is a fundamental issue in cooperative scheduling |
21:05:21 | FromDiscord | <leorize> to use preemptative scheduling, you can just rely on the OS by spawning more threads |
21:05:41 | FromDiscord | <Phil (he/him)> So basically you define a bunch of lines with export pragmas etc. and then at the end of it all you can call makeHeader and boom, headerfile.Does the set of pragmas need to be userdefined or is it always the same set? |
21:06:09 | FromDiscord | <Elegantbeef> The `{.pragma` needs to be user defined as there is no nice way of taking in a list of them you might want |
21:06:36 | FromDiscord | <Elegantbeef> Sometimes you might want to expose a different calling convention, you might want to add tags, you might want to chew bubble gum whilst walking |
21:06:44 | FromDiscord | <Phil (he/him)> So providing some kind of template to spawn them is out of the question then, hmmmm |
21:06:53 | FromDiscord | <Elegantbeef> There is no point it's just complexity |
21:07:08 | FromDiscord | <Elegantbeef> Having to explicitly define your pragmas is fine |
21:08:21 | FromDiscord | <Elegantbeef> I could make `expose` take a block of procs but that adds an indent that's fugly |
21:08:23 | FromDiscord | <Phil (he/him)> Fair, was just wondering if the need to know about the various pragmas etc. could be removed or not.↵The less a user needs to know the better ^^' |
21:08:23 | FromDiscord | <Elegantbeef> No cause the user needs to know this |
21:08:25 | FromDiscord | <Elegantbeef> The user needs to know the calling convention! |
21:08:26 | FromDiscord | <Elegantbeef> Infact I have a warning and error about it inside `expose` |
21:08:46 | FromDiscord | <Phil (he/him)> Okay, given that it's that fundamental I believe I can put it on the "It is okay that I, a mere mortal, do not have a solution for this" |
21:09:31 | FromDiscord | <Phil (he/him)> ~~But maybe there are default calling conventions and in 50% of the cases the user doesn't~~ |
21:09:34 | FromDiscord | <leorize> yea, and solving that is not our job anyways |
21:09:45 | FromDiscord | <Elegantbeef> There are default calling conventions |
21:09:51 | FromDiscord | <Elegantbeef> Nimcall is not the same on linux as windows |
21:10:07 | FromDiscord | <Elegantbeef> On linux you do not need to annotate the procedure for nimcall, on windows it's fastcall |
21:10:12 | FromDiscord | <leorize> on x86\_64 they're pretty much the same |
21:10:42 | FromDiscord | <Phil (he/him)> That reminds me of the blogpost dragging C through the mod for its bajillion calling conventions and calling it not a language but a protocol |
21:10:50 | FromDiscord | <Phil (he/him)> This is giving me very distinct "that's true" vibes |
21:11:03 | FromDiscord | <Phil (he/him)> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1191126307078144062): That reminds me of the blogpost dragging C through the mud for its bajillion calling conventions and calling it not a language but a protocol |
21:11:12 | FromDiscord | <Elegantbeef> I also do not want to mutate their procedures as that means the non header generation path relies on a macro |
21:11:21 | FromDiscord | <Elegantbeef> It still does otherwise but it's simply a macro that returns the ast |
21:11:23 | FromDiscord | <leorize> eh it's not a C thing |
21:11:37 | FromDiscord | <Elegantbeef> Calling conventions is the lowest level "How do we get our parameters" |
21:11:39 | FromDiscord | <leorize> it's an architecture thing |
21:12:29 | FromDiscord | <leorize> modern architectures have a proper convention defined, but back in the days of x86 no one agreed on any particular solution |
21:12:56 | FromDiscord | <leorize> most OS vendors corrected that for amd64, fortunately |
21:13:33 | FromDiscord | <Phil (he/him)> Okay, given that , err... isn't "jield" kind of the optimal implementation then?↵I mean, I already have a threadpool generally per actor.↵I just add a "work-pool" per actor... I am now just wondering whether to let the threadpool I already have work on that, or have a second threadpool just for the continuation-workpool |
21:14:19 | FromDiscord | <leorize> pretty much, it's the same as `sched_yield` if you ever did MT |
21:14:29 | FromDiscord | <Phil (he/him)> For reference, this is my architecture pretty much\:↵https://raw.githubusercontent.com/PhilippMDoerner/ThreadButler/main/assets/app_architecture.png |
21:14:31 | FromDiscord | <leorize> the purpose is to demonstrate cps, not to be a meaningful threadpool |
21:15:33 | FromDiscord | <leorize> you're doing too much |
21:15:51 | FromDiscord | <Phil (he/him)> hm? |
21:16:58 | FromDiscord | <leorize> your diagram is trying to solve job scheduling, messaging and work at the same time |
21:17:29 | om3ga | what does this multithreaded service? |
21:18:26 | FromDiscord | <Phil (he/him)> It doesn't "feel" like a lot in the implementation for the most part |
21:18:29 | FromDiscord | <Phil (he/him)> Wait, is this a statement about how the package is thus doing too much in general or how this is a bad explainer for the package because it does too much? |
21:18:30 | FromDiscord | <leorize> it won't be a lot, but will take a lot to do them well |
21:18:31 | FromDiscord | <leorize> for example, executing async tasks for `n ms` is impossible |
21:18:33 | FromDiscord | <Phil (he/him)> That's poll(x) with x being a configurable value |
21:18:51 | FromDiscord | <Phil (he/him)> or drain(x), I think drain is the more semantically accurate, right now that's poll though |
21:19:02 | FromDiscord | <leorize> well, what happens if you can't get it done on time? |
21:19:10 | FromDiscord | <leorize> remember, async tasks can and do block |
21:19:30 | FromDiscord | <Phil (he/him)> Then the diagram lies and you take longer than n ms, this just means you're doing at least one task or waiting for one to happen |
21:20:49 | FromDiscord | <Phil (he/him)> It's also not like I implement the messaging. I use channel implementations from threading/channels or system/Chan.↵↵All I do is define object-variants that wrap the messages so one channel can contain different kinds of messages that can all go to the same thread |
21:20:53 | FromDiscord | <leorize> also, this means your back-pressure is horrible as long as a task is queued |
21:21:22 | FromDiscord | <Phil (he/him)> Thaaaat would be accurate, but unavoidable I think |
21:21:26 | FromDiscord | <leorize> because if you `poll` for `n ms`, it will take at least `n ms` to run, no matter if nothing is ready |
21:21:42 | FromDiscord | <Phil (he/him)> And is also the reason why n is a configurable value |
21:21:50 | FromDiscord | <leorize> the solution is an mpmc channel \:p |
21:22:09 | FromDiscord | <Phil (he/him)> Which is more complicated again \>\_\< |
21:22:20 | FromDiscord | <leorize> have you looked at loony apis? |
21:22:45 | FromDiscord | <Phil (he/him)> I've been busy trying to understand the taskpool example to see if I can provide CPS support similar to async support |
21:22:56 | FromDiscord | <Phil (he/him)> As in, make it easy to use |
21:23:43 | FromDiscord | <leorize> and your pool is too static |
21:24:08 | FromDiscord | <leorize> why is it important to have thread a and thread b? |
21:25:33 | FromDiscord | <Phil (he/him)> You do not have to, you can also only have a thread A that spawns tasks.↵I have one in this example because the entire architecture of having permanent, long-running threads that act more as permanently available "servers" that can have their own state is one that seemed intuitive to me and I've received confirmation from work that it appears to be a common pattern in at least mobile app dev, though I am like 50% certain that the |
21:25:48 | FromDiscord | <leorize> if they are the same, then what I'm seeing is that you want your computation distributed, not messages |
21:26:22 | FromDiscord | <Phil (he/him)> They are not. Think of Thread A as the thread that runs the GTK gui-loop, while Thread B takes care of all "backend" tasks so that the gui-loop is never blocked |
21:27:19 | FromDiscord | <Phil (he/him)> Work is pushed from Thread A to B by simply sending a message to B and it then does work there. B may decide to send a message back to A to update it, if A can meaningfully react to that (by e.g. changing the GUI in some form) |
21:28:02 | FromDiscord | <leorize> yep, your problem is definitely computation distribution |
21:28:36 | FromDiscord | <leorize> the stuff that will solve your problem is not sending messages, but specifying where should the computation happens |
21:29:15 | FromDiscord | <leorize> say you need to grab `x` from gtk, then pause your compute, move it to gtk thread, process the action, and re-queue |
21:29:34 | om3ga | what's the point to create thread which creates another thread to calculate something? |
21:30:00 | FromDiscord | <Elegantbeef> It does not block the main loop |
21:30:13 | FromDiscord | <Phil (he/him)> The primary goal is never ever block the GUI loop |
21:30:17 | om3ga | I tried to understand the diagram, but looks very complicated and not well clear where this can be used |
21:30:48 | FromDiscord | <Elegantbeef> In games and GUI you often want to offload things like mesh generation to another thread and then just upload it to the GPU from the main thread instead of blocking the game to generate a mesh on the main thread |
21:31:03 | om3ga | is there any practical reason to have such tangled parallelism? |
21:31:03 | FromDiscord | <Phil (he/him)> The problem with stuff like e.g. weave and malebolgia I've seen so far is you can parallelize processing easily. But then you need to await.↵During that time your GUI is thus unresponsibe |
21:31:40 | FromDiscord | <Elegantbeef> Wait phil do you spawn a thread that just spawns threads? |
21:31:44 | FromDiscord | <leorize> by moving compute to where they are needed, you solve the problem of message passing by getting rid of them in the first place |
21:31:53 | FromDiscord | <Phil (he/him)> No, that's an option that you have but not the main thing |
21:32:53 | FromDiscord | <Phil (he/him)> You can use a threadpool, you can also just have a handler-proc for a message on Thread B that directly does some computation and sends a response or does a thing. |
21:32:58 | FromDiscord | <Elegantbeef> Yea in the chess example a flowvar you just wait for the present move on seems a bit more sane |
21:34:12 | FromDiscord | <Phil (he/him)> But waiting on a flowvar would block the GUI-loop, no? |
21:34:48 | FromDiscord | <Elegantbeef> `isReady` |
21:35:10 | FromDiscord | <Phil (he/him)> Could you rephrase that? |
21:37:54 | om3ga | what is this? like inotify? |
21:48:55 | * | azimut quit (Ping timeout: 240 seconds) |
21:58:52 | * | xet7 joined #nim |
22:04:52 | FromDiscord | <Elegantbeef> You use the global timeout to check if it's ready, if it's you get the data from the flow var and only block for a brief period |
22:04:54 | FromDiscord | <Elegantbeef> He means the router backend model |
22:04:57 | FromDiscord | <Elegantbeef> Perhaps instead of making tooling around the problem you should make a tic-tac-toe engine and a gui program around it |
22:04:58 | FromDiscord | <Elegantbeef> Dog food a problem to find a solution that works |
22:05:00 | FromDiscord | <Elegantbeef> At least I do not think you have made anything practical whilst developing threadbutler, if you have whoopsies on my part |
22:05:03 | FromDiscord | <Phil (he/him)> I mean, my enthusiasm for threadbutler is basically now so dead I need a bit to recover from that. |
22:05:05 | FromDiscord | <Elegantbeef> By "anything practical" I do not mean threadbutler itself |
22:05:08 | FromDiscord | <Elegantbeef> I just mean a real program along side it |
22:05:09 | FromDiscord | <Phil (he/him)> I mean the entire approach was wrong then. The solution would've more likely been... I guess docs in owlkettle to use taskpools/weave better (I'm not sure if malebolgia is an option since I don't think it can do anything without blocking the gui thread) |
22:05:11 | FromDiscord | <Elegantbeef> leo always letting people down |
22:05:14 | FromDiscord | <Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html> |
22:05:16 | FromDiscord | <Elegantbeef> I cannot wait for you to read my C header generator and to deflate my enthusiasm! 😛 |
22:05:18 | FromDiscord | <Elegantbeef> I mean I was going to but I felt like the user needed to be able to plug code |
22:05:20 | FromDiscord | <Elegantbeef> Rumour has it for a hobby leo goes around to children's birthday party and stabs balloons |
22:05:22 | FromDiscord | <Elegantbeef> Including headers and the like, technically you can generate multiple headers from a single project |
22:05:23 | FromDiscord | <Elegantbeef> Cause it's so poorly documented on how to actually parse AST 😛 |
22:05:25 | FromDiscord | <Elegantbeef> Well sorry not parse AST, but get a semantically analysed AST |
22:05:27 | FromDiscord | <Phil (he/him)> I mean, I guess the nice thing is that I then basically don't need to think about CPS support, which drops one aspect of new complexity |
22:05:29 | FromDiscord | <Phil (he/him)> Since it then boils down to "do it yourself with nim-taskpools if you can" |
22:05:29 | FromDiscord | <Elegantbeef> but yea leo I while ago I worked toyed with using the compiler directly and was stuck in "What the does anything do" hell https://gitlab.com/beef331/seeya/-/blob/main/src/seeya.nim?ref_type=heads |
22:05:31 | FromDiscord | <Phil (he/him)> The mental model (for webdevs) is a lot more trivial which is why I went with it because none of the taskpool solutions make sense unless you've already gotten an understanding of those kinds of solutions and how to distribute computation using them. |
22:05:37 | FromDiscord | <Elegantbeef> Luckily webdevs are too busy clattering away at using the newest framework that came out the minute this message is read by the reader |
22:05:41 | FromDiscord | <Phil (he/him)> And that is not an easy jump |
22:05:42 | FromDiscord | <Elegantbeef> Where each action is a request that takes you down a specific path |
22:05:44 | FromDiscord | <Phil (he/him)> Exactly that.↵Throw out an action into the ether that states "I wanna do X", X results in a state change, that state change results in UI changes if necessary. |
22:05:46 | FromDiscord | <leorize> sent a code paste, see https://play.nim-lang.org/#ix=html> |
22:05:47 | FromDiscord | <leorize> even `asyncdispatch` could do that, but moving closure iterators across threads is not something I've tried, personally |
22:05:48 | FromDiscord | <leorize> ah, sorry about that |
22:05:49 | FromDiscord | <leorize> I had to solve a similar problem in go and unfortunately the solution was to rethink the problem |
22:10:59 | FromDiscord | <Phil (he/him)> Effectively decoupling starting an action from what an action does |
22:11:02 | FromDiscord | <leorize> if you can unify message fetching and async queue then your model will work |
22:11:03 | FromDiscord | <leorize> and a shared threadpool would go a long way |
22:11:05 | FromDiscord | <Phil (he/him)> Effectively decoupling starting an action in the UI from what an action does which in turn is decoupled again from how the changes affect the UI |
22:11:05 | FromDiscord | <leorize> a lot of the problem with that diagram is the implementation I think, I haven't read the actual code, though |
22:12:38 | FromDiscord | <Phil (he/him)> The actual code very much is a reflection of that diagram. |
22:13:46 | FromDiscord | <Phil (he/him)> It's not too complicated (imo)↵It's a while-loop for each threadServer (the gui loop is not necessarily one) that every iteration fetches a message from the queue (which is an object variant) and calls a routing proc which basically is a proc containing a giant switch-case statement that calls a proc you previously registered using a DSL |
22:14:57 | FromDiscord | <Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html> |
22:18:09 | FromDiscord | <leorize> for this model to work well, I think you'd have to do the following simplification\:↵● remove the distinction between async and message processing↵● unify the threadpools, use message passing to deliver resources back to caller |
22:24:32 | FromDiscord | <leorize> this is basically the application of that model I wrote earlier back here, which let you remove the delays due to blocking on async queue (by allowing messages to participate) and remove threadpool blocks |
22:24:35 | FromDiscord | <Phil (he/him)> Wait but I thought the approach with long-running threads like this was the wrong one and instead to solely move specific procs into tasks that run in a taskpool which communicate with the main-thread/GUI-thread using their flowvar which you can check for "is-ready" in the GUI-loop |
22:25:28 | FromDiscord | <Phil (he/him)> Basically you only have one long running thread with the GUI-loop and other than that a threadpool that eats through tasks that you define |
22:26:06 | FromDiscord | <leorize> I just write you the same implementation but applied to your threadbutler |
22:27:50 | FromDiscord | <leorize> in fact you will reach the same model simply because once you can farm out computation this way, it makes less sense to use multiple butlers when you can just threadpool your way through and not having it impede your message receiver loop |
22:28:25 | FromDiscord | <Phil (he/him)> I mean, essentially you will have 0 butlers since you entirely move to threadpool |
22:29:04 | FromDiscord | <leorize> pretty much |
22:32:00 | FromDiscord | <leorize> and like, isn't in web you have the same thing? |
22:32:01 | FromDiscord | <leorize> it's just that you can afford to farm out to a different computer, while here it's the same computer all the way down |
22:40:22 | FromDiscord | <Phil (he/him)> sent a long message, see <!doctype html> |
22:41:01 | FromDiscord | <Phil (he/him)> Depends on how you view it.↵↵Generally the mental model in webdev is you regard the webserver as one thing aka you very much regard it as a single threaded application that "via magic" is multithreaded.You are currently seeing the webserver as a threadpool, which is multiple things and the more technical accurate aspect of it. |
22:44:29 | FromDiscord | <leorize> not really, I view the webserver as a giant work queue, all I care is that I sent work there and I'd have to wait (asynchronously) until that work completes |
22:48:30 | FromDiscord | <leorize> wrt web stuff, I'm of the mind that tech like service workers and wasm not getting a large foothold (in web pages) boils down to insufficient integration with existing event queues and that the messaging scheme is a major overhead both mentally and computationally |
22:52:13 | FromDiscord | <Phil (he/him)> I'd agree, though I'd more describe it as "it's more difficult than existing tooling while only providing sufficient benefits in edgecases" |
22:53:36 | FromDiscord | <Phil (he/him)> Which is why pages with complex and computationally intensive UI like roll20 likely uses wasm (I assume) in their redesign since the possible performance benefit outweighs the complexity drawback |
22:53:58 | FromDiscord | <Phil (he/him)> But other than that... why not just use htmx |
23:08:47 | * | junaid_ joined #nim |
23:11:45 | * | junaid_ quit (Client Quit) |
23:12:48 | * | junaid_ joined #nim |
23:15:01 | * | junaid_ quit (Client Quit) |
23:16:00 | FromDiscord | <scipio_nl> Happy New Year from The Netherlands, everybody! 🎉 🥂 🌟 |
23:18:34 | * | jmdaemon joined #nim |
23:53:32 | * | oprypin quit (Quit: Bye) |
23:53:43 | * | oprypin joined #nim |