<< 17-08-2023 >>

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