<< 26-09-2022 >>

00:03:59FromDiscord<acikek> pm
00:40:56*wallabra quit (Ping timeout: 260 seconds)
01:12:03*wallabra joined #nim
01:40:40*alice quit (Remote host closed the connection)
01:40:55*alice joined #nim
01:46:19*reversem3[m] quit (Ping timeout: 268 seconds)
01:53:44*alice quit (Remote host closed the connection)
01:54:51*alice joined #nim
01:57:50FromDiscord<Patitotective> hello
02:00:14FromDiscord<Elegantbeef> yellow
02:01:32FromDiscord<Patitotective> pink
02:15:16*reversem3[m] joined #nim
03:10:42FromDiscord<Shiba> red
03:23:59FromDiscord<Bung> https://github.com/nim-lang/Nim/pull/20423 dont know how to detect the symbol is for construct generic object in compiler's `semSym`
03:47:48FromDiscord<Bung> found that part maybe bugy code, I removed it generics test passed , let me see other tests
04:11:41FromDiscord<Bung> where is tensordsl package, can't found it in nimble.directy nor github , but it's included in nim CI packages test.
04:33:37*derpydoo joined #nim
04:53:23*wallabra quit (Ping timeout: 265 seconds)
05:17:07FromDiscord<flywind> In reply to @Bung "where is tensordsl package,": Here you are https://[email protected]/krux02/tensordslnim/src/master/ Though I has been curious why I cannot read the repo.
05:18:30FromDiscord<flywind> (edit) "read" => "open"
05:18:43FromDiscord<flywind> (edit) "https://[email protected]/krux02/tensordslnim/src/master/ Though I has been curious why I cannot open the repo." => "https://bitbucket.org/krux02/tensordslnim/src/master/"
05:18:48FromDiscord<Bung> me neither, `Having trouble showing that directory` , nvm , my problem not specific to it
05:32:06*wallabra joined #nim
05:40:32FromDiscord<Forest [She/Her]> Anyone know how Nim replicates pointers in JS? It uses lists but honestly idk how
05:40:47FromDiscord<Elegantbeef> It emits an array
05:40:55FromDiscord<Elegantbeef> And it passes a integer to index that
05:40:58FromDiscord<Elegantbeef> IIRC
05:41:14FromDiscord<Elegantbeef> This gives you pointer semantics with things that are normally copied in JS
05:41:21FromDiscord<Forest [She/Her]> A global array?
05:41:40FromDiscord<Forest [She/Her]> In reply to @Elegantbeef "This gives you pointer": So another thing that works because of the hell that is JS, got it haha
05:43:10FromDiscord<Elegantbeef> No it's not a global array
05:47:28FromDiscord<Forest [She/Her]> Alright
05:48:01FromDiscord<Forest [She/Her]> In Python the semantics could probably be somewhat easily replicated with a 'Pointer' class
05:48:59FromDiscord<Forest [She/Her]> Yeah i could just redirect every call to an object beneath it and only get the object when needed
05:51:31*derpydoo quit (Ping timeout: 246 seconds)
06:24:58*kenran joined #nim
06:50:59FromDiscord<Girvo> Can I define something via `nimble build -d:example`? Does that actually set it?
06:53:00FromDiscord<Elegantbeef> I dont think it does, but i cannot recall
06:53:11FromDiscord<Girvo> No worries. Turns out I'd already set it in `nim.cfg` anyway lol
07:14:31FromDiscord<ChocolettePalette> Uhh, I can't understand the thing. If I declare a cstring variable let's say with var keyword, and then I change its value... What will happen? Will my functions imported from C fail or smth? Will the previous value cause a memory leak?I think that everything will be just fine, hoping for a cstring type variable to manage the memory management for me, but I'm not sure
07:15:07FromDiscord<Elegantbeef> A cstring is really just `ptr char` so no it will not do memory management
07:15:41FromDiscord<Elegantbeef> You'd likely want `string` then do `cstring(myString)` as long as your `cstring` doesnt outlast your `string`
07:19:04FromDiscord<ChocolettePalette> So if I do `var s: cstring = cstring(normal_string)` inside a proc, I will get a memory leak?
07:20:02FromDiscord<Elegantbeef> No
07:20:19FromDiscord<Elegantbeef> `cstring` conversion there just takes the address of the first character
07:20:23FromDiscord<Elegantbeef> It's a free conversion but Nim doesnt track that cstring
07:20:35FromDiscord<Elegantbeef> As such if you dont properly watch your usage you can access a dangling pointer
07:23:06FromDiscord<ChocolettePalette> Oh, I think I got it. So the above example won't cause a memory leak, because that variable will be a pointer. But if I do `var s: cstring = "text"` I'll leak some memory, right?
07:23:07FromDiscord<Elegantbeef> No
07:23:25FromDiscord<Elegantbeef> string literals are constants
07:23:25FromDiscord<Elegantbeef> So that is stored in static memory
07:23:50FromDiscord<Elegantbeef> if you do `var s = someCProcThatReturnsCString()` it will
07:23:55FromDiscord<ChocolettePalette> Ah, yes, right. Thank you!
07:34:35NimEventerNew Nimble package! passy - A fast little password generator, see https://github.com/infinitybeond1/passy
07:34:59FromDiscord<Elegantbeef> Someone uploaded a binary again
07:35:16FromDiscord<Elegantbeef> God damn it they're using an array of strings for this
07:36:35FromDiscord<Forest [She/Her]> Aren't these type of passwords easier to crack anyway iirc?
07:36:57FromDiscord<Forest [She/Her]> Like `h31l0 w0r1d`
07:37:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bsM
07:38:48FromDiscord<Forest [She/Her]> Also you should remove the binary from the GitHub and add it to the `.gitignore` :p
07:39:08FromDiscord<Elegantbeef> I did mention that
07:39:36FromDiscord<Elegantbeef> They also dont pin the version of termui they're using
07:52:01FromDiscord<Forest [She/Her]> In reply to @Elegantbeef "I did mention that": Yeah ik
07:58:37NimEventerNew Nimble package! checkif - A CLI tool to check files (and registry in Windows), see https://git.ozzuu.com/thisago/checkif
08:08:33*kenran quit (Ping timeout: 268 seconds)
08:29:31FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=4bsU
08:29:35FromDiscord<Bung> t10833.nim(3, 6) Error: type expected
08:30:17FromDiscord<Bung> after fix issue 10833, I found it cant be used as field type ?
08:31:34FromDiscord<Bung> @ElegantBeef it should compile, right ?
08:36:49FromDiscord<Elegantbeef> No it shouldnt
08:37:06FromDiscord<Elegantbeef> `typeof(C)` should though
08:39:12FromDiscord<Elegantbeef> `static`s are values not types
08:39:13*jmdaemon quit (Ping timeout: 244 seconds)
08:39:21FromDiscord<Bung> okay, get it
08:39:27FromDiscord<Elegantbeef> A field that is `c: 10` isnt sensible
08:40:04FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=4bsY
08:40:42FromDiscord<Bung> how can I use C assign to a const , if it not in arguments ?
08:40:52FromDiscord<Elegantbeef> `result.C`
08:41:09FromDiscord<Bung> that's I tried ` Error: cannot evaluate at compile time: result`
08:41:23FromDiscord<Elegantbeef> `typeof(result).C`
08:41:24FromDiscord<Elegantbeef> Generic parameters can be accessed on instanced of that type
08:41:50FromDiscord<Elegantbeef> Or just `C`
08:41:58FromDiscord<Elegantbeef> You can use static generic parameters just like normal parameters
08:43:28FromDiscord<Forest [She/Her]> What should i use for my web app? Jester or httpx? Idk which one would be better suited
08:43:39FromDiscord<Forest [She/Her]> (It's a shopping website so)
08:43:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bsZ
08:44:17FromDiscord<Forest [She/Her]> Jester looks good ngl, think i'll try that out
08:44:40FromDiscord<Elegantbeef> Bung for some more examples of static parameters https://hatebin.com/pnvtgimacf https://github.com/beef331/nimtrest/blob/master/remoterefs.nim
08:53:33FromDiscord<Bung> I see some issue about const expr in argument type, like `T.s` , dont know how far nim supported
08:54:13FromDiscord<Bung> (edit) "`T.s`" => "`b:T.s`"
08:54:25FromDiscord<Elegantbeef> Yea i think it's mostly just generic bugs sadly
08:54:53*kenran joined #nim
09:00:50FromDiscord<untoreh> does memory profiler work with arc?
09:01:10FromDiscord<Elegantbeef> if you're using memory tools you'll want to do `-d:useMalloc`
09:04:34FromDiscord<untoreh> the output of `-d:memProfiler` with arc is empty so I am trying valgrind which I had to compile from trunk to make it work anyway 😒
09:05:12FromDiscord<Elegantbeef> Yea i didnt even know there was a memProfiler 😄
09:07:32*kenran quit (Quit: WeeChat info:version)
09:14:16*kenran joined #nim
09:14:35*kenran quit (Client Quit)
09:15:37*kenran joined #nim
09:15:39*kenran quit (Client Quit)
09:16:08*kenran joined #nim
09:16:12*kenran quit (Client Quit)
09:33:28*kenran joined #nim
09:37:24*kenran quit (Client Quit)
09:38:27*kenran joined #nim
09:45:50*kenran quit (Quit: WeeChat)
09:55:17FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4btc
09:58:24FromDiscord<Forest [She/Her]> Doesn't prologue cache it or something?
10:00:42FromDiscord<Forest [She/Her]> Oh i changed the title not the page content
10:00:44FromDiscord<Forest [She/Her]> Oops
10:00:45*TrueBlue[m] quit (Quit: Bridge terminating on SIGTERM)
10:00:50*reversem3[m] quit (Quit: Bridge terminating on SIGTERM)
10:01:20FromDiscord<Phil> If you await it anyway, why not just use sync reading?
10:02:02FromDiscord<Phil> You're pretty much just buying additional expensive operations at that point
10:03:30FromDiscord<Forest [She/Her]> Good point xD
10:04:00FromDiscord<Forest [She/Her]> I only added this code because i wanted to do dev work so yeah maybe just using sync reading is better
10:04:27FromDiscord<Phil> In reply to @Event Horizon "I only added this": Do you want to read the template in at compile time? Or at runtime?
10:06:27*reversem3[m] joined #nim
10:06:31FromDiscord<Phil> Because you can do the entire reading in at compile-time. You don't have to have the ability to swap out templates at runtime
10:06:46*TrueBlue[m] joined #nim
10:07:45FromDiscord<Phil> Though I guess during development having to re-compile just because you changed a template can be annoying, but you could have a when-block for these cases.↔Then again, reading the template at runtime isn't really that much of a performance penalty, network will screw your request times harder than that
10:09:27FromDiscord<Forest [She/Her]> It's fine i already know how that works, i made a `when defined(release)` block that uses staticRead to compile the pages into the code and an else statement that just defines a template to read the file at runtime
10:10:24FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4btj
10:10:33FromDiscord<Forest [She/Her]> Works perfectly 👍
10:13:37*kenran joined #nim
10:18:36*kenran quit (Quit: WeeChat)
10:30:35FromDiscord<Phil> In reply to @Event Horizon "Works perfectly 👍": Assume you'll have to do that for multiple endpoints, might be worth contemplating turning the entire block into a template for reuse 😄
10:30:54FromDiscord<Phil> (edit) "In reply to @Event Horizon "Works perfectly 👍": Assume you'll have to do that for multiple endpoints, might be worth contemplating turning the entire block into a template for reuse ... 😄" added "that'll only need to take in a path/name of an HTML file"
10:31:40FromDiscord<Forest [She/Her]> Yeah that's what i'm gonna do xD
10:32:33FromDiscord<Forest [She/Her]> I think i have to use a macro
10:32:47FromDiscord<Forest [She/Her]> For generating a const or template
10:34:54FromDiscord<Phil> I think dirty templates allow for doing a const
10:35:08FromDiscord<Phil> That is available outside the template
10:42:48FromDiscord<Forest [She/Her]> Oh neat
10:43:33FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4btr
10:54:09FromDiscord<hamidb80 (Hamid Bluri)> hey, how can i get current project directory at the compile time ? `os,getCurrentDir` or `system/nimscript.getCurrentDir` doesn't seem to work
11:07:56FromDiscord<Bung> go `currentSourcePath`
11:17:31*arkurious joined #nim
11:26:42FromDiscord<hamidb80 (Hamid Bluri)> thanks
11:35:43FromDiscord<Bung> https://github.com/nim-lang/Nim/pull/20423 @ElegantBeef now I fixed it, and the next is fix the `typeof(T)` in field declaration.
11:41:19FromDiscord<Takemichi Hanagaki> sent a long message, see http://ix.io/4btE
11:42:59FromDiscord<hamidb80 (Hamid Bluri)> i think `expermental: overloadable enums` is a good fix
11:43:34FromDiscord<hamidb80 (Hamid Bluri)> https://nim-lang.org/docs/manual.html#types-overloadable-enum-field-names
11:44:03FromDiscord<Rika> In reply to @Takemichi Hanagaki "Does I have anyway": Having non-namespaced enums does not disallow you from using the namespaced version
11:44:23FromDiscord<Rika> So you don’t need to force it, you can just use it as is
11:44:43FromDiscord<Takemichi Hanagaki> In reply to @Rika "So you don’t need": Okay!
11:45:15FromDiscord<Takemichi Hanagaki> I found on same page.↔Just don't use {.pure.}.
11:45:28FromDiscord<Rika> Pure is deprecated
11:45:37FromDiscord<Rika> It doesn’t do anything anymore when used on enums I believe
11:45:43FromDiscord<Takemichi Hanagaki> In reply to @Rika "Pure is deprecated": Ohhh, I got it.
11:45:53FromDiscord<Rika> You can still use it but it has no effect
11:46:55FromDiscord<Takemichi Hanagaki> So I can't use only the namespaced form. ↔Because, my problem is conflict names.
11:49:10*kenran joined #nim
11:49:49*kenran quit (Client Quit)
11:51:22FromDiscord<Rika> You can use the form
11:51:29FromDiscord<Rika> You just can’t force it
11:51:42FromDiscord<Rika> Then again, if the names are conflicting then that’s essentially forcing it
11:51:48FromDiscord<Rika> But you can’t force it outside of that
11:52:13FromDiscord<Rika> You should try just putting the namespaced form as is without any other pragmas or whatever else
11:52:17FromDiscord<Rika> It will work
11:54:57*Vladar joined #nim
11:59:56FromDiscord<Takemichi Hanagaki> In reply to @Rika "You should try just": Okay! Thank you! 😄
12:00:30FromDiscord<Forest [She/Her]> What did pure used to do?
12:02:13FromDiscord<Rika> Force namespaces lol
12:03:18FromDiscord<Forest [She/Her]> Ah
12:49:19FromDiscord<!&luke> In reply to @Elegantbeef "Someone uploaded a binary": Oops
12:53:20FromDiscord<Require Support> is it possible to tell nimble to not prompt for overriting? `Prompt: [email protected] already exists. Overwrite? [y/N]`
12:53:56FromDiscord<Bung> -y
12:54:01FromDiscord<Require Support> thanks
13:02:49FromDiscord<fbpyr> is there a way to `defer` an import? e.g. when I first need to extract an .so or .dll from a `staticRead` from the binary, before importing that lib via `import`?
13:13:28FromDiscord<Rika> Put it below the code
13:13:57FromDiscord<Rika> Run the extraction code in a static block too I guess
13:22:37FromDiscord<System64 ~ Flandre Scarlet> Hi, is there a library / framework that let me making gui easily? I'm thinking of making a gui like this https://media.discordapp.net/attachments/371759389889003532/1023947703215992852/unknown.png
13:30:58FromDiscord<Phil> In reply to @System64 "Hi, is there a": If you're familiar with webdev you could try to use karax or the like to write an HTML based interface that you server via webview.↔That can work more or less well, depending on the OS and the browser it bundles
13:31:28FromDiscord<Phil> As for simple native GUI I think there's owlkettle?
13:31:28FromDiscord<System64 ~ Flandre Scarlet> what about performances? Is it like Electron?
13:34:03FromDiscord<Phil> sent a long message, see http://ix.io/4bu0
13:34:40FromDiscord<System64 ~ Flandre Scarlet> oh interesting
13:34:54FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "As for simple native": does it let me do those little moving windows?
13:34:59FromDiscord<Phil> The default browser each OS uses for webview is Edge on Windows, Safari on Apple.↔On Linux it depends on the DE: Epiphany on Gnome and... I think Konqueror on KDE (?)
13:38:18FromDiscord<Phil> sent a long message, see http://ix.io/4bu1
13:40:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "The way I see": Ah alright↔Because I don't want to go low level for building GUIs
13:41:33FromDiscord<System64 ~ Flandre Scarlet> so I think the simplest would be JS
13:47:48FromDiscord<Phil> Alrighty, if that works for you.↔`nimview` is worth a shot for something webview based↔Should that not work out for you, you can take a look at the more basic `webgui` package
13:49:55FromDiscord<Phil> Actually, scratch that, I recommend looking into webgui from the get go, turns out the nimview guy would rather wait for nim bindings in tauri
13:59:33*rockcavera joined #nim
13:59:33*rockcavera quit (Changing host)
13:59:33*rockcavera joined #nim
14:04:40*kenran joined #nim
14:06:16*kenran quit (Remote host closed the connection)
14:08:27*kenran joined #nim
14:09:26*kenran quit (Remote host closed the connection)
14:11:30*kenran joined #nim
14:31:18FromDiscord<Forest [She/Her]> How could i return a string or a proc that returns a string?
14:40:13*vicecea quit (Remote host closed the connection)
14:40:50*vicecea joined #nim
14:43:29*Vladar quit (Quit: Leaving)
14:45:09FromDiscord<demotomohiro> Return an object variant that contains string or a procedural type.
14:45:17FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#types-object-variants
15:01:26FromDiscord<Forest [She/Her]> That looks like overkill for me lmao nvm
15:01:41FromDiscord<Forest [She/Her]> I need to restructure my program instead probably
15:11:55*kenran quit (Remote host closed the connection)
15:12:36FromDiscord<auxym> i mean, variant objects is pretty standard/idiomatic in nim whenever you mean to return 2 different types.
15:13:23FromDiscord<auxym> If not, then always return a proc? And if you have a constant string, wrap it in a proc?
15:15:48FromDiscord<Forest [She/Her]> I was just making it for using the staticRead at compileTime but it's fine i have a better solution now
15:16:36NimEventerNew thread by drkameleon: Battling with copies & a silly question, see https://forum.nim-lang.org/t/9493
15:21:39FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4buH
15:51:43FromDiscord<Forest [She/Her]> Honestly i wish i could make something to compile Python bytecode to Nim source code
15:57:49FromDiscord<aruZeta> In reply to @4zv4l "how can I do": you can't make an operator `:`
15:59:16FromDiscord<aruZeta> but you could make it with any other
15:59:26FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=4buO
16:01:59FromDiscord<4zv4l> thanks ! looks way better
16:16:57*krux02 joined #nim
17:01:20FromDiscord<auxym> In reply to @Event Horizon "Honestly i wish i": its been discussed a few times but it's basically impossible in all but the simplest cases. python is way too dynamic, there's no way to represent that in a static language like nim
17:01:53FromDiscord<Forest [She/Her]> So a generic python object couldn't be used?
17:02:06FromDiscord<Forest [She/Her]> But yeah i see your point
17:04:04FromDiscord<auxym> nuitka compiles python to C though, I wonder how they do it
17:04:35FromDiscord<Forest [She/Her]> Don't they statically link the python library?
17:04:46FromDiscord<Forest [She/Her]> If not, they probably use a generic python object that contains the base data
17:34:31FromDiscord<Forest [She/Her]> Hm https://nim-lang.org/docs/sharedtables.html doesn't have the same API as https://nim-lang.org/docs/tables.html, is that intentional?
17:36:28FromDiscord<Forest [She/Her]> Thinks like `hasKey` or `[]` is missing
17:36:52FromDiscord<Forest [She/Her]> So i had to use `hasKeyOrPut` (works for my use case but likely won't for others) and `mget`
17:37:45FromDiscord<Forest [She/Her]> The reason why i even need to do this is here
17:37:53FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4bvK
17:38:08FromDiscord<Forest [She/Her]> I just wanna load the html files as needed, so if a page goes unexplored, no need to load it
17:54:18FromDiscord<Require Support> if i initialize for example an object like `AsyncHttpClient` should I do it with `let` or `var` if i will be changing object fields like `AsyncHttpClient.headers`
18:01:03*LuxuryMode quit (Quit: Connection closed for inactivity)
18:03:01FromDiscord<Bubblie> hello can anyone help me with dimscord here?
18:03:14FromDiscord<Bubblie> I feel like this is a well known issue but I cant figure out why this is happening
18:03:17*kenran joined #nim
18:04:11FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=4bw0
18:04:12FromDiscord<Bubblie> is the error I get
18:05:30FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=4bw2
18:05:30FromDiscord<Bubblie> so its still erroring regardless
18:05:35FromDiscord<ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4bw3
18:05:43FromDiscord<ravinder387> I'm getting error in last 2 line
18:08:03FromDiscord<planetis> In reply to @jos "yeah, in a pretty": `for letter in 'a' .. 'z'` and examples with enums and arrays where you specify ranges use inclusive bounds. Not at all rare in nim code bases. Same as saying DSLs are rare because you never wrote one in X language that doesn't support NIm's macros. One-sided arguments can be debunked easily
18:08:50FromDiscord<jos> well then just search it on github
18:08:57FromDiscord<jos> if you really want the answer
18:09:22FromDiscord<jos> but any sensible person being fair will tell you that iterating over collections, indexing collections numerically, is way, way more common
18:09:34FromDiscord<jos> you know too, I'm sure
18:09:44FromDiscord<planetis> so?
18:09:45FromDiscord<jos> just like how Dijkstra and Guido came to that conclusion too
18:10:01FromDiscord<jos> idk, so the point is on average you produce less bugs
18:10:09FromDiscord<jos> and that's what a language designer should be thinking about
18:10:20FromDiscord<jos> it's just how it be
18:10:50FromDiscord<jos> you could argue for letter ranges the default should be different or something
18:11:51FromDiscord<planetis> {'a'..'z'} and the rest in strutils
18:12:30FromDiscord<planetis> I give you examples but I wont change your mind
18:13:16FromDiscord<planetis> hopeful those reading can make their conclussions
18:13:27FromDiscord<planetis> (edit) "hopeful" => "hopefully" | "conclussions" => "conclusions"
18:13:52FromDiscord<jos> well yeah, my priority is making less bugs on average
18:14:36FromDiscord<jos> I think the use case you're talking about (exhaustively enumerating a set) is way less common than using ranges to iterate or take a subset of a zero-indexed collection
18:14:41FromDiscord<jos> I'm not sure what your priority is
18:14:43FromDiscord<planetis> and you have achieved that by exclusive upper bounds, right...
18:14:45FromDiscord<jos> or what you're optimizing for
18:16:10FromDiscord<jos> so like for every 1 person pleased that you have inclusive upper bounds because they're enumerating all the natural numbers
18:16:32FromDiscord<jos> you'll have 10 people displeased because they're taking a slice of a 0-indexed string or something
18:17:14FromDiscord<jos> and tbh everyone is already used to half open intervals anyway, so even that 1 guy might be prepared
18:19:44FromDiscord<planetis> whenever i can I write for i in 1..10 because its easier to understand, in contrast to how programmers think, which is not how normal people think. yes
18:20:29FromDiscord<jos> agree to disagree then
18:20:50FromDiscord<jos> idk what you want from me, I think my position is firm and pretty sensible
18:21:10FromDiscord<jos> im not asking you to change your mind unless you think my reasoning is good enough to do that
18:24:30FromDiscord<planetis> good so it;s you opinion and not a fact
18:26:25FromDiscord<jos> well no, just half the argument
18:26:57FromDiscord<jos> it's cleaner for any lang with zero-indexed collections, because the length of the collection aligns with the end of the interval
18:27:20FromDiscord<jos> i.e. str[0..str.len] is a no-op
18:27:38FromDiscord<jos> another advantage is that you can express an empty slice i.e. [3..3]
18:27:51FromDiscord<jos> with open intervals, you can't express that intuitively
18:28:48FromDiscord<jos> another one is there's no overlap between adjacent slices i.e. [0..3] + [3..6] = [0..6]
18:29:14FromDiscord<jos> so that reduces a lot of wiggling around with +1 and -1
18:33:03FromDiscord<planetis> with enum its harder to reason though range[html..td] what's the predecessor of td?
18:33:09FromDiscord<planetis> (edit) "enum" => "enums"
18:33:35FromDiscord<planetis> and who writes fast code with slices anyway
18:33:48FromDiscord<jos> again, for the uncommon case of exhaustively enumerating a set or a set that isn't intuitively ordered, you provide an alternative syntax
18:33:59FromDiscord<jos> but the alternative syntax should be for the uncommon case
18:34:06FromDiscord<jos> the default should be for the common case
18:34:36FromDiscord<jos> In reply to @planetis "and who writes fast": in most modern languages trying to be fast, like nim and rust, it compiles to comparable machine code anyway
18:34:37FromDiscord<planetis> I told you what's common sense 1 based indexing and inclusive ranges!
18:34:49FromDiscord<jos> hmm
18:35:07FromDiscord<jos> I agree with 1 based indexing, inclusive ranges make more sense
18:35:19FromDiscord<jos> but there are a plethora of reasons not to choose 1 based indexing
18:35:34FromDiscord<jos> which is why only a handful of languages do it
18:39:13FromDiscord<planetis> I loved programming in julia for once it was so intuitive that's why I insist on that.
18:40:02*derpydoo joined #nim
18:41:35FromDiscord<Forest [She/Her]> In reply to @jos "I agree with 1": Inclusive ranges?
18:41:48FromDiscord<Forest [She/Her]> Ans 1 based indexing? I thought Nim started from 0, all my code does lol
18:43:15FromDiscord<jos> yeah we're just talking about language design in generL
18:43:18FromDiscord<jos> general
18:43:39FromDiscord<Forest [She/Her]> Ah fair
18:43:48FromDiscord<jos> In reply to @planetis "I loved programming in": maybe for heavily computational problems, which is Julia's target audience I think?
18:44:03FromDiscord<Forest [She/Her]> I personally like 0 based indexing but only because it's familiar to me tbh
18:44:16FromDiscord<jos> could be
18:45:08FromDiscord<planetis> no just a uni project in numerical analysis
18:49:23*pro joined #nim
18:50:27FromDiscord<untoreh> is the example here actual? https://nim-lang.org/docs/manual.html#special-types-static-t↔tried to reproduce but doesn't work, or maybe I misunderstood "replaces the call"
19:08:50FromDiscord<Bubblie> what does a switch statement in nim look like
19:12:30FromDiscord<huantian> https://nim-lang.org/docs/tut1.html#control-flow-statements-case-statement↔has some examples
19:17:58*pro quit (Quit: pro)
19:19:09*kenran quit (Remote host closed the connection)
19:25:25FromDiscord<Bubblie> thanks!
19:25:31FromDiscord<Bubblie> is there anything on using sqlite in nim too?
19:25:39FromDiscord<Bubblie> tryna just manage a tiny database
19:30:57FromDiscord<huantian> https://nim-lang.org/docs/db_sqlite.html
19:31:04FromDiscord<huantian> there's a builtin sqlite wrapper
19:47:03FromDiscord<Phil> In reply to @Bubblie "is there anything on": You may want to use ndb/sqlite instead of the official wrapper.↔The official wrapper represents "NULL" from the database as `""`, the ndb wrapper gives it a proper representation
19:49:57FromDiscord<auxym> there's also gulpf/tiny_sqlite
20:10:31FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4bwH
20:10:52FromDiscord<Forest [She/Her]> https://media.discordapp.net/attachments/371759389889003532/1024050442449211553/error.nim
20:11:13FromDiscord<Forest [She/Her]> When serving it statically, i got no issues?
20:12:48FromDiscord<Forest [She/Her]> By static i mean manually serving the procs
20:17:02*disso_pch quit (Remote host closed the connection)
20:19:29FromDiscord<Forest [She/Her]> Uhh i made Nim generate invalid C code
20:19:39FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4bwO
20:19:49FromDiscord<Forest [She/Her]> My current code
20:19:51FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4bwP
20:21:51*jmdaemon joined #nim
20:22:38FromDiscord<Forest [She/Her]> How the hell did i make Nim generate invalid code
20:26:42FromDiscord<Forest [She/Her]> I fixed it with an `exportc` pragma on `serveProc` but how the hell did i make it generate invalid code...
20:26:48FromDiscord<Forest [She/Her]> I'll make a Nim issue
20:34:18FromDiscord<Phil> First things first, why is it ".html", but only "css"? Why not ".css" ?
20:36:22FromDiscord<Bung> it's a weird idea that u use dir rec for routing
20:36:24FromDiscord<Phil> @Forest [She/Her]
20:37:21FromDiscord<Forest [She/Her]> In reply to @Isofruit "First things first, why": I fixed that after
20:37:37FromDiscord<Forest [She/Her]> In reply to @Bung "it's a weird idea": How? It explores all files within a folder
20:38:10FromDiscord<Forest [She/Her]> Current code btw https://hastebin.com/tusadacota.properties
20:39:19FromDiscord<Bung> the web server function is url -> router -> your asyn proc
20:39:26FromDiscord<Phil> You're setting up your routes at runtime
20:39:40FromDiscord<Phil> Hmm
20:39:46FromDiscord<Forest [She/Her]> Yeah, idk how to make it done at compile time xD
20:39:55FromDiscord<Forest [She/Her]> But the bug shouldn't happen regardless
20:39:59FromDiscord<Phil> Wait, nevermind, that's normal, just not that particular way
20:40:47FromDiscord<Phil> Question, why not just do static file serving with that setup?
20:41:25FromDiscord<Phil> Since you're pretty much just forwarding the HTML file
20:41:53FromDiscord<Forest [She/Her]> In reply to @Isofruit "Question, why not just": Wdym?
20:42:27FromDiscord<Forest [She/Her]> I'm gonna be adding templating later on so
20:42:40FromDiscord<Bung> nothing stop you duplicate your async proc
20:42:41FromDiscord<Phil> In reply to @Event Horizon "Wdym?": From what I'm seeing the route does not return anything except for the contents of the read in HTML file, no?↔That's static file serving.↔That could be done via staticFilesMiddleware
20:43:10FromDiscord<Phil> Where you basically just define a directory and the user has access to all files inside of it, not need for setting up routes
20:43:42FromDiscord<Forest [She/Her]> Ah
20:43:49FromDiscord<Bubblie> In reply to @Isofruit "You may want to": Okay!
20:43:53FromDiscord<Forest [She/Her]> Yeah but i'm gonna be adding templating to it after
20:43:54FromDiscord<Bung> u redefine 404 become 500
20:44:23FromDiscord<Forest [She/Her]> So i can insert products that are currently being sold without JS
20:44:39FromDiscord<Phil> In reply to @Event Horizon "Yeah but i'm gonna": Is this without or with database data?
20:45:00FromDiscord<Forest [She/Her]> Without, the products list is just gonna be a JSON file
20:45:17FromDiscord<Forest [She/Her]> Unless there's a more ideal way i should do this?
20:45:30FromDiscord<Phil> I mean, how likely is the JSON to change
20:45:32FromDiscord<Phil> ?
20:45:43FromDiscord<Forest [She/Her]> Quite likely, as products are in or out of stock
20:46:00FromDiscord<Forest [She/Her]> I could make an API and do this with clientside JS, tbf
20:46:06FromDiscord<Phil> Any specific reason you want to avoid a database?
20:46:40FromDiscord<Forest [She/Her]> Not really besides not wanting to deal with setup, since i'm also testing it from repl.it which can't run databases afaik
20:46:51FromDiscord<Forest [She/Her]> Besides it's own crappy one
20:46:52FromDiscord<Phil> Like, it's not mandatory, but generally is just always so nice to have that it's justifiably a default architecture
20:47:05FromDiscord<Forest [She/Her]> Hm fair
20:47:35FromDiscord<Forest [She/Her]> In reply to @Event Horizon "Not really besides not": (and i have nowhere to host one currently, i have no money)
20:47:40FromDiscord<Phil> And if its setup that annoys you, sqlite is low setup
20:47:51FromDiscord<Forest [She/Her]> Oh? I'll look into that then
20:48:01FromDiscord<Phil> Sqlite is basically a glorified file as a relational database
20:48:09FromDiscord<huantian> a very glorified file
20:48:33FromDiscord<Phil> Faster than fopen, has the ability to implement pretty fast Full text search, supports most sql syntax
20:49:00FromDiscord<Forest [She/Her]> Hm interesting
20:49:01FromDiscord<Bung> https://planety.github.io/prologue/staticfiles/ prologue documented well
20:49:26FromDiscord<Phil> Like its one weakpoint is that it's slower than postgres/mysql and co in concurrent write access and larger amounts of concurrent read access, but at that point we're talking way > 10.000 users a day
20:49:45FromDiscord<Forest [She/Her]> In reply to @Bung "https://planety.github.io/prologue/staticfiles/ pr": Prologue does have nice docs tbh
20:50:06FromDiscord<Phil> Yeh, flywind did a pretty nice job
20:50:13FromDiscord<Forest [She/Her]> In reply to @Isofruit "Like its *one* weakpoint": Ah i doubt i'd get that many users haha, i can always migrate to an actual database if i earn money
20:50:29FromDiscord<huantian> sqlite is an actual database!
20:50:44FromDiscord<Forest [She/Her]> Well, an actual MySQL database :p
20:51:04FromDiscord<Phil> actually, if you go mysql you can try out mariadb! But yeah I getcha
20:51:20FromDiscord<Forest [She/Her]> Oh?
20:51:25FromDiscord<huantian> I didn't know people still used mysql in 2022 😛
20:51:38FromDiscord<Phil> mariadb is a drop in replacement for mysql to get away from oracle
20:51:41FromDiscord<Forest [She/Her]> Okay so i'm probably just going to make it render products and stuff clientside haha
20:51:49FromDiscord<Forest [She/Her]> In reply to @Isofruit "mariadb is a drop": Ah fair enough
20:52:00FromDiscord<Phil> In reply to @huantian "I didn't know people": Man, is working in an IT company going to blow your mind
20:52:36FromDiscord<Phil> We had several key core services still on java 8 at the start of the year
20:52:36FromDiscord<huantian> maybe I should restate my sentence, I didn't know people wanted to use mysql in a new app in 2022 :)
20:52:39FromDiscord<Forest [She/Her]> I remember last year we had to use MS Access
20:52:54FromDiscord<Forest [She/Her]> That was horrible to use
20:53:00FromDiscord<Phil> In reply to @huantian "maybe I should restate": Ohhh that is fair. Well Mysql is widespread, so lots of good guides etc. but yeah
20:53:20FromDiscord<Phil> In reply to @Event Horizon "I remember last year": I mean... the MS says it all
20:53:25FromDiscord<Forest [She/Her]> XD
20:53:55FromDiscord<Phil> But yeah, generally sqlite is one of those small but absolutely incredible pieces of technology
20:55:38FromDiscord<Forest [She/Her]> Do static files get cached or just resent every request?
20:55:53FromDiscord<Phil> you mean from the static files middleware?
20:55:56FromDiscord<Forest [She/Her]> Yup
20:56:04FromDiscord<Phil> Resent
20:56:14FromDiscord<Phil> Strictly speaking, that middleware is nothing you should be using in prod
20:56:27FromDiscord<Horizon [She/Her]> Ah okay then hm
20:56:30FromDiscord<Phil> Because strictly speaking, static file serving is something your reverse proxy does
20:56:30*derpydoo quit (Ping timeout: 244 seconds)
20:56:43FromDiscord<huantian> ^
20:56:52FromDiscord<Phil> As in, these requests should never ever be reaching your prologue-application
20:57:15FromDiscord<Bung> what's a proper error message for this ? https://github.com/nim-lang/Nim/issues/19271
20:57:33FromDiscord<Horizon [She/Her]> Would it not be fine to just generate code to generate the routes for me lol?
20:57:50FromDiscord<Horizon [She/Her]> My system caches the pages so just using that for now is probably simple
20:58:53FromDiscord<Bung> there's wildcard route or directory based route
20:59:20FromDiscord<Horizon [She/Her]> Oh? I'd like to do directory based route if possible
20:59:45FromDiscord<Bung> so read the prologue document
21:00:15FromDiscord<Horizon [She/Her]> Reading it rn
21:00:24FromDiscord<Horizon [She/Her]> When you said that it exists
21:04:08FromDiscord<Horizon [She/Her]> Ah I've seen `{path}` before in FastAPI, is it possible to do `/{path:path}` for the full URL? Or just `/{path}`?
21:04:41FromDiscord<Phil> You can do regex for url params, there's also other ways but I prefer regex
21:06:40FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4bwZ
21:07:06FromDiscord<Phil> ignore the handler, the key part is the first bit that is the url
21:09:37FromDiscord<Phil> Sadly it's not set up to yell at you if you call for path parameters in your proc that do not exist in your route's URL
21:09:45FromDiscord<Phil> (edit) "Sadly it's not set up to yell at you if you call for path parameters in your proc that do not exist in your route's URL ... " added "at compile-time"
21:11:09FromDiscord<Horizon [She/Her]> In reply to @Isofruit "You can do regex": Ah
21:11:41FromDiscord<Horizon [She/Her]> I'd need the full URL path
21:11:52FromDiscord<Horizon [She/Her]> So `/css/index.css` would also be given to me
21:24:14*disso_peach joined #nim
21:28:54FromDiscord<Horizon [She/Her]> I have a solution
21:52:42*ehmry quit (Read error: Connection reset by peer)
21:53:47*wallabra quit (Ping timeout: 252 seconds)
22:00:23*wallabra joined #nim
22:12:27*krux02 quit (Remote host closed the connection)
22:18:07FromDiscord<Mrcool> is <https://github.com/nim-lang/langserver> the recommend lsp or nimlsp ?
22:19:01FromDiscord<Mrcool> nvm langserver doesn't even seem to build
22:19:27FromDiscord<Mrcool> is there a recommend way to get tests coverage?
22:44:59FromDiscord<Elegantbeef> It needs 1.7.1 or 1.6.8(though this isnt released fully iirc)↔(@Mrcool)
22:45:59FromDiscord<Mrcool> any links on how to use it?
22:46:25FromDiscord<Elegantbeef> Whoops wrong reply
22:46:25FromDiscord<Elegantbeef> that was to nimlangserver
22:47:43FromDiscord<Mrcool> I have nim 1.7.1
22:48:00FromDiscord<Mrcool> I'll try nim dev
22:49:07FromDiscord<Mrcool> ah wait 1.7.1 is dev xD
22:49:20FromDiscord<Mrcool> https://media.discordapp.net/attachments/371759389889003532/1024090320725618728/unknown.png
22:50:36FromDiscord<Mrcool> I guess thats an easy fix, lets see if it thats the only issue
22:52:14FromDiscord<Mrcool> cool thats the only error
22:53:46FromDiscord<Mrcool> i'm impressed that the lsp ddin't crash when opening langersever.nim file
22:54:11FromDiscord<Mrcool> my 60 lines files kills it usually <https://github.com/sigmaSd/deno-nim/blob/master/src/deno_nim.nim>
22:54:22FromDiscord<Mrcool> (edit) "files" => "file"
22:54:49FromDiscord<Mrcool> maybe the js backend makes the lsp even more unstable
23:02:06FromDiscord<demotomohiro> sent a long message, see http://ix.io/4bxo
23:04:08FromDiscord<Patitotective> lmao
23:04:59FromDiscord<auxym> I mean, I understand the idea behind cryptographically secure PRNGs. but really, if you seed the rng from some system entropy, and (deterministically) generate a random password, what exactly is the attack vector here?
23:05:31FromDiscord<auxym> Someone has access to the state of your system RNG at password-generation time? If so you have a lot more problems IMO
23:07:27FromDiscord<demotomohiro> Point is, if you generate a password longer than 16 charactors, it doesn't stronger than 16 charactors.
23:10:53FromDiscord<demotomohiro> If attacker know how password is generated, passwords longer than 16 chars does not make cracking password harder.
23:18:19FromDiscord<auxym> if attacker knows how password is generated and the state of the RNG at password generation time
23:22:12FromDiscord<Mrcool> is there amethod to print to stderr
23:22:15FromDiscord<Mrcool> (edit) "amethod" => "a method"
23:23:15FromDiscord<auxym> `stderr.write`
23:27:35FromDiscord<Bung> well, password does not need to be crypto , u see it's a cli program , it outputs to user
23:31:41*ehmry joined #nim
23:44:05FromDiscord<Girvo> My TCP server, built around `threadpool` seems to fall over after running for a while: all `recv` calls end up immediately timing out. Is the re-used socket the problem? Seems really odd
23:45:37FromDiscord<Girvo> Like I have a "60 minute" timeout set (don't ask, its just a test), but the existing clients are timing out _immediately_
23:45:45FromDiscord<Girvo> New clients can connect no worries
23:48:50FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4bxr
23:49:42FromDiscord<Girvo> Restarting the server allows the existing clients to begin connecting again properly
23:54:43FromDiscord<Girvo> `isClosed` doesn't exist on `Socket` from `std/net` right?
23:55:56FromDiscord<Girvo> Guess this needs to be refactored onto asyncnet. Annoying.
23:57:02FromDiscord<Patitotective> currently is there a way to use same fields for different branches? https://github.com/nim-lang/RFCs/issues/368
23:57:55FromDiscord<Generic> no