<< 27-10-2023 >>

00:29:48*beholders_eye quit (Ping timeout: 260 seconds)
00:53:41*ox joined #nim
00:54:18*oz quit (Ping timeout: 260 seconds)
00:58:16*NimEventer quit (Ping timeout: 260 seconds)
00:58:20*xet7 joined #nim
00:58:28*NimEventer joined #nim
00:59:27FromDiscord<typistx> newbie here, just read the compiler manual quickly, it mentions there is no signal handler in nim as in posix, how to do signal handling in nim then?
01:00:52FromDiscord<typistx> "The Nim programming language has no concept of Posix's signal handling mechanisms."
01:09:55Amun-Rathere are signals in std/posix
01:09:59termerYou can handle some easily like SIGINT, there's something like onCtrlC
01:10:06termerI forget the naney
01:10:08termername
01:19:40Amun-RasetControlCHook
02:53:39FromDiscord<takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4K3T
02:54:36FromDiscord<takemichihanagaki3129> (edit) "https://play.nim-lang.org/#ix=4K3T" => "https://play.nim-lang.org/#ix=4K3U"
02:56:29FromDiscord<Elegantbeef> `typ: typedesc` and `when typ is string`
03:15:09*marcus quit (Read error: Connection reset by peer)
03:16:01*marcus joined #nim
03:16:08FromDiscord<takemichihanagaki3129> In reply to @Elegantbeef "`typ: typedesc` and `when": Thank you!
03:30:36FromDiscord<girvo> Dumb question: why does `std/asyncnet` have `isClosed(sock: AsyncSocket): bool` but `std/net` doesn't have an `isClosed` for `Socket`? Am I missing something obvious? (quite likely tbh)
03:32:51FromDiscord<girvo> Could I `getFd()` and check if it's closed that way?
03:33:08FromDiscord<girvo> Or do I need to handle this `socket.closed` state tracking myself via the return val of `recv` and similar
03:38:07*rockcavera quit (Remote host closed the connection)
03:49:19FromDiscord<jviega> getFd() should return you the fd, then call fcntl(fd, F_GETFD)
03:50:23FromDiscord<jviega> Not that I know why you'd ever want to do that
03:50:29FromDiscord<jviega> The fd can get reassigned if closed
03:51:40FromDiscord<jviega> Generally you know when a fd is closed when a read or write fails w/o an interrupt, then you do the accounting 🙂
04:22:48FromDiscord<treeform> In reply to @chronos.vitaqua "The answer was yes": Thoughts? https://github.com/treeform/debby/pull/5/files
04:55:06FromDiscord<gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4K47
04:55:32FromDiscord<Elegantbeef> float.low
04:55:33FromDiscord<Elegantbeef> and float.high
04:56:21FromDiscord<Elegantbeef> Or `Inf` and `NegInf`
05:06:00FromDiscord<gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4K4a
05:09:05FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4K4c
05:12:45FromDiscord<gyatsoyt> In reply to @demotomohiro "Probably `getAttr` proc you": Umm what could be the solution
05:22:15FromDiscord<demotomohiro> Read manual or source code to check if which module export that proc and proc signature.
05:31:40FromDiscord<TӨMΛ ☠> sent a code paste, see https://play.nim-lang.org/#ix=4K4h
05:32:00FromDiscord<TӨMΛ ☠> Installed it through Nimble, if that helps with anything 🤷‍♂️
05:32:11FromDiscord<Elegantbeef> Does that package ship zlib?
05:32:13FromDiscord<Elegantbeef> Don't recall
05:38:04FromDiscord<demotomohiro> In reply to @toma400 "Tried using `zip` package,": It seems you need to install https://zlib.net/
05:39:27FromDiscord<TӨMΛ ☠> In reply to @demotomohiro "It seems you need": Ewhhh, dependency that is not listed on GitHub site, that makes sense. Will try, thank you ❤️
05:39:46FromDiscord<Elegantbeef> Could always use zippy if you don't want an external dep
05:44:05FromDiscord<TӨMΛ ☠> In reply to @Elegantbeef "Could always use zippy": Thought of it too, but their documentation is really rough to read
05:44:43FromDiscord<TӨMΛ ☠> Examples don't have compression, only unpacking, and docs are not enough straightforward for someone like me :x
05:49:47FromDiscord<demotomohiro> zlib is a popular C library and install on many Linux machine but not on windows.↵Maybe that is why dependency to zlib is not list.
05:59:54*advesperacit joined #nim
06:01:59FromDiscord<TӨMΛ ☠> Yeah, this checks out
06:02:24FromDiscord<TӨMΛ ☠> If anyone have some tutorial on how to generally learn installing such annoying dependencies, I'd be thankful
06:03:01FromDiscord<TӨMΛ ☠> I have no idea how to even start with it, C source code make me confused af on how to make it DLL and where, and DDL is not really recognised
06:03:07FromDiscord<TӨMΛ ☠> Ewh
06:03:21FromDiscord<TӨMΛ ☠> (edit) "I have no idea how to even start with it, C source code make me confused af on how to make it DLL and where, and ... DDL" added "pre-downloaded"
06:03:29FromDiscord<nnsee> In reply to @toma400 "If anyone have some": step 1. install linux 😅
06:04:25FromDiscord<Elegantbeef> Eh in this case there is an argument for just having a `-d:zlibUseSource`
06:05:08FromDiscord<nnsee> the predownloaded dll doesn't work without the corresponding header file - the header file is the one that actually allows the compiler to link against this dependency (ie, what functions and with which signatures)
06:05:20FromDiscord<nnsee> i'm not too sure how compilers or linking in general works in windows though
06:05:48FromDiscord<Elegantbeef> Mostly the same
06:06:02FromDiscord<Elegantbeef> They likely do not have the header in their include path and it's erroring
06:06:17FromDiscord<Elegantbeef> All in all a fork should be made that submodules zlib
06:09:47FromDiscord<inventormatt> the tests folder in zippy do show some examples of compressing
06:09:51*junaid_ joined #nim
06:12:41*junaid_ quit (Remote host closed the connection)
06:17:05FromDiscord<Chronos [She/Her]> In reply to @treeform "Thoughts? https://github.com/treeform/debby/pull/5/": Ah, that was what I did first, but if you try passing `it` to a function, it has some difficulties iirc, not at my PC rn
06:17:23*nyeaa4928423010 quit (Read error: Connection reset by peer)
06:17:42*nyeaa4928423010 joined #nim
06:27:08FromDiscord<demotomohiro> In reply to @toma400 "Yeah, this checks out": My article might help: https://internet-of-tomohiro.netlify.app/nim/clibrary.en
06:27:56FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "Ah, that was what": Causes runtime issues with the query iirc, syntax error
06:35:40FromDiscord<gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4K4u
06:37:05FromDiscord<Chronos [She/Her]> Hm, I don't understand the error, could you post the full code?
06:37:07FromDiscord<Elegantbeef> your proc is `endGame = bool`
06:37:13FromDiscord<Elegantbeef> not `endGame = false` or `endGame = true`
06:37:48FromDiscord<Chronos [She/Her]> Aah I missed that
06:38:52FromDiscord<demotomohiro> In reply to @gyatsoyt "Code: this is line": Or set proc parameter type like `proc foo(b: bool, x: int)`
06:38:54FromDiscord<gyatsoyt> bool means true or false right
06:40:01FromDiscord<gyatsoyt> Nvm there was a little typo in my code fixed that error
06:53:06FromDiscord<gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4K4x
06:53:33FromDiscord<Elegantbeef> `square` is a PyObject
07:05:43FromDiscord<gyatsoyt> In reply to @Elegantbeef "`square` is a PyObject": Yes but how can I use it ?
07:06:10FromDiscord<Elegantbeef> No clue I don't use the python library
07:06:31FromDiscord<Chronos [She/Her]> In reply to @gyatsoyt "The line which throws": Is square a Python string?
07:06:37FromDiscord<gyatsoyt> In reply to @chronos.vitaqua "Is square a Python": Yes
07:06:48FromDiscord<gyatsoyt> Its python idk about string
07:08:25FromDiscord<nnsee> square is a python object
07:08:26FromDiscord<nnsee> https://python-chess.readthedocs.io/en/latest/core.html#chess.square
07:10:43FromDiscord<nnsee> actually, looking at the code, it seems to be an alias for int https://github.com/niklasf/python-chess/blob/615a21b4ca7679c51388159324f2a9545868f6f1/chess/init.py#L160
07:11:22FromDiscord<gyatsoyt> In reply to @nnsee "actually, looking at the": Umm so what do I have to do
07:12:23FromDiscord<nnsee> call `.to(int)` on the square, maybe
07:12:26FromDiscord<nnsee> no clue
07:12:38FromDiscord<nnsee> i haven't used nimpy myself
07:13:00FromDiscord<nnsee> but that's what's done in the very basic example in the readme https://github.com/yglukhov/nimpy#calling-python-from-nim
08:05:40FromDiscord<shourchats> new to nim, is using references in nim that common as you would in c
08:06:05FromDiscord<shourchats> (edit) "new to nim, is using references in nim that common as you would ... in" added "with pointers"
08:07:53FromDiscord<Phil> In reply to @shourchats "new to nim, is": I mean both value and ref types are often used, but honestly the "default" is more value-types from what I can see.
08:08:33FromDiscord<Phil> Though I have no idea how common pointers are in C. My only point of contact with it is my wrapping some widgets of GTK
08:08:57Amun-Rapointers are very common in C
08:10:44Amun-RaC always uses pass by value
08:12:03Amun-Ranim does that "under the hood"
08:12:46Amun-Rathat (using pointers)
08:18:48FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "Causes runtime issues with": Hey Treeform, whenever you're on, I've submitted a PR for checking if `it` is being passed to a call (though it doesn't do it recursively, it probably should tbh), and also made it so `innerFilter` accepts `db` and `it` so they aren't hardcoded
08:19:02FromDiscord<Chronos [She/Her]> For `it`, doesn't really matter, but it makes sense for `db` imo
08:19:16FromDiscord<Chronos [She/Her]> Since I'm storing `Db` in another type
08:19:34FromDiscord<shourchats> nim always pases by reference i guess?
08:20:16FromDiscord<shourchats> or by value?
08:20:18Amun-Rashourchats: (long time since I looked at the internals but) nim passes by pointer large…ish objects
08:20:53Amun-Rayou don't have to think about that in nim, nim does that foryou
08:21:22Amun-Raref objects are tracked by GC, non-ref ones are not, that's the biggest difference
08:21:49FromDiscord<shourchats> by ref you mean like reference like pointers in nim?
08:22:39Amun-Raref is a keword used for data tracked by GC
08:22:40FromDiscord<Phil> In reply to @shourchats "by ref you mean": Yeah. The difference between ref and pointer (both of which are concepts nim has) is that ref's are counted and tracked.↵If the ref count reaches 0, the object is freed (under the ARC/ORC memory management strategy)
08:22:56FromDiscord<Phil> This is not the case for pointer, which may matter if you interact with C code that has pointers
08:23:00*kenran joined #nim
08:23:14FromDiscord<shourchats> yea
08:23:21FromDiscord<Phil> On that note, using pointers is basically the only way to really do "unsafe" code to trigger use-after-free's etc.
08:23:29Amun-Rayes, nim has "raw pointers" too, I wouldn't recommend them for young players
08:24:28FromDiscord<Phil> Aye, agreed
08:26:21FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "Since I'm storing `Db`": https://github.com/Yu-Vitaqua-fer-Chronos/debby/actions/runs/6664750580/job/18112970910 tests also pass (It's in another branch due to me forgetting to accept the workflow agreement initially)
08:28:53FromDiscord<shourchats> sent a code paste, see https://play.nim-lang.org/#ix=4J3o
08:30:04FromDiscord<Elegantbeef> In Nim `ref` is always a gc'd heap allocated block of memory
08:30:33FromDiscord<Elegantbeef> For mutable references to variables you use `var T` inside the procedure parameter list
08:30:56FromDiscord<pcarrier> > We won't be adapting to Nimble any time soon, as clearly there are several better package manager options.
08:31:24FromDiscord<pcarrier> (edit) ">" => "seen in a PR:↵>" | "options." => "options.↵that wasn't clear to me, anything worth looking into? 🙂"
08:31:46FromDiscord<Elegantbeef> What PR?
08:32:50FromDiscord<shourchats> sent a code paste, see https://play.nim-lang.org/#ix=4J5E
08:33:49FromDiscord<Elegantbeef> Nothing
08:33:53FromDiscord<Elegantbeef> It's a stack allocated variable
08:33:58FromDiscord<shourchats> oh lol
08:33:58FromDiscord<Elegantbeef> There is no GC for stack variables
08:34:06FromDiscord<shourchats> bruh ok
08:34:22FromDiscord<Phil> It passes references to the stack variable to other places that mutate it right?
08:34:48FromDiscord<Elegantbeef> `var T` is a pointer yes
08:35:00FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4J8O
08:35:06FromDiscord<Phil> Ah, you were faster than I could prototype an example
08:35:33FromDiscord<Elegantbeef> also phil that's a funny way of writing `x += x` 😛
08:36:58FromDiscord<shourchats> what about blocks
08:37:03FromDiscord<shourchats> they are like python?
08:37:25FromDiscord<Elegantbeef> No clue
08:37:45FromDiscord<shourchats> ... uhh
08:38:04FromDiscord<Elegantbeef> Believe it or not some people do not write python
08:38:37FromDiscord<shourchats> ok lol
08:39:21FromDiscord<Phil> Define an example regarding blocks
08:39:34FromDiscord<Phil> I did write python but it's been a couple years at this point
08:41:08FromDiscord<gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4J9i
08:41:26FromDiscord<Elegantbeef> Reread the error message
08:41:32FromDiscord<shourchats> sent a code paste, see https://play.nim-lang.org/#ix=4JcC
08:41:45FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Jez
08:41:49FromDiscord<Elegantbeef> No
08:41:53FromDiscord<Elegantbeef> Not only that
08:42:01FromDiscord<Elegantbeef> They need to provide the exception type
08:42:14FromDiscord<Chronos [She/Her]> `import std/strformat` then `&"hello"`
08:42:19FromDiscord<Chronos [She/Her]> Ah
08:42:27FromDiscord<Chronos [She/Her]> I just read the code :p
08:42:42FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Jix
08:42:44FromDiscord<Phil> Wait, that's nim code
08:43:07FromDiscord<Chronos [She/Her]> sent a code paste, see https://paste.rs/bnKjE
08:44:33FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Jnq
08:44:45FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4Jnq" => "https://paste.rs/2EqRk"
08:48:27FromDiscord<gyatsoyt> In reply to @Elegantbeef "They need to provide": What kinds of types are there where can I find them
08:52:12FromDiscord<shourchats> any replacement to "echo" which is a function lol
08:52:35FromDiscord<Phil> There actually is no list in the docs, but VSCode provides them with autosuggest if you start writing "error"
08:53:02FromDiscord<Phil> In reply to @shourchats "any replacement to "echo"": You mean propper logging?
08:53:16FromDiscord<shourchats> like a printing function
08:53:18FromDiscord<Phil> Other than that you can of course also write echo the way it would as a function:↵`echo("still running")`
08:54:15FromDiscord<shourchats> oh ok
08:54:19FromDiscord<Phil> Nim as uniform call syntax (UFCS).↵These ways of syntax are all the same:↵↵`myvar.myProc`, `myvar.myProc()`, `myProc myvar`, `myProc(myvar)`
08:54:24FromDiscord<Phil> (edit) "as" => "has"
08:54:37FromDiscord<shourchats> oh so functions can be called without ()
08:54:54FromDiscord<Phil> Yep, and the first parameter of a proc can be used as "starting point" to call a proc
08:55:25FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JoL
08:56:10FromDiscord<shourchats> wow
08:56:36FromDiscord<Phil> You'll need to hammer down style-guidelines for yourself if you want to have any chance of consistent code writing ^^
08:56:59FromDiscord<Phil> What this does emphasize though is that the first parameter typically is the "most important"
09:22:03*junaid_ joined #nim
09:22:30FromDiscord<Chronos [She/Her]> I wonder if there's times where JIT generated code is faster than just being compiled
09:26:15FromDiscord<Phil> That debate is happening in internals right now, could ask there 😛
09:26:37FromDiscord<Chronos [She/Her]> Didn't wanna distract Araq :p
09:27:36FromDiscord<Chronos [She/Her]> Asked :p
09:28:32PMunchI guess it would be theoretically possible since it has more information to optimise during runtime
09:28:54FromDiscord<Chronos [She/Her]> Yeah I asked
09:29:43FromDiscord<Chronos [She/Her]> Araq said he doesn't really know if JITed Nim code could be faster bc usually yeah, JITs are done for dynamic languages and stuff
09:33:45*kenran quit (Remote host closed the connection)
09:39:38FromDiscord<gyatsoyt> In reply to @isofruit "There actually is no": I am not on vs code rn it's replit
09:41:45FromDiscord<Chronos [She/Her]> Hm... Not sure how I'd restructure my code into multiple files rn
09:45:45FromDiscord<Phil> sent a code paste, see https://paste.rs/KCEGO
09:46:19FromDiscord<Phil> Note that you can make your own Errors by subclassing from CatchableError
09:46:52FromDiscord<Phil> Error = Runtime error (can be caught by a try-except)↵Defect = Compiletime error (can't / should never be caught by a try-except)
09:48:53FromDiscord<Chronos [She/Her]> Inheriting, we don't have classes :p
09:49:21FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JyT
09:49:33FromDiscord<Chronos [She/Her]> In reply to @isofruit "Error = Runtime error": Saying defect is compile time is a bit misleading imo
09:49:59FromDiscord<Chronos [She/Her]> It's runtime, but you're not supposed to catch it at all, and should rewrite your code so it doesn't get thrown in the first place
09:50:01FromDiscord<Phil> Fair-ish, I guess it's more "Defect = Rust Panic = Your Application must die now"
09:50:08FromDiscord<Chronos [She/Her]> Yeah
09:50:14FromDiscord<Phil> I'll update it
09:50:47*beholders_eye joined #nim
09:52:09FromDiscord<freakyHipster> Hello again people of nim
09:52:20FromDiscord<Chronos [She/Her]> Epic :)
09:52:24FromDiscord<Chronos [She/Her]> In reply to @freakyHipster "Hello again people of": o7
09:53:25FromDiscord<freakyHipster> I need to support a debian 9 system and I get an error complaining about wrong glibc version
09:54:11FromDiscord<freakyHipster> I'd usually just compile this on a debian 9 system but I can't even get curl running in debian9 container
09:54:28*junaid_ quit (Remote host closed the connection)
09:54:52FromDiscord<freakyHipster> And I be happy for any easy way to cross compile for Mac as well 🙂
09:55:07FromDiscord<Phil> If you want to compile for specific glibc versions I'd recommend telling nim to use the zig-compiler for compiling the generated c code into a binary
09:55:24FromDiscord<freakyHipster> Sounds great 😄 how tho?
09:55:38FromDiscord<Phil> https://stackoverflow.com/questions/73345643/how-to-use-the-zig-compiler-in-order-to-compile-nim-code↵This provides a small guide on how to do so with also the flags needed to tell the zig compiler to compile for specific glibc versions
09:56:03FromDiscord<freakyHipster> Cheers ❤️
09:56:11FromDiscord<Phil> You may want to use the package from enthus1ast that I linked in the question as I believe he made that extra easy
09:56:19FromDiscord<Chronos [She/Her]> In reply to @freakyHipster "I'd usually just compile": Do you not have access to `apt` in the container?
09:56:36FromDiscord<freakyHipster> Yes but apt install curl will break
09:57:18FromDiscord<freakyHipster> Had to change repo to archive.debian.org as well otherwise even apt update fails
09:57:56FromDiscord<Chronos [She/Her]> Huh
09:58:04FromDiscord<freakyHipster> And I have debian 8 running somewhere too but that's pretty much hopeless at this point
09:58:13FromDiscord<griffith1deadly> In reply to @freakyHipster "And I be happy": https://github.com/heysokam/confy↵i think you can use zigcc for this
09:58:22FromDiscord<Phil> ~~It's kinda cool to at this point be at a level where I can answer like half of the more low-level-ish style questions~~
09:59:42FromDiscord<freakyHipster> I had a nice docker container for 1.6 but kinda struggles with 2.0 for Mac cross compile
10:01:43FromDiscord<freakyHipster> Kinda falling in love with zig
10:05:05FromDiscord<Phil> I heard good things, but I don't think the lang is for me because it doesn't have that "You can opt into complexity if you choose" aspect like nim does from what I can see
10:05:15FromDiscord<Phil> (edit) "I heard good things, but I don't think the lang is for me because it doesn't have that "You can opt into complexity ... if" added "for more performance"
10:26:49FromDiscord<nnsee> In reply to @freakyHipster "I need to support": could always statically compile
10:26:57FromDiscord<nnsee> ie with musl-gcc
10:27:04FromDiscord<nnsee> it's not very difficult at all
10:39:11FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4JJr
10:39:28FromDiscord<Chronos [She/Her]> The lock is there because there's a non-zero chance some stuff is happening in a thread
10:40:40FromDiscord<odexine> If it’s blocking then the culprit is probably in that filter procedure
10:40:52FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4JJE
10:41:31FromDiscord<Phil> In reply to @nnsee "could always statically compile": Ironically enough I've only ever done dynamic linking with musl IIRC
10:42:08FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "for what you use": Something may happen in a thread elsewhere
10:42:32FromDiscord<Chronos [She/Her]> In reply to @odexine "If it’s blocking then": Gucci, it should be fine then
11:00:45FromDiscord<Chronos [She/Her]> Ah anyone with an understanding of SQL, what's the reasoning for using fields as indexes?
11:10:22advesperacithttps://use-the-index-luke.com/
11:12:12advesperacitThat's a great resource for learning about SQL performance, I bought the book in physical form several years ago
11:12:47FromDiscord<Chronos [She/Her]> Oh epic! Thanks!
11:18:07FromDiscord<ingo_61476> sent a code paste, see https://play.nim-lang.org/#ix=4K4L
11:31:58FromDiscord<freakyHipster> In reply to @nnsee "could always statically compile": Sounds good.↵Any link to a guide or somesuch
11:43:27FromDiscord<nnsee> In reply to @freakyHipster "Sounds good. Any link": tl;dr `nim --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc --passL:-static c hello.nim`
11:43:45FromDiscord<nnsee> assuming you have musl-gcc installed
11:44:02FromDiscord<nnsee> that varies on whatever OS you're using
11:44:12FromDiscord<nnsee> for a longer guide https://scripter.co/nim-deploying-static-binaries/
11:56:01FromDiscord<Phil> In reply to @nnsee "tl;dr `nim --gcc.exe:musl-gcc --gcc.linkerexe:musl-": Ahhhh the -static flag is the difference between static compiling musl and linking to it
12:04:17FromDiscord<nnsee> indeed
12:19:33*ox is now known as oz
12:28:13FromDiscord<Chronos [She/Her]> Debby doesn't seem to be finding my query... :/
12:28:19FromDiscord<Chronos [She/Her]> `SELECT FROM login WHERE ((service_user=?)and(service=?))`
12:28:27FromDiscord<Chronos [She/Her]> And the parameters given are correct
12:28:31FromDiscord<Chronos [She/Her]> It's the right table
12:28:35FromDiscord<Chronos [She/Her]> Yet... Nothinh
12:33:48*edr joined #nim
12:36:27FromDiscord<Chronos [She/Her]> Aah, the type
12:36:45FromDiscord<Chronos [She/Her]> Not the type
12:37:13FromDiscord<Chronos [She/Her]> The `service` is the issue, the string in the db is surrounded by quotes which is just wrong
12:45:16FromDiscord<Chronos [She/Her]> Rn I'm not sure how I'm supposed to store bytes in the Db with parse hook :p
12:58:47FromDiscord<Chronos [She/Her]> Ig I'll just use the string representation for now but still a bit annoyinh
12:58:51FromDiscord<Chronos [She/Her]> annoying
13:00:57FromDiscord<Chronos [She/Her]> Epic this all works
13:02:24FromDiscord<Chronos [She/Her]> Time to work on an actual account system that isn't backed by anything else 🥲
13:27:07FromDiscord<Phil> Backed as in?
13:27:25FromDiscord<treeform> I have a special binary type, as dabs handle strings oddly
13:27:36FromDiscord<treeform> (edit) "dabs" => "DBs"
13:27:41NimEventerNew Nimble package! htmlparser - Parse a HTML document in Nim., see https://github.com/nim-lang/htmlparser
13:35:16FromDiscord<Chronos [She/Her]> In reply to @isofruit "Backed as in?": Local accounts
13:35:59FromDiscord<Chronos [She/Her]> In reply to @treeform "I have a special": Yeah, not sure how to use that for `sqlDumpHook` or `sqlParseHook` sadly
13:36:07FromDiscord<Phil> I don't follow. So basically you just need to figure out the schema for an account table?
13:36:34FromDiscord<Phil> If so, you can always just copy the schema django uses (if you want that level of being able to restrict access)
13:36:55FromDiscord<Phil> And even if you don't you can still use their schema and just build a different permission management system
13:37:08FromDiscord<Chronos [She/Her]> In reply to @isofruit "I don't follow. So": I know how it'll be laid out, just annoyed it didn't magically exist lol
13:37:24*marcus quit (Remote host closed the connection)
13:37:34FromDiscord<Phil> Can always make a helper package 😛
13:38:15*marcus joined #nim
13:38:31FromDiscord<Chronos [She/Her]> For accounts and such? I'd imagine the usecase varies wildly
13:43:34*rockcavera joined #nim
13:44:13FromDiscord<Phil> In reply to @chronos.vitaqua "For accounts and such?": The core thing fascinatingly doesn't and if you allow yourself to assume you're on an SQL table it's in fact not a problem
13:44:41FromDiscord<Phil> The core thing is always just to get a list of all users you have. Maybe add an additional column to allow users to "delete" themselves
13:44:44FromDiscord<Chronos [She/Her]> I'm using Debby for this anyway :P
13:45:02FromDiscord<Phil> If you need application specific data you can always make a separate table and join that to the first via FK relationship
13:45:10FromDiscord<Chronos [She/Her]> FK?
13:45:11FromDiscord<Phil> The performance won't really hurt all that much
13:45:15FromDiscord<Phil> FK = Foreign Key
13:45:22FromDiscord<Phil> That would be a 1 to 1 relationship
13:45:22FromDiscord<Chronos [She/Her]> Don't know what that is
13:45:36FromDiscord<Chronos [She/Her]> Is it basically just a unique value pointing to another table?
13:45:41FromDiscord<Phil> Okay so my first recommendation before you do anything else is work through an SQL workshop 😛
13:45:49FromDiscord<Chronos [She/Her]> Lmao
13:46:01FromDiscord<Phil> In reply to @chronos.vitaqua "Is it basically just": Yeah but there are various optimizations and Constraints you can add on top
13:46:03FromDiscord<Chronos [She/Her]> I did Microsoft Access in college if that counts for anything lmao
13:46:14FromDiscord<Phil> In reply to @chronos.vitaqua "I did Microsoft Access": It doesn't, off with you to the SQL bootcamp 😛
13:46:21FromDiscord<Chronos [She/Her]> Lmao
13:46:41*dogtor joined #nim
13:46:43FromDiscord<Chronos [She/Her]> Hey, I just wanna make this all good enough, doesn't have to be good :P
13:47:01FromDiscord<Phil> Nono, it's fine if the code isn't perfect, but you should be 😛 So work on it!
13:47:37FromDiscord<Chronos [She/Her]> But mama said my imperfections make me unique 🥺
13:48:11FromDiscord<Phil> https://www.w3schools.com/sql/default.asp↵w3schools is a fair start, traversy media has a fair few solid videos:↵https://www.w3schools.com/sql/default.asp
13:48:16FromDiscord<Phil> (edit) "videos:↵https://www.w3schools.com/sql/default.asp" => "videos:↵https://www.youtube.com/results?search_query=traversy+media+sql+crash+course"
13:48:39FromDiscord<Chronos [She/Her]> I do understand a small amount of SQL, though actually becoming decent at it is probably a good idea, I'll read up on it when I'm home
13:48:50FromDiscord<Phil> In reply to @chronos.vitaqua "But mama said my": That's for your human being side, not your programmer side. As a programmer your imperfections make you less efficient to work with 😛
13:49:02FromDiscord<Chronos [She/Her]> 😔
13:49:13FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "I do understand a": of this reason i'm still using orm's or mongodb
13:49:53FromDiscord<Phil> In reply to @griffith1deadly "of this reason i'm": I mean, I know a fair bit of SQL and I still use ORM because ain't nobody got time for writing simple insert/update/delete/read SQL statements for every flipping table
13:49:59FromDiscord<Phil> (edit) "ORM" => "ORMs"
13:50:24FromDiscord<Phil> Writing actual SQL is for more complicated stuff like recursive queries or grouping
13:50:50FromDiscord<Chronos [She/Her]> Recursive queries?
13:50:52FromDiscord<Phil> But you still should know a fair bit about setting up Schemas because the value they provide you even in the medium term is (imo) immense
13:51:27FromDiscord<Phil> In reply to @chronos.vitaqua "Recursive queries?": Imagine you have a tree structure. Like article-sections that are within article-sections, that are within article-sections
13:51:36FromDiscord<Phil> Each entry of an article-section only has the ID of its direct parent
13:52:05FromDiscord<Phil> Now you have a row of an article-section and want to get the id of the "root" section where parentSectionId is NULL
13:52:16FromDiscord<Phil> You are now in recursive query land
13:52:26FromDiscord<Phil> Where things are fun and not at all hard to read
13:52:31FromDiscord<Chronos [She/Her]> Lol
13:52:41FromDiscord<Chronos [She/Her]> I could probably do that if I had access to google tbf
13:53:08FromDiscord<treeform> I have tests to show how binary data works?
13:53:24FromDiscord<treeform> I could add that to read me
13:53:30FromDiscord<Chronos [She/Her]> Do you? I must've missed them aha, I'll look right now
13:53:41FromDiscord<Chronos [She/Her]> Yeah adding to the README would be great
13:53:54FromDiscord<Phil> Oh, another example:↵You have a "location" table where a location can be inside a location. Like a house is in a street is in a city is in a county is in a country is in a nation is in a continent is on a planet
13:54:10FromDiscord<Phil> Also a recursive relationship
13:54:33FromDiscord<Phil> Why did I remember that? Because that's the case where I had recursive queries
13:54:54FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K55
13:55:01FromDiscord<treeform> https://github.com/treeform/debby/blob/master/tests/common_test.nim#L214-L236
13:55:17FromDiscord<Chronos [She/Her]> In reply to @treeform "I have tests to": Oh wait I see it, but I wanted to be able to have custom hooks for it tbh
13:55:42FromDiscord<Chronos [She/Her]> sent a code paste, see https://paste.rs/FBqyy
13:56:01FromDiscord<Phil> What are you taaaaaalking about, this is recursive query land, where people only have fun and good thoughts!
13:56:25FromDiscord<treeform> Every DB handles binary data differently. But here is a hook for pg: https://github.com/treeform/debby/blob/master/src/debby/postgres.nim#L402-L422
13:57:04FromDiscord<Chronos [She/Her]> Aaah okay, that's good to know now
13:57:25FromDiscord<treeform> Only Sqlite supports binary data "natively", mysql and pg encode it in their respective formats
13:57:35FromDiscord<treeform> but really you could use base64 if you wanted
13:57:37FromDiscord<Chronos [She/Her]> Though, why did you make `Bytes` a `distinct string`? I'm curious
13:57:55FromDiscord<treeform> Because if you don't make it that it did not work
13:58:19FromDiscord<treeform> (edit) "if you don't make" => "that made" | removed "that it did not"
13:59:01FromDiscord<Chronos [She/Her]> Fair enough lol
13:59:15FromDiscord<Chronos [She/Her]> Thanks Treeform!
13:59:48FromDiscord<Chronos [She/Her]> Did you see the PR, btw?
14:00:10FromDiscord<Chronos [She/Her]> I'm not sure how I'd add a test for a compile time error so I didn't, but yeah
14:00:46FromDiscord<treeform> `when compiles(...)/when not compiles(...)`
14:00:53*junaid_ joined #nim
14:01:07FromDiscord<Phil> In reply to @chronos.vitaqua "I'm not sure how": treeforms approach or testament
14:01:32FromDiscord<Phil> Testament works well enough imo, could use a few more docs but what it has is alright, I use it for compile-time validation in mapster
14:01:41FromDiscord<Phil> (edit) "Testament works well enough imo, could use a few more docs but what it has is alright, I use it for ... compile-time" added "testing"
14:01:42FromDiscord<Chronos [She/Her]> Aaah alright, that makes sense, I'll add the test for it when I get home then!
14:01:59FromDiscord<Chronos [She/Her]> In reply to @isofruit "treeforms approach *or* testament": Seeing as this is their library, I'll use their approach :p
14:02:30FromDiscord<Phil> 🤔 Seems almost sensible
14:02:53FromDiscord<Phil> How unusual!
14:03:08FromDiscord<Chronos [She/Her]> Hey, I can be sensible at times, once in a blue moon!
14:03:25FromDiscord<Phil> Makes sense, your pfp does have blue hair, the connection is apparent!
14:04:10FromDiscord<Chronos [She/Her]> Ah yes, my brain links up to the universal lunar network and all data is shared allowing for all unused servers to be utilised
14:04:21FromDiscord<Chronos [She/Her]> I don't know what I generated there, but it sure is a sentence
14:04:48FromDiscord<Phil> Those certainly are letters you have glued together
14:05:18FromDiscord<Chronos [She/Her]> Truely a sentence of letters
14:05:32FromDiscord<Chronos [She/Her]> A `seq[char]` if you would
14:06:12FromDiscord<Phil> Let's call it string, like stringing something together on a thread
14:06:29FromDiscord<Chronos [She/Her]> Threading? Where's the locks!
14:06:34FromDiscord<Phil> And let's not store the length, after all users can just figure that out themselves, that seems sensible and not at all annoying
14:06:50FromDiscord<Chronos [She/Her]> Ah, an UncheckedArray then
14:07:12FromDiscord<Phil> Also I think it makes no sense to indicate that it's an array, the dev sure can figure that out
14:07:19FromDiscord<Phil> Lets just hand the dev a pointer to the first element
14:07:26FromDiscord<Chronos [She/Her]> That works perfectly
14:07:40FromDiscord<Phil> And they have to figure out by consulting their closest god whether it's a single entry or a list of entries and how long it is
14:08:02FromDiscord<Chronos [She/Her]> Let's also make it null terminated for shits and giggles, this won't at all go poorly for communicating binary data
14:08:19FromDiscord<Phil> Yes, yes! Great minds think alike!
14:08:25FromDiscord<Chronos [She/Her]> Lmao
14:12:11*dogtor quit (Ping timeout: 260 seconds)
14:15:40*PMunch quit (Quit: Leaving)
14:56:40FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4K5f
14:57:59FromDiscord<dlesnoff> (edit) "https://play.nim-lang.org/#ix=4K5f" => "https://paste.rs/FrveB"
15:02:08FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4K5q
15:26:22arkanoidwhich Nim project you would consider worth reading to grasp idiomatic nim and good use of language features and type system?
15:27:33FromDiscord<Chronos [She/Her]> One of the stdlib modules, maybe?
15:27:39FromDiscord<Chronos [She/Her]> Like std/json? Not sure
15:27:45FromDiscord<Chronos [She/Her]> Maybe strutils?
15:38:25arkanoidisn't stdlib stuck in place due to backward compatibility, and so lacks many good idioms and ideas worth using in a nim 2.0 project?
16:06:24FromDiscord<leorize> if you want something that's focused on macro usage, cps is a good one to read
16:09:08FromDiscord<leorize> if you want something that tries to make the best use of distinct, see nim-sys\: https://github.com/alaviss/nim-sys
16:21:35*beholders_eye quit (Ping timeout: 240 seconds)
16:32:22*beholders_eye joined #nim
16:56:08*CO2 quit (Quit: WeeChat 4.1.0)
17:24:25*CO2 joined #nim
17:40:08*junaid_ quit (Remote host closed the connection)
17:40:54FromDiscord<Chronos [She/Her]> What are the usecases of a concept? When/where would I benefit from it?
17:45:32FromDiscord<Phil> In reply to @chronos.vitaqua "What are the usecases": I implement this thing that encapsulates an entire functionality.↵Like, let's say a sortable concept.↵I really don't give a crap what type you are, you could be a table for all I care, you just need to have a specific set of properties you need to satisfy so I can do my functionality with you
17:46:06FromDiscord<Phil> Concepts allow you to check for those properties very explicitly, in fact more closely than normal interface-concepts in other languages (that I'm aware of) do
17:47:53FromDiscord<Phil> Their general usecase is just reducing code duplication.↵Reusing code duplication across types that you'd normally think would have their own implementation but really don't need it if you look at it in a more generalized fashion
17:48:04FromDiscord<Phil> (edit) removed "duplication"
17:49:44FromDiscord<Chronos [She/Her]> Oh huh
17:50:02FromDiscord<Chronos [She/Her]> Sounds useful
17:50:14FromDiscord<Chronos [She/Her]> I wonder if streams could be implemented with this
17:50:19FromDiscord<Phil> sent a long message, see http://ix.io/4K61
17:50:43FromDiscord<Chronos [She/Her]> In reply to @isofruit "For example, I could": Makes sense
17:51:45FromDiscord<Phil> The main reason I didn't do it is at the time I didn't understand enough about concept and was more engrossed in just getting the idea behind Snorlogue to work, as it was my first form-generating project
17:51:57FromDiscord<Chronos [She/Her]> Fair enough aha
17:52:15FromDiscord<Phil> If you want a project where you could learn about it, that could be an interesting task though 😛
17:52:21FromDiscord<Phil> (edit) "If you want a project where you could learn about ... it," added "it/play around with"
17:52:59*beholders_eye quit (Ping timeout: 255 seconds)
17:53:54FromDiscord<Chronos [She/Her]> Maybe a rewrite of streams? :p↵Tho Araq said concepts wouldn't work with streams so
17:54:33FromDiscord<Phil> See, all the more reason to contribute for a Snorlogue refactor 😛
17:54:40FromDiscord<Chronos [She/Her]> :p
17:55:35*beholders_eye joined #nim
17:56:00FromDiscord<Chronos [She/Her]> Hm... Trying to figure out how to structure my code yet again-
17:56:18FromDiscord<Chronos [She/Her]> For users and such
18:00:58FromDiscord<Chronos [She/Her]> Code is odd
18:10:10*CO2 quit (Quit: WeeChat 4.1.0)
18:26:41NimEventerNew post on r/nim by Mcfattti: Like Most Things for Me on Android, Creating a Simple App Is Having Me Pull My Hair Out, see https://reddit.com/r/nim/comments/17hu18k/like_most_things_for_me_on_android_creating_a/
18:31:24FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K6e
18:31:42FromDiscord<Phil> How is that something you arrive at?
18:35:01*CO2 joined #nim
18:57:47FromDiscord<preemptible> @heteroing Hey! I wonder how you discovered the server 🙂
18:58:00FromDiscord<preemptible> (edit) "🙂" => ":omegalul:"
18:58:11FromDiscord<typistx> if leetcode coderpad etc supports nim, that will be really nice
18:58:37FromDiscord<preemptible> In reply to @typistx "if leetcode coderpad etc": This. That's why my solve rate is so low
19:00:12FromDiscord<preemptible> Codeforces supports freaking php and not Nim
19:13:17FromDiscord<Chronos [She/Her]> Hm... Does Debby encode seqs in a separate table or does it serialise them to JSON?
19:13:31FromDiscord<Chronos [She/Her]> Time to find out ✨
19:15:57*krux02 joined #nim
19:17:45FromDiscord<Chronos [She/Her]> Yep, encodes it as JSON
19:25:51FromDiscord<Chronos [She/Her]> So confused why my filter query isn't working now :/
19:26:20FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4K6r
19:26:32FromDiscord<Chronos [She/Her]> And I know when parsed, the ULID in the db is valid
19:27:11FromDiscord<Chronos [She/Her]> What I'm confused about is why `app.db.filter(State, it.val == ULID.parse(state.get()))` returns nothing... Moving `ULID.parse(state.get())` out of that and into it's own variable does nothing either
19:35:11om3gaHi guys! Vey very strange things here. Don't blame me because of style, but... https://play.nim-lang.org/#ix=4K6t
19:35:24FromDiscord<Phil> Sometimes I wonder why stuff can't stay stable for like 6 months
19:35:35FromDiscord<Phil> Like seriously, I don't like at snorlogue for 6 months and I get the most asinine errors
19:35:47FromDiscord<Phil> That's not even that fucking long
19:35:49om3gastrange moment happens with packet record number 15550
19:36:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K6w
19:37:04om3gainside a second loop, when we check if that number in sequence... debug lines printed
19:37:17FromDiscord<Phil> I mean, om3ga, can't really tell me since that's not a compileable example
19:37:47om3gaPhil, because of object definitions
19:37:56om3gaand you don't have input data
19:38:13om3galet me explain how strange thing is
19:39:10FromDiscord<heteroing> In reply to @preemptible "<@124347516878585858> Hey! I wonder": hmmmmmm
19:39:52om3gathe line : if 15550 in currentPacket.num checks 15550 in sequence of uint64 "num", and when nested loop quits, if I not assing to ghostPacket = currentPacket
19:39:57om3gathis packet dissapears
19:40:07om3gahaha, GC issue?
19:40:18FromDiscord<yetiwizard> sent a code paste, see https://play.nim-lang.org/#ix=4K6z
19:40:36om3gaI tried to switch it to another, zero effect
19:42:15FromDiscord<Chronos [She/Her]> In reply to @yetiwizard "I have a proc": I'd say it's bad style anyway tbh, you shouldn't add discardable to everything
19:42:16om3gaI tested the code with valgrind, sanitizers, with different compilers, and alocators, with musl libc
19:42:24FromDiscord<Chronos [She/Her]> But idk what the issue is, sorry
19:42:59FromDiscord<Chronos [She/Her]> In reply to @om3ga "I tested the code": Different GCs too?
19:43:21om3gaChronos, yeah, only with GC's that support SharedHeap ofc
19:43:51om3gait's one of procs from relatively big project
19:44:26FromDiscord<Chronos [She/Her]> Ah, unsure then
19:44:28om3gaI spent whole day to find area in many procedures where bug is
19:44:38om3gabut the bug is not very obvious
19:45:48om3gaI might say, it is not obvious at all, because for some reason, when second loop finishes it's iterations, that data of packet record 15550 dissapears :D
19:46:11FromDiscord<leorize> is this threaded code?
19:46:23om3gaand if I use ghostPacket assignment, then it prints this data!
19:46:24om3galol
19:46:31FromDiscord<Phil> Question, when was "taskRequires" introduced for the first time?
19:46:33FromDiscord<leorize> and are you using orc?
19:46:39FromDiscord<leorize> new nimble↵(@Phil)
19:46:47om3galeorize, yeah thread, with orc/boehm/arc all the same
19:46:58FromDiscord<Phil> Cool, that explains why that basically broke backwards compatibility of norm with anything not nim 2.0
19:47:36FromDiscord<leorize> orc/arc is not thread safe if you pass reference across threads
19:48:06om3gano ref's , only one Shared heap ptr passed to thread
19:48:28om3gacurrently one thread works, and no writes or reads in this proc
19:49:01FromDiscord<leorize> have you tried `-d:useMalloc` and drd/helgrind?
19:49:50om3gathe only one chance that there's something wrong when some not very clever logic overwrites currentPacket
19:50:03om3gabut I don't see anything that can do this
19:50:15FromDiscord<leorize> do you use destructors to free your pointers?
19:50:34FromDiscord<leorize> if it's a race then drd should detect it
19:50:38om3galeorize, with valgrind, drMemory, sanitizers, even with macOs profiler
19:50:45FromDiscord<Chronos [She/Her]> Hey @treeform, I may of discovered a possible oversight in Debby? Specifically with `innerSelect`↵`args` accepts `varargs[string, '$']` (replacing \` with ' so the formatting doesn't break), but when comparing objects that have a different form of representation with the `sqlDumpHook` that differs from `$` (such as byte data), it doesn't compare the results correctly
19:50:49FromDiscord<leorize> but you need `-d:useMalloc` or it can't do anything
19:51:14FromDiscord<Chronos [She/Her]> Changing the signature from to `varargs[string, '$']` works perfectly
19:51:28om3gano destructors, only discard GC_Strategy(gcOptimizeSpace), but this not makes any effect
19:51:49om3galeorize, yes I enabled this flag
19:51:54om3gawhen tested with valgrind
19:51:56FromDiscord<Chronos [She/Her]> Surprised it wasn't noticed before since this behaviour seems like a big oversight, like for comparing complex objects
19:52:26FromDiscord<leorize> and drd and helgrind didn't yell at you?
19:53:02om3galeorize, nothing, no error anywhere
19:53:25om3galeorize, with musl even it says no leaks are possible
19:53:45om3gaub sanitizer is silent, thread sanitizer too, address san. too
19:53:55FromDiscord<leorize> I doubt that it's a leak
19:53:57om3gathere's no error in the code
19:54:14om3gathere is no underflow or overflow
19:54:35om3gathe data is only huge, and a lot of objects
19:54:45om3gait's a network packet analyzer
19:55:09om3ga3-4 GB pcap files
19:56:32FromDiscord<leorize> so what storage was shared between threads?
19:56:44FromDiscord<leorize> do you have proper locking for them?
19:57:05om3gano, currently only one thread is working
19:57:17om3gait even not needs locks
19:57:38FromDiscord<leorize> i'd be concerned if you need locks for single threaded work \:P
19:57:54om3gaI mean it is real thread
19:58:27FromDiscord<leorize> the problem is probably in your shared storage if stuff just disappears
19:58:48FromDiscord<leorize> but what does "disappears" here even mean?
19:58:54om3ganot very like that, shared heap is for thread result
19:59:23om3galeorize, there is 2 blocks with debugEcho at the end
19:59:29om3gawith numbers 15550
20:00:17om3gaone with ghostPacket prints out, because I stored to it in second loop where 15550 check happens
20:01:34om3gaand with block of debug prints where same check does with currentPacket object, it fails
20:02:12FromDiscord<leorize> i'm surprised that it even works single-threaded
20:02:14om3gaif 15550 in currentPacket.num <- this one, not executes
20:02:30om3galeorize, why? :)
20:02:54FromDiscord<leorize> your code mutates too much
20:03:09FromDiscord<leorize> in line 13 you're replacing currentPacket every iteration
20:03:19om3gawell, it's not a easy task, and this is rough code
20:03:23*beholders_eye quit (Ping timeout: 255 seconds)
20:04:06FromDiscord<leorize> if you got packet 15550 then there's still another right behind, it'd disappear, ofc
20:04:11om3gaoh, right damn
20:04:23om3gahahahaha
20:04:35om3gawhat a stupid mistake
20:05:16FromDiscord<leorize> i'd recommend scoping your mutations to keep your own sanity in check
20:05:21om3gaand overwrites currentPacket.num
20:06:24om3gataking rest will help
20:06:50om3galeorize, thanks for your time!
20:06:51om3gaand help
20:07:14FromDiscord<leorize> you're welcome
20:07:17*gooba quit (Remote host closed the connection)
20:21:47FromDiscord<Chronos [She/Her]> Not sure whether I should edit the library to use `sqlDumpHook` rather than `$` and PR it tbh
20:21:55*beholders_eye joined #nim
20:22:01FromDiscord<Chronos [She/Her]> Already made a bunch of changes together
20:22:38FromDiscord<Chronos [She/Her]> Maybe `sqlDump` is better actually
20:22:42FromDiscord<Chronos [She/Her]> But same logic
20:23:03FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "Maybe `sqlDump` is better": Definitely is actually, gonna do that
20:24:41NimEventerNew thread by isaiah: How to wrap c scanf procedure in nim, see https://forum.nim-lang.org/t/10569
20:33:55FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "Definitely is actually, gonna": Adding some more tests for complex objects so this hopefully doesn't happen in the future
20:34:08*rockcavera quit (Read error: Connection reset by peer)
20:36:26FromDiscord<Chronos [She/Her]> (The oversights, I mean)
21:13:25*CO2 quit (Quit: WeeChat 4.1.0)
21:15:41FromDiscord<Phil> Do we have anyone that does nim on Android (for the new reddit thread?)
21:16:24FromDiscord<System64 ~ Flandre Scarlet> Is it normal I have this error? https://media.discordapp.net/attachments/371759389889003532/1167572531616686111/message.txt?ex=654e9da7&is=653c28a7&hm=6bac8df385fbdd6998eb87ed64979203d4785b80891a79b64fd8ad65c63f8fc2&
21:16:50FromDiscord<Elegantbeef> "Is it normal to have C gen errors", nope
21:17:06FromDiscord<Phil> I mean that just means that you're running into some evil C-codegen errors likely based on wonky hooks or sth
21:17:16FromDiscord<Phil> I that still persists with --mm:refc I'd be surprised
21:17:22*advesperacit quit ()
21:18:13FromDiscord<Elegantbeef> It looks more like bad wrappings
21:18:38FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "It looks more like": I use NimGL wrappings, worked fine before
21:18:39FromDiscord<Phil> Okay, that change that happened on nim 1.6.X where manipulating the kind of an object variant after instantiating it causes errors, not cool to first introduce the breaking change and then hand me in the error message a flag to change the behaviour back to the old one
21:18:49FromDiscord<Phil> Don't do that in minor version changes, like wth
21:19:03FromDiscord<System64 ~ Flandre Scarlet> I use Nim 2
21:19:25FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4K71
21:19:37FromDiscord<Phil> That was unrelated to you, I just fixed up snorlogue which didn't compile anymore under 1.6.12 despite being written for 1.6.2 or so
21:19:44FromDiscord<System64 ~ Flandre Scarlet> Oh, sorry
21:20:21FromDiscord<Phil> And somewhere in between those patch versions a breaking change to object variants was seemingly introduced together with the flag -d:nimOldCaseObjects ?
21:20:23FromDiscord<Phil> (edit) "?" => "(?)"
21:20:41FromDiscord<Phil> Which I found less than cool
21:21:47FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K73
21:22:12FromDiscord<System64 ~ Flandre Scarlet> I didn't defined any error type
21:23:35FromDiscord<Phil> ... you sure you haven't in any of your places where you call `raise` used a custom error type or a lib that does so?
21:24:02FromDiscord<Phil> I mean, the stacktrace seems cut-off, but it's got to come from somewhere
21:29:06FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "... you sure you": Pretty sure
21:29:42FromDiscord<System64 ~ Flandre Scarlet> Here it doesn't cut off https://media.discordapp.net/attachments/371759389889003532/1167575878167953429/message.txt?ex=654ea0c5&is=653c2bc5&hm=384298bfc67ebfa088418d1975b918ca4646603951c0306540c0c56e69b0caa3&
21:30:36FromDiscord<Phil> I mean yeah, that's the C gen stacktrace.↵I literally can not interpret that because all the info that hands me is "Something somewhere went terribly wrong on a rather tricky level and it has to do with the imgui package".
21:30:43FromDiscord<Phil> I meant the one for --mm:refc
21:31:10FromDiscord<System64 ~ Flandre Scarlet> Everything worked fine until now
21:31:33FromDiscord<Phil> In that case undo your changes step by step to see what change broke it.↵Based on that try to make a minimal example
21:32:37FromDiscord<Phil> This is not the easy kind of error, at least not for me, for beef this may be child's play I dunno.↵In my view this is requiring step by step detective work with 0 obvious clues to go with
21:32:48FromDiscord<Phil> (edit) "This is not the easy kind of error, at least not for me, for beef this may be child's play I dunno.↵In my view this is requiring step by step detective work with 0 obvious clues to go with ... " added "for starters"
21:38:02FromDiscord<System64 ~ Flandre Scarlet> C/C++ is pain and it will always be
21:38:14FromDiscord<Chronos [She/Her]> Oof Debby doesn't like ref objects when filtering it
21:39:59FromDiscord<Chronos [She/Her]> Not too sure how to handle that
21:43:03FromDiscord<yetiwizard> sent a code paste, see https://play.nim-lang.org/#ix=4K6z
21:45:59FromDiscord<Phil> In reply to @yetiwizard "I have a proc": I mean, I can't help much here as I'd strongly recommend against using discardable in the first place.↵Either return something or nothing. using Discard is an exception case.↵I'm not ven sure what "thisCall" is trying to do here
21:46:53FromDiscord<Phil> Ah, C++↵So that Serialize thing is calling a C++ proc?
21:47:00FromDiscord<Phil> (edit) "calling" => "binding"
21:47:02FromDiscord<yetiwizard> I cannot change the `Serialize` function, it is part of another exe
21:47:09FromDiscord<yetiwizard> I can only assign it an address to use it
21:47:27FromDiscord<yetiwizard> with the correct calling convention
21:47:36*CO2 joined #nim
21:48:16FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K78
21:49:11FromDiscord<System64 ~ Flandre Scarlet> Ok I guess my software caught cancer???
21:49:37*beholders_eye quit (Ping timeout: 252 seconds)
21:49:39FromDiscord<System64 ~ Flandre Scarlet> I removed the entire legacy mode, still have those compile problems
21:50:18FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K79
21:50:34FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K7a
21:51:26FromDiscord<Phil> In reply to @yetiwizard "I cannot change the": discardable is not inherently part of the proc in the C++ exe right?
21:51:32FromDiscord<Phil> That's something you added for the nim type?
21:51:40FromDiscord<System64 ~ Flandre Scarlet> Wait oh god don't tell me it's that...
21:52:12FromDiscord<yetiwizard> In reply to @isofruit "In that case the": I see, I guess there's no way around it then
21:52:25FromDiscord<Phil> In that case it may make sense to split your code into a binding, which is only defining the procs from the exe you're loading and then your nim procs that you build around it
21:52:40FromDiscord<yetiwizard> In reply to @isofruit "That's something you added": no, I don't think it is
21:52:42FromDiscord<Phil> That also has the benefit that your nim procs can use nim-types and the nim-procs transform them into the necessary c++ types
21:53:02FromDiscord<Phil> In reply to @yetiwizard "no, I don't think": Do you have docs for the original C++ lib you're binding?
21:53:05FromDiscord<yetiwizard> I'll go this route than, thanks!
21:53:24FromDiscord<Phil> Rather that particular proc to see if it has that kind of pragma, I'm mostly wondering where that pragma came from
21:53:25FromDiscord<yetiwizard> In reply to @isofruit "Do you have docs": no I don't. I didn't even know `discardable` was a thing in C++
21:53:39FromDiscord<Chronos [She/Her]> How do I get the type that a `sym` is referring to :/
21:54:09FromDiscord<Chronos [She/Her]> `getType` keeps returning a string but maybe I'm missing something
21:54:33FromDiscord<Phil> In reply to @chronos.vitaqua "How do I get": typed macro
21:54:42FromDiscord<System64 ~ Flandre Scarlet> Yeah it was that...↵I used -d:cpp instead of -b:cpp... 🤦↵My brain can't handle programming anymore 🤣
21:55:13FromDiscord<Phil> In reply to @sys64 "Yeah it was that...": Ouch, it's always the little things.↵May make sense to push that kind of stuff into nimble tasks so you can't get them wrong 😄
21:55:25FromDiscord<System64 ~ Flandre Scarlet> Yeah 🤣
21:55:37FromDiscord<Chronos [She/Her]> In reply to @isofruit "typed macro": It is, but then gets passed to a proc
21:55:58FromDiscord<Phil> In reply to @chronos.vitaqua "It is, but then": Oh? In that case ... one sec I don't know the proc by heart but I have used it in mapster
21:56:06FromDiscord<Chronos [She/Her]> Aha
21:56:09FromDiscord<Phil> Because I follow the ident nodes to their types to analyse said types for its fields
21:56:25FromDiscord<Chronos [She/Her]> It's a `sym` not an `ident` tho?
21:57:08FromDiscord<Phil> `sym.getImpl()` with sym being a symbol NimNode
21:57:17FromDiscord<Chronos [She/Her]> Ah thank you!
21:57:17FromDiscord<Phil> No, symnodes are nnkSym
21:57:57FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K7b
21:58:20FromDiscord<Chronos [She/Her]> Aaah found my issue
21:58:31FromDiscord<Chronos [She/Her]> Complex type is hiding within a `HiddenDeref`
21:59:18FromDiscord<Phil> Sidenote as it is something I do for personal preference:↵I basically confirm that a node is of an expected kind like every step of the way
21:59:36FromDiscord<Phil> So if something changes or goes wrong, I know immediately.↵That does have the drawback that there's basically only "one right way" of doing things
21:59:41FromDiscord<Chronos [She/Her]> Yeah that's what I'll be doing too :p
22:00:07FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K7c
22:03:25FromDiscord<Chronos [She/Her]> Thanks Phil!
22:03:54FromDiscord<Chronos [She/Her]> Now that I'm at my target node tho... Didn't think out how comparing an object would even work
22:04:10FromDiscord<Phil> Depends on what you want to compare
22:07:39FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4K7f
22:08:00FromDiscord<Chronos [She/Her]> Because this is a subset of SQL basically, but in Nim
22:08:13FromDiscord<Chronos [She/Her]> Meh maybe I should ignore this
22:08:44FromDiscord<Chronos [She/Her]> Because it's just not doable by expanding the subset, unless I want to move the check to runtime which is a bit meeeeh
22:09:34FromDiscord<Elegantbeef> `seq[NimNodeKind]` why?
22:09:37FromDiscord<Elegantbeef> Why phil... why!
22:09:56FromDiscord<Phil> In reply to @Elegantbeef "`seq[NimNodeKind]` why?": Sometimes I may want to allow multiple kinds
22:10:04FromDiscord<Elegantbeef> `set[NimNodeKind]`
22:10:05FromDiscord<Phil> And I just haven't ingrained the reflex to use varargs
22:10:12FromDiscord<Phil> fair
22:10:18FromDiscord<Chronos [She/Her]> Lol
22:10:22FromDiscord<Chronos [She/Her]> Beef is suffering
22:10:47FromDiscord<Elegantbeef> \Reading code here is like using eyedrops that contain silica dioxide
22:10:56FromDiscord<Phil> I'm suffering because suddenly compiling docs requires me installing libpcre in a container and that broke my github workflows despite me changing nothing >_>
22:11:28FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "\*Reading code here is": Loool
22:14:49FromDiscord<Phil> ~~If it weren't just compiletime I'd be more concerned~~
22:15:13FromDiscord<Elegantbeef> Hey compile speed is important!
22:15:34FromDiscord<Phil> It is, but this isn't going to be the thing that breaks the camel's back.
22:15:43FromDiscord<Phil> lto is
22:15:54FromDiscord<Elegantbeef> I mean Nim compilation is slow as is
22:15:57FromDiscord<Elegantbeef> No need to slow it down further
22:16:34FromDiscord<Phil> Yall just never enjoyed the privilege of a rust compiler so fast it melts your CPU while taking a minute to compile hello world
22:16:39FromDiscord<Phil> Hyperbolically speaking
22:17:09FromDiscord<Elegantbeef> You're right it takes 2 minutes cause you need to compile 30 seperate crates!
22:18:11FromDiscord<Phil> I am still wondering to this day how rust crates managed to be this gargantuan
22:19:00FromDiscord<Phil> I mean, things might have changed in the last 18 months but the entire "Set up a simple webserver, here are dependencies roughly 1GB in size" is still nuts to me.↵What is this? java and Spring?
22:19:30FromDiscord<Elegantbeef> Remember that Rust requires you to use a crate per macro
22:19:42FromDiscord<Phil> Okay what lib is libpcre.so(.3|.1|)
22:20:44FromDiscord<Elegantbeef> It's `libprce.so.3` or `libprce.so.1` or `libprce.so`
22:20:54FromDiscord<Elegantbeef> pcre\
22:47:59*beholders_eye joined #nim
22:52:34FromDiscord<Chronos [She/Her]> Ah... Just remembered I still have to make that thing to generate OpenAPI documents
22:57:09*krux02 quit (Remote host closed the connection)
23:15:47*gooba joined #nim
23:17:31FromDiscord<Phil> On the bright side, Snorlogue works agai
23:17:33FromDiscord<Phil> (edit) "agai" => "again"
23:39:19*beholders_eye quit (Ping timeout: 258 seconds)