00:08:04 | FromDiscord | <Robyn [She/Her]> I wonder how well cps could integrate with asyncdispatch |
00:08:13 | FromDiscord | <Robyn [She/Her]> The other way around seems trickier |
00:14:57 | FromDiscord | <leorize> it's not that hard |
00:15:11 | FromDiscord | <leorize> you just have to have your callbacks resume the continuation |
00:15:30 | * | greaser|q joined #nim |
00:25:22 | FromDiscord | <Robyn [She/Her]> I wonder if there's any point to that, now :p |
00:26:23 | FromDiscord | <Robyn [She/Her]> Maybe if you want to exclusively use cps but wanna provide a way for people using async code a way of using your code too? Though ig they could just call it like normal functions and it'd work |
00:27:19 | * | jmdaemon joined #nim |
01:12:56 | * | azimut quit (Ping timeout: 255 seconds) |
01:26:34 | FromDiscord | <raynei486> is there a generic type that can take any procedure |
01:26:44 | FromDiscord | <raynei486> like something that takes an unnamed procedure |
01:27:31 | FromDiscord | <Elegantbeef> `proc` |
01:30:24 | FromDiscord | <raynei486> alright thanks |
01:39:32 | * | baalajimaestro joined #nim |
01:50:06 | * | greaser|q quit (Remote host closed the connection) |
01:55:19 | FromDiscord | <demotomohiro> In reply to @raynei486 "is there a generic": Here is a list of type classes: https://nim-lang.org/docs/manual.html#generics-type-classes |
02:15:43 | * | greaser|q joined #nim |
02:20:06 | * | greaser|q quit (Remote host closed the connection) |
02:45:44 | * | greaser|q joined #nim |
02:46:03 | * | baalajimaestro quit (Remote host closed the connection) |
03:29:23 | * | derpydoo quit (Ping timeout: 264 seconds) |
03:55:17 | * | greaser|q quit (Remote host closed the connection) |
04:02:42 | NimEventer | New thread by undefined: Would Nim modules or available Nim web frameworks suffice for an e-commerce back-end?, see https://forum.nim-lang.org/t/11053 |
04:13:33 | * | greaser|q joined #nim |
04:15:17 | * | greaser|q quit (Remote host closed the connection) |
04:16:42 | * | greaser|q joined #nim |
07:08:16 | * | advesperacit joined #nim |
08:15:51 | * | rockcavera quit (Remote host closed the connection) |
08:40:06 | src | `10b.nim` is there a way to compile this file? |
08:40:30 | FromDiscord | <odexine> No, rename the file |
08:40:41 | src | k, bummer, ty for the answer |
08:40:45 | FromDiscord | <odexine> File names must be valid Nim identifiers |
08:53:35 | src | hoped for an option to override |
08:53:49 | src | not a big drama though |
09:23:13 | * | xet7 quit (Ping timeout: 264 seconds) |
10:02:00 | * | azimut joined #nim |
12:34:03 | FromDiscord | <Robyn [She/Her]> `cmd: ./koch boot -d:release --skipUserCfg --skipParentCfg --hints:off↵error: "./koch": executable's TLS segment is underaligned: alignment is 8, needs to be at least 64 for ARM64 Bionic` uh |
12:35:12 | FromDiscord | <nnsee> interesting. what does `lsb_release -a` say |
12:35:37 | FromDiscord | <Robyn [She/Her]> Built koch myself and it's working fine now |
12:35:59 | FromDiscord | <nnsee> where did you get the nonfunctional koch |
12:36:38 | FromDiscord | <Robyn [She/Her]> Straight from the nim repo |
12:38:38 | FromDiscord | <nnsee> wut? |
12:38:43 | FromDiscord | <nnsee> there is no koch binary in the nim repo |
12:38:50 | FromDiscord | <Robyn [She/Her]> Wait then how did I get it |
12:39:09 | FromDiscord | <Robyn [She/Her]> I have no idea then |
13:18:00 | * | krux02 joined #nim |
13:19:02 | * | Guest95 joined #nim |
13:23:52 | * | krux02 quit (Remote host closed the connection) |
13:26:03 | Guest95 | hi, I have a large a project using orc also ptr and threads ... where I started having sigsegv after a big change in the code, but I dont know how to narrow down the source of the error. gdb stack trace points to alloc.nim deallocation on the largest object in the project (3d game engine so the object is too big to split or test in smaller chunks). |
13:26:04 | Guest95 | any tips? |
13:39:11 | Zevv | valgrind |
13:39:36 | Zevv | do not move any refs over threads unless you really really know what you're doing. if you must, use arc |
13:39:52 | Zevv | asan, tsan, helgrind, drd |
13:40:15 | FromDiscord | <fosster> guys, how can I append a query to an `Uri` with a raw string, so to not escape special characters in the string like % |
13:40:19 | Zevv | don't assume you're smarter than the sanitizers and blame this on false positives |
13:41:35 | Zevv | Guest95: are you sharing refs? |
13:42:22 | Guest95 | Zevv: no ref sharing, only pointers. |
13:42:26 | FromDiscord | <fosster> I specifically need to add a query containing an hexadecimal representation of an hash, and I have already created a function that convert the hash to its url-encoded representation (%xx), and when I append it to an Uri with `%` function, it also escapes the percent |
13:43:04 | Zevv | Guest95: that's good. Check the lifetimes on your data, if you take a ptr to something that no longer exists you're screwed of course. |
13:43:20 | Zevv | for the rest: sanitizers and valgrind. they will tell you where you're messing up. |
13:43:37 | Guest95 | yes, but that would not mess up orc I guess? |
13:44:01 | Zevv | no that should be ok, orc doesn't care about your ptrs |
13:44:04 | Guest95 | I would get segfault in my code, which I can debug |
13:44:14 | Zevv | when you get a segfault, you're too late |
13:44:22 | Zevv | often, way to late. |
13:44:28 | * | rockcavera joined #nim |
13:44:51 | Zevv | you want to catch your code red handed. that's where your sanitizers will help, they will tell you when stuff is wrong /before/ you crash |
13:44:52 | Guest95 | yes, that is why I hoped there is something else other than valgrind and related memory sanitation, |
13:45:16 | Zevv | if you're doing ptrs, you're not fighting orc or arc. |
13:45:18 | Guest95 | something in nim that maybe tracks orc activities, I dont know really |
13:45:27 | Zevv | you do ptrs, not erfs. |
13:45:28 | Zevv | refs. |
13:45:35 | Zevv | right? |
13:46:27 | Guest95 | I have a mix, usually when I have ptr problems I get segfault in my code, I can trace that and fix it |
13:46:41 | Guest95 | here I am getting a segfault in orc deallocation |
13:46:54 | Guest95 | system/alloc.nim |
13:46:56 | Zevv | right, so you're not doing just pointers |
13:47:02 | Guest95 | that is why I am not sure it is ptr related |
13:47:16 | Zevv | run with -d:useMalloc to cut the nim allocator out of the mix, your code will run just with your libc malloc/free |
13:47:21 | Guest95 | I thought maybe there is something in nim that tells me, orc and refs are fine or not |
13:47:21 | Zevv | that might simplify things for debuggin |
13:47:36 | Zevv | orc and refs are fine, but not over threads. |
13:47:37 | Guest95 | oh, great |
13:47:41 | Zevv | that'll blow up in your face |
13:47:43 | Guest95 | that is what I needed |
13:47:56 | Guest95 | i need to take orc out of the equation |
13:48:00 | Zevv | also measure, your standard malloc() might give better performance than nim malloc |
13:48:10 | Zevv | -d:usemalloc does not exclude orc |
13:48:15 | Zevv | only the nim memory allocator |
13:48:25 | Guest95 | yes malloc is faster, that is why I am having a mix |
13:48:48 | Guest95 | eveything high perf is basically C style memory and threading. |
13:48:56 | Zevv | these are not mutually exclusive, you can do ptrs with the nim allocator or orc with libc malloc |
13:49:05 | Zevv | one is about allocation, the other is about lifetime management |
13:50:05 | Zevv | the thing is, if you start peeking and poking refs from muiltiple threads, the refcounter under the hood gets messed up |
13:50:35 | Zevv | so you end up with 100% certain data races on the rc, and potential leaks or use-after-free |
13:51:08 | Guest95 | yes, right, but still, for perf I usually just write in C low level style, full control over everything, and then for the cold path, nim orc. thus the mix. |
13:51:16 | Zevv | right. sanitizers. |
13:51:38 | Zevv | imho your code should run 100% clean on drd and tsan |
13:51:52 | Zevv | there are exceptions, but these are pretty rare |
13:52:23 | Guest95 | Zevv: thanks for the infos! I have a long afternoon ahead chasing pointers. |
13:52:32 | Zevv | let the tooling do it for you |
13:53:23 | Zevv | --passC:-fsanitize=thread --passL:-fsanitize=thread |
13:54:45 | * | junaid_ joined #nim |
13:56:58 | * | junaid_ quit (Remote host closed the connection) |
14:07:13 | Guest95 | Zevv: useMalloc fixed the issue or hid it. now I need to do some address sanitization and maybe go back to without useMalloc to understand the issue. |
14:07:58 | Zevv | "hid it" is most likely, yes |
14:08:21 | Zevv | sanitizers are hugely underappreciated. I sanitize 100% of my code these days. |
14:08:31 | Zevv | I'm just not smart enough to do these things myself. |
14:08:51 | Zevv | even without threading involved. Don't get me started about when threading *is* involved. |
14:09:48 | Zevv | as of late i prefer getting a stapler to the forehead over doing any kind of threading code involving shared memory |
14:13:39 | * | end quit (Ping timeout: 255 seconds) |
14:18:37 | * | end joined #nim |
14:29:34 | Guest95 | Zevv: a few data races around the same object and a mutex destruction error, I think that I am using a ptr object that contains at some layers deep refs, I will need to recheck this code. Thanks for the help. |
15:18:20 | * | jmdaemon quit (Ping timeout: 260 seconds) |
15:48:05 | * | def- quit (Quit: -) |
15:48:23 | * | def- joined #nim |
15:52:14 | * | def- quit (Client Quit) |
15:55:28 | * | def- joined #nim |
16:10:40 | FromDiscord | <␀ Array 🇵🇸 🍉> can nim be compiled for powerpc? specificlly the wiiu |
16:11:14 | Zevv | nim can be compiled for any platform with a C compiler |
16:13:27 | FromDiscord | <im__cynical> how do I assign a value to something in json |
16:14:01 | FromDiscord | <im__cynical> sent a long message, see https://pasty.ee/UpnLFydfSyMU |
16:25:36 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=farsPFRJikOa |
16:28:12 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=dzzUdEjcHAqE |
16:47:59 | * | rockcavera quit (Read error: Connection reset by peer) |
16:48:18 | * | rockcavera joined #nim |
16:52:14 | FromDiscord | <␀ Array 🇵🇸 🍉> i could just take the c output and manually compile that but id assume the compiler can do that |
16:57:30 | Zevv | Check the docs for cross compiler info |
16:57:49 | Zevv | there's a bunch of specific targets, anything not in the list can be done with --os:any |
16:57:59 | Zevv | make a nim.cfg file where you specify your compiler path and prefix |
16:58:06 | Zevv | and nim does the rest for you |
16:58:28 | Zevv | https://nim-lang.org/docs/nimc.html#crossminuscompilation |
16:58:57 | Zevv | also your nick is crappy, I can't msg or @ you |
17:01:31 | * | def- quit (Quit: -) |
17:02:09 | * | def- joined #nim |
17:04:09 | * | Guest95 quit (Quit: Ping timeout (120 seconds)) |
17:05:35 | * | azimut quit (Ping timeout: 255 seconds) |
17:14:46 | NimEventer | New thread by Horkarod: Local library development and editor tooling, see https://forum.nim-lang.org/t/11057 |
17:18:07 | * | ntat joined #nim |
17:35:50 | * | ntat quit (Quit: Leaving) |
17:52:08 | * | def- quit (Quit: -) |
17:52:49 | * | def- joined #nim |
17:55:51 | * | def- quit (Client Quit) |
17:56:32 | * | def- joined #nim |
18:10:12 | * | xet7 joined #nim |
18:15:36 | * | def- quit (Quit: -) |
18:16:46 | * | def- joined #nim |
18:57:56 | * | azimut joined #nim |
19:50:17 | * | azimut quit (Ping timeout: 255 seconds) |
19:51:36 | * | azimut joined #nim |
20:27:18 | FromDiscord | <nervecenter> In reply to @Guest95 "i need to take": --gc:none |
20:27:45 | FromDiscord | <nervecenter> (edit) "--gc:none" => "--mm:none" |
20:28:06 | FromDiscord | <nervecenter> (edit) "--mm:none" => "`--mm:none`" |
20:51:06 | * | om3ga quit (Read error: Connection reset by peer) |
21:04:44 | * | disso-peach joined #nim |
21:32:26 | * | xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in) |
21:34:23 | * | xutaxkamay joined #nim |
21:35:54 | FromDiscord | <Elegantbeef> `--mm:arc` |
21:47:19 | FromDiscord | <Robyn [She/Her]> In reply to @chronos.vitaqua "I'm trying to mess": Hm not sure how to make this work, specifically for storing objects in a table↵↵Should I return a `ProviderTable` or something and make `store` a method of that? Would I need to do something like `JsonTableProvider` or could I use something that isn't specific to a provider... |
21:47:34 | FromDiscord | <Robyn [She/Her]> I'm struggling to explain my thoughts atm, I'm just gonna try it |
22:07:01 | * | dza quit (Quit: ) |
22:08:32 | * | dza joined #nim |
22:26:04 | NimEventer | New thread by shirleyquirk: Buildroot host-nim package?, see https://forum.nim-lang.org/t/11059 |
22:36:07 | FromDiscord | <bosinski2023> sent a code paste, see https://play.nim-lang.org/#pasty=nGCMrQnszVnU |
22:36:37 | FromDiscord | <bosinski2023> (edit) "https://play.nim-lang.org/#pasty=IFIwJYcGOvNg" => "https://play.nim-lang.org/#pasty=PkTBtPBjjjuu" |
22:42:04 | FromDiscord | <nnsee> In reply to @␀ Array 🇵🇸 🍉 "can nim be compiled": yes |
22:50:50 | * | advesperacit quit () |
23:06:16 | NimEventer | New thread by georgelemon: Tim - A template engine & markup language, see https://forum.nim-lang.org/t/11060 |
23:07:50 | * | azimut quit (Ping timeout: 255 seconds) |
23:26:07 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
23:26:40 | * | SchweinDeBurg joined #nim |
23:28:37 | FromDiscord | <rongcuid> What's the canonical way to use C libraries in Nim? |
23:29:12 | * | Epsilon quit (Remote host closed the connection) |
23:29:40 | * | Epsilon joined #nim |
23:30:12 | FromDiscord | <Robyn [She/Her]> In reply to @rongcuid "What's the canonical way": You mean the recommended way? |
23:30:54 | FromDiscord | <Robyn [She/Her]> Well, one is either wrapping the C libraries yourself with `importc` (the docs should have info on that), or using Futhark, which uses libclang to parse C code and generate a Nim wrapper for it |
23:31:39 | FromDiscord | <Elegantbeef> And if you're on a proper OS you can then use pkg-config to get the flags for your library |
23:32:39 | FromDiscord | <rongcuid> Yeah, recommended way. I would prefer not to manually wrapping the library |
23:32:57 | FromDiscord | <Elegantbeef> Futhark or c2nim is the way then |
23:33:23 | FromDiscord | <rongcuid> Last time I touched Nim it was still 1.6 or something, I will need to catch up on the tools |
23:34:15 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "And if you're on": Pkg-config? |
23:34:36 | FromDiscord | <Elegantbeef> yes a tool that library authors can create files for to easily query flags required for compiling |
23:34:49 | FromDiscord | <rongcuid> How does the nim auto formatting work these days? |
23:34:53 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "yes a tool that": Nice! |
23:34:55 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=YJxqIyxeiDyK |
23:35:00 | FromDiscord | <Robyn [She/Her]> In reply to @rongcuid "How does the nim": As in, `nimpretty`? |
23:35:11 | FromDiscord | <rongcuid> I think so. I remember it breaking lines in very weird ways |
23:35:15 | FromDiscord | <Robyn [She/Her]> There's actually something newer on the scene called `nimph` which is super cool |
23:35:20 | FromDiscord | <Elegantbeef> nph is a new formater that forces a style if you want |
23:35:25 | FromDiscord | <Robyn [She/Her]> Oh nph |
23:35:29 | FromDiscord | <Robyn [She/Her]> Not nimph |
23:37:36 | FromDiscord | <rongcuid> Can Nim use pkg-config? |
23:54:02 | FromDiscord | <Elegantbeef> You can use it inside `passL` or `passC` pragmas options |