<< 21-02-2024 >>

00:08:04FromDiscord<Robyn [She/Her]> I wonder how well cps could integrate with asyncdispatch
00:08:13FromDiscord<Robyn [She/Her]> The other way around seems trickier
00:14:57FromDiscord<leorize> it's not that hard
00:15:11FromDiscord<leorize> you just have to have your callbacks resume the continuation
00:15:30*greaser|q joined #nim
00:25:22FromDiscord<Robyn [She/Her]> I wonder if there's any point to that, now :p
00:26:23FromDiscord<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:34FromDiscord<raynei486> is there a generic type that can take any procedure
01:26:44FromDiscord<raynei486> like something that takes an unnamed procedure
01:27:31FromDiscord<Elegantbeef> `proc`
01:30:24FromDiscord<raynei486> alright thanks
01:39:32*baalajimaestro joined #nim
01:50:06*greaser|q quit (Remote host closed the connection)
01:55:19FromDiscord<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:42NimEventerNew 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:06src`10b.nim` is there a way to compile this file?
08:40:30FromDiscord<odexine> No, rename the file
08:40:41srck, bummer, ty for the answer
08:40:45FromDiscord<odexine> File names must be valid Nim identifiers
08:53:35srchoped for an option to override
08:53:49srcnot a big drama though
09:23:13*xet7 quit (Ping timeout: 264 seconds)
10:02:00*azimut joined #nim
12:34:03FromDiscord<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:12FromDiscord<nnsee> interesting. what does `lsb_release -a` say
12:35:37FromDiscord<Robyn [She/Her]> Built koch myself and it's working fine now
12:35:59FromDiscord<nnsee> where did you get the nonfunctional koch
12:36:38FromDiscord<Robyn [She/Her]> Straight from the nim repo
12:38:38FromDiscord<nnsee> wut?
12:38:43FromDiscord<nnsee> there is no koch binary in the nim repo
12:38:50FromDiscord<Robyn [She/Her]> Wait then how did I get it
12:39:09FromDiscord<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:03Guest95hi, 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:04Guest95any tips?
13:39:11Zevvvalgrind
13:39:36Zevvdo not move any refs over threads unless you really really know what you're doing. if you must, use arc
13:39:52Zevvasan, tsan, helgrind, drd
13:40:15FromDiscord<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:19Zevvdon't assume you're smarter than the sanitizers and blame this on false positives
13:41:35ZevvGuest95: are you sharing refs?
13:42:22Guest95Zevv: no ref sharing, only pointers.
13:42:26FromDiscord<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:04ZevvGuest95: 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:20Zevvfor the rest: sanitizers and valgrind. they will tell you where you're messing up.
13:43:37Guest95yes, but that would not mess up orc I guess?
13:44:01Zevvno that should be ok, orc doesn't care about your ptrs
13:44:04Guest95I would get segfault in my code, which I can debug
13:44:14Zevvwhen you get a segfault, you're too late
13:44:22Zevvoften, way to late.
13:44:28*rockcavera joined #nim
13:44:51Zevvyou 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:52Guest95yes, that is why I hoped there is something else other than valgrind and related memory sanitation,
13:45:16Zevvif you're doing ptrs, you're not fighting orc or arc.
13:45:18Guest95something in nim that maybe tracks orc activities, I dont know really
13:45:27Zevvyou do ptrs, not erfs.
13:45:28Zevvrefs.
13:45:35Zevvright?
13:46:27Guest95I have a mix, usually when I have ptr problems I get segfault in my code, I can trace that and fix it
13:46:41Guest95here I am getting a segfault in orc deallocation
13:46:54Guest95system/alloc.nim
13:46:56Zevvright, so you're not doing just pointers
13:47:02Guest95that is why I am not sure it is ptr related
13:47:16Zevvrun with -d:useMalloc to cut the nim allocator out of the mix, your code will run just with your libc malloc/free
13:47:21Guest95I thought maybe there is something in nim that tells me, orc and refs are fine or not
13:47:21Zevvthat might simplify things for debuggin
13:47:36Zevvorc and refs are fine, but not over threads.
13:47:37Guest95oh, great
13:47:41Zevvthat'll blow up in your face
13:47:43Guest95that is what I needed
13:47:56Guest95i need to take orc out of the equation
13:48:00Zevvalso measure, your standard malloc() might give better performance than nim malloc
13:48:10Zevv-d:usemalloc does not exclude orc
13:48:15Zevvonly the nim memory allocator
13:48:25Guest95yes malloc is faster, that is why I am having a mix
13:48:48Guest95eveything high perf  is basically C style memory and threading.
13:48:56Zevvthese are not mutually exclusive, you can do ptrs with the nim allocator or orc with libc malloc
13:49:05Zevvone is about allocation, the other is about lifetime management
13:50:05Zevvthe thing is, if you start peeking and poking refs from muiltiple threads, the refcounter under the hood gets messed up
13:50:35Zevvso you end up with 100% certain data races on the rc, and potential leaks or use-after-free
13:51:08Guest95yes, 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:16Zevvright. sanitizers.
13:51:38Zevvimho your code should run 100% clean on drd and tsan
13:51:52Zevvthere are exceptions, but these are pretty rare
13:52:23Guest95Zevv: thanks for the infos! I have a long afternoon ahead chasing pointers.
13:52:32Zevvlet the tooling do it for you
13:53:23Zevv--passC:-fsanitize=thread --passL:-fsanitize=thread
13:54:45*junaid_ joined #nim
13:56:58*junaid_ quit (Remote host closed the connection)
14:07:13Guest95Zevv: 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:58Zevv"hid it" is most likely, yes
14:08:21Zevvsanitizers are hugely underappreciated. I sanitize 100% of my code these days.
14:08:31ZevvI'm just not smart enough to do these things myself.
14:08:51Zevveven without threading involved. Don't get me started about when threading *is* involved.
14:09:48Zevvas 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:34Guest95Zevv: 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:40FromDiscord<␀ Array 🇵🇸 🍉> can nim be compiled for powerpc? specificlly the wiiu
16:11:14Zevvnim can be compiled for any platform with a C compiler
16:13:27FromDiscord<im__cynical> how do I assign a value to something in json
16:14:01FromDiscord<im__cynical> sent a long message, see https://pasty.ee/UpnLFydfSyMU
16:25:36FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=farsPFRJikOa
16:28:12FromDiscord<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:14FromDiscord<␀ Array 🇵🇸 🍉> i could just take the c output and manually compile that but id assume the compiler can do that
16:57:30ZevvCheck the docs for cross compiler info
16:57:49Zevvthere's a bunch of specific targets, anything not in the list can be done with --os:any
16:57:59Zevvmake a nim.cfg file where you specify your compiler path and prefix
16:58:06Zevvand nim does the rest for you
16:58:28Zevvhttps://nim-lang.org/docs/nimc.html#crossminuscompilation
16:58:57Zevvalso 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:46NimEventerNew 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:18FromDiscord<nervecenter> In reply to @Guest95 "i need to take": --gc:none
20:27:45FromDiscord<nervecenter> (edit) "--gc:none" => "--mm:none"
20:28:06FromDiscord<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:54FromDiscord<Elegantbeef> `--mm:arc`
21:47:19FromDiscord<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:34FromDiscord<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:04NimEventerNew thread by shirleyquirk: Buildroot host-nim package?, see https://forum.nim-lang.org/t/11059
22:36:07FromDiscord<bosinski2023> sent a code paste, see https://play.nim-lang.org/#pasty=nGCMrQnszVnU
22:36:37FromDiscord<bosinski2023> (edit) "https://play.nim-lang.org/#pasty=IFIwJYcGOvNg" => "https://play.nim-lang.org/#pasty=PkTBtPBjjjuu"
22:42:04FromDiscord<nnsee> In reply to @␀ Array 🇵🇸 🍉 "can nim be compiled": yes
22:50:50*advesperacit quit ()
23:06:16NimEventerNew 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:37FromDiscord<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:12FromDiscord<Robyn [She/Her]> In reply to @rongcuid "What's the canonical way": You mean the recommended way?
23:30:54FromDiscord<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:39FromDiscord<Elegantbeef> And if you're on a proper OS you can then use pkg-config to get the flags for your library
23:32:39FromDiscord<rongcuid> Yeah, recommended way. I would prefer not to manually wrapping the library
23:32:57FromDiscord<Elegantbeef> Futhark or c2nim is the way then
23:33:23FromDiscord<rongcuid> Last time I touched Nim it was still 1.6 or something, I will need to catch up on the tools
23:34:15FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "And if you're on": Pkg-config?
23:34:36FromDiscord<Elegantbeef> yes a tool that library authors can create files for to easily query flags required for compiling
23:34:49FromDiscord<rongcuid> How does the nim auto formatting work these days?
23:34:53FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "yes a tool that": Nice!
23:34:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=YJxqIyxeiDyK
23:35:00FromDiscord<Robyn [She/Her]> In reply to @rongcuid "How does the nim": As in, `nimpretty`?
23:35:11FromDiscord<rongcuid> I think so. I remember it breaking lines in very weird ways
23:35:15FromDiscord<Robyn [She/Her]> There's actually something newer on the scene called `nimph` which is super cool
23:35:20FromDiscord<Elegantbeef> nph is a new formater that forces a style if you want
23:35:25FromDiscord<Robyn [She/Her]> Oh nph
23:35:29FromDiscord<Robyn [She/Her]> Not nimph
23:37:36FromDiscord<rongcuid> Can Nim use pkg-config?
23:54:02FromDiscord<Elegantbeef> You can use it inside `passL` or `passC` pragmas options