<< 18-05-2022 >>

00:21:04*Guest7620 is now known as Stink
00:39:03*vicfred quit (Quit: Leaving)
00:40:34*krux02 quit (Remote host closed the connection)
00:59:11FromDiscord<retkid> so like
00:59:24FromDiscord<retkid> if im loading a 89 gb file into the xml parser
00:59:29FromDiscord<retkid> will it chunk it at all?
00:59:59FromDiscord<retkid> or do i have to make my own or does someone already have a library which buffer reads it
01:04:05FromDiscord<californiatokens> I'll help 10 people on how to earn $12,000 within 72 hours but you will pay me 10% of your profit when you receive it.↵Note\: only interested people should apply, drop a message let's get started or via WhatsApp\: +1 (216 315 7686
01:05:58FromDiscord<huantian> more of em
01:06:01FromDiscord<!Patitotective> In reply to @californiatokens "I'll help 10 people": @Yardanico ban?
01:33:22FromDiscord<Elegantbeef> it takes a string so nope↵(@retkid)
01:33:46FromDiscord<retkid> In reply to @Elegantbeef "it takes a string": think of a more painful sentince
01:33:51FromDiscord<retkid> (edit) "sentince" => "sentience"
01:33:59FromDiscord<Elegantbeef> sentence even 😄
01:34:13FromDiscord<retkid> ;/kn mcvb ncvb ?
01:34:18FromDiscord<retkid> setence
01:34:23FromDiscord<retkid> all sentience is painful
01:34:26FromDiscord<Elegantbeef> Wait nevermind xmlparser does actualy stream
01:34:31FromDiscord<retkid> sentence
01:34:38FromDiscord<retkid> typing is hard
01:34:49FromDiscord<Elegantbeef> https://nim-lang.org/docs/parsexml.html#example-1colon-retrieve-html-title
01:35:29FromDiscord<retkid> I dont think that will be enough to stop my ram from being filled
01:36:07FromDiscord<Elegantbeef> What do you mean
01:36:10FromDiscord<Elegantbeef> it uses streams
01:38:19FromDiscord<retkid> In reply to @Elegantbeef "it uses streams": well it depends how it works but what if the tree itself is enough to fill 8 gb
01:38:39FromDiscord<retkid> or if im able to issue operations without loading too much into ram
01:56:58FromDiscord<Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3Y2x
01:57:24FromDiscord<Elegantbeef> `let myEnv = getEnv("MY_ENV", "default")`
02:00:42FromDiscord<Zectbumo> why I didn't see that, who knows
02:01:00FromDiscord<Rika> Reminder that Nim does not have truthy values
02:01:58FromDiscord<Zectbumo> yeah :/ I eventually will be making \`??\` I imagine
02:03:32FromDiscord<Rika> You do you
02:03:38FromDiscord<Rika> Most of us don’t want it
02:03:56FromDiscord<Zectbumo> and most of you do yous
02:04:06FromDiscord<Rika> Yes
02:04:40FromDiscord<huantian> I think it'd be better just to wrap things like `getEnv` in `Option`
02:05:00FromDiscord<Zectbumo> instead of using the builtin default parameter?
02:05:31FromDiscord<Rika> Yes, default does not mean “nothing”
02:05:44FromDiscord<Rika> They’re valid values that may be received from input
02:06:19FromDiscord<Zectbumo> In reply to @huantian "I think it'd be": what would be the example in my case using Option?
02:06:31FromDiscord<huantian> or do something like↵`getEnv(env: string): Option[String]` and `getEnv(env: string, default: string): string`
02:07:13FromDiscord<Zectbumo> I'll try that on for size and see how the crotch fits
02:07:46FromDiscord<Rika> That is the strangest figure of speech I’ve heard recently
02:08:02FromDiscord<Elegantbeef> The first half is common
02:08:08FromDiscord<Elegantbeef> The latter half is very much uncommon
02:08:29FromDiscord<huantian> sent a code paste, see https://paste.rs/hrN
02:09:20FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=3Y2A" => "https://play.nim-lang.org/#ix=3Y2B"
02:09:21FromDiscord<Zectbumo> ah that's nice ?| that's that ?? I've been looking for
02:09:31FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=3Y2B" => "https://play.nim-lang.org/#ix=3Y2C"
02:09:43FromDiscord<Zectbumo> well, sheesh, how come getEnv didn't do that in the first place?
02:09:49FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=3Y2C" => "https://play.nim-lang.org/#ix=3Y2D"
02:10:00FromDiscord<Elegantbeef> Old API that could not have drastic changes due to 1.0
02:10:00FromDiscord<Rika> Because the standard library doesn’t integrate with options
02:10:15FromDiscord<Zectbumo> oh year, getEnv would be as old as it gets I imagine
02:10:23FromDiscord<Zectbumo> (edit) "year," => "yeah,"
02:10:54FromDiscord<Elegantbeef> at the very least it should've returned `(bool, string)` where the bool is if it existed
02:12:01FromDiscord<Zectbumo> it would be cool to have std lib flavors. Everything rewritten with (bool, string) returns and another flavor with everything Options
02:12:32FromDiscord<Rika> Combinational explosion, that would be
02:12:43FromDiscord<Elegantbeef> No point in flavours you can convert between both really
02:14:34FromDiscord<Zectbumo> Rika, I don't think you would want to combine them all
02:16:28FromDiscord<Rika> That’s not what I mean
02:16:49FromDiscord<Rika> The amount of options would multiply how many things that would need attention
02:17:09FromDiscord<Rika> You could say of course to implement this via a macro
02:18:02FromDiscord<Zectbumo> oh I was thinking more like fork the std/
02:18:37FromDiscord<Zectbumo> maybe later when nim2 has a huge user base
02:18:43FromDiscord<Elegantbeef> Smarter to just build ontop of it
02:19:12FromDiscord<Zectbumo> I dunno, some of the lib APIs are bad
02:19:38FromDiscord<Elegantbeef> Sure but 2.0 is explicitly dealing with bad stdlib
02:20:29FromDiscord<Zectbumo> I want to get used to std/ so I'm using as much std/ as possible. I'll branch out once I start forming my opinions. I imagine there are full nim environments out there waiting for me
02:25:29FromDiscord<Zectbumo> wait, so where is this nim2? and can I clone it?
02:25:58FromDiscord<Elegantbeef> If you have choosenim it's `choosenim devel` afaik
02:26:07FromDiscord<Elegantbeef> It's not a concrete thing as of yet
02:26:15FromDiscord<Elegantbeef> Just a bunch of goals that need to be met really
02:26:45FromDiscord<Zectbumo> so this has the works for the rebuilding of the std lib?
02:27:02FromDiscord<Elegantbeef> One of the goals is addressing issues of the stdlib
02:27:08FromDiscord<Elegantbeef> So if you want to change things time to get in there
02:27:19FromDiscord<Zectbumo> this devel branch would be non-backwards compatible then
02:27:30FromDiscord<that_dude> In reply to @Zectbumo "wait, so where is": https://forum.nim-lang.org/t/9132↵https://github.com/nim-lang/RFCs/issues/437↵This may be of interest?
02:28:44FromDiscord<Zectbumo> threads:on huh, well there goes everyone's easy Windows experience. missing pthread
02:29:03FromDiscord<Elegantbeef> The implication they dont address that
02:29:23FromDiscord<spoon> whats going on in nim 2 with std?
02:29:37*noeontheend quit (Ping timeout: 260 seconds)
02:30:05FromDiscord<Elegantbeef> It can change
02:30:39FromDiscord<Zectbumo> In reply to @Elegantbeef "So if you want": I should have taken notes as I've been going through the API
02:30:47FromDiscord<spoon> only thing on my wishlist for nim 2 is better multidimensional array syntax
02:31:22FromDiscord<Elegantbeef> That can be done with a `[]` macro
02:32:07FromDiscord<spoon> i guess, still learning macros
02:38:29*cyraxjoe joined #nim
03:03:19FromDiscord<Elegantbeef> @spoon\: it's not too hard https://play.nim-lang.org/#ix=3Y2O
03:03:54FromDiscord<Elegantbeef> actually that's wrong
03:04:00FromDiscord<Elegantbeef> `a[0]` doesnt work for enum indexed arrays
03:06:00FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Y2P there we go
03:06:52FromDiscord<spoon> ah
03:07:06FromDiscord<Elegantbeef> This could be generalize for all collections if one really wanted to
03:09:07FromDiscord<spoon> how would assigning a type look?
03:09:11FromDiscord<spoon> without dynamic typing
03:10:49FromDiscord<spoon> (and woah, didn't know something like c could happen, does it convert the boolean to 0 or 1 value to index it?)
03:11:17FromDiscord<Elegantbeef> It's an enum indexed array it works just like `array[-10..10, int]`
03:13:43FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Y2R
03:15:37FromDiscord<spoon> what about manually defining the type instead of inferring it?
03:15:46FromDiscord<Elegantbeef> What?
03:15:59FromDiscord<spoon> as in `let b: <type>`
03:16:13FromDiscord<Elegantbeef> `array[bool, int]`
03:16:51FromDiscord<Zectbumo> how does or-ing types work? I see things like `(array or seq)` it makes sense reading it but I can't make sense of it under the hood. nim doesn't support stuff like `myInt == (1 or 3)` does it?
03:17:32FromDiscord<spoon> don't multidimensional arrays have to be defined by `let a: array[4, array[4, int]]`
03:17:32FromDiscord<Elegantbeef> array's take ranges as the index, the accept integers/values and convert them to ranges
03:17:34FromDiscord<TechnoRazor> In reply to @Zectbumo "how does or-ing types": it's a shorthand for generics, which is why that can only be used for function parameters
03:18:10FromDiscord<Zectbumo> but it was used like this `oa[oa.low] is (array or seq)` https://play.nim-lang.org/#ix=3Y2P
03:18:15FromDiscord<Elegantbeef> No you can define them as literals↵(@spoon)
03:18:20FromDiscord<Elegantbeef> Thats a concept↵(@Zectbumo)
03:18:43FromDiscord<Elegantbeef> Or'd types are constraints or can be checked against
03:19:03FromDiscord<Zectbumo> okay I haven't gotten to concepts yet
03:19:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y2T
03:19:27FromDiscord<TechnoRazor> i didn't know that was possible, that's cool
03:19:38FromDiscord<Elegantbeef> Concepts are experimental but rather lovely
03:20:05FromDiscord<Zectbumo> is that proc example a concept too or a separate example on how type or can be used?
03:20:14FromDiscord<TechnoRazor> i used concepts for something kind of funny a while back
03:20:14FromDiscord<Elegantbeef> That's a generic procedure
03:20:19FromDiscord<Elegantbeef> If it doesnt say `concept` it's not a concept
03:21:09FromDiscord<spoon> how would manually defining a 3 or 4 dimensional array work then?
03:21:36FromDiscord<Elegantbeef> `var a = [[[[1]]][[[[2]]]]`
03:21:46FromDiscord<huantian> mmm syntax
03:21:48FromDiscord<Elegantbeef> with a comma
03:22:04FromDiscord<huantian> I feel like i'm writing lisp
03:22:09FromDiscord<Elegantbeef> If you're manually defining a 4D array you have bigger problems
03:23:21FromDiscord<Zectbumo> I would macro that to `var a = [4x4]`
03:23:51FromDiscord<spoon> right, was just saying if i wanted a 3-dimensional grid of objects, seq or otherwise, and i wanted to fill it in algorithmically after assigning it, wouldn't that require using `var b: array[3, array[3, array[3, int]]]`
03:23:57FromDiscord<Elegantbeef> I'd just make a procedure `matrix[4](myVec4, myVec4, myVec4, myVec4)`
03:24:14FromDiscord<Elegantbeef> Yes it'd
03:24:24FromDiscord<Elegantbeef> That is the type afterall
03:24:59FromDiscord<Elegantbeef> You could also just do `array[27, int]` like most would
03:25:59FromDiscord<TechnoRazor> sent a code paste, see https://play.nim-lang.org/#ix=3Y2U
03:26:01FromDiscord<Elegantbeef> Then make your own `[a, b]` and `[a, b, c]`
03:26:06FromDiscord<TechnoRazor> (edit) "https://play.nim-lang.org/#ix=3Y2U" => "https://paste.rs/qh1"
03:26:51FromDiscord<Elegantbeef> Jeez that's silly
03:26:59FromDiscord<TechnoRazor> it works ¯\_(ツ)_/¯
03:27:01FromDiscord<spoon> lol
03:27:06FromDiscord<Elegantbeef> Just use distinct
03:27:19FromDiscord<huantian> that's gonna be the words on your gravestone beef
03:27:26FromDiscord<Elegantbeef> Indeed
03:27:26FromDiscord<TechnoRazor> but then i'd have to borrow every seq & openArray function i wanted to use? no thanks
03:27:33FromDiscord<Elegantbeef> No you dont
03:27:49FromDiscord<Elegantbeef> You can use converters or make a template
03:28:01FromDiscord<TechnoRazor> that's just as frustrating
03:28:25FromDiscord<TechnoRazor> i messed around with templates & converters, and they did not work as well as that concept
03:28:43FromDiscord<Elegantbeef> QED
03:28:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y2V
03:29:45FromDiscord<Elegantbeef> you can of course even make it `a`
03:29:55FromDiscord<Elegantbeef> Then internally you lose all that typing
03:30:06FromDiscord<TechnoRazor> `distinctBase` returns a typedesc
03:31:05FromDiscord<Elegantbeef> No it doesnt
03:31:20FromDiscord<TechnoRazor> https://media.discordapp.net/attachments/371759389889003532/976326094930214962/unknown.png
03:31:36FromDiscord<Elegantbeef> Test it before you spepak
03:31:37FromDiscord<Elegantbeef> speak even
03:32:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y2W
03:32:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y2X
03:32:58FromDiscord<Elegantbeef> When on a variable it returns the type converted variable
03:33:03FromDiscord<Elegantbeef> When used on a type it returns the base type
03:33:11FromDiscord<TechnoRazor> is the documentation wrong then?
03:33:15FromDiscord<TechnoRazor> oh
03:33:18FromDiscord<Elegantbeef> Well the above works
03:33:30FromDiscord<TechnoRazor> right, i didn't notice the template at the bottom
03:33:32FromDiscord<TechnoRazor> my bad
03:33:37FromDiscord<TechnoRazor> (edit) "right, i didn't notice the template at the bottom ... " added "of the documentation"
03:33:47FromDiscord<Elegantbeef> Ah ok
03:34:16FromDiscord<Elegantbeef> I've been using it a shit ton with my wasm wrapping so it's a bit funny to hear it doesnt do what i know it does 😄
03:34:35FromDiscord<TechnoRazor> yeah i get that, i was just confused
03:35:08FromDiscord<huantian> In reply to @Elegantbeef "I've been using it": no beef we're not gaslighting you
03:35:30FromDiscord<Elegantbeef> Good i'm to be flame broiled
03:38:15FromDiscord<TechnoRazor> sent a code paste, see https://play.nim-lang.org/#ix=3Y2Z
03:38:17FromDiscord<TechnoRazor> (edit) "https://play.nim-lang.org/#ix=3Y2Z" => "https://paste.rs/CEL"
03:38:22FromDiscord<Elegantbeef> Like i said you can use a converter
03:38:37FromDiscord<TechnoRazor> i think converters didn't work with functions that take `openArray`s
03:38:40FromDiscord<TechnoRazor> im not certain
03:38:44FromDiscord<Elegantbeef> Correct
03:38:51FromDiscord<TechnoRazor> so it's still frustrating
03:39:31FromDiscord<TechnoRazor> i really feel like my concept solution was the neatest for my case, as silly as it is
03:40:43FromDiscord<TechnoRazor> In reply to @TechnoRazor "going back to this;": and i don't know the answer to this: would converting types like this, or using converters, slow things down at all?
03:41:02FromDiscord<TechnoRazor> (edit) "would" => "wouldn't"
03:42:32FromDiscord<Elegantbeef> the conversion for distincts are free so the converter proc call would be a cost, but it'd probably be inlined in most builds
03:42:51FromDiscord<TechnoRazor> right
03:43:14FromDiscord<TechnoRazor> in any case im sticking with my silly little solution
03:48:22FromDiscord<retkid> what the fuck is =?=
03:48:33FromDiscord<Elegantbeef> an opeprator
03:48:34FromDiscord<huantian> probably someone's custom operator
03:48:39FromDiscord<Elegantbeef> operoeproepreorator
03:48:48FromDiscord<huantian> orpororatoerorotor?
03:48:58FromDiscord<retkid> In reply to @huantian "probably someone's custom operator": ye im stupid i didn't see the definition until right after i typed it
03:49:08FromDiscord<retkid> return cmpIgnoreCase(a, b) == 0
03:49:17FromDiscord<retkid> (edit) "return cmpIgnoreCase(a, b) == 0" => "sent a code paste, see https://play.nim-lang.org/#ix="
03:49:17FromDiscord<retkid> fair
04:15:31*slowButPresent quit (Quit: ERC 5.4 (IRC client for GNU Emacs 28.1))
05:55:02FromDiscord<everyone> In reply to @huantian "orpororatoerorotor?": orpotatoporteratororpotator
05:58:58*ltriant_ joined #nim
06:01:03*ltriant quit (Ping timeout: 246 seconds)
06:01:24*Ekho quit (Ping timeout: 246 seconds)
06:01:24*NimEventer quit (Ping timeout: 246 seconds)
06:01:36*NimEventer joined #nim
06:06:57*Ekho- joined #nim
06:18:05*Ekho- is now known as Ekho
06:39:04*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in - Stopping for maintenance... Leave messages at my XMPP ([email protected]), or my Discord (Gustavo6046#9009), or possibly my Mastodon [email protected]), or email ([email protected]).)
06:39:35FromDiscord<Zectbumo> @ElegantBeef , now you have me thinking when I spot stuff in the stdlib. So for example, os.lastPathPart says it's "aka: baseName" but basename would return empty string "" when passed "foo/bar/" so no, it's not like basename. I think it should act like basename as they actually thought they were doing
06:40:18FromDiscord<Zectbumo> https://nim-lang.org/docs/os.html#lastPathPart%2Cstring
06:41:08FromDiscord<Zectbumo> this is the proc that should be saying that it's like basename:↵https://nim-lang.org/docs/os.html#extractFilename%2Cstring
06:43:21FromDiscord<that_dude> In reply to @Zectbumo "<@145405730571288577> , now you": I've been looking into starting to participate in pr's so it would be awesome if you could collect a list of various things like this
06:44:01FromDiscord<that_dude> At least to look at
06:44:01FromDiscord<Zectbumo> sounds good. I just started. this is my first note
06:44:22FromDiscord<that_dude> :)
06:45:09*wallabra joined #nim
06:58:14*PMunch joined #nim
07:37:24FromDiscord<everyone> can somebody give me an example code of a simple hello world cli made with std/parseopts? I am having a hard time understanding it from the docs.
07:50:56PMunch@everyone, isn't there one in the docs?
07:51:07PMunchhttps://nim-lang.org/docs/parseopt.html
07:52:37FromDiscord<everyone> In reply to @PMunch "<@856412455507984404>, isn't there one": ik but it's A BIT confusing
07:52:58PMunchWhich part is confusing to you?
07:53:10FromDiscord<everyone> In reply to @PMunch "Which part is confusing": basically everything
07:53:37PMunchWell that certainly makes it harder to try and explain what's going on..
07:53:39FromDiscord<everyone> like, what is in the `initOptParser`
07:53:55PMunchinitOptParser is called with the string you want to parse as options
07:54:05FromDiscord<everyone> `cmdShortOption, cmdLongOption`
07:54:18FromDiscord<everyone> `cmdArgument`
07:54:24FromDiscord<everyone> `cmdEnd`
07:54:59PMunchTypically this would be commandLineParams
07:55:53PMunchcmdShortOption and cmdLongOption corresponds to -a and --argument respectively
07:56:49PMunchcmdArgument are arguments like file.txt without any dashes
07:57:04PMunchAnd cmdEnd just tells you that you've reached the end of the options
07:57:06FromDiscord<everyone> In reply to @PMunch "cmdShortOption and cmdLongOption corresponds": isn't the `--argument` called flag?
07:57:43PMunchWell flags are options without a value
07:58:17FromDiscord<everyone> sooo how do we run this?
07:58:40PMunchPlop it in a file and do `nim c -r myfile.nim <any arguments here>`
07:58:58PMunchOr of course do `nim c myfile.nim` and then `./myfile <arguments>`
07:59:06FromDiscord<everyone> hmmm
08:01:16FromDiscord<everyone> and what is this ` p.next()`
08:01:45PMunchThat selects the next argument
08:02:19FromDiscord<everyone> In reply to @PMunch "That selects the next": which is.....
08:02:37PMunchWhatever the next argument in your input is..
08:02:58PMunchIf you leave it out you will just get the same argument forever in the loop there
08:03:01FromDiscord<everyone> oh
08:03:17PMunchSo it would just say "Option: a" over and over again
08:04:05*sagax quit (Remote host closed the connection)
08:11:07FromDiscord<choltreppe> sent a code paste, see https://play.nim-lang.org/#ix=3Y3y
08:11:28FromDiscord<Yardanico> In reply to @choltreppe "I noticed something: this": the first one working is actually a bug
08:11:38FromDiscord<choltreppe> ah ok
08:11:44FromDiscord<Yardanico> lemme reference the manual on this
08:13:10FromDiscord<Yardanico> In reply to @choltreppe "ah ok": but basically IIRC there's a rule that if you've used `result` in the proc body, then a return like that won't work
08:15:59FromDiscord<choltreppe> ok thx
08:16:18FromDiscord<Yardanico> In reply to @choltreppe "ok thx": actually doesn't look like it's in the manual (or I missed it), but it is in the first tutorial
08:16:23FromDiscord<Yardanico> "A procedure that does not have any return statement and does not use the special result variable returns the value of its last expression."
08:20:12*ltriant_ quit (Ping timeout: 260 seconds)
08:20:34*ltriant joined #nim
08:24:30*krux02 joined #nim
08:28:01FromDiscord<Yardanico> hah, realised that `nil` is still not deprecated but not also documented regarding its use instead of `discard` in procedure bodies :)
08:35:33*xet7 quit (Remote host closed the connection)
08:36:50*xet7 joined #nim
08:37:28FromDiscord<everyone> sent a code paste, see https://play.nim-lang.org/#ix=3Y3F
08:39:06FromDiscord<Yardanico> @everyone it's .key not .val
08:39:14FromDiscord<Yardanico> .key is the name, .val is the value of the argument
08:39:22FromDiscord<everyone> In reply to @Yardanico ".key is the name,": hmmmm
08:40:29FromDiscord<everyone> In reply to @Yardanico "<@856412455507984404> it's .key not": i changed .val to .key, still not working
08:40:34FromDiscord<Yardanico> because you have a space in the string
08:40:40FromDiscord<Yardanico> it's `"version"` not `" version"`
08:40:43FromDiscord<everyone> bruh
08:41:31FromDiscord<m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=3Y3H
08:44:09FromDiscord<everyone> ok so now it is working when i use `.\main.exe --version`, but it is also working when i use `.\main.exe --joe`
08:44:14FromDiscord<Elegantbeef> check the kind of `j` then use the proper accessor
08:47:09FromDiscord<Yardanico> In reply to @m4ul3r "I'm planning on iterating": why not https://nim-lang.org/docs/json.html#pairs.i%2CJsonNode ? it'll be more efficient
08:47:18FromDiscord<Yardanico> since getFields has to store everything in a seq first, while pairs is an iterator
08:50:09FromDiscord<m4ul3r> that's much easier, thanks!
08:52:30*jmdaemon quit (Ping timeout: 260 seconds)
08:59:29*krux02 quit (Remote host closed the connection)
09:33:34*firq quit (Ping timeout: 250 seconds)
09:37:14*firq joined #nim
09:41:05FromDiscord<Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3Y3V
09:42:42FromDiscord<Rika> I didn’t know that
09:43:00FromDiscord<Rika> That’s one way to do a cursed different-value-assign
09:43:10FromDiscord<Rika> Just have a proc that’s stateful
09:43:46FromDiscord<m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=3Y3W
09:43:56FromDiscord<Yardanico> not sure I understand the question
09:43:57FromDiscord<Rika> I don’t get it
09:44:01FromDiscord<Yardanico> you just construct an object normally and add it to the sequence
09:44:05FromDiscord<Yardanico> there's nothing unusual about that
09:44:08FromDiscord<m4ul3r> (edit) "https://play.nim-lang.org/#ix=3Y3W" => "https://play.nim-lang.org/#ix=3Y3X"
09:44:31FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Y3Y
09:45:45FromDiscord<m4ul3r> would all objects in the sequence not have variable names?
09:45:55FromDiscord<Yardanico> there's no concept of "variable name" at runtime
09:46:04FromDiscord<Yardanico> because that's just an abstraction for the compiler and developer
09:46:07FromDiscord<Yardanico> maybe you actually want a table?
09:46:12FromDiscord<Yardanico> https://nim-lang.org/docs/tables.html
09:46:14FromDiscord<Rika> Do you mean reference
09:46:36FromDiscord<Yardanico> tables is what you should use if you want to have some strings (or other types) as keys to refer to some objects in memory
09:47:27FromDiscord<m4ul3r> That might be what I need for this case, i'll check it out
10:08:38*kenran joined #nim
10:08:51*kenran quit (Client Quit)
10:39:56om3gahttps://0bin.net/paste/t14fcr-7#5IT7760z3UzdOc4tfls2eNCeBxPpICza3Xjq-Z5icJd <---- I have fun time
10:40:36om3gathe ridiculous thing, that code worked before
10:40:54om3gaand it works if I disable --opt:speed
10:42:16om3gaWhat I want to ask, is the allocShared0 "stable" function? Can I use it with any GC?
10:45:40FromDiscord<oliverwilliams> I'll help 10 people on how to earn $20,000 within 72 hours but you will pay me 10% of your profit when you receive it.↵Note\: only interested people should apply, drop a message let's get started↵https://t.me/Tradewitholiver01
10:46:24om3gahmm, spam? :)
10:46:25FromDiscord<Yardanico> [federico3](https://matrix.to/#/@federico.ceratto:matrix.org)\: can you remove the message on matrix though?
10:46:26FromDiscord<Yardanico> i can't for some reason
10:46:42PMunchom3ga, yes, spam
10:56:39PMunchHmm, looking at V-USB I don't think it should be too hard to part it to Nim
10:57:09PMunchProbably re-use the assembly files for the timing critical parts
10:59:20PMunchAnd create a shared interface with the USB chip on the Atmega32u4
11:17:36om3gaAnother question, can binary from subcatalog for example : modulemodule_name affect final result, if that module was imported from upper level : import module/module_name ?
11:18:53FromDiscord<Rika> I don’t understand the question
11:18:56om3gaGeany IDE puts binary, after compilation in the same catalog, so I press accidentally that button sometimes
11:19:36om3gafor example I have main.nim, which imports module from ./module/modulename
11:20:25om3gaif I compile ./module/modulename.nim, geany puts binary here > ./module/modulename
11:21:07PMunchThat shouldn't affect anything
11:21:17om3gathanks
11:21:30PMunchOr to put it this way, if you aren't sure if it affects anything, it probably doesn't
11:21:48om3gaI removed it, and that errors gone
11:21:48FromDiscord<enthus1ast> only if you have a folder called "modulename" and are on linux that has no executable suffix
11:21:50PMunchYou could of course write a macro which detects the presence of that file and does something with it
11:22:02om3gastrange things I have here, trying to debug that
11:22:17PMunchom3ga, what error did you get
11:22:24om3gaundefined behavior somewhere, looks like something tries to read from null
11:22:43om3gahere is example with gcc https://0bin.net/paste/t14fcr-7#5IT7760z3UzdOc4tfls2eNCeBxPpICza3Xjq-Z5icJd
11:24:16om3gaI should try to compact the code which gives the same err, and maybe that will help to understand
11:25:32PMunchYes, creating a minimal reproduction is always a good idea
11:27:03om3gahttps://0bin.net/paste/toW0F87v#ePdBScO-/n44OjuwF9OHIa3djjLtIPZLZBK985e9Jo1
11:27:21om3gathat's what now it says, after I deleted all leftover binaries
11:28:15om3ga#7 and #6 - strange
11:29:53PMunchHard to tell without seeing any code
11:30:41om3gayes, of course, I will copy minimal non-working example
11:31:01om3gaor maybe I will find the error by myself during that process :)
11:31:46FromDiscord<d4rckh> which nim web server runs best in a thread?
11:32:16FromDiscord<d4rckh> or asynchronously
11:32:21PMunch@d4rckh, benchmark and find out :)
11:32:38FromDiscord<d4rckh> haha
11:32:59om3gad4rckh, you can use httperf for benchmarking
11:33:45FromDiscord<d4rckh> i think ill go with jester
11:35:28FromDiscord<enthus1ast> think most of the time this actually does not matter, since you might have a caching reverse proxy, and application logic that takes a while, database connection, etc, i think most importantly is having a correct webserver \:)↵(@d4rckh)
11:36:20FromDiscord<enthus1ast> and also stuff like\: authentication etc must be doable
11:36:22FromDiscord<enthus1ast> and websocket
11:36:33FromDiscord<d4rckh> hmm, i see
11:36:41FromDiscord<enthus1ast> maybe even compression (but this is often also done in the proxy)
11:36:58FromDiscord<d4rckh> how would i run jester in async?
11:37:17FromDiscord<d4rckh> and call this using `asyncCheck startHttpAPI()`
11:37:18FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Y4j
11:38:00FromDiscord<Rika> Looks wrong, doesn’t serve run the async loop?
11:38:27om3gaI continue to use fcgi lib for that reasons. Exactly that's what I'm doing right now
11:39:05om3ga3000 requests per second <=1000 requests in parallel with lighttpd
11:39:32FromDiscord<d4rckh> In reply to @Rika "Looks wrong, doesn’t serve": should i run server using asyncCheck?
11:39:57FromDiscord<d4rckh> ok that didnt work
11:44:16FromDiscord<enthus1ast> is jester the only thing that should run async in your code?
11:44:45FromDiscord<d4rckh> nah, there are multiple things that run in async
11:45:07FromDiscord<enthus1ast> https://github.com/dom96/jester/blob/2551a8cfce7faa7a60500bf25acc2cc81b79d1b0/jester.nim#L515
11:45:15FromDiscord<enthus1ast> serve calls runForever
11:45:29FromDiscord<enthus1ast> which is just a while loop that calls poll
11:45:49FromDiscord<enthus1ast> so serve drives the async loop
11:45:56FromDiscord<d4rckh> ah yes
11:45:58FromDiscord<d4rckh> fixed it
11:46:02FromDiscord<enthus1ast> what you could do is to run other stuff before that
11:46:08FromDiscord<d4rckh> yup
11:46:15FromDiscord<enthus1ast> with asyncCheck
11:46:17FromDiscord<enthus1ast> kk
11:46:50PMunchThere really should be a version without runForever..
11:46:57FromDiscord<enthus1ast> yeas
11:47:02FromDiscord<enthus1ast> yeah/yes
11:47:35FromDiscord<d4rckh> ok, now my other things are slow :\(
11:48:13FromDiscord<enthus1ast> just slow all the time? Or when you do stuff in your http routes?
11:48:16FromDiscord<d4rckh> for example i read stdin in a thread and `await asyncdispatch.sleepAsync(100)`
11:48:28FromDiscord<d4rckh> and it takes like 1 second to read what i typed
11:49:27FromDiscord<d4rckh> ok sometimes its faster
11:49:28FromDiscord<d4rckh> its weird
11:49:31FromDiscord<d4rckh> heh
11:50:12PMunchThat sounds like a weird way of doing it..
11:50:18FromDiscord<enthus1ast> first thing i would try is to change the poll timeout (but you cant easily because jester drives the async loop \:) )
11:50:28FromDiscord<d4rckh> yup
11:52:05FromDiscord<enthus1ast> `await asyncdispatch.sleepAsync(100)` you call in a loop to wait for the flow var to complete right?
11:52:15FromDiscord<d4rckh> exactly
11:53:31FromDiscord<enthus1ast> yeah, i would just fork jester, copy and paste the serve and remove the waitForever (if this code path is taken at all, since it also could be httpbeast, which i do not know), or use something else
11:53:50FromDiscord<enthus1ast> ahm runForever i mean
11:54:35FromDiscord<enthus1ast> depending on what you wanna do with http, asynchttp server might be enough already
11:54:45FromDiscord<enthus1ast> must do the routing yourself though
11:56:37FromDiscord<enthus1ast> for this i've used code from that repo in the past\: https://github.com/enthus1ast/nimAsyncHttpTools/tree/master/src
11:58:56FromDiscord<d4rckh> got it
11:58:59FromDiscord<d4rckh> will probably do this later
11:59:55FromDiscord<d4rckh> is there any way to pass paramters to a jester router?
12:00:14FromDiscord<d4rckh> I'd like to access server props in myrouter
12:00:38FromDiscord<d4rckh> sent a code paste, see https://paste.rs/5aS
12:00:54FromDiscord<enthus1ast> globals maybe?
12:01:31FromDiscord<enthus1ast> but idk really, would have a look how router is implemented, guess its a macro
12:06:58FromDiscord<d4rckh> okay, globals worked
12:07:08FromDiscord<enthus1ast> but are ugly af
12:08:18FromDiscord<d4rckh> i guess
12:08:29FromDiscord<d4rckh> now i want to send over a sequence using json
12:08:54FromDiscord<enthus1ast> mh ok the macro generates procs\:
12:09:15FromDiscord<d4rckh> In reply to @d4rckh "now i want to": this does not really work `$(toJson server.clients)`
12:09:16FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/cfW
12:09:38FromDiscord<enthus1ast> $(%\ server.clients)
12:09:43FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Y4q
12:09:57FromDiscord<enthus1ast> or is it jsony?
12:10:08FromDiscord<d4rckh> that worked
12:10:24FromDiscord<d4rckh> except now it complains about an attribute of a client
12:10:31FromDiscord<d4rckh> a tuple, actually
12:10:39FromDiscord<d4rckh> cant it convert it to a json object?
12:11:10FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=
12:13:33FromDiscord<enthus1ast> mh could be that you must define a proc `%`(mytype)\: JsonNode = for it
12:14:23FromDiscord<d4rckh> ouch
12:14:50FromDiscord<enthus1ast> but then the parsing is the issue, i THINK you can define a parsing proc as well nowadays but not done it for std/json yet
12:21:18FromDiscord<d4rckh> `Error: 'myrouterIter' is not GC-safe as it accesses 'server' which is a global using GC'ed memory`
12:21:20FromDiscord<d4rckh> god
12:22:49*vicecea joined #nim
12:24:18FromDiscord<enthus1ast> Can try to wrap it in a gcsafe cast
12:25:32FromDiscord<enthus1ast> But when you use threads (or http east which uses threads imho, you must secure the access via locks
12:26:13FromDiscord<d4rckh> its just a damn object reference...
12:27:44FromDiscord<enthus1ast> https://nim-lang.org/docs/manual.html#effect-system-gc-safety-effect
12:28:02FromDiscord<enthus1ast> This one
12:28:25FromDiscord<enthus1ast> proc setPerThread() = {.cast(gcsafe).}\: deepCopy(perThread, someGlobal)
12:33:57*lumo_e joined #nim
12:42:30FromDiscord<billykin> https://t.me/Tradewitholiver01
12:43:09FromDiscord<d4rckh> In reply to @enthus1ast "proc setPerThread() = {.cast(gcsafe).}\:": i see, thanks
12:47:00*lumo_e quit (Ping timeout: 272 seconds)
12:54:54PMunchWARNING: The message from @billykin is a SCAM, do not click the link
13:02:49FromDiscord<enthus1ast> "trade" in the url == "scam" or "stupid nft"
13:13:37FromDiscord<Zoom> Well, [Matt Rader](https://www.mattrader.com/) wants a word with you.
13:14:05FromDiscord<enthus1ast> What is Matt Rader?
13:14:36FromDiscord<sheerluck> my trader
13:15:35FromDiscord<sheerluck> like Saul Goodman and "it's all good, man!"
13:16:05FromDiscord<enthus1ast> ah ok "t Rade" ic
13:16:17FromDiscord<enthus1ast> took longer than i would like to admit
13:19:13*dithpri joined #nim
13:25:30*genpaku quit (Ping timeout: 276 seconds)
13:25:39*dithpri quit (Quit: '); DROP TABLE Users;--)
13:32:00*genpaku joined #nim
13:33:49*vicfred joined #nim
13:45:00*LuxuryMode joined #nim
14:11:19*lumo_e joined #nim
14:30:58FromDiscord<Xzayler> I'm having a very basic problem...↵I have norm installed through nimble and when I compile `import norm` I get a `cannot open file` error....
14:31:13FromDiscord<Xzayler> what directory is supposed to be in my $PATH?
14:31:17FromDiscord<Xzayler> or is that even the problem?
14:36:35*piapiac quit (Remote host closed the connection)
14:46:23FromDiscord<demotomohiro> Which file `cannot open file`?
14:48:06FromDiscord<jmiven> do you have the `requires "norm"` line in your_project.nimble?
14:52:59FromDiscord<Xzayler> In reply to @demotomohiro "Which file `cannot open": norm
14:53:18FromDiscord<Xzayler> In reply to @jmiven "do you have the": not sure? I installed norm with nimble
14:54:02FromDiscord<Xzayler> I don't have a file like thta
14:54:04FromDiscord<Xzayler> (edit) "thta" => "that"
14:54:30NimEventerNew thread by Stoneface86: Problem with doc gen and runnableExamples, see https://forum.nim-lang.org/t/9161
14:54:31FromDiscord<Xzayler> AH wait I do
14:55:45FromDiscord<Xzayler> In reply to @jmiven "do you have the": Ok that fixed it, thanks
15:08:40FromDiscord<choltreppe> Is there any way to define/overload default values of types?
15:12:23FromDiscord<huantian> Could you elaborate?
15:17:01FromDiscord<choltreppe> sent a code paste, see https://play.nim-lang.org/#ix=3Y5s
15:17:04FromDiscord<choltreppe> for the type
15:18:13FromDiscord<huantian> If you wanna differentiate between a value and no value
15:18:20FromDiscord<huantian> You should use std/options
15:18:36FromDiscord<stoneface> don't think so, I know you can overload `default` but it will still zero initialize the type
15:19:22FromDiscord<huantian> options will default to none(int), and if you want a value you just set it to some(10). Just using int as an example, other types work too
15:19:24*noeontheend joined #nim
15:21:13om3gaPMunch, could you please check this https://drive.google.com/file/d/1L614Lroc7oJahPmCXRrVvgNyCokouuZB/view?usp=sharing
15:21:32om3gaminimal version of the code
15:22:27FromDiscord<choltreppe> Yea I Bad that idea aswell was abit disapointed that dient work
15:24:00FromDiscord<choltreppe> Had
15:25:46FromDiscord<stoneface> relevant RFC - https://github.com/nim-lang/RFCs/issues/233
15:42:39om3gagood idea, I hate to initialize each time
15:56:01FromDiscord<ambient> sent a code paste, see https://play.nim-lang.org/#ix=3Y5H
15:56:18FromDiscord<ambient> (edit) "https://play.nim-lang.org/#ix=3Y5H" => "https://play.nim-lang.org/#ix=3Y5I"
15:56:39FromDiscord<ambient> without writing a separate function that is
16:11:33*noeontheend quit (Ping timeout: 252 seconds)
16:34:40FromDiscord<d4rckh> what's wrong with this proc?
16:34:43FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Y5U
16:34:49FromDiscord<d4rckh> it prints `1` every time i run it
16:34:52FromDiscord<d4rckh> and then `hi`
16:34:59FromDiscord<d4rckh> but if i call it a second time
16:35:10FromDiscord<d4rckh> it only prints `1`
16:35:13FromDiscord<d4rckh> but nothing is sent
16:35:18FromDiscord<d4rckh> (edit) "but" => "and"
16:35:53FromDiscord<d4rckh> https://media.discordapp.net/attachments/371759389889003532/976523529254211644/unknown.png
16:38:01FromDiscord<d4rckh> ok, if i completely restart the server, connect my websocket client it works, until i reconnect the client
16:38:30*smvg joined #nim
16:38:46FromDiscord<d4rckh> this is very weird
16:39:11*jmdaemon joined #nim
16:44:47*LuxuryMode quit (Quit: Connection closed for inactivity)
16:48:18*lumo_e quit (Ping timeout: 272 seconds)
16:50:13FromDiscord<d4rckh> sometimes it sends data sometimes it doesnt
16:56:36FromDiscord<d4rckh> okay i see the problem, once i sent something, the socket closes for some reason
16:56:41FromDiscord<d4rckh> (edit) "sent" => "send"
17:14:48NimEventerNew thread by Jmgomez: NimForUE , see https://forum.nim-lang.org/t/9162
17:32:07*krux02 joined #nim
17:39:36FromDiscord<Xzayler> sent a code paste, see https://play.nim-lang.org/#ix=3Y68
17:40:09FromDiscord<Xzayler> I'm just trying to iterate through all objects within the sequence regardless of how many objects are inside of it
17:40:28FromDiscord<Xzayler> (edit) "https://play.nim-lang.org/#ix=3Y68" => "https://play.nim-lang.org/#ix=3Y69"
17:41:17FromDiscord<Xzayler> sent a code paste, see https://play.nim-lang.org/#ix=3Y6a
17:41:18FromDiscord<Xzayler> just the iterator version doesn't
17:48:30FromDiscord<demotomohiro> It seems that `insert` proc requires `var T` but `plant` in your for loop is not mutable.
17:49:17FromDiscord<demotomohiro> `for plant in plants.mitems:` would work.
17:50:48FromDiscord<d4rckh> ok i am trying this now
17:50:59FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Y6b
17:51:04FromDiscord<d4rckh> even tho the state is `Open`, I don't receive any data
17:51:07FromDiscord<d4rckh> (edit) "even tho the state is `Open`, I don't receive any data ... " added "on my websocket client"
17:52:53FromDiscord<Rika> What library is this
17:53:16FromDiscord<d4rckh> ws
17:53:19FromDiscord<d4rckh> im using it in combination with jester
17:54:58FromDiscord<geekrelief> for nimble to install dependencies via `requires` it seems I have to run `nimble build`, but for a custom task, is there a way I can get nimble to pull the dependencies?
18:16:17*dtomato quit (Quit: The Lounge - https://thelounge.chat)
18:17:20*dtomato joined #nim
18:18:44*dtomato quit (Client Quit)
18:19:35*dtomato joined #nim
18:21:38*dtomato quit (Client Quit)
18:22:00*dtomato joined #nim
18:23:21*vicfred quit (Quit: Leaving)
18:32:33*lumo_e joined #nim
18:35:11*lumo_e quit (Read error: Connection reset by peer)
18:52:21*kenran joined #nim
18:56:12*PMunch quit (Quit: leaving)
19:00:19FromDiscord<Recruit_main707> ignoring implicit passes by reference, does it make sense to use `seq[ref Car]` when Car is a pretty big object? Or since its a seq its not useful?
19:00:20*haliucinas quit (Ping timeout: 260 seconds)
19:02:47FromDiscord<Rika> It will consume the same amount memory, but not contiguous which can be good or bad
19:02:54FromDiscord<Rika> Depending on your situation
19:03:04FromDiscord<Rika> In reply to @Rika "It will consume the": Roughly the same
19:03:27FromDiscord<Rika> The ref version is larger by Npointer size
19:03:36FromDiscord<Recruit_main707> thats what i thought
19:04:32FromDiscord<Recruit_main707> i guess since ill be creating a lot of them with not so many cars inside id rahter have them without the ref
19:04:56FromDiscord<Rika> Contiguity is good for cache
19:05:43FromDiscord<Recruit_main707> yeah, ok thanks rika
19:08:05FromDiscord<Rika> In constrained memory situations fragmented memory makes it difficult to allocate contiguous blocks
19:08:32FromDiscord<Rika> Further fragmenting memory by using indirection isn’t a good solution though
19:11:10FromDiscord<Recruit_main707> https://tenor.com/view/the-more-you-know-gif-10358303
19:17:20FromDiscord<ynfle> In reply to @Xzayler "any idea why this": Try
19:17:39FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3Y6o
19:17:49FromDiscord<ynfle> (edit) "https://play.nim-lang.org/#ix=3Y6o" => "https://paste.rs/Djd"
19:17:53FromDiscord<ynfle> You need the mutable version of the iterator
19:23:15*vicfred joined #nim
19:26:35FromDiscord<planetis> In reply to @Recruit_main707 "**ignoring implicit passes by": ref would be faster when mutating the seq, sorting, etc but ref semantics are also more error prone
19:27:29FromDiscord<planetis> but yes when updating all cars in a loop, seq[car] might be better
19:44:40FromDiscord<demotomohiro> `setLen` or `add` to `seq[Car]` can reallocate internal heap and need to copy all new elements to new heap.↵`insert` to `seq[Car]` can copy elements after the inserted position.↵Does Nim use moves instead of copies for these operations?
19:48:10FromDiscord<Zectbumo> this doesn't make sense to me↵!eval for (x, y) in [[1,2,3], [4,5,6]]: echo x, ' ', y
19:48:20FromDiscord<Zectbumo> !eval for (x, y) in [[1,2,3], [4,5,6]]: echo x, ' ', y
19:48:23NimBot1 2↵4 5
19:48:27FromDiscord<Zectbumo> (edit) "me↵!eval for (x, y) in [[1,2,3], [4,5,6]]: echo x, ' ', y" => "me"
19:48:49FromDiscord<Zectbumo> !eval for (x, y, z) in [[1,2,3], [4,5,6]]: echo x, ' ', y, ' ', z
19:48:51NimBotCompile failed: /usercode/in.nim(1, 5) Error: wrong number of variables
19:49:34FromDiscord<Zectbumo> how does (x,y) work perfectly as expected, and then (x,y,z) not
19:50:33FromDiscord<Rika> !eval for (x, y) in [[9,5,3], [4,7,0]]: echo x, ' ', y
19:50:35NimBot9 5↵4 7
19:50:36FromDiscord<Rika> Just making sure
19:50:43FromDiscord<Rika> Hm
19:51:10FromDiscord<Rika> I don’t understand how this works
19:51:56FromDiscord<Zectbumo> if anything, it should be the other way right? wrong number of variables in the first case, and then correct number in the other
19:55:53FromDiscord<Recruit_main707> smells like a compiler bug, if i had to gamble it some check like `>` instead of `>=`
19:56:25FromDiscord<Recruit_main707> if this is the expected behaviour i dont understand it
19:59:36FromDiscord<demotomohiro> `for (x, y) in [[9,5,3], [4,7,0]]: ` looks like it doing tuple unpacking but it is not tuple but array.
20:00:32FromDiscord<demotomohiro> !eval for (x, y, z) in [(9,5,3), (4,7,0)]: echo x, ' ', y, ' ', z
20:00:34NimBot9 5 3↵4 7 0
20:03:01FromDiscord<Zectbumo> tuples work fine, just array is weird
20:29:54om3gaI think compiler optimises out needed parts of code
20:30:28om3gaothervise I don't know what to look
20:31:12*kenran quit (Quit: WeeChat info:version)
20:32:11om3gathe code should work, but when I enable --opt:speed it receives sigabort sent by system, and caused by a READ memory access.
20:32:39om3gaany suggestions?
20:35:49FromDiscord<Yardanico> no real suggestions there, --opt:speed affects the C compiler
20:35:55FromDiscord<Yardanico> what's your compiler version?
20:36:19FromDiscord<demotomohiro> Your code might have undefined behavior. Is your code have `addr`, `cast` or call C functions?
20:36:27FromDiscord<Yardanico> I mean C compiler version
20:36:42FromDiscord<Yardanico> and yeah, can you reproduce it without --opt:speed but with -O2 manually passed?
20:38:07om3gaYardanico, I tried different versions, clang 10, clang 11
20:38:13om3gagcc11, gcc12
20:38:29FromDiscord<Yardanico> well, then maybe something's up in your code? demotomohiro's suggestion is good
20:39:20om3gademotomohiro, you are correct, I use unsafe pointer passing to the functions
20:39:34om3gabut that's how fcgi lib works
20:39:37FromDiscord<Yardanico> what GC are you using?
20:39:50om3gaYardanico, tried all available :)
20:40:00FromDiscord<Yardanico> well, and do you pass GC'd types through pointers?
20:40:49om3gayou mean gc'd objects?
20:40:53FromDiscord<Yardanico> yes
20:41:01FromDiscord<Yardanico> anything that is a `ref` or a string or a sequence
20:41:07om3gathey are in stack
20:41:14FromDiscord<Bubblie> Do you all know where nim’s import module code is located in the nim-lang repository?
20:41:17om3gaother ones stored in shared mem
20:41:19FromDiscord<Bubblie> Sorry if Im interrupting
20:41:21FromDiscord<Recruit_main707> on the heap
20:42:03FromDiscord<Yardanico> @Bubblie for similar questions we generally use #internals , but it's fine asking here of course
20:42:15FromDiscord<Bubblie> Sorry 😅
20:42:26FromDiscord<Yardanico> In reply to @om3ga "other ones stored in": sorry, then I can't suggest anything, it's really just a guessing game without the code to try :(
20:42:29FromDiscord<Bubblie> Ill ask there next time
20:42:39FromDiscord<Bubblie> Or if its okay can I repaste my message there?
20:43:00om3gaYardanico, could you please check this https://drive.google.com/file/d/1L614Lroc7oJahPmCXRrVvgNyCokouuZB/view?usp=sharing
20:43:32om3gaI tried to make smallest possible code
20:44:46om3gathe problem I think is with request: FCGX_Request, or with fastcgi/fcgi_lib.nim
20:44:59FromDiscord<Xzayler> sent a code paste, see https://play.nim-lang.org/#ix=3Y6y
20:45:18FromDiscord<Yardanico> and how do I test it? just make a request to the ip:port I bind it to?
20:45:36FromDiscord<ynfle> In reply to @Xzayler "Yes it's working. Thanks": It's probably an issue with `with` not allowing the compiler to automatically use the mutable version
20:45:38om3gajust edit main.nim, enter there 127.0.0.1
20:45:44om3gacompile and run
20:45:54om3gait should throw err immidiately
20:46:07om3gaalso libfcgi is required
20:46:08FromDiscord<Xzayler> In reply to @ynfle "It's probably an issue": tbh I have no idea what `with` does at all. I was just following the docs for `norm`
20:46:26om3gaif you're on linux, it is in the repo in arch for example
20:46:27FromDiscord<Xzayler> tutorials, not docs
20:46:39FromDiscord<Yardanico> In reply to @om3ga "it should throw err": Hm, weird, it didn't for me in WSL (arch), will try on native arch now
20:46:57FromDiscord<Yardanico> Oh right, and your Nim version is 1.6.6?
20:47:00om3gayes! that's what I saw before
20:47:11om3gaYardanico, yes, I tried dev and stable branches
20:48:05om3gaoh, pls check config.nims, if there --opt:speed is enabled
20:48:18om3gafirst 2 lines should be commented out
20:48:41FromDiscord<Yardanico> opt speed is enabled there
20:48:49om3gathat's strange
20:49:09FromDiscord<Yardanico> latest clang on arch is 13.0.1
20:49:53om3gahttps://0bin.net/paste/XW405Fuu#1-BwN04mtrVHeZwbw5psKFCtkqYdAGWtdGEifv+56SW
20:50:06om3gathat's what I get with te same code on Mac
20:50:23FromDiscord<Yardanico> well, clang on macOS is apple's version with some apple patches
20:50:28FromDiscord<ynfle> In reply to @Xzayler "tbh I have no": Look at https://nim-lang.org/docs/with.html
20:51:26om3gahttps://0bin.net/paste/hikQmzfE#Wvify0iU1WsHRtZn6BSw0X-rrEqJB64rOJUHNAZk1KU
20:51:29om3gafrom arch
20:51:42om3gacrazy isn't?
20:52:24FromDiscord<Yardanico> but maybe i should do some request?
20:52:30FromDiscord<Yardanico> it doesn't crash for me when I just start it
20:52:40FromDiscord<Yardanico> and yeah, i'm trying on nim devel
20:53:03om3gamaybe my house bombed with high energy particles from space, and computers experience constant single events
20:53:33om3gaYardanico, I tried with both branches, the same effect
20:53:50om3gasomething is wrong here in the system maybe, or with lib
20:54:12om3ga<Yardanico> but maybe i should do some request? - that requires lighttpd or nginx
20:54:27FromDiscord<Bubblie> how is nim threading btw?
20:54:33om3gaif you have one I can upload simple config
20:54:36FromDiscord<Bubblie> I heard some mixed things about it
20:54:46om3gathreading works just great
20:54:49FromDiscord<Yardanico> In reply to @om3ga "if you have one": sure, I can try I guess
20:54:58FromDiscord<Elegantbeef> It's got lock primitives and channels
20:55:01FromDiscord<Elegantbeef> So it works
20:56:04om3gaYardanico, https://0bin.net/paste/2tljvo60#tcs1mbmcvzPkHJU06S4K83kfpBInSYU-cdQWuS+d39s
20:58:04om3gaif you have web servers for other uses, just edit root path, set it to unique one
20:58:26om3gaand it should forward requests to the app server
20:58:27FromDiscord<Xzayler> In reply to @ynfle "Look at https://nim-lang.org/docs/with.html": ok I see, pretty simple. So it's completely useless in the context I used it in
20:58:43FromDiscord<Yardanico> In reply to @Xzayler "ok I see, pretty": maybe you want https://github.com/zevv/with ?
21:01:02FromDiscord<Yardanico> yeah @om3ga it just works without any errors from the sanitizer 🤷
21:01:10om3ga:(
21:01:51om3gaYardanico, thank you very much for the help
21:01:59FromDiscord<Yardanico> I didn't really "help" :)
21:02:06om3gano, you did
21:02:13om3gaI will scan hdd on errors now
21:02:26om3gasomething should be the reason
21:02:27FromDiscord<Yardanico> but yeah, it works for me and just gives out http code 404 with 404 in the body
21:02:42FromDiscord<Yardanico> @om3ga can you try installing nim devel the manual way on some updated arch installation?
21:02:48om3gayeah, custom 404 header with text
21:02:55FromDiscord<Yardanico> git clone https://github.com/nim-lang/nim
21:02:56FromDiscord<Yardanico> cd nim
21:02:58FromDiscord<Yardanico> sh build_all.sh
21:03:07om3gaYardanico, I will try now
21:03:07FromDiscord<Yardanico> and then put nim/bin folder to PATH
21:03:51FromDiscord<Yardanico> oh @om3ga gcc thread sanitizer indeed errors for me
21:03:54FromDiscord<Yardanico> but not the clang one
21:04:22om3gaYardanico, yes! Interesting
21:04:34om3gathat's what I mentioned about gcc11 errs
21:04:49om3gaafter I upgraded gcc
21:07:10FromDiscord<Yardanico> it seems that it's triggered by --stacktrace:on specifically
21:07:18FromDiscord<Yardanico> without stacktrace (so with -d:release or -d:danger) it works fine
21:07:26FromDiscord<Yardanico> most other options don't matter at all
21:08:49FromDiscord<Yardanico> it specifically crashes in nim stack frame handling code
21:10:45om3gahmm
21:11:00om3gagreat! how you find that?
21:11:20FromDiscord<Yardanico> just experimenting with flags, and I just enabled -g to see where it crashes in Nim code
21:11:32FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/976592898160218162/unknown.png
21:11:38FromDiscord<Yardanico> and --nimcache to check the compiled C code
21:11:54om3gaexactrly the same
21:12:02om3ga*the same err
21:12:38om3gapreviously it crashed on FCGX_Finish_r
21:13:33om3gabut now, seems it fails on FCGX_Accept_r
21:14:17*vicfred quit (Remote host closed the connection)
21:14:31*vicfred joined #nim
21:15:41FromDiscord<Yardanico> well, it could really be just a bug in gcc 11 :)
21:16:28om3galooks like there is more
21:17:13om3gaNow it fails with clang 13.0.1 If profiler option is set
21:17:40om3gaor --opt:speed
21:17:43FromDiscord<Yardanico> `profiler` Nim option is deprecated anyway
21:17:49FromDiscord<Yardanico> it shouldn't really be used anymore
21:17:51om3gaoh!
21:18:13FromDiscord<planetis> you need llvm package on arch to get line info
21:18:14FromDiscord<planetis> llvm-symbolizer
21:18:26FromDiscord<Yardanico> i already have it
21:18:29FromDiscord<Yardanico> and it already works
21:18:40FromDiscord<planetis> or addr2line on gcc
21:18:47FromDiscord<Yardanico> not exactly sure what message you wanted to reply to :D
21:18:50om3gaand what enables lgcov in nim now?
21:19:04FromDiscord<planetis> cool yardanico
21:19:35FromDiscord<Yardanico> I think we should disable thread sanitizer for now @om3ga
21:19:45FromDiscord<Yardanico> i think it's erroring because nim is trying to raise an exception in the thread and deallocates it
21:20:39om3gaYardanico, that might be the reason indeed
21:21:53om3gaI added try: except: to that code right before the strange stuff appeared
21:21:58FromDiscord<Yardanico> and it should be worth actually checking error codes returned by FCGI functions instead of just discarding stuff
21:23:24om3gayeah, so I will try that now
21:24:04om3gaI want to had modern looking code, but now it will be like C
21:24:06om3ga:)
21:24:32FromDiscord<Yardanico> i'm really not sure why do you want to use fcgi even though you want modern stuff :)
21:24:45FromDiscord<Yardanico> you can just run a http server with nim and host it behind lighttpd/nginx
21:25:48om3gaIt's still very powerfull
21:26:02FromDiscord<Yardanico> eh, i don't really think so
21:26:07FromDiscord<Yardanico> you can replicate what it does and more with usual http stuff
21:26:45om3gabut on each call web server will exec binary
21:26:55FromDiscord<Yardanico> no?
21:27:06FromDiscord<Yardanico> that's not the case with fcgi, and it's not the case with http servers
21:27:08om3gaor what you mean
21:27:19FromDiscord<Yardanico> with a normal http server you just start a http server that accepts requests
21:27:30FromDiscord<Yardanico> then host it behind nginx/lighttpd as a reverse proxy for SSL and other stuff (optional)
21:27:40FromDiscord<Yardanico> it's a single binary, it's not started for each request
21:27:51om3gaI mean backend
21:27:53FromDiscord<Yardanico> yes
21:28:01FromDiscord<Yardanico> backend is the http server
21:28:02om3gaall dynamic stuff, db requests etc
21:28:06FromDiscord<Yardanico> yes
21:28:12FromDiscord<Yardanico> you don't need to start a binary on each request
21:28:21FromDiscord<Yardanico> and you don't need to open the DB on each request either
21:28:28om3gabut how it will be executed? :)
21:28:33FromDiscord<Yardanico> wdym?
21:28:38FromDiscord<planetis> In reply to @Zectbumo "!eval for (x, y)": that stupid for loop tuple sugar strikes again
21:28:40FromDiscord<Yardanico> you just make an HTTP request and your server handles it
21:28:49FromDiscord<planetis> so many bugs
21:28:58om3gaYardanico, sorry I don't understand
21:29:10FromDiscord<Zectbumo> In reply to @planetis "that stupid for loop": should I file a bug or bring it up in #internals?
21:29:11om3gafor static data transfer - sure
21:29:23FromDiscord<Yardanico> In reply to @om3ga "for static data transfer": I don't understand what you don't understand, you don't need multiple processes for DB or anything else
21:29:24om3gabut I have here dynamic pages
21:29:36FromDiscord<Yardanico> In reply to @om3ga "but I have here": ??? you easily do that with http servers
21:29:39FromDiscord<planetis> I think a bug report is better
21:29:44FromDiscord<Yardanico> forum.nim-lang.org runs as a single binary for example
21:29:52FromDiscord<Yardanico> with dynamic pages and whatnot (although in this case it's more of frontend)
21:30:07FromDiscord<Yardanico> you can easily make "dynamic" stuff with nim and http, see for example https://github.com/planety/prologue
21:30:21FromDiscord<Zectbumo> In reply to @planetis "I think a bug": also, which is the bug? that (x,y) works or that (x,y,z) doesn't work, or throwing wrong error
21:30:24FromDiscord<Yardanico> http server isn't just "static stuff", you can construct responses on the fly
21:30:35FromDiscord<Elegantbeef> It's a bug that the first works↵(@Zectbumo)
21:30:46om3gaYardanico, thanks, interesting
21:30:54FromDiscord<Elegantbeef> `for (x, y) in z` tuple unpacks the `z` it does not do array destructuring
21:31:10FromDiscord<Yardanico> In reply to @om3ga "<@177365113899057152>, thanks, interesting": anything can do dynamic responses, even https://github.com/dom96/jester
21:31:10om3gaYardanico, and it also can do load balancing?
21:31:22om3gaor it requires vip address?
21:31:39FromDiscord<Yardanico> yes, you can either use multiple threads or use multiple binaries with SO_REUSEPORT
21:31:46FromDiscord<planetis> In reply to @Zectbumo "also, which is the": none of them work, compare the output with for x,y (no parenthesis)
21:31:54FromDiscord<Yardanico> but again, you don't need to rely on any libraries like fcgi, you just get http requests and answer with http responses
21:32:04FromDiscord<Yardanico> and you can construct them at runtime easily, since it's just strings in the end
21:32:06om3gahmm, I should try that definitely
21:32:10FromDiscord<Zectbumo> In reply to @planetis "none of them work,": no parenthesis makes sense because that's the index form
21:32:13FromDiscord<Elegantbeef> Those are different semantics↵(@planetis)
21:32:35FromDiscord<planetis> why do you explicitly call the items iterator?
21:32:37FromDiscord<Elegantbeef> `for x, y` is not equivlent to `for (x, y)`
21:32:39om3gaYardanico, why I like fcgi, is - resource management, load balancing, etc...
21:32:49FromDiscord<planetis> I am pretty sure it is
21:32:53FromDiscord<Elegantbeef> The first calls pairs and the latter still calls items
21:32:54FromDiscord<Yardanico> wdym by "resource management" ?
21:32:56FromDiscord<Elegantbeef> They're not equivlent
21:33:00FromDiscord<planetis> really
21:33:02FromDiscord<planetis> wtf
21:33:05om3gaI use it for years, maybe that;s why I like it
21:33:09FromDiscord<Yardanico> also, we can probably move to #webdev (#nim-webdev on IRC)
21:33:13FromDiscord<planetis> man that seriously sucks
21:33:29FromDiscord<Yardanico> In reply to @om3ga "I use it for": yeah i think that's the only reason :) with http servers you can do anything you can with fcgi and more
21:33:40FromDiscord<Elegantbeef> Second one errors
21:33:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y6I
21:33:52FromDiscord<Elegantbeef> They're not equivlent for a point
21:34:01FromDiscord<Elegantbeef> You can have an iterator that isnt `pairs` or `items` and unpack it nicely
21:34:38FromDiscord<planetis> I just tried the same...
21:34:43FromDiscord<huantian> Huh does for x, (y, z) work for seq[tuple[A, B]]
21:34:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y6J
21:34:53FromDiscord<Elegantbeef> Should↵(@huantian)
21:35:22FromDiscord<planetis> when I was making collect stuff like for (x, (y, z)) didn't parse
21:36:00FromDiscord<planetis> someone needs to add it Nim v2 wishlist
21:36:09FromDiscord<planetis> either fix it or kill it with fire
21:36:50FromDiscord<planetis> also implicitly calling items or pairs seems a bad idea
21:37:19FromDiscord<ambient> sent a code paste, see https://play.nim-lang.org/#ix=3Y6K
21:37:38FromDiscord<Elegantbeef> Of course it wouldnt
21:37:41FromDiscord<Elegantbeef> That's not a valid nim structure
21:37:51FromDiscord<Elegantbeef> Add what?
21:38:02FromDiscord<Elegantbeef> It is a bad idea
21:38:18FromDiscord<Elegantbeef> Especially since it presently doesnt work with generics
21:38:27FromDiscord<planetis> (edit) "also implicitly calling items or pairs seems ... a" added "like"
21:38:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y6L
21:39:06FromDiscord<Elegantbeef> and even `mixin items` doesnt resolve it since the magic expansion doesnt respect mixin'd
21:39:57FromDiscord<Elegantbeef> Probably making more modules imported doesnt make nim any better↵(@ambient)
21:40:20FromDiscord<ambient> I like writing small anonymous functions with a simple syntax
21:48:22*noeontheend joined #nim
21:51:11FromDiscord<Zoom> Wtf is ` type mismatch: got <Alias, typedesc[BackwardsIndex]>`
21:51:23FromDiscord<Elegantbeef> Using concept?
21:51:28FromDiscord<Zoom> Yep
21:51:37FromDiscord<Elegantbeef> What's your concept?
21:51:48FromDiscord<Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3Y6M
21:52:17FromDiscord<Zoom> Don't laugh\: `proc hasKey[T](a: array[char, T]; key: char): bool = true`
21:52:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y6N
21:53:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y6O
21:54:51FromDiscord<Elegantbeef> Generic parameters are aliases in concepts which is what the error message is about
21:55:01FromDiscord<Elegantbeef> You need to bind it explicitly to a variable to reason it
21:55:28*noeontheend quit (Ping timeout: 272 seconds)
21:57:41FromDiscord<Zoom> > invalid type\: 'T' in this context\: 'inferred[T]' for var
21:57:59FromDiscord<Elegantbeef> Code?
21:58:43FromDiscord<Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3Y6S
22:02:48FromDiscord<Elegantbeef> Havent really used inferred generics with concepts so this seems to be an issue with them
22:03:44FromDiscord<Zoom> Kind of a silly code, but looks reasonable. Just wanted to see if it works at all.
22:03:57FromDiscord<Zoom> looks like concepts aren't ready for Zoom
22:08:24om3gaYardanico, I fixed!
22:08:33FromDiscord<Yardanico> what way?
22:08:37om3gait was not ontly try: exept
22:08:43om3gabut also withLock:
22:08:54FromDiscord<Yardanico> okay
22:09:05FromDiscord<Yardanico> but I really strongly suggest you to try https://github.com/dom96/jester or https://github.com/planety/prologue/ anyway
22:09:22FromDiscord<Yardanico> doing typical http DB stuff with dynamic pages will be much easier since you don't need to interface with C at all
22:09:25FromDiscord<Yardanico> it's all written in Nim
22:09:43om3gaI removed all that withLock's and used old pthread mutex stuff
22:10:04om3gaYardanico, I will try that for sure, but it requires studying
22:10:16FromDiscord<Yardanico> well, not a lot
22:10:24om3gaI need at least ability to manage requests, load balancing, etc
22:10:27FromDiscord<Yardanico> it's the same http requests, just you don't have any middle layer like FCGI
22:10:32FromDiscord<Yardanico> In reply to @om3ga "I need at least": of course it's all there
22:10:34FromDiscord<Yardanico> and even more
22:10:40FromDiscord<Yardanico> prologue is quite a complete web framework
22:10:41*krux02 quit (Remote host closed the connection)
22:10:47FromDiscord<Yardanico> https://planety.github.io/prologue/
22:10:53om3gathen it's great!
22:10:59om3gatthanks, awesome
22:11:08om3gaand what about DOS?
22:11:13FromDiscord<Yardanico> what about it?
22:11:18*krux02 joined #nim
22:11:21om3gaI mean queue management
22:11:34om3gaor it depends how I will implement it?
22:11:51FromDiscord<Yardanico> not sure what you mean at all, prologue is async
22:12:03om3gaaha, ok. I understand
22:12:23om3gaI use tables with dynamics per ip
22:12:39om3gaif rate is high, then client will be blocked
22:13:05FromDiscord<Yardanico> yeah you can do that easily with prologue
22:13:25FromDiscord<Yardanico> and async nim web frameworks are generally really fast
22:13:56FromDiscord<Yardanico> prologue hello world (just http 200 hello world) does ~70-80k reqs/second on my 3700X on a single thread
22:14:33FromDiscord<Yardanico> with threads enabled (so with all 16 threads) that hello world does ~440k requests/second
22:14:38om3gait's pretty fast
22:14:49FromDiscord<Yardanico> so you'll be really only constrained by the speed of your DB access and stuff and don't need to worry about the actual underlying stuff
22:14:57FromDiscord<Yardanico> like sockets or whatever
22:15:04om3gayeah, fd's
22:15:41FromDiscord<Elegantbeef> Yea Zoom i dont know how this is capable of working
22:15:58FromDiscord<Elegantbeef> There is no way to in fer the `[T, U]`
22:16:09FromDiscord<Elegantbeef> infer even
22:17:07FromDiscord<Elegantbeef> Consider a user defined non generic type like `type MyType = object`
22:18:04FromDiscord<Elegantbeef> The only way to know what the `T` is and the `U` is is to work from the definitions
22:18:21FromDiscord<Elegantbeef> That doesnt really work well
22:19:24FromDiscord<Elegantbeef> Atleast i presently think it's quite difficult to impossible to infer a concepts generics
22:19:41FromDiscord<Elegantbeef> Atleast in this case
22:20:16FromDiscord<Zoom> Well, before the addition of `var t: T` it worked on tables.
22:20:27FromDiscord<Elegantbeef> Hmph
22:23:45FromDiscord<Elegantbeef> Ok so i'm just being dumb as usual it seems it's attempting to bind to the backwards index for `[]`
22:24:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y6X
22:29:32FromDiscord<Zoom> Why do you add mixin there?
22:29:39FromDiscord<Elegantbeef> Cause it's a generic and that's how you properly make sure nothing goes astray 😄
22:30:05FromDiscord<Elegantbeef> You always want the scope of the callsite to be considered for this type of user defined interface
22:30:44FromDiscord<Zoom> Thanks. You've been very helpful as always. Too bad I have no use for this code at all. \:P
22:31:06FromDiscord<Elegantbeef> No problem
22:31:41FromDiscord<Elegantbeef> If not evident the issue is that `[]` matches `BackwardsIndex` first and as such `T` was bound to it
22:32:25FromDiscord<Zoom> This is evident, post factum
22:32:56FromDiscord<Elegantbeef> Hey doesnt harm to explain the problem 😛
22:33:30FromDiscord<Zoom> I meant it's become evident to me after I saw the solution \:)
22:33:48FromDiscord<Elegantbeef> Yea it's odd that it bounded like that
22:34:07FromDiscord<Elegantbeef> It makes a ton of sense given the way they variables are unconstrained
22:34:08FromDiscord<Elegantbeef> I'd argue it's correct 😄
22:34:42FromDiscord<Elegantbeef> Thought it makes more sense to find the exact match over a partial match
22:35:48FromDiscord<mendykin> I'll help 10 people on how to earn $20,000 within 72 hours but you will pay me 10% of your profit when you receive it.↵Note\: only interested people should apply, drop a message let's get started↵https://t.me/Tradewitholiver01
22:35:52FromDiscord<Zoom> I agree with [krux02 (Arne Döring)](https://matrix.to/#/@krux02-562fccc916b6c7089cb87897:gitter.im) , tableimpl should go. It's not much DRY and lots of untyped templates for a critical module.
22:36:05FromDiscord<Elegantbeef> Fucking matrix bots
22:36:29FromDiscord<Elegantbeef> I mean most things should go
22:36:47FromDiscord<Zoom> Hash proc and defaults should be parametrizable
22:37:07FromDiscord<Elegantbeef> What do you mean?
22:38:11*smvg quit (Quit: smvg)
22:38:12FromDiscord<Zoom> I should have an option to tell which hash function tables module should use for a basic type
22:38:46FromDiscord<Zoom> And the whole possible rework is blocked by> First we should get view types into the state where Option[var T] and Option[lent T] do work reliably
22:39:43FromDiscord<Elegantbeef> Yea i've personally never really needed to custom hash primitives but i can see why would want it
22:39:50FromDiscord<Elegantbeef> Luckily though it's not too difficult to bodge
22:45:51*tiorock joined #nim
22:45:51*tiorock quit (Changing host)
22:45:52*tiorock joined #nim
22:45:52*rockcavera quit (Killed (calcium.libera.chat (Nickname regained by services)))
22:45:52*tiorock is now known as rockcavera
22:50:19*cyraxjoe quit (Ping timeout: 240 seconds)
22:51:09*cyraxjoe joined #nim
23:06:39*noeontheend joined #nim
23:20:06*noeontheend quit (Ping timeout: 244 seconds)
23:28:00FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Y74
23:28:15FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3Y74" => "https://play.nim-lang.org/#ix=3Y75"
23:30:02FromDiscord<Elegantbeef> cstringarray
23:32:25FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Y78
23:32:41FromDiscord<Elegantbeef> `list = [cstring"a", cstring"b"]`
23:33:44FromDiscord<Elegantbeef> then pass the `addr`
23:35:36FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Y79
23:35:49FromDiscord<Elegantbeef> yes cstringarray is a `ptr` type
23:35:57FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3Y79" => "https://play.nim-lang.org/#ix=3Y7a"
23:36:00FromDiscord<Elegantbeef> Read the error message
23:36:18FromDiscord<Elegantbeef> you can pass `filterPatts.addr` to the procedure
23:36:25FromDiscord<Elegantbeef> As such it needs to be `let`
23:37:21FromDiscord<!Patitotective> In reply to @Elegantbeef "you can pass `filterPatts.addr`": i cant because it is of type `ptr array[0..1, cstring]` and not `ptr ptr cschar` (?)
23:37:32FromDiscord<Elegantbeef> cast is a hell of a drug
23:47:31FromDiscord<retkid> is there anyway to read from a specific byte to specific byte in a filestream without making my own function
23:49:13FromDiscord<Elegantbeef> `setPosition` follow by `readData(myData.addr, len)`
23:52:09FromDiscord<retkid> In reply to @Elegantbeef "`setPosition` follow by `readData(myData.addr,": readData is like read but it doesn't remove the bytes from the file stream i presume
23:52:40FromDiscord<Elegantbeef> read doesnt remove the data it moves the position
23:52:40FromDiscord<Elegantbeef> all read procedures move the position
23:54:07FromDiscord<retkid> In reply to @Elegantbeef "all read procedures move": why would i use readData and not read
23:54:22FromDiscord<Elegantbeef> You want to read a specific amount of data
23:54:59FromDiscord<retkid> but i do the same thing with just reading a buffer?
23:55:22FromDiscord<Elegantbeef> If you have an amount of data to read and it's not to an array you use read data
23:55:40FromDiscord<Elegantbeef> `read` is a basic procedure that doesnt know types it just reads `sizeof(T)`
23:57:24FromDiscord<Elegantbeef> so if you do `read(mySeq)` you'll just get an arbitrary sequence and not the data you want