<< 06-01-2024 >>

00:07:08FromDiscord<Elegantbeef> The line it warns on is not very sensible either
00:07:09FromDiscord<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:46FromDiscord<Elegantbeef> Or y'know just `ptr MyModule.EchoFilter` 😄
00:08:44FromDiscord<Robyn [She/Her]> That's also a thing
00:09:27FromDiscord<Elegantbeef> Oh Phil I think I see the reason for the data race
00:09:28FromDiscord<Elegantbeef> `isFull` is called before a lock happens
00:09:51FromDiscord<Phil> I shall write that in the threading issue I opened because of this
00:09:59FromDiscord<Phil> Because I! Want! Threadsafety!
00:10:58FromDiscord<Elegantbeef> Changing to `send` and `recv` removes it
00:11:15FromDiscord<Elegantbeef> So I figure this is a false positive due to the design of `try`
00:11:18FromDiscord<Robyn [She/Her]> General convention is newType is for heap, and initType is for stack, right? In the stdlib
00:11:40FromDiscord<Elegantbeef> They're awful conventions to put the type in the proc name, but yes
00:12:14FromDiscord<Phil> While that is true, `new(t: typedesc[yourtype])` makes far more sense imo
00:12:21FromDiscord<Phil> Which is what I tend to use
00:12:50FromDiscord<Robyn [She/Her]> Would it be rude to ping Anuke with minor suggestions of me going through his code?
00:13:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
00:13:14FromDiscord<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:18FromDiscord<Elegantbeef> I mean you could
00:13:30FromDiscord<Elegantbeef> I've pinged people for their code 😛
00:13:46FromDiscord<Elegantbeef> Could also just make a PR if you really wanted to
00:14:34FromDiscord<Robyn [She/Her]> Fair
00:14:41FromDiscord<Robyn [She/Her]> Hm...
00:14:52FromDiscord<Robyn [She/Her]> I can't test any code atm so I won't
00:15:12FromDiscord<Robyn [She/Her]> I am interested in the game framework he's making for Nim tho
00:15:36FromDiscord<Elegantbeef> Phil i'm like 90% certain that sanitiser is mad about nothing in this case
00:15:42FromDiscord<Elegantbeef> It's just the design of the channel
00:16:19FromDiscord<Elegantbeef> To answer your question, changing that to use the lock before accessing `isFull` makes `try` blocking
00:17:16FromDiscord<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:15FromDiscord<Elegantbeef> Hmm actually in the case of a race you might block until you can send
00:22:10FromDiscord<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:15FromDiscord<Elegantbeef> thought\
00:23:10FromDiscord<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:59FromDiscord<leorize> the solution here is to try-acquire that lock \:P
01:06:44FromDiscord<leorize> or just get rid of that `if` in the first place
01:13:59FromDiscord<Elegantbeef> Yea that makes a lot more sense
01:14:02*jmdaemon joined #nim
01:42:14FromDiscord<Robyn [She/Her]> Where's a place that I'd use SIMD in? What type of projects does it benefit?
01:42:48FromDiscord<Elegantbeef> Anything that simd can accelerate
01:42:49FromDiscord<Elegantbeef> 😛
01:43:09FromDiscord<Robyn [She/Her]> Yes, what can it accelerate? I don't know what SIMD is used for specifically-
01:43:18FromDiscord<Elegantbeef> Go read the extensions
01:43:23FromDiscord<auxym> anything that needs to things fast by doing the same thing on a large array of ints, or something like that
01:43:26FromDiscord<Elegantbeef> The extensions are specifically made for certain goals
01:43:30FromDiscord<Robyn [She/Her]> Those are wordy 😭
01:43:45FromDiscord<Elegantbeef> Anything that needs to be done fast that the extensions can aid you in
01:43:56FromDiscord<Elegantbeef> You can use it for speeding up string searching for instance
01:43:57FromDiscord<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:20FromDiscord<Elegantbeef> You're limited by the operations and registers, so ... it depends
01:44:38FromDiscord<Elegantbeef> You cannot explain what simd can speed up cause there are like 30 different extensions
01:44:44FromDiscord<auxym> sent a long message, see <!doctype html>
01:45:50FromDiscord<Robyn [She/Her]> Ah
01:47:07FromDiscord<Elegantbeef> More modern extensions are aimed at speeding up common float operations for streaming and video encoding
01:47:49FromDiscord<Elegantbeef> 512bit registers and all
01:49:15FromDiscord<Robyn [She/Her]> Fair
01:49:23FromDiscord<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:27FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1193045637101519009/image.png?ex=65ab4955&is=6598d455&hm=134fe8cd2eb604083c733060e43a7f5060bff6e5eb7ca92ec7fe1a9039866ada&
04:17:27FromDiscord<albassort> these all suck
04:17:30FromDiscord<albassort> besides asciigraph
04:17:53FromDiscord<Elegantbeef> y'know
04:19:43FromDiscord<albassort> what do i know
04:19:53FromDiscord<Elegantbeef> No clue
04:20:01FromDiscord<Elegantbeef> You just say they all suck without elaboration
04:20:26FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=html>
04:20:39FromDiscord<Elegantbeef> Time to write a macro around it 😛
04:20:58FromDiscord<albassort> no its not my fault the guy wont maintain matplotnim
04:21:11FromDiscord<Elegantbeef> Uh hu
04:21:19FromDiscord<Elegantbeef> I love people bitching about things they can change
04:21:55FromDiscord<albassort> you know im incompetent
04:22:08FromDiscord<␀ Array 🇵🇸 🍉> what is "coherent noise" supposed to mean?↵(@auxym)
04:22:18FromDiscord<Elegantbeef> Well best way to get better iss to do
04:22:25FromDiscord<␀ Array 🇵🇸 🍉> kind of an oxymoron
04:22:36FromDiscord<Robyn [She/Her]> In reply to @␀ Array 🇵🇸 🍉 "what is "coherent noise"": Stuff suitable for world generation perhaps?
04:22:59FromDiscord<␀ Array 🇵🇸 🍉> i guess?↵(@Robyn [She/Her])
04:23:12FromDiscord<albassort> coherency in noise is when the noise isn't actually completely noise
04:23:14FromDiscord<albassort> its not white nosie
04:23:15FromDiscord<albassort> (edit) "nosie" => "noise"
04:23:27FromDiscord<albassort> it has a use that isn't pure randomness
04:23:30FromDiscord<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:40FromDiscord<Robyn [She/Her]> In reply to @albassort "it has a use": Makes sense
05:21:48*disso-peach quit (Quit: Leaving)
06:22:47FromDiscord<Robyn [She/Her]> I really need a small project I'd actually complete ngl
06:24:00FromDiscord<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:10FromDiscord<Robyn [She/Her]> Oh fellow transfem who listens to Jagwar Twins
06:24:15FromDiscord<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:35FromDiscord<ntzeno> aye, i don't know who jagwar twins is though
06:24:35FromDiscord<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:39FromDiscord<Robyn [She/Her]> (edit) "Twins" => "Twin"
06:25:07FromDiscord<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:25FromDiscord<ntzeno> oh, it's from that person ? i see, ty
06:25:31FromDiscord<ntzeno> i just copied it straight from nightcore :P
06:26:00FromDiscord<ntzeno> In reply to @chronos.vitaqua "To be fair I": go for it then, girl
06:26:11FromDiscord<Robyn [She/Her]> In reply to @ntzeno "i just copied it": Fair aha
06:26:29FromDiscord<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:34FromDiscord<ntzeno> aye
06:26:37FromDiscord<Robyn [She/Her]> Adios for now, I'm gonna get some sleep
06:26:43FromDiscord<ntzeno> good night
06:27:12FromDiscord<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:10FromDiscord<Phil> In reply to @leorize "the solution here is": Added the suggestion to the issue of threading
07:27:26FromDiscord<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:52FromDiscord<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:03FromDiscord<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:20FromDiscord<Elegantbeef> Profile
07:52:59FromDiscord<4zv4l> profile ?
07:53:04FromDiscord<odexine> do profiling
07:53:07FromDiscord<Elegantbeef> Profile it
07:56:20FromDiscord<huantian> but that's so much work
07:58:21FromDiscord<4zv4l> thats for the C one https://media.discordapp.net/attachments/371759389889003532/1193101232852705330/prof_output.txt?ex=65ab7d1c&is=6599081c&hm=28272297ea298aa248bdeb2f8e7ac3b610a46a3c4a0d10bae2393c17503bca43&
07:58:36FromDiscord<4zv4l> for Nim I tried `--passC=-pg` but it didnt make the output
07:59:26FromDiscord<4zv4l> `30033236` calls to md5check seems a lot
08:00:06FromDiscord<4zv4l> but possible
08:00:07FromDiscord<4zv4l> xD
08:01:51FromDiscord<4zv4l> trying with `--profiler:on`
08:02:09FromDiscord<Elegantbeef> Just use a C profiler with `--debugger:native`
08:06:00FromDiscord<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:23FromDiscord<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:11FromDiscord<Elegantbeef> cachegrind is ok, perf is good
10:10:24FromDiscord<Elegantbeef> perf + flamegraph is pretty nice
10:10:35FromDiscord<Elegantbeef> whoops callgrind not cachegrind
10:25:08*lucerne joined #nim
11:47:25FromDiscord<fosster> sent a code paste, see https://play.nim-lang.org/#ix=html>
11:48:27FromDiscord<Phil (he/him)> How do you borrow?
11:48:39FromDiscord<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:45FromDiscord<Phil (he/him)> As in, what does the line of code look like
11:48:54FromDiscord<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:08FromDiscord<fosster> sorry for the format fucked up
11:49:57FromDiscord<fosster> where `type Number = distinct float`
11:52:49FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
11:53:29FromDiscord<fosster> alright let me try this out in a while!
11:53:33FromDiscord<Phil> `==` will be used to figure out `!=`↵`>` is used to figure out `<`↵`>=` is used to figure out `<=`
11:55:23FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=html>
11:55:37FromDiscord<ambient3332> Chaing the last line += to = removes the bug
11:55:52FromDiscord<ambient3332> (edit)
11:55:53FromDiscord<Phil> Question, fundamentally, what is a mutex?
11:56:15FromDiscord<ambient3332> (edit) "Chaing" => "Changing"
11:57:44FromDiscord<Phil> Is a mutex just the concept of a lock?
12:00:50FromDiscord<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:30FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=html>
12:01:37FromDiscord<ambient3332> This fixes the bug but the sound is distorted
12:02:11FromDiscord<ambient3332> I have no idea what is going on 😓
12:07:04*azimut joined #nim
12:25:54FromDiscord<ambient3332> Yeah, audioCallback will run asynchronously...
12:31:02FromDiscord<ambient3332> race condition from behind 😵‍💫
12:34:47FromDiscord<fosster> wtf it worked! thank you very much!↵(@Phil)
12:35:12FromDiscord<fosster> are you creating some sort of sound synthetizer?↵(@ambient3332)
12:35:31FromDiscord<ambient3332> Yeah just playing around with some simple sine pings and keyboard
12:35:37FromDiscord<ambient3332> maybe karplus strong and reverb later
12:40:27*PMunch joined #nim
12:49:15FromDiscord<fosster> cool, that's what I tried to do once in C
12:49:36FromDiscord<Phil (he/him)> Happy to have helped
12:49:38FromDiscord<fosster> now I'm writing an interpreter in Nim that generates music out of lisp code
12:56:10FromDiscord<ambient3332> Separating keyboard input to synth and visual presentation is a bit more complex...
12:56:18FromDiscord<ambient3332> Nim GC complains to me then I try to make a keyboard polling thread
12:57:58PMunchWhat exactly is it complaining about?
12:58:54FromDiscord<ambient3332> https://github.com/amb/nim-synth/blob/main/main.nim the addSynth part in the keyboardReadingThread
13:00:21FromDiscord<ambient3332> Warning: 'addSynth' is not GC-safe as it accesses 'audioEngine' which is a global using GC'ed memory [GcUnsafe2]
13:00:26FromDiscord<ambient3332> Error: 'keyboardReadingThread' is not GC-safe as it calls 'addSynth'
13:04:49PMunchRight, the addSynth touches some global variable so it can't safely be shared
13:06:39FromDiscord<ambient3332> I could just put locks around it but don't know quite how
13:07:26FromDiscord<ambient3332> And if that would even fix GC issues
13:10:21FromDiscord<ambient3332> The complexity of both threads and GC
13:10:51PMunchIt wouldn't fix the GC issues
13:11:00PMunchWell, it wouldn't let the compiler know they where fixed at least
13:11:47FromDiscord<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:49FromDiscord<Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html>
13:16:04FromDiscord<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:08PMunch`var sink auto`?
13:24:35FromDiscord<whisperecean> I am using the most popular nim extension on vs code but I dont understand the build on save
13:24:39FromDiscord<whisperecean> is that preconfigured or not?
13:24:54FromDiscord<whisperecean> It opens tasks but I dont have a build task defined
13:31:00FromDiscord<whisperecean> hmm nvm its not predefined I had to define it
13:34:30FromDiscord<Phil> In reply to @PMunch "`var sink auto`?": sink var auto
13:39:42PMunchAh right
13:52:27FromDiscord<whisperecean> Does anybody have a good recent cheat sheet for Nim features and patterns?
13:54:03FromDiscord<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:11FromDiscord<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:33FromDiscord<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:40FromDiscord<whisperecean> I onl have zig cc not zigcc.
13:57:08FromDiscord<whisperecean> In reply to @ezquerra "You should not use": Why?
13:58:14FromDiscord<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:01FromDiscord<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:55FromDiscord<whisperecean> Ah ok I get it. I did not have nimble bin in my path.
14:00:54PMunch@whisperecean, https://nim-by-example.github.io/ is pretty good, and https://scripter.co/notes/nim
14:01:01PMunchNot sure if they are 100% up to date though
14:02:06*deadmarshal_ joined #nim
14:02:33FromDiscord<whisperecean> Thanks!
14:10:34*ehmry is now known as emery
14:10:42*emery is now known as ehmry
14:22:19FromDiscord<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:34FromDiscord<whisperecean> Does anybody know how in Norm i can represent nullable field?
16:37:31FromDiscord<sOkam! 🫐> sent a long message, see <!doctype html>
16:45:58FromDiscord<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:38FromDiscord<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:58Amun-Ranope
16:54:31Amun-Rawithout pure pragma you can write both ways, Type.value or value
16:55:50FromDiscord<kiloneie> sent a long message, see <!doctype html>
16:56:56Amun-Ralong discord messages do not travel to irc land
16:57:15FromDiscord<kiloneie> https://www.reddit.com/r/nim/comments/cxbidq/could_someone_explain_pure/
16:57:20FromDiscord<kiloneie> https://nim-by-example.github.io/types/enums/
16:57:33FromDiscord<kiloneie> Both of these say this didn't use to be the case.
16:57:40FromDiscord<kiloneie> whats the irc limit ?
16:57:54Amun-Rapure pragma makes writing type name required
16:58:59Amun-Ratype Foo {.pure.} = bar, baz; `let x = bar` is an error
16:59:23Amun-Ratype Foo {.pure.} = enum: bar, baz; `let x = bar` is an error
17:01:50Amun-Rahttps://dpaste.com/6DBMJFZER
17:02:51FromDiscord<kiloneie> im getting no such errors...
17:03:30FromDiscord<kiloneie> also playground is broken
17:03:42FromDiscord<kiloneie> the share part
17:04:09FromDiscord<kiloneie> i am on 2.0.0, need to update
17:05:31Amun-Ramy example was bad
17:05:58FromDiscord<whisperecean> How can I convert int to a DateTime object?
17:06:19Amun-Rakiloneie: https://nim-lang.org/docs/manual.html#types-enumeration-types
17:07:25Amun-RaI've never used pure enums in my code and forgot it's about enum name clash
17:07:58Amun-Rawhisperecean: .fromUnix?
17:08:09Amun-Rahttps://nim-lang.org/docs/times.html#fromUnix%2Cint64
17:08:23FromDiscord<whisperecean> That gives a Time object
17:08:24Amun-Raah, it's Time
17:08:46FromDiscord<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:03FromDiscord<bigcatnova> i feel like ive tried everything, still doesnt work "could not load: (libcrypto-1_1-x64).dll"
17:09:08Amun-Rawhisperecean: 1.toUnix.utc or 1.toUnix.local
17:09:16Amun-Rahttps://nim-lang.org/docs/times.html#utc%2CTime
17:10:14Amun-Rado you have that dll in path?
17:11:21FromDiscord<whisperecean> Yay that works!
17:11:22FromDiscord<whisperecean> Thanks
17:11:44Amun-Ragreat :)
17:12:23FromDiscord<kiloneie> In reply to @Amun-Ra "<@398205119583485964>: https://nim-lang.org/docs/ma": Thanks, i missed the ambigious part...
17:12:32FromDiscord<leorize> add `--dynlibOverride:crypto --dynlibOverride:ssl` and you can link statically using `--passL`↵(@bigcatnova)
17:13:04FromDiscord<bigcatnova> In reply to @leorize "add `--dynlibOverride:crypto --dynlibOverride:ssl` ": yup tried it, still get the same error
17:13:30FromDiscord<leorize> you can go nuclear with `--dynlibOverrideAll` then
17:13:44FromDiscord<bigcatnova> In reply to @leorize "you can go nuclear": any side effects i should expect?
17:14:13FromDiscord<leorize> it'd expose every libraries that is used by your program
17:14:26FromDiscord<leorize> but since you're aiming to static link it might be what you want
17:14:46FromDiscord<bigcatnova> ok forget that
17:14:51FromDiscord<bigcatnova> ill just look for an alternative module i guess
17:15:04FromDiscord<leorize> typically it's ssl and pcre that's in a jim program
17:15:13FromDiscord<leorize> there's no alternative fwiw
17:15:29FromDiscord<leorize> nim, even
17:16:17FromDiscord<odexine> jim program hahaha
17:17:00FromDiscord<leorize> autocorrect is ass \:p
17:19:02*azimut joined #nim
17:19:44FromDiscord<bigcatnova> what about httpbeast
17:21:53FromDiscord<leorize> httpbeast is a http server
17:21:56FromDiscord<leorize> one that doesn't even support ssl to begin with
17:22:04FromDiscord<odexine> hey dont beat me to the punch
17:22:57Amun-Raturn autocorrection off, own your mistakes ;)
17:23:06FromDiscord<bigcatnova> i just need to download a file from url
17:23:26FromDiscord<leorize> if you're looking to statically link, just use `--dynlibOverrideAll`
17:23:42FromDiscord<bigcatnova> is that not unsafe though
17:24:02FromDiscord<leorize> it's actually safer than the dlopen mess nim uses
17:24:46FromDiscord<bigcatnova> i tried using `--dynlibOverrideAll` but i just get a huge error log that i cant even read
17:25:35Amun-Rabc you have to feed the compiler with all thr required libs yourself
17:25:59FromDiscord<leorize> yea because now you gotta add your static linking flags
17:26:24FromDiscord<leorize> in your case it should just be the flags for libssl and libcrypto
17:26:29FromDiscord<bigcatnova> yea well nothing works its all outdated
17:26:36FromDiscord<bigcatnova> pretty much everything i read says different stuff
17:26:43Amun-Raleorize: wait, nim uses dlopen with -d=ssl? it shouldn't
17:27:13FromDiscord<leorize> anything `{.dynlib: x.}` uses dlopen
17:27:32FromDiscord<leorize> nim has an allergy to using the os dynamic linker
17:28:05FromDiscord<leorize> tl;dr\: araq don't like installing `libx-dev` packages
17:29:00Amun-RaI just ldd'ed tssl.nim from tests suite and you're right
17:29:14Amun-Ratbh I use dlopen for all my library wrappers
17:29:33FromDiscord<leorize> the nim missing library message is different from the typical stuff because it doesn't use the dynamic linker
17:29:35Amun-Ravia my dynlib utils (dlutils package)
17:30:26FromDiscord<whisperecean> how do I use this when I see stuff like this in libraries?
17:30:27FromDiscord<whisperecean> proc `$`(uuid: UUID): string
17:30:30FromDiscord<leorize> I'd prefer that dlopen usage be explicit, they mess up with too many tools
17:30:56ehmryyea, dlopen is fucked, I patch my compiler to not do that
17:31:17FromDiscord<whisperecean> initUUID returns UUID and has this $ to convert uuid to string but how do I use it?
17:31:29FromDiscord<leorize> `$uuid`
17:31:43FromDiscord<leorize> it's a prefix operator
17:31:58FromDiscord<whisperecean> but how do I call it on a function?
17:32:06Amun-Ra$foo()
17:32:19FromDiscord<whisperecean> when I have newUser(uuid = initUUID())
17:32:33Amun-Raand uuid must be string?
17:32:40FromDiscord<whisperecean> yes for sqlite
17:32:48Amun-Rauuid = $initUUID()
17:32:48FromDiscord<leorize> `$initUUID()`
17:33:08FromDiscord<whisperecean> that does not work 😦
17:33:39FromDiscord<leorize> how does it not work?
17:33:54FromDiscord<whisperecean> i am using this https://github.com/pragmagic/uuids
17:33:55FromDiscord<whisperecean> sent a long message, see <!doctype html>
17:34:42Amun-Rathere's no `$` defined for UUID
17:35:03Amun-Ra(or I'm blind)
17:35:21Amun-Rahttps://github.com/pragmagic/uuids/blob/master/uuids.nim#L117-L118
17:35:23Amun-RaI think I am
17:36:28FromDiscord<odexine> `initUUID` needs parameters
17:37:16FromDiscord<whisperecean> am dumb right!
17:37:31FromDiscord<whisperecean> $genUUID works
17:38:55FromDiscord<mengu> sent a code paste, see https://play.nim-lang.org/#ix=html>
17:39:46FromDiscord<mengu> how do I fix that?
17:40:08FromDiscord<mengu> (edit) "how do I fix that? ... " added "my nim version: `Nim Compiler Version 2.0.2 [MacOSX: arm64]`"
17:40:23FromDiscord<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:28Amun-Raare these code pastes on discord inline?
17:40:54FromDiscord<leorize> and this is why we hate funcs in nim \:p
17:41:27FromDiscord<leorize> you kinda just grep your way through
17:41:42*mengu1 joined #nim
17:42:56FromDiscord<leorize> make your `==` proc a func and it might work↵(@mengu)
17:43:34FromDiscord<leorize> side effects evaluation quality really went downhill
17:44:14FromDiscord<whisperecean> so would none DateTime represent NULL-able DateTime field?
17:44:21FromDiscord<whisperecean> none comes from Options
17:44:35FromDiscord<leorize> are you using norm?
17:44:58FromDiscord<whisperecean> yes!
17:45:10*mengu1 quit (Client Quit)
17:49:53FromDiscord<leorize> then yes, none is null
17:54:23FromDiscord<whisperecean> thanks!
17:57:19FromDiscord<whisperecean> Does anyone know how to fix this? https://github.com/soasme/nim-schedules/issues/19
17:57:24FromDiscord<whisperecean> Or the library needs to be fixed?
18:00:31FromDiscord<leorize> could be both
18:00:49FromDiscord<leorize> a lot of macros have bad lineinfo management so it might show issues with your code pointing to the library
18:18:39NimEventerNew Nimble package! taggy - Everything to do with HTML and XML, see https://github.com/treeform/taggy
18:22:53FromDiscord<whisperecean> Does anybody know of any alternative?
18:23:04FromDiscord<whisperecean> Just want to execute my program cron style
18:23:55FromDiscord<leorize> then shouldn't you use crontab? \:p
18:25:09FromDiscord<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:37FromDiscord<leorize> it is
18:26:52FromDiscord<leorize> actually I'm not sure about the status of strictFuncs so you might want to try `proc {.nosideeffects.}`
18:27:09FromDiscord<mengu> I've tried that one as well, did not work because of the `hasKey` call
18:27:56FromDiscord<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:49FromDiscord<mengu> so both `proc `==` (a, b: BencodeType): bool {.noSideEffect.}` and `func `==` (a, b: BencodeType): bool` versions work
18:29:49FromDiscord<leorize> that's great then
18:29:58FromDiscord<leorize> how come hasKey is not side-effects free...
18:32:38FromDiscord<mengu> thanks for the help @leorize
18:42:58FromDiscord<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:19FromDiscord<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:30FromDiscord<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:56FromDiscord<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:59FromDiscord<sOkam! 🫐> In reply to @treeform "You welcome. I am": do you think tailwind syntax could be potentially reasonable to do?
19:37:23FromDiscord<treeform> I don't know what is "tailwind syntax", reasearching...
19:39:57FromDiscord<treeform> Isn't tailwind syntax just css classes? How would I support that better?
19:40:34FromDiscord<Phil (he/him)> Tailwind kinda is one CSS property tied to one CSS class
19:41:04FromDiscord<Phil (he/him)> Meaning your class attribute on a html tag will explode in size
19:41:13FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=html>
19:41:26FromDiscord<Phil (he/him)> Not sure I'd prefer tailwind over just BEM
19:41:57FromDiscord<Phil (he/him)> Which is about writing your own CSS classes but with meaningful names and according to a specific pattern
19:42:08FromDiscord<Phil (he/him)> Which makes refactoring into components easier
19:43:01FromDiscord<treeform> Why not use inline styles over tailwind's tiny classes?
19:43:27FromDiscord<Phil (he/him)> For one theyre unsafe, see csp content security protection
19:43:28FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=html>
19:43:47FromDiscord<Phil (he/him)> Ah friend is back, ask me tomorrow and I'll answer
19:44:11FromDiscord<Phil (he/him)> Tomorrow = in 14h
19:44:49FromDiscord<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:07FromDiscord<treeform> explain
19:45:09FromDiscord<sOkam! 🫐> its love-or-hate, so hence why i asked for the "is it feasible"
19:45:20FromDiscord<treeform> how would it look with in taggy?
19:46:45FromDiscord<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:04FromDiscord<treeform> oh, there is a post processor?
19:47:06FromDiscord<sOkam! 🫐> if you support not processing css, that would be an option that would rely on npm
19:47:18FromDiscord<sOkam! 🫐> In reply to @treeform "oh, there is a": yeah its compiled to regular css
19:47:56FromDiscord<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:01FromDiscord<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:10FromDiscord<treeform> But if its some really heavy processed based system... that will make me redo everything probably not.
19:48:39FromDiscord<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:22FromDiscord<sOkam! 🫐> that would depend on npm, not pure nim, but i guess better than nothing
19:49:23FromDiscord<treeform> tailwind adds a special lanauge into the class attribute?
19:49:50FromDiscord<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:16FromDiscord<sOkam! 🫐> don't have much insights on the inner workings of tailwind, im new and only using it as a newb webdev
19:56:02ehmryis 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:45FromDiscord<sOkam! 🫐> In reply to @ehmry "is anyone doing paramerized/generic": what does this question mean?
19:57:17FromDiscord<sOkam! 🫐> "fill in all the generic types" <-- the problematic part of the question
19:57:26ehmrysOkam!: `import foo[int]`
19:57:38FromDiscord<sOkam! 🫐> that's not correct syntax
19:57:38FromDiscord<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:07ehmryI'm asking about Ocaml style modules
19:58:16FromDiscord<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:17FromDiscord<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:16FromDiscord<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:22ehmryI think this can be done with modulest that only export a template for generated the module body
20:00:12FromDiscord<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:57ehmrysOkam!: I wasn't asking you
20:01:47FromDiscord<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:55FromDiscord<whisperecean> When I comment out the pragma it works
20:03:01FromDiscord<asakura44> guys i read a weird thing
20:03:02FromDiscord<whisperecean> but can anyone from status comment?
20:04:39FromDiscord<asakura44> sent a long message, see <!doctype html>
20:06:55FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:07:44FromDiscord<asakura44> hmmm
20:07:48FromDiscord<asakura44> maybe ide
20:09:27FromDiscord<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:50FromDiscord<whisperecean> What is the difference between func and proc? When should I use the former and when the latter?
20:14:49FromDiscord<treeform> func is a proc that tries to prevent some side effects
20:15:13FromDiscord<asakura44> In reply to @treeform "func is a proc": yes i know
20:15:17FromDiscord<treeform> I almost never use func, as it does not prevent enough side effects
20:15:27FromDiscord<treeform> so its kind of a middle of the road thing, not very interesting to me
20:15:33FromDiscord<asakura44> but what is weird to me is the message i get ``func can have side effects``
20:15:45FromDiscord<treeform> also you hae to use debugEcho inside funcs which is most annoyuing
20:16:03FromDiscord<leorize> func breaks your code every release because they add more restrictions but analysis is still bad
20:16:46FromDiscord<treeform> I had a phase where I used funcs for everything...
20:17:21FromDiscord<treeform> but then it felt like I was a working for the compiler and not other way around
20:17:31FromDiscord<treeform> so I replaced them all back to procs
20:17:35FromDiscord<asakura44> it is still very weird to me
20:17:44FromDiscord<treeform> it is weird to me too
20:17:51FromDiscord<asakura44> yeah
20:18:04FromDiscord<asakura44> they could say : func does not have side effects
20:18:16FromDiscord<asakura44> which is the best expression for the situation
20:19:10FromDiscord<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:14FromDiscord<treeform> but its like half way there
20:22:29FromDiscord<asakura44> nim is a good language but very mysterious
20:26:01FromDiscord<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:02FromDiscord<.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:40FromDiscord<leorize> depends on how your db code works
20:30:56FromDiscord<whisperecean> @treeform Is reddit also supporting Nim or are you just using to develop internal tooling?
20:32:33FromDiscord<ambient3332> Yeah I also thought func was about being strictly, explicitly side-effect free
20:32:57FromDiscord<ambient3332> Although mixing these paradigms may cause more headaches than they solve IMHO
20:33:00FromDiscord<.bobbbob> In reply to @leorize "depends on how your": do I need to close a db at the end of a route?
20:33:35FromDiscord<leorize> are you opening them per route instead of opening once?
20:34:09FromDiscord<whisperecean> @leorize Are you using Norm?
20:34:38FromDiscord<leorize> nope
20:35:51FromDiscord<.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:46FromDiscord<leorize> most dbs should be thread safe though
20:37:13FromDiscord<leorize> anyhow, if you open once per route then you must close whenever you finish your work
20:38:34FromDiscord<.bobbbob> ok Ill give it a try
20:41:41FromDiscord<.bobbbob> prolouge routes are async, does that impact anything with having a global db variable?
20:42:07FromDiscord<leorize> it shouldn't
20:42:19FromDiscord<leorize> what db are you using?
20:43:13FromDiscord<.bobbbob> norm with sqlite
20:44:29FromDiscord<Phil (he/him)> I have the same setup, if you still have questions 14h from now I'm happy to answer↵(@.bobbbob)
20:44:53FromDiscord<leorize> then you need one connection per thread↵(@.bobbbob)
20:45:37FromDiscord<leorize> I suppose a threadvar might work, but I'm not familiar with how prologue does it's thing
20:46:23FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:46:35FromDiscord<sOkam! 🫐> (edit)
20:48:00FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:49:06FromDiscord<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:33FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:52:09FromDiscord<whisperecean> For anyone using Norm how do I connect to a db?
20:52:13FromDiscord<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:23FromDiscord<sOkam! 🫐> (edit)
20:52:34FromDiscord<sOkam! 🫐> (edit)
20:57:10FromDiscord<.bobbbob> In reply to @whisperecean "For anyone using Norm": let db = open(dbPath, "", "", "") but apparaently dont trust me too much
20:57:22FromDiscord<.bobbbob> (edit) "apparaently" => "apparently"
20:58:22FromDiscord<whisperecean> This creates a file on localhost 😄
20:58:48FromDiscord<leorize> if you're using sqlite then ofc it will do that \:p
20:59:37FromDiscord<whisperecean> I wanna connect to a remote postgres
21:04:15FromDiscord<leorize> then make sure you import norm/postgres
21:04:15FromDiscord<leorize> https://norm.nim.town/pool.html↵↵looks like there's already a built in solution for you↵(@.bobbbob)
21:07:06FromDiscord<asakura44> In reply to @treeform "I almost never use": are you sure about this ?
21:07:57FromDiscord<asakura44> is echoing considered a side effect ?
21:08:59FromDiscord<asakura44> hmm maybe right is it because it is trying to write ? but weird why returning is not considered a side effect ?
21:10:12FromDiscord<leorize> it's a side effect, just one of those that would be better off pretended as not one
21:10:32FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=html>
21:11:30FromDiscord<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:32FromDiscord<albassort> yo, treeform
21:11:49FromDiscord<whisperecean> @leorize where do you see it? :M
21:13:34FromDiscord<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:57FromDiscord<treeform> that's why you got ot use debugEcho which is echo that says it has no sife-effects
21:15:04FromDiscord<treeform> but to me echo is always for debugging
21:15:38FromDiscord<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:44FromDiscord<leorize> wdym?↵(@whisperecean)
21:45:32FromDiscord<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:52FromDiscord<leorize> for example, `newException` ceases to work \:p
21:48:42FromDiscord<Elegantbeef> But yea all code that uses it ceases to function
21:48:43FromDiscord<leorize> imagine writing a proper write tracker
21:48:45FromDiscord<Elegantbeef> I mean I'm dumb enough I cannot imagine that
22:12:32FromDiscord<nnsee> kind of unrelated but I despise tailwind for the exact same reason i despise inline styles: mixing markup with presentation
22:12:37FromDiscord<nnsee> it's ugly and it makes me feel icky
22:16:19FromDiscord<leorize> although lets be real, html is a mess of a presentation-oriented markup now
22:17:02FromDiscord<leorize> we add `div`s like no tomorrow just to get some styling working, not much markup there anymore
22:20:46FromDiscord<Elegantbeef> They insulted our divs but I was not a web developer so did nothing
22:21:54FromDiscord<leorize> \:p
22:23:12FromDiscord<leorize> though tailwind make for super clutter code because it pretends that we only change one css attribute at a time
22:34:38FromDiscord<.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:27FromDiscord<nasuray> In reply to @heysokam "that would be for": Why not just run tailwind on the nim source directly?
22:47:34FromDiscord<leorize> In reply to @.bobbbob "so what's the right": your program should know how to shutdown gracefully
22:48:34FromDiscord<.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:02FromDiscord<leorize> you'd have to tell it
22:49:33FromDiscord<leorize> sqlite is good enough that you can crash and probably won't lose data, but I won't bank on that
22:50:00FromDiscord<.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:22FromDiscord<leorize> that's the neat part, you have to close it when you still have it
22:50:35FromDiscord<leorize> you can never open a database then lose the connection object
22:50:40FromDiscord<leorize> it has to be somewhere
22:50:52FromDiscord<leorize> if you don't need it, then close it on the spot
22:53:29FromDiscord<.bobbbob> I see
22:54:03FromDiscord<leorize> usually in stuff like go there's a cancellation signal that can be issued
22:54:21FromDiscord<leorize> your thread would check for this signal, then stop whatever its doing immediately
22:55:03FromDiscord<leorize> that way all finalizers will be executed until the point where the program can be shutdown
22:55:39FromDiscord<leorize> i'm not aware of any technique to do the same in nim, unfortunately
23:11:18FromDiscord<Robyn [She/Her]> I wonder how hard it actually is to create an Android app without the ndk, is that even doable?
23:11:49FromDiscord<leorize> people do that all the time
23:13:58FromDiscord<leorize> i'd wager that most apps on the play store don't need the ndk
23:18:57FromDiscord<Robyn [She/Her]> Oh huh
23:21:04*Jjp137 quit (Quit: Leaving)
23:31:04FromDiscord<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:16FromDiscord<leorize> you could try seeing what qt uses as a template
23:34:09FromDiscord<Elegantbeef> https://lisyarus.github.io/blog/programming/2023/07/19/porting-for-android.html#bare-bones
23:49:47FromDiscord<Robyn [She/Her]> Ah well that's interesting-
23:59:53FromDiscord<sOkam! 🫐> In reply to @nasuray "Why not just run": iis that possible?