00:03:59 | FromDiscord | <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:50 | FromDiscord | <Patitotective> hello |
02:00:14 | FromDiscord | <Elegantbeef> yellow |
02:01:32 | FromDiscord | <Patitotective> pink |
02:15:16 | * | reversem3[m] joined #nim |
03:10:42 | FromDiscord | <Shiba> red |
03:23:59 | FromDiscord | <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:48 | FromDiscord | <Bung> found that part maybe bugy code, I removed it generics test passed , let me see other tests |
04:11:41 | FromDiscord | <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:07 | FromDiscord | <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:30 | FromDiscord | <flywind> (edit) "read" => "open" |
05:18:43 | FromDiscord | <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:48 | FromDiscord | <Bung> me neither, `Having trouble showing that directory` , nvm , my problem not specific to it |
05:32:06 | * | wallabra joined #nim |
05:40:32 | FromDiscord | <Forest [She/Her]> Anyone know how Nim replicates pointers in JS? It uses lists but honestly idk how |
05:40:47 | FromDiscord | <Elegantbeef> It emits an array |
05:40:55 | FromDiscord | <Elegantbeef> And it passes a integer to index that |
05:40:58 | FromDiscord | <Elegantbeef> IIRC |
05:41:14 | FromDiscord | <Elegantbeef> This gives you pointer semantics with things that are normally copied in JS |
05:41:21 | FromDiscord | <Forest [She/Her]> A global array? |
05:41:40 | FromDiscord | <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:10 | FromDiscord | <Elegantbeef> No it's not a global array |
05:47:28 | FromDiscord | <Forest [She/Her]> Alright |
05:48:01 | FromDiscord | <Forest [She/Her]> In Python the semantics could probably be somewhat easily replicated with a 'Pointer' class |
05:48:59 | FromDiscord | <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:59 | FromDiscord | <Girvo> Can I define something via `nimble build -d:example`? Does that actually set it? |
06:53:00 | FromDiscord | <Elegantbeef> I dont think it does, but i cannot recall |
06:53:11 | FromDiscord | <Girvo> No worries. Turns out I'd already set it in `nim.cfg` anyway lol |
07:14:31 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> A cstring is really just `ptr char` so no it will not do memory management |
07:15:41 | FromDiscord | <Elegantbeef> You'd likely want `string` then do `cstring(myString)` as long as your `cstring` doesnt outlast your `string` |
07:19:04 | FromDiscord | <ChocolettePalette> So if I do `var s: cstring = cstring(normal_string)` inside a proc, I will get a memory leak? |
07:20:02 | FromDiscord | <Elegantbeef> No |
07:20:19 | FromDiscord | <Elegantbeef> `cstring` conversion there just takes the address of the first character |
07:20:23 | FromDiscord | <Elegantbeef> It's a free conversion but Nim doesnt track that cstring |
07:20:35 | FromDiscord | <Elegantbeef> As such if you dont properly watch your usage you can access a dangling pointer |
07:23:06 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> No |
07:23:25 | FromDiscord | <Elegantbeef> string literals are constants |
07:23:25 | FromDiscord | <Elegantbeef> So that is stored in static memory |
07:23:50 | FromDiscord | <Elegantbeef> if you do `var s = someCProcThatReturnsCString()` it will |
07:23:55 | FromDiscord | <ChocolettePalette> Ah, yes, right. Thank you! |
07:34:35 | NimEventer | New Nimble package! passy - A fast little password generator, see https://github.com/infinitybeond1/passy |
07:34:59 | FromDiscord | <Elegantbeef> Someone uploaded a binary again |
07:35:16 | FromDiscord | <Elegantbeef> God damn it they're using an array of strings for this |
07:36:35 | FromDiscord | <Forest [She/Her]> Aren't these type of passwords easier to crack anyway iirc? |
07:36:57 | FromDiscord | <Forest [She/Her]> Like `h31l0 w0r1d` |
07:37:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bsM |
07:38:48 | FromDiscord | <Forest [She/Her]> Also you should remove the binary from the GitHub and add it to the `.gitignore` :p |
07:39:08 | FromDiscord | <Elegantbeef> I did mention that |
07:39:36 | FromDiscord | <Elegantbeef> They also dont pin the version of termui they're using |
07:52:01 | FromDiscord | <Forest [She/Her]> In reply to @Elegantbeef "I did mention that": Yeah ik |
07:58:37 | NimEventer | New 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:31 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4bsU |
08:29:35 | FromDiscord | <Bung> t10833.nim(3, 6) Error: type expected |
08:30:17 | FromDiscord | <Bung> after fix issue 10833, I found it cant be used as field type ? |
08:31:34 | FromDiscord | <Bung> @ElegantBeef it should compile, right ? |
08:36:49 | FromDiscord | <Elegantbeef> No it shouldnt |
08:37:06 | FromDiscord | <Elegantbeef> `typeof(C)` should though |
08:39:12 | FromDiscord | <Elegantbeef> `static`s are values not types |
08:39:13 | * | jmdaemon quit (Ping timeout: 244 seconds) |
08:39:21 | FromDiscord | <Bung> okay, get it |
08:39:27 | FromDiscord | <Elegantbeef> A field that is `c: 10` isnt sensible |
08:40:04 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4bsY |
08:40:42 | FromDiscord | <Bung> how can I use C assign to a const , if it not in arguments ? |
08:40:52 | FromDiscord | <Elegantbeef> `result.C` |
08:41:09 | FromDiscord | <Bung> that's I tried ` Error: cannot evaluate at compile time: result` |
08:41:23 | FromDiscord | <Elegantbeef> `typeof(result).C` |
08:41:24 | FromDiscord | <Elegantbeef> Generic parameters can be accessed on instanced of that type |
08:41:50 | FromDiscord | <Elegantbeef> Or just `C` |
08:41:58 | FromDiscord | <Elegantbeef> You can use static generic parameters just like normal parameters |
08:43:28 | FromDiscord | <Forest [She/Her]> What should i use for my web app? Jester or httpx? Idk which one would be better suited |
08:43:39 | FromDiscord | <Forest [She/Her]> (It's a shopping website so) |
08:43:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bsZ |
08:44:17 | FromDiscord | <Forest [She/Her]> Jester looks good ngl, think i'll try that out |
08:44:40 | FromDiscord | <Elegantbeef> Bung for some more examples of static parameters https://hatebin.com/pnvtgimacf https://github.com/beef331/nimtrest/blob/master/remoterefs.nim |
08:53:33 | FromDiscord | <Bung> I see some issue about const expr in argument type, like `T.s` , dont know how far nim supported |
08:54:13 | FromDiscord | <Bung> (edit) "`T.s`" => "`b:T.s`" |
08:54:25 | FromDiscord | <Elegantbeef> Yea i think it's mostly just generic bugs sadly |
08:54:53 | * | kenran joined #nim |
09:00:50 | FromDiscord | <untoreh> does memory profiler work with arc? |
09:01:10 | FromDiscord | <Elegantbeef> if you're using memory tools you'll want to do `-d:useMalloc` |
09:04:34 | FromDiscord | <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:12 | FromDiscord | <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:17 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4btc |
09:58:24 | FromDiscord | <Forest [She/Her]> Doesn't prologue cache it or something? |
10:00:42 | FromDiscord | <Forest [She/Her]> Oh i changed the title not the page content |
10:00:44 | FromDiscord | <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:20 | FromDiscord | <Phil> If you await it anyway, why not just use sync reading? |
10:02:02 | FromDiscord | <Phil> You're pretty much just buying additional expensive operations at that point |
10:03:30 | FromDiscord | <Forest [She/Her]> Good point xD |
10:04:00 | FromDiscord | <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:27 | FromDiscord | <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:31 | FromDiscord | <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:45 | FromDiscord | <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:27 | FromDiscord | <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:24 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4btj |
10:10:33 | FromDiscord | <Forest [She/Her]> Works perfectly đ |
10:13:37 | * | kenran joined #nim |
10:18:36 | * | kenran quit (Quit: WeeChat) |
10:30:35 | FromDiscord | <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:54 | FromDiscord | <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:40 | FromDiscord | <Forest [She/Her]> Yeah that's what i'm gonna do xD |
10:32:33 | FromDiscord | <Forest [She/Her]> I think i have to use a macro |
10:32:47 | FromDiscord | <Forest [She/Her]> For generating a const or template |
10:34:54 | FromDiscord | <Phil> I think dirty templates allow for doing a const |
10:35:08 | FromDiscord | <Phil> That is available outside the template |
10:42:48 | FromDiscord | <Forest [She/Her]> Oh neat |
10:43:33 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4btr |
10:54:09 | FromDiscord | <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:56 | FromDiscord | <Bung> go `currentSourcePath` |
11:17:31 | * | arkurious joined #nim |
11:26:42 | FromDiscord | <hamidb80 (Hamid Bluri)> thanks |
11:35:43 | FromDiscord | <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:19 | FromDiscord | <Takemichi Hanagaki> sent a long message, see http://ix.io/4btE |
11:42:59 | FromDiscord | <hamidb80 (Hamid Bluri)> i think `expermental: overloadable enums` is a good fix |
11:43:34 | FromDiscord | <hamidb80 (Hamid Bluri)> https://nim-lang.org/docs/manual.html#types-overloadable-enum-field-names |
11:44:03 | FromDiscord | <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:23 | FromDiscord | <Rika> So you donât need to force it, you can just use it as is |
11:44:43 | FromDiscord | <Takemichi Hanagaki> In reply to @Rika "So you donât need": Okay! |
11:45:15 | FromDiscord | <Takemichi Hanagaki> I found on same page.â”Just don't use {.pure.}. |
11:45:28 | FromDiscord | <Rika> Pure is deprecated |
11:45:37 | FromDiscord | <Rika> It doesnât do anything anymore when used on enums I believe |
11:45:43 | FromDiscord | <Takemichi Hanagaki> In reply to @Rika "Pure is deprecated": Ohhh, I got it. |
11:45:53 | FromDiscord | <Rika> You can still use it but it has no effect |
11:46:55 | FromDiscord | <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:22 | FromDiscord | <Rika> You can use the form |
11:51:29 | FromDiscord | <Rika> You just canât force it |
11:51:42 | FromDiscord | <Rika> Then again, if the names are conflicting then thatâs essentially forcing it |
11:51:48 | FromDiscord | <Rika> But you canât force it outside of that |
11:52:13 | FromDiscord | <Rika> You should try just putting the namespaced form as is without any other pragmas or whatever else |
11:52:17 | FromDiscord | <Rika> It will work |
11:54:57 | * | Vladar joined #nim |
11:59:56 | FromDiscord | <Takemichi Hanagaki> In reply to @Rika "You should try just": Okay! Thank you! đ |
12:00:30 | FromDiscord | <Forest [She/Her]> What did pure used to do? |
12:02:13 | FromDiscord | <Rika> Force namespaces lol |
12:03:18 | FromDiscord | <Forest [She/Her]> Ah |
12:49:19 | FromDiscord | <!&luke> In reply to @Elegantbeef "Someone uploaded a binary": Oops |
12:53:20 | FromDiscord | <Require Support> is it possible to tell nimble to not prompt for overriting? `Prompt: [email protected] already exists. Overwrite? [y/N]` |
12:53:56 | FromDiscord | <Bung> -y |
12:54:01 | FromDiscord | <Require Support> thanks |
13:02:49 | FromDiscord | <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:28 | FromDiscord | <Rika> Put it below the code |
13:13:57 | FromDiscord | <Rika> Run the extraction code in a static block too I guess |
13:22:37 | FromDiscord | <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:58 | FromDiscord | <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:28 | FromDiscord | <Phil> As for simple native GUI I think there's owlkettle? |
13:31:28 | FromDiscord | <System64 ~ Flandre Scarlet> what about performances? Is it like Electron? |
13:34:03 | FromDiscord | <Phil> sent a long message, see http://ix.io/4bu0 |
13:34:40 | FromDiscord | <System64 ~ Flandre Scarlet> oh interesting |
13:34:54 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "As for simple native": does it let me do those little moving windows? |
13:34:59 | FromDiscord | <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:18 | FromDiscord | <Phil> sent a long message, see http://ix.io/4bu1 |
13:40:02 | FromDiscord | <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:33 | FromDiscord | <System64 ~ Flandre Scarlet> so I think the simplest would be JS |
13:47:48 | FromDiscord | <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:55 | FromDiscord | <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:18 | FromDiscord | <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:09 | FromDiscord | <demotomohiro> Return an object variant that contains string or a procedural type. |
14:45:17 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#types-object-variants |
15:01:26 | FromDiscord | <Forest [She/Her]> That looks like overkill for me lmao nvm |
15:01:41 | FromDiscord | <Forest [She/Her]> I need to restructure my program instead probably |
15:11:55 | * | kenran quit (Remote host closed the connection) |
15:12:36 | FromDiscord | <auxym> i mean, variant objects is pretty standard/idiomatic in nim whenever you mean to return 2 different types. |
15:13:23 | FromDiscord | <auxym> If not, then always return a proc? And if you have a constant string, wrap it in a proc? |
15:15:48 | FromDiscord | <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:36 | NimEventer | New thread by drkameleon: Battling with copies & a silly question, see https://forum.nim-lang.org/t/9493 |
15:21:39 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4buH |
15:51:43 | FromDiscord | <Forest [She/Her]> Honestly i wish i could make something to compile Python bytecode to Nim source code |
15:57:49 | FromDiscord | <aruZeta> In reply to @4zv4l "how can I do": you can't make an operator `:` |
15:59:16 | FromDiscord | <aruZeta> but you could make it with any other |
15:59:26 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=4buO |
16:01:59 | FromDiscord | <4zv4l> thanks ! looks way better |
16:16:57 | * | krux02 joined #nim |
17:01:20 | FromDiscord | <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:53 | FromDiscord | <Forest [She/Her]> So a generic python object couldn't be used? |
17:02:06 | FromDiscord | <Forest [She/Her]> But yeah i see your point |
17:04:04 | FromDiscord | <auxym> nuitka compiles python to C though, I wonder how they do it |
17:04:35 | FromDiscord | <Forest [She/Her]> Don't they statically link the python library? |
17:04:46 | FromDiscord | <Forest [She/Her]> If not, they probably use a generic python object that contains the base data |
17:34:31 | FromDiscord | <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:28 | FromDiscord | <Forest [She/Her]> Thinks like `hasKey` or `[]` is missing |
17:36:52 | FromDiscord | <Forest [She/Her]> So i had to use `hasKeyOrPut` (works for my use case but likely won't for others) and `mget` |
17:37:45 | FromDiscord | <Forest [She/Her]> The reason why i even need to do this is here |
17:37:53 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4bvK |
17:38:08 | FromDiscord | <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:18 | FromDiscord | <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:01 | FromDiscord | <Bubblie> hello can anyone help me with dimscord here? |
18:03:14 | FromDiscord | <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:11 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=4bw0 |
18:04:12 | FromDiscord | <Bubblie> is the error I get |
18:05:30 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=4bw2 |
18:05:30 | FromDiscord | <Bubblie> so its still erroring regardless |
18:05:35 | FromDiscord | <ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4bw3 |
18:05:43 | FromDiscord | <ravinder387> I'm getting error in last 2 line |
18:08:03 | FromDiscord | <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:50 | FromDiscord | <jos> well then just search it on github |
18:08:57 | FromDiscord | <jos> if you really want the answer |
18:09:22 | FromDiscord | <jos> but any sensible person being fair will tell you that iterating over collections, indexing collections numerically, is way, way more common |
18:09:34 | FromDiscord | <jos> you know too, I'm sure |
18:09:44 | FromDiscord | <planetis> so? |
18:09:45 | FromDiscord | <jos> just like how Dijkstra and Guido came to that conclusion too |
18:10:01 | FromDiscord | <jos> idk, so the point is on average you produce less bugs |
18:10:09 | FromDiscord | <jos> and that's what a language designer should be thinking about |
18:10:20 | FromDiscord | <jos> it's just how it be |
18:10:50 | FromDiscord | <jos> you could argue for letter ranges the default should be different or something |
18:11:51 | FromDiscord | <planetis> {'a'..'z'} and the rest in strutils |
18:12:30 | FromDiscord | <planetis> I give you examples but I wont change your mind |
18:13:16 | FromDiscord | <planetis> hopeful those reading can make their conclussions |
18:13:27 | FromDiscord | <planetis> (edit) "hopeful" => "hopefully" | "conclussions" => "conclusions" |
18:13:52 | FromDiscord | <jos> well yeah, my priority is making less bugs on average |
18:14:36 | FromDiscord | <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:41 | FromDiscord | <jos> I'm not sure what your priority is |
18:14:43 | FromDiscord | <planetis> and you have achieved that by exclusive upper bounds, right... |
18:14:45 | FromDiscord | <jos> or what you're optimizing for |
18:16:10 | FromDiscord | <jos> so like for every 1 person pleased that you have inclusive upper bounds because they're enumerating all the natural numbers |
18:16:32 | FromDiscord | <jos> you'll have 10 people displeased because they're taking a slice of a 0-indexed string or something |
18:17:14 | FromDiscord | <jos> and tbh everyone is already used to half open intervals anyway, so even that 1 guy might be prepared |
18:19:44 | FromDiscord | <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:29 | FromDiscord | <jos> agree to disagree then |
18:20:50 | FromDiscord | <jos> idk what you want from me, I think my position is firm and pretty sensible |
18:21:10 | FromDiscord | <jos> im not asking you to change your mind unless you think my reasoning is good enough to do that |
18:24:30 | FromDiscord | <planetis> good so it;s you opinion and not a fact |
18:26:25 | FromDiscord | <jos> well no, just half the argument |
18:26:57 | FromDiscord | <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:20 | FromDiscord | <jos> i.e. str[0..str.len] is a no-op |
18:27:38 | FromDiscord | <jos> another advantage is that you can express an empty slice i.e. [3..3] |
18:27:51 | FromDiscord | <jos> with open intervals, you can't express that intuitively |
18:28:48 | FromDiscord | <jos> another one is there's no overlap between adjacent slices i.e. [0..3] + [3..6] = [0..6] |
18:29:14 | FromDiscord | <jos> so that reduces a lot of wiggling around with +1 and -1 |
18:33:03 | FromDiscord | <planetis> with enum its harder to reason though range[html..td] what's the predecessor of td? |
18:33:09 | FromDiscord | <planetis> (edit) "enum" => "enums" |
18:33:35 | FromDiscord | <planetis> and who writes fast code with slices anyway |
18:33:48 | FromDiscord | <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:59 | FromDiscord | <jos> but the alternative syntax should be for the uncommon case |
18:34:06 | FromDiscord | <jos> the default should be for the common case |
18:34:36 | FromDiscord | <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:37 | FromDiscord | <planetis> I told you what's common sense 1 based indexing and inclusive ranges! |
18:34:49 | FromDiscord | <jos> hmm |
18:35:07 | FromDiscord | <jos> I agree with 1 based indexing, inclusive ranges make more sense |
18:35:19 | FromDiscord | <jos> but there are a plethora of reasons not to choose 1 based indexing |
18:35:34 | FromDiscord | <jos> which is why only a handful of languages do it |
18:39:13 | FromDiscord | <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:35 | FromDiscord | <Forest [She/Her]> In reply to @jos "I agree with 1": Inclusive ranges? |
18:41:48 | FromDiscord | <Forest [She/Her]> Ans 1 based indexing? I thought Nim started from 0, all my code does lol |
18:43:15 | FromDiscord | <jos> yeah we're just talking about language design in generL |
18:43:18 | FromDiscord | <jos> general |
18:43:39 | FromDiscord | <Forest [She/Her]> Ah fair |
18:43:48 | FromDiscord | <jos> In reply to @planetis "I loved programming in": maybe for heavily computational problems, which is Julia's target audience I think? |
18:44:03 | FromDiscord | <Forest [She/Her]> I personally like 0 based indexing but only because it's familiar to me tbh |
18:44:16 | FromDiscord | <jos> could be |
18:45:08 | FromDiscord | <planetis> no just a uni project in numerical analysis |
18:49:23 | * | pro joined #nim |
18:50:27 | FromDiscord | <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:50 | FromDiscord | <Bubblie> what does a switch statement in nim look like |
19:12:30 | FromDiscord | <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:25 | FromDiscord | <Bubblie> thanks! |
19:25:31 | FromDiscord | <Bubblie> is there anything on using sqlite in nim too? |
19:25:39 | FromDiscord | <Bubblie> tryna just manage a tiny database |
19:30:57 | FromDiscord | <huantian> https://nim-lang.org/docs/db_sqlite.html |
19:31:04 | FromDiscord | <huantian> there's a builtin sqlite wrapper |
19:47:03 | FromDiscord | <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:57 | FromDiscord | <auxym> there's also gulpf/tiny_sqlite |
20:10:31 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4bwH |
20:10:52 | FromDiscord | <Forest [She/Her]> https://media.discordapp.net/attachments/371759389889003532/1024050442449211553/error.nim |
20:11:13 | FromDiscord | <Forest [She/Her]> When serving it statically, i got no issues? |
20:12:48 | FromDiscord | <Forest [She/Her]> By static i mean manually serving the procs |
20:17:02 | * | disso_pch quit (Remote host closed the connection) |
20:19:29 | FromDiscord | <Forest [She/Her]> Uhh i made Nim generate invalid C code |
20:19:39 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4bwO |
20:19:49 | FromDiscord | <Forest [She/Her]> My current code |
20:19:51 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4bwP |
20:21:51 | * | jmdaemon joined #nim |
20:22:38 | FromDiscord | <Forest [She/Her]> How the hell did i make Nim generate invalid code |
20:26:42 | FromDiscord | <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:48 | FromDiscord | <Forest [She/Her]> I'll make a Nim issue |
20:34:18 | FromDiscord | <Phil> First things first, why is it ".html", but only "css"? Why not ".css" ? |
20:36:22 | FromDiscord | <Bung> it's a weird idea that u use dir rec for routing |
20:36:24 | FromDiscord | <Phil> @Forest [She/Her] |
20:37:21 | FromDiscord | <Forest [She/Her]> In reply to @Isofruit "First things first, why": I fixed that after |
20:37:37 | FromDiscord | <Forest [She/Her]> In reply to @Bung "it's a weird idea": How? It explores all files within a folder |
20:38:10 | FromDiscord | <Forest [She/Her]> Current code btw https://hastebin.com/tusadacota.properties |
20:39:19 | FromDiscord | <Bung> the web server function is url -> router -> your asyn proc |
20:39:26 | FromDiscord | <Phil> You're setting up your routes at runtime |
20:39:40 | FromDiscord | <Phil> Hmm |
20:39:46 | FromDiscord | <Forest [She/Her]> Yeah, idk how to make it done at compile time xD |
20:39:55 | FromDiscord | <Forest [She/Her]> But the bug shouldn't happen regardless |
20:39:59 | FromDiscord | <Phil> Wait, nevermind, that's normal, just not that particular way |
20:40:47 | FromDiscord | <Phil> Question, why not just do static file serving with that setup? |
20:41:25 | FromDiscord | <Phil> Since you're pretty much just forwarding the HTML file |
20:41:53 | FromDiscord | <Forest [She/Her]> In reply to @Isofruit "Question, why not just": Wdym? |
20:42:27 | FromDiscord | <Forest [She/Her]> I'm gonna be adding templating later on so |
20:42:40 | FromDiscord | <Bung> nothing stop you duplicate your async proc |
20:42:41 | FromDiscord | <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:10 | FromDiscord | <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:42 | FromDiscord | <Forest [She/Her]> Ah |
20:43:49 | FromDiscord | <Bubblie> In reply to @Isofruit "You may want to": Okay! |
20:43:53 | FromDiscord | <Forest [She/Her]> Yeah but i'm gonna be adding templating to it after |
20:43:54 | FromDiscord | <Bung> u redefine 404 become 500 |
20:44:23 | FromDiscord | <Forest [She/Her]> So i can insert products that are currently being sold without JS |
20:44:39 | FromDiscord | <Phil> In reply to @Event Horizon "Yeah but i'm gonna": Is this without or with database data? |
20:45:00 | FromDiscord | <Forest [She/Her]> Without, the products list is just gonna be a JSON file |
20:45:17 | FromDiscord | <Forest [She/Her]> Unless there's a more ideal way i should do this? |
20:45:30 | FromDiscord | <Phil> I mean, how likely is the JSON to change |
20:45:32 | FromDiscord | <Phil> ? |
20:45:43 | FromDiscord | <Forest [She/Her]> Quite likely, as products are in or out of stock |
20:46:00 | FromDiscord | <Forest [She/Her]> I could make an API and do this with clientside JS, tbf |
20:46:06 | FromDiscord | <Phil> Any specific reason you want to avoid a database? |
20:46:40 | FromDiscord | <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:51 | FromDiscord | <Forest [She/Her]> Besides it's own crappy one |
20:46:52 | FromDiscord | <Phil> Like, it's not mandatory, but generally is just always so nice to have that it's justifiably a default architecture |
20:47:05 | FromDiscord | <Forest [She/Her]> Hm fair |
20:47:35 | FromDiscord | <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:40 | FromDiscord | <Phil> And if its setup that annoys you, sqlite is low setup |
20:47:51 | FromDiscord | <Forest [She/Her]> Oh? I'll look into that then |
20:48:01 | FromDiscord | <Phil> Sqlite is basically a glorified file as a relational database |
20:48:09 | FromDiscord | <huantian> a very glorified file |
20:48:33 | FromDiscord | <Phil> Faster than fopen, has the ability to implement pretty fast Full text search, supports most sql syntax |
20:49:00 | FromDiscord | <Forest [She/Her]> Hm interesting |
20:49:01 | FromDiscord | <Bung> https://planety.github.io/prologue/staticfiles/ prologue documented well |
20:49:26 | FromDiscord | <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:45 | FromDiscord | <Forest [She/Her]> In reply to @Bung "https://planety.github.io/prologue/staticfiles/ pr": Prologue does have nice docs tbh |
20:50:06 | FromDiscord | <Phil> Yeh, flywind did a pretty nice job |
20:50:13 | FromDiscord | <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:29 | FromDiscord | <huantian> sqlite is an actual database! |
20:50:44 | FromDiscord | <Forest [She/Her]> Well, an actual MySQL database :p |
20:51:04 | FromDiscord | <Phil> actually, if you go mysql you can try out mariadb! But yeah I getcha |
20:51:20 | FromDiscord | <Forest [She/Her]> Oh? |
20:51:25 | FromDiscord | <huantian> I didn't know people still used mysql in 2022 đ |
20:51:38 | FromDiscord | <Phil> mariadb is a drop in replacement for mysql to get away from oracle |
20:51:41 | FromDiscord | <Forest [She/Her]> Okay so i'm probably just going to make it render products and stuff clientside haha |
20:51:49 | FromDiscord | <Forest [She/Her]> In reply to @Isofruit "mariadb is a drop": Ah fair enough |
20:52:00 | FromDiscord | <Phil> In reply to @huantian "I didn't know people": Man, is working in an IT company going to blow your mind |
20:52:36 | FromDiscord | <Phil> We had several key core services still on java 8 at the start of the year |
20:52:36 | FromDiscord | <huantian> maybe I should restate my sentence, I didn't know people wanted to use mysql in a new app in 2022 :) |
20:52:39 | FromDiscord | <Forest [She/Her]> I remember last year we had to use MS Access |
20:52:54 | FromDiscord | <Forest [She/Her]> That was horrible to use |
20:53:00 | FromDiscord | <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:20 | FromDiscord | <Phil> In reply to @Event Horizon "I remember last year": I mean... the MS says it all |
20:53:25 | FromDiscord | <Forest [She/Her]> XD |
20:53:55 | FromDiscord | <Phil> But yeah, generally sqlite is one of those small but absolutely incredible pieces of technology |
20:55:38 | FromDiscord | <Forest [She/Her]> Do static files get cached or just resent every request? |
20:55:53 | FromDiscord | <Phil> you mean from the static files middleware? |
20:55:56 | FromDiscord | <Forest [She/Her]> Yup |
20:56:04 | FromDiscord | <Phil> Resent |
20:56:14 | FromDiscord | <Phil> Strictly speaking, that middleware is nothing you should be using in prod |
20:56:27 | FromDiscord | <Horizon [She/Her]> Ah okay then hm |
20:56:30 | FromDiscord | <Phil> Because strictly speaking, static file serving is something your reverse proxy does |
20:56:30 | * | derpydoo quit (Ping timeout: 244 seconds) |
20:56:43 | FromDiscord | <huantian> ^ |
20:56:52 | FromDiscord | <Phil> As in, these requests should never ever be reaching your prologue-application |
20:57:15 | FromDiscord | <Bung> what's a proper error message for this ? https://github.com/nim-lang/Nim/issues/19271 |
20:57:33 | FromDiscord | <Horizon [She/Her]> Would it not be fine to just generate code to generate the routes for me lol? |
20:57:50 | FromDiscord | <Horizon [She/Her]> My system caches the pages so just using that for now is probably simple |
20:58:53 | FromDiscord | <Bung> there's wildcard route or directory based route |
20:59:20 | FromDiscord | <Horizon [She/Her]> Oh? I'd like to do directory based route if possible |
20:59:45 | FromDiscord | <Bung> so read the prologue document |
21:00:15 | FromDiscord | <Horizon [She/Her]> Reading it rn |
21:00:24 | FromDiscord | <Horizon [She/Her]> When you said that it exists |
21:04:08 | FromDiscord | <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:41 | FromDiscord | <Phil> You can do regex for url params, there's also other ways but I prefer regex |
21:06:40 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4bwZ |
21:07:06 | FromDiscord | <Phil> ignore the handler, the key part is the first bit that is the url |
21:09:37 | FromDiscord | <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:45 | FromDiscord | <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:09 | FromDiscord | <Horizon [She/Her]> In reply to @Isofruit "You can do regex": Ah |
21:11:41 | FromDiscord | <Horizon [She/Her]> I'd need the full URL path |
21:11:52 | FromDiscord | <Horizon [She/Her]> So `/css/index.css` would also be given to me |
21:24:14 | * | disso_peach joined #nim |
21:28:54 | FromDiscord | <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:07 | FromDiscord | <Mrcool> is <https://github.com/nim-lang/langserver> the recommend lsp or nimlsp ? |
22:19:01 | FromDiscord | <Mrcool> nvm langserver doesn't even seem to build |
22:19:27 | FromDiscord | <Mrcool> is there a recommend way to get tests coverage? |
22:44:59 | FromDiscord | <Elegantbeef> It needs 1.7.1 or 1.6.8(though this isnt released fully iirc)â”(@Mrcool) |
22:45:59 | FromDiscord | <Mrcool> any links on how to use it? |
22:46:25 | FromDiscord | <Elegantbeef> Whoops wrong reply |
22:46:25 | FromDiscord | <Elegantbeef> that was to nimlangserver |
22:47:43 | FromDiscord | <Mrcool> I have nim 1.7.1 |
22:48:00 | FromDiscord | <Mrcool> I'll try nim dev |
22:49:07 | FromDiscord | <Mrcool> ah wait 1.7.1 is dev xD |
22:49:20 | FromDiscord | <Mrcool> https://media.discordapp.net/attachments/371759389889003532/1024090320725618728/unknown.png |
22:50:36 | FromDiscord | <Mrcool> I guess thats an easy fix, lets see if it thats the only issue |
22:52:14 | FromDiscord | <Mrcool> cool thats the only error |
22:53:46 | FromDiscord | <Mrcool> i'm impressed that the lsp ddin't crash when opening langersever.nim file |
22:54:11 | FromDiscord | <Mrcool> my 60 lines files kills it usually <https://github.com/sigmaSd/deno-nim/blob/master/src/deno_nim.nim> |
22:54:22 | FromDiscord | <Mrcool> (edit) "files" => "file" |
22:54:49 | FromDiscord | <Mrcool> maybe the js backend makes the lsp even more unstable |
23:02:06 | FromDiscord | <demotomohiro> sent a long message, see http://ix.io/4bxo |
23:04:08 | FromDiscord | <Patitotective> lmao |
23:04:59 | FromDiscord | <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:31 | FromDiscord | <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:27 | FromDiscord | <demotomohiro> Point is, if you generate a password longer than 16 charactors, it doesn't stronger than 16 charactors. |
23:10:53 | FromDiscord | <demotomohiro> If attacker know how password is generated, passwords longer than 16 chars does not make cracking password harder. |
23:18:19 | FromDiscord | <auxym> if attacker knows how password is generated and the state of the RNG at password generation time |
23:22:12 | FromDiscord | <Mrcool> is there amethod to print to stderr |
23:22:15 | FromDiscord | <Mrcool> (edit) "amethod" => "a method" |
23:23:15 | FromDiscord | <auxym> `stderr.write` |
23:27:35 | FromDiscord | <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:05 | FromDiscord | <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:37 | FromDiscord | <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:45 | FromDiscord | <Girvo> New clients can connect no worries |
23:48:50 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4bxr |
23:49:42 | FromDiscord | <Girvo> Restarting the server allows the existing clients to begin connecting again properly |
23:54:43 | FromDiscord | <Girvo> `isClosed` doesn't exist on `Socket` from `std/net` right? |
23:55:56 | FromDiscord | <Girvo> Guess this needs to be refactored onto asyncnet. Annoying. |
23:57:02 | FromDiscord | <Patitotective> currently is there a way to use same fields for different branches? https://github.com/nim-lang/RFCs/issues/368 |
23:57:55 | FromDiscord | <Generic> no |