<< 13-12-2024 >>

01:10:24*phantom_ joined #nim
01:44:08*phantom_ quit (Quit: WeeChat 3.5)
02:01:45FromDiscord<nasuray> zigcc is just a wrapper around `zig cc` https://nimpkgs.dayl.in/#/pkg/zigcc
02:02:34FromDiscord<PATRYK SENS> jyyps\:// pls
02:04:24*tiorock joined #nim
02:04:24*rockcavera is now known as Guest4349
02:04:24*Guest4349 quit (Killed (tantalum.libera.chat (Nickname regained by services)))
02:04:24*tiorock is now known as rockcavera
02:06:27*rockcavera is now known as Guest7735
02:06:27*tiorock joined #nim
02:06:27*Guest7735 quit (Killed (copper.libera.chat (Nickname regained by services)))
02:06:27*tiorock is now known as rockcavera
02:23:12FromDiscord<k0ts> sent a code paste, see https://play.nim-lang.org/#pasty=LAQQYbRp
02:24:19FromDiscord<k0ts> (edit) "https://play.nim-lang.org/#pasty=oBSzJaKE" => "https://play.nim-lang.org/#pasty=SlGqgyfN"
02:50:03*syl_ is now known as syl
02:52:02*tiorock joined #nim
02:52:02*tiorock quit (Changing host)
02:52:02*tiorock joined #nim
02:52:02*rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services)))
02:52:02*tiorock is now known as rockcavera
03:12:27*rockcavera quit (Remote host closed the connection)
04:26:46*SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev)
04:27:15*SchweinDeBurg joined #nim
04:28:14*krux02_ quit (Quit: Leaving)
05:02:05FromDiscord<bostonboston> In current year does Nim expose allocator functions?
05:03:29FromDiscord<Elegantbeef> Which ones?
05:03:41FromDiscord<Elegantbeef> Do you want to just allocate a block of memory or access the actual allocator
05:03:55FromDiscord<bostonboston> The equivalents of alloc and free and a realloc
05:04:09FromDiscord<Elegantbeef> Yes
05:09:08*xet7 joined #nim
05:10:53FromDiscord<odexine> theyre called those exact same names if you're talking about that
05:11:02FromDiscord<odexine> alloc, free, realloc
05:11:21FromDiscord<bostonboston> My purpose for wanting one is to allow memory I want to outlive a return, alternative could I make a ref type that I call gc_ref() on before I return, does that accomplish the same thing for me
05:12:13FromDiscord<Elegantbeef> Yes
05:12:20FromDiscord<odexine> i dont think you need to call gc_ref if you're not passing it to an extern?
05:12:37FromDiscord<bostonboston> It is extern
05:12:43FromDiscord<odexine> okay then yes
05:15:08FromDiscord<bostonboston> I love languages that let me do whatever I want
05:41:29FromDiscord<4zv4l> Nim gives so much freedom for real xD
05:46:21FromDiscord<k0ts> sent a code paste, see https://play.nim-lang.org/#pasty=LVEFZqCG
05:57:00FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#pasty=oLzFcRid
05:58:15FromDiscord<bostonboston> In the cast it looks like you're dereferencing your ptr, I think you either need to not dereference, or change your cast from ptr array to just array
05:58:36FromDiscord<bostonboston> Nvm, I read the parentheses wrong
05:59:30FromDiscord<Elegantbeef> `cast[ptr UncheckedArray[uint8]](myPointer).toOpenArray(0, high)`?
06:00:01FromDiscord<4zv4l> if I need to precise the length in the `toOpenArray`, I can just keep the `ptr array` xD
06:00:32FromDiscord<Elegantbeef> You can indeed
06:00:42FromDiscord<Elegantbeef> Why you're using pthreads directly is a bit confounding
06:00:45FromDiscord<4zv4l> its not possible to pass an `openArray` by addr ?
06:00:50FromDiscord<4zv4l> oh its just a silly test
06:00:58FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#pasty=oAJSLLzu
06:01:15FromDiscord<Elegantbeef> You'd send `oa[0].addr`
06:02:53FromDiscord<4zv4l> In reply to @Elegantbeef "You'd send `oa[0].addr`": it seems to still cause the Loc error
06:03:03FromDiscord<4zv4l> or there is a special way to cast the ptr back to openArray ?
06:07:00FromDiscord<Elegantbeef> You can only cast the above way
06:09:06FromDiscord<Elegantbeef> Open arrays are not really real
06:39:18FromDiscord<bostonboston> Call it a span and we'll be a real language
07:10:10*acidsys quit (Ping timeout: 248 seconds)
07:33:09*acidsys joined #nim
07:48:25*xet7 quit (Ping timeout: 272 seconds)
08:07:53*beholders_eye joined #nim
08:13:03*beholders_eye quit (Ping timeout: 246 seconds)
08:14:53*xet7 joined #nim
08:21:41*xet7 quit (Ping timeout: 248 seconds)
09:59:16FromDiscord<nocturn9x> for today's "bugs that make no sense"
09:59:25FromDiscord<nocturn9x> please observe:
09:59:47FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=GRuQuskF
09:59:55FromDiscord<nocturn9x> (edit) "https://play.nim-lang.org/#pasty=DRpxCWEH" => "https://play.nim-lang.org/#pasty=FsKgjZMA"
10:00:01FromDiscord<nocturn9x> `args.self` is a `ptr SearchManager`
10:00:04FromDiscord<nocturn9x> huh?????
10:01:49FromDiscord<nocturn9x> `SearchManager` is an object btw. It's stored in a seq and I pass the `addr` to the worker thread
10:05:01FromDiscord<Elegantbeef> The sequence outlives the thread?
10:06:36FromDiscord<Elegantbeef> The copy version working makes me think you're modifying the sequence wrongly, as is typical run it through a thread sanitizer
10:11:48FromDiscord<nocturn9x> In reply to @Elegantbeef "The sequence outlives the": yes, always
10:12:17FromDiscord<nocturn9x> the flow is the following: there is one `var SearchManager` which has a `children` `seq[SearchManager]` that it appends children into
10:12:24FromDiscord<nocturn9x> (edit) "the flow is the following: there is one `var SearchManager` ... which" added "from the "main" thread"
10:13:06FromDiscord<nocturn9x> it appends a `newSearchManager()` to the sequence and passes its `addr` to the thread
10:13:15FromDiscord<nocturn9x> the sequence is only emptied after all worker threads have already exited
10:13:20FromDiscord<nocturn9x> this sounds like a bug in lifetime tracking
10:13:41FromDiscord<nocturn9x> it works fine if I just spawn one worker thread, but it breaks with more
10:13:57FromDiscord<nocturn9x> if I explicitly assign the pointer to a variable then it works with any number of threads
10:14:38*beholders_eye joined #nim
10:14:57FromDiscord<Elegantbeef> Well it copies the object↵(@nocturn9x)
10:15:13FromDiscord<nocturn9x> _oh_
10:15:14FromDiscord<Elegantbeef> `args.self[]` copies the object then you operate on the local variable
10:15:15FromDiscord<nocturn9x> right
10:15:31FromDiscord<nocturn9x> that makes sense
10:15:56FromDiscord<Elegantbeef> Which means it's likely an issue with sharing gc'd memory across threads and causing multiple threads to do something šŸ˜„
10:16:04FromDiscord<Elegantbeef> But I have to go so no more insights
10:16:04FromDiscord<nocturn9x> yeah
11:49:21*beholders_eye quit (Ping timeout: 246 seconds)
12:17:47*beholders_eye joined #nim
13:08:16*nils` quit (Ping timeout: 252 seconds)
13:48:04*nils` joined #nim
14:14:34*nils` quit (Ping timeout: 252 seconds)
14:14:57*beholders_eye quit (Ping timeout: 276 seconds)
14:20:32*zgasma quit (Quit: Lost terminal)
14:24:00FromDiscord<System64 ~ Flandre Scarlet> Is it possible to use Nim 2.2.0 on Ubuntu 16.04?
14:26:46Amun-Racan't see why not
14:27:38FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "can't see why not": I tried choosenim, my glibc is too old
14:28:29Amun-Rahave you tried building from git repo?
14:28:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "have you tried building": Is it hard to do? Does it take a lot of time?
14:29:00Amun-Ragit clone https://github.com/nim-lang/Nim; cd Nim; git checkout v2.2.0; ./build_all.sh
14:29:20FromDiscord<System64 ~ Flandre Scarlet> Oh, might be easy then!
14:30:08Amun-RaI usually copy a few required dirs to /opt/nim then symlink all the files from /opt/nim/bin to /usr/local/bin and voila
14:30:27Amun-Rayou can run nim right from that dir
14:30:41FromDiscord<System64 ~ Flandre Scarlet> Or adding to the PATH?
14:30:50Amun-Rathat works too
14:31:15FromDiscord<System64 ~ Flandre Scarlet> I can build a Docker image, but Docker...
14:31:31Amun-Raadd bin dir to the PATH and there's nothing more needed in order for nim to work
14:54:49*beholders_eye joined #nim
15:21:02*nils` joined #nim
15:45:53*xet7 joined #nim
15:47:21*ntat joined #nim
15:50:55FromDiscord<zumi.dxy> In reply to @sys64 "Oh, might be easy": it is
16:30:25*coldfeet joined #nim
16:33:05*beholders_eye quit (Quit: WeeChat 4.1.2)
17:01:21FromDiscord<System64 ~ Flandre Scarlet> In reply to @zumi.dxy "it is": But is it even possible to make a Docker image?
17:19:00*krux02_ joined #nim
17:26:29FromDiscord<nnsee> In reply to @sys64 "I tried choosenim, my": too old to run choosenim or too old to run the binary tarball it downloads?
17:26:46FromDiscord<nnsee> because if it's the former, you can just download the tarball manually
17:29:11*ntat quit (Quit: Leaving)
17:41:02*valms19901 joined #nim
17:50:54*xet7 quit (Ping timeout: 246 seconds)
17:53:10*GnuYawk6 quit (Quit: The Lounge - https://thelounge.chat)
17:53:41*GnuYawk6 joined #nim
17:57:18Amun-RaI suspect choosenim binary is too new
18:03:34*xet7 joined #nim
18:05:06Amun-RaI always build nim to .deb
18:08:57Amun-Raofficial debian repository suck balls… it still contains 1.6.10-ish
18:45:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @nnsee "too old to run": Choosenim I think↵But I compiled Nim from source
19:44:17FromDiscord<System64 ~ Flandre Scarlet> Does someone knows how I can use musl instead of glibc please?↵I don't understand how to do
19:45:13*xaltsc joined #nim
19:51:03FromDiscord<Elegantbeef> Did you download a musl compiler?
20:06:09FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Did you download a": musl-gcc
20:08:09FromDiscord<Elegantbeef> Did you then do `--gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc`?
20:09:59FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=qcCGJgUX
20:10:42Amun-Rayou don't neec .cpp. if you don't use cpp target
20:10:44FromDiscord<Elegantbeef> Yes
20:10:46Amun-Raneed*
20:11:33FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "you don't neec .cpp.": There is some C++ code in a dependencie
20:11:53FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1317222481307631726/message.txt?ex=675de688&is=675c9508&hm=d2c3afb3ff1df68c1e9a91137d3690ba5236d4596c05ee0dc319d9b9fe87077b&
20:11:57FromDiscord<System64 ~ Flandre Scarlet> Compiler very very angry
20:13:19FromDiscord<System64 ~ Flandre Scarlet> That's weird because x11 is installed
20:14:28FromDiscord<Elegantbeef> Right you need musl includes for anything you use
20:14:29FromDiscord<Elegantbeef> You can possibly use your normal headers and hope it works
20:14:50FromDiscord<System64 ~ Flandre Scarlet> so I need to include everything manually?
20:15:34FromDiscord<Elegantbeef> You probably can do `--passC:"-I/usr/include/"`
20:16:32FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "You probably can do": libc-header-start.h https://media.discordapp.net/attachments/371759389889003532/1317223653083185212/message.txt?ex=675de79f&is=675c961f&hm=b0214bc4abd24cbfc5779a0c5070a49091bb5ae7556e660404ce2f8f9f7fa94a&
20:18:36FromDiscord<Elegantbeef> Welcome to C compiler hell
20:19:36FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Welcome to C compiler": would zigcc solve the problem?
20:20:28FromDiscord<Elegantbeef> If you wanted to target an older glibc instead of musl
20:23:22FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "If you wanted to": The principle is the same?
20:24:51FromDiscord<Elegantbeef> In what regard?
20:26:19FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=Xthjweza
20:26:36FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1317226184760889544/message.txt?ex=675de9fb&is=675c987b&hm=37508c3c2e8a96349d98be1be76eafdd1a8c3ed82f2789fff98844618ef37702&
20:27:20FromDiscord<Elegantbeef> Well I provided the zigcc command for targeting an older glibc yesterday my time
20:27:29FromDiscord<Elegantbeef> install zig and the nimble zigcc package then use it
20:30:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "install zig and the": Some progress I guess? https://media.discordapp.net/attachments/371759389889003532/1317227263858577468/message.txt?ex=675deafc&is=675c997c&hm=23cfc5ae6bc6d06030c2b051129de9bff4c4fc4946cc79900d4f26f26c98380d&
20:32:06FromDiscord<Elegantbeef> What's your zig config?
20:37:09FromDiscord<Elegantbeef> Rather what is your config for the zig compiler in your nim config
20:37:30FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Rather what is your": Can I send the code please? The configs are quite complex
20:40:38FromDiscord<System64 ~ Flandre Scarlet> I think i use the default one, but not sure
20:41:24FromDiscord<Elegantbeef> The zig config flags was like a single line when I sent them
20:41:29FromDiscord<Elegantbeef> You should have `--cc:clang --clang.exe=zigcc ....`
20:41:58FromDiscord<nnsee> In reply to @Amun-Ra "official debian repository suck": but it's "StAbLe"
20:43:15FromDiscord<System64 ~ Flandre Scarlet> Oooh clang
20:46:55Amun-Rannsee: even experimental branch has no 2.0
20:47:20FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=RfoCULnM
20:47:40FromDiscord<Elegantbeef> Stop targetting musl and be happy
20:47:55FromDiscord<System64 ~ Flandre Scarlet> So I can target a lower libc? How to do this?
20:48:01FromDiscord<System64 ~ Flandre Scarlet> (edit) "this?" => "this please?"
20:48:11FromDiscord<Elegantbeef> You select one of the glibc versions zig has
20:50:12FromDiscord<Elegantbeef> `zig targets | jq -r .glibc[]` to list all the glibcs zig has target support of
20:53:21FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=gQJSLXSM
20:54:07FromDiscord<Elegantbeef> Sounds like your include paths are mis configured
20:54:46FromDiscord<System64 ~ Flandre Scarlet> It should just find them? It's Linux, not Windows
20:57:33FromDiscord<Elegantbeef> C compilers are not magic they need to be properly configured
20:57:43FromDiscord<Elegantbeef> If your `/usr/include` is not in your path or `-I` is not set then it'll do this
20:57:50FromDiscord<Elegantbeef> Does it work fine with gcc/clang?
20:58:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Does it work fine": Works perfectly with gcc, not tried with Clang
21:00:51FromDiscord<System64 ~ Flandre Scarlet> Well, I did ``--passC:"-I/usr/include"`` and zigcc https://media.discordapp.net/attachments/371759389889003532/1317234806039253153/message.txt?ex=675df202&is=675ca082&hm=be82a581a75c4d5e67f41d58e7b0b062127f7ccef94acf149af7a924fd47cada&
21:01:16FromDiscord<System64 ~ Flandre Scarlet> It's even weirder
21:03:29FromDiscord<Robyn [She/Her]> I wonder how hard it is to use the AST generated by clang to create bindings to stuff
21:03:35FromDiscord<Robyn [She/Her]> I know that Futhark does that
21:03:47FromDiscord<Elegantbeef> Opir is right there for you to steal from
21:04:45FromDiscord<System64 ~ Flandre Scarlet> Seem the only solution I have is to compile on an old distro?
21:04:55FromDiscord<Elegantbeef> Or y'know fix your compiler
21:06:13FromDiscord<Robyn [She/Her]> ...huh, this is appended after the json output :p↵`/usr/bin/ld: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../lib64/Scrt1.o: in function `_start':↵(.text+0x1b): undefined reference to `main'`
21:06:19FromDiscord<Robyn [She/Her]> (edit) "...huh, this is appended after the json output :p↵`/usr/bin/ld: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../lib64/Scrt1.o: in function `_start':↵(.text+0x1b): undefined reference to `main'`" => "sent a code paste, see https://play.nim-lang.org/#pasty=DRVTdbPD"
21:06:30FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Opir is right there": Good point....
21:08:39FromDiscord<Robyn [She/Her]> My question is how do I get a C API wrapper from a C++ API without having to make the glue myself
21:10:32FromDiscord<Robyn [She/Her]> In reply to @chronos.vitaqua "...huh, this is appended": `-S` did the trick
21:13:11FromDiscord<System64 ~ Flandre Scarlet> C/C++ bad
21:13:20*coldfeet quit (Quit: Lost terminal)
21:21:28FromDiscord<System64 ~ Flandre Scarlet> Like↵It has too many problems
21:25:37FromDiscord<Robyn [She/Her]> In reply to @sys64 "C/C++ bad": Issue: Gotta make bindings for Godot C++ API
21:25:45FromDiscord<Robyn [She/Her]> It only exposes a C++ API, too
21:25:59FromDiscord<Robyn [She/Her]> Well it does expose a C API but I don't think it's everything
21:26:12FromDiscord<Robyn [She/Her]> It does expose a JSON file for the API
21:26:21FromDiscord<Robyn [She/Her]> I guess I should use that, I forgot that existed-
21:30:18FromDiscord<demotomohiro> In reply to @sys64 "C/C++ bad": But most of OS and drivers are writtten in C/C++.
21:31:22*rockcavera joined #nim
21:33:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "But most of OS": Dependency management is HELL
21:34:27FromDiscord<Elegantbeef> Nah it's fine just use pkg-config
21:36:31FromDiscord<System64 ~ Flandre Scarlet> what is that?
21:37:18FromDiscord<System64 ~ Flandre Scarlet> Like↵Having X11 issues just because I want to use an older libc, so weird
21:40:19FromDiscord<Elegantbeef> Pkg-config is a nice tool that dumps C flags for libraries if people write a pc file
21:40:44FromDiscord<Elegantbeef> Makes it so you can just do things like `nim c --passL:$(pkg-config --libs sdl2)`
21:42:01FromDiscord<System64 ~ Flandre Scarlet> Quite interesting↵However I'm still stuck with my weird issue
21:42:15FromDiscord<Elegantbeef> Right does the issue persist if you remove the target parameter?
21:43:39FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Right does the issue": No, compiles fine
21:46:05*valms19901 quit (Remote host closed the connection)
22:00:59FromDiscord<Robyn [She/Her]> Man I don't understand the GDExtension API format
22:02:31*tiorock joined #nim
22:02:31*tiorock quit (Changing host)
22:02:31*tiorock joined #nim
22:02:31*rockcavera quit (Killed (molybdenum.libera.chat (Nickname regained by services)))
22:02:31*tiorock is now known as rockcavera
22:03:16FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Right does the issue": I can still compile from a VM with old Linux distro, but it's very inconvenient
22:04:35*tiorock joined #nim
22:04:35*tiorock quit (Changing host)
22:04:35*tiorock joined #nim
22:04:35*rockcavera is now known as Guest3920
22:04:35*tiorock is now known as rockcavera
22:08:09*Guest3920 quit (Ping timeout: 276 seconds)
22:21:59FromDiscord<Robyn [She/Her]> Hmm is this an acceptable template? `template raiseIf[T: Exception](exception: typedesc[T], condition: bool, message: string) = (if condition: raise exception.newException(message))`
22:22:25FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=fzfMRjHE
22:22:36FromDiscord<Robyn [She/Her]> Could even remove the parens but idk if I wanna do that
22:35:34FromDiscord<Robyn [She/Her]> The urge to rewrite if builtinClassSize["build_configuration"].getStr != $BuildConfiguration: continue as (builtinClassSize["build_configuration"].getStr != $BuildConfiguration).then(continue)
22:35:47FromDiscord<Robyn [She/Her]> (edit) "if" => "`if" | "continue" => "continue`" | "(builtinClassSize["build_configuration"].getStr" => "`(builtinClassSize["build_configuration"].getStr" | "$BuildConfiguration).then(continue)" => "$BuildConfiguration).then(continue)`"
22:39:46FromDiscord<Robyn [She/Her]> `expression expected, but found 'keyword continue'` laaaame
23:17:45*disso-peach joined #nim
23:26:49*disso-peach quit (Quit: Leaving)
23:29:05FromDiscord<Robyn [She/Her]> ...huh??? `extensionApi["builtin_class_sizes"].kind != JArray`
23:29:07FromDiscord<Robyn [She/Her]> Oops
23:29:12FromDiscord<Robyn [She/Her]> ``Error: unhandled exception: /home/chronos/.asdf/installs/nim/2.2.0/lib/pure/json.nim(831, 3) `node.kind == JArray` : items() can not iterate a JsonNode of kind JObject [AssertionDefect]``
23:29:19FromDiscord<Robyn [She/Her]> I have a check for this
23:29:37FromDiscord<Robyn [She/Her]> And printing `extensionApi["builtin_class_sizes"]` shows that it is a list
23:29:38FromDiscord<Robyn [She/Her]> Wtf
23:31:06FromDiscord<Robyn [She/Her]> Oh wait
23:31:09FromDiscord<Robyn [She/Her]> it is an object
23:31:24FromDiscord<Robyn [She/Her]> The error is for a later line of code
23:31:34FromDiscord<Robyn [She/Her]> Why isn't it showing what line of code it is though.
23:33:53*xet7 quit (Remote host closed the connection)
23:35:21*xet7 joined #nim
23:37:36FromDiscord<System64 ~ Flandre Scarlet> In reply to @sys64 "I can still compile": I used Docker, works perfectly!