<< 19-02-2024 >>

00:04:40*jmdaemon joined #nim
00:26:03*cnx quit (Ping timeout: 260 seconds)
00:38:59*cnx joined #nim
00:51:41*rockcavera quit (Ping timeout: 240 seconds)
00:58:25*rockcavera joined #nim
00:58:25*rockcavera quit (Changing host)
00:58:25*rockcavera joined #nim
01:03:41*Mister_Magister quit (Quit: bye)
01:04:39*xet7 quit (Ping timeout: 256 seconds)
01:05:35*Mister_Magister joined #nim
01:09:24*rockcavera quit (Read error: Connection reset by peer)
01:10:35*rockcavera joined #nim
01:14:17*azimut quit (Ping timeout: 255 seconds)
01:22:25*xet7 joined #nim
02:22:57*lucasta quit (Quit: Leaving)
04:14:16*pbsds quit (Quit: The Lounge - https://thelounge.chat)
04:16:27*pbsds joined #nim
05:19:17*rockcavera quit (Ping timeout: 240 seconds)
05:57:07FromDiscord<aryzen> Is there anywhere I can go to see what packages there are for nimble?
06:06:36FromDiscord<intellij_gamer> https://nimble.directory/
06:28:56FromDiscord<zumi.dxy> this one is also pretty good https://nimpkgs.dayl.in/
06:33:05*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
07:00:38*SchweinDeBurg joined #nim
07:02:46*junaid_ joined #nim
07:31:42*gooba quit (Quit: Leaving)
07:33:17*gooba joined #nim
07:38:55*advesperacit joined #nim
08:24:08*junaid_ quit (Remote host closed the connection)
08:38:51FromDiscord<aryzen> Thx both of you!!
08:51:24*PMunch joined #nim
09:06:29*derpydoo quit (Ping timeout: 240 seconds)
09:10:22*azimut joined #nim
09:56:08*azimut quit (Remote host closed the connection)
09:56:43*azimut joined #nim
10:18:16FromDiscord<madonuko> <https://github.com/terrapkg/packages/actions/runs/7956652643/job/21717829224#step:7:3720>↵↵cannot build choosenim on arm64?
10:18:55FromDiscord<madonuko> sent a code paste, see https://play.nim-lang.org/#pasty=gdnOJAuayLJC
10:48:41FromDiscord<djazz> choosenim doesnt support arm because Nim binaries arent distributed for arm afaik
10:50:21FromDiscord<djazz> I havent tried compiling it myself on arm tho
10:52:22FromDiscord<djazz> The error in your link comes from inline assembly in nim module zippy that fails to compile on arm https://github.com/guzba/zippy/blob/9560f3d20479fb390c97f731ef8d100f1ed54e6c/src/zippy/internal.nim#L332
10:53:02FromDiscord<djazz> cpuid but it is in a when defined(amd64) block??
11:13:57FromDiscord<System64 ~ Flandre Scarlet> Did someone already achieved to compile a Nim program for the SEGA Genesis / MegaDrive?
11:17:01PMunchNot sure if anyone has tried yet :P
11:17:31Amun-RaI can see there's a toolchain to build on gh, I may try it :)
11:17:40PMunchBut I wouldn't be surprised at all
11:22:23*jmdaemon quit (Ping timeout: 252 seconds)
11:56:08*azimut quit (Remote host closed the connection)
11:56:51*azimut joined #nim
12:02:21*azimut quit (Remote host closed the connection)
12:02:58*azimut joined #nim
12:08:59FromDiscord<ayex> I have built nim on aarch64 on raspi and librem5 a couple of times. it works fine, just a little slow on raspi due to its low processing power.↵(@djazz)
12:10:35ZevvI think that since nim has --os:any a lot of the other -os:* settings could (should?) be scrapped
12:10:50Zevvthe majority of these are not tested in CI and no one knows in what state they are
12:11:22ZevvHaiki? VxWorks? Genode? DragonFly? CROSSOS? PalOS, really?!
12:11:40PMunchI guess the better option would be to supply some way to define these in separate repos
12:11:51ZevvI don't see why the compiler must know about these at all
12:12:14Zevvwe generate C. with --os:any and -d:usemalloc there is no other depdency than a few stdlib calls
12:12:24Zevvwhich are available on virtually an C implementation
12:12:30PMunchIIRC it's mostly to enable/disable various parts of the stdlib
12:13:15PMunchAnd of course setting the architecture and other such things. Basically they just bundle a bunch of options into one convenient switch
12:13:22ehmry_it's also to generate os-specific entrypoints other than main()
12:13:34PMunchOh really?
12:13:47Zevvyeah but the problem is that the stdlib is now filld with things like `if defined(solaris) or defined(zephyr) or defined(freertos) or defined(nuttx) or defined(haiku)`
12:14:19Zevvand it's all not tested, right.
12:14:29ehmry_nope
12:14:47ehmry_some of that stuff is hard to test
12:14:53Zevvsure.
12:15:43ehmry_it would be nice to make this stuff external and pass in a package of os-specific stuff as a compiler option
12:15:51Zevvfeature macros instad
12:15:55Zevvinstead
12:16:26Zevvwith an os -> feature matrix somewhere
12:17:17ehmry_with some OSes there isn't enough maintainers to keep support working for every release, which is why it would be nice to externalize it and say FooOS supports compiler version whatever
12:17:33ehmry_if this was easy someone would already be doing it :(
12:17:53PMunchWell it would require the existing ones to be refactored
12:18:06Zevvprbobaly not even a matter of 'easy'. it's just that alot of these were merged in once, the original author has long left and no one ever cared about it since.
12:18:09ehmry_C is like that but C++ is where the dumb platform shit spills out
12:18:11PMunchAnd yeah, a feature matrix system is indeed the better way to deal with this
12:19:41ehmry_having a decent no-libc base platform would be nice
12:20:20*azimut quit (Remote host closed the connection)
12:20:40*azimut joined #nim
12:21:12Zevvi tried that for --os:any, but it was not worth the effort at that point. my goal was to go to no deps at all
12:21:36Zevvwhat's left is basically fwrite(), malloc() and a few others.
12:21:45Zevvyou can stub these in 10 lines of C
12:22:07ZevvI do run nim on misc no-libc platforms
12:22:24ZevvI did some nim inside the linux kernel as well
12:23:54Zevvthe orignal name of the flag was --os:none
12:24:07Zevvbut araq requested I change it to --os:any
12:29:59ehmry_I like os:any
12:35:43Zevveverybody likes os:any
12:36:18Zevvit should have a fluffy and fuzzy mascotte
12:40:16FromDiscord<zumi.dxy> `os:any` vs `os:standalone` at the moment is like "freedom of OS doesn't mean lack of OS" or something like that
12:41:03Zevvos:stdalone isn't really
12:41:56ehmry_I have a solo5 unikernel port that I've been sitting on that's mostly blocked by networking
12:42:15ehmry_networking works but the abstraction doesn't
12:42:23Zevvhow come
12:43:35ehmry_the std network stuff is sockets based, so either you emulate sockets to make that work or drop in other networking library
12:43:41*azimut quit (Ping timeout: 255 seconds)
12:44:14Zevvright. i must admit I never liked nim's networking layers; I almost always use posix.* instead.
12:45:06*azimut joined #nim
12:45:08ehmry_right. and there is some nim platform that use lwip socket implementation when using the native lwip callback interface would be much better
12:45:43Zevvsure. but you just use the lwip api directly without bothering going through the nim network layers.
12:46:09PMunchWell then you lose the ability for library reuse
12:46:28Zevvthe thing is. I want to use some library and it uses dial()
12:46:34Zevvand goes doing a blocking getaddrinfo()
12:46:43Zevvthat's always the first thing that breaks for me
12:48:31ehmry_I don't think there is consensus on what layer dial/connecting by name should be on, which complicates things
12:48:49Zevvit is just *very* hard to have a single API, widely portable network stack.
12:49:02Zevvespecially when you go down, deep embedded
12:49:20Zevvwhere not everything is a fd
12:49:46ehmry_if you want a a single API then write a TCP/IP stack in Nim :)
12:50:08Zevvlet's start with the TLS layers shall we
12:51:07FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "I can see there's": Where did you find it?
12:52:45Amun-Rahttps://github.com/noname22/megadrive-gcc
12:53:05ehmry_I tried to make a portable network library but I don't have time to maintain it https://git.sr.ht/~ehmry/nim_taps
12:54:45ehmry_and I think my crappy asyncfuture code isn't compatible with orc
12:55:14Zevvmumble mumble cps mumble
12:55:24ehmry_jaja
12:57:05Zevvhave you always been off-github
12:57:10ehmry_if taps is a worthwhile library then it should just be in nim-sys
12:57:22Zevvi considered a few times, but people stared complaining about not being able to find my stuff
12:58:46ehmry_I've been mostly off github for a few years so I try and put everything in the nimble registry
12:59:15FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "https://github.com/noname22/megadrive-gcc": There is SGDK too
13:00:31ehmry_I just write hipster shit anyway
13:01:19Zevvstill, you should consider the other hipsters.
13:16:03*baalajimaestro quit (Remote host closed the connection)
13:24:33FromDiscord<summarity> Can Nim produce source maps for the C backend?
13:25:34*rockcavera joined #nim
13:36:46FromDiscord<djazz> In reply to @ayex "I have built nim": Choosenim on arm...
13:43:04*LyndsySimon quit (Ping timeout: 246 seconds)
13:44:06*oisota quit (Read error: Connection reset by peer)
13:44:32*oisota joined #nim
13:44:47*disso-peach quit (Read error: Connection reset by peer)
13:44:50*disso_pch joined #nim
13:45:52*robertmeta quit (Ping timeout: 246 seconds)
13:49:40*cm_ joined #nim
13:50:04*cm quit (Ping timeout: 246 seconds)
13:50:04*cm_ is now known as cm
13:52:49*LyndsySimon joined #nim
13:54:39*robertmeta joined #nim
13:57:25*LyndsySimon quit (Ping timeout: 264 seconds)
13:59:41*rockcavera quit (Remote host closed the connection)
14:13:54*LyndsySimon joined #nim
14:14:01*blackbeard420 quit (Ping timeout: 268 seconds)
14:14:36FromDiscord<djazz> Nim on pi is slow yeah
14:14:46FromDiscord<djazz> Pi zero
14:17:59*ntat joined #nim
14:18:37*blackbeard420 joined #nim
14:22:29PMunchReally?
14:24:25*GreaseMonkey quit (Ping timeout: 264 seconds)
14:27:42FromDiscord<leorize> nim compiler is very memory bandwidth reliant afaict
14:31:11FromDiscord<nervecenter> Isn't cross-compiling how most mobile frameworks do it anyways?
14:31:17FromDiscord<nervecenter> I could be completely wrong
14:32:05FromDiscord<nervecenter> That's probably an advantage for Android JVM applications, they can accept the same JVM bytecode and different architectural implementations of the JVM can just run it
14:33:36FromDiscord<odexine> it pretty much is the advantage of any VM based language
14:33:56FromDiscord<odexine> well ig its not inherent to VM based languages, some dont have this benefit, but
14:34:57*greaser|q joined #nim
14:35:46PMunchHmm, working with FreeRTOS I'm running into a memory leak situation
14:35:56PMunchI think it might be caused by vTaskDelete(nil)
14:36:11PMunchBasically at the end of the task it must delete itself or it triggers an assertion
14:36:33PMunchBut I guess the ARC cleanup code is injected after the call to vTaskDelete
14:36:47PMunchWhich means that my task never cleans up after itself..
14:37:38FromDiscord<leorize> when in doubt, add an another layer of indirection
14:41:38FromDiscord<jayj2368> https://github.com/romeric/Fastor/blob/master/Fastor/tensor/Tensor.h#L18-L19 Hi, does nim support this kind type? const value as generic parameters, and generic varargs?
14:42:00FromDiscord<jayj2368> sent a code paste, see https://play.nim-lang.org/#pasty=nywcbDmNaSyj
14:42:21PMunch@leorize, yeah that's what I*m considering..
14:43:41FromDiscord<leorize> nim does not support generic varargs↵(@jayj2368)
14:43:54FromDiscord<leorize> const value, sure
14:43:59*derpydoo joined #nim
14:44:10FromDiscord<leorize> you can checkout arraymancer as a tensor implementation in nim
14:44:28*rockcavera joined #nim
14:44:51FromDiscord<jayj2368> @leorize Thanks.
15:00:03*rockcavera quit (Read error: Connection reset by peer)
15:00:23*rockcavera joined #nim
15:07:50PMunchHmm, looks like maybe I was wrong..
15:08:22PMunchI tried to add a level of indirection. Basically my task now calls an "impl" which is a normal Nim proc
15:08:28PMunchBut it's still leaking
15:08:35*rockcavera quit (Read error: Connection reset by peer)
15:08:35PMunchExactly 192 bytes each iteration
15:09:46*rockcavera joined #nim
15:09:46*rockcavera quit (Changing host)
15:09:46*rockcavera joined #nim
15:11:23NimEventerNew thread by Horkarod: Futhark and editor tooling, see https://forum.nim-lang.org/t/11040
15:16:41*PMunch quit (Quit: Leaving)
15:23:32*rockcavera quit (Read error: Connection reset by peer)
15:23:53*rockcavera joined #nim
15:23:53*rockcavera quit (Changing host)
15:23:53*rockcavera joined #nim
15:25:37*LyndsySimon quit (Ping timeout: 264 seconds)
15:25:46*LyndsySimon joined #nim
15:46:57*greaser|q quit (Ping timeout: 256 seconds)
15:50:07*greaser|q joined #nim
17:20:54*pbsds quit (Quit: The Lounge - https://thelounge.chat)
17:21:41*mahlon quit (Ping timeout: 260 seconds)
17:22:21*xet7 quit (Remote host closed the connection)
17:31:02*rockcavera quit (Read error: Connection reset by peer)
17:31:47*rockcavera joined #nim
17:31:47*rockcavera quit (Changing host)
17:31:47*rockcavera joined #nim
17:39:54FromDiscord<grandpa> can i get help here
17:40:57FromDiscord<grandpa> i'm getting errors when trying to compile something: https://media.discordapp.net/attachments/371759389889003532/1209192916472569856/message.txt?ex=65e607a9&is=65d392a9&hm=af88d499d6059ceac6376867d98e8cf9eb3d13f2be62d8f537ac29518b9a2716&
17:42:32*pbsds joined #nim
17:45:07FromDiscord<odexine> compile with --mm:refc
17:55:14*mahlon joined #nim
18:08:37*junaid_ joined #nim
18:18:07*ntat quit (Quit: Leaving)
18:52:57FromDiscord<griffith1deadly> if i unload nim dll (nim program compiled to dll), should allocated memory by dll get's deallocated?↵↵i mean, i wanna write some plugin system for nim with hotcodereloading, and I'm wondering if there will be a memory leak when the dll is reloaded
19:08:26FromDiscord<Robyn [She/Her]> Does anyone know if there's a way to create idiomatic C++ bindings to a Nim library? Like, if I want to expose a Nim type as a class, and some functions as methods on that class
19:11:27FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "Does anyone know if": i know only genny for c, https://github.com/treeform/genny
19:12:02FromDiscord<Robyn [She/Her]> Fair, thanks anyway
19:12:14FromDiscord<Robyn [She/Her]> Might need to figure out how to handwrite it in a decent way
19:29:12*greaser|q quit (Changing host)
19:29:12*greaser|q joined #nim
19:29:15*greaser|q is now known as GreaseMonkey
19:56:32*rockcavera quit (Read error: Connection reset by peer)
19:57:43*rockcavera joined #nim
20:13:09*jmdaemon joined #nim
20:16:12*junaid_ quit (Remote host closed the connection)
20:16:33FromDiscord<fosster> hii all
20:16:56FromDiscord<Robyn [She/Her]> Heya
20:17:04FromDiscord<fosster> can I use Option[var Something] as a function signature?
20:17:36FromDiscord<fosster> I get `Warning: Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]`
20:17:41FromDiscord<Elegantbeef> No
20:18:12FromDiscord<fosster> mh, is there an alternative for it?
20:18:16FromDiscord<Elegantbeef> `var T` is only allowed as a parameter and return type, you need a borrow checker to use it anywhere else safely (there is an experimental feature)
20:18:27FromDiscord<fosster> I've been bangin my head against this problem all day long
20:19:13FromDiscord<Elegantbeef> What does the function do?
20:19:56FromDiscord<Robyn [She/Her]> In reply to @fosster "mh, is there an": Why not a ref?
20:19:56FromDiscord<Robyn [She/Her]> Or a pointer depending on your needs
20:20:04FromDiscord<fosster> basically I need to pass an optional variable reference that, when provided, store an hash inside said variable
20:20:24FromDiscord<Elegantbeef> Use an overload
20:21:12FromDiscord<fosster> I thought about it but I'd need to rewrite the whole function again
20:21:32FromDiscord<Elegantbeef> I mean if we're really lazy templates exist
20:21:35FromDiscord<fosster> like I should have two identical functions for just a few line of code more
20:23:02FromDiscord<Elegantbeef> You also can just make the internal logic be another proc and forward arguments
20:23:17FromDiscord<Elegantbeef> Or if ref fits better you can use that
20:23:20FromDiscord<Elegantbeef> Or ptr
20:26:57FromDiscord<fosster> you mean with Option?
20:27:18FromDiscord<fosster> I'm trying to solve it using template
20:42:46FromDiscord<fakecrafter> is there a easy way to compare two objects for equality in the sense of data
20:44:23FromDiscord<fakecrafter> basically `equals[T](a: T, b: T): bool`
20:47:59FromDiscord<fosster> I ended up using macros, however I'm still facing another issue, how can I inherit local variables from within macros? i.e. a variable defined in the function where the macro is invoked, but it seems it doesn't inherit it
20:51:29FromDiscord<fosster> don't worry, I solved the problem
20:51:57FromDiscord<fosster> I was looking at the wrong thing
20:52:29FromDiscord<bosinski2023> In reply to @fakecrafter "basically `equals[T](a: T, b:": i guess u look for smth. like `func `==`[T]( a, b :T ) :bool = # your compare-fn` as done for all build-in types in `system.nim` https://nim-lang.org/docs/system.html#%3D%3D%2Cbool%2Cbool
20:53:43FromDiscord<fosster> the approach with seems to be working btw
20:56:48FromDiscord<Elegantbeef> fosster I am interested in this macro you've got 😄
21:02:18*def- quit (Quit: -)
21:02:31*def- joined #nim
21:02:51FromDiscord<fakecrafter> Thx
21:05:16FromDiscord<Robyn [She/Her]> Debating on making my NBT impl allow for implementing custom types but is that even worth it? Considering no-one should really be using NBT anywhere except for Minecraft specifically? And it already implements the entire spec so
21:07:42FromDiscord<Elegantbeef> Why write code that no one needs?
21:08:06FromDiscord<Robyn [She/Her]> Exactly
21:08:27FromDiscord<Robyn [She/Her]> I am bored tho and don't know what to do
21:18:02*rockcavera quit (Read error: Connection reset by peer)
21:19:13*rockcavera joined #nim
21:19:13*rockcavera quit (Changing host)
21:19:13*rockcavera joined #nim
21:19:42*dukester joined #nim
21:35:28FromDiscord<asviest> what is nnkVarTuple ?
21:35:43FromDiscord<Elegantbeef> `var (x, y) = bleh`
21:39:30FromDiscord<asviest> ok, is the penultimate slot reserved for pragmas or why is it needed ?
21:41:13FromDiscord<Elegantbeef> Don't ask me I just know how to create AST not why AST
21:45:02*def- quit (Quit: -)
21:45:36*def- joined #nim
21:55:54NimEventerNew thread by lou15b: How to detect (and report) reference cycles?, see https://forum.nim-lang.org/t/11045
21:58:18*def- quit (Quit: -)
21:59:00*def- joined #nim
22:06:13*dukester left #nim (Time to go)
22:23:56*advesperacit quit ()
22:51:35FromDiscord<grandpa> In reply to @odexine "compile with --mm:refc": tysm
22:59:57*disso_pch quit (Remote host closed the connection)
23:43:19*derpydoo quit (Ping timeout: 246 seconds)