00:07:08 | FromDiscord | <Elegantbeef> The line it warns on is not very sensible either |
00:07:09 | FromDiscord | <Robyn [She/Her]> Don't wanna ping Anuken but if he happens to be here: https://github.com/Anuken/fau/blob/master/src/fau/audio.nim#L19↵↵You can do `import module except Type` and then do `from module import Type as AnotherName` |
00:07:46 | FromDiscord | <Elegantbeef> Or y'know just `ptr MyModule.EchoFilter` 😄 |
00:08:44 | FromDiscord | <Robyn [She/Her]> That's also a thing |
00:09:27 | FromDiscord | <Elegantbeef> Oh Phil I think I see the reason for the data race |
00:09:28 | FromDiscord | <Elegantbeef> `isFull` is called before a lock happens |
00:09:51 | FromDiscord | <Phil> I shall write that in the threading issue I opened because of this |
00:09:59 | FromDiscord | <Phil> Because I! Want! Threadsafety! |
00:10:58 | FromDiscord | <Elegantbeef> Changing to `send` and `recv` removes it |
00:11:15 | FromDiscord | <Elegantbeef> So I figure this is a false positive due to the design of `try` |
00:11:18 | FromDiscord | <Robyn [She/Her]> General convention is newType is for heap, and initType is for stack, right? In the stdlib |
00:11:40 | FromDiscord | <Elegantbeef> They're awful conventions to put the type in the proc name, but yes |
00:12:14 | FromDiscord | <Phil> While that is true, `new(t: typedesc[yourtype])` makes far more sense imo |
00:12:21 | FromDiscord | <Phil> Which is what I tend to use |
00:12:50 | FromDiscord | <Robyn [She/Her]> Would it be rude to ping Anuke with minor suggestions of me going through his code? |
00:13:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
00:13:14 | FromDiscord | <Robyn [She/Her]> I was gonna do that but I feel like this may seem rude, and I do not understand social norms so |
00:13:18 | FromDiscord | <Elegantbeef> I mean you could |
00:13:30 | FromDiscord | <Elegantbeef> I've pinged people for their code 😛 |
00:13:46 | FromDiscord | <Elegantbeef> Could also just make a PR if you really wanted to |
00:14:34 | FromDiscord | <Robyn [She/Her]> Fair |
00:14:41 | FromDiscord | <Robyn [She/Her]> Hm... |
00:14:52 | FromDiscord | <Robyn [She/Her]> I can't test any code atm so I won't |
00:15:12 | FromDiscord | <Robyn [She/Her]> I am interested in the game framework he's making for Nim tho |
00:15:36 | FromDiscord | <Elegantbeef> Phil i'm like 90% certain that sanitiser is mad about nothing in this case |
00:15:42 | FromDiscord | <Elegantbeef> It's just the design of the channel |
00:16:19 | FromDiscord | <Elegantbeef> To answer your question, changing that to use the lock before accessing `isFull` makes `try` blocking |
00:17:16 | FromDiscord | <Elegantbeef> A possible solution might be to use `Atomic[int]` for slots, head, tail. My ignorance says there is no issue here though |
00:19:15 | FromDiscord | <Elegantbeef> Hmm actually in the case of a race you might block until you can send |
00:22:10 | FromDiscord | <Elegantbeef> On second though there is a check after for when not blocking to exit, so seems it very much is a non problem |
00:22:15 | FromDiscord | <Elegantbeef> thought\ |
00:23:10 | FromDiscord | <Elegantbeef> Someone with a brain required though |
01:02:10 | * | azimut quit (Remote host closed the connection) |
01:02:33 | * | azimut joined #nim |
01:03:59 | FromDiscord | <leorize> the solution here is to try-acquire that lock \:P |
01:06:44 | FromDiscord | <leorize> or just get rid of that `if` in the first place |
01:13:59 | FromDiscord | <Elegantbeef> Yea that makes a lot more sense |
01:14:02 | * | jmdaemon joined #nim |
01:42:14 | FromDiscord | <Robyn [She/Her]> Where's a place that I'd use SIMD in? What type of projects does it benefit? |
01:42:48 | FromDiscord | <Elegantbeef> Anything that simd can accelerate |
01:42:49 | FromDiscord | <Elegantbeef> 😛 |
01:43:09 | FromDiscord | <Robyn [She/Her]> Yes, what can it accelerate? I don't know what SIMD is used for specifically- |
01:43:18 | FromDiscord | <Elegantbeef> Go read the extensions |
01:43:23 | FromDiscord | <auxym> anything that needs to things fast by doing the same thing on a large array of ints, or something like that |
01:43:26 | FromDiscord | <Elegantbeef> The extensions are specifically made for certain goals |
01:43:30 | FromDiscord | <Robyn [She/Her]> Those are wordy 😭 |
01:43:45 | FromDiscord | <Elegantbeef> Anything that needs to be done fast that the extensions can aid you in |
01:43:56 | FromDiscord | <Elegantbeef> You can use it for speeding up string searching for instance |
01:43:57 | FromDiscord | <Robyn [She/Her]> In reply to @auxym "anything that needs to": Oh so that's why simd json is a thing and is fast |
01:44:20 | FromDiscord | <Elegantbeef> You're limited by the operations and registers, so ... it depends |
01:44:38 | FromDiscord | <Elegantbeef> You cannot explain what simd can speed up cause there are like 30 different extensions |
01:44:44 | FromDiscord | <auxym> sent a long message, see <!doctype html> |
01:45:50 | FromDiscord | <Robyn [She/Her]> Ah |
01:47:07 | FromDiscord | <Elegantbeef> More modern extensions are aimed at speeding up common float operations for streaming and video encoding |
01:47:49 | FromDiscord | <Elegantbeef> 512bit registers and all |
01:49:15 | FromDiscord | <Robyn [She/Her]> Fair |
01:49:23 | FromDiscord | <Robyn [She/Her]> I think I heard about that |
03:25:08 | * | flouer__ quit (Remote host closed the connection) |
03:25:25 | * | flouer_ joined #nim |
03:29:27 | * | flouer joined #nim |
03:29:36 | * | flouer_ quit (Remote host closed the connection) |
03:35:43 | * | azimut quit (Ping timeout: 240 seconds) |
03:37:24 | * | disso-peach joined #nim |
04:17:27 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1193045637101519009/image.png?ex=65ab4955&is=6598d455&hm=134fe8cd2eb604083c733060e43a7f5060bff6e5eb7ca92ec7fe1a9039866ada& |
04:17:27 | FromDiscord | <albassort> these all suck |
04:17:30 | FromDiscord | <albassort> besides asciigraph |
04:17:53 | FromDiscord | <Elegantbeef> y'know |
04:19:43 | FromDiscord | <albassort> what do i know |
04:19:53 | FromDiscord | <Elegantbeef> No clue |
04:20:01 | FromDiscord | <Elegantbeef> You just say they all suck without elaboration |
04:20:26 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=html> |
04:20:39 | FromDiscord | <Elegantbeef> Time to write a macro around it 😛 |
04:20:58 | FromDiscord | <albassort> no its not my fault the guy wont maintain matplotnim |
04:21:11 | FromDiscord | <Elegantbeef> Uh hu |
04:21:19 | FromDiscord | <Elegantbeef> I love people bitching about things they can change |
04:21:55 | FromDiscord | <albassort> you know im incompetent |
04:22:08 | FromDiscord | <␀ Array 🇵🇸 🍉> what is "coherent noise" supposed to mean?↵(@auxym) |
04:22:18 | FromDiscord | <Elegantbeef> Well best way to get better iss to do |
04:22:25 | FromDiscord | <␀ Array 🇵🇸 🍉> kind of an oxymoron |
04:22:36 | FromDiscord | <Robyn [She/Her]> In reply to @␀ Array 🇵🇸 🍉 "what is "coherent noise"": Stuff suitable for world generation perhaps? |
04:22:59 | FromDiscord | <␀ Array 🇵🇸 🍉> i guess?↵(@Robyn [She/Her]) |
04:23:12 | FromDiscord | <albassort> coherency in noise is when the noise isn't actually completely noise |
04:23:14 | FromDiscord | <albassort> its not white nosie |
04:23:15 | FromDiscord | <albassort> (edit) "nosie" => "noise" |
04:23:27 | FromDiscord | <albassort> it has a use that isn't pure randomness |
04:23:30 | FromDiscord | <Robyn [She/Her]> Since I'd imagine generating a bunch of random pixels and using that as a world map isn't exactly great |
04:23:40 | FromDiscord | <Robyn [She/Her]> In reply to @albassort "it has a use": Makes sense |
05:21:48 | * | disso-peach quit (Quit: Leaving) |
06:22:47 | FromDiscord | <Robyn [She/Her]> I really need a small project I'd actually complete ngl |
06:24:00 | FromDiscord | <ntzeno> In reply to @chronos.vitaqua "I really need a": you could think of making nim code for reading and writing MC NBT datas ? yes theres library for it, but it's project you can do nonetheless |
06:24:10 | FromDiscord | <Robyn [She/Her]> Oh fellow transfem who listens to Jagwar Twins |
06:24:15 | FromDiscord | <ntzeno> (edit) "In reply to @chronos.vitaqua "I really need a": you could think of making nim code for reading and writing MC NBT datas ? yes theres library for it, but it's ... project" added "a" |
06:24:35 | FromDiscord | <ntzeno> aye, i don't know who jagwar twins is though |
06:24:35 | FromDiscord | <Robyn [She/Her]> In reply to @ntzeno "you could think of": To be fair I was planning on it, since I already have a library for parsing MC network data (though, it doesn't wrap anything into packets) |
06:24:39 | FromDiscord | <Robyn [She/Her]> (edit) "Twins" => "Twin" |
06:25:07 | FromDiscord | <Robyn [She/Her]> In reply to @ntzeno "aye, i don't know": Oh I just assumed that the words in your bio was from his song aha |
06:25:25 | FromDiscord | <ntzeno> oh, it's from that person ? i see, ty |
06:25:31 | FromDiscord | <ntzeno> i just copied it straight from nightcore :P |
06:26:00 | FromDiscord | <ntzeno> In reply to @chronos.vitaqua "To be fair I": go for it then, girl |
06:26:11 | FromDiscord | <Robyn [She/Her]> In reply to @ntzeno "i just copied it": Fair aha |
06:26:29 | FromDiscord | <Robyn [She/Her]> In reply to @ntzeno "go for it then,": Hell yeah! I'll probably do it once I'm back at my PC |
06:26:34 | FromDiscord | <ntzeno> aye |
06:26:37 | FromDiscord | <Robyn [She/Her]> Adios for now, I'm gonna get some sleep |
06:26:43 | FromDiscord | <ntzeno> good night |
06:27:12 | FromDiscord | <Robyn [She/Her]> Night! |
06:39:42 | * | deadmarshal_ quit (Ping timeout: 260 seconds) |
06:55:58 | * | rockcavera quit (Remote host closed the connection) |
07:00:02 | * | om3ga quit (Ping timeout: 252 seconds) |
07:01:59 | * | deadmarshal_ joined #nim |
07:26:10 | FromDiscord | <Phil> In reply to @leorize "the solution here is": Added the suggestion to the issue of threading |
07:27:26 | FromDiscord | <Phil> (edit) "of" => "I opened in the" | "I opened in thethreading ... " added "repo" |
07:36:21 | * | ehmry joined #nim |
07:40:28 | * | lucerne quit (Ping timeout: 276 seconds) |
07:49:52 | FromDiscord | <4zv4l> they are slightly different, but is there any reason why the `nim` one goes much faster than the `c` one ? https://media.discordapp.net/attachments/371759389889003532/1193099097478021160/client.nim?ex=65ab7b1f&is=6599061f&hm=0dd93f91f369aec5098f0a61126b8ca1904ef51c0e46a8dca724cbfbb6de154f& https://media.discordapp.net/attachments/371759389889003532/1193099097910038578/client.c?ex=65ab7b1f&is=6599061f&hm=fc28e37654d97943adf48cc533560f58e3e7a |
07:51:03 | FromDiscord | <4zv4l> for example if the server send the md5 hash of `ccbbb` nim takes `11,660s` and `c` takes `31,033s` |
07:51:56 | * | om3ga joined #nim |
07:52:20 | FromDiscord | <Elegantbeef> Profile |
07:52:59 | FromDiscord | <4zv4l> profile ? |
07:53:04 | FromDiscord | <odexine> do profiling |
07:53:07 | FromDiscord | <Elegantbeef> Profile it |
07:56:20 | FromDiscord | <huantian> but that's so much work |
07:58:21 | FromDiscord | <4zv4l> thats for the C one https://media.discordapp.net/attachments/371759389889003532/1193101232852705330/prof_output.txt?ex=65ab7d1c&is=6599081c&hm=28272297ea298aa248bdeb2f8e7ac3b610a46a3c4a0d10bae2393c17503bca43& |
07:58:36 | FromDiscord | <4zv4l> for Nim I tried `--passC=-pg` but it didnt make the output |
07:59:26 | FromDiscord | <4zv4l> `30033236` calls to md5check seems a lot |
08:00:06 | FromDiscord | <4zv4l> but possible |
08:00:07 | FromDiscord | <4zv4l> xD |
08:01:51 | FromDiscord | <4zv4l> trying with `--profiler:on` |
08:02:09 | FromDiscord | <Elegantbeef> Just use a C profiler with `--debugger:native` |
08:06:00 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "To be fair I": nim need nbt simd parser |
08:37:49 | * | deadmarshal_ quit (Ping timeout: 260 seconds) |
10:05:23 | FromDiscord | <4zv4l> In reply to @Elegantbeef "Just use a C": Any profiler to recommend ? I never really used one. Except the -pg which generates a file gprof |
10:10:11 | FromDiscord | <Elegantbeef> cachegrind is ok, perf is good |
10:10:24 | FromDiscord | <Elegantbeef> perf + flamegraph is pretty nice |
10:10:35 | FromDiscord | <Elegantbeef> whoops callgrind not cachegrind |
10:25:08 | * | lucerne joined #nim |
11:47:25 | FromDiscord | <fosster> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:48:27 | FromDiscord | <Phil (he/him)> How do you borrow? |
11:48:39 | FromDiscord | <fosster> like this\:↵`proc `<`(a, b: Number): bool {.borrow.} proc `>`(a, b: Number): bool {.borrow.} proc `<=`(a, b: Number): bool {.borrow.} proc `>=`(a, b: Number): bool {.borrow.} proc `==`(a, b: Number): bool {.borrow.} proc `!=`(a, b: Number): bool {.borrow.}` |
11:48:45 | FromDiscord | <Phil (he/him)> As in, what does the line of code look like |
11:48:54 | FromDiscord | <fosster> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1193159191003672670): like this\:↵↵\`\`\`proc `<`\(a, b\: Number)\: bool {.borrow.}proc `>`\(a, b\: Number)\: bool {.borrow.}proc `<=`\(a, b\: Number)\: bool {.borrow.}proc `>=`\(a, b\: Number)\: bool {.borrow.}proc `==`\(a, b\: Number)\: bool {.borrow.}proc `!=`\(a, b\: Number)\: bool {.borrow.}\`\`\` |
11:49:08 | FromDiscord | <fosster> sorry for the format fucked up |
11:49:57 | FromDiscord | <fosster> where `type Number = distinct float` |
11:52:49 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:53:29 | FromDiscord | <fosster> alright let me try this out in a while! |
11:53:33 | FromDiscord | <Phil> `==` will be used to figure out `!=`↵`>` is used to figure out `<`↵`>=` is used to figure out `<=` |
11:55:23 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:55:37 | FromDiscord | <ambient3332> Chaing the last line += to = removes the bug |
11:55:52 | FromDiscord | <ambient3332> (edit) |
11:55:53 | FromDiscord | <Phil> Question, fundamentally, what is a mutex? |
11:56:15 | FromDiscord | <ambient3332> (edit) "Chaing" => "Changing" |
11:57:44 | FromDiscord | <Phil> Is a mutex just the concept of a lock? |
12:00:50 | FromDiscord | <odexine> In reply to @isofruit "Is a mutex just": I guess? I forget exactly what locks are in a more formal definition but mutexes are formally defined as semaphores with a value of 1 IIRC |
12:01:30 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=html> |
12:01:37 | FromDiscord | <ambient3332> This fixes the bug but the sound is distorted |
12:02:11 | FromDiscord | <ambient3332> I have no idea what is going on 😓 |
12:07:04 | * | azimut joined #nim |
12:25:54 | FromDiscord | <ambient3332> Yeah, audioCallback will run asynchronously... |
12:31:02 | FromDiscord | <ambient3332> race condition from behind 😵💫 |
12:34:47 | FromDiscord | <fosster> wtf it worked! thank you very much!↵(@Phil) |
12:35:12 | FromDiscord | <fosster> are you creating some sort of sound synthetizer?↵(@ambient3332) |
12:35:31 | FromDiscord | <ambient3332> Yeah just playing around with some simple sine pings and keyboard |
12:35:37 | FromDiscord | <ambient3332> maybe karplus strong and reverb later |
12:40:27 | * | PMunch joined #nim |
12:49:15 | FromDiscord | <fosster> cool, that's what I tried to do once in C |
12:49:36 | FromDiscord | <Phil (he/him)> Happy to have helped |
12:49:38 | FromDiscord | <fosster> now I'm writing an interpreter in Nim that generates music out of lisp code |
12:56:10 | FromDiscord | <ambient3332> Separating keyboard input to synth and visual presentation is a bit more complex... |
12:56:18 | FromDiscord | <ambient3332> Nim GC complains to me then I try to make a keyboard polling thread |
12:57:58 | PMunch | What exactly is it complaining about? |
12:58:54 | FromDiscord | <ambient3332> https://github.com/amb/nim-synth/blob/main/main.nim the addSynth part in the keyboardReadingThread |
13:00:21 | FromDiscord | <ambient3332> Warning: 'addSynth' is not GC-safe as it accesses 'audioEngine' which is a global using GC'ed memory [GcUnsafe2] |
13:00:26 | FromDiscord | <ambient3332> Error: 'keyboardReadingThread' is not GC-safe as it calls 'addSynth' |
13:04:49 | PMunch | Right, the addSynth touches some global variable so it can't safely be shared |
13:06:39 | FromDiscord | <ambient3332> I could just put locks around it but don't know quite how |
13:07:26 | FromDiscord | <ambient3332> And if that would even fix GC issues |
13:10:21 | FromDiscord | <ambient3332> The complexity of both threads and GC |
13:10:51 | PMunch | It wouldn't fix the GC issues |
13:11:00 | PMunch | Well, it wouldn't let the compiler know they where fixed at least |
13:11:47 | FromDiscord | <Phil (he/him)> Is there a way to "steal" a ref value from the place it was called? "sink" does not appear to be doing it |
13:14:49 | FromDiscord | <Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html> |
13:16:04 | FromDiscord | <Phil (he/him)> Ah, the solution is to make it a "var" so that wasMoved nil's it |
13:18:25 | * | jmdaemon quit (Ping timeout: 246 seconds) |
13:24:08 | PMunch | `var sink auto`? |
13:24:35 | FromDiscord | <whisperecean> I am using the most popular nim extension on vs code but I dont understand the build on save |
13:24:39 | FromDiscord | <whisperecean> is that preconfigured or not? |
13:24:54 | FromDiscord | <whisperecean> It opens tasks but I dont have a build task defined |
13:31:00 | FromDiscord | <whisperecean> hmm nvm its not predefined I had to define it |
13:34:30 | FromDiscord | <Phil> In reply to @PMunch "`var sink auto`?": sink var auto |
13:39:42 | PMunch | Ah right |
13:52:27 | FromDiscord | <whisperecean> Does anybody have a good recent cheat sheet for Nim features and patterns? |
13:54:03 | FromDiscord | <fosster> are you writing a binary program or a library? bc if it's a library, I'd really need one since I could not find any suitable synth library↵(@whisperecean) |
13:54:11 | FromDiscord | <ezquerra> In reply to @whisperecean "I am using the": You should not use that extension. Look for the official one called “nim-lang.org” |
13:56:33 | FromDiscord | <whisperecean> @enthus1ast I am getting CC: campaign_check.nim↵/bin/sh: zigcc: command not found↵Error: execution of an external compiler program 'zigcc -c -w -ferror-limit=3 -pthread -O3 from ur zigcc package |
13:56:40 | FromDiscord | <whisperecean> I onl have zig cc not zigcc. |
13:57:08 | FromDiscord | <whisperecean> In reply to @ezquerra "You should not use": Why? |
13:58:14 | FromDiscord | <ezquerra> The most popular one hasn’t been updated in a very long time. There is a new official extension that is supported by the nim development team |
13:59:01 | FromDiscord | <drunkenalcoholic> @ezquerra maybe they need to update the instructions on the git-hub to say "nim-lang-org" instead of "Nim" when installing the extention for VSCode |
13:59:55 | FromDiscord | <whisperecean> Ah ok I get it. I did not have nimble bin in my path. |
14:00:54 | PMunch | @whisperecean, https://nim-by-example.github.io/ is pretty good, and https://scripter.co/notes/nim |
14:01:01 | PMunch | Not sure if they are 100% up to date though |
14:02:06 | * | deadmarshal_ joined #nim |
14:02:33 | FromDiscord | <whisperecean> Thanks! |
14:10:34 | * | ehmry is now known as emery |
14:10:42 | * | emery is now known as ehmry |
14:22:19 | FromDiscord | <Robyn [She/Her]> In reply to @griffith1deadly "nim need nbt simd": Doesn't seem simple :p |
14:27:28 | * | xet7 joined #nim |
15:18:42 | * | rockcavera joined #nim |
15:35:43 | * | azimut quit (Ping timeout: 240 seconds) |
15:51:34 | FromDiscord | <whisperecean> Does anybody know how in Norm i can represent nullable field? |
16:37:31 | FromDiscord | <sOkam! 🫐> sent a long message, see <!doctype html> |
16:45:58 | FromDiscord | <Robyn [She/Her]> In reply to @whisperecean "<@719962937095356507> I am getting": Make sure `.nimble/bin` is in the PATH |
16:49:58 | * | rockcavera quit (Remote host closed the connection) |
16:50:17 | * | rockcavera joined #nim |
16:53:38 | FromDiscord | <kiloneie> Is pure pragma implicit on enums ?(from searching on information about it, it looks like you required it in order to write enumeration instead of Enumerator.enumeration) |
16:53:58 | Amun-Ra | nope |
16:54:31 | Amun-Ra | without pure pragma you can write both ways, Type.value or value |
16:55:50 | FromDiscord | <kiloneie> sent a long message, see <!doctype html> |
16:56:56 | Amun-Ra | long discord messages do not travel to irc land |
16:57:15 | FromDiscord | <kiloneie> https://www.reddit.com/r/nim/comments/cxbidq/could_someone_explain_pure/ |
16:57:20 | FromDiscord | <kiloneie> https://nim-by-example.github.io/types/enums/ |
16:57:33 | FromDiscord | <kiloneie> Both of these say this didn't use to be the case. |
16:57:40 | FromDiscord | <kiloneie> whats the irc limit ? |
16:57:54 | Amun-Ra | pure pragma makes writing type name required |
16:58:59 | Amun-Ra | type Foo {.pure.} = bar, baz; `let x = bar` is an error |
16:59:23 | Amun-Ra | type Foo {.pure.} = enum: bar, baz; `let x = bar` is an error |
17:01:50 | Amun-Ra | https://dpaste.com/6DBMJFZER |
17:02:51 | FromDiscord | <kiloneie> im getting no such errors... |
17:03:30 | FromDiscord | <kiloneie> also playground is broken |
17:03:42 | FromDiscord | <kiloneie> the share part |
17:04:09 | FromDiscord | <kiloneie> i am on 2.0.0, need to update |
17:05:31 | Amun-Ra | my example was bad |
17:05:58 | FromDiscord | <whisperecean> How can I convert int to a DateTime object? |
17:06:19 | Amun-Ra | kiloneie: https://nim-lang.org/docs/manual.html#types-enumeration-types |
17:07:25 | Amun-Ra | I've never used pure enums in my code and forgot it's about enum name clash |
17:07:58 | Amun-Ra | whisperecean: .fromUnix? |
17:08:09 | Amun-Ra | https://nim-lang.org/docs/times.html#fromUnix%2Cint64 |
17:08:23 | FromDiscord | <whisperecean> That gives a Time object |
17:08:24 | Amun-Ra | ah, it's Time |
17:08:46 | FromDiscord | <bigcatnova> are there any straight-forward ways of statically linking openssl when using httpclient? or is there an alternative module i can use which is statically linked already |
17:09:03 | FromDiscord | <bigcatnova> i feel like ive tried everything, still doesnt work "could not load: (libcrypto-1_1-x64).dll" |
17:09:08 | Amun-Ra | whisperecean: 1.toUnix.utc or 1.toUnix.local |
17:09:16 | Amun-Ra | https://nim-lang.org/docs/times.html#utc%2CTime |
17:10:14 | Amun-Ra | do you have that dll in path? |
17:11:21 | FromDiscord | <whisperecean> Yay that works! |
17:11:22 | FromDiscord | <whisperecean> Thanks |
17:11:44 | Amun-Ra | great :) |
17:12:23 | FromDiscord | <kiloneie> In reply to @Amun-Ra "<@398205119583485964>: https://nim-lang.org/docs/ma": Thanks, i missed the ambigious part... |
17:12:32 | FromDiscord | <leorize> add `--dynlibOverride:crypto --dynlibOverride:ssl` and you can link statically using `--passL`↵(@bigcatnova) |
17:13:04 | FromDiscord | <bigcatnova> In reply to @leorize "add `--dynlibOverride:crypto --dynlibOverride:ssl` ": yup tried it, still get the same error |
17:13:30 | FromDiscord | <leorize> you can go nuclear with `--dynlibOverrideAll` then |
17:13:44 | FromDiscord | <bigcatnova> In reply to @leorize "you can go nuclear": any side effects i should expect? |
17:14:13 | FromDiscord | <leorize> it'd expose every libraries that is used by your program |
17:14:26 | FromDiscord | <leorize> but since you're aiming to static link it might be what you want |
17:14:46 | FromDiscord | <bigcatnova> ok forget that |
17:14:51 | FromDiscord | <bigcatnova> ill just look for an alternative module i guess |
17:15:04 | FromDiscord | <leorize> typically it's ssl and pcre that's in a jim program |
17:15:13 | FromDiscord | <leorize> there's no alternative fwiw |
17:15:29 | FromDiscord | <leorize> nim, even |
17:16:17 | FromDiscord | <odexine> jim program hahaha |
17:17:00 | FromDiscord | <leorize> autocorrect is ass \:p |
17:19:02 | * | azimut joined #nim |
17:19:44 | FromDiscord | <bigcatnova> what about httpbeast |
17:21:53 | FromDiscord | <leorize> httpbeast is a http server |
17:21:56 | FromDiscord | <leorize> one that doesn't even support ssl to begin with |
17:22:04 | FromDiscord | <odexine> hey dont beat me to the punch |
17:22:57 | Amun-Ra | turn autocorrection off, own your mistakes ;) |
17:23:06 | FromDiscord | <bigcatnova> i just need to download a file from url |
17:23:26 | FromDiscord | <leorize> if you're looking to statically link, just use `--dynlibOverrideAll` |
17:23:42 | FromDiscord | <bigcatnova> is that not unsafe though |
17:24:02 | FromDiscord | <leorize> it's actually safer than the dlopen mess nim uses |
17:24:46 | FromDiscord | <bigcatnova> i tried using `--dynlibOverrideAll` but i just get a huge error log that i cant even read |
17:25:35 | Amun-Ra | bc you have to feed the compiler with all thr required libs yourself |
17:25:59 | FromDiscord | <leorize> yea because now you gotta add your static linking flags |
17:26:24 | FromDiscord | <leorize> in your case it should just be the flags for libssl and libcrypto |
17:26:29 | FromDiscord | <bigcatnova> yea well nothing works its all outdated |
17:26:36 | FromDiscord | <bigcatnova> pretty much everything i read says different stuff |
17:26:43 | Amun-Ra | leorize: wait, nim uses dlopen with -d=ssl? it shouldn't |
17:27:13 | FromDiscord | <leorize> anything `{.dynlib: x.}` uses dlopen |
17:27:32 | FromDiscord | <leorize> nim has an allergy to using the os dynamic linker |
17:28:05 | FromDiscord | <leorize> tl;dr\: araq don't like installing `libx-dev` packages |
17:29:00 | Amun-Ra | I just ldd'ed tssl.nim from tests suite and you're right |
17:29:14 | Amun-Ra | tbh I use dlopen for all my library wrappers |
17:29:33 | FromDiscord | <leorize> the nim missing library message is different from the typical stuff because it doesn't use the dynamic linker |
17:29:35 | Amun-Ra | via my dynlib utils (dlutils package) |
17:30:26 | FromDiscord | <whisperecean> how do I use this when I see stuff like this in libraries? |
17:30:27 | FromDiscord | <whisperecean> proc `$`(uuid: UUID): string |
17:30:30 | FromDiscord | <leorize> I'd prefer that dlopen usage be explicit, they mess up with too many tools |
17:30:56 | ehmry | yea, dlopen is fucked, I patch my compiler to not do that |
17:31:17 | FromDiscord | <whisperecean> initUUID returns UUID and has this $ to convert uuid to string but how do I use it? |
17:31:29 | FromDiscord | <leorize> `$uuid` |
17:31:43 | FromDiscord | <leorize> it's a prefix operator |
17:31:58 | FromDiscord | <whisperecean> but how do I call it on a function? |
17:32:06 | Amun-Ra | $foo() |
17:32:19 | FromDiscord | <whisperecean> when I have newUser(uuid = initUUID()) |
17:32:33 | Amun-Ra | and uuid must be string? |
17:32:40 | FromDiscord | <whisperecean> yes for sqlite |
17:32:48 | Amun-Ra | uuid = $initUUID() |
17:32:48 | FromDiscord | <leorize> `$initUUID()` |
17:33:08 | FromDiscord | <whisperecean> that does not work 😦 |
17:33:39 | FromDiscord | <leorize> how does it not work? |
17:33:54 | FromDiscord | <whisperecean> i am using this https://github.com/pragmagic/uuids |
17:33:55 | FromDiscord | <whisperecean> sent a long message, see <!doctype html> |
17:34:42 | Amun-Ra | there's no `$` defined for UUID |
17:35:03 | Amun-Ra | (or I'm blind) |
17:35:21 | Amun-Ra | https://github.com/pragmagic/uuids/blob/master/uuids.nim#L117-L118 |
17:35:23 | Amun-Ra | I think I am |
17:36:28 | FromDiscord | <odexine> `initUUID` needs parameters |
17:37:16 | FromDiscord | <whisperecean> am dumb right! |
17:37:31 | FromDiscord | <whisperecean> $genUUID works |
17:38:55 | FromDiscord | <mengu> sent a code paste, see https://play.nim-lang.org/#ix=html> |
17:39:46 | FromDiscord | <mengu> how do I fix that? |
17:40:08 | FromDiscord | <mengu> (edit) "how do I fix that? ... " added "my nim version: `Nim Compiler Version 2.0.2 [MacOSX: arm64]`" |
17:40:23 | FromDiscord | <whisperecean> Error: for --gc:arc|orc 'deepcopy' support has to be enabled with --deepcopy:on. I can do that but how can I find out which thing triggered deepcopy? |
17:40:28 | Amun-Ra | are these code pastes on discord inline? |
17:40:54 | FromDiscord | <leorize> and this is why we hate funcs in nim \:p |
17:41:27 | FromDiscord | <leorize> you kinda just grep your way through |
17:41:42 | * | mengu1 joined #nim |
17:42:56 | FromDiscord | <leorize> make your `==` proc a func and it might work↵(@mengu) |
17:43:34 | FromDiscord | <leorize> side effects evaluation quality really went downhill |
17:44:14 | FromDiscord | <whisperecean> so would none DateTime represent NULL-able DateTime field? |
17:44:21 | FromDiscord | <whisperecean> none comes from Options |
17:44:35 | FromDiscord | <leorize> are you using norm? |
17:44:58 | FromDiscord | <whisperecean> yes! |
17:45:10 | * | mengu1 quit (Client Quit) |
17:49:53 | FromDiscord | <leorize> then yes, none is null |
17:54:23 | FromDiscord | <whisperecean> thanks! |
17:57:19 | FromDiscord | <whisperecean> Does anyone know how to fix this? https://github.com/soasme/nim-schedules/issues/19 |
17:57:24 | FromDiscord | <whisperecean> Or the library needs to be fixed? |
18:00:31 | FromDiscord | <leorize> could be both |
18:00:49 | FromDiscord | <leorize> a lot of macros have bad lineinfo management so it might show issues with your code pointing to the library |
18:18:39 | NimEventer | New Nimble package! taggy - Everything to do with HTML and XML, see https://github.com/treeform/taggy |
18:22:53 | FromDiscord | <whisperecean> Does anybody know of any alternative? |
18:23:04 | FromDiscord | <whisperecean> Just want to execute my program cron style |
18:23:55 | FromDiscord | <leorize> then shouldn't you use crontab? \:p |
18:25:09 | FromDiscord | <mengu> In reply to @leorize "make your `==` proc": that went worse 😄 `func` is `proc` without side effects, right? is it essentially proc labeled with `{.noSideEffect.}`? anyways, now the compiler is complaining about both the list and the dict |
18:25:37 | FromDiscord | <leorize> it is |
18:26:52 | FromDiscord | <leorize> actually I'm not sure about the status of strictFuncs so you might want to try `proc {.nosideeffects.}` |
18:27:09 | FromDiscord | <mengu> I've tried that one as well, did not work because of the `hasKey` call |
18:27:56 | FromDiscord | <mengu> but assuming dict == dict would return the real result, no need to compare with keys & len etc, so I switched to `a.d == b.d` and it worked |
18:28:49 | FromDiscord | <mengu> so both `proc `==` (a, b: BencodeType): bool {.noSideEffect.}` and `func `==` (a, b: BencodeType): bool` versions work |
18:29:49 | FromDiscord | <leorize> that's great then |
18:29:58 | FromDiscord | <leorize> how come hasKey is not side-effects free... |
18:32:38 | FromDiscord | <mengu> thanks for the help @leorize |
18:42:58 | FromDiscord | <sOkam! 🫐> In reply to @NimEventer "New Nimble package! taggy": @treeform I was looking for something very similar just yesterday, and didn't know you already had it↵thanks for making taggy. such a neat and simple tool |
18:45:19 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "a lot of macros": I obsessively try and make macros have semi-accurate/good line info and all that, because for stuff like asyncdispatch it's just a pain |
18:46:30 | FromDiscord | <Robyn [She/Her]> Especially considering that the patch to store unexpanded code was denied for error reporting |
18:56:06 | * | rockcavera quit (Remote host closed the connection) |
19:11:56 | FromDiscord | <treeform> In reply to @heysokam "<@107140179025735680> I was looking": You welcome. I am still actively working on taggy any feedback would be will actionable. |
19:34:59 | FromDiscord | <sOkam! 🫐> In reply to @treeform "You welcome. I am": do you think tailwind syntax could be potentially reasonable to do? |
19:37:23 | FromDiscord | <treeform> I don't know what is "tailwind syntax", reasearching... |
19:39:57 | FromDiscord | <treeform> Isn't tailwind syntax just css classes? How would I support that better? |
19:40:34 | FromDiscord | <Phil (he/him)> Tailwind kinda is one CSS property tied to one CSS class |
19:41:04 | FromDiscord | <Phil (he/him)> Meaning your class attribute on a html tag will explode in size |
19:41:13 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=html> |
19:41:26 | FromDiscord | <Phil (he/him)> Not sure I'd prefer tailwind over just BEM |
19:41:57 | FromDiscord | <Phil (he/him)> Which is about writing your own CSS classes but with meaningful names and according to a specific pattern |
19:42:08 | FromDiscord | <Phil (he/him)> Which makes refactoring into components easier |
19:43:01 | FromDiscord | <treeform> Why not use inline styles over tailwind's tiny classes? |
19:43:27 | FromDiscord | <Phil (he/him)> For one theyre unsafe, see csp content security protection |
19:43:28 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=html> |
19:43:47 | FromDiscord | <Phil (he/him)> Ah friend is back, ask me tomorrow and I'll answer |
19:44:11 | FromDiscord | <Phil (he/him)> Tomorrow = in 14h |
19:44:49 | FromDiscord | <sOkam! 🫐> In reply to @treeform "Isn't tailwind syntax just": no way, not even close↵the reason is that tailwind doesnt work with classes, it works with shorthands so that you dont need classes at all |
19:45:07 | FromDiscord | <treeform> explain |
19:45:09 | FromDiscord | <sOkam! 🫐> its love-or-hate, so hence why i asked for the "is it feasible" |
19:45:20 | FromDiscord | <treeform> how would it look with in taggy? |
19:46:45 | FromDiscord | <sOkam! 🫐> the same as it would in html, i figure↵i guess one could just use tailwind and call for the tailwind processor after creating the html |
19:47:04 | FromDiscord | <treeform> oh, there is a post processor? |
19:47:06 | FromDiscord | <sOkam! 🫐> if you support not processing css, that would be an option that would rely on npm |
19:47:18 | FromDiscord | <sOkam! 🫐> In reply to @treeform "oh, there is a": yeah its compiled to regular css |
19:47:56 | FromDiscord | <treeform> I would probably not use tailwind, as I have a system I like. But if tailwind support is easy and does not interfere with other things... |
19:48:01 | FromDiscord | <sOkam! 🫐> the idea is that it gives you proper css defaults, with modern standards, and they work as you expect right out of the box without having to create a class for everything |
19:48:10 | FromDiscord | <treeform> But if its some really heavy processed based system... that will make me redo everything probably not. |
19:48:39 | FromDiscord | <sOkam! 🫐> In reply to @treeform "I would probably not": if you allow not processing the css `class=""` output in some way, then yeah |
19:49:22 | FromDiscord | <sOkam! 🫐> that would depend on npm, not pure nim, but i guess better than nothing |
19:49:23 | FromDiscord | <treeform> tailwind adds a special lanauge into the class attribute? |
19:49:50 | FromDiscord | <sOkam! 🫐> In reply to @treeform "tailwind adds a special": you pass tailwind syntax to the class attribute, and it creates your css in there, afaik |
19:50:16 | FromDiscord | <sOkam! 🫐> don't have much insights on the inner workings of tailwind, im new and only using it as a newb webdev |
19:56:02 | ehmry | is anyone doing paramerized/generic nim modules? like I want to import a module and fill in all the generic types in one pass |
19:56:45 | FromDiscord | <sOkam! 🫐> In reply to @ehmry "is anyone doing paramerized/generic": what does this question mean? |
19:57:17 | FromDiscord | <sOkam! 🫐> "fill in all the generic types" <-- the problematic part of the question |
19:57:26 | ehmry | sOkam!: `import foo[int]` |
19:57:38 | FromDiscord | <sOkam! 🫐> that's not correct syntax |
19:57:38 | FromDiscord | <nasuray> In reply to @heysokam "the same as it": Does tailwind only process from html files? I know with UnoCSS it can take any file as input to generate the css. I use it with https://github.com/nimpkgs/website |
19:58:07 | ehmry | I'm asking about Ocaml style modules |
19:58:16 | FromDiscord | <whisperecean> i can't seem to compile a project with nim-chronicles getting this: .nimble/pkgs2/stew-0.1.0-46d58c4feb457f3241e3347778334e325dce5268/stew/ptrops.nim(39, 11) Error: invalid pragma: checks: off |
19:58:17 | FromDiscord | <sOkam! 🫐> In reply to @nasuray "Does tailwind only process": afaik it processes from any file, but i've only used it with tsx and html |
19:59:16 | FromDiscord | <sOkam! 🫐> In reply to @ehmry "I'm asking about Ocaml": ive never used ocaml, but that syntax and question makes no sense in terms of nim generics↵can you explain your goal without ocaml terminology? |
19:59:22 | ehmry | I think this can be done with modulest that only export a template for generated the module body |
20:00:12 | FromDiscord | <sOkam! 🫐> so in ocaml you can import a module with a type, and force the compiler to output code for that type only?↵if yes, that's now how nim generics work |
20:00:57 | ehmry | sOkam!: I wasn't asking you |
20:01:47 | FromDiscord | <sOkam! 🫐> ehmry: and I was trying to be kind and answer your question. but i guess you can keep your answer unanswered for longer |
20:02:55 | FromDiscord | <whisperecean> When I comment out the pragma it works |
20:03:01 | FromDiscord | <asakura44> guys i read a weird thing |
20:03:02 | FromDiscord | <whisperecean> but can anyone from status comment? |
20:04:39 | FromDiscord | <asakura44> sent a long message, see <!doctype html> |
20:06:55 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:07:44 | FromDiscord | <asakura44> hmmm |
20:07:48 | FromDiscord | <asakura44> maybe ide |
20:09:27 | FromDiscord | <treeform> In reply to @heysokam "you pass tailwind syntax": I find it strange. Can you show me how you would want it to work with taggy? I kind of dont get it still. |
20:13:50 | FromDiscord | <whisperecean> What is the difference between func and proc? When should I use the former and when the latter? |
20:14:49 | FromDiscord | <treeform> func is a proc that tries to prevent some side effects |
20:15:13 | FromDiscord | <asakura44> In reply to @treeform "func is a proc": yes i know |
20:15:17 | FromDiscord | <treeform> I almost never use func, as it does not prevent enough side effects |
20:15:27 | FromDiscord | <treeform> so its kind of a middle of the road thing, not very interesting to me |
20:15:33 | FromDiscord | <asakura44> but what is weird to me is the message i get ``func can have side effects`` |
20:15:45 | FromDiscord | <treeform> also you hae to use debugEcho inside funcs which is most annoyuing |
20:16:03 | FromDiscord | <leorize> func breaks your code every release because they add more restrictions but analysis is still bad |
20:16:46 | FromDiscord | <treeform> I had a phase where I used funcs for everything... |
20:17:21 | FromDiscord | <treeform> but then it felt like I was a working for the compiler and not other way around |
20:17:31 | FromDiscord | <treeform> so I replaced them all back to procs |
20:17:35 | FromDiscord | <asakura44> it is still very weird to me |
20:17:44 | FromDiscord | <treeform> it is weird to me too |
20:17:51 | FromDiscord | <asakura44> yeah |
20:18:04 | FromDiscord | <asakura44> they could say : func does not have side effects |
20:18:16 | FromDiscord | <asakura44> which is the best expression for the situation |
20:19:10 | FromDiscord | <treeform> I would like a func that makes everything inside functional/params immutable/no side effects and made echo be same as debugEcho |
20:19:14 | FromDiscord | <treeform> but its like half way there |
20:22:29 | FromDiscord | <asakura44> nim is a good language but very mysterious |
20:26:01 | FromDiscord | <nasuray> In reply to @treeform "I find it strange.": Haven't looked at taggy but if you can specify a "class" html attribute as a string then it shouldn't need any modification |
20:28:02 | FromDiscord | <.bobbbob> I have a web server in prolouge that loads a database in the routes and does stuff with it. It seems to work fine, but it seems like when the server gets a lot of accesses it returns 504 errors with the log saying DbError: unable to open database file. It works if I restart the service but that shouldnt happen, is it some kind of problem with threads? |
20:30:40 | FromDiscord | <leorize> depends on how your db code works |
20:30:56 | FromDiscord | <whisperecean> @treeform Is reddit also supporting Nim or are you just using to develop internal tooling? |
20:32:33 | FromDiscord | <ambient3332> Yeah I also thought func was about being strictly, explicitly side-effect free |
20:32:57 | FromDiscord | <ambient3332> Although mixing these paradigms may cause more headaches than they solve IMHO |
20:33:00 | FromDiscord | <.bobbbob> In reply to @leorize "depends on how your": do I need to close a db at the end of a route? |
20:33:35 | FromDiscord | <leorize> are you opening them per route instead of opening once? |
20:34:09 | FromDiscord | <whisperecean> @leorize Are you using Norm? |
20:34:38 | FromDiscord | <leorize> nope |
20:35:51 | FromDiscord | <.bobbbob> In reply to @leorize "are you opening them": im opening the db per route, and Im using norm. I thought I couldnt open it once globally because it causes problems with threads |
20:36:46 | FromDiscord | <leorize> most dbs should be thread safe though |
20:37:13 | FromDiscord | <leorize> anyhow, if you open once per route then you must close whenever you finish your work |
20:38:34 | FromDiscord | <.bobbbob> ok Ill give it a try |
20:41:41 | FromDiscord | <.bobbbob> prolouge routes are async, does that impact anything with having a global db variable? |
20:42:07 | FromDiscord | <leorize> it shouldn't |
20:42:19 | FromDiscord | <leorize> what db are you using? |
20:43:13 | FromDiscord | <.bobbbob> norm with sqlite |
20:44:29 | FromDiscord | <Phil (he/him)> I have the same setup, if you still have questions 14h from now I'm happy to answer↵(@.bobbbob) |
20:44:53 | FromDiscord | <leorize> then you need one connection per thread↵(@.bobbbob) |
20:45:37 | FromDiscord | <leorize> I suppose a threadvar might work, but I'm not familiar with how prologue does it's thing |
20:46:23 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:46:35 | FromDiscord | <sOkam! 🫐> (edit) |
20:48:00 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:49:06 | FromDiscord | <sOkam! 🫐> that would be for the non-processed version, to later on pass the actual tailwind on the html that taggy would output |
20:49:26 | * | FromDiscord quit (Remote host closed the connection) |
20:49:39 | * | FromDiscord joined #nim |
20:51:33 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:52:09 | FromDiscord | <whisperecean> For anyone using Norm how do I connect to a db? |
20:52:13 | FromDiscord | <sOkam! 🫐> but I'm not expecting you to reimplement tailwind if you don't already use it and not like it. atomic styling is very hate-it-or-love-it |
20:52:23 | FromDiscord | <sOkam! 🫐> (edit) |
20:52:34 | FromDiscord | <sOkam! 🫐> (edit) |
20:57:10 | FromDiscord | <.bobbbob> In reply to @whisperecean "For anyone using Norm": let db = open(dbPath, "", "", "") but apparaently dont trust me too much |
20:57:22 | FromDiscord | <.bobbbob> (edit) "apparaently" => "apparently" |
20:58:22 | FromDiscord | <whisperecean> This creates a file on localhost 😄 |
20:58:48 | FromDiscord | <leorize> if you're using sqlite then ofc it will do that \:p |
20:59:37 | FromDiscord | <whisperecean> I wanna connect to a remote postgres |
21:04:15 | FromDiscord | <leorize> then make sure you import norm/postgres |
21:04:15 | FromDiscord | <leorize> https://norm.nim.town/pool.html↵↵looks like there's already a built in solution for you↵(@.bobbbob) |
21:07:06 | FromDiscord | <asakura44> In reply to @treeform "I almost never use": are you sure about this ? |
21:07:57 | FromDiscord | <asakura44> is echoing considered a side effect ? |
21:08:59 | FromDiscord | <asakura44> hmm maybe right is it because it is trying to write ? but weird why returning is not considered a side effect ? |
21:10:12 | FromDiscord | <leorize> it's a side effect, just one of those that would be better off pretended as not one |
21:10:32 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:11:30 | FromDiscord | <treeform> In reply to @asakura44 "hmm maybe right is": What do you mean returning new objects is a very `func`tional-programming way of doing things? |
21:11:32 | FromDiscord | <albassort> yo, treeform |
21:11:49 | FromDiscord | <whisperecean> @leorize where do you see it? :M |
21:13:34 | FromDiscord | <asakura44> In reply to @leorize "it's a side effect,": but when i try to echo from ``func`` it says ``it can have side-effects`` |
21:14:57 | FromDiscord | <treeform> that's why you got ot use debugEcho which is echo that says it has no sife-effects |
21:15:04 | FromDiscord | <treeform> but to me echo is always for debugging |
21:15:38 | FromDiscord | <treeform> if I want to write stuff out for real, use a logger, or some other writer |
21:25:58 | * | jmdaemon joined #nim |
21:35:44 | FromDiscord | <leorize> wdym?↵(@whisperecean) |
21:45:32 | FromDiscord | <Elegantbeef> @treeform hey 2.0 strict defs prevent writing to all `ref` locations even ones declared inside the `func` so it's extremely fun to use 😄 |
21:45:52 | FromDiscord | <leorize> for example, `newException` ceases to work \:p |
21:48:42 | FromDiscord | <Elegantbeef> But yea all code that uses it ceases to function |
21:48:43 | FromDiscord | <leorize> imagine writing a proper write tracker |
21:48:45 | FromDiscord | <Elegantbeef> I mean I'm dumb enough I cannot imagine that |
22:12:32 | FromDiscord | <nnsee> kind of unrelated but I despise tailwind for the exact same reason i despise inline styles: mixing markup with presentation |
22:12:37 | FromDiscord | <nnsee> it's ugly and it makes me feel icky |
22:16:19 | FromDiscord | <leorize> although lets be real, html is a mess of a presentation-oriented markup now |
22:17:02 | FromDiscord | <leorize> we add `div`s like no tomorrow just to get some styling working, not much markup there anymore |
22:20:46 | FromDiscord | <Elegantbeef> They insulted our divs but I was not a web developer so did nothing |
22:21:54 | FromDiscord | <leorize> \:p |
22:23:12 | FromDiscord | <leorize> though tailwind make for super clutter code because it pretends that we only change one css attribute at a time |
22:34:38 | FromDiscord | <.bobbbob> so what's the right way to handle exiting/crashing a program that may or may not have a database open in a thread, do you need to close it in an exit proc or will it close anyways? |
22:45:27 | FromDiscord | <nasuray> In reply to @heysokam "that would be for": Why not just run tailwind on the nim source directly? |
22:47:34 | FromDiscord | <leorize> In reply to @.bobbbob "so what's the right": your program should know how to shutdown gracefully |
22:48:34 | FromDiscord | <.bobbbob> In reply to @leorize "your program should know": erm you mean it automatically knows how or I have to tell it how? |
22:49:02 | FromDiscord | <leorize> you'd have to tell it |
22:49:33 | FromDiscord | <leorize> sqlite is good enough that you can crash and probably won't lose data, but I won't bank on that |
22:50:00 | FromDiscord | <.bobbbob> okay, how would I close the database connection if I dont have the variable that it was loaded in and arent even sure if it was loaded? |
22:50:22 | FromDiscord | <leorize> that's the neat part, you have to close it when you still have it |
22:50:35 | FromDiscord | <leorize> you can never open a database then lose the connection object |
22:50:40 | FromDiscord | <leorize> it has to be somewhere |
22:50:52 | FromDiscord | <leorize> if you don't need it, then close it on the spot |
22:53:29 | FromDiscord | <.bobbbob> I see |
22:54:03 | FromDiscord | <leorize> usually in stuff like go there's a cancellation signal that can be issued |
22:54:21 | FromDiscord | <leorize> your thread would check for this signal, then stop whatever its doing immediately |
22:55:03 | FromDiscord | <leorize> that way all finalizers will be executed until the point where the program can be shutdown |
22:55:39 | FromDiscord | <leorize> i'm not aware of any technique to do the same in nim, unfortunately |
23:11:18 | FromDiscord | <Robyn [She/Her]> I wonder how hard it actually is to create an Android app without the ndk, is that even doable? |
23:11:49 | FromDiscord | <leorize> people do that all the time |
23:13:58 | FromDiscord | <leorize> i'd wager that most apps on the play store don't need the ndk |
23:18:57 | FromDiscord | <Robyn [She/Her]> Oh huh |
23:21:04 | * | Jjp137 quit (Quit: Leaving) |
23:31:04 | FromDiscord | <Robyn [She/Her]> Really wish there was an app that had the bare minimum, and all it did was load a .so file |
23:32:05 | * | Jjp137 joined #nim |
23:33:16 | FromDiscord | <leorize> you could try seeing what qt uses as a template |
23:34:09 | FromDiscord | <Elegantbeef> https://lisyarus.github.io/blog/programming/2023/07/19/porting-for-android.html#bare-bones |
23:49:47 | FromDiscord | <Robyn [She/Her]> Ah well that's interesting- |
23:59:53 | FromDiscord | <sOkam! 🫐> In reply to @nasuray "Why not just run": iis that possible? |