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:27 | FromDiscord | <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:52 | FromDiscord | <typistx> "The Nim programming language has no concept of Posix's signal handling mechanisms." |
01:09:55 | Amun-Ra | there are signals in std/posix |
01:09:59 | termer | You can handle some easily like SIGINT, there's something like onCtrlC |
01:10:06 | termer | I forget the naney |
01:10:08 | termer | name |
01:19:40 | Amun-Ra | setControlCHook |
02:53:39 | FromDiscord | <takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4K3T |
02:54:36 | FromDiscord | <takemichihanagaki3129> (edit) "https://play.nim-lang.org/#ix=4K3T" => "https://play.nim-lang.org/#ix=4K3U" |
02:56:29 | FromDiscord | <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:08 | FromDiscord | <takemichihanagaki3129> In reply to @Elegantbeef "`typ: typedesc` and `when": Thank you! |
03:30:36 | FromDiscord | <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:51 | FromDiscord | <girvo> Could I `getFd()` and check if it's closed that way? |
03:33:08 | FromDiscord | <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:19 | FromDiscord | <jviega> getFd() should return you the fd, then call fcntl(fd, F_GETFD) |
03:50:23 | FromDiscord | <jviega> Not that I know why you'd ever want to do that |
03:50:29 | FromDiscord | <jviega> The fd can get reassigned if closed |
03:51:40 | FromDiscord | <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:48 | FromDiscord | <treeform> In reply to @chronos.vitaqua "The answer was yes": Thoughts? https://github.com/treeform/debby/pull/5/files |
04:55:06 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4K47 |
04:55:32 | FromDiscord | <Elegantbeef> float.low |
04:55:33 | FromDiscord | <Elegantbeef> and float.high |
04:56:21 | FromDiscord | <Elegantbeef> Or `Inf` and `NegInf` |
05:06:00 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4K4a |
05:09:05 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4K4c |
05:12:45 | FromDiscord | <gyatsoyt> In reply to @demotomohiro "Probably `getAttr` proc you": Umm what could be the solution |
05:22:15 | FromDiscord | <demotomohiro> Read manual or source code to check if which module export that proc and proc signature. |
05:31:40 | FromDiscord | <TӨMΛ ☠> sent a code paste, see https://play.nim-lang.org/#ix=4K4h |
05:32:00 | FromDiscord | <TӨMΛ ☠> Installed it through Nimble, if that helps with anything 🤷♂️ |
05:32:11 | FromDiscord | <Elegantbeef> Does that package ship zlib? |
05:32:13 | FromDiscord | <Elegantbeef> Don't recall |
05:38:04 | FromDiscord | <demotomohiro> In reply to @toma400 "Tried using `zip` package,": It seems you need to install https://zlib.net/ |
05:39:27 | FromDiscord | <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:46 | FromDiscord | <Elegantbeef> Could always use zippy if you don't want an external dep |
05:44:05 | FromDiscord | <TӨMΛ ☠> In reply to @Elegantbeef "Could always use zippy": Thought of it too, but their documentation is really rough to read |
05:44:43 | FromDiscord | <TӨMΛ ☠> Examples don't have compression, only unpacking, and docs are not enough straightforward for someone like me :x |
05:49:47 | FromDiscord | <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:59 | FromDiscord | <TӨMΛ ☠> Yeah, this checks out |
06:02:24 | FromDiscord | <TӨMΛ ☠> If anyone have some tutorial on how to generally learn installing such annoying dependencies, I'd be thankful |
06:03:01 | FromDiscord | <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:07 | FromDiscord | <TӨMΛ ☠> Ewh |
06:03:21 | FromDiscord | <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:29 | FromDiscord | <nnsee> In reply to @toma400 "If anyone have some": step 1. install linux 😅 |
06:04:25 | FromDiscord | <Elegantbeef> Eh in this case there is an argument for just having a `-d:zlibUseSource` |
06:05:08 | FromDiscord | <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:20 | FromDiscord | <nnsee> i'm not too sure how compilers or linking in general works in windows though |
06:05:48 | FromDiscord | <Elegantbeef> Mostly the same |
06:06:02 | FromDiscord | <Elegantbeef> They likely do not have the header in their include path and it's erroring |
06:06:17 | FromDiscord | <Elegantbeef> All in all a fork should be made that submodules zlib |
06:09:47 | FromDiscord | <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:05 | FromDiscord | <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:08 | FromDiscord | <demotomohiro> In reply to @toma400 "Yeah, this checks out": My article might help: https://internet-of-tomohiro.netlify.app/nim/clibrary.en |
06:27:56 | FromDiscord | <Chronos [She/Her]> In reply to @chronos.vitaqua "Ah, that was what": Causes runtime issues with the query iirc, syntax error |
06:35:40 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4K4u |
06:37:05 | FromDiscord | <Chronos [She/Her]> Hm, I don't understand the error, could you post the full code? |
06:37:07 | FromDiscord | <Elegantbeef> your proc is `endGame = bool` |
06:37:13 | FromDiscord | <Elegantbeef> not `endGame = false` or `endGame = true` |
06:37:48 | FromDiscord | <Chronos [She/Her]> Aah I missed that |
06:38:52 | FromDiscord | <demotomohiro> In reply to @gyatsoyt "Code: this is line": Or set proc parameter type like `proc foo(b: bool, x: int)` |
06:38:54 | FromDiscord | <gyatsoyt> bool means true or false right |
06:40:01 | FromDiscord | <gyatsoyt> Nvm there was a little typo in my code fixed that error |
06:53:06 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4K4x |
06:53:33 | FromDiscord | <Elegantbeef> `square` is a PyObject |
07:05:43 | FromDiscord | <gyatsoyt> In reply to @Elegantbeef "`square` is a PyObject": Yes but how can I use it ? |
07:06:10 | FromDiscord | <Elegantbeef> No clue I don't use the python library |
07:06:31 | FromDiscord | <Chronos [She/Her]> In reply to @gyatsoyt "The line which throws": Is square a Python string? |
07:06:37 | FromDiscord | <gyatsoyt> In reply to @chronos.vitaqua "Is square a Python": Yes |
07:06:48 | FromDiscord | <gyatsoyt> Its python idk about string |
07:08:25 | FromDiscord | <nnsee> square is a python object |
07:08:26 | FromDiscord | <nnsee> https://python-chess.readthedocs.io/en/latest/core.html#chess.square |
07:10:43 | FromDiscord | <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:22 | FromDiscord | <gyatsoyt> In reply to @nnsee "actually, looking at the": Umm so what do I have to do |
07:12:23 | FromDiscord | <nnsee> call `.to(int)` on the square, maybe |
07:12:26 | FromDiscord | <nnsee> no clue |
07:12:38 | FromDiscord | <nnsee> i haven't used nimpy myself |
07:13:00 | FromDiscord | <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:40 | FromDiscord | <shourchats> new to nim, is using references in nim that common as you would in c |
08:06:05 | FromDiscord | <shourchats> (edit) "new to nim, is using references in nim that common as you would ... in" added "with pointers" |
08:07:53 | FromDiscord | <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:33 | FromDiscord | <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:57 | Amun-Ra | pointers are very common in C |
08:10:44 | Amun-Ra | C always uses pass by value |
08:12:03 | Amun-Ra | nim does that "under the hood" |
08:12:46 | Amun-Ra | that (using pointers) |
08:18:48 | FromDiscord | <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:02 | FromDiscord | <Chronos [She/Her]> For `it`, doesn't really matter, but it makes sense for `db` imo |
08:19:16 | FromDiscord | <Chronos [She/Her]> Since I'm storing `Db` in another type |
08:19:34 | FromDiscord | <shourchats> nim always pases by reference i guess? |
08:20:16 | FromDiscord | <shourchats> or by value? |
08:20:18 | Amun-Ra | shourchats: (long time since I looked at the internals but) nim passes by pointer large…ish objects |
08:20:53 | Amun-Ra | you don't have to think about that in nim, nim does that foryou |
08:21:22 | Amun-Ra | ref objects are tracked by GC, non-ref ones are not, that's the biggest difference |
08:21:49 | FromDiscord | <shourchats> by ref you mean like reference like pointers in nim? |
08:22:39 | Amun-Ra | ref is a keword used for data tracked by GC |
08:22:40 | FromDiscord | <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:56 | FromDiscord | <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:14 | FromDiscord | <shourchats> yea |
08:23:21 | FromDiscord | <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:29 | Amun-Ra | yes, nim has "raw pointers" too, I wouldn't recommend them for young players |
08:24:28 | FromDiscord | <Phil> Aye, agreed |
08:26:21 | FromDiscord | <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:53 | FromDiscord | <shourchats> sent a code paste, see https://play.nim-lang.org/#ix=4J3o |
08:30:04 | FromDiscord | <Elegantbeef> In Nim `ref` is always a gc'd heap allocated block of memory |
08:30:33 | FromDiscord | <Elegantbeef> For mutable references to variables you use `var T` inside the procedure parameter list |
08:30:56 | FromDiscord | <pcarrier> > We won't be adapting to Nimble any time soon, as clearly there are several better package manager options. |
08:31:24 | FromDiscord | <pcarrier> (edit) ">" => "seen in a PR:↵>" | "options." => "options.↵that wasn't clear to me, anything worth looking into? 🙂" |
08:31:46 | FromDiscord | <Elegantbeef> What PR? |
08:32:50 | FromDiscord | <shourchats> sent a code paste, see https://play.nim-lang.org/#ix=4J5E |
08:33:49 | FromDiscord | <Elegantbeef> Nothing |
08:33:53 | FromDiscord | <Elegantbeef> It's a stack allocated variable |
08:33:58 | FromDiscord | <shourchats> oh lol |
08:33:58 | FromDiscord | <Elegantbeef> There is no GC for stack variables |
08:34:06 | FromDiscord | <shourchats> bruh ok |
08:34:22 | FromDiscord | <Phil> It passes references to the stack variable to other places that mutate it right? |
08:34:48 | FromDiscord | <Elegantbeef> `var T` is a pointer yes |
08:35:00 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4J8O |
08:35:06 | FromDiscord | <Phil> Ah, you were faster than I could prototype an example |
08:35:33 | FromDiscord | <Elegantbeef> also phil that's a funny way of writing `x += x` 😛 |
08:36:58 | FromDiscord | <shourchats> what about blocks |
08:37:03 | FromDiscord | <shourchats> they are like python? |
08:37:25 | FromDiscord | <Elegantbeef> No clue |
08:37:45 | FromDiscord | <shourchats> ... uhh |
08:38:04 | FromDiscord | <Elegantbeef> Believe it or not some people do not write python |
08:38:37 | FromDiscord | <shourchats> ok lol |
08:39:21 | FromDiscord | <Phil> Define an example regarding blocks |
08:39:34 | FromDiscord | <Phil> I did write python but it's been a couple years at this point |
08:41:08 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4J9i |
08:41:26 | FromDiscord | <Elegantbeef> Reread the error message |
08:41:32 | FromDiscord | <shourchats> sent a code paste, see https://play.nim-lang.org/#ix=4JcC |
08:41:45 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Jez |
08:41:49 | FromDiscord | <Elegantbeef> No |
08:41:53 | FromDiscord | <Elegantbeef> Not only that |
08:42:01 | FromDiscord | <Elegantbeef> They need to provide the exception type |
08:42:14 | FromDiscord | <Chronos [She/Her]> `import std/strformat` then `&"hello"` |
08:42:19 | FromDiscord | <Chronos [She/Her]> Ah |
08:42:27 | FromDiscord | <Chronos [She/Her]> I just read the code :p |
08:42:42 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Jix |
08:42:44 | FromDiscord | <Phil> Wait, that's nim code |
08:43:07 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://paste.rs/bnKjE |
08:44:33 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Jnq |
08:44:45 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4Jnq" => "https://paste.rs/2EqRk" |
08:48:27 | FromDiscord | <gyatsoyt> In reply to @Elegantbeef "They need to provide": What kinds of types are there where can I find them |
08:52:12 | FromDiscord | <shourchats> any replacement to "echo" which is a function lol |
08:52:35 | FromDiscord | <Phil> There actually is no list in the docs, but VSCode provides them with autosuggest if you start writing "error" |
08:53:02 | FromDiscord | <Phil> In reply to @shourchats "any replacement to "echo"": You mean propper logging? |
08:53:16 | FromDiscord | <shourchats> like a printing function |
08:53:18 | FromDiscord | <Phil> Other than that you can of course also write echo the way it would as a function:↵`echo("still running")` |
08:54:15 | FromDiscord | <shourchats> oh ok |
08:54:19 | FromDiscord | <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:24 | FromDiscord | <Phil> (edit) "as" => "has" |
08:54:37 | FromDiscord | <shourchats> oh so functions can be called without () |
08:54:54 | FromDiscord | <Phil> Yep, and the first parameter of a proc can be used as "starting point" to call a proc |
08:55:25 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JoL |
08:56:10 | FromDiscord | <shourchats> wow |
08:56:36 | FromDiscord | <Phil> You'll need to hammer down style-guidelines for yourself if you want to have any chance of consistent code writing ^^ |
08:56:59 | FromDiscord | <Phil> What this does emphasize though is that the first parameter typically is the "most important" |
09:22:03 | * | junaid_ joined #nim |
09:22:30 | FromDiscord | <Chronos [She/Her]> I wonder if there's times where JIT generated code is faster than just being compiled |
09:26:15 | FromDiscord | <Phil> That debate is happening in internals right now, could ask there 😛 |
09:26:37 | FromDiscord | <Chronos [She/Her]> Didn't wanna distract Araq :p |
09:27:36 | FromDiscord | <Chronos [She/Her]> Asked :p |
09:28:32 | PMunch | I guess it would be theoretically possible since it has more information to optimise during runtime |
09:28:54 | FromDiscord | <Chronos [She/Her]> Yeah I asked |
09:29:43 | FromDiscord | <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:38 | FromDiscord | <gyatsoyt> In reply to @isofruit "There actually is no": I am not on vs code rn it's replit |
09:41:45 | FromDiscord | <Chronos [She/Her]> Hm... Not sure how I'd restructure my code into multiple files rn |
09:45:45 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/KCEGO |
09:46:19 | FromDiscord | <Phil> Note that you can make your own Errors by subclassing from CatchableError |
09:46:52 | FromDiscord | <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:53 | FromDiscord | <Chronos [She/Her]> Inheriting, we don't have classes :p |
09:49:21 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JyT |
09:49:33 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Error = Runtime error": Saying defect is compile time is a bit misleading imo |
09:49:59 | FromDiscord | <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:01 | FromDiscord | <Phil> Fair-ish, I guess it's more "Defect = Rust Panic = Your Application must die now" |
09:50:08 | FromDiscord | <Chronos [She/Her]> Yeah |
09:50:14 | FromDiscord | <Phil> I'll update it |
09:50:47 | * | beholders_eye joined #nim |
09:52:09 | FromDiscord | <freakyHipster> Hello again people of nim |
09:52:20 | FromDiscord | <Chronos [She/Her]> Epic :) |
09:52:24 | FromDiscord | <Chronos [She/Her]> In reply to @freakyHipster "Hello again people of": o7 |
09:53:25 | FromDiscord | <freakyHipster> I need to support a debian 9 system and I get an error complaining about wrong glibc version |
09:54:11 | FromDiscord | <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:52 | FromDiscord | <freakyHipster> And I be happy for any easy way to cross compile for Mac as well 🙂 |
09:55:07 | FromDiscord | <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:24 | FromDiscord | <freakyHipster> Sounds great 😄 how tho? |
09:55:38 | FromDiscord | <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:03 | FromDiscord | <freakyHipster> Cheers ❤️ |
09:56:11 | FromDiscord | <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:19 | FromDiscord | <Chronos [She/Her]> In reply to @freakyHipster "I'd usually just compile": Do you not have access to `apt` in the container? |
09:56:36 | FromDiscord | <freakyHipster> Yes but apt install curl will break |
09:57:18 | FromDiscord | <freakyHipster> Had to change repo to archive.debian.org as well otherwise even apt update fails |
09:57:56 | FromDiscord | <Chronos [She/Her]> Huh |
09:58:04 | FromDiscord | <freakyHipster> And I have debian 8 running somewhere too but that's pretty much hopeless at this point |
09:58:13 | FromDiscord | <griffith1deadly> In reply to @freakyHipster "And I be happy": https://github.com/heysokam/confy↵i think you can use zigcc for this |
09:58:22 | FromDiscord | <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:42 | FromDiscord | <freakyHipster> I had a nice docker container for 1.6 but kinda struggles with 2.0 for Mac cross compile |
10:01:43 | FromDiscord | <freakyHipster> Kinda falling in love with zig |
10:05:05 | FromDiscord | <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:15 | FromDiscord | <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:49 | FromDiscord | <nnsee> In reply to @freakyHipster "I need to support": could always statically compile |
10:26:57 | FromDiscord | <nnsee> ie with musl-gcc |
10:27:04 | FromDiscord | <nnsee> it's not very difficult at all |
10:39:11 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4JJr |
10:39:28 | FromDiscord | <Chronos [She/Her]> The lock is there because there's a non-zero chance some stuff is happening in a thread |
10:40:40 | FromDiscord | <odexine> If it’s blocking then the culprit is probably in that filter procedure |
10:40:52 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4JJE |
10:41:31 | FromDiscord | <Phil> In reply to @nnsee "could always statically compile": Ironically enough I've only ever done dynamic linking with musl IIRC |
10:42:08 | FromDiscord | <Chronos [She/Her]> In reply to @griffith1deadly "for what you use": Something may happen in a thread elsewhere |
10:42:32 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "If it’s blocking then": Gucci, it should be fine then |
11:00:45 | FromDiscord | <Chronos [She/Her]> Ah anyone with an understanding of SQL, what's the reasoning for using fields as indexes? |
11:10:22 | advesperacit | https://use-the-index-luke.com/ |
11:12:12 | advesperacit | That's a great resource for learning about SQL performance, I bought the book in physical form several years ago |
11:12:47 | FromDiscord | <Chronos [She/Her]> Oh epic! Thanks! |
11:18:07 | FromDiscord | <ingo_61476> sent a code paste, see https://play.nim-lang.org/#ix=4K4L |
11:31:58 | FromDiscord | <freakyHipster> In reply to @nnsee "could always statically compile": Sounds good.↵Any link to a guide or somesuch |
11:43:27 | FromDiscord | <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:45 | FromDiscord | <nnsee> assuming you have musl-gcc installed |
11:44:02 | FromDiscord | <nnsee> that varies on whatever OS you're using |
11:44:12 | FromDiscord | <nnsee> for a longer guide https://scripter.co/nim-deploying-static-binaries/ |
11:56:01 | FromDiscord | <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:17 | FromDiscord | <nnsee> indeed |
12:19:33 | * | ox is now known as oz |
12:28:13 | FromDiscord | <Chronos [She/Her]> Debby doesn't seem to be finding my query... :/ |
12:28:19 | FromDiscord | <Chronos [She/Her]> `SELECT FROM login WHERE ((service_user=?)and(service=?))` |
12:28:27 | FromDiscord | <Chronos [She/Her]> And the parameters given are correct |
12:28:31 | FromDiscord | <Chronos [She/Her]> It's the right table |
12:28:35 | FromDiscord | <Chronos [She/Her]> Yet... Nothinh |
12:33:48 | * | edr joined #nim |
12:36:27 | FromDiscord | <Chronos [She/Her]> Aah, the type |
12:36:45 | FromDiscord | <Chronos [She/Her]> Not the type |
12:37:13 | FromDiscord | <Chronos [She/Her]> The `service` is the issue, the string in the db is surrounded by quotes which is just wrong |
12:45:16 | FromDiscord | <Chronos [She/Her]> Rn I'm not sure how I'm supposed to store bytes in the Db with parse hook :p |
12:58:47 | FromDiscord | <Chronos [She/Her]> Ig I'll just use the string representation for now but still a bit annoyinh |
12:58:51 | FromDiscord | <Chronos [She/Her]> annoying |
13:00:57 | FromDiscord | <Chronos [She/Her]> Epic this all works |
13:02:24 | FromDiscord | <Chronos [She/Her]> Time to work on an actual account system that isn't backed by anything else 🥲 |
13:27:07 | FromDiscord | <Phil> Backed as in? |
13:27:25 | FromDiscord | <treeform> I have a special binary type, as dabs handle strings oddly |
13:27:36 | FromDiscord | <treeform> (edit) "dabs" => "DBs" |
13:27:41 | NimEventer | New Nimble package! htmlparser - Parse a HTML document in Nim., see https://github.com/nim-lang/htmlparser |
13:35:16 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Backed as in?": Local accounts |
13:35:59 | FromDiscord | <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:07 | FromDiscord | <Phil> I don't follow. So basically you just need to figure out the schema for an account table? |
13:36:34 | FromDiscord | <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:55 | FromDiscord | <Phil> And even if you don't you can still use their schema and just build a different permission management system |
13:37:08 | FromDiscord | <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:34 | FromDiscord | <Phil> Can always make a helper package 😛 |
13:38:15 | * | marcus joined #nim |
13:38:31 | FromDiscord | <Chronos [She/Her]> For accounts and such? I'd imagine the usecase varies wildly |
13:43:34 | * | rockcavera joined #nim |
13:44:13 | FromDiscord | <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:41 | FromDiscord | <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:44 | FromDiscord | <Chronos [She/Her]> I'm using Debby for this anyway :P |
13:45:02 | FromDiscord | <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:10 | FromDiscord | <Chronos [She/Her]> FK? |
13:45:11 | FromDiscord | <Phil> The performance won't really hurt all that much |
13:45:15 | FromDiscord | <Phil> FK = Foreign Key |
13:45:22 | FromDiscord | <Phil> That would be a 1 to 1 relationship |
13:45:22 | FromDiscord | <Chronos [She/Her]> Don't know what that is |
13:45:36 | FromDiscord | <Chronos [She/Her]> Is it basically just a unique value pointing to another table? |
13:45:41 | FromDiscord | <Phil> Okay so my first recommendation before you do anything else is work through an SQL workshop 😛 |
13:45:49 | FromDiscord | <Chronos [She/Her]> Lmao |
13:46:01 | FromDiscord | <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:03 | FromDiscord | <Chronos [She/Her]> I did Microsoft Access in college if that counts for anything lmao |
13:46:14 | FromDiscord | <Phil> In reply to @chronos.vitaqua "I did Microsoft Access": It doesn't, off with you to the SQL bootcamp 😛 |
13:46:21 | FromDiscord | <Chronos [She/Her]> Lmao |
13:46:41 | * | dogtor joined #nim |
13:46:43 | FromDiscord | <Chronos [She/Her]> Hey, I just wanna make this all good enough, doesn't have to be good :P |
13:47:01 | FromDiscord | <Phil> Nono, it's fine if the code isn't perfect, but you should be 😛 So work on it! |
13:47:37 | FromDiscord | <Chronos [She/Her]> But mama said my imperfections make me unique 🥺 |
13:48:11 | FromDiscord | <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:16 | FromDiscord | <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:39 | FromDiscord | <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:50 | FromDiscord | <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:02 | FromDiscord | <Chronos [She/Her]> 😔 |
13:49:13 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "I do understand a": of this reason i'm still using orm's or mongodb |
13:49:53 | FromDiscord | <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:59 | FromDiscord | <Phil> (edit) "ORM" => "ORMs" |
13:50:24 | FromDiscord | <Phil> Writing actual SQL is for more complicated stuff like recursive queries or grouping |
13:50:50 | FromDiscord | <Chronos [She/Her]> Recursive queries? |
13:50:52 | FromDiscord | <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:27 | FromDiscord | <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:36 | FromDiscord | <Phil> Each entry of an article-section only has the ID of its direct parent |
13:52:05 | FromDiscord | <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:16 | FromDiscord | <Phil> You are now in recursive query land |
13:52:26 | FromDiscord | <Phil> Where things are fun and not at all hard to read |
13:52:31 | FromDiscord | <Chronos [She/Her]> Lol |
13:52:41 | FromDiscord | <Chronos [She/Her]> I could probably do that if I had access to google tbf |
13:53:08 | FromDiscord | <treeform> I have tests to show how binary data works? |
13:53:24 | FromDiscord | <treeform> I could add that to read me |
13:53:30 | FromDiscord | <Chronos [She/Her]> Do you? I must've missed them aha, I'll look right now |
13:53:41 | FromDiscord | <Chronos [She/Her]> Yeah adding to the README would be great |
13:53:54 | FromDiscord | <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:10 | FromDiscord | <Phil> Also a recursive relationship |
13:54:33 | FromDiscord | <Phil> Why did I remember that? Because that's the case where I had recursive queries |
13:54:54 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K55 |
13:55:01 | FromDiscord | <treeform> https://github.com/treeform/debby/blob/master/tests/common_test.nim#L214-L236 |
13:55:17 | FromDiscord | <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:42 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://paste.rs/FBqyy |
13:56:01 | FromDiscord | <Phil> What are you taaaaaalking about, this is recursive query land, where people only have fun and good thoughts! |
13:56:25 | FromDiscord | <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:04 | FromDiscord | <Chronos [She/Her]> Aaah okay, that's good to know now |
13:57:25 | FromDiscord | <treeform> Only Sqlite supports binary data "natively", mysql and pg encode it in their respective formats |
13:57:35 | FromDiscord | <treeform> but really you could use base64 if you wanted |
13:57:37 | FromDiscord | <Chronos [She/Her]> Though, why did you make `Bytes` a `distinct string`? I'm curious |
13:57:55 | FromDiscord | <treeform> Because if you don't make it that it did not work |
13:58:19 | FromDiscord | <treeform> (edit) "if you don't make" => "that made" | removed "that it did not" |
13:59:01 | FromDiscord | <Chronos [She/Her]> Fair enough lol |
13:59:15 | FromDiscord | <Chronos [She/Her]> Thanks Treeform! |
13:59:48 | FromDiscord | <Chronos [She/Her]> Did you see the PR, btw? |
14:00:10 | FromDiscord | <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:46 | FromDiscord | <treeform> `when compiles(...)/when not compiles(...)` |
14:00:53 | * | junaid_ joined #nim |
14:01:07 | FromDiscord | <Phil> In reply to @chronos.vitaqua "I'm not sure how": treeforms approach or testament |
14:01:32 | FromDiscord | <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:41 | FromDiscord | <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:42 | FromDiscord | <Chronos [She/Her]> Aaah alright, that makes sense, I'll add the test for it when I get home then! |
14:01:59 | FromDiscord | <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:30 | FromDiscord | <Phil> 🤔 Seems almost sensible |
14:02:53 | FromDiscord | <Phil> How unusual! |
14:03:08 | FromDiscord | <Chronos [She/Her]> Hey, I can be sensible at times, once in a blue moon! |
14:03:25 | FromDiscord | <Phil> Makes sense, your pfp does have blue hair, the connection is apparent! |
14:04:10 | FromDiscord | <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:21 | FromDiscord | <Chronos [She/Her]> I don't know what I generated there, but it sure is a sentence |
14:04:48 | FromDiscord | <Phil> Those certainly are letters you have glued together |
14:05:18 | FromDiscord | <Chronos [She/Her]> Truely a sentence of letters |
14:05:32 | FromDiscord | <Chronos [She/Her]> A `seq[char]` if you would |
14:06:12 | FromDiscord | <Phil> Let's call it string, like stringing something together on a thread |
14:06:29 | FromDiscord | <Chronos [She/Her]> Threading? Where's the locks! |
14:06:34 | FromDiscord | <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:50 | FromDiscord | <Chronos [She/Her]> Ah, an UncheckedArray then |
14:07:12 | FromDiscord | <Phil> Also I think it makes no sense to indicate that it's an array, the dev sure can figure that out |
14:07:19 | FromDiscord | <Phil> Lets just hand the dev a pointer to the first element |
14:07:26 | FromDiscord | <Chronos [She/Her]> That works perfectly |
14:07:40 | FromDiscord | <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:02 | FromDiscord | <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:19 | FromDiscord | <Phil> Yes, yes! Great minds think alike! |
14:08:25 | FromDiscord | <Chronos [She/Her]> Lmao |
14:12:11 | * | dogtor quit (Ping timeout: 260 seconds) |
14:15:40 | * | PMunch quit (Quit: Leaving) |
14:56:40 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4K5f |
14:57:59 | FromDiscord | <dlesnoff> (edit) "https://play.nim-lang.org/#ix=4K5f" => "https://paste.rs/FrveB" |
15:02:08 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4K5q |
15:26:22 | arkanoid | which Nim project you would consider worth reading to grasp idiomatic nim and good use of language features and type system? |
15:27:33 | FromDiscord | <Chronos [She/Her]> One of the stdlib modules, maybe? |
15:27:39 | FromDiscord | <Chronos [She/Her]> Like std/json? Not sure |
15:27:45 | FromDiscord | <Chronos [She/Her]> Maybe strutils? |
15:38:25 | arkanoid | isn'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:24 | FromDiscord | <leorize> if you want something that's focused on macro usage, cps is a good one to read |
16:09:08 | FromDiscord | <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:54 | FromDiscord | <Chronos [She/Her]> What are the usecases of a concept? When/where would I benefit from it? |
17:45:32 | FromDiscord | <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:06 | FromDiscord | <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:53 | FromDiscord | <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:04 | FromDiscord | <Phil> (edit) removed "duplication" |
17:49:44 | FromDiscord | <Chronos [She/Her]> Oh huh |
17:50:02 | FromDiscord | <Chronos [She/Her]> Sounds useful |
17:50:14 | FromDiscord | <Chronos [She/Her]> I wonder if streams could be implemented with this |
17:50:19 | FromDiscord | <Phil> sent a long message, see http://ix.io/4K61 |
17:50:43 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "For example, I could": Makes sense |
17:51:45 | FromDiscord | <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:57 | FromDiscord | <Chronos [She/Her]> Fair enough aha |
17:52:15 | FromDiscord | <Phil> If you want a project where you could learn about it, that could be an interesting task though 😛 |
17:52:21 | FromDiscord | <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:54 | FromDiscord | <Chronos [She/Her]> Maybe a rewrite of streams? :p↵Tho Araq said concepts wouldn't work with streams so |
17:54:33 | FromDiscord | <Phil> See, all the more reason to contribute for a Snorlogue refactor 😛 |
17:54:40 | FromDiscord | <Chronos [She/Her]> :p |
17:55:35 | * | beholders_eye joined #nim |
17:56:00 | FromDiscord | <Chronos [She/Her]> Hm... Trying to figure out how to structure my code yet again- |
17:56:18 | FromDiscord | <Chronos [She/Her]> For users and such |
18:00:58 | FromDiscord | <Chronos [She/Her]> Code is odd |
18:10:10 | * | CO2 quit (Quit: WeeChat 4.1.0) |
18:26:41 | NimEventer | New 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:24 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K6e |
18:31:42 | FromDiscord | <Phil> How is that something you arrive at? |
18:35:01 | * | CO2 joined #nim |
18:57:47 | FromDiscord | <preemptible> @heteroing Hey! I wonder how you discovered the server 🙂 |
18:58:00 | FromDiscord | <preemptible> (edit) "🙂" => ":omegalul:" |
18:58:11 | FromDiscord | <typistx> if leetcode coderpad etc supports nim, that will be really nice |
18:58:37 | FromDiscord | <preemptible> In reply to @typistx "if leetcode coderpad etc": This. That's why my solve rate is so low |
19:00:12 | FromDiscord | <preemptible> Codeforces supports freaking php and not Nim |
19:13:17 | FromDiscord | <Chronos [She/Her]> Hm... Does Debby encode seqs in a separate table or does it serialise them to JSON? |
19:13:31 | FromDiscord | <Chronos [She/Her]> Time to find out ✨ |
19:15:57 | * | krux02 joined #nim |
19:17:45 | FromDiscord | <Chronos [She/Her]> Yep, encodes it as JSON |
19:25:51 | FromDiscord | <Chronos [She/Her]> So confused why my filter query isn't working now :/ |
19:26:20 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4K6r |
19:26:32 | FromDiscord | <Chronos [She/Her]> And I know when parsed, the ULID in the db is valid |
19:27:11 | FromDiscord | <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:11 | om3ga | Hi guys! Vey very strange things here. Don't blame me because of style, but... https://play.nim-lang.org/#ix=4K6t |
19:35:24 | FromDiscord | <Phil> Sometimes I wonder why stuff can't stay stable for like 6 months |
19:35:35 | FromDiscord | <Phil> Like seriously, I don't like at snorlogue for 6 months and I get the most asinine errors |
19:35:47 | FromDiscord | <Phil> That's not even that fucking long |
19:35:49 | om3ga | strange moment happens with packet record number 15550 |
19:36:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K6w |
19:37:04 | om3ga | inside a second loop, when we check if that number in sequence... debug lines printed |
19:37:17 | FromDiscord | <Phil> I mean, om3ga, can't really tell me since that's not a compileable example |
19:37:47 | om3ga | Phil, because of object definitions |
19:37:56 | om3ga | and you don't have input data |
19:38:13 | om3ga | let me explain how strange thing is |
19:39:10 | FromDiscord | <heteroing> In reply to @preemptible "<@124347516878585858> Hey! I wonder": hmmmmmm |
19:39:52 | om3ga | the 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:57 | om3ga | this packet dissapears |
19:40:07 | om3ga | haha, GC issue? |
19:40:18 | FromDiscord | <yetiwizard> sent a code paste, see https://play.nim-lang.org/#ix=4K6z |
19:40:36 | om3ga | I tried to switch it to another, zero effect |
19:42:15 | FromDiscord | <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:16 | om3ga | I tested the code with valgrind, sanitizers, with different compilers, and alocators, with musl libc |
19:42:24 | FromDiscord | <Chronos [She/Her]> But idk what the issue is, sorry |
19:42:59 | FromDiscord | <Chronos [She/Her]> In reply to @om3ga "I tested the code": Different GCs too? |
19:43:21 | om3ga | Chronos, yeah, only with GC's that support SharedHeap ofc |
19:43:51 | om3ga | it's one of procs from relatively big project |
19:44:26 | FromDiscord | <Chronos [She/Her]> Ah, unsure then |
19:44:28 | om3ga | I spent whole day to find area in many procedures where bug is |
19:44:38 | om3ga | but the bug is not very obvious |
19:45:48 | om3ga | I 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:11 | FromDiscord | <leorize> is this threaded code? |
19:46:23 | om3ga | and if I use ghostPacket assignment, then it prints this data! |
19:46:24 | om3ga | lol |
19:46:31 | FromDiscord | <Phil> Question, when was "taskRequires" introduced for the first time? |
19:46:33 | FromDiscord | <leorize> and are you using orc? |
19:46:39 | FromDiscord | <leorize> new nimble↵(@Phil) |
19:46:47 | om3ga | leorize, yeah thread, with orc/boehm/arc all the same |
19:46:58 | FromDiscord | <Phil> Cool, that explains why that basically broke backwards compatibility of norm with anything not nim 2.0 |
19:47:36 | FromDiscord | <leorize> orc/arc is not thread safe if you pass reference across threads |
19:48:06 | om3ga | no ref's , only one Shared heap ptr passed to thread |
19:48:28 | om3ga | currently one thread works, and no writes or reads in this proc |
19:49:01 | FromDiscord | <leorize> have you tried `-d:useMalloc` and drd/helgrind? |
19:49:50 | om3ga | the only one chance that there's something wrong when some not very clever logic overwrites currentPacket |
19:50:03 | om3ga | but I don't see anything that can do this |
19:50:15 | FromDiscord | <leorize> do you use destructors to free your pointers? |
19:50:34 | FromDiscord | <leorize> if it's a race then drd should detect it |
19:50:38 | om3ga | leorize, with valgrind, drMemory, sanitizers, even with macOs profiler |
19:50:45 | FromDiscord | <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:49 | FromDiscord | <leorize> but you need `-d:useMalloc` or it can't do anything |
19:51:14 | FromDiscord | <Chronos [She/Her]> Changing the signature from to `varargs[string, '$']` works perfectly |
19:51:28 | om3ga | no destructors, only discard GC_Strategy(gcOptimizeSpace), but this not makes any effect |
19:51:49 | om3ga | leorize, yes I enabled this flag |
19:51:54 | om3ga | when tested with valgrind |
19:51:56 | FromDiscord | <Chronos [She/Her]> Surprised it wasn't noticed before since this behaviour seems like a big oversight, like for comparing complex objects |
19:52:26 | FromDiscord | <leorize> and drd and helgrind didn't yell at you? |
19:53:02 | om3ga | leorize, nothing, no error anywhere |
19:53:25 | om3ga | leorize, with musl even it says no leaks are possible |
19:53:45 | om3ga | ub sanitizer is silent, thread sanitizer too, address san. too |
19:53:55 | FromDiscord | <leorize> I doubt that it's a leak |
19:53:57 | om3ga | there's no error in the code |
19:54:14 | om3ga | there is no underflow or overflow |
19:54:35 | om3ga | the data is only huge, and a lot of objects |
19:54:45 | om3ga | it's a network packet analyzer |
19:55:09 | om3ga | 3-4 GB pcap files |
19:56:32 | FromDiscord | <leorize> so what storage was shared between threads? |
19:56:44 | FromDiscord | <leorize> do you have proper locking for them? |
19:57:05 | om3ga | no, currently only one thread is working |
19:57:17 | om3ga | it even not needs locks |
19:57:38 | FromDiscord | <leorize> i'd be concerned if you need locks for single threaded work \:P |
19:57:54 | om3ga | I mean it is real thread |
19:58:27 | FromDiscord | <leorize> the problem is probably in your shared storage if stuff just disappears |
19:58:48 | FromDiscord | <leorize> but what does "disappears" here even mean? |
19:58:54 | om3ga | not very like that, shared heap is for thread result |
19:59:23 | om3ga | leorize, there is 2 blocks with debugEcho at the end |
19:59:29 | om3ga | with numbers 15550 |
20:00:17 | om3ga | one with ghostPacket prints out, because I stored to it in second loop where 15550 check happens |
20:01:34 | om3ga | and with block of debug prints where same check does with currentPacket object, it fails |
20:02:12 | FromDiscord | <leorize> i'm surprised that it even works single-threaded |
20:02:14 | om3ga | if 15550 in currentPacket.num <- this one, not executes |
20:02:30 | om3ga | leorize, why? :) |
20:02:54 | FromDiscord | <leorize> your code mutates too much |
20:03:09 | FromDiscord | <leorize> in line 13 you're replacing currentPacket every iteration |
20:03:19 | om3ga | well, it's not a easy task, and this is rough code |
20:03:23 | * | beholders_eye quit (Ping timeout: 255 seconds) |
20:04:06 | FromDiscord | <leorize> if you got packet 15550 then there's still another right behind, it'd disappear, ofc |
20:04:11 | om3ga | oh, right damn |
20:04:23 | om3ga | hahahaha |
20:04:35 | om3ga | what a stupid mistake |
20:05:16 | FromDiscord | <leorize> i'd recommend scoping your mutations to keep your own sanity in check |
20:05:21 | om3ga | and overwrites currentPacket.num |
20:06:24 | om3ga | taking rest will help |
20:06:50 | om3ga | leorize, thanks for your time! |
20:06:51 | om3ga | and help |
20:07:14 | FromDiscord | <leorize> you're welcome |
20:07:17 | * | gooba quit (Remote host closed the connection) |
20:21:47 | FromDiscord | <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:01 | FromDiscord | <Chronos [She/Her]> Already made a bunch of changes together |
20:22:38 | FromDiscord | <Chronos [She/Her]> Maybe `sqlDump` is better actually |
20:22:42 | FromDiscord | <Chronos [She/Her]> But same logic |
20:23:03 | FromDiscord | <Chronos [She/Her]> In reply to @chronos.vitaqua "Maybe `sqlDump` is better": Definitely is actually, gonna do that |
20:24:41 | NimEventer | New thread by isaiah: How to wrap c scanf procedure in nim, see https://forum.nim-lang.org/t/10569 |
20:33:55 | FromDiscord | <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:26 | FromDiscord | <Chronos [She/Her]> (The oversights, I mean) |
21:13:25 | * | CO2 quit (Quit: WeeChat 4.1.0) |
21:15:41 | FromDiscord | <Phil> Do we have anyone that does nim on Android (for the new reddit thread?) |
21:16:24 | FromDiscord | <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:50 | FromDiscord | <Elegantbeef> "Is it normal to have C gen errors", nope |
21:17:06 | FromDiscord | <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:16 | FromDiscord | <Phil> I that still persists with --mm:refc I'd be surprised |
21:17:22 | * | advesperacit quit () |
21:18:13 | FromDiscord | <Elegantbeef> It looks more like bad wrappings |
21:18:38 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "It looks more like": I use NimGL wrappings, worked fine before |
21:18:39 | FromDiscord | <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:49 | FromDiscord | <Phil> Don't do that in minor version changes, like wth |
21:19:03 | FromDiscord | <System64 ~ Flandre Scarlet> I use Nim 2 |
21:19:25 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4K71 |
21:19:37 | FromDiscord | <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:44 | FromDiscord | <System64 ~ Flandre Scarlet> Oh, sorry |
21:20:21 | FromDiscord | <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:23 | FromDiscord | <Phil> (edit) "?" => "(?)" |
21:20:41 | FromDiscord | <Phil> Which I found less than cool |
21:21:47 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K73 |
21:22:12 | FromDiscord | <System64 ~ Flandre Scarlet> I didn't defined any error type |
21:23:35 | FromDiscord | <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:02 | FromDiscord | <Phil> I mean, the stacktrace seems cut-off, but it's got to come from somewhere |
21:29:06 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "... you sure you": Pretty sure |
21:29:42 | FromDiscord | <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:36 | FromDiscord | <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:43 | FromDiscord | <Phil> I meant the one for --mm:refc |
21:31:10 | FromDiscord | <System64 ~ Flandre Scarlet> Everything worked fine until now |
21:31:33 | FromDiscord | <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:37 | FromDiscord | <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:48 | FromDiscord | <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:02 | FromDiscord | <System64 ~ Flandre Scarlet> C/C++ is pain and it will always be |
21:38:14 | FromDiscord | <Chronos [She/Her]> Oof Debby doesn't like ref objects when filtering it |
21:39:59 | FromDiscord | <Chronos [She/Her]> Not too sure how to handle that |
21:43:03 | FromDiscord | <yetiwizard> sent a code paste, see https://play.nim-lang.org/#ix=4K6z |
21:45:59 | FromDiscord | <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:53 | FromDiscord | <Phil> Ah, C++↵So that Serialize thing is calling a C++ proc? |
21:47:00 | FromDiscord | <Phil> (edit) "calling" => "binding" |
21:47:02 | FromDiscord | <yetiwizard> I cannot change the `Serialize` function, it is part of another exe |
21:47:09 | FromDiscord | <yetiwizard> I can only assign it an address to use it |
21:47:27 | FromDiscord | <yetiwizard> with the correct calling convention |
21:47:36 | * | CO2 joined #nim |
21:48:16 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K78 |
21:49:11 | FromDiscord | <System64 ~ Flandre Scarlet> Ok I guess my software caught cancer??? |
21:49:37 | * | beholders_eye quit (Ping timeout: 252 seconds) |
21:49:39 | FromDiscord | <System64 ~ Flandre Scarlet> I removed the entire legacy mode, still have those compile problems |
21:50:18 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K79 |
21:50:34 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K7a |
21:51:26 | FromDiscord | <Phil> In reply to @yetiwizard "I cannot change the": discardable is not inherently part of the proc in the C++ exe right? |
21:51:32 | FromDiscord | <Phil> That's something you added for the nim type? |
21:51:40 | FromDiscord | <System64 ~ Flandre Scarlet> Wait oh god don't tell me it's that... |
21:52:12 | FromDiscord | <yetiwizard> In reply to @isofruit "In that case the": I see, I guess there's no way around it then |
21:52:25 | FromDiscord | <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:40 | FromDiscord | <yetiwizard> In reply to @isofruit "That's something you added": no, I don't think it is |
21:52:42 | FromDiscord | <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:02 | FromDiscord | <Phil> In reply to @yetiwizard "no, I don't think": Do you have docs for the original C++ lib you're binding? |
21:53:05 | FromDiscord | <yetiwizard> I'll go this route than, thanks! |
21:53:24 | FromDiscord | <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:25 | FromDiscord | <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:39 | FromDiscord | <Chronos [She/Her]> How do I get the type that a `sym` is referring to :/ |
21:54:09 | FromDiscord | <Chronos [She/Her]> `getType` keeps returning a string but maybe I'm missing something |
21:54:33 | FromDiscord | <Phil> In reply to @chronos.vitaqua "How do I get": typed macro |
21:54:42 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah it was that...↵I used -d:cpp instead of -b:cpp... 🤦↵My brain can't handle programming anymore 🤣 |
21:55:13 | FromDiscord | <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:25 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah 🤣 |
21:55:37 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "typed macro": It is, but then gets passed to a proc |
21:55:58 | FromDiscord | <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:06 | FromDiscord | <Chronos [She/Her]> Aha |
21:56:09 | FromDiscord | <Phil> Because I follow the ident nodes to their types to analyse said types for its fields |
21:56:25 | FromDiscord | <Chronos [She/Her]> It's a `sym` not an `ident` tho? |
21:57:08 | FromDiscord | <Phil> `sym.getImpl()` with sym being a symbol NimNode |
21:57:17 | FromDiscord | <Chronos [She/Her]> Ah thank you! |
21:57:17 | FromDiscord | <Phil> No, symnodes are nnkSym |
21:57:57 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K7b |
21:58:20 | FromDiscord | <Chronos [She/Her]> Aaah found my issue |
21:58:31 | FromDiscord | <Chronos [She/Her]> Complex type is hiding within a `HiddenDeref` |
21:59:18 | FromDiscord | <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:36 | FromDiscord | <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:41 | FromDiscord | <Chronos [She/Her]> Yeah that's what I'll be doing too :p |
22:00:07 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4K7c |
22:03:25 | FromDiscord | <Chronos [She/Her]> Thanks Phil! |
22:03:54 | FromDiscord | <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:10 | FromDiscord | <Phil> Depends on what you want to compare |
22:07:39 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4K7f |
22:08:00 | FromDiscord | <Chronos [She/Her]> Because this is a subset of SQL basically, but in Nim |
22:08:13 | FromDiscord | <Chronos [She/Her]> Meh maybe I should ignore this |
22:08:44 | FromDiscord | <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:34 | FromDiscord | <Elegantbeef> `seq[NimNodeKind]` why? |
22:09:37 | FromDiscord | <Elegantbeef> Why phil... why! |
22:09:56 | FromDiscord | <Phil> In reply to @Elegantbeef "`seq[NimNodeKind]` why?": Sometimes I may want to allow multiple kinds |
22:10:04 | FromDiscord | <Elegantbeef> `set[NimNodeKind]` |
22:10:05 | FromDiscord | <Phil> And I just haven't ingrained the reflex to use varargs |
22:10:12 | FromDiscord | <Phil> fair |
22:10:18 | FromDiscord | <Chronos [She/Her]> Lol |
22:10:22 | FromDiscord | <Chronos [She/Her]> Beef is suffering |
22:10:47 | FromDiscord | <Elegantbeef> \Reading code here is like using eyedrops that contain silica dioxide |
22:10:56 | FromDiscord | <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:28 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "\*Reading code here is": Loool |
22:14:49 | FromDiscord | <Phil> ~~If it weren't just compiletime I'd be more concerned~~ |
22:15:13 | FromDiscord | <Elegantbeef> Hey compile speed is important! |
22:15:34 | FromDiscord | <Phil> It is, but this isn't going to be the thing that breaks the camel's back. |
22:15:43 | FromDiscord | <Phil> lto is |
22:15:54 | FromDiscord | <Elegantbeef> I mean Nim compilation is slow as is |
22:15:57 | FromDiscord | <Elegantbeef> No need to slow it down further |
22:16:34 | FromDiscord | <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:39 | FromDiscord | <Phil> Hyperbolically speaking |
22:17:09 | FromDiscord | <Elegantbeef> You're right it takes 2 minutes cause you need to compile 30 seperate crates! |
22:18:11 | FromDiscord | <Phil> I am still wondering to this day how rust crates managed to be this gargantuan |
22:19:00 | FromDiscord | <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:30 | FromDiscord | <Elegantbeef> Remember that Rust requires you to use a crate per macro |
22:19:42 | FromDiscord | <Phil> Okay what lib is libpcre.so(.3|.1|) |
22:20:44 | FromDiscord | <Elegantbeef> It's `libprce.so.3` or `libprce.so.1` or `libprce.so` |
22:20:54 | FromDiscord | <Elegantbeef> pcre\ |
22:47:59 | * | beholders_eye joined #nim |
22:52:34 | FromDiscord | <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:31 | FromDiscord | <Phil> On the bright side, Snorlogue works agai |
23:17:33 | FromDiscord | <Phil> (edit) "agai" => "again" |
23:39:19 | * | beholders_eye quit (Ping timeout: 258 seconds) |