<< 18-07-2022 >>

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