00:16:36 | FromDiscord | <sharpcdf> In reply to @ripluke "proof im on arch": shit that looks awesome |
00:16:50 | FromDiscord | <sharpcdf> ive wanted to use arch for a while but im too lazy to set everything up |
00:17:01 | FromDiscord | <sharpcdf> so im just stuck on fedora lol |
00:17:21 | FromDiscord | <# Luke> In reply to @sharpcdf "ive wanted to use": Raw arch really isn't worth it imo |
00:17:34 | FromDiscord | <# Luke> I have used/installed it before many times |
00:18:24 | FromDiscord | <sharpcdf> yea i dont really know what to install if i start using it so im kind of stuck on yt tutorials and wikis |
00:19:12 | FromDiscord | <sharpcdf> oh wait thats garuda lol |
00:19:14 | FromDiscord | <# Luke> Lol instead of raw arch try something like endeavorOS or Garuda linux |
00:19:16 | FromDiscord | <sharpcdf> is garuda arch based? |
00:19:19 | FromDiscord | <# Luke> In reply to @sharpcdf "is garuda arch based?": Yea |
00:19:23 | FromDiscord | <sharpcdf> i tried endeavor before i didnt really like it |
00:19:29 | FromDiscord | <# Luke> Og |
00:19:30 | FromDiscord | <sharpcdf> garuda seems nice |
00:19:36 | FromDiscord | <# Luke> (edit) "Og" => "Oh" |
00:19:54 | FromDiscord | <sharpcdf> like deadass that desktop is the nicest setup ive ever seen on linux |
00:19:59 | FromDiscord | <sharpcdf> at least yours |
00:20:12 | FromDiscord | <# Luke> In reply to @sharpcdf "garuda seems nice": It is, it has heavy btrfs integration, backing up your system after every update |
00:20:30 | FromDiscord | <# Luke> In reply to @sharpcdf "like deadass that desktop": 💀 I actually designed it on endeavor lol |
00:20:37 | FromDiscord | <sharpcdf> lmao |
00:20:48 | FromDiscord | <sharpcdf> what desktop environment do you use |
00:20:49 | FromDiscord | <# Luke> I just put my dots on GitHub so it was easy to get it on Garuda too |
00:21:45 | FromDiscord | <# Luke> In reply to @sharpcdf "what desktop environment do": None lol I use a wm ↵https://en.m.wikipedia.org/wiki/Tiling_window_manager |
00:21:55 | FromDiscord | <# Luke> I use riverwm |
00:22:04 | FromDiscord | <# Luke> Which is written in zig |
00:22:11 | FromDiscord | <sharpcdf> damn nice |
00:22:30 | FromDiscord | <# Luke> Lol if someone writes a Wayland compositor in nim I'll switch to lmao |
00:22:43 | FromDiscord | <# Luke> (edit) "Lol if someone writes a Wayland compositor in nim I'll switch to ... lmao" added "it" |
00:22:53 | FromDiscord | <Elegantbeef> I mean i have some wacky ideas for the one i plan on writting |
00:23:01 | FromDiscord | <Elegantbeef> Not overly coventional |
00:23:20 | FromDiscord | <Elegantbeef> conventional is how to spell it |
00:24:29 | FromDiscord | <sharpcdf> i never really knew what a window manager is, thought it was just a type of mod for desktop environments |
00:24:37 | FromDiscord | <# Luke> In reply to @Elegantbeef "Not overly coventional": I love stuff that defies conventions |
00:24:55 | * | lumo_e quit (Quit: Quit) |
00:24:58 | FromDiscord | <# Luke> In reply to @sharpcdf "i never really knew": Well basically a window manager is what manages the windows in a desktop environment |
00:25:10 | FromDiscord | <# Luke> But you can run it without a desktop environment |
00:25:27 | FromDiscord | <sharpcdf> is it possible to get fedora without a desktop environment and just use a window manager 😳 |
00:25:48 | FromDiscord | <sharpcdf> In reply to @ripluke "proof im on arch": like your taskbar on top looks so good |
00:25:53 | FromDiscord | <# Luke> In reply to @sharpcdf "is it possible to": Yea they have an i3 spin |
00:25:56 | FromDiscord | <sharpcdf> i cant explain it its just the nicest thing ever |
00:26:26 | FromDiscord | <Elegantbeef> One thing i'm thinking about is a carousel instead of tags/numbers, i find numbered workspaces hell on earth |
00:26:40 | FromDiscord | <Elegantbeef> Having more than a single monitor makes it so tedious to use |
00:26:40 | FromDiscord | <sharpcdf> In reply to @ripluke "Yea they have an": wheres that |
00:27:02 | FromDiscord | <sharpcdf> i really just want a distro thats simple af but still looks nice and easy to use |
00:27:37 | FromDiscord | <sharpcdf> like it doesnt come with all of the apps predownloaded and you're able to switch windows and launch apps but nothing else |
00:27:52 | FromDiscord | <# Luke> In reply to @sharpcdf "i cant explain it": Oh lol thx |
00:28:22 | FromDiscord | <Elegantbeef> I also want that wasm controlled layout logic |
00:28:59 | FromDiscord | <# Luke> In reply to @sharpcdf "wheres that": You’d have to completely reinstall fedora tho |
00:29:14 | FromDiscord | <# Luke> The better way is to just download a window manager with dnf |
00:29:28 | FromDiscord | <# Luke> Then on your login screen you can select it |
00:29:37 | FromDiscord | <sharpcdf> oh ok |
00:30:08 | FromDiscord | <sharpcdf> did you download a plugin/extension or something for your taskbar |
00:30:16 | FromDiscord | <# Luke> Oh also we should move to off topic or dms |
00:30:20 | FromDiscord | <sharpcdf> how do you get those custom icons 😩 |
00:30:23 | FromDiscord | <# Luke> (edit) "off topic" => "#offtopic" |
00:30:24 | FromDiscord | <sharpcdf> oh ywa |
00:30:32 | FromDiscord | <Elegantbeef> Welcome to tiling window managers it takes about 300 years to configure it |
00:33:55 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Welcome to tiling window": HerbstluftWM took me 2-3h and it was the second time using a tiling wm lollll uwu |
00:34:26 | FromDiscord | <Elegantbeef> It's my most like TWM i've used |
00:37:56 | FromDiscord | <TryAngle> can we rewrite rust compiler in nim as april fools ? |
00:38:52 | FromDiscord | <TryAngle> before it happens the other way around but unironically 😔✊ |
00:58:22 | * | cyraxjoe quit (Quit: I'm out!) |
01:00:25 | * | cyraxjoe joined #nim |
01:00:56 | FromDiscord | <Rika> That’s gonna be difficult |
01:10:31 | NimEventer | New Nimble package! monerorpc - Library for interacting with Monero wallets via RPC., see https://github.com/eversinc33/nim-monero-rpc |
01:18:31 | * | noeontheend joined #nim |
01:26:10 | FromDiscord | <creikey> why does a try catch on Exception not catchAssertionDefect? |
01:26:12 | FromDiscord | <creikey> (edit) "catchAssertionDefect?" => "catch AssertionDefect?" |
01:27:58 | FromDiscord | <Elegantbeef> Cause defects are not to be caught |
01:29:13 | FromDiscord | <Elegantbeef> If you want to catch them you can do `--panics:off` |
01:29:44 | FromDiscord | <Elegantbeef> In most cases defects indicate an issue with the coded that should be resolved and not ignored |
01:39:27 | FromDiscord | <creikey> In reply to @Elegantbeef "In most cases defects": this is more just in case there are defects I don't want the whole server to crash, I want to just log it and keep running the server without losing the state |
01:39:50 | FromDiscord | <creikey> I could be serializing state to disk to make it fault tolerant to server restarts, but you can't serialize websocket connections |
01:39:59 | FromDiscord | <Elegantbeef> Yep welcome to the issue with defects in Nim, they're a good idea but are not tracked in the effect system |
01:39:59 | FromDiscord | <creikey> (edit) "I could be serializing state to disk to make it fault tolerant to server restarts, but you can't serialize websocket connections ... " added "so every player would still be kicked" |
01:40:12 | FromDiscord | <creikey> In reply to @Elegantbeef "If you want to": is this a good toggle or no |
01:40:13 | FromDiscord | <creikey> (edit) "no" => "no?" |
01:40:28 | FromDiscord | <Elegantbeef> I mean if you want to have defects turned into exceptions sure |
01:40:41 | FromDiscord | <creikey> alright cool |
01:41:23 | FromDiscord | <Elegantbeef> It's annoying that even with panic off it doesnt track defects |
01:44:10 | FromDiscord | <Rika> A good amount of people disagree with each other whether something should be a defect or not |
03:02:43 | * | toluene quit (Read error: Connection reset by peer) |
03:03:39 | * | toluene joined #nim |
03:10:40 | FromDiscord | <# Luke> In reply to @TryAngle "can we rewrite rust": but thats like next year tho :( |
03:13:50 | * | noeontheend quit (Ping timeout: 240 seconds) |
03:22:46 | FromDiscord | <b1rdf00d> do enums still need the hungarian notation, or is it a 2.0 thing where it'll no longer be needed? |
03:24:06 | FromDiscord | <Elegantbeef> OverloadableEnums exist now so with that flag they dont |
03:24:18 | FromDiscord | <b1rdf00d> thanks! |
03:24:56 | FromDiscord | <Elegantbeef> Though i think there is an issue with them and other types |
03:25:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44Gw |
03:30:31 | FromDiscord | <b1rdf00d> sent a code paste, see https://play.nim-lang.org/#ix=44Gx |
03:31:39 | FromDiscord | <b1rdf00d> anyway, going to try using an enum instead of inheritance while following the ray tracing in one weekend book |
03:31:44 | FromDiscord | <Elegantbeef> What? |
03:32:19 | FromDiscord | <Elegantbeef> The "issue" ii'd argue is there is no ambiguity when you have an enum field and a type field named the same |
03:33:30 | FromDiscord | <Elegantbeef> But anyway yes you dont need the weird prefix notation anymore with the experimental flag |
03:34:43 | FromDiscord | <b1rdf00d> and `MyEnum.A != A` in your snippet right? so you need to check which enum field you have then switch on that for which object you want |
03:35:15 | FromDiscord | <b1rdf00d> (I'm following this: https://nim-lang.org/docs/manual.html#types-object-variants) |
03:36:04 | * | arkurious quit (Quit: Leaving) |
03:36:34 | FromDiscord | <Elegantbeef> I'm not talking about object variants |
03:37:05 | FromDiscord | <Elegantbeef> I'm saying even with the new overlodable enums a enum field and type name cannot be the same if declared in the same module |
03:39:04 | FromDiscord | <b1rdf00d> Ah okay, so it just lets you name unrelated fields the same thing |
03:39:10 | FromDiscord | <b1rdf00d> (edit) "thing" => "thing?" |
03:39:22 | FromDiscord | <Elegantbeef> I dont know what you're talking about |
03:40:26 | FromDiscord | <b1rdf00d> I guess I don't understand enough, thanks for the help |
03:40:40 | FromDiscord | <Rika> The name of the type he made and the enum he made clash |
03:41:07 | FromDiscord | <Rika> They can’t work now, but before it did because enums needed to be distinguished with the “parent type” name |
03:44:56 | FromDiscord | <voidwalker> how fast is on average a reply on the forum? |
03:45:14 | FromDiscord | <voidwalker> and do we get beef and enthusiasts working there/ |
03:45:16 | FromDiscord | <Elegantbeef> Depends on the topic, it can be instant |
03:45:21 | FromDiscord | <# Luke> ^ |
03:45:53 | FromDiscord | <Elegantbeef> It's better than here if it's obscure as inane ramblings dont hide it |
03:48:00 | FromDiscord | <Elegantbeef> Everyone knows realtime chats are for realtime idiots |
03:50:33 | FromDiscord | <TryAngle> In reply to @ripluke "but thats like next": enough time to prepere |
03:51:08 | FromDiscord | <# Luke> Nim rust backend 🤨 |
03:51:09 | FromDiscord | <TryAngle> In reply to @Elegantbeef "OverloadableEnums exist now so": do u use CamelCase now? |
03:52:05 | FromDiscord | <Elegantbeef> I still do lower case camelcase |
04:14:00 | FromDiscord | <creikey> why is vscode linting complaining about this async macro when it compiles fine? https://media.discordapp.net/attachments/371759389889003532/998442489138663434/unknown.png |
04:14:18 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/998442565676310528/unknown.png |
04:15:55 | FromDiscord | <Rika> That’s spurious |
04:16:04 | FromDiscord | <Rika> Change the file and save then change it back then save |
04:26:18 | FromDiscord | <untoreh> can I do anything about these kind of segfaults?↵https://pastebin.com/raw/MQTmw2Rc |
04:27:25 | FromDiscord | <Rika> Chronos probably doesn’t work with ARC |
04:27:34 | FromDiscord | <untoreh> mmh |
04:54:23 | FromDiscord | <# Luke> I got my image colorizer (dye) to convert a 1080p image in 13 seconds and a 6k image in 130 second |
04:54:36 | FromDiscord | <# Luke> (edit) "130" => "140" |
04:54:40 | FromDiscord | <# Luke> (edit) "second" => "seconds" |
04:57:28 | FromDiscord | <Elegantbeef> Is you repo updated? |
05:11:10 | * | fallback quit (Remote host closed the connection) |
05:11:47 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44GR |
05:18:26 | FromDiscord | <Elegantbeef> You use codegendecl if you need |
05:20:19 | FromDiscord | <Elegantbeef> It likely doesnt matter |
05:21:20 | FromDiscord | <Elegantbeef> Reading about that attribute it only matters if you want to change the accessing for external linking |
05:28:16 | FromDiscord | <sOkam!> wdym? not sure i follow all that last sentence means |
05:28:29 | FromDiscord | <Elegantbeef> If you dont follow you probably dont need to care |
05:28:46 | FromDiscord | <sOkam!> i didn't code the thing. i might be missing something |
05:29:02 | FromDiscord | <sOkam!> the dll interfaces with a game engine I didn't code |
05:29:06 | FromDiscord | <Elegantbeef> So what? |
05:29:22 | FromDiscord | <sOkam!> so i don't know if i don't know, because i can't know if im missing something |
05:29:50 | FromDiscord | <Elegantbeef> That attribute only allows you to override the linking visibility, so if you dont provide it it's fine |
05:30:15 | FromDiscord | <sOkam!> how can i know if i provide it? |
05:30:27 | FromDiscord | <Elegantbeef> What? |
05:30:33 | FromDiscord | <sOkam!> its what you said |
05:30:46 | FromDiscord | <sOkam!> "if you don't provide it its fine".... how do i know if im providing it or not? |
05:30:58 | FromDiscord | <Elegantbeef> Did you write a codegendecl pragma to provide it? |
05:31:20 | FromDiscord | <sOkam!> no i didn't, but that doesn't mean its not there or i don't need it |
05:31:56 | FromDiscord | <sOkam!> its my first line of code on the thing, the very first word to be precise, so i understand little about what i should or shouldnt be doing currently |
05:32:23 | FromDiscord | <Elegantbeef> It just allows the user to control the visabillity of procedures for linking |
05:32:26 | FromDiscord | <Elegantbeef> It's a nothing burger |
05:32:49 | FromDiscord | <Elegantbeef> If your build system doesnt override the default linking it only exists to annoy you |
05:33:13 | FromDiscord | <Elegantbeef> Copy what you pasted into your favourite search engine and read the writeups other people have written |
05:36:20 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44GU |
05:36:30 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=44GU" => "https://play.nim-lang.org/#ix=44GV" |
05:36:46 | FromDiscord | <sOkam!> and dunno if related or not, but it also strips them |
05:37:05 | FromDiscord | <Elegantbeef> Just make your nim library |
05:37:07 | FromDiscord | <Elegantbeef> Test it |
05:37:12 | FromDiscord | <Elegantbeef> If it doesnt work use codegendecl |
05:37:25 | FromDiscord | <Elegantbeef> I dont think it matters but i could be wrong |
05:38:24 | FromDiscord | <Elegantbeef> If you do need it you can use codegendecl to emit specific C code https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-codegendecl-pragma |
05:51:20 | FromDiscord | <sOkam!> is `shared` a reserved keyword in nim? |
05:51:50 | FromDiscord | <Elegantbeef> There arent many reserved keywords |
05:52:32 | FromDiscord | <sOkam!> must be the nim plugin freaking out, its highlighting it in another color 🤔 |
05:52:48 | NimEventer | New Nimble package! njo - A small utility to create JSON objects written in Nim. This is inspired by jpmens/jo., see https://github.com/uga-rosa/njo |
05:53:18 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/998467476226572298/image.png |
06:22:57 | * | pch quit (Quit: Leaving) |
06:27:00 | FromDiscord | <jmgomez> hey guys, Im trying to go from string -> type -> implementation in a macro, I was kind of able to do so via bindSym with (experimental dynamicBindSym) the problem is that the type that I want to introspect is known at invocation time and it seems like bindSym only knows about the context at definition time? Is there any other way to get there? |
06:27:46 | FromDiscord | <Elegantbeef> You need to store all the types you're interested in in a list and use some type id to figure out which it is |
06:28:39 | FromDiscord | <Elegantbeef> 'invocation time ' does this mean at the macro or program? |
06:29:10 | FromDiscord | <jmgomez> I meant when I call the macro |
06:29:22 | FromDiscord | <Elegantbeef> Ok so this is at compile time |
06:29:42 | FromDiscord | <Elegantbeef> what's the macro do? |
06:34:59 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=44H0 |
06:35:55 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=44H1 |
06:36:05 | FromDiscord | <jmgomez> The rest of the calls arent relevant |
06:37:08 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=44H2 |
06:37:26 | FromDiscord | <Elegantbeef> I dont get why you need to bind the symbols |
06:38:04 | FromDiscord | <jmgomez> That's kind of the question, Im not sure if there is another way besides binding it to go from string to type |
06:38:22 | FromDiscord | <Elegantbeef> You cannot, the question i'm having is more why do you need to |
06:38:57 | FromDiscord | <jmgomez> because it has a signature inside that I need in order to generate a function that will be used, that's a user defined type |
06:39:37 | FromDiscord | <Elegantbeef> Can you not just defer it to another macro? |
06:41:39 | FromDiscord | <jmgomez> how so? Im not following. The general process is DSL -> Model with the Data -> GenNimTypes -> EmitUETypes. That's the first step, if I lack the data there it will be problematic, but if therer is not other way.. |
06:42:02 | FromDiscord | <Elegantbeef> `multicastDynOneParamNim: FDynamicMulticastDelegateOneParamTest` is the problem right? |
06:42:26 | FromDiscord | <Elegantbeef> Can you not just emit a `typeof(FDynamicMulticastDelegateOneParamTest`? |
06:42:34 | FromDiscord | <jmgomez> yes, but there will be more. I need to discriminate there if it's a regular field or a "delegate" |
06:43:04 | FromDiscord | <jmgomez> at that point so I can change the underlaying data (UEField) accordingly |
06:43:33 | FromDiscord | <Elegantbeef> Is it not possible to just emit a macro to handle that? |
06:43:52 | FromDiscord | <Elegantbeef> Sorry I'm trying to get how this works |
06:44:40 | FromDiscord | <jmgomez> So you are saying to do another pass once is it emitted or something? I dont get where I should do it so it will make a difference |
06:44:55 | FromDiscord | <Elegantbeef> Well i dont get what this is generating |
06:47:32 | FromDiscord | <Elegantbeef> This i assume is generating a Nim typedef and calls to connect to unreal |
06:47:57 | FromDiscord | <jmgomez> sent a long message, see http://ix.io/44H5 |
06:48:23 | FromDiscord | <jmgomez> (edit) "http://ix.io/44H5" => "http://ix.io/44H6" |
06:48:51 | FromDiscord | <Elegantbeef> Ok so what does the above DSL generate in your ideal world? |
06:50:05 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=44H7 |
06:50:22 | FromDiscord | <jmgomez> (edit) |
06:51:31 | FromDiscord | <jmgomez> It generates that model. In the particular case of the issue, I need to know the shape of the type so I can see if it's an uefDelegate or an uefProp. If it's the former I need to setup the signature. For the later it's already working as it is |
06:52:22 | FromDiscord | <Elegantbeef> so what change is required if it's a delegate vs prop? |
06:54:58 | FromDiscord | <jmgomez> based on it I push different Nim code and different Unreal code. I guess I can work around those and do it another way if the type cant be inspected but it's just non convenient.. |
06:55:54 | FromDiscord | <Elegantbeef> Yea i'd suggest to try to do it lazily if possible by emitting a either a macro call or a when statement |
06:56:11 | FromDiscord | <Elegantbeef> I'm truthfully lost at what's going on i need a good before and after to see the issue |
06:59:55 | FromDiscord | <jmgomez> Im doing something similar to defer the call that will happen at runtime by wrapping it into a function, you are saying that the same can be done with a macro? |
07:00:11 | FromDiscord | <Elegantbeef> A macro or a when statement |
07:00:13 | FromDiscord | <Elegantbeef> Probably |
07:01:10 | FromDiscord | <jmgomez> ok, will see if I can make that to work. Thank you for your time! |
07:26:37 | * | gsalazar joined #nim |
07:43:18 | * | Jjp137 quit (Ping timeout: 264 seconds) |
07:43:36 | * | Jjp137 joined #nim |
07:52:18 | * | wallabra quit (Ping timeout: 264 seconds) |
08:15:16 | * | fallback joined #nim |
08:17:45 | FromDiscord | <Dale> Ah that is super interesting! |
08:18:38 | FromDiscord | <Dale> I'm building an engine that is sorta UE inspired, I intend to make macros/templates that work similarly, so I can annotate things to make them appear in the editor and such |
08:20:03 | FromDiscord | <Dale> Thinking of ditching OOP for it in favour of ECS though. I really like the idea of systems consolidating logic to one place so it's really easy to comprehend things |
08:23:50 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44Hp |
08:25:11 | FromDiscord | <huantian> Can you cast ints to procs?? I have no idea lol |
08:25:37 | FromDiscord | <sOkam!> ints to procs? why? |
08:26:48 | FromDiscord | <Rika> In reply to @huantian "Can you cast ints": You can cast anything into anything |
08:26:59 | FromDiscord | <Rika> Whether it will work or not is another thing |
08:30:53 | FromDiscord | <huantian> True |
08:33:12 | * | clemens3 joined #nim |
08:33:16 | * | clemens3 quit (Client Quit) |
08:35:49 | * | clemens3 joined #nim |
08:41:24 | * | xet7_ joined #nim |
08:41:30 | * | xet7 quit (Ping timeout: 264 seconds) |
09:02:26 | FromDiscord | <aruZeta> is there some way to know if a nnkCall is a call to proc or a macro? |
09:02:49 | FromDiscord | <Elegantbeef> `getImpl` on the first node |
09:08:31 | FromDiscord | <aruZeta> sent a code paste, see https://paste.rs/wrc |
09:08:48 | FromDiscord | <Elegantbeef> Well yea |
09:08:51 | FromDiscord | <Elegantbeef> `untyped` |
09:09:04 | FromDiscord | <Elegantbeef> untyped macros are not semantically checked so it's not a call to a macro or procedure |
09:09:16 | FromDiscord | <aruZeta> hmm |
09:09:17 | FromDiscord | <Elegantbeef> Well the input to them |
09:09:30 | * | lumo_e joined #nim |
09:09:31 | FromDiscord | <Elegantbeef> all you know is it it's a call |
09:09:35 | FromDiscord | <aruZeta> yes |
09:09:59 | FromDiscord | <Elegantbeef> You can do a secondary macro call if you need to or make it typed |
09:10:26 | FromDiscord | <aruZeta> needs to be untyped |
09:10:38 | FromDiscord | <aruZeta> what about that secondary macro call ? |
09:12:13 | FromDiscord | <aruZeta> maybe a way to call the proc/macro? |
09:12:23 | FromDiscord | <aruZeta> (edit) "proc/macro?" => "proc/macro itself?" |
09:13:16 | FromDiscord | <Elegantbeef> What? |
09:13:45 | FromDiscord | <Elegantbeef> If you want to insert a call to the above you can do `newCall(bindSym"errorIfMacro", myCall)` |
09:15:22 | FromDiscord | <aruZeta> ohh |
09:15:36 | FromDiscord | <aruZeta> have seen the `bindSym` before, but what is it? |
09:15:50 | FromDiscord | <Elegantbeef> It searches the scope of the macro and captures the symbol of that name |
09:15:58 | FromDiscord | <Elegantbeef> This way you dont have to export `errorIfMacro` |
09:16:14 | FromDiscord | <aruZeta> ohh, thanks |
09:16:17 | FromDiscord | <Elegantbeef> It allows you to not leak internal implementations |
09:16:28 | FromDiscord | <aruZeta> i see, that's nice |
09:19:10 | * | rockcavera quit (Remote host closed the connection) |
09:21:31 | FromDiscord | <aruZeta> what's a nnkHiddenDeref? |
09:22:10 | FromDiscord | <Elegantbeef> `var T` parameters are pointers and as such they require a dereference to access |
09:23:03 | FromDiscord | <aruZeta> more or less what I thought, thanks |
09:53:02 | NimEventer | New Nimble package! entgrep - A grep but for secrets (based on entropy)., see https://github.com/srozb/entgrep |
10:38:04 | FromDiscord | <sOkam!> How would you access a specific C pointer from a dll? |
10:38:15 | FromDiscord | <sOkam!> (edit) "How would you access a specific C pointer from a ... dll?" added "Nim" |
10:40:01 | FromDiscord | <enthus1ast> @sOkam!\: could you be more specific? |
10:41:33 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/ixN |
10:42:07 | FromDiscord | <sOkam!> I need to reach that syscallptr in some way, so that I can use it from Nim to access the engine from the dll |
10:42:30 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=44HL" => "https://play.nim-lang.org/#ix=44HK" |
10:42:46 | FromDiscord | <enthus1ast> and you load the nim dll into the engine? |
10:42:54 | FromDiscord | <sOkam!> yep, that's the goal |
10:44:44 | FromDiscord | <enthus1ast> does the engine has some kind of module interface? Or how do you gonna do it? |
10:46:59 | FromDiscord | <enthus1ast> i'm asking because, if the engine has a module interface, then it would tell you somehow where the functionalitly is |
10:47:21 | FromDiscord | <sOkam!> what do you mean by module interface? |
10:47:39 | FromDiscord | <enthus1ast> engine == ue? |
10:47:41 | FromDiscord | <sOkam!> the engine works and loads dll normally, i'm just trying to port the C code into Nim instead |
10:47:49 | FromDiscord | <sOkam!> no, q3 engine |
10:48:16 | FromDiscord | <enthus1ast> so it just loads the dll and calls dll main? |
10:48:55 | FromDiscord | <sOkam!> it calls dll main, but then you can, from the dll, ask the engine to do things with that syscall pointer |
10:49:25 | FromDiscord | <enthus1ast> ah so it also calls dllEntry from your dll? |
10:50:16 | FromDiscord | <sOkam!> the engine calls dllEntry after it has been loaded, and gives it the pointer |
10:51:57 | FromDiscord | <sOkam!> In reply to @enthus1ast "ah so it also": https://github.com/ec-/Quake3e/blob/5d67c15d2c6c47931218ac218c1095e61cbd8735/code/qcommon/vm.c#L1712-L1721 |
10:53:25 | FromDiscord | <sOkam!> The problem is that the documentation for interfacing with the ffi is crazy sparse, so I'm super lost in how to approach it |
10:53:41 | FromDiscord | <sOkam!> (edit) "The problem is that the documentation for interfacing with the ffi ... is" added "(if that's even what i have to do)" |
10:55:17 | FromDiscord | <enthus1ast> can you post the documentation of the q3 engine where they describe the modules (or whatever you do) |
10:55:23 | FromDiscord | <sOkam!> 😄 |
10:55:37 | FromDiscord | <sOkam!> documentation in q3 engine, funny. there is barely any |
10:56:55 | FromDiscord | <mratsim> In reply to @sOkam! "the engine works and": use c2nim |
10:57:17 | FromDiscord | <sOkam!> In reply to @mratsim "use c2nim": yes, that solves the translation part. but not the interfacing part |
10:57:32 | FromDiscord | <sOkam!> the issue is in the interfacing |
10:58:25 | FromDiscord | <mratsim> In reply to @sOkam! "yes, that solves the": This seems like a callback parameter? the only tricky part is ensuring cdecl |
10:58:36 | FromDiscord | <enthus1ast> and varargs |
10:59:54 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=44HO |
11:00:12 | FromDiscord | <sOkam!> In reply to @mratsim "This seems like a": probably, ye |
11:01:16 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=44HR |
11:01:35 | FromDiscord | <mratsim> (edit) "https://play.nim-lang.org/#ix=44HR" => "https://play.nim-lang.org/#ix=44HS" |
11:03:16 | FromDiscord | <mratsim> (edit) "https://play.nim-lang.org/#ix=44HS" => "https://play.nim-lang.org/#ix=44HT" |
11:05:02 | FromDiscord | <sOkam!> @mratsim that looks super similar 🤔 |
11:06:57 | FromDiscord | <mratsim> In reply to @sOkam! "<@570268431522201601> that looks super": and for syscallptr, it's likely this function: https://github.com/mratsim/weave/blob/a230cce98a8524b2680011e496ec17de3c1039f2/weave/primitives/futex_linux.nim#L23= |
11:07:52 | FromDiscord | <mratsim> ah no, the equivalent on windows |
11:08:39 | FromDiscord | <mratsim> or your VM has a syscall concept maybe? |
11:09:30 | FromDiscord | <sOkam!> In reply to @mratsim "or your VM has": syscall as in? |
11:09:44 | FromDiscord | <sOkam!> the callback is called `syscall`... so |
11:09:56 | FromDiscord | <sOkam!> dunno if you mean that, or something else that's named the same |
11:10:11 | FromDiscord | <enthus1ast> it prolly is this https://github.com/id-Software/Quake-III-Arena/blob/dbe4ddb10315479fc00086f08e25d968b4b43c49/code/game/g_syscalls.c |
11:10:25 | FromDiscord | <enthus1ast> but who knows, to less information |
11:10:32 | FromDiscord | <sOkam!> In reply to @enthus1ast "it prolly is this": `ui_syscalls.c`, but yes |
11:11:08 | FromDiscord | <sOkam!> there are 3 dll loaded for gamecode. `g`, `cg` and `ui`. that one is specifically g, but currently porting ui |
11:12:36 | * | gsalazar quit (Remote host closed the connection) |
11:14:16 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44HU |
11:15:07 | FromDiscord | <mratsim> Probably syscallptr is supposed to be an array/table |
11:16:02 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44HV |
11:16:03 | FromDiscord | <sOkam!> ye i think so |
11:16:09 | FromDiscord | <enthus1ast> so this means, this dllEntry code is in a dll |
11:16:13 | FromDiscord | <enthus1ast> and is exported |
11:16:18 | FromDiscord | <enthus1ast> so the game calls it |
11:16:25 | FromDiscord | <sOkam!> yep, qexport is so that the variable is not hidden with fvisibility=hidden |
11:16:48 | FromDiscord | <sOkam!> (edit) "variable" => "function" |
11:17:08 | FromDiscord | <sOkam!> In reply to @enthus1ast "so this means, this": yep, exactly |
11:17:09 | * | gsalazar joined #nim |
11:17:42 | FromDiscord | <sOkam!> This is how the engine loads the dll↵https://github.com/ec-/Quake3e/blob/5d67c15d2c6c47931218ac218c1095e61cbd8735/code/qcommon/vm.c#L1712-L1721 |
11:23:53 | FromDiscord | <enthus1ast> qcommon.h\:typedef intptr\_t (QDECL \dllSyscall\_t)( intptr\_t callNum, ... ); |
11:25:22 | FromDiscord | <enthus1ast> (my c is weak) but i think this is a function pointer to call various stuff in the quake vm right? |
11:25:37 | FromDiscord | <sOkam!> yep |
11:26:25 | FromDiscord | <sOkam!> it allows the dll to do something like `trap_The_EngineFunction()` and make the code execute native in the engine, instead of inside the vm/dll |
11:27:22 | FromDiscord | <enthus1ast> so this means, in your nimdll you can have a global `syscall` which you set when the engine calls dllEntry |
11:27:44 | FromDiscord | <enthus1ast> then you use this pointer to call engine funcitons |
11:27:50 | FromDiscord | <sOkam!> yep, that's the idea |
11:28:33 | FromDiscord | <sOkam!> that's why I was asking "how do i access a very specific pointer from the dll", trying to reach this callback pointer |
11:29:09 | FromDiscord | <sOkam!> (edit) "that's why I was asking "how do i access a very specific pointer ... fromnim" added "of the C code" | "of the C codefrom the ... dll"," added "nim" |
11:29:34 | FromDiscord | <enthus1ast> the engine gives the pointer to you in dllEntry |
11:31:35 | FromDiscord | <enthus1ast> you cast it to the correct proc signature and call it |
11:31:39 | FromDiscord | <enthus1ast> like a normal function |
11:32:49 | * | toluene quit (Quit: Ping timeout (120 seconds)) |
11:33:25 | FromDiscord | <enthus1ast> and the sig is this\:↵typedef intptr\_t (QDECL \dllSyscall\_t)( intptr\_t callNum, ... ); |
11:34:50 | FromDiscord | <sOkam!> seems to be the same text that its used as parameter in `dllEntry` |
11:34:53 | * | toluene joined #nim |
11:34:56 | FromDiscord | <sOkam!> just different variable names |
11:35:16 | FromDiscord | <enthus1ast> yes |
11:35:46 | FromDiscord | <enthus1ast> now you must find a list of params |
11:35:58 | FromDiscord | <enthus1ast> or search in the code |
11:36:39 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44I0 |
11:37:02 | FromDiscord | <enthus1ast> i would create a type for the syscall |
11:37:22 | FromDiscord | <sOkam!> how? wdym? |
11:37:24 | FromDiscord | <enthus1ast> syscallptr\: proc (arg\: intptr\_t)\: intptr\_t {.varargs.}) |
11:38:04 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44I2 |
11:39:09 | FromDiscord | <enthus1ast> then you can do cast[QSyscall](thePointerFromTheEngine)(my, params, to, the, syscallinterface) |
11:40:04 | FromDiscord | <enthus1ast> what the params are, i do not know, maybe they have a list of stuff you can do |
11:40:23 | FromDiscord | <sOkam!> yeah, the interface after its fine, i can handle the params |
11:40:34 | FromDiscord | <enthus1ast> yeah thats all i guess |
11:40:36 | FromDiscord | <sOkam!> its the interfacing that i'm struggling with big time |
11:41:37 | FromDiscord | <enthus1ast> dllEntry(syscallptr\: pointer) .... should be enough |
11:41:41 | FromDiscord | <enthus1ast> you later cast it anyhow |
11:43:23 | FromDiscord | <sOkam!> oh, you don't use :qsyscall as the type for the input? |
11:43:39 | FromDiscord | <enthus1ast> maybe you also can |
11:46:32 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44I3 |
11:47:07 | FromDiscord | <enthus1ast> idk if this works withouth explicit cast↵`syscall:Syscall = syscallptr` |
11:47:27 | FromDiscord | <enthus1ast> also intptr\_t is prolly just pointer but not sure |
11:47:43 | FromDiscord | <sOkam!> its an int, but has some properties for casting pointers |
11:47:49 | FromDiscord | <sOkam!> for all the rest, its an int |
11:47:57 | FromDiscord | <enthus1ast> k then int |
11:47:58 | FromDiscord | <Dale> What's the best way to flatten a seq of strings? |
11:48:05 | FromDiscord | <enthus1ast> join |
11:48:38 | FromDiscord | <Dale> sent a code paste, see https://play.nim-lang.org/#ix=44I4 |
11:48:48 | FromDiscord | <Dale> Ah, thanks. Is that in seqUtils? |
11:49:10 | FromDiscord | <enthus1ast> strutils imho |
11:50:07 | FromDiscord | <Dale> Yeah I just found it |
11:50:08 | FromDiscord | <Dale> Thanks :) |
11:50:12 | FromDiscord | <sOkam!> how do you correctly cast the pointer to the proc type? |
11:50:30 | FromDiscord | <enthus1ast> `cast[QSyscall](thePointerFromTheEngine)(my, params, to, the, syscallinterface)` |
11:50:46 | FromDiscord | <enthus1ast> or just `cast[QSyscall](thePointerFromTheEngine)` |
11:51:40 | FromDiscord | <sOkam!> does that output anything, and I should store it? |
11:52:26 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44I6 |
11:54:07 | FromDiscord | <enthus1ast> think it also returns stuff |
11:55:48 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44I8 |
11:56:10 | FromDiscord | <enthus1ast> yeah, only idk if nim has a intptr\_t |
11:56:34 | FromDiscord | <sOkam!> intptr is just a typedef int |
11:56:47 | FromDiscord | <enthus1ast> ah ans syscall should be a global, i think you will not do all your module stuff in dllEntry or? |
11:56:50 | FromDiscord | <enthus1ast> and |
11:57:24 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=44I8" => "https://play.nim-lang.org/#ix=44I9" |
11:57:52 | FromDiscord | <sOkam!> yeah, forgot to get it outside of it for the example |
12:21:02 | FromDiscord | <Meowing Cat> deos this language still exist? |
12:21:35 | FromDiscord | <Meowing Cat> where is steak bot???? |
12:30:02 | FromDiscord | <pruno> sent a code paste, see https://play.nim-lang.org/#ix=44Id |
12:30:59 | FromDiscord | <enthus1ast> there is https://nim-lang.org/docs/strutils.html#multiReplace%2Cstring%2Cvarargs%5B%5D |
12:31:15 | FromDiscord | <enthus1ast> but idk if they can replace any binary |
12:31:32 | FromDiscord | <enthus1ast> think a few procs in strutils could not handle \\00 but do not know which |
12:33:36 | FromDiscord | <enthus1ast> or replace with strings\: a.replace("\\ff\\d9", "\\00\\00") |
12:38:23 | FromDiscord | <pruno> Thanks :) |
12:38:24 | FromDiscord | <pruno> sent a code paste, see https://play.nim-lang.org/#ix=44If |
12:38:26 | * | toluene quit (Read error: Connection reset by peer) |
12:40:08 | * | toluene joined #nim |
12:40:42 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44Ig |
12:43:45 | FromDiscord | <pruno> In reply to @enthus1ast "another option, if you": Well another quick question, how could i find those offsets ? Like a python a.find("mystring") ? |
12:45:01 | FromDiscord | <enthus1ast> ah yeah, find has the \\00 issue |
12:45:24 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44Ih |
12:46:45 | FromDiscord | <pruno> So if a string has "\x00" it won't work ? |
12:47:40 | FromDiscord | <enthus1ast> yes |
12:48:00 | FromDiscord | <pruno> Mmh, this is a problem, binary files usually have null bytes 😅 |
12:48:07 | FromDiscord | <enthus1ast> yeah |
12:48:48 | * | pch_ joined #nim |
12:48:49 | FromDiscord | <enthus1ast> no idea actually why strutils.find works this way |
13:02:41 | FromDiscord | <pruno> It kinda blocks me with what i wanted to do 🤔. I could try to make it "manually" possible by iterating over all the bytes of the file and printing the offset everytime but ... yeah, too bad |
13:03:14 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44Ip |
13:03:21 | FromDiscord | <enthus1ast> no idea if this is 100% correct |
13:05:14 | NimEventer | New Nimble package! etf - ETF (Erlang Term Format) library for nim, see https://github.com/metagn/etf |
13:06:28 | FromDiscord | <pruno> sent a code paste, see https://play.nim-lang.org/#ix=44Iq |
13:06:59 | FromDiscord | <pruno> (i checked by hand the offset of the string i was looking for and it showed the same) |
13:08:39 | FromDiscord | <enthus1ast> for pattern matching i've used hmatching |
13:08:46 | FromDiscord | <enthus1ast> quite nice actually |
13:13:24 | FromDiscord | <pruno> Looking at the github repo, seems nice indeed, will check that |
13:14:03 | * | noeontheend joined #nim |
13:27:29 | * | pch__ joined #nim |
13:30:15 | * | pch_ quit (Ping timeout: 260 seconds) |
13:42:35 | FromDiscord | <planetis> I am waiting for that sweet Var(let a, var b) syntax to become possible. |
13:45:59 | * | pch__ quit (Ping timeout: 255 seconds) |
13:47:36 | * | pch joined #nim |
14:00:36 | * | gsalazar quit (Read error: Connection reset by peer) |
14:00:38 | * | gsalazar_ joined #nim |
14:00:50 | * | pch quit (Ping timeout: 240 seconds) |
14:09:10 | * | noeontheend quit (Ping timeout: 240 seconds) |
14:09:35 | FromDiscord | <Luckayla> ... Why? |
14:09:40 | FromDiscord | <Luckayla> That looks... Ugly |
14:09:44 | FromDiscord | <Luckayla> What would that be useful for? |
14:13:52 | FromDiscord | <planetis> pattern matching ofc |
14:15:32 | * | pch joined #nim |
14:17:16 | FromDiscord | <planetis> ...could also be tuple unpacking |
14:22:44 | * | lumo_e quit (Quit: Quit) |
14:24:19 | * | noeontheend joined #nim |
14:28:42 | * | gsalazar_ quit (Quit: Leaving) |
14:28:51 | * | gsalazar joined #nim |
14:31:20 | * | arkurious joined #nim |
14:35:52 | FromDiscord | <Luckayla> When you edit the message to change what I replied to, makes things look weird :p |
14:39:28 | * | CyberTailor quit (Excess Flood) |
14:40:23 | * | CyberTailor joined #nim |
14:42:03 | * | rockcavera joined #nim |
14:42:03 | * | rockcavera quit (Changing host) |
14:42:03 | * | rockcavera joined #nim |
15:08:33 | FromDiscord | <planetis> lol |
15:18:40 | * | rockcavera quit (Remote host closed the connection) |
15:22:06 | * | rockcavera joined #nim |
15:22:06 | * | rockcavera quit (Changing host) |
15:22:06 | * | rockcavera joined #nim |
15:50:51 | * | gsalazar quit (Read error: Connection reset by peer) |
15:51:10 | * | noeontheend quit (Ping timeout: 240 seconds) |
16:06:47 | * | noeontheend joined #nim |
16:46:29 | FromDiscord | <Dale> Wow the compiler actually caught me trying to use a threadlocal the wrong way, that's so cool |
16:48:49 | FromDiscord | <lantos> can libcurl be made async? |
16:48:53 | FromDiscord | <Phil> I like the compiler telling me I'm an idiot. I also like it when I can understand where the compiler is telling me that I'm an idiot.↵With the types of errors I make, I get that a fair bit from the compiler that's why I like it |
16:49:13 | FromDiscord | <Phil> (edit) "it" => "nim" |
16:49:55 | FromDiscord | <Yardanico> In reply to @lantos "can libcurl be made": if you use threads, yes |
16:50:07 | FromDiscord | <Phil> In reply to @lantos "can libcurl be made": https://curl.se/libcurl/c/↵> The multi interface is the asynchronous brother in the family and it also offers multiple transfers using a single thread and more. Get a grip of how to work with it in the multi interface overview. ↵It appears the c lib has an interface for this |
16:50:55 | FromDiscord | <lantos> In reply to @Yardanico "if you use threads,": I've used threads, but the threadpool maxes out at 10 threads (mac m1 has 10 threads) |
16:51:13 | FromDiscord | <lantos> (edit) "threads)" => "threads). I need to have thousands of threads. I thought this was managed by the OS?" |
16:51:13 | FromDiscord | <Yardanico> threadpool is deprecated and isn't supposed to be used for this anyway |
16:51:21 | FromDiscord | <enthus1ast> this is not how threads work↵(@lantos) |
16:51:33 | FromDiscord | <Yardanico> if you use normal threads there's no limit on the CPU cores |
16:51:39 | FromDiscord | <Yardanico> @enthus1ast that's the threadpool Nim limit |
16:51:46 | FromDiscord | <Yardanico> normal Nim threads don't ahve this limit |
16:51:49 | FromDiscord | <Yardanico> (edit) "ahve" => "have" |
16:52:23 | FromDiscord | <Dale> thousands of threads is kinda weird as well. They aren't gonna be that concurrent when you have that many |
16:52:32 | FromDiscord | <Dale> You might want to make some kind of task system |
16:52:44 | FromDiscord | <Phil> In reply to @enthus1ast "this is not how": Checked out the new code btw. seems to work. I wouldn't call the branch merge-ready yet, but from what I looked at that was more a PoC than anything |
16:52:47 | FromDiscord | <lantos> I thought the CPU has a scheduler that switches when threads are not active? |
16:53:02 | FromDiscord | <Dale> Yeah but for thousands it's a bit silly |
16:53:46 | FromDiscord | <Phil> Thanks for the fix on that btw! |
16:54:04 | FromDiscord | <Phil> Why thousands of threads? |
16:54:05 | FromDiscord | <Dale> `htop` says I'm running 620 threads right now, and that's including the OS, DE, and a whole bunch of electron apps |
16:54:10 | FromDiscord | <Phil> Like, wut? |
16:54:47 | FromDiscord | <enthus1ast> yeah its not yet ready, i have some recursive code but its a little weird still, maybe can work on this the day after tomorrow↵(@Phil) |
16:54:50 | FromDiscord | <lantos> I need to poll GET /docker/myContainer/stats and then push it to a DB.↵The GET streams data and is idle for 90%+ of the time |
16:55:14 | FromDiscord | <Dale> Why not reuse the threads? |
16:55:24 | FromDiscord | <Dale> Make a task queue using channels |
16:55:37 | FromDiscord | <ezquerra> I haven't used it but you might want to look into https://github.com/status-im/nim-taskpools |
16:55:53 | FromDiscord | <lantos> In reply to @Yardanico "threadpool is deprecated and": What is the new threading lib? |
16:57:11 | FromDiscord | <Dale> In reply to @ezquerra "I haven't used it": I saw the lecture on that, they are pretty cool |
16:57:41 | FromDiscord | <lantos> In reply to @Dale "Why not reuse the": Would like to but the libcurl seems to block on the request(), it has a call back and that is using channels but doesn't matter if the request is open |
16:57:46 | FromDiscord | <Yardanico> In reply to @lantos "What is the new": not sure what you mean by that |
16:57:53 | FromDiscord | <Yardanico> nim has threads which is the interface over OS threads |
16:58:00 | FromDiscord | <Yardanico> you just do --threads:on and you can use normal threads |
16:58:09 | FromDiscord | <Yardanico> and there are other abstractions other threads like threadpool or taskpools |
16:58:20 | FromDiscord | <Yardanico> but again, you don't need those to use threading |
16:58:37 | FromDiscord | <lantos> https://nim-lang.org/docs/threads.html↵this one? |
16:58:38 | FromDiscord | <enthus1ast> what i often do to have very robust systems, is to just create processes, save data to the filesystem, have another application that collects them etc... |
16:58:56 | FromDiscord | <Dale> You can only execute as many thing concurrently as the host allows anyway, so having tousands wouldn't do anything, 99.9% of them would be sitting there waiting to execute, which is no different from libcurl blocking |
16:59:00 | FromDiscord | <enthus1ast> this way, every one of these can crash and not affecting the whole system |
16:59:02 | FromDiscord | <Dale> (edit) "thing" => "things" |
16:59:39 | FromDiscord | <enthus1ast> i've written large crawlers this way actually |
17:00:06 | FromDiscord | <Yardanico> yeah I needed to do a website scraper recently, and I did it with nim async + ran multiple processes of it |
17:00:13 | FromDiscord | <Yardanico> and used mariadb for storing the data (since sqlite can't do concurrent writes) |
17:00:49 | FromDiscord | <lantos> I would have used the asyncHttpClient but it doesn't interface with unix domain sockets |
17:01:14 | FromDiscord | <enthus1ast> its also more convenient for long running systems, to see the status on a db server |
17:01:16 | FromDiscord | <lantos> (edit) "sockets" => "sockets. The AsyncSocket couldn't get it working but I could get cpp working" |
17:01:33 | FromDiscord | <Dale> Yeah lots of processes sounds more like what you want |
17:01:53 | FromDiscord | <Dale> The OS will manage it all for you as well |
17:01:56 | FromDiscord | <enthus1ast> @lantos\: if its just this, just speak http by hand |
17:02:20 | FromDiscord | <enthus1ast> can imagine, that docker does not speak advanced http |
17:03:44 | FromDiscord | <enthus1ast> you can even copy paste code from the nim clients (or even reuse some of the proc it uses, don't know how open this is, though) some stuff is in eg\: https://nim-lang.org/docs/httpcore.html |
17:04:45 | FromDiscord | <lantos> From their docks its just an http server listening @ unix:///var/run/docker.sock |
17:05:43 | FromDiscord | <lantos> okay so, ↵1. don't use spawn in threadpool, use the default threads (--threads:on)↵2. Use processes here rather then threads |
17:06:17 | FromDiscord | <lantos> (edit) "spawn" => "spawn/sync()" |
17:10:36 | FromDiscord | <Yardanico> you can also go the hard route and do http requests like https://github.com/kamilchm/docker-nim/blob/master/client.nim :D |
17:11:25 | FromDiscord | <Yardanico> also found https://github.com/tulayang/asyncdocker |
17:11:58 | FromDiscord | <enthus1ast> does not look to hard to me, actually much easier than handling many threads etc |
17:17:09 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=44JT |
17:18:09 | FromDiscord | <lantos> (edit) "https://play.nim-lang.org/#ix=44JT" => "https://play.nim-lang.org/#ix=44JU" |
17:18:23 | FromDiscord | <lantos> (edit) "https://play.nim-lang.org/#ix=44JU" => "https://play.nim-lang.org/#ix=44JV" |
17:22:25 | FromDiscord | <sharpcdf> how can i get the extension of a file |
17:22:32 | FromDiscord | <sharpcdf> specifically .tar.gz or .tar.xz |
17:22:47 | FromDiscord | <Yardanico> just split the filename |
17:24:00 | FromDiscord | <sharpcdf> wdym |
17:24:20 | FromDiscord | <sharpcdf> ive done `splitFile(file).ext` but it only returns `.gz` or `.xz` |
17:24:44 | FromDiscord | <lantos> https://nim-lang.org/docs/strutils.html#split%2Cstring%2Cchar%2Cint |
17:24:47 | FromDiscord | <Yardanico> In reply to @sharpcdf "ive done `splitFile(file).ext` but": split by dot |
17:24:50 | FromDiscord | <Yardanico> only first time |
17:25:01 | FromDiscord | <Yardanico> maxsplit argument |
17:25:05 | FromDiscord | <sharpcdf> In reply to @Yardanico "split by dot": what if the filename has a . |
17:26:01 | FromDiscord | <Yardanico> then use libmagic instead of file extensions |
17:26:04 | FromDiscord | <Yardanico> they're useless on unix anyway |
17:32:06 | * | CyberTailor quit (Remote host closed the connection) |
17:34:28 | * | CyberTailor joined #nim |
17:35:48 | FromDiscord | <sharpcdf> actually ill just use split and then use the last two elements in the seq |
17:56:43 | * | rockcavera quit (Remote host closed the connection) |
17:57:57 | FromDiscord | <sharpcdf> im trying to use https://nimble.directory/pkg/nimarchive but for some reason after running `nimble install nimarchive` and importing it then building, nimble errors and says that it cant find it, do i have to do something else? |
18:02:19 | FromDiscord | <hotdog> In reply to @sharpcdf "im trying to use": Add to your package deps |
18:02:38 | FromDiscord | <utatane> Hi guys I just started Nim today and wanna ask something.↵I'm using VScode, probably i assume u too, but hovering symbols doesnt show me the pop up, and `go to definition` doesnt work too.↵I tried these two extensions mainly. anyone have any idea? https://media.discordapp.net/attachments/371759389889003532/998651022174076998/unknown.png |
18:02:40 | FromDiscord | <hotdog> In your nimble file you need a `requires` line |
18:03:03 | FromDiscord | <hotdog> In reply to @utatane "Hi guys I just": I use nimsaem's extension |
18:03:19 | FromDiscord | <hotdog> Make sure nimsuggest is in your $PATH so the extension can use it |
18:03:19 | FromDiscord | <pseuxide> does `go to definition` work in your env? |
18:03:43 | FromDiscord | <hotdog> Yes, but not all the time, unfortunately nimsuggest doesn't always work |
18:04:12 | FromDiscord | <hotdog> But certainly most module level stuff works and generally stuff in the same package |
18:04:26 | FromDiscord | <sharpcdf> In reply to @hotdog "Add to your package": i did, i put `require "nimarchive"` |
18:04:52 | FromDiscord | <pseuxide> heard the term nimsuggest, have to install or build-in?↵package i checked is `winim` |
18:05:23 | FromDiscord | <Yardanico> In reply to @utatane "Hi guys I just": use the nimsaem one, nimsuggest is built-in |
18:05:37 | FromDiscord | <Yardanico> but if you're on linux it has to be in $PATH, and yeah, as hotdog said, it doesn't always work |
18:05:43 | FromDiscord | <Yardanico> winim is quite a big package with thousands of procedures |
18:05:45 | * | krux02 joined #nim |
18:05:49 | FromDiscord | <Yardanico> try just with the stdlib to see if nimsuggest works |
18:05:55 | FromDiscord | <hotdog> In reply to @sharpcdf "i did, i put": It should look like `requires "nimarchive >= 1.0.0"` (change the version number to correct one) |
18:06:37 | FromDiscord | <Yardanico> In reply to @hotdog "It should look like": that's not really needed though |
18:06:39 | FromDiscord | <Yardanico> version is optional |
18:06:54 | FromDiscord | <Yardanico> In reply to @sharpcdf "im trying to use": nimarchive uses nimterop and it's been kind of abandoned for some time |
18:06:57 | FromDiscord | <Yardanico> instead I think you should try zippy |
18:07:18 | FromDiscord | <sharpcdf> oh ok |
18:07:30 | FromDiscord | <Phil> zippy works fine for me for gzip compression |
18:07:38 | FromDiscord | <hotdog> Fair enough but isn't it `requires` not `require`? |
18:07:40 | FromDiscord | <sharpcdf> i just need it to extract tarballs |
18:08:02 | FromDiscord | <Yardanico> In reply to @hotdog "Fair enough but isn't": ah yeah that one |
18:08:08 | FromDiscord | <sharpcdf> In reply to @hotdog "Fair enough but isn't": yea it is, i just forgot the s in discord |
18:08:20 | FromDiscord | <hotdog> In reply to @sharpcdf "yea it is, i": Cool just checking in case |
18:08:27 | FromDiscord | <pseuxide> fmm didnt work with base64 as well https://media.discordapp.net/attachments/371759389889003532/998652486091026472/unknown.png |
18:08:44 | FromDiscord | <Yardanico> you're on nix right? |
18:08:49 | FromDiscord | <Yardanico> how did you add Nim to your patrh? |
18:08:50 | FromDiscord | <Yardanico> (edit) "patrh?" => "path?" |
18:08:55 | FromDiscord | <pseuxide> nope, windows |
18:09:04 | FromDiscord | <pseuxide> sorry i didnt get to tell it. |
18:09:06 | FromDiscord | <Yardanico> well, the question still stands :P |
18:09:38 | FromDiscord | <Yardanico> on windows it's usually enough to just add Nim folder to the system path and re-login |
18:09:53 | FromDiscord | <Yardanico> also, does nimsuggest open if you do `nimsuggest` in cmd? |
18:10:15 | FromDiscord | <sharpcdf> i dont use the nimsaem one, the other one seems to have better syntax highlighting for nimble and nims along with better proc info |
18:10:26 | FromDiscord | <Yardanico> it doesn't really has better syntax highlighting |
18:10:27 | FromDiscord | <pseuxide> when i type `nimsuggest` on powershell, nothing printed out. |
18:10:57 | FromDiscord | <sharpcdf> In reply to @utatane "when i type `nimsuggest`": open up environment variables and add the nim path to your PATH |
18:11:07 | FromDiscord | <Yardanico> also @sharpcdf nimsaem one has a lot of improvements |
18:11:08 | FromDiscord | <sharpcdf> to do it system wide you need admin |
18:11:09 | FromDiscord | <pseuxide> In reply to @Yardanico "on windows it's usually": I guess its not system path here, user path↵Idk if it matters |
18:11:21 | FromDiscord | <Yardanico> try to also add it to global system paths |
18:11:23 | FromDiscord | <sharpcdf> In reply to @Yardanico "also <@459463405636419594> nimsaem one": like what |
18:11:28 | FromDiscord | <Yardanico> a lot of bug fixes |
18:11:32 | FromDiscord | <Yardanico> kosz is abandoned since like 1.5 years ago |
18:11:55 | FromDiscord | <Yardanico> https://github.com/saem/vscode-nim#history--trivia |
18:12:00 | FromDiscord | <sharpcdf> oh really |
18:12:01 | FromDiscord | <Yardanico> yes |
18:12:13 | FromDiscord | <sharpcdf> how come in nimble files i dont get any syntax highlighting when i use it |
18:12:17 | FromDiscord | <pseuxide> ah wait, i only had a path for nimble/bin now. maybe thats the problem |
18:13:17 | FromDiscord | <pseuxide> Thanks anyways, ill try handle it by myself from here! |
18:13:36 | FromDiscord | <pseuxide> :nimAngry: |
18:14:55 | FromDiscord | <sharpcdf> @Yardanico why dont i get syntax highlighting in nimble files with the nimsaem extension |
18:18:43 | FromDiscord | <daniellowrie (Daniel Lowrie)> Greetings everyone, n00b here with a question...would anyone know why my nim binaries are getting roasted by Windows Defender? Thanks |
18:19:32 | FromDiscord | <Yardanico> In reply to @sharpcdf "<@177365113899057152> why dont i": just select language mode nim |
18:19:38 | FromDiscord | <Yardanico> in the lower right corner in vscode |
18:19:51 | FromDiscord | <sharpcdf> oh yea |
18:19:53 | FromDiscord | <Yardanico> In reply to @daniellowrie (Daniel Lowrie) "Greetings everyone, n00b here": because people like to write malware in Nim, and AV vendors are too lazy to properly detect this malware |
18:20:00 | * | matt_13377 quit (Ping timeout: 276 seconds) |
18:20:06 | FromDiscord | <Yardanico> so the signatures seem to detect a lot of innocent nim programs as malware |
18:20:50 | FromDiscord | <daniellowrie (Daniel Lowrie)> So M$ thinks that a programming language is malware? |
18:21:00 | FromDiscord | <daniellowrie (Daniel Lowrie)> Why it no bust python? |
18:22:01 | FromDiscord | <Yardanico> not the programming language |
18:22:01 | FromDiscord | <sharpcdf> In reply to @daniellowrie (Daniel Lowrie) "Why it no bust": python doesnt make an executable |
18:22:14 | FromDiscord | <sharpcdf> its interpreted |
18:22:16 | FromDiscord | <Yardanico> it thinks that a lot of nim binaries are malware because AV vendors are lazy |
18:22:24 | FromDiscord | <Yardanico> and can't make proper signatures |
18:22:39 | FromDiscord | <daniellowrie (Daniel Lowrie)> Well that's fun 😟 |
18:22:58 | * | xet7_ is now known as xet7 |
18:23:02 | FromDiscord | <daniellowrie (Daniel Lowrie)> So If I want to dev with nim, I'd better stick to \nix? |
18:23:08 | FromDiscord | <daniellowrie (Daniel Lowrie)> and pray no AV installed? |
18:23:10 | FromDiscord | <Yardanico> try using a different C compiler |
18:24:05 | FromDiscord | <dom96> just use WSL :D |
18:24:07 | FromDiscord | <daniellowrie (Daniel Lowrie)> Does Golang have this issue? |
18:24:50 | FromDiscord | <sharpcdf> when i set the language mode for a nimble fiel to nim it errors when i try to use `requires` |
18:24:51 | FromDiscord | <sharpcdf> :/ |
18:25:07 | FromDiscord | <sharpcdf> or switch |
18:25:08 | FromDiscord | <sharpcdf> or task |
18:25:44 | FromDiscord | <Yardanico> yes because that's custom nimble stuff |
18:25:53 | FromDiscord | <sharpcdf> (edit) "fiel" => "file" |
18:25:56 | FromDiscord | <Yardanico> no nim extension does proper error checking for that |
18:26:18 | FromDiscord | <sharpcdf> so doesnt that mean that it doesnt have nimble support? |
18:26:34 | FromDiscord | <Yardanico> kosz one doesn't either, nimble has some custom stuff but it's based on nimscript |
18:26:40 | FromDiscord | <daniellowrie (Daniel Lowrie)> So, I'm working in a Linux environment and using mingw for the compiler to exe. I made a simple echo "hello world" and Defender called it a Trojan and I was very offended XD |
18:27:15 | FromDiscord | <sharpcdf> In reply to @Yardanico "kosz one doesn't either,": well kosz didnt make the nimble file error :/ |
18:27:23 | FromDiscord | <Yardanico> In reply to @sharpcdf "well kosz didnt make": because it didn't do error checking |
18:27:23 | FromDiscord | <dom96> In reply to @daniellowrie (Daniel Lowrie) "So, I'm working in": Guess you're a malware author now :D |
18:28:03 | FromDiscord | <daniellowrie (Daniel Lowrie)> Well, actually 😉↵(@dom96) |
18:28:12 | FromDiscord | <daniellowrie (Daniel Lowrie)> JK |
18:28:13 | FromDiscord | <sharpcdf> In reply to @Yardanico "because it didn't do": so how am i supposed to get it to ignore the nimble file and not show the errors |
18:28:27 | FromDiscord | <dom96> In reply to @daniellowrie (Daniel Lowrie) "Well, actually 😉 (<@132595483838251008>)": 😱 |
18:28:35 | FromDiscord | <dom96> _calls the police_ |
18:29:08 | FromDiscord | <huantian> I don’t think I’ve gotten errors on my nimble files before? |
18:29:26 | FromDiscord | <sharpcdf> are you using the nimsaem extension |
18:29:50 | FromDiscord | <huantian> But I might be misremembering |
18:29:52 | FromDiscord | <huantian> Yeah |
18:29:57 | FromDiscord | <daniellowrie (Daniel Lowrie)> I do work in cyber and thought nim would be a cool language to use to create useful teaching tools and custom security tools, but since a simple echo command gets hit by Defender I may have to move to greener pastures. Too bad. I really liked the way nim did most things↵(@dom96) |
18:30:09 | FromDiscord | <dom96> @sharpcdf just colour it using .ini, should work fine |
18:30:16 | FromDiscord | <sharpcdf> https://media.discordapp.net/attachments/371759389889003532/998657976917303378/unknown.png |
18:30:27 | FromDiscord | <sharpcdf> In reply to @dom96 "<@459463405636419594> just colour it": how do you do that lmao |
18:30:41 | FromDiscord | <dom96> what text editor are you using? |
18:31:00 | FromDiscord | <Yardanico> In reply to @dom96 "<@459463405636419594> just colour it": for basic stuff yes |
18:31:04 | FromDiscord | <Yardanico> but some people like to write a lot of code in .nimble |
18:31:05 | FromDiscord | <sharpcdf> In reply to @dom96 "what text editor are": vscode |
18:31:11 | FromDiscord | <Yardanico> In reply to @dom96 "what text editor are": the same place where you chose nim |
18:31:13 | FromDiscord | <Yardanico> choose ini instead |
18:32:35 | FromDiscord | <sharpcdf> the errors are still there |
18:32:42 | FromDiscord | <dom96> In reply to @Yardanico "but some people like": those people can create a PR to fix the highlighting in the Nim VS code plugins :D |
18:32:52 | * | matt_13377 joined #nim |
18:33:09 | FromDiscord | <Yardanico> In reply to @sharpcdf "the errors are still": yes, they're just the old ones |
18:33:13 | FromDiscord | <Yardanico> reopen vscode |
18:33:16 | FromDiscord | <dom96> In reply to @Yardanico "choose ini instead": ~~choosenim~~chooseini |
18:34:01 | FromDiscord | <dom96> btw this is what my project's cargo.toml file looks like, I just ignore the errors https://media.discordapp.net/attachments/371759389889003532/998658921105461349/unknown.png |
18:34:27 | FromDiscord | <sharpcdf> lmao |
18:34:45 | FromDiscord | <dom96> it seems at least we're consistent with Rust |
18:35:36 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
18:40:35 | * | kenran joined #nim |
18:40:36 | * | kenran quit (Client Quit) |
18:43:16 | FromDiscord | <Kermithos> whats the easiest way to get cookies from a response and use it in the next request in httpclient? |
18:43:34 | FromDiscord | <Kermithos> is there something like session from pythons request lib? |
18:43:36 | FromDiscord | <sharpcdf> In reply to @Yardanico "yes, they're just the": and it also cant see nimble packages |
18:43:37 | FromDiscord | <sharpcdf> bruh |
18:44:04 | FromDiscord | <sharpcdf> wait no it just cant import zippy |
18:44:08 | FromDiscord | <sharpcdf> why?!?!? |
18:44:40 | FromDiscord | <sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44Kg |
18:44:58 | FromDiscord | <dom96> requires "zippy" in your .nimble? |
18:45:05 | * | lumo_e joined #nim |
18:45:07 | FromDiscord | <sharpcdf> yep |
18:46:18 | FromDiscord | <huantian> import zippy/zipfile? |
18:46:23 | FromDiscord | <huantian> i think that's the name of the submodule |
18:46:31 | FromDiscord | <sharpcdf> oh wait yea |
18:46:51 | FromDiscord | <sharpcdf> well no |
18:46:56 | FromDiscord | <sharpcdf> still doesnt work |
18:46:58 | FromDiscord | <sharpcdf> its `zippy/tarball` |
18:46:59 | FromDiscord | <huantian> In reply to @daniellowrie (Daniel Lowrie) "I do work in": dang windows why are you ruining the language smh my head |
18:47:28 | FromDiscord | <huantian> oh I was thinking of `zippy/ziparchives` |
18:47:40 | FromDiscord | <sharpcdf> it still errors |
18:47:44 | FromDiscord | <huantian> you would use tarballs if you like |
18:47:49 | FromDiscord | <huantian> wanted to extract tarballs ig |
18:47:57 | FromDiscord | <sharpcdf> ik thats exactly what im using it for lmao |
18:48:03 | FromDiscord | <sharpcdf> but i cant use anything from zippy |
18:48:07 | FromDiscord | <sharpcdf> it cant find it |
18:48:13 | FromDiscord | <huantian> what is it |
18:48:19 | FromDiscord | <sharpcdf> wdym |
18:48:27 | FromDiscord | <huantian> what can't find it |
18:48:32 | FromDiscord | <Yardanico> In reply to @sharpcdf "wdym": how are you running your code? |
18:48:48 | FromDiscord | <sharpcdf> `nimble debug` (debug is a task) |
19:01:44 | FromDiscord | <pseuxide> sent a long message, see http://ix.io/44Kp |
19:01:53 | FromDiscord | <pseuxide> (edit) "http://ix.io/44Kp" => "http://ix.io/44Kq" |
19:02:05 | FromDiscord | <pseuxide> (edit) "http://ix.io/44Kq" => "https://paste.rs/SEY" |
19:07:25 | FromDiscord | <deeuu> @enthus1ast Hey, do you have any examples of using ninja with nimscripter? I'm still keen on rendering templates dynamically in Nim 😉 |
19:08:26 | FromDiscord | <enthus1ast> last time i tried nimscripter with nimja, it failed |
19:08:46 | FromDiscord | <# Luke> Can I use jester with nimja? |
19:08:50 | FromDiscord | <enthus1ast> i'm also interested in dynamic templates |
19:08:55 | FromDiscord | <enthus1ast> @.luke\: sure |
19:09:06 | FromDiscord | <enthus1ast> nimja is very simple and very open |
19:09:07 | FromDiscord | <# Luke> Oh that's good lol |
19:09:44 | FromDiscord | <enthus1ast> @deeuu\: i want to go the "direct pnode execution" route |
19:09:56 | FromDiscord | <enthus1ast> like the dynamic again branch |
19:10:10 | FromDiscord | <frobnicate> If I try to do `myVar[0][0].addr` it says "expression has no address" |
19:10:19 | FromDiscord | <frobnicate> On an array of arrays |
19:10:53 | FromDiscord | <enthus1ast> @deeuu\: but give it a try, would be interesting to know |
19:11:35 | FromDiscord | <deeuu> In reply to @enthus1ast "<@746663152459972669>\: but give it": Start with the runtimeEvaluation example? |
19:12:17 | FromDiscord | <enthus1ast> you mean with nimscripter? or without? |
19:13:26 | FromDiscord | <deeuu> In reply to @enthus1ast "you mean with nimscripter?": oh sorry was talking about the dynamicAgain branch |
19:14:27 | FromDiscord | <enthus1ast> the dynamicAgain branch contains a full PNode renderer, so it should be able to render all nimja code |
19:14:27 | FromDiscord | <Elegantbeef> Is it a const?↵(@frobnicate) |
19:14:39 | FromDiscord | <frobnicate> let |
19:14:43 | FromDiscord | <frobnicate> does it need to be var? |
19:15:11 | FromDiscord | <enthus1ast> the issue is still the params (get data from native to vm) |
19:15:12 | FromDiscord | <frobnicate> it needed to be var |
19:15:14 | FromDiscord | <frobnicate> my bad |
19:15:35 | FromDiscord | <Elegantbeef> To explain what is happening |
19:15:40 | FromDiscord | <enthus1ast> maybe i can use the vmconf code from nimscripter |
19:15:59 | FromDiscord | <Elegantbeef> `[]` for let returns an immutable value so `[0][0]` returns just `T` |
19:16:14 | FromDiscord | <Elegantbeef> but `[]` for var returns a mutable reference |
19:16:22 | FromDiscord | <Elegantbeef> so `[0][0]` returns `var T` |
19:17:20 | FromDiscord | <enthus1ast> @deeuu\: it is definitly on my todo list, i just need some time to do it |
19:23:38 | NimEventer | New Nimble package! tagger - A library to generate xml and html tags, see https://github.com/aruZeta/tagger |
19:26:14 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=44Kx |
19:26:38 | FromDiscord | <jan0809> oh thats my topic, whatcha doin |
19:27:15 | FromDiscord | <jan0809> http(?) but why |
19:32:18 | FromDiscord | <lantos> I am trying to interact with docker.sock there are some docker API things that people have written in nim but they are stale.↵Trying to put one together. Tried to use the httpclient/asynchttpclient lib but they don't support AF_UNIX unix domain sockets. ↵Tried to modify the httpclient but couldn't get asyncSocket working with unix so just trying to get it to work |
19:32:29 | FromDiscord | <jan0809> aaah |
19:32:29 | FromDiscord | <lantos> (edit) "things" => "packages" |
19:33:00 | FromDiscord | <jan0809> ok yeah thats really something raw socks make sense for |
19:33:50 | FromDiscord | <lantos> yeah, but it seems like most other languages support unix:// in their httpNets is that something that nim should? |
19:34:08 | FromDiscord | <lantos> like it is HTTP just being served over the unix socks |
19:36:45 | FromDiscord | <jan0809> In reply to @lantos "yeah, but it seems": yeah thats what i was about to say, in python for example thats pretty ez afaik https://media.discordapp.net/attachments/371759389889003532/998674710583836764/IMG_20220718_213528.jpg |
19:39:38 | FromDiscord | <lantos> yeah nim has connectUnix for socket and asyncSocket but it throws Bad file descriptor or file not found |
19:40:07 | FromDiscord | <lantos> (edit) "yeah nim has connectUnix for socket and asyncSocket but it throws Bad file descriptor or file not found ... " added "which is odd because isn't it using sys/socket.h under the hood" |
19:41:13 | FromDiscord | <jan0809> wanted to try doing local lan AF_INET with nim, to communicated with my nitendo-switch |
19:41:25 | FromDiscord | <lantos> no work? |
19:41:26 | FromDiscord | <jan0809> (edit) "communicated" => "communicate" |
19:41:38 | FromDiscord | <jan0809> ? |
19:41:51 | FromDiscord | <lantos> (edit) "no" => "did it" |
19:43:25 | FromDiscord | <jan0809> ah, didnt happened to find time yet |
19:43:46 | FromDiscord | <jan0809> but im almost sure, did that before in python |
19:44:02 | FromDiscord | <deeuu> In reply to @enthus1ast "last time i tried": Back to nimscripter, I'm not having much luck. Doesn't look like we can expose `compileTemplateFile` to nimscript, but that kinda makes sense. I'm totally dabbling here |
19:47:26 | FromDiscord | <jan0809> sent a code paste, see https://play.nim-lang.org/#ix=44KB |
19:47:47 | FromDiscord | <jan0809> (edit) "https://play.nim-lang.org/#ix=44KB" => "https://play.nim-lang.org/#ix=44KC" |
19:48:45 | FromDiscord | <lantos> oh yeah that should be more straight forward |
20:00:03 | FromDiscord | <sharpcdf> do switches that you pass to the nim compiler not work when passed to nimble? i have switches but when building with nimble they just get ignored |
20:00:15 | FromDiscord | <sharpcdf> like `--out` and `--opt`, etc. |
20:07:58 | FromDiscord | <Rika> some nimble commands do ignore/not pass switches yeah, i think its classified as a bug |
20:08:03 | FromDiscord | <Rika> maybe file an issue if not already filed |
20:13:36 | FromDiscord | <# Luke> Nimja is awesome |
20:13:50 | FromDiscord | <# Luke> I can make good website in nim |
20:13:54 | FromDiscord | <# Luke> Without wasm |
20:14:01 | FromDiscord | <# Luke> And they're fast af |
20:27:11 | FromDiscord | <lantos> https://github.com/nim-lang/Nim/blob/98cebad7debddfb147ee22bc6f3d81221582c4d6/lib/pure/net.nim#L1287↵REEE found the issue |
20:51:01 | FromDiscord | <# Luke> is there any way i can get these 2 functions any faster |
20:51:20 | FromDiscord | <# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44KM |
20:53:02 | FromDiscord | <frobnicate> simd maybe? |
20:53:07 | FromDiscord | <frobnicate> I dunno |
20:56:26 | FromDiscord | <frobnicate> since you're doing the same thing for every color |
20:57:22 | FromDiscord | <demotomohiro> I don't think you need to do `sqrt` to find closest color. |
20:57:38 | FromDiscord | <frobnicate> oh yeah I didn't even notice that |
20:57:45 | FromDiscord | <frobnicate> you can just keep the numbers squared |
20:57:51 | FromDiscord | <demotomohiro> `distance = ((r2 - r)^2 + (g2 - g)^2 + (b2 - b)^2)` would be enough |
20:57:51 | FromDiscord | <# Luke> In reply to @demotomohiro "I don't think you": its the formula on wikipediqa |
20:58:22 | FromDiscord | <# Luke> but then my diff system wouldnt work |
20:59:19 | FromDiscord | <frobnicate> but you overwrite the diff anyway |
20:59:38 | FromDiscord | <demotomohiro> `((r2 - r)^2 + (g2 - g)^2 + (b2 - b)^2)` is just distance distance where `distance = sqrt((r2 - r)^2....`. |
20:59:58 | FromDiscord | <frobnicate> and yeah just square your base diff |
21:00:37 | FromDiscord | <frobnicate> I'm not sure why it's 999 though |
21:01:43 | FromDiscord | <Prestige> You only need to do `old.to(ColorRGB)` once, right? |
21:01:52 | FromDiscord | <Prestige> Here you're doing it 3 times per loop iteration |
21:02:51 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=44KT |
21:02:54 | FromDiscord | <Yardanico> xd |
21:02:58 | FromDiscord | <Prestige> Also you don't need to create the `res` variable, just use `result` |
21:04:13 | FromDiscord | <demotomohiro> Treeform's chroma calculate distance of colors in a different way: https://github.com/treeform/chroma/blob/master/src/chroma/distance.nim |
21:05:04 | FromDiscord | <Prestige> Seems like overkill to me |
21:05:27 | * | CyberTailor quit (Quit: Konversation terminated!) |
21:05:35 | FromDiscord | <huantian> Well if you wanna get actual color difference to your human eyes, you can’t just do rgb distance |
21:05:48 | FromDiscord | <# Luke> In reply to @Avahe "You only need to": ohh yea i should probably fix that |
21:06:04 | FromDiscord | <# Luke> In reply to @demotomohiro "Treeform's chroma calculate distance": its slow af |
21:06:16 | FromDiscord | <# Luke> i was using it but it was super slow |
21:06:46 | FromDiscord | <ache of head> sent a code paste, see https://play.nim-lang.org/#ix=44KU |
21:06:55 | FromDiscord | <ache of head> so you don't have to do `var res: ... = ...` |
21:07:12 | FromDiscord | <# Luke> oh |
21:08:44 | FromDiscord | <ache of head> at least that's what i remember |
21:08:47 | FromDiscord | <ache of head> i'm not 100% sure |
21:09:24 | FromDiscord | <Elegantbeef> You're right |
21:10:11 | FromDiscord | <Prestige> Yep |
21:10:33 | FromDiscord | <Prestige> In reply to @Avahe "Also you don't need": Which is why I said this ^ |
21:11:25 | FromDiscord | <ache of head> oh sorry, didn't notice that |
21:11:42 | FromDiscord | <Elegantbeef> It's ok we mostly ignore prestige |
21:12:01 | FromDiscord | <ache of head> lol |
21:12:18 | FromDiscord | <Generic> @.luke why did you stop using a proper color diff function, was it too slow? |
21:12:39 | FromDiscord | <# Luke> In reply to @Generic "<@704106773660827690> why did you": yea |
21:13:04 | FromDiscord | <# Luke> 1080p image with the distance function in chroma was about 60 seconds |
21:13:20 | FromDiscord | <# Luke> my function is 13-14 seconds |
21:13:39 | FromDiscord | <Prestige> wait you're doing this on every pixel? |
21:13:45 | FromDiscord | <Generic> against how many colors do you make comparisons? |
21:13:49 | FromDiscord | <# Luke> In reply to @Avahe "wait you're doing this": yes |
21:13:54 | FromDiscord | <Prestige> oh lawd |
21:14:06 | FromDiscord | <Elegantbeef> Luke |
21:14:11 | FromDiscord | <Elegantbeef> https://github.com/Infinitybeond1/dye/blob/main/src/dye.nim#L158-L159 |
21:14:13 | FromDiscord | <Elegantbeef> Is this sit accurate |
21:14:23 | FromDiscord | <Elegantbeef> If so why the hell are you doing `colors.prepareClosestColor` every single pixel |
21:14:25 | FromDiscord | <# Luke> In reply to @Elegantbeef "https://github.com/Infinitybeond1/dye/blob/main/src": no i made some changes |
21:14:43 | FromDiscord | <# Luke> In reply to @Elegantbeef "If so why the": hmm should fix that |
21:14:46 | FromDiscord | <Generic> you're really getting into territory where simd and multithreading are necessary for bearable performance |
21:14:53 | FromDiscord | <# Luke> (edit) "In reply to @Elegantbeef "If so why the": hmm ... should" added "i" |
21:14:59 | FromDiscord | <Elegantbeef> You think you should stop parsing 20 colours for every pixel in a 1080p image? |
21:15:01 | FromDiscord | <Prestige> Just create 1920x1080 threads, easy |
21:15:19 | FromDiscord | <# Luke> In reply to @Avahe "Just create 1920x1080 threads,": my poor poor cpu 💀 |
21:15:22 | FromDiscord | <Prestige> Lol |
21:15:26 | FromDiscord | <Generic> how big are the palettes? |
21:15:42 | FromDiscord | <# Luke> In reply to @Elegantbeef "You think you should": well i should |
21:15:45 | FromDiscord | <Generic> because depending on that further optimisations can be decided on |
21:15:50 | FromDiscord | <# Luke> In reply to @Generic "how big are the": 16-20 colors |
21:16:06 | FromDiscord | <# Luke> but if neccesary i can lower the limit to 16 |
21:16:31 | FromDiscord | <Generic> ok then brute force will probably be still faster than constructing some accelerated data structure like a kd tree |
21:16:34 | FromDiscord | <Prestige> https://github.com/guzba/nimsimd this looks interesting |
21:16:47 | FromDiscord | <Generic> though first move prepareClosestColor out of the hot loop! |
21:16:49 | FromDiscord | <Elegantbeef> I dont even think you really need anything much here |
21:17:05 | FromDiscord | <Generic> I told you to do that yesterday when I suggested to create such a function in the first place!!! |
21:18:03 | FromDiscord | <# Luke> In reply to @Generic "though first move prepareClosestColor": oh |
21:18:08 | FromDiscord | <# Luke> done |
21:18:19 | FromDiscord | <Elegantbeef> 2 million iterations isnt really that much |
21:18:46 | FromDiscord | <Generic> not if it's part of a video where it's times 30 every second 😛 |
21:18:57 | FromDiscord | <Elegantbeef> Also stop the `if colormatch` |
21:19:06 | FromDiscord | <Elegantbeef> you arent saving any performance there |
21:19:10 | FromDiscord | <Elegantbeef> you're iterating 2 \ colors for most pixels |
21:19:21 | FromDiscord | <# Luke> In reply to @Elegantbeef "you arent saving any": oh |
21:19:39 | FromDiscord | <# Luke> and where was that again |
21:19:57 | FromDiscord | <Elegantbeef> above the set color |
21:20:05 | FromDiscord | <# Luke> ah done |
21:20:14 | FromDiscord | <Elegantbeef> Jesus christ on a cracker |
21:20:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44KW |
21:20:23 | FromDiscord | <Elegantbeef> You were doing that per every pixel |
21:20:44 | FromDiscord | <Generic> honestly with all those savings, you can probably switch back to the more accurate color comparison function |
21:20:59 | FromDiscord | <Generic> and it still be faster |
21:21:03 | FromDiscord | <Elegantbeef> Probably |
21:21:07 | FromDiscord | <Elegantbeef> sqrt isnt that expensive |
21:21:19 | FromDiscord | <Elegantbeef> Compared to parsing 20 strings to colour per every pixel |
21:21:39 | FromDiscord | <# Luke> In reply to @Elegantbeef "Compared to parsing 20": 💀 |
21:21:58 | FromDiscord | <Prestige> Elegantbeef we need to collab on something of substance |
21:22:21 | FromDiscord | <Elegantbeef> Why you want to get yelled at more? 😛 |
21:22:48 | FromDiscord | <Elegantbeef> Too bad my mind cannot create anything of substance |
21:22:55 | FromDiscord | <Prestige> We can bring more attention to Nim I think |
21:23:00 | FromDiscord | <huantian> Hey beef do you want to make a Minecraft launcher in Nim |
21:23:08 | FromDiscord | <Elegantbeef> The fuck is minecraft? |
21:23:16 | FromDiscord | <# Luke> bloody i got it to 1 second |
21:23:18 | FromDiscord | <Prestige> why does minecraft need a launcher |
21:23:28 | FromDiscord | <Elegantbeef> MS doesnt know linux exists↵(@Prestige) |
21:23:33 | FromDiscord | <Elegantbeef> I↵(@.luke) |
21:23:42 | FromDiscord | <huantian> Because I don’t want to manually install 300 mods for a modpack |
21:23:44 | FromDiscord | <Generic> that's the power of not using strings |
21:23:48 | FromDiscord | <Prestige> Oh I forgot there's some windows-only version of minecraft isnt here |
21:23:50 | FromDiscord | <Prestige> (edit) "here" => "there" |
21:23:51 | FromDiscord | <Elegantbeef> Huan multimc exists |
21:24:05 | FromDiscord | <huantian> well yeah I use PolyMC |
21:24:11 | FromDiscord | <huantian> Which is a launcher |
21:24:19 | FromDiscord | <Prestige> I could never stand that game tbh |
21:24:21 | FromDiscord | <huantian> But I don’t want to use git to manage my modpacks |
21:24:31 | FromDiscord | <Elegantbeef> It's the power of moving stupid code out of a hot path 😛↵(@Generic) |
21:24:38 | FromDiscord | <huantian> And have to like make a new commit each time I want to update it |
21:24:39 | FromDiscord | <# Luke> In reply to @Avahe "I could never stand": it gets boring after a bit |
21:24:53 | FromDiscord | <huantian> That’s why you play modded Minecraft |
21:25:23 | FromDiscord | <Generic> In reply to @Elegantbeef "It's the power of": if you're not using strings, i.e. not doing a bunch of allocations which dive into deep code the compiler cannot reason well over, the compiler can also just move things out of the hot path by itself |
21:25:30 | FromDiscord | <Prestige> We could do something like work on the godot 4 nim bindings maybe, Elegantbeef. And could make a little site/tutorial on how to use it, might gain some traction |
21:26:58 | FromDiscord | <huantian> With the new godot stuff is it possible to automatically generate all the bindings? I haven’t been keeping up with the new godot 4 |
21:27:16 | FromDiscord | <Elegantbeef> It has a small header for the register then a JSON file for all the definitions |
21:27:38 | FromDiscord | <Elegantbeef> So you have like 500 loc for C then you generate mappings to the exposed API |
21:29:10 | FromDiscord | <huantian> Hm it can’t be that hard right? |
21:29:30 | FromDiscord | <frobnicate> In reply to @Avahe "We could do something": I tried Godot but can't stand it and the devs seem really defensive about performance and good programming |
21:29:51 | FromDiscord | <huantian> Wdym by that, just curious |
21:30:02 | FromDiscord | <frobnicate> Which part? |
21:30:17 | FromDiscord | <huantian> Good programming |
21:30:26 | FromDiscord | <frobnicate> One sec |
21:30:28 | FromDiscord | <frobnicate> I'll link |
21:30:37 | FromDiscord | <Prestige> I'm also curious |
21:30:47 | FromDiscord | <Prestige> I've used godot for a few projects now, it seems alright |
21:30:52 | FromDiscord | <Elegantbeef> there's the vblanco debacle |
21:31:05 | FromDiscord | <Prestige> That sounds like an album name |
21:31:08 | FromDiscord | <Elegantbeef> Where vblanco reimplemented their rendering pipeline to no longer use linked lists and increased the render performance |
21:31:19 | FromDiscord | <Elegantbeef> But reduz pretty much said "Yea that's nice" |
21:31:39 | FromDiscord | <Elegantbeef> https://github.com/godotengine/godot/issues/23998 |
21:32:13 | FromDiscord | <huantian> That is a somewhat aggressive title |
21:32:29 | FromDiscord | <Elegantbeef> I mean he brought the reciepts |
21:35:33 | FromDiscord | <huantian> If you go with open source I don’t know if there’s many other options for game engines tho |
21:35:43 | FromDiscord | <Elegantbeef> O3DE |
21:35:55 | FromDiscord | <Elegantbeef> Literally a OSS fork of cryengine |
21:36:09 | FromDiscord | <Elegantbeef> Well lumberyard |
21:36:52 | FromDiscord | <Elegantbeef> Does anyone know if godot 4 has compilation hooks? |
21:37:06 | FromDiscord | <Elegantbeef> In my view it's unusable until you can have it unload and recompile your project |
21:37:33 | FromDiscord | <Prestige> https://github.com/godotengine/godot/issues/23998#issuecomment-513858916 |
21:38:25 | FromDiscord | <Prestige> Makes sense actually |
21:38:31 | FromDiscord | <Elegantbeef> > Again, when an alpha of Godot 4.0 is rolled out (hopefully before the end of this year) |
21:38:35 | FromDiscord | <Elegantbeef> Oh boy valve time |
21:38:51 | FromDiscord | <Elegantbeef> Didnt 4.0 alpha land this year? |
21:39:02 | FromDiscord | <Prestige> Yeah I think so |
21:39:41 | FromDiscord | <Prestige> Ah that reminds me, I need to work on my collision broad phase for my game engine... Was going to use AABB trees but don't feel like figuring that all out. Quadtrees and spatial hashing are so much easier |
21:39:46 | FromDiscord | <Elegantbeef> Anyway if godot doesnt have a way to recompile/create files for non "first class" languages it's really not a great thing |
21:41:13 | FromDiscord | <Elegantbeef> I dont know about you, but i've toyed with godot-nim and it's a pain to use |
21:41:43 | FromDiscord | <Elegantbeef> I know geekrelief has their version which has things like hot code reloading/ a file watcher but i didnt have great success there |
21:43:02 | FromDiscord | <frobnicate> In reply to @Elegantbeef "But reduz pretty much": Yes, that. Thanks for the link. Also the 3d render part of Godot is still behind. I don't know how far they've gotten with vulkan since I last used it |
21:43:22 | FromDiscord | <Elegantbeef> They're in 4.0 beta which vulkan is the main feature of |
21:43:35 | FromDiscord | <Elegantbeef> It has a bunch of new features/capabillities |
21:43:47 | FromDiscord | <Prestige> I've been waiting for 4.0 to try Nim <-> Godot |
21:43:55 | FromDiscord | <Prestige> just been using GDScript so far, it's... okay I guess |
21:44:10 | FromDiscord | <Elegantbeef> Yea it's not great if you cannot hook a compiler on the play button imo |
21:44:28 | FromDiscord | <Elegantbeef> And i'm fairly certain that's not a thing |
21:44:49 | FromDiscord | <huantian> Just fork godot beef ez |
21:44:54 | FromDiscord | <frobnicate> Is GDScript still really slow? |
21:44:56 | FromDiscord | <Prestige> Or just make a PR |
21:45:01 | FromDiscord | <Prestige> Yeah it's not fast |
21:45:09 | FromDiscord | <Elegantbeef> It's written in C++, i'd not be able to make a PR that's reasonable |
21:45:24 | FromDiscord | <Prestige> c++ is one of those languages I hope to never touch |
21:45:53 | FromDiscord | <frobnicate> It's not that bad until you have ten guys with vastly different ways of doing everything |
21:46:07 | FromDiscord | <Elegantbeef> I was confused for like an hour attempting to understand a C++ intializer syntax |
21:46:18 | FromDiscord | <Elegantbeef> `Child child(&contaiiner);` is syntax |
21:46:22 | FromDiscord | <frobnicate> I have a funny video about that |
21:46:53 | FromDiscord | <frobnicate> https://youtu.be/7DTlWPgX6zs |
21:46:54 | FromDiscord | <Elegantbeef> I mean it makes sense once you learn in C++ `=` is copy not assignment |
21:47:28 | FromDiscord | <Elegantbeef> so `Child child = Child(&container);` would use the default intializer + constructor |
21:48:15 | FromDiscord | <Prestige> The less I know about cpp the better |
21:49:00 | FromDiscord | <frobnicate> Then don't watch the vid I posted |
21:49:01 | FromDiscord | <Prestige> Hm maybe I should try out the Nim Reactjs bindings. Wonder if they're decent to use, or.. not |
21:49:21 | FromDiscord | <frobnicate> They talked about doing Vue at work |
21:50:00 | FromDiscord | <Prestige> I heard Vue is nice |
21:50:03 | FromDiscord | <Elegantbeef> Anyway prestige i wouldnt be opposed to it, it's just i highly doubt it'd be something we could really say "Oh look how nice it is to use" |
21:50:05 | FromDiscord | <Prestige> I've only used react so far |
21:50:29 | FromDiscord | <Prestige> Elegantbeef: Well if we can come up with a decent idea, I think we could do a good job |
21:50:51 | FromDiscord | <Prestige> Maybe something a step up from a minecraft launcher, lol |
21:50:54 | FromDiscord | <Elegantbeef> I mean it's down to the godot limitation there so i guess someone should make the bindings then make an RFC or whatever they do |
21:51:19 | FromDiscord | <Elegantbeef> It's just so dumb to have to remember to run a command if you're using a second class language to script |
21:51:55 | FromDiscord | <Prestige> I'm not very familiar with what all is involved, maybe I should learn more about it. Would be great to have 4.0 working well |
21:52:17 | FromDiscord | <frobnicate> Just make your own engine 🚂 |
21:52:38 | FromDiscord | <frobnicate> Thomas the game engine |
21:54:19 | FromDiscord | <Prestige> Well I have my own 2d engine, it's basically replaced most things for me that godot does |
21:54:33 | FromDiscord | <Prestige> Except I still haven't figured out static linking |
22:05:37 | FromDiscord | <Elegantbeef> You dont have shaders do you?↵(@Prestige) |
22:10:00 | FromDiscord | <Prestige> I do |
22:11:56 | FromDiscord | <Prestige> https://github.com/einheit-tech/shade/blob/master/examples/shaders/simple.nim |
22:13:45 | FromDiscord | <frobnicate> Static linking for? |
22:14:01 | FromDiscord | <Prestige> Deploying games |
22:14:33 | FromDiscord | <frobnicate> So you have the dll as part of the target exe? |
22:14:53 | FromDiscord | <Prestige> You'd ship just one binary, yeah |
22:15:08 | FromDiscord | <frobnicate> I haven't even looked into that yet |
22:15:13 | FromDiscord | <frobnicate> I use SDL |
22:16:13 | FromDiscord | <Elegantbeef> Most people dont mind shipping libraries with their binary |
22:16:41 | FromDiscord | <Prestige> I ran into a million issues trying to do that with a game I made, never found a solution |
22:16:50 | FromDiscord | <Prestige> I think they had an older libc or something, can't remember |
22:16:55 | FromDiscord | <theangryepicbanana> is there a way to use `{.emit: [...].}` as/for an expression? |
22:17:14 | FromDiscord | <Elegantbeef> You can emit C inline |
22:17:29 | FromDiscord | <theangryepicbanana> yeah but I'd rather avoid that if possible |
22:17:41 | FromDiscord | <Elegantbeef> Nim cannot know that it's an expression |
22:18:05 | FromDiscord | <theangryepicbanana> but it should know that if it's used in the position of an expression? |
22:18:20 | FromDiscord | <Elegantbeef> And how is it supposed to know the type? |
22:18:34 | FromDiscord | <theangryepicbanana> hmm I assumed I'd just be able to annotate the type manually |
22:18:43 | FromDiscord | <Elegantbeef> You can do this with a template |
22:19:13 | FromDiscord | <theangryepicbanana> I use Haxe pretty frequently, and it has a thing called `untyped`, which can be used to temporarily ignore the type of an expression so you can give it a different type |
22:19:23 | FromDiscord | <theangryepicbanana> helpful when writing native coder |
22:19:25 | FromDiscord | <theangryepicbanana> (edit) "coder" => "code" |
22:30:19 | FromDiscord | <creikey> if I asyncCheck some other function that awaits a timer for 60 seconds then does stuff, but the function I asyncChecked from excepted on an error before the await on the asyncChecked function completes, what happens? |
22:30:23 | FromDiscord | <creikey> let me make an example |
22:31:53 | FromDiscord | <frobnicate> In reply to @theangryepicbanana "I use Haxe pretty": Nim has untyped |
22:32:06 | FromDiscord | <theangryepicbanana> different kind of untyped |
22:32:12 | FromDiscord | <frobnicate> But I don't know if it works the same |
22:32:16 | FromDiscord | <theangryepicbanana> haxe's untyped is for expressions, not macros |
22:32:47 | FromDiscord | <Prestige> Also Elegantbeef we need to figure out how to fix all these non-errors I'm getting from nimsuggest :( |
22:33:00 | FromDiscord | <Prestige> been broken since 1.4.0 I think, it blows |
22:33:01 | FromDiscord | <creikey> does done print |
22:33:03 | FromDiscord | <Elegantbeef> I figured out how prestige 😛 |
22:33:04 | FromDiscord | <Elegantbeef> It's a bodge but it works |
22:33:04 | FromDiscord | <creikey> sent a code paste, see https://play.nim-lang.org/#ix=44L8 |
22:33:07 | FromDiscord | <creikey> wait now that I have an example I can just run it |
22:33:28 | FromDiscord | <Elegantbeef> Look at the brain on brad↵(@creikey) |
22:33:29 | FromDiscord | <frobnicate> @Prestige btw how does your render module work? With the emit stuff |
22:34:36 | FromDiscord | <creikey> wow it does error caught https://media.discordapp.net/attachments/371759389889003532/998719467649515580/unknown.png |
22:34:48 | FromDiscord | <creikey> so interesting |
22:34:58 | FromDiscord | <creikey> so like when you asynCheck a proc it's attached to the proc it came from? |
22:35:12 | FromDiscord | <creikey> if that proc fails on an exception because it's attached to it it also no longer runs |
22:36:31 | FromDiscord | <Elegantbeef> Put a `poll(10000)` after the `waitFor main`↵(@creikey) |
22:36:33 | FromDiscord | <frobnicate> I guess since you ran it on the same thread |
22:36:51 | FromDiscord | <Elegantbeef> Nim's default async doesnt have any form of cancellation |
22:37:33 | FromDiscord | <frobnicate> Nvm then |
22:37:40 | FromDiscord | <creikey> In reply to @Elegantbeef "Put a `poll(10000)` after": interesting that this works in this example |
22:37:51 | FromDiscord | <huantian> well not really? |
22:37:58 | FromDiscord | <creikey> no I mean like |
22:38:00 | FromDiscord | <huantian> once main() is done executing anything async stops |
22:38:02 | FromDiscord | <creikey> it doesn't cancel |
22:38:12 | FromDiscord | <creikey> but in my server it seems like it cancels |
22:38:27 | FromDiscord | <creikey> I have this function right now https://media.discordapp.net/attachments/371759389889003532/998720431068553276/unknown.png |
22:38:38 | FromDiscord | <creikey> and if the players leave or something so the websocket conections are disconnected and the lobby is removed from the dictionary |
22:38:43 | FromDiscord | <creikey> it doesn't seem like it keeps on running |
22:39:03 | FromDiscord | <creikey> like it's called here https://media.discordapp.net/attachments/371759389889003532/998720583686696980/unknown.png |
22:40:19 | FromDiscord | <Elegantbeef> Unrelated but those `errorIf`s are so much cleaner |
22:42:09 | FromDiscord | <creikey> In reply to @Elegantbeef "Unrelated but those `errorIf`s": yeah I'm very happy with it |
22:42:21 | FromDiscord | <creikey> something concerning though is I've never actually seen any of the error conditions happen |
22:42:26 | FromDiscord | <creikey> so I still have no idea if the code actually works |
22:44:52 | FromDiscord | <frobnicate> Potentially you could make unit tests for that |
22:46:12 | FromDiscord | <Prestige> In reply to @frobnicate "<@778498877464117248> btw how does": Not sure what you're referring to |
22:51:18 | FromDiscord | <creikey> In reply to @creikey "it doesn't cancel": I just realized that all of my code doesn't do anything if there aren't any players in the lobby that's why there's no exceptions |
23:04:32 | FromDiscord | <frobnicate> In reply to @Avahe "Not sure what you're": In your engine, you have a render module, that uses {.emit.} and I was just curious how it worked |
23:04:40 | FromDiscord | <frobnicate> I think it's in a template |
23:19:12 | FromDiscord | <sharpcdf> would it be possible to compile a project that uses a nimble package with nim instead of nimble? |
23:19:43 | FromDiscord | <creikey> In reply to @sharpcdf "would it be possible": yeah just install the nimble packages then compile with nim |
23:20:11 | FromDiscord | <sharpcdf> In reply to @creikey "yeah just install the": no i mean not `nimble build` but `nim build` with a config.nims |
23:20:36 | FromDiscord | <sharpcdf> because i saw that the underlying command is `nim c` so is there anything else that nimble does or could i just run the command in a nimscript |
23:22:54 | FromDiscord | <sharpcdf> wait yea https://github.com/nim-lang/nimble/issues/654 |
23:23:04 | FromDiscord | <sharpcdf> `--nimblePath` does it |
23:23:05 | FromDiscord | <sharpcdf> neat |
23:32:25 | FromDiscord | <Prestige> In reply to @frobnicate "In your engine, you": I.. don't think I do? You're talking about this? https://github.com/einheit-tech/shade/blob/master/src/shadepkg/render/render.nim |
23:32:42 | * | krux02 quit (Remote host closed the connection) |
23:33:20 | FromDiscord | <Prestige> In reply to @Elegantbeef "It's a bodge but": Will it be accepted into mainline? |
23:38:50 | * | noeontheend quit (Ping timeout: 240 seconds) |
23:44:51 | * | lumo_e quit (Quit: Quit) |