<< 02-04-2023 >>

00:05:22FromDiscord<gogolxdong> In reply to @Elegantbeef "https://www.jasonbeetham.com/snake/nicoscripter.htm": I didn't see any repository
00:05:36FromDiscord<Elegantbeef> I do not have one setup
00:10:14FromDiscord<gogolxdong> haha 😆
00:10:42FromDiscord<Elegantbeef> It's just nimscripter + nico + emscripten
00:42:18FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4ssc
00:44:19FromDiscord<Ayy Lmao> I think you can cast the first element's address if I'm not mistaken.
00:45:09FromDiscord<System64 ~ Flandre Scarlet> In reply to @Ayy Lmao "I think you can": cast the pointer to UncheckedArray?
00:45:26FromDiscord<Ayy Lmao> `cast[UncheckedArray[byte]](tex[0].addr)` I think
00:46:59FromDiscord<System64 ~ Flandre Scarlet> In reply to @Ayy Lmao "`cast[UncheckedArray[byte]](tex[0].addr)` I think": https://media.discordapp.net/attachments/371759389889003532/1091886458308137080/image.png
00:47:46FromDiscord<Ayy Lmao> `cast[UncheckedArray[ptr byte]](tex[0].addr)` maybe? or `cast[ptr UncheckedArray[byte]](tex[0].addr)`?
00:47:55FromDiscord<Ayy Lmao> I always get confused on unchecked arrays
00:48:31FromDiscord<System64 ~ Flandre Scarlet> It works, thanks
00:48:37FromDiscord<Ayy Lmao> No problem
00:49:17FromDiscord<Elegantbeef> `ptr Unchecked[byte]` only makes sense
00:49:36FromDiscord<Elegantbeef> `UncheckedArray[byte]` would mean it's a contiguous array, it only makes sense really on manually managed objects
00:50:08FromDiscord<Ayy Lmao> I had no idea Unchecked was a thing
00:50:26FromDiscord<Ayy Lmao> I was running into an issue a while ago with UncheckedArray and that is probably my solution.
00:51:57FromDiscord<Elegantbeef> `UncheckedArray`\
00:53:04FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/C5S
00:55:33FromDiscord<Elegantbeef> It's the equivlent of a `[]` in C
00:56:37FromDiscord<Ayy Lmao> I haven't seen `toOpenArray` before
00:56:55FromDiscord<Elegantbeef> Stay awhile and listen
00:57:11FromDiscord<Ayy Lmao> Not even sure what it does because I thought you could only have them in function arguments
00:57:22FromDiscord<Elegantbeef> Exactly
00:57:49FromDiscord<Elegantbeef> It converts a `ptr UncheckedArray[...]` to `openArray[...]` which nim supports
00:58:47FromDiscord<Ayy Lmao> Is an openArray just something you can index but bounds checked?
01:03:22FromDiscord<Ayy Lmao> Also unrelated question, is there any serious downside to implementing runtime polymorphism by storing a function pointer inside an object as opposed to using a method?
01:06:22FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4ssf
01:06:27FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4ssg
01:07:50FromDiscord<Elegantbeef> Sokam stop using a generic and just use a procedure
01:08:34FromDiscord<sOkam!> that means having a procedure for every type used in the material
01:08:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ssi
01:08:54FromDiscord<Elegantbeef> Yes....?
01:09:17FromDiscord<Elegantbeef> You already are doing the same thing
01:09:48*ltriant joined #nim
01:11:20FromDiscord<sOkam!> i guess ill take the hit and keep the when cases
01:11:51FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4ssj
01:12:49FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4ssk
01:12:50FromDiscord<Ayy Lmao> sent a code paste, see https://paste.rs/gGr
01:14:29FromDiscord<sOkam!> learnopengl is confusing for starting, do not recommend. its only good when you are already decent at it↵Cannot recommend this series enough. He actually explains the basics in an understandable way↵https://www.youtube.com/watch?v=6dtqg0r28Yc&list=PLA0dXqQjCx0S04ntJKUftl6OaOgsiwHjA&index=4
01:14:52*ltriant quit (Ping timeout: 276 seconds)
01:15:28FromDiscord<sOkam!> when you reach the specular/diffuse chapter, then learnopengl becomes valuable again. but for starting from no knowledge... learnopengl skims over crucial stuff that you actually need for everything you do later on
01:17:06FromDiscord<sOkam!> learnopengl = this is what you do↵ogldev = this is why you do things, how to do it explained in human words, and then what to do with code to achieve those
01:18:39FromDiscord<Ayy Lmao> Asking this again: Is there any serious downside to implementing runtime polymorphism by storing a function pointer inside an object as opposed to using a method?
01:20:21FromDiscord<Ayy Lmao> The only cost is having to store a pointer for each function you use right?
01:20:58FromDiscord<sOkam!> In reply to @Ayy Lmao "Asking this again: Is": i believe there is a nimble package/library for doing polymorphism in nim. might be worth checking
01:21:02FromDiscord<Yardanico> In reply to @Ayy Lmao "Asking this again: Is": I think that's normal, even Nim's own streams use that
01:21:18FromDiscord<Yardanico> In reply to @sOkam! "i believe there is": yeah https://github.com/yglukhov/iface basically does that but with all macro magic
01:21:52FromDiscord<Ayy Lmao> Interesting, I'll check it out, thanks!
01:22:39FromDiscord<Yardanico> <https://nim-lang.org/docs/streams.html#StreamObj>
01:22:46FromDiscord<Yardanico> you can see that it's just an object with procs
01:23:02FromDiscord<Yardanico> and then actual implementations like FileStream assign their own implementations
01:23:21FromDiscord<Yardanico> Also see <https://github.com/def-/nimes/commit/baefb72c290471f5b487910e1545614b9a3d24b3> for showing how to do methods -> procs
01:23:28FromDiscord<Yardanico> this PR was because methods were slow with ARC back then :)
01:23:41FromDiscord<System64 ~ Flandre Scarlet> In reply to @sOkam! "learnopengl is confusing for": Might be useful↵Btw↵``glBindVertexArray(VAO);`` What is VAO?
01:28:10*ltriant joined #nim
01:33:16FromDiscord<sOkam!> sent a long message, see http://ix.io/4ssm
01:33:46FromDiscord<System64 ~ Flandre Scarlet> Oh alright
01:34:06*ltriant quit (Ping timeout: 255 seconds)
01:35:56FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4ssn
01:36:20FromDiscord<sOkam!> you are drawing only once on init, and then clearing the screen every frame
01:37:02FromDiscord<sOkam!> also missing the part where you upload the vertex data to opengl. the buffers are created, but they are currently empty
02:00:26NimEventerNew thread by alexeypetrushin: Why auto doesn't work with void?, see https://forum.nim-lang.org/t/10061
02:19:03*ltriant joined #nim
02:23:28*ltriant quit (Ping timeout: 248 seconds)
02:37:03*ltriant joined #nim
02:37:11termerIs it possible to create macros and use them as pragmas for type defs?
02:38:01termerI'm trying to make a macro called "implements" that ensures a type implements a specific conept
02:38:03termer*concept
02:39:15termeroh, looks like I had a syntax error
02:39:18termerlol
02:39:21termerIt works
02:39:22FromDiscord<Elegantbeef> Type section macros can only generate type section code
02:40:54termerit should be all right
02:41:32FromDiscord<Elegantbeef> Depending on the concept it's generally just easier for a `MyType.implements(MyConcept`
02:41:45FromDiscord<Elegantbeef> Atleast that's what i learned with traitor
02:42:41termeris that already a macro or is that something I need
02:42:44termeralso is traitor a library
02:42:50termerwould rather use that and not reinvent the wheel
02:42:53*ltriant quit (Ping timeout: 268 seconds)
02:42:55termerif it does what I need
02:42:58FromDiscord<Elegantbeef> It's something i suggest instead of typesection macros
02:43:09FromDiscord<Elegantbeef> https://github.com/beef331/traitor#what-does-it-do
02:43:27FromDiscord<Elegantbeef> I have a rewrite that changes it drastically and is much cleaner but yea it's rust Trait-ish
02:44:06FromDiscord<Elegantbeef> The rewrite looks like https://github.com/beef331/traitor/blob/traitor1/traitor.nim#L282-L345
02:46:01termerLooks interesting but something I'll have to check out later
02:46:21termera bit more complicated than I need for what I'm working on
02:46:28FromDiscord<Elegantbeef> I do not know exactly what you're checking for
02:46:32FromDiscord<System64 ~ Flandre Scarlet> How to block segfaults :↵1 : Import ``std/segfaults``↵2 : Try Except statements↵3 : No segfault anymore
02:47:16FromDiscord<Elegantbeef> I'd just write a `template implements(T, Y: typedesc): untyped = static: assert T is Y`
02:47:25termerPretty much a clean way of writing
02:47:25termerwhen thing isnot ConceptThing: {.fatal: "Nope".}
02:47:28FromDiscord<Elegantbeef> That's not how you fix segfaulting
02:47:43termerhahaha
02:48:28FromDiscord<Elegantbeef> You can use a type section macro of course, but you still need a method for if you have a type that matches the concept but not at the declaration
02:48:37FromDiscord<Elegantbeef> So i'd just go with the template and call it a day
02:48:46termerfair enough
02:48:53termerI thought I'd be fancy but it looks like you're right lol
02:49:31FromDiscord<Elegantbeef> Yea pretty much any type or concept that needs implementations defined fall apart there
02:49:37FromDiscord<Elegantbeef> 😄
02:50:31FromDiscord<Elegantbeef> It would be nice if the compiler had some sort of `{.enforce: MyConcept.}` which is ensured to be implemented
02:50:53termerYeah I'd appreciate that a lot since it's very annoying right now
02:51:05termerI need some sort of compile time assurance that my types comform to the concepts I want them to
02:51:07FromDiscord<Elegantbeef> But Nim has too many experimental features 😄
02:51:27termerOf many of the experimental features, concepts should be solidified
02:51:31termercause it's incredibly useful
02:51:38FromDiscord<Elegantbeef> Well i find the old style work fine
02:51:54termerI don't like the thing with proc pointers at all
02:52:00termeralso you have to store more data (the pointers themselves)
02:52:00FromDiscord<Elegantbeef> People try to do too fancy things with them and they fall apart, but you have to learn your way around their 'features'
02:52:27termeralso, sometimes people don't implement all the features on the type so you get a null deref when you try calling one of them
02:52:30FromDiscord<Elegantbeef> Well the proc pointers in traitor was just cause I could
02:52:40termerthis is the case in at least one stdlib module
02:52:59FromDiscord<Elegantbeef> You should never get a runtime error for something not implementing a procedure
02:52:59termerI think in osproc it was, if you try peeking a process stream it segfaults
02:53:08termerAraq didn't seem to think this was a problem
02:53:25termerit's because the impl proc pointer was a null pointer
02:53:25FromDiscord<Elegantbeef> Well i disagree with him a lot so...
02:53:28termerit just wasn't implemented
02:53:43termerNo documentation on this fact either
02:53:44FromDiscord<Elegantbeef> Sure but the streams API doesnt need to be a runtime typed
02:54:00termerI'm currently working on a streams library cause the async streams in the stdlib are so bad lol
02:54:15termerI don't think the people who wrote asyncstreams ever worked with async streams
02:54:39termerSure, it's an "unstable" API
02:55:08termerbut you'd expect something so fundamental (and used in other parts of the stdlib) to not have fundamental flaws that make them useless for real-world application
02:55:29FromDiscord<Elegantbeef> i do not write real world applications or use async 😄
02:55:47termerand that's why Nim never gets talked about seriously
02:56:10termerMy current project is bringing httpx up to a production-ready level
02:56:25termerand it was from that point I learned that httpbeast is basically a tech demo
02:56:44termerand subsequently that most things people write in Nim are tech demos and toys
02:57:28termersometimes I think that Status is the only group using Nim for anything *but* toys lol
03:03:27termerI am determined to write production code in Nim
03:03:39termerall these silly libraries and bugs will never stop me!
03:04:22FromDiscord<Elegantbeef> Well when it comes to compiler bugs on the type system I'm here to help 😛
03:27:29FromDiscord<gogolxdong> One more thing is system async modules conflict with status async libraries which focus on blockchain development.
03:29:57*ltriant joined #nim
03:34:24*ltriant quit (Ping timeout: 248 seconds)
03:57:29FromDiscord<Dudugz> Does Nim v2 fix traceback for async errors?
04:00:57*Guest74 joined #nim
04:01:28*Guest74 quit (Client Quit)
04:01:44*Guest74 joined #nim
04:02:01*ltriant joined #nim
04:13:38*Guest74 quit (Ping timeout: 260 seconds)
04:17:52termerElegantbeef How do you define procs for a concept
04:20:44FromDiscord<Elegantbeef> just call it inside the concept body
04:20:50FromDiscord<user2m> random question why do we have to import tables to use tables, but don't have to import anything to use arrays and sequences ?
04:21:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ssH
04:21:26FromDiscord<Elegantbeef> Cause `seq` and `array` are first class data types
04:21:40termerI was doing
04:21:41termertype Thing = concept x
04:21:41termer proc doStuff(this: x)
04:21:53FromDiscord<Elegantbeef> Only new style concepts work with that
04:21:53termeris that not something you can do?
04:22:01termerwhat are new style concepts exactly
04:22:02FromDiscord<Elegantbeef> it'd be `proc doStuff(this: Self)`
04:22:25FromDiscord<ringabout> And there is no varaible after concept
04:22:31FromDiscord<ringabout> (edit) "varaible" => "varible"
04:22:36FromDiscord<ringabout> (edit) "varible" => "variable"
04:23:02FromDiscord<Elegantbeef> New style concepts use the procedure definition instead of just arbitrary expressions
04:23:14termerIt seems to not work on 1.6.12
04:23:19termerIt doesn't enforce it
04:23:50termerthe issue is that the calling syntax makes it very hard to do method-style procs
04:23:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ssI
04:24:14termeroh wait
04:24:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ssJ
04:24:25termeryou can just use x as the argument
04:24:26termerI'm retarded
04:24:50termerthough, calling other things, you need some sort of implementation
04:25:08termerwhen you say new style, what are you referring to exactly
04:25:12termerwhat supports the new style?
04:27:01termerhttps://play.nim-lang.org/#ix=4ssK
04:27:11FromDiscord<ringabout> In reply to @termer "when you say new": It means https://github.com/nim-lang/RFCs/issues/168
04:27:38FromDiscord<ringabout> Which is partly implemented by https://github.com/nim-lang/Nim/pull/15251
04:27:59FromDiscord<ringabout> Though it still lacks some kind of documentation https://github.com/nim-lang/Nim/issues/20225
04:28:17termerIs this present in devel
04:28:27termerI'm assuming it's not present in stable
04:28:49FromDiscord<ringabout> It is present in the stable.
04:29:36FromDiscord<ringabout> Here is a spec => https://github.com/nim-lang/Nim/blob/devel/tests/concepts/tspec.nim
04:32:03termerOk this makes more sense
04:33:32*om3ga quit (Ping timeout: 250 seconds)
04:34:55termerNew-style concepts are much better
04:35:12termerThe old one is interesting but much harder to use in practice
04:36:21termerCan you not use doc comments in a new-style concept?
04:36:36termerunexpected construct in the new-styled concept: ## Concept to be implemented by async read streams.
04:36:54termerThis might be a bug, because I'm sure you would want to document them
04:37:00FromDiscord<ringabout> Nope, it is ignored on the devel afaik
04:37:46FromDiscord<ringabout> In reply to @termer "This might be a": Yeah, it was fixed by https://github.com/nim-lang/Nim/pull/20752
04:38:40termerOk, I suppose that will be present in a future release
04:39:01termerIs it possible to describe properties of an object in a new-styled concept?
04:40:10FromDiscord<ringabout> Nope I think.
04:40:46termerThat's not a big deal
04:41:08termerIn the old-style, I was able to make descriptions that were ambiguous, like
04:41:16termerx.isFinished is bool
04:41:20termerwhich could be either a proc or a property
04:41:25termerbut that's not really desirable in the real world
04:41:44termerAlso harder to document
04:42:53termerIs there a way to explicitly inherit from another concept, ringabout?
04:43:05termerfor example, in the old style you could do
04:43:06termerx is AsyncWriteStream[T]
04:43:38FromDiscord<Elegantbeef> Break each part into it's own concept
04:44:11termerI was thinking that was what I'd do, but I wanted to see if it was possible to do inheritence first
04:44:26FromDiscord<Elegantbeef> Nah do not do that it causes recursive look ups
04:44:34FromDiscord<Elegantbeef> Also the field syntax is exactly what one wants
04:44:39termerPerhaps
04:44:44FromDiscord<Elegantbeef> It is what gives the code such great power
04:44:57termerField syntax is great for virtual properties basically
04:45:09termerinline func that returns a value
04:45:24termeror proc with undocumented side-effects if you're evil
04:46:26FromDiscord<Elegantbeef> The beauty is it doesnt matter to you
04:46:58termerI'm pretty conservative with features I use
04:47:05termerand would prefer things to be more explicit at times
04:47:13termerwhich is ironic given the fact that I'm using Nim
04:47:43FromDiscord<Elegantbeef> Sure but whether a generic has a field or a proc doesnt matter as long as it's typed properly
04:48:24termerIt does matter if it has side-effects
04:48:33termerwhich is why it's best if those virtual properties are func
04:49:00FromDiscord<Elegantbeef> Macros do work inside concepts
04:49:14FromDiscord<Elegantbeef> So if you want to ensure it's a field or a func you can make a macro that does the check for you
04:49:24termeror I declare them as func lol
04:49:27termerwhich is what I'm doing right now
04:49:35termerfunc queueMaxLen(): int
04:49:35termer ## The queue's max length
04:49:50FromDiscord<Elegantbeef> I mean inside the concept you can do `isFunc(a.doThing())`
04:50:01termeroh right, well I'm using new-styled concept now
04:50:06FromDiscord<Elegantbeef> where `isFunc` is a macro that ensures your `doThing` is a func
04:50:13termergood to know
04:50:14FromDiscord<Elegantbeef> Yea they work
04:50:19FromDiscord<Elegantbeef> Though i find them less useful
04:50:35termerI really just need to do an OOP-style interface so it works fine for this purpose
04:50:54termerThe original style of concept is brilliant
04:51:08termerbut in practice can be hard to use for traditional tasks like defining a set of methods
04:52:09termeroh yeah also, for a virtual setter, you do
04:52:10termer`=queueMaxLen`(this: Self, newMaxLen: int)
04:52:11termerright?
04:55:41*azimut quit (Ping timeout: 255 seconds)
04:57:00termerUh oh
04:57:11termercannot instantiate: 'Option[T]'; Maybe generic arguments are missing?
04:57:38termerThis happens when I define a proc that returns an Option
04:58:51termerhttps://play.nim-lang.org/#ix=4ssP
04:59:42termerperhaps this feature isn't ready yet
05:03:48*ltriant quit (Ping timeout: 255 seconds)
05:15:28FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4ssR
05:16:03FromDiscord<Elegantbeef> `{...}` is an array syntax so you'd need to use a macro
05:16:07FromDiscord<Elegantbeef> Then an object variant
05:16:25termerwhere's the {}
05:16:49FromDiscord<user2m> In reply to @Elegantbeef "`{...}` is an array": I thought {...} was set syntax?
05:17:05termeroh you're talking to someone else
05:17:05FromDiscord<Elegantbeef> `{a: b}` is table constr
05:17:06FromDiscord<Elegantbeef> `{a, b, c}` is set
05:17:10termermy bad
05:17:35FromDiscord<Elegantbeef> table constructor is sugar to `[(a, b)]`
05:18:00FromDiscord<Elegantbeef> But you could also just make a `Table[string, YourVariant]`
05:19:29termerNim's template errors are incredibly unhelpful lol
05:19:40termerthe error compile in my thing was a lack of a generic specified somewhere completely different
05:20:53FromDiscord<user2m> Ok I guess what I'm asking is how would I go about creating a table with multiple key, value types in it? like a key or value could be of type int or string ?
05:22:40FromDiscord<Elegantbeef> Object variants
05:24:22FromDiscord<user2m> In reply to @Elegantbeef "Object variants": Thank you I'll look into it!!
05:54:08termerhttps://play.nim-lang.org/#ix=4ssU
05:54:16termerOk, here's my latest conundrum
05:54:25termerThe assertion fails here
05:54:33termeras far as I can tell, it should match
05:54:54FromDiscord<Elegantbeef> `SimpleImpl` is a typeclass
05:55:19termerwhat's the significance of that
05:56:04*arkurious quit (Quit: Leaving)
05:56:31FromDiscord<Elegantbeef> Ah the bigger issue is you have no way to reason T
05:57:18termerNot sure how I could
05:57:23FromDiscord<Elegantbeef> Though it doesnt seem to resolve it
05:57:45termerI think generics are pretty much broken in new-styled concepts
05:57:55termerbecause as far as I can tell, I can't get it to understand this
05:58:19FromDiscord<Elegantbeef> Well `Simple[T]` without anything to reason `T` makes no sense
05:58:47termerthe original thing I was doing was DummyStream[T]
05:58:54termerso you could create a stream of anything
05:59:10FromDiscord<Elegantbeef> You still need to bind the T
05:59:32termerhow can I bind it to something if I don't know what that thing is on the proc
05:59:48termerif you're talking about at the assertion, I already tried it with [string]
05:59:58FromDiscord<Elegantbeef> No i mean in the concept
06:00:07termerare you saying Self[T]?
06:00:15termeror wait a minute
06:00:17FromDiscord<Elegantbeef> No
06:00:32termerso waht do you mean
06:01:22FromDiscord<Elegantbeef> Inside the concept there is no way of reasoning what type the T is
06:01:37FromDiscord<Elegantbeef> It has no associated type it's just a generic parameter
06:02:00FromDiscord<Elegantbeef> It seems it does not cause issues, but it should
06:02:22termerI mean, I'm not sure what other way I could use to implement a generic object like that
06:02:45FromDiscord<Elegantbeef> It seems it doesnt matter here and just take the generic parameter of the type
06:02:49FromDiscord<Elegantbeef> Which is wrong
06:03:30*derpydoo joined #nim
06:03:49termerAny version of SimpleImpl that uses a concrete type has no issues
06:04:00termeror rather, with no type param at all
06:04:04FromDiscord<Elegantbeef> Concepts seem buggy
06:04:06FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4ssX
06:04:11FromDiscord<Elegantbeef> Well new concepts
06:04:45termerok so what this tells me is that concepts are barely usable if you have generics going on
06:05:00FromDiscord<Elegantbeef> New style are not
06:05:01FromDiscord<Elegantbeef> Old style make sense and work
06:05:16FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4ssZ
06:05:20termerExcept you have to have some way of instantiating certain things
06:05:20FromDiscord<Elegantbeef> Works fine
06:05:31termerlike you have to have some way of representing another type
06:05:31FromDiscord<Elegantbeef> What?
06:05:38termerlet me give you an example
06:05:40FromDiscord<Elegantbeef> What?
06:05:50termerI'm writing an example
06:09:51termerhttps://play.nim-lang.org/#ix=4st3
06:10:04termerI have no idea how to represent an argument of type WriteStream here
06:10:13termerbecause WriteStream is also a concept
06:10:41termerwait I'm retarded hold on
06:10:57termerhttps://play.nim-lang.org/#ix=4st5
06:11:00termerfixed example
06:11:58FromDiscord<Elegantbeef> Right i see the issue
06:14:08termerThe issue is how to represent generic types and concepts as arguments
06:14:39termernow, it's possible to get around this with macros, MAYBE
06:14:49termerbut at that point, the amount of hackery going on is ridiculous
06:15:03FromDiscord<Elegantbeef> Well there is no issue representing them as arguments
06:15:22termerI just demonstrated how there is an issue representing them as arguments
06:15:52FromDiscord<Elegantbeef> No you didnt
06:15:52FromDiscord<Elegantbeef> Like what requirements does `WriteStream` need?
06:16:23termerthere's a proc called pipeTo whose second argument is of type WriteStream[T]
06:16:51termerI don't know what WriteStream needs, because it's a concept
06:16:59termerit's going to be implemented by something else beyond my control
06:17:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4st7
06:17:31termerwhat a mindfuck
06:17:46termerso effectively I need to include all possible non-concrete types that will be referenced as generics
06:17:55termerStill not sure how I can represent that as an argument though
06:17:59FromDiscord<Elegantbeef> There are other methods that might work
06:19:14FromDiscord<Elegantbeef> i'm looking at alternatives now
06:19:37termerSo far I'm stuck on the second argument and how effectively represent an instance of that generic concept lol
06:27:17FromDiscord<Elegantbeef> Hmph i do not think there is a way to constrain it to a concept
06:27:27FromDiscord<Elegantbeef> Aside from the generic parameter approach
06:28:05termerthe generic parameter approach, the issue is that you can't represent it as an argument
06:28:22termerlike are you supposed to do x.pipeTo(Y())
06:28:27termerbecause that only works on non-ref objects
06:28:30FromDiscord<Elegantbeef> You can just do `Y`
06:28:34FromDiscord<Elegantbeef> or do `var y: Y`
06:28:40termeroh shit you're right
06:28:46termerman this is all kinds of fucked up
06:29:17termerof course, newer compiler versions that inevitably require you to initialize the variable before using it will break that
06:29:33FromDiscord<Elegantbeef> Nah concept code
06:29:42termerconcept code is based on compiles()
06:30:07termerso if the compiler requires you to initialize vars (which I've read musing about), the var thing: Y concept will break
06:30:17FromDiscord<Elegantbeef> Correct, but i mean "Within the concept body, types can appear in positions where ordinary values and parameters are expected. "
06:30:24FromDiscord<Elegantbeef> Concepts do have specialised logic
06:30:36termerI see what you're saying
06:30:46termerDoes seem incredibly volatile though
06:31:08FromDiscord<Elegantbeef> You can do `default(Y)` if you're really concerned
06:31:16termeroh yeah
06:31:21termerthere are so many features I forget them
06:34:00termerok so here's my attempt using default() and making additional types into their own generic params
06:34:09termerhttps://play.nim-lang.org/#ix=4stc
06:34:23termerNo luck
06:34:40termerI legitimately think this is impossible
06:34:52FromDiscord<Elegantbeef> One second
06:39:05termeras far as generics go, it seems to have problems with applying generic params to other types with generic params
06:45:59termerOk yeah, they just don't work no matter what I do
06:46:14termerI removed the WriteStream proc and it simply doesn't work with generics
06:46:18termerI think it's pretty busted
06:46:41termerTried new and old style
06:49:55termerElegantBeef Thanks for the massive help on this
06:50:03termerUltimately though, I think it's simply unusable
06:50:21termerA shame cause it could have been very useful
06:50:51FromDiscord<Elegantbeef> Well parts of it can be used
06:51:20termerI couldn't get any of my real-world use-case working
06:51:32FromDiscord<Elegantbeef> Like `pipeTo` doesnt really need constrained if you call it inside a procedure that limits to `ReadStream, WriteStream`
06:51:43termeryeah, I removed that and it still didn't work
06:52:09FromDiscord<Elegantbeef> Well `assert TypeClass is Concept` will never work
06:52:16termerey?
06:52:20termerit does work for other things
06:52:32termerIt works for typeclasses
06:52:34FromDiscord<Elegantbeef> What does it work for?
06:52:43termeryou can do it if it understands the procs
06:52:58FromDiscord<Elegantbeef> I mean i showed it works as a parameter
06:53:13termerhttps://github.com/termermc/nim-asyncstream-core
06:53:27termerhttps://github.com/termermc/nim-asyncstream-core/blob/master/src/asyncstream_core.nim
06:53:29termerhttps://github.com/termermc/nim-asyncstream-core/blob/master/src/asyncstream_core/dummy.nim
06:53:50termerI removed the pipeTo bit from the main file and it didn't work
06:54:25termerYou'll notice all the Future and Option uses
06:54:29termerit really trips up on those
06:56:07termerlol unarchived it to push the removal of the pipeTo bits
06:56:11termerbut you'll see what I mean
07:22:13*Notxor joined #nim
08:34:24*ltriant joined #nim
08:38:54*ltriant quit (Ping timeout: 255 seconds)
08:59:19*ltriant joined #nim
09:15:55FromDiscord<demotomohiro> I found a small mistake in example code of `proc add[T](x: var seq[T]; y: openArray[T]) {.noSideEffect.}`, so I'm going to fix it.↵But `nim doc system.nim` result in compile error:↵Nim/lib/system/compilation.nim(18, 52) Error: type mismatch: got 'None' for 'false' but expected 'bool'↵https://github.com/nim-lang/Nim/blob/63b4b3c5b8c930ffc271c5e4e1a446e8616b2571/lib/system/compilation.nim#L18
09:17:59FromDiscord<demotomohiro> This example code is calling `proc add[T](x: var seq[T]; y: sink T)`, not `proc add[T](x: var seq[T]; y: openArray[T])`↵https://nim-lang.org/docs/system.html#add%2Cseq%5BT%5D%2CopenArray%5BT%5D
09:34:28*ltriant quit (Ping timeout: 252 seconds)
10:08:02*ltriant joined #nim
10:12:50*ltriant quit (Ping timeout: 250 seconds)
10:28:26*Notxor quit (Remote host closed the connection)
10:31:55FromDiscord<jmgomez> Is there a way to tell a function that an object should be pass as copy? I know you can specify it in the type def but that will be applied everywhere
10:32:28FromDiscord<Andreas> git clone https://github.com/bytecodealliance/wasmtime.git/crates/c-api
10:35:10FromDiscord<ringabout> Nope, but it is a good feature, which could be implemented in the future.
10:39:37FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4su7
10:40:33FromDiscord<jmgomez> The quick fix is to add bycopy in the type itself
10:43:34FromDiscord<ringabout> Yeah, I cannot think of other solutions.
10:45:02*ltriant joined #nim
10:50:45*ltriant quit (Ping timeout: 255 seconds)
11:15:04*ltriant joined #nim
11:19:33*ltriant quit (Ping timeout: 255 seconds)
11:34:48*Notxor joined #nim
11:34:48*ltriant joined #nim
11:42:35*ltriant quit (Ping timeout: 248 seconds)
13:04:32FromDiscord<demotomohiro> In reply to @demotomohiro "I found a small": I sent PR: https://github.com/nim-lang/Nim/pull/21607
13:13:22*beholders_eye joined #nim
13:19:36*PMunch joined #nim
13:22:04*ltriant joined #nim
13:26:54*ltriant quit (Ping timeout: 265 seconds)
13:30:23FromDiscord<@@prestosilver> sent a code paste, see https://play.nim-lang.org/#ix=4suL
13:31:42FromDiscord<@@prestosilver> Not the exact same behaviour, pretty close tho
13:32:51*kenran joined #nim
13:44:19PMunchHmm, I have a `proc to[T: object](someObj: SomeObject, t: typedesc[T]): T =` definition, which works fine, but I want to pass the object symbol on to a macro to generate the body of the proc
13:44:43PMunchWhen I pass T to the macro as a typed argument I jut get `sym T` though with a nil impl..
13:45:16*beholders_eye quit (Ping timeout: 252 seconds)
13:46:43FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/yrJ
13:48:11FromDiscord<Rika> countup proc?
13:48:35*kenran quit (Remote host closed the connection)
13:51:15*nanxiao joined #nim
13:53:05FromDiscord<System64 ~ Flandre Scarlet> Thanks!
14:06:44*kenran joined #nim
14:08:56*ltriant joined #nim
14:13:42*ltriant quit (Ping timeout: 255 seconds)
14:31:01*beholders_eye joined #nim
14:33:58PMunchElegantBeef, I think you need to do some SEO work on fungus :P I tried to google it and Google wanted to correct it to "bum fungus"..
14:34:22*derpydoo quit (Ping timeout: 276 seconds)
14:37:00*nanxiao quit (Quit: Client closed)
14:37:41*nanxiao joined #nim
14:38:20PMunchUhm, say what now: Error: redefinition of 'settings'; previous declaration here: /home/peter/.choosenim/toolchains/nim-#version-2-0/lib/std/genasts.nim(89, 13)
14:38:38*azimut joined #nim
14:43:02*kenran quit (Remote host closed the connection)
14:43:53*nanxiao quit (Quit: Client closed)
15:08:06FromDiscord<Marcus> hmm, I wonder why nim-setup-action is so extremely slow on macos.
15:09:07FromDiscord<Marcus> seeing 3-5 seconds on linux, 40-5 seconds on windows and 5-8 minutes on macos 🧩
15:13:19NimEventerNew thread by nimian: Anyone tried GPT-4 for Nim?, see https://forum.nim-lang.org/t/10062
15:27:38*ltriant joined #nim
15:27:59FromDiscord<michaelb.eth> In reply to @Marcus "seeing 3-5 seconds on": Do you have a link for nim-setup-action?↵↵I’m guessing that the Nim compiler and tools are being compiled for macOS but are prebuilt downloads for Linux and Windows
15:32:27*ltriant quit (Ping timeout: 248 seconds)
15:34:26FromDiscord<Marcus> https://github.com/jiro4989/setup-nim-action↵(@michaelb.eth)
15:34:51FromDiscord<michaelb.eth> found it, was looking it over
15:35:07FromDiscord<Marcus> it uses choosenim on all platform afaict
15:35:59FromDiscord<michaelb.eth> I still use a hand-rolled choosenim setup in GHA so wasn’t aware of that action but looks promising
15:36:26FromDiscord<michaelb.eth> What version/a of Nim are you specifying?
15:36:41FromDiscord<michaelb.eth> (edit) "version/a" => "version/s"
15:37:18FromDiscord<Marcus> https://github.com/marcusramberg/promexplorer/actions/runs/4588428969/jobs/8102634046↵(@michaelb.eth)
15:37:21FromDiscord<Marcus> I really can't tell why it's so slow, seems like it just downloads it.
15:37:28FromDiscord<Marcus> Maybe it's a problem with github mac ci
15:39:27FromDiscord<michaelb.eth> By analogy, in my setup I spec version-1-2, version-1-6, version-2-0 (those are branch names), so the compiler and tools are built from scratch for Linux, Mac, and Windows. To speed up the builds I use caching. The 4-5 minute time seems to match my experience when I have a cache miss.
15:44:49FromDiscord<michaelb.eth> In reply to @Marcus "https://github.com/marcusramberg/promexplorer/actio": Yep, looking at the output for the setup step, on macOS it’s building from sources whereas for Linux and Windows it’s not.
15:46:02FromDiscord<Marcus> I actually saw now that I have cache in place to solve this in my test runner build job that runs in every commit 🤦‍♂️ Was wondering why it didn't have the same problem.
15:51:28*beholders_eye quit (Quit: WeeChat 3.6)
15:53:01FromDiscord<HitBlast> Is there a way to put pragmas in an object much like how we can put decorators inside a Python object and use them inside the object only?
16:00:47*arkurious joined #nim
16:03:40*Jjp137 quit (Ping timeout: 260 seconds)
17:00:08*Jjp137 joined #nim
17:32:09FromDiscord<miragearhitect> sent a code paste, see https://play.nim-lang.org/#ix=4sw0
17:32:36FromDiscord<miragearhitect> cant figure it out
17:37:43FromDiscord<Hourglass [She/Her]> I'm surprised I'm actually saying this but, is there a library that kinda does what the DOM does?
17:37:56FromDiscord<Hourglass [She/Her]> For a TUI
17:38:48FromDiscord<Hourglass [She/Her]> So I'd have panels/elements on screen that are just simple containers, then I can use text elements with some basic formatting (aligning it horizontally, vertically, to the top, left... Etc) and then having IDs for them?
17:39:05FromDiscord<Hourglass [She/Her]> C or C++ is fine too, since I can just write bindings for them in Nim
17:44:32FromDiscord<guttural666> any tips on how to trouble shoot the nimlsp in vim? I recently updated my nim verison and the nimlsp through nimble and the COC nimlsp package with PlugUpdate, now the language server doesn't give me anything in my file anymore (errors, autocomplete etc.)
17:54:49FromDiscord<michaelb.eth> In reply to @guttural666 "any tips on how": have you tried nimlangserver as alternative to nimlsp?
17:55:37FromDiscord<guttural666> I always just used nimlsp by Peter and COC
18:00:41FromDiscord<Marcus> Wasn't aware that there's two different ones!↵(@michaelb.eth)
18:01:45FromDiscord<Marcus> I think only pmunch's is packaged in nix
18:01:47FromDiscord<guttural666> nimlsp comes with the full guide to integrate it into Vim, which was quite painless in the past, don't really want to spend a lot of time on vim config, let alone neovim, which I just tried and also didn't work (treesitter also has no nim support, which sucks)
18:02:30FromDiscord<guttural666> thinking about just nuking the whole system and starting with a clean slate from scratch right now
18:02:42FromDiscord<michaelb.eth> sent a long message, see http://ix.io/4sw7
18:03:40FromDiscord<michaelb.eth> if you're unaware of Notcurses, make sure to take a look at its repo, demo videos, etc. – it makes possible some pretty amazing stuff for TUIs and CLIs
18:03:55FromDiscord<Hourglass [She/Her]> Thanks! I'll take a look!
18:12:39FromDiscord<Marcus> guttural6\: You can use `{ "alaviss/nim.nvim" }` to get syntax highlighting in nvim.
18:13:49FromDiscord<Marcus> I just used illwill for promexplorer and I found it quite easy to work with. it doesn't work the way Horizon describes (like the DOM) tho.↵(@michaelb.eth)
18:16:36FromDiscord<michaelb.eth> sure, working like the DOM is a pretty tall order
18:16:52FromDiscord<michaelb.eth> so my suggestions were more general, for sure
18:17:32FromDiscord<michaelb.eth> for Go, there's the charms thing, looks pretty cool, allows styling by CSS, crazy stuff
18:17:57FromDiscord<Marcus> agree, charms is pretty shiny \:)
18:18:35FromDiscord<Marcus> https://github.com/marcusramberg/promexplorer/blob/main/promexplorer.gif?raw=true I found making a ui like this with panels and navigation fairly easy tho.
18:18:37FromDiscord<michaelb.eth> (edit) "by CSS," => "with CSS-like,"
18:19:32FromDiscord<michaelb.eth> once I'm a bit farther along with nim-notcurses, I'm going to try to re-impl some illwill based TUIs with it, just to see how it goes
18:20:07FromDiscord<Marcus> I've only seen the notcurses demos, they are pretty cool tho \:)
18:20:16FromDiscord<michaelb.eth> one of my goals is for the high-level wrapper to be powerful yet easy to work with
18:21:40FromDiscord<guttural666> In reply to @Marcus "guttural6\: You can use": okay thanks, maybe I will come back to nvim one day, sticking to vim for now I think
18:22:03FromDiscord<Marcus> Lazyvim \<3
18:23:31FromDiscord<guttural666> In reply to @Marcus "Lazyvim \<3": is that a thing? sticking to vim because I'm too lazy to learn lua? haha
18:23:56FromDiscord<Marcus> no I meant the neovim distribution \:D https://www.lazyvim.org/
18:24:33FromDiscord<Marcus> Writing vimscript instead of lua isn't lazy, that's masochist.
18:25:52FromDiscord<guttural666> I just tried it with the kickstart.nvim https://github.com/nvim-lua/kickstart.nvim
18:26:21FromDiscord<Marcus> I see he links to lazyvim as well \:)
18:26:58FromDiscord<guttural666> installing nimlsp with Mason worked great, but still no lsp support active and I am just too lazy to get into their lua file and figure things out for the moment 😄
18:28:00FromDiscord<guttural666> one click solutions first, then I can get into the details at my own pace, but if something like this doesn't work first try, I hate that
18:28:03FromDiscord<Hourglass [She/Her]> Now I'm continuing to try and work on my MC server software...
18:28:29FromDiscord<Marcus> Sure - https://github.com/marcusramberg/nix-config/blob/main/config/nvim/lua/plugins/languages.lua#L38
18:28:36FromDiscord<Marcus> this is how I activated it
18:28:44FromDiscord<Marcus> for if you decided to go back later \:)
18:29:54FromDiscord<guttural666> thanks mate
18:30:44FromDiscord<Marcus> image.png https://media.discordapp.net/attachments/371759389889003532/1092154163967836220/image.png
18:36:45FromDiscord<Hourglass [She/Her]> I have no idea why my code is segfaulting and gdb is absolutely useless here
18:36:48FromDiscord<Hourglass [She/Her]> Very fun
18:42:47*deadmarshal_ quit (Ping timeout: 246 seconds)
18:45:51FromDiscord<guttural666> In reply to @Marcus "image.png": this is what I want to see 😄
18:46:33*kenran joined #nim
18:47:26FromDiscord<guttural666> god, Vim and Neovim are just so good
18:53:15FromDiscord<michaelb.eth> fwiw, Emacs and nimlangserver work very nicely together (via `lsp-mode` for Emacs), but I know most people are hesitant to embrace the strange side of The Force
18:53:32FromDiscord<michaelb.eth> (edit) "embrace" => "embracing"
18:53:57FromDiscord<Hourglass [She/Her]> Okay i genuinely can't tell why or where I'm segfaulting, it's so odd and confusing...
18:54:56FromDiscord<Hourglass [She/Her]> All my echo statements run, and it consistently segfaults after the second time i close the socket, but code after closing the socket still runs
18:56:10*casaca joined #nim
19:00:10FromDiscord<michaelb.eth> In reply to @Hourglass, When the Hour Strikes "All my echo statements": do you have some code to share or a simplified example that reproduces the problem?
19:02:59FromDiscord<Hourglass [She/Her]> I can't make a simplified example but I can give my current code, it's spread across a few repos though... 😓
19:03:17FromDiscord<Hourglass [She/Her]> I could probably make a small zip with the code but doubt anyone would actually be interested
19:03:50FromDiscord<michaelb.eth> so, let's come at it a different way
19:03:59FromDiscord<michaelb.eth> are you worrking with async?
19:04:15FromDiscord<michaelb.eth> and how about threads?
19:04:19FromDiscord<Hourglass [She/Her]> Yep, async as well as shared libraries with the orc gc
19:04:29FromDiscord<Hourglass [She/Her]> Async across shared libraries, in fact aha
19:05:09FromDiscord<Hourglass [She/Her]> Doesn't explain why it suddenly segfaults since it doesn't seem to have an obvious relation to the shared library
19:05:24FromDiscord<Hourglass [She/Her]> Unless it's the dispatcher that segfaults for some reason?
19:06:09FromDiscord<Hourglass [She/Her]> Since, with async and shared libraries, you have to set the dispatcher across the boundary (so the shared library is sharing a dispatcher with the core app)
19:06:16*deadmarshal joined #nim
19:07:05FromDiscord<michaelb.eth> by shared libs in this context you mean some Nim codebases that have been compiled to shared libs (`.so`, `.dylib`, `.dll`)?
19:07:26FromDiscord<Hourglass [She/Her]> Yep
19:08:09FromDiscord<michaelb.eth> are you sure everything is using orc, i.e. is it possible that one of them might be using refc?
19:08:23FromDiscord<michaelb.eth> weird question, maybe, but I'm trying to think what's going wrong
19:08:26FromDiscord<Hourglass [She/Her]> No, that's not possible, every single one is definitely using orc
19:08:44FromDiscord<Hourglass [She/Her]> In reply to @michaelb.eth "weird question, maybe, but": Yeah I understand, I've been sitting on this for weeks now so I'm taking any help i can get
19:08:50FromDiscord<turbo> What's the current best way to deep compare objects (something like lodash's `Equals`). In my case objects may contain sequences of variant types, other objects and options, but no cycles, procs or other non-scalar things.
19:14:47FromDiscord<Hourglass [She/Her]> The only thing I can get from gdb is `0x(2 byte hex) in unregisterCyclesystem_2921`
19:19:49FromDiscord<miragearhitect> sent a code paste, see https://play.nim-lang.org/#ix=4sws
19:23:31FromDiscord<Hourglass [She/Her]> I am so lost...
19:25:33FromDiscord<michaelb.eth> In reply to @miragearhitect ".": what is the output of `echo format("hello")`?
19:27:13FromDiscord<michaelb.eth> In reply to @Hourglass, When the Hour Strikes "I am so lost...": I don't think I can be of much more help atm, but consider creating small modules/libs that have the same relationships as the ones in your codebase; try to add the minimal code to them necessary recreate the crash, e.g. you mentioned a socket and closing it is involved
19:27:22FromDiscord<michaelb.eth> you could be hitting a bug in ORC, who knows
19:29:44*ltriant joined #nim
19:30:02FromDiscord<Hourglass [She/Her]> In reply to @michaelb.eth "I don't think I": I can try but I don't know if I'll be able to encounter it again, since the codebase is fairly complex
19:30:14FromDiscord<miragearhitect> In reply to @michaelb.eth "what is the output": <strong>hello</strong>
19:30:19FromDiscord<Hourglass [She/Her]> I could try the arc GC instead and see if that fixes it
19:30:35FromDiscord<michaelb.eth> In reply to @Hourglass, When the Hour Strikes "I *could* try the": worth a shot, for sure
19:31:09FromDiscord<michaelb.eth> if it doesn't crash, that would suggest something going wrong with orc, hopefully you'll be able to turn the experience into a bug report 🙂
19:31:17FromDiscord<michaelb.eth> (edit) "if it doesn't crash, that would suggest something going wrong with orc, ... hopefullyyou'd" added "and" | "you'll" => "you'd"
19:31:24FromDiscord<Hourglass [She/Her]> Ah, it's not reproducible with arc at all
19:31:26FromDiscord<Hourglass [She/Her]> Hm...
19:32:47FromDiscord<michaelb.eth> In reply to @miragearhitect "<strong>hello</strong>": any chance there's trailing whitespace? maybe try strip?
19:34:26*ltriant quit (Ping timeout: 250 seconds)
19:36:25*sagax joined #nim
19:37:14FromDiscord<Hourglass [She/Her]> In reply to @michaelb.eth "if it doesn't crash,": It'll be quite hard without a minimal reproducible example aha... Not sure how to recreate that
19:38:01FromDiscord<Hourglass [She/Her]> Anyway, anyone know if arc plays nicely with async? Iirc i saw some posts about arc eventually crashing from memory use because of async
19:39:03FromDiscord<michaelb.eth> no, because async (and nim-chronos too) involves cyclical references
19:39:17FromDiscord<michaelb.eth> so you'll eventually leak memory with arc
19:39:36FromDiscord<michaelb.eth> (edit) "no, because ... async" added "std"
19:39:45FromDiscord<Elegantbeef> chronos isnt supposed to have cycles
19:39:48FromDiscord<Elegantbeef> That's one of the things that it touts
19:39:58FromDiscord<michaelb.eth> oh, I thought I'd read the opposite
19:40:03FromDiscord<michaelb.eth> will revisit the readme, etc.
19:40:36FromDiscord<tsoj> sent a code paste, see https://play.nim-lang.org/#ix=4swE
19:45:18FromDiscord<michaelb.eth> In reply to @michaelb.eth "will revisit the readme,": looking at some closed PRs/issues, yeah, maybe it will work with arc now, but I'm not 100% certain
19:46:19*junaid_ joined #nim
19:48:34PMunch@guttural666, yeah there are some issues with NimLSP on recent versions
20:23:16FromDiscord<Marcus> I used doom emacs for a couple of years but I couldn't deal with the slow. neovim is so snappy in comparison↵(@michaelb.eth)
20:27:11*sagax quit (Remote host closed the connection)
20:28:35FromDiscord<Hourglass [She/Her]> In reply to @michaelb.eth "so you'll eventually leak": Ah
20:30:49FromDiscord<wiga> anyone knows how to use the RSA_public_encrypt and RSA\_private\_decrypt functions from openssl ?
20:31:33*kenran quit (Remote host closed the connection)
20:33:04FromDiscord<dlesnoff> In reply to @wiga "anyone knows how to": Maybe ask in #security ?
20:33:20FromDiscord<wiga> maybe
20:33:45PMunchThe people who've made languageserver basically introduced some breaking changes (and outright bugs) to nimsuggest which doesn't show up in their project but which breaks NimLSP..
20:33:55PMunch@wiga, define "how to use"
20:34:21FromDiscord<wiga> an example
20:34:31FromDiscord<wiga> like, how to encrypt and decrypt a string
20:35:16PMunchAh, for that I'd look at C examples, they should be 1:1 portable
20:35:24FromDiscord<guttural666> In reply to @PMunch "<@375727321958580228>, yeah there are": any way to fix them on your side or what can I do in Vim?
20:35:51PMunchAnyone know if there is some pragma or something you can put around a call to make asserts throw a catchable error?
20:36:08FromDiscord<wiga> In reply to @PMunch "Ah, for that I'd": I do not C
20:36:08PMunch@guttural666, yeah they basically have to be fixed in NimLSP/nimsuggest
20:36:25PMunchI've looked into it but I haven't had time to fix them properly. Nimsuggest is a hairy beast
20:36:49PMunch@wiga, well there's always time to learn
20:37:04FromDiscord<wiga> I don't have much time thats the problem
20:37:11PMunchWhat are you encrypting/decrypting?
20:37:13FromDiscord<guttural666> In reply to @PMunch "<@375727321958580228>, yeah they basically": damn, that sucks, basically flying blind rn in vim, is that something you can tackle in nimlsp or is that strictly on nimsuggest?
20:37:20FromDiscord<wiga> In reply to @PMunch "What are you encrypting/decrypting?": json
20:37:23FromDiscord<wiga> strings
20:37:29FromDiscord<wiga> for server communications
20:37:52PMunchIn general crypto is something which is tricky to get right, so unless you have time to learn it properly then it might not be worth it at all
20:38:00FromDiscord<wiga> or maybe if there's other asymetric encryption algorithm
20:38:01PMunchFalse sense of security and all that
20:38:30PMunchI've used RSA public/private crypto in Nim before with OpenSSL, so it's certainly possible
20:38:42PMunchI remember it being quite simple even
20:38:47FromDiscord<wiga> can u give me an example?
20:39:47PMunch@guttural666, I believe it should be possible to fix in NimLSP
20:40:38FromDiscord<guttural666> In reply to @PMunch "<@375727321958580228>, I believe it": you must encounter these probs as well, I'v seen you use vim on YT
20:40:49PMunchAt least if you use a version where this fix is present: https://github.com/nim-lang/Nim/pull/21555
20:41:11PMunchYeah I use Vim, but I've also used Nim long enough that I don't really notice when NimLSP stops working..
20:41:34FromDiscord<guttural666> In reply to @PMunch "Yeah I use Vim,": yeah 😄
20:41:34PMunchI do have some error messages and stuff in my Vim at the moment, not 100% sure where they come from though
20:42:25PMunch@wiga, I'm doing something else at the moment, but it's pretty much a copy/paste of the C solutions you find on Stackoverflow I'd imagine
20:43:36FromDiscord<wiga> ah
20:43:40FromDiscord<wiga> ty
21:06:19FromDiscord<corey> Hey nim friends, I am trying to upgrade to 2.0.0 rc2
21:07:00FromDiscord<corey> I checkout version 2.0, then importantly I _pull_, and then I run `sh build_all.sh`
21:07:18FromDiscord<corey> After this completes however, if I type `nim --version` I get back `1.9.3`
21:07:32FromDiscord<corey> What am I doing wrong? Do I need to fiddle with my paths or something?
21:12:47*Notxor quit (Quit: Leaving)
21:15:21FromDiscord<Elegantbeef> That's right
21:15:45FromDiscord<Yardanico> In reply to @corey "What am I doing": unstable nim versions are always odd
21:15:46FromDiscord<Elegantbeef> Version 2.0's rc is 1.9.3 presently
21:15:55FromDiscord<Yardanico> when nim 2.x becomes stable it'll be 2.x :)
21:16:28FromDiscord<corey> So even though I'm on 2.0 rc2 it will still say 1.9.3?
21:16:39PMunchCorrect
21:16:48FromDiscord<corey> Alrighty
21:16:53*PMunch quit (Quit: leaving)
21:17:02FromDiscord<corey> Thanks!
21:28:52*ltriant joined #nim
21:33:37*ltriant quit (Ping timeout: 265 seconds)
21:40:42FromDiscord<BoomBang> Do you guys know how to check if 2 `case` objects are equal?
21:42:47FromDiscord<Elegantbeef> You have to implement your own `==` operator
21:46:15FromDiscord<BoomBang> oh
21:46:17FromDiscord<BoomBang> ok
21:47:04FromDiscord<Elegantbeef> If your data type only uses stack allocated memory you could import C's equalMem or whatever it's called
21:47:14FromDiscord<Elegantbeef> You also could use one of the many macro libraries for object variants
21:53:13*TakinOver joined #nim
22:00:50FromDiscord<turbo> How can I create a json array with `%` as the root object, instead of an object?
22:01:24*junaid_ quit (Remote host closed the connection)
22:01:28FromDiscord<turbo> nvm got it
22:18:53*ltriant joined #nim
22:34:48*ltriant quit (Read error: Connection reset by peer)
22:35:17*ltriant joined #nim
23:32:44FromDiscord<sOkam!> is there any stdlib function for replacing text in a file?
23:39:15*ltriant quit (Ping timeout: 250 seconds)
23:41:15*ltriant joined #nim
23:55:24FromDiscord<auxym> strutils...
23:55:49FromDiscord<sOkam!> im searching there. but i don't know if there is any of them specifically made to replace in a file
23:56:15FromDiscord<sOkam!> im currently opening the file into a string, and writing the entire file again with a `replace` call, but it feels cheaty
23:56:41FromDiscord<auxym> read to a string, replace, write. If the file fits in memory.
23:57:05FromDiscord<auxym> if it doesn't fit in memory, you'll have to roll your own sed-like thing ig
23:58:09FromDiscord<Yardanico> In reply to @sOkam! "im currently opening the": i mean if the file is small enough, it really won't be noticeable in real-world usage :)
23:58:18FromDiscord<Yardanico> but if it's multiple MBs, then maybe you need a better solution
23:58:44FromDiscord<sOkam!> kk