<< 31-08-2023 >>

00:03:37FromDiscord<Chronos [She/Her]> Quick question: What'd be the best way for my event system (running on the main thread) to fire functions in other threads with data in the main thread? Like if someone wants to register an event that's running on another thread
00:03:42FromDiscord<Chronos [She/Her]> That's probably not doable tbh
00:03:54FromDiscord<Chronos [She/Her]> Or at least with no real ude
00:03:56FromDiscord<Chronos [She/Her]> Use
00:19:37FromDiscord<ahungry> excuse all the lisp - this is another one I did in janet that's very close to your suggestion- the meat and potatoes is C level pthread spinlocks to simulate clojure like atoms, so I have a cross-thread shared memory space, and threads can mutate the data by function callback application (same as clojure atom) - I'm new to nim, but I think the same approach could be done there since it was a feature for janet, but done in C: https://githu
00:19:49FromDiscord<ahungry> (edit) "suggestion-" => "question -"
00:20:29FromDiscord<ahungry> if you don't need a thread to mutate the data, just a cross thread shared memory space (not sure the nim idiom for that)
00:30:15FromDiscord<Elegantbeef> Channels are your best option afaik↵(@Chronos [She/Her])
00:32:41FromDiscord<sOkam! 🫐> In reply to @sys64 "https://github.com/heysokam/confy About confy, ": thats an extra `build.nim` file that is next to your main file
00:33:38FromDiscord<sOkam! 🫐> the `examples/nim_hello` folder shows the folder structure for that example
00:38:04FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Channels are your best": Fair enough
00:57:04FromDiscord<ahungry> can channels perform bi-directional communication in nim? that's why I wrote the janet lib (it lacked that, or I didn't understand it) - a worker thread could receive messages, but couldn't (easily) send messages to other worker threads or back to the supervisor - so if you wanted to have 8 threads work in parallel to build up some big object and re-assemble it, not a good fit
00:57:23FromDiscord<Elegantbeef> The Nim way of doing bidirectional would be having two channels
00:57:44FromDiscord<Elegantbeef> Though I do not do multi threading
00:59:05*mal`` quit (Quit: Leaving)
01:08:54FromDiscord<Chronos [She/Her]> Tbf it wouldn't be hard to use one channel both ways
01:14:09*mal`` joined #nim
01:22:16NimEventerNew thread by maverk: Nim documention, see https://forum.nim-lang.org/t/10447
01:37:32FromDiscord<Chronos [She/Her]> How would you generate the docs locally, if anyone knows? For the stdlib
01:37:32FromDiscord<Chronos [She/Her]> Wondering now
01:49:54FromDiscord<Elegantbeef> `koch docs` iirc
01:51:01FromDiscord<Elegantbeef> Though docs should be shipped if installed using choosenim i believe
01:51:54FromDiscord<Elegantbeef> Yea there's a docs folder inside the nim toolchain and you can go to the html folder and get them locally
01:52:27*krux02 quit (Remote host closed the connection)
01:58:18FromDiscord<Chronos [She/Her]> Makes sense
01:58:27FromDiscord<Chronos [She/Her]> Heh, ChatGPT finally helped me-
01:58:44FromDiscord<Chronos [She/Her]> It outputted a Crockford Base32 encoder and decoder in Nim for me
01:59:24nmz-probably stolen from somewhere else
02:00:35FromDiscord<Chronos [She/Her]> Most definitely for sure, but I genuinely could not be bothered to try and figure it out after ages of struggling lol
02:01:14FromDiscord<ahungry> I use `nim doc filename.nim` - is koch different? I don't have that on my OS (I installed nim with choosenim)
02:01:27FromDiscord<ahungry> I enjoy `nim genDepend` also
02:02:00FromDiscord<Elegantbeef> koch is the compiler build tool
02:02:07FromDiscord<Elegantbeef> It's for development
02:03:47FromDiscord<Chronos [She/Her]> Lol the code doesn't work 🥲
02:04:18FromDiscord<Elegantbeef> Of course not
02:04:50FromDiscord<Chronos [She/Her]> Idk what I expected but
02:04:52FromDiscord<Chronos [She/Her]> Oh well
02:05:00FromDiscord<Chronos [She/Her]> It outputs `0` no matter the input value
02:05:03FromDiscord<Chronos [She/Her]> For deciding
02:05:05FromDiscord<Chronos [She/Her]> Decoding
02:10:55FromDiscord<Chronos [She/Her]> https://play.nim-lang.org/#ix=4EXQ have fun ig? Lol
02:11:57FromDiscord<Chronos [She/Her]> Weird, changing line 26 to `result = result 32 + value` makes it output `8610` instead somehow
02:11:59FromDiscord<Elegantbeef> `result = 1`
02:12:30FromDiscord<Elegantbeef> `0 32 + value` != `result = result (32 + value)`
02:15:25*edr quit (Quit: Leaving)
02:20:27FromDiscord<Chronos [She/Her]> Still gives wrong numbers, outputs `41378` now?
02:20:52FromDiscord<Chronos [She/Her]> Using `result = result 32 + value` with `result` having an initial value of 1 at the start
02:21:22FromDiscord<Elegantbeef> I didnt look at the algo, just the math
02:23:02FromDiscord<Chronos [She/Her]> This is pain
02:28:05NimEventerNew Nimble package! iecook - Cook all cookies of your browser, see https://github.com/thisago/iecook
02:33:21FromDiscord<Elegantbeef> Well base32/64 rely on how the ascii table is defined
02:33:36FromDiscord<Elegantbeef> It'd be nicer if it chose 32 sequential characters
02:33:55FromDiscord<Elegantbeef> Also how is that base 32 when there are 36 characters?
02:34:39FromDiscord<Elegantbeef> Ah nvm it skips some letters
02:42:02FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "It'd be nicer if": Avoids chars that can look like others (`lI1`, `0O`) and 'U' to avoid profanity lol
02:42:13FromDiscord<Chronos [She/Her]> lI1, 0O
02:57:12FromDiscord<kyre58> how is the nim sublime text experience? decent?
03:08:59termerdunno
03:09:03termeruse VSCode
03:09:06termer8)
03:11:41FromDiscord<Chronos [She/Her]> In reply to @kyre58 "how is the nim": Probably alright, but I recommend trying it yourself to see if you think it's worth it
03:12:03FromDiscord<Chronos [She/Her]> I use VSC personally, but with all editors or IDEs, you'll find Nim support is.... Lacking, unfortunately
03:13:25FromDiscord<kyre58> ah, i tried vsc but electron…
03:13:54termerYou'll find that nimsuggest is a bigger hog than Electron
03:16:54FromDiscord<Elegantbeef> Even worse when a project isn't setup 'properly'
03:17:08*termer quit (Remote host closed the connection)
03:17:36*termer joined #nim
03:18:04*mahlon quit (Read error: Connection reset by peer)
03:18:44*mahlon joined #nim
03:40:31FromDiscord<sOkam! 🫐> Is there any flag I can send to `nim c ` so it outputs the full command that is being called for building?↵I'm calling it from a tool which automates it, and need to figure out what's wrong with it. but `--verbosity:2` is showing me the data inside the compilation steps, not the command itself 🤔
03:42:15FromDiscord<Elegantbeef> `--listCmd` or `--fullCmd` always forget
03:42:40FromDiscord<sOkam! 🫐> ty ✍️
03:42:53FromDiscord<sOkam! 🫐> --listCmd
03:44:31FromDiscord<sOkam! 🫐> oh wait, but it prints the commands that verbosity:2 already does
03:47:11FromDiscord<sOkam! 🫐> ah i see the problem. classic `nim c` ignoring `--outdir:` being sent in the wrong position 😔
03:54:24FromDiscord<sOkam! 🫐> In reply to @odexine "maybe swap the order": This, basically, was the problem. I will never understand how this is a thing 😔
03:54:52FromDiscord<Elegantbeef> "wrong position?
04:01:10FromDiscord<sOkam! 🫐> sent a code paste, see https://paste.rs/zf6Hy
04:01:29FromDiscord<sOkam! 🫐> Only the order of the args+outdir was changed
05:07:11*advesperacit joined #nim
05:23:30FromDiscord<Phil> In reply to @.maverk "so 32 bits are": There are no exact floating points. You can make it more and more precise so that the "error" becomes so small you start noticing it less, but it'll always be there
05:24:41FromDiscord<Phil> 32bit is just so little you notice it more quickly, 64bit still has it but it's smaller.↵That is the reason why for finance math you very often do calculations of prices etc. with integers in cents so that you don't have floating numbers which might add error.
05:41:40*ntat joined #nim
06:05:19*rockcavera quit (Remote host closed the connection)
06:26:30FromDiscord<ringabout> In reply to @jmgomez "agh he just broke": Worry not, It breaks my PRs as well. https://github.com/nim-lang/Nim/pull/22595
06:28:12*PMunch joined #nim
06:41:03FromDiscord<pmunch> In reply to @.maverk "created 25 days ago": Account creation by itself doesn't ping the moderators. You have to create a topic in order for us to notice you as a new user. I checked your account and you are a proper user now.
06:42:17FromDiscord<pmunch> In reply to @heysokam "they are all static": This does indeed complicate it a bit, but you could always copy one of them and remove the `main` function before running Futhark on it. Involves a tiny bit of manual work, but it should work.
06:52:29FromDiscord<enthus1ast> for the float thing\: https://nim-lang.org/docs/math.html#almostEqual%2CT%2CT%2CNatural↵`template `\~=`(a, b: float): bool = almostEqual(a, b)`
06:59:20*isaiah joined #nim
07:00:20FromDiscord<enthus1ast> @ahungry\: @.maverk ^
07:00:59isaiahhello everyone
07:01:10FromDiscord<enthus1ast> hi
07:01:18PMunchHi
07:01:31isaiahis there something like tkinter and flask in nim
07:02:40FromDiscord<enthus1ast> we have some webserver and some gui frameworks
07:02:57PMunchYou have a tcl wrapper in the Nim organization as well, not sure how supported it is though
07:03:01FromDiscord<enthus1ast> i think it depends what you need
07:03:08PMunchFor flask I'd say Jester is probably the closest
07:03:26PMunchBut it's been a long time since I used flask, so I might misremember
07:03:40isaiahbut jester seems to have no detailed doc or resource for learning it
07:04:05FromDiscord<enthus1ast> there is not too much to learn
07:04:42PMunchIt's definitely a bit of a "everything works until it doesn't" kind of situation though
07:04:42isaiahso how do you nim personally
07:05:12PMunchI've looked at Jester source code more than once to figure out how I'm supposed to do something because the docs are lacking
07:05:50FromDiscord<enthus1ast> yeah looking at the source code is a good tip in general
07:05:59PMunchYou could try HappyX though, more active development, and possibly better docs although I haven't had a look at them
07:06:31FromDiscord<enthus1ast> for webserver i currently tend to use mummy though
07:06:49PMunchisaiah, what do you mean? I tend to use Jester simply because I'm familiar with it, and for UI I tend to use Gtk or imlib2, again because I'm familiar with them
07:06:57isaiahhappyx i will chcek it now. i just wish it could have the python libraries i mean written in nim
07:07:31PMunchOh yeah, mummy might be good. Haven't checked that out either
07:08:05FromDiscord<enthus1ast> mummy itself is more barebone in some cases, but its easily extendable
07:08:29PMunchisaiah, you could always have a look at nimpy if you really want to use a Python library
07:09:49isaiahwon't it better if those libraries were rewritten in nim? it could make it more faster
07:09:52FromDiscord<enthus1ast> but to be honest, i think (currently) its easier in python to write a cross platform gui than in nim, in nim its much more hands on
07:10:23FromDiscord<enthus1ast> a non trivial gui
07:11:14FromDiscord<enthus1ast> but its definitly doable\: https://github.com/Dankr4d/BF2142Unlocker
07:11:44FromDiscord<enthus1ast> this one is done in gintro
07:12:45isaiahi will love it to be easier in nim to. it will boost nim popularity
07:14:37FromDiscord<enthus1ast> maybe
07:15:45FromDiscord<enthus1ast> maybe you can start with what you wanna do, and see for yourself if you can do it
07:15:59FromDiscord<enthus1ast> and if you stuck come here and ask \:)
07:16:53isaiahsure once my nim skills is as a good as my python i will . i prefer nim to rust
07:18:16isaiahNim also need great books to make it easy for those starting out
07:19:16FromDiscord<enthus1ast> https://ssalewski.de/nimprogramming.html
07:19:28PMunchThere's also Nim in Action and Mastering Nim
07:20:00PMunchNative Nim libraries could be faster, but sometimes you just want to do something and not worry about the speed
07:20:20FromDiscord<enthus1ast> https://narimiran.github.io/nim-basics/
07:20:42FromDiscord<enthus1ast> and not worry about it break on production, like in python
07:21:14PMunchAs for GUI there are a lot of options, but the ones that are easy to use typically tend to lack some of the more complex aspects of UI
07:21:28PMunchenthus1ast, oh yeah shipping Python programs is still a pain..
07:22:06FromDiscord<enthus1ast> thats what i really dislike about python, they should finally do their type system
07:40:14qwrif typescript could, then probably its possible for python, but bolting on such things later comes at cost. for typescript its compile time cost, it is not cheap to check at best, and undecidable for some stuff
07:41:26qwrand there are some separate python type annotation checkers, but due the cost i don't believe, that python would ever check these by default
07:42:20*genr8eofl__ is now known as genr8eofl
07:52:23PMunchHmm, I'm wrapping a C library for arbitrary precision math. It supports setting an existing variable from a string, a long, or a double. How would you wrap this? I tried to implement `=` for the type, but that has to have the same arguments. I could do a `set` procedure so you could do `myNum.set("5.0")`, but that seems a bit verbose..
07:56:21isaiahi really do not know how to do that. but are you trying to build a wrapper around the c math library
07:56:59FromDiscord<enthus1ast> p"5.0"
07:57:00FromDiscord<enthus1ast> ?
08:01:58FromDiscord<odexine> where p is string->datatype yeah
08:02:36PMunchisaiah, nah I'm wrapping MAPM
08:02:53PMunchenthus1ast, why p?
08:03:03PMunchBut yeah a prefix like that would work
08:04:38FromDiscord<odexine> any prefix works
08:04:47FromDiscord<odexine> prolly just a plaseholder
08:04:49FromDiscord<odexine> place
08:13:00isaiahi just checked it out its for high precision maths
08:15:48PMunchYup
08:15:49FromDiscord<enthus1ast> p for precision \:)
08:26:55*isaiah quit (Quit: Client closed)
08:29:53NimEventerNew thread by arnetheduck: Pure Nim FFT library, see https://forum.nim-lang.org/t/10449
08:43:20PMunchHmm, this library has a copy procedure. Anyone know how to wrap that with `=copy`?
08:43:45PMunchI have currently followed this: https://nim-lang.org/docs/destructors.html#lifetimeminustracking-hooks-nimeqcopy-hook
08:44:17PMunchBut I'm not entirely sure if the `=destroy` call there might do something it shouldn't..
08:49:07FromDiscord<Elegantbeef> Your destroy hook should be disarmed so it should do nothing if there is nothing to destroy
08:49:39PMunchHmm, the library doesn't have anything like "in-initialized" though..
08:49:45PMunchis*
08:50:06FromDiscord<Elegantbeef> No pointer or anything used as a sentinel either, odd
08:51:49PMunchI mean I just call an init function which returns a pointer
08:52:13PMunchI guess since Nim nil initializes things I could just use `isNil`
08:52:35FromDiscord<Elegantbeef> Right inside your `=destroy` you should have a nil check
08:56:46PMunchSo this should be fine? http://ix.io/4EZ7
08:57:10PMunchWhere MapmInternal is `ptr MapmStruct`.
08:57:40FromDiscord<Elegantbeef> You do not need to check if it's not self
08:58:01PMunchSure?
08:58:03NimEventerNew thread by hyu1996: How to make custom linear containers automatically converted to OpenArray, like SEQ or Array, see https://forum.nim-lang.org/t/10450
08:58:20PMunchIt is mentioned in the official docs: https://nim-lang.org/docs/destructors.html#lifetimeminustracking-hooks-nimeqcopy-hook
08:58:21FromDiscord<Elegantbeef> Ah sorry sink doesnt
10:08:44*jmdaemon quit (Ping timeout: 248 seconds)
10:21:21FromDiscord<.maverk> In reply to @enthus1ast "<@358073954994225153>\: <@1021771961040375900> ^": yes ?
10:21:51FromDiscord<.maverk> In reply to @pmunch "Account creation by itself": thanks
10:34:50FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1146754967483453460/41.PNG
10:35:00FromDiscord<.maverk> the tuple keyword is not working
10:36:18NimEventerNew thread by maverk: The tuple keyword is not working, see https://forum.nim-lang.org/t/10451
10:59:08FromDiscord<System64 ~ Flandre Scarlet> Aaaaah this crash is so confusing https://media.discordapp.net/attachments/371759389889003532/1146761081793040474/message.txt
11:01:51FromDiscord<odexine> Why the threading?
11:02:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "Why the threading?": I have an instance manager that boots every game instance
11:03:02FromDiscord<System64 ~ Flandre Scarlet> https://github.com/system64MC/tfe/tree/develop↵This is the complete code↵And since yesterday I try to fix this crash problem
11:06:24FromDiscord<System64 ~ Flandre Scarlet> I tried quite everything, it always crashes when the server closes
11:06:40FromDiscord<System64 ~ Flandre Scarlet> (edit) "I tried quite everything, it always crashes when the ... server" added "game instance"
11:10:26FromDiscord<griffith1deadly> In reply to @sys64 "https://github.com/system64MC/tfe/tree/develop This": https://github.com/system64MC/tfe/blob/develop/server/src/server.nim#L28↵bro why just locking main thread
11:10:34FromDiscord<griffith1deadly> you can also use it
11:12:31FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "https://github.com/system64MC/tfe/blob/develop/serv": Oh yeah that's true!↵I can put the InstanceManager on the main thread
11:14:06FromDiscord<griffith1deadly> In reply to @sys64 "Oh yeah that's true!": https://github.com/system64MC/tfe/blob/develop/server/src/instanceManager.nim#L134↵↵in this case you can make your own template for pretty code
11:16:31FromDiscord<System64 ~ Flandre Scarlet> Yeah, will reduce repetition
11:16:35FromDiscord<griffith1deadly> https://github.com/qb-0/pyMeow/blob/master/src/gui.nim#L38↵like this
11:18:06FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "https://github.com/qb-0/pyMeow/blob/master/src/gui.": Oh alright
11:18:23FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "https://github.com/system64MC/tfe/blob/develop/serv": Sadly it doesn't fix the crash
11:18:55FromDiscord<griffith1deadly> In reply to @sys64 "Aaaaah this crash is": try debug what thread is crashing
11:19:06FromDiscord<griffith1deadly> istanceman or web or another
11:20:30FromDiscord<griffith1deadly> looks like instanceman
11:20:33FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "istanceman or web or": I don't think web is crashing↵But how can I debug a specific thread?
11:22:09FromDiscord<griffith1deadly> In reply to @sys64 "I don't think web": crash in spawn inst.bootGameInstance2()
11:22:22FromDiscord<griffith1deadly> (edit) "In reply to @sys64 "I don't think web": crash in spawn inst.bootGameInstance2()" => "sent a code paste, see https://play.nim-lang.org/#ix=4EZA"
11:22:34FromDiscord<griffith1deadly> (edit) "https://play.nim-lang.org/#ix=4EZA" => "https://play.nim-lang.org/#ix=4EZB"
11:22:40FromDiscord<System64 ~ Flandre Scarlet> So it crashes in this proc?
11:23:19FromDiscord<griffith1deadly> ye, look in stacktrace https://media.discordapp.net/attachments/371759389889003532/1146767167455514685/image.png
11:23:46FromDiscord<System64 ~ Flandre Scarlet> So it's not InstanceManager's fault?
11:24:35FromDiscord<griffith1deadly> it gameInstance fault↵https://github.com/system64MC/tfe/blob/develop/server/src/gameInstance.nim#L303
11:25:04FromDiscord<griffith1deadly> try play with code to find line who crashing
11:27:38FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4EZC
11:28:15FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "by the way, it": I tried to use the port instead of an actual GameInstance still crashes
11:29:58FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4EZD
11:41:13FromDiscord<.maverk> does nim have optimizaton flags ?
11:41:40FromDiscord<.maverk> (edit) "optimizaton" => "optimization"
11:41:45PMunchYes
11:43:37FromDiscord<.maverk> In reply to @PMunch "Yes": what are they ? ↵↵i used ``-d:danger``
11:43:41FromDiscord<.maverk> but not working
11:43:54FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "try remove this line": It doesn't crash now, but since I moved InstanceManager to the main thread, the channel doesn't work anymore
11:44:59PMunch.maverk, what do you mean "not working"?
11:45:21FromDiscord<.maverk> In reply to @PMunch ".maverk, what do you": i get a lot of errors in the screen
11:45:24PMunch-d:danger turns off a bunch of range checks, along with implying -d:release which turns off some debug features
11:45:29PMunchErrors?
11:45:38FromDiscord<.maverk> let me show you
11:45:48PMunchWell to remove errors you need to fix your code, not turn on optimizations :P
11:47:21FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1146773216245862540/91.PNG
11:47:46FromDiscord<.maverk> In reply to @PMunch "Well to remove errors": no u misunderstood then
11:47:56FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EZK
11:48:23FromDiscord<odexine> In reply to @.maverk "": The flag goes before the file name
11:48:42FromDiscord<.maverk> let me try again
11:48:44PMunchAh
11:48:52PMunchYou need to put -d:release before the filename
11:48:52*disso-peach joined #nim
11:49:15PMunchThe way you have it there it would be an argument to your program, and those can only be passed when you tell Nim to run your program after compiling it
11:49:15*disso-peach quit (Client Quit)
11:49:26FromDiscord<.maverk> now workes
11:49:34FromDiscord<.maverk> (edit) "workes" => "works"
11:50:44*kenran joined #nim
11:51:09FromDiscord<bung8954> @pmunch is nim LSP gc Mark and sweep required?
11:56:47FromDiscord<frobnicate> Was there an ETA on a v2 docker image?
11:56:52PMunchbung8954, haven't tried compiling it without mark and sweep for a while, but since it's basically using nimsuggest as a library it has the same requirements as nimsuggest. And nimsuggest still uses mark and sweep: https://github.com/nim-lang/Nim/blob/devel/nimsuggest/nimsuggest.nim.cfg
11:57:41FromDiscord<griffith1deadly> In reply to @sys64 "nevermind, I have a": looks like norm doesnt support multithread (true)
11:57:47PMunchfrobnicate, not sure if this is automated in any way.. Well, the playground builds docker images for each version.. If you want you can grab the Dockerfile from the playground repo
11:58:40FromDiscord<frobnicate> Can I just curl it or how does that work?
11:58:57FromDiscord<frobnicate> The one on docker hub is little old
11:58:59FromDiscord<jmgomez> In reply to @PMunch "<@714152700920594493>, haven't tried compiling": > but since it's basically using nimsuggest as a library↵Can you elaborate on this? How does it uses as a library? And what does it does on top of nimsuggest that nimsuggest doesnt do? ↵Im asking because at some point Im going to make a vscode extension for NUE and potentially general Nim too
11:59:21FromDiscord<jmgomez> And nimlangserver is a no go for me
11:59:58PMunchfrobnicate, uhm I guess you could curl the dockerfile from GitHub..
12:00:12PMunchjmgomez, how it uses it as a library?
12:00:17PMunch`import nimsuggest`
12:00:22FromDiscord<frobnicate> Yeah cus I don't need the entire repo
12:01:16FromDiscord<jmgomez> In reply to @PMunch "<@726017160115126333>, how it uses": I see. I thought you may referred to using it as dll or something else
12:01:25FromDiscord<bung8954> @pmunch get it, I tried use nimskull compile with orc compiled but runs failed
12:03:27PMunchWhat it does on top is basically just listen to LSP commands, calls some internal nimsuggest function to create a reply, and then converts that back to LSP
12:04:16PMunchbung8954, I think it should work now, the compiler runs with ORC IIRC and nimsuggest is basically just the compiler
12:04:41FromDiscord<frobnicate> I've really been trying hard lately to containerise evwerything 😅
12:06:01FromDiscord<jmgomez> In reply to @PMunch "What it does on": do you see opportunities to open it to other providers? Rather than just `nimsuggest`?
12:06:48FromDiscord<griffith1deadly> nimsuggest so buggy and laggy
12:07:00PMunchjmgomez, what do you mean?
12:08:54FromDiscord<odexine> are there other suggestion providers aside from nimsuggest>
12:08:55FromDiscord<odexine> (edit) "nimsuggest>" => "nimsuggest?"
12:08:56FromDiscord<jmgomez> In reply to @PMunch "<@726017160115126333>, what do you": Like having it multiple backends, so it reports back to the user based on those commands an aggregation of those other backends. Other backends could be something that read road files (when IC is there) or even a basic Nim parser (which oc wouldnt work for macros)
12:11:12FromDiscord<bung8954> @pmunch thanks, there must be problem at other place I'll try to figure it out
12:15:25FromDiscord<.maverk> why is ``of`` considered an operator ????? https://media.discordapp.net/attachments/371759389889003532/1146780277197250641/1.PNG
12:20:53FromDiscord<odexine> it's used in case statements
12:21:20PMunchjmgomez, well it shouldn't be too hard to make it into a modular architecture. But I assume nimsuggest will get IC support, and with the lack of alternate parsers I haven't really considered it.
12:21:24FromDiscord<odexine> https://nim-lang.org/docs/manual.html#statements-and-expressions-case-statement
12:21:37PMunchAnd `x = object of Y`
12:22:21FromDiscord<.maverk> In reply to @odexine "it's used in case": yes i know
12:22:27FromDiscord<.maverk> but operator really ?
12:22:45FromDiscord<odexine> In reply to @PMunch "And `x = object": ah i thought you asked about keywords, but its used here as an operator
12:22:51FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "looks like norm doesnt": Wait WTF??
12:33:35*ntat quit (Quit: leaving)
12:38:40FromDiscord<jmgomez> In reply to @PMunch "<@726017160115126333>, well it shouldn't": > But I assume nimsuggest will get IC support↵Im a bit pessimistic about IC magically improving nimsuggest. Im referring to have something else that reads those road files and provides suggestions based on what it founds. Obviously, it wouldnt be as exhaustive as nimsuggest but for most usages it will be just fine and more importantly it wouldnt be a replacement
12:48:06FromDiscord<Phil> In reply to @griffith1deadly "looks like norm doesnt": That's wild.↵I was aware there were async issues, but I can't see for the life of me how multithreading would screw you over in norn
12:48:08FromDiscord<Phil> (edit) "norn" => "norm"
12:50:07FromDiscord<queebee> Is there a list of c compilers which can be used with `--cc`
12:50:11FromDiscord<queebee> (edit) "`--cc`" => "`--cc`?"
12:57:36*cedb quit (Ping timeout: 246 seconds)
13:06:26FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "That's wild. I was": I guess I'll have to change ORM?
13:11:44FromDiscord<Phil> I can't help there, I never ran into those issues. This is beyond me.↵If you ever want to see this fixed, make a GitHub issue as otherwise nobody will ever know.↵I'm struggling to conceptualise how an orm could screw you in multi threading in the first place
13:12:23FromDiscord<Phil> The only part that interacts is the thread pool and that never was problematic for me in webdev
13:13:23FromDiscord<Phil> (edit) "The only part that interacts ... isconnection" added "with threads without being encapsulated" | "thread" => "connection"
13:24:36FromDiscord<griffith1deadly> In reply to @sys64 "I guess I'll have": debby maybe
13:24:43FromDiscord<griffith1deadly> it support multithreading
13:25:54FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "it support multithreading": So I don't understand why it crashes
13:50:00*ced2 joined #nim
13:50:18FromDiscord<sOkam! 🫐> In reply to @pmunch "This does indeed complicate": not sure i understand what you meant
13:51:06FromDiscord<System64 ~ Flandre Scarlet> Aaaaaalright so I think I found the problem @Phil @griffith1deadly ↵I don't think it's Norm's fault↵I think it's Orc trying to collect a cycle and it explodes
13:53:52FromDiscord<griffith1deadly> In reply to @sys64 "Aaaaaalright so I think": i only say because it figured in stacktrace
13:54:18PMunchsOkam, you said you have main.c files where the main function is defined and it includes some local things. You could take one of those, snip out the main function, and then pass it on to Futhark to wrap everything else.
13:54:32*xmachina joined #nim
13:54:53FromDiscord<sOkam! 🫐> In reply to @PMunch "sOkam, you said you": yeah the snip out part is what i don't get
13:55:41FromDiscord<sOkam! 🫐> do you mean take the entire file without main? or create a header for the functions of main? or copy-paste the static functions to a new file without copying main?↵could be many things
13:56:11*ntat joined #nim
13:56:36FromDiscord<sOkam! 🫐> also, how do you pass futhark on it if there is no .h file?
14:00:34*PMunch quit (Quit: Leaving)
14:06:52FromDiscord<System64 ~ Flandre Scarlet> Finally I fixed the bug...↵Seems Orc still has some problems so I moved to Arc
14:07:52FromDiscord<sOkam! 🫐> How would you map `const char argv[]` to Nim?↵`argv :cstringArray`? 🤔
14:08:32FromDiscord<odexine> do you need to?
14:09:39FromDiscord<sOkam! 🫐> In reply to @odexine "do you need to?": yes, afaik. im with `--noMain --mm:none`
14:15:00FromDiscord<demotomohiro> You can get the contents of argv using `os.paramStr`
14:15:45FromDiscord<demotomohiro> So you cannot use it because `--noMain`?
14:16:22FromDiscord<sOkam! 🫐> In reply to @demotomohiro "You can get the": im not trying to access the contents of argv, i'm trying to map this file into nim↵https://github.com/id-Software/Quake-III-Arena/blob/dbe4ddb10315479fc00086f08e25d968b4b43c49/code/unix/unix_main.c#L1223-L1273
14:17:21FromDiscord<sOkam! 🫐> I want to run the engine from Nim, and that involves passing through that file -first-. otherwise the engine doesn't even launch
14:21:52FromDiscord<.maverk> there is no signed suffix ?????
14:21:59FromDiscord<sOkam! 🫐> how can I find where the nim real main is defined, the one that calls for `NimMain` naturally by default, the same that is skipped by `--noMain`?
14:22:20FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1146812214821527682/92.PNG
14:22:39FromDiscord<.maverk> no signed suffix ?
14:22:41FromDiscord<sOkam! 🫐> In reply to @.maverk "": ??? `'iN`
14:22:55FromDiscord<sOkam! 🫐> how is `'i32` not signed?
14:22:56FromDiscord<.maverk> In reply to @heysokam "??? `'iN`": no
14:23:17FromDiscord<.maverk> i mean
14:23:32FromDiscord<.maverk> machine dependent
14:23:34FromDiscord<.maverk> int
14:23:38FromDiscord<sOkam! 🫐> `42.int`
14:23:42FromDiscord<sOkam! 🫐> there you have it
14:23:50FromDiscord<.maverk> no you don't understand
14:24:05FromDiscord<sOkam! 🫐> `42'i32 == 42.int == int(42)`
14:24:09FromDiscord<demotomohiro> In reply to @heysokam "I want to run": https://github.com/nim-lang/Nim/blob/devel/lib/system/ctypes.nim#L68↵`cstringArray` should map to `char argv[]`.
14:24:33FromDiscord<sOkam! 🫐> (edit) "`42'i32 == 42.int == int(42)` ... " added "(on 32bit systems)"
14:24:52FromDiscord<sOkam! 🫐> In reply to @.maverk "no you don't understand": suffixes are just procs
14:24:56FromDiscord<.maverk> sent a long message, see http://ix.io/4F0v
14:25:11FromDiscord<sOkam! 🫐> suffixes are just procs↵`var value : int = 42.int`
14:25:24FromDiscord<.maverk> mmmm
14:25:27FromDiscord<.maverk> oky
14:26:38FromDiscord<demotomohiro> In reply to @heysokam "how can I find": `main` is in `@mfoo.nim.c` in nimcache dir if you compile foo.nim.
14:27:24FromDiscord<sOkam! 🫐> In reply to @demotomohiro "`main` is in `@mfoo.nim.c`": but i saw some code a while ago where the real main was written from the lang in nim↵i was wondering how to find that again
14:27:46FromDiscord<sOkam! 🫐> it was probably the code that generates it or something
14:30:48FromDiscord<solitudesf> In reply to @.maverk "i mean like this": integer literals default to int
14:35:14FromDiscord<.maverk> In reply to @solitudesf "integer literals default to": i see
14:35:46FromDiscord<demotomohiro> !eval echo typeof(123'i)
14:35:47NimBotCompile failed: /usercode/in.nim(1, 13) Error: undeclared field: ''i' for type system.string [type declared in /playground/nim/lib/system/basic_types.nim(23, 3)]
14:39:17FromDiscord<sOkam! 🫐> where in https://github.com/nim-lang/Nim/ is `NimMain()` called under normal usage of the language?
14:42:43FromDiscord<sOkam! 🫐> Oh, I might have found them 👀↵https://github.com/nim-lang/Nim/blob/5387b302117bbbc8c52ff2bed416b10a564e8b15/compiler/cgen.nim#L1544-L1578
14:48:51*rockcavera joined #nim
14:55:16FromDiscord<odexine> In reply to @.maverk "i mean like this": because it's default, iirc
14:55:23FromDiscord<odexine> well "default"
14:58:12FromDiscord<acornes> hello, is it possible to look for a file in a directory using only the file extension in nim? specifically only one file
15:00:03FromDiscord<demotomohiro> Check os module.
15:04:01FromDiscord<acornes> i checked walkFiles but i still don't understand how it works
15:05:46FromDiscord<jeanphilippecrowley> thanks for the nickname i chosen to be the whore of Nim for a while now
15:08:04FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F0S
15:09:02FromDiscord<acornes> thank you
15:09:14FromDiscord<sOkam! 🫐> np
15:22:16FromDiscord<System64 ~ Flandre Scarlet> Did someone already encountered a problem with ARC?
15:23:43*xmachina quit (Quit: WeeChat 4.0.4)
15:32:37FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F0W
15:34:18FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F0X
15:40:48*xmachina joined #nim
15:54:50*xet7 quit (Remote host closed the connection)
16:07:19FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F10
16:07:41FromDiscord<sOkam! 🫐> `build.nim` is a second app that you build with the confy task. and that calls for the buildsystem itself
16:08:55FromDiscord<sOkam! 🫐> `build.nim` turns into `build.exe` which is a wrapper for calling zigcc and nimc with the appropriate set of commands and flags
16:17:25FromDiscord<sOkam! 🫐> the readme definitely needs a proper `how to` section, though. I thought nobody was using it
16:24:21FromDiscord<Chronos [She/Her]> AHA! MY ENCODER AND DECODER FINALLY FUCKING WORKS
16:24:34FromDiscord<Chronos [She/Her]> AND BECAUSE THIS IS ABSOLUTE PAIN, I'LL PROBABLY RELEASE IT ON NIMBLE
16:25:22FromDiscord<Chronos [She/Her]> Idk what to name the package tho bc it'll have a ridiculously long name
16:25:45FromDiscord<sOkam! 🫐> 👆 _[insert.evil.laughter.here]_
16:26:13FromDiscord<sOkam! 🫐> for some reason it sounded like that in my brain 🙈
16:27:13FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Idk what to name": `nimble install ridiculouslynamedencoderdecoder` sounds gud to me 😏
16:28:01FromDiscord<Chronos [She/Her]> 😭 no, I'll probably name it `crockfordb32`
16:28:17FromDiscord<Chronos [She/Her]> It has no checksum ability or anything but
16:28:35FromDiscord<sOkam! 🫐> `ridiculouscrock` sounds kinda cool for some reason, lol
16:28:40FromDiscord<griffith1deadly> In reply to @heysokam "you don't `nimble build`": can you add to confy android and ios target, if it possible?
16:28:57FromDiscord<Chronos [She/Her]> In reply to @heysokam "`ridiculouscrock` sounds kinda cool": Sounds pain xD
16:29:12FromDiscord<sOkam! 🫐> In reply to @griffith1deadly "can you add to": oof, no idea. what is it required to build for android?↵for ios yes, it does support mac
16:29:36FromDiscord<sOkam! 🫐> unless ios is the phone system or something, im really ignorant on phone stuff
16:30:50FromDiscord<Chronos [She/Her]> For android it just needs the ndk I think? But zig cc should support compiling for Android, idk tho
16:31:08FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "For android it just": ye, ndk
16:31:10FromDiscord<sOkam! 🫐> In reply to @griffith1deadly "can you add to": These are the supported systems by nim, and I think all of them are supported by zigcc. I mapped all of them to their zig counterpart, but I only tested win/lnx/mac↵https://github.com/heysokam/confy/blob/2239e4afc33d44e5403a459d1b673f848633a21b/src/confy/types.nim#L40-L48
16:31:12FromDiscord<griffith1deadly> but ios idk
16:31:59FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "For android it just": zigcc support android and ios
16:32:54FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1c
16:33:15FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4F1c" => "https://play.nim-lang.org/#ix=4F1d"
16:33:47FromDiscord<sOkam! 🫐> I don't know how to test, but if you want to try it I wouldn't mind helping with debugging it
16:34:26FromDiscord<sOkam! 🫐> In reply to @griffith1deadly "zigcc support android and": what does Nim code look like when built for android/ios? 🤔
16:35:01FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "zigcc support android and": Neat
16:37:51FromDiscord<sOkam! 🫐> isn't `Android` actually just `OS.Linux, CPU.arm64`? 🤔
16:38:11FromDiscord<griffith1deadly> In reply to @heysokam "isn't `Android` actually just": no
16:38:13FromDiscord<Chronos [She/Her]> Nope, Android is funky
16:38:19FromDiscord<griffith1deadly> android build produces apk binary
16:38:24FromDiscord<sOkam! 🫐> how do you build nim for android then?
16:38:43FromDiscord<griffith1deadly> example zig build file:↵https://github.com/MasterQ32/ZigAndroidTemplate/blob/master/build.zig#L84
16:38:51FromDiscord<sOkam! 🫐> if you answer that, i can tell you if confy can support it. because currently i have no single clue how compiling for android even works, so cannot give an answer
16:39:26FromDiscord<sOkam! 🫐> In reply to @griffith1deadly "example zig build file:": sure, but that doesn't help. because that uses zig directly↵but we go through the nim compiler to build it first...
16:39:59FromDiscord<sOkam! 🫐> so if the nim compiler doesn't support building for android, then confy cannot support it for nim
16:40:30FromDiscord<sOkam! 🫐> but i've never done anything at all for android, so need some extra info to be able to answer the request, basically
16:41:57FromDiscord<griffith1deadly> https://github.com/search?q=repo%3Ayglukhov%2Fnimx+android&type=code↵nim can be builded for android, as i see
16:44:32FromDiscord<sOkam! 🫐> In reply to @griffith1deadly "https://github.com/search?q=repo%3Ayglukhov%2Fnimx+": i can't find any examples of their buildsystem setup for android, though
16:44:41FromDiscord<sOkam! 🫐> do you know where that is stored?
16:45:21FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "`build.nim` is a second": And build.nim must be in src directory?
16:45:53FromDiscord<sOkam! 🫐> In reply to @sys64 "And build.nim must be": by default, yes. you could change it, but if you don't change then yes its in `src/build.nim` right next to your `src/yourapp.nim`
16:45:56FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1g
16:46:22FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1h
16:47:12FromDiscord<griffith1deadly> In reply to @heysokam "do you know where": https://github.com/yglukhov/nimx/blob/master/nimx/naketools.nim↵maybe this can help you
16:47:22FromDiscord<sOkam! 🫐> In reply to @griffith1deadly "https://github.com/search?q=repo%3Ayglukhov%2Fnimx+": Apparently there is a specific `--os:android` switch↵I'm not sure why that is not mapped for confy, but definitely should 🤔 ↵https://nim-lang.org/docs/nimc.html#crossminuscompilation-for-android
16:47:27FromDiscord<sOkam! 🫐> (edit) "switch↵I'm" => "switch for nimc↵I'm"
16:48:39FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "did you `include confy/nims`": https://github.com/heysokam/confy/blob/master/examples/nim_hello/src/build.nim↵It's not done here, but I did in the nimble file
16:49:27FromDiscord<kyre58> Looks like SOkam is gonna support android and ios, nice.
16:50:49FromDiscord<sOkam! 🫐> In reply to @sys64 "https://github.com/heysokam/confy/blob/master/examp": the nimble file is fine with the `confy/nims` module. that file has only nimscript functions, so it cannot be used from a binary file
16:51:10FromDiscord<sOkam! 🫐> but anything else shouldn't import it, which is what that guard.nim file is telling you about
16:51:17FromDiscord<sOkam! 🫐> idk whats triggering it though
16:51:37FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1j
16:52:06FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1146849908800901201/image.png
16:52:41FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1l
16:53:26FromDiscord<sOkam! 🫐> i haven't included confy/nims in a while, so maybe something changed? 🤔↵like, i don't get why the guard.nim file is triggering at all
16:53:31FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1n
16:53:43FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1o
16:53:51FromDiscord<System64 ~ Flandre Scarlet> Ah, so I need to put something?
16:53:52FromDiscord<sOkam! 🫐> but yeah like that
16:54:12FromDiscord<sOkam! 🫐> In reply to @sys64 "Ah, so I need": no "need", is jst a reference message for when you do `nimble tasks`
16:54:26FromDiscord<sOkam! 🫐> could leave it empty, tbh
16:54:44FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1p
16:54:51FromDiscord<sOkam! 🫐> oh waaait
16:54:59FromDiscord<sOkam! 🫐> remove the file, you are on 0.0.5
16:55:06FromDiscord<sOkam! 🫐> (edit) "file," => "package,"
16:55:34FromDiscord<sOkam! 🫐> for some reason there is a bug in nim v2.0 that doesn't get the latest version from `#head` packages
16:55:42FromDiscord<sOkam! 🫐> its fixed in devel, but not in stable
16:56:02FromDiscord<sOkam! 🫐> latest version is `confy-0.0.10`
16:57:15FromDiscord<System64 ~ Flandre Scarlet> Oh, lemme try that
16:57:29FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "latest version is `confy-0.0.10`": nimble install confy-0.0.10?
16:58:02FromDiscord<sOkam! 🫐> In reply to @sys64 "nimble install confy-0.0.10?": no, just remove your package locally and it will download 0.0.10 (or should)
16:58:42FromDiscord<sOkam! 🫐> basically you can just delete the `C:\Users\USER\.nimble\pkgs2\confy-0.0.5-deed504727716afbad17602eebbf8df545a317e9\` folder directly manually if you want
16:59:10FromDiscord<sOkam! 🫐> the package is tagged, so it should download 0.0.10
17:00:20FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/526Yk
17:00:29FromDiscord<sOkam! 🫐> still? damn 😦
17:01:39FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1s
17:03:32FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1t
17:04:07FromDiscord<sOkam! 🫐> oh, this might be the issue https://github.com/heysokam/confy/blob/2239e4afc33d44e5403a459d1b673f848633a21b/src/confy/nims/guard.nim#L10-L12
17:04:17FromDiscord<sOkam! 🫐> can you try `echo` in console?
17:04:27FromDiscord<sOkam! 🫐> `echo hello` for example
17:05:04FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1u
17:05:20FromDiscord<sOkam! 🫐> then it has something to do with `gorgeEx("echo")` when run on windows 🤔
17:05:41FromDiscord<System64 ~ Flandre Scarlet> Windows moment
17:05:54FromDiscord<System64 ~ Flandre Scarlet> Windows, cringe forever
17:06:07FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1v
17:06:32FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4F1v" => "https://play.nim-lang.org/#ix=4F1x"
17:06:32FromDiscord<sOkam! 🫐> edited, sry. missed the rest
17:07:23FromDiscord<sOkam! 🫐> i still don't understand why the `guard.nim` file is used at all though. that makes no sense
17:07:32FromDiscord<sOkam! 🫐> (edit) "used" => "imported"
17:07:37*Phytolizer joined #nim
17:07:56FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1y
17:09:13FromDiscord<sOkam! 🫐> yeah there is the issue, basically. that file is being imported from nimble, and triggering the error pragma
17:10:01FromDiscord<sOkam! 🫐> could you add `echo gorgeEx("echo").exitCode` to that nims file?
17:10:04*Phytolizer left #nim (#nim)
17:10:21FromDiscord<sOkam! 🫐> maybe the command on windows returns a `1` on success or something
17:10:23FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "could you add `echo": Gotta try after the dinner
17:12:30*SebastianM joined #nim
17:39:54FromDiscord<griffith1deadly> In reply to @heysokam "Apparently there is a": looks like nimx use for build android app --os:linux↵https://github.com/yglukhov/nimx/blob/master/nimx/naketools.nim#L744
17:40:12FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1G
17:41:06FromDiscord<System64 ~ Flandre Scarlet> And with your Hello test too https://media.discordapp.net/attachments/371759389889003532/1146862236611129507/message.txt
17:42:12FromDiscord<.maverk> guys the precedence list in the nim doc is really weird i cannot understand it
18:09:43FromDiscord<jviega> It's meant for people who understand compilers. It's standard stuff.
18:12:54*azimut quit (Ping timeout: 246 seconds)
18:15:07*krux02 joined #nim
18:16:57*xet7 joined #nim
18:20:38FromDiscord<juan_carlos> You dont speak compiler ?.
18:30:59FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1V
18:31:21FromDiscord<odexine> In reply to @juan_carlos "You dont speak compiler": Imagine not being the compiler
18:32:47FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4F1V" => "https://play.nim-lang.org/#ix=4F1X"
18:33:09FromDiscord<sOkam! 🫐> @System64 ~ Flandre Scarlet that part its definitely not going to work without a patch for zipping on windows 😦
18:33:21FromDiscord<sOkam! 🫐> `tar` is not an app on windows, right?
18:33:29FromDiscord<sOkam! 🫐> can you try running it, in case it is?
18:33:34FromDiscord<sOkam! 🫐> `tar -v`
18:33:53FromDiscord<sOkam! 🫐> (edit) "-v`" => "--version`"
18:33:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "<@380360389377916939> that part its": I have tar
18:34:07FromDiscord<sOkam! 🫐> did you install it or is it there by dfault?
18:34:21FromDiscord<System64 ~ Flandre Scarlet> How can I check the path to the executable?
18:35:21FromDiscord<sOkam! 🫐> 🤷‍♂️ no clues. in linux you can just do `which tar`
18:35:32*ntat quit (Quit: leaving)
18:37:32FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F20
18:38:05FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F21
18:38:24FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4F21" => "https://play.nim-lang.org/#ix=4F22"
18:38:39FromDiscord<sOkam! 🫐> idk if that will run, first time trying it, but doesn't hurt to try
18:38:54FromDiscord<.maverk> sent a code paste, see https://play.nim-lang.org/#ix=4F23
18:40:12FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4F24
18:40:44FromDiscord<.maverk> should i do nimble install std/net ?
18:41:01FromDiscord<griffith1deadly> no, because it part of std in installed nim
18:41:12FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F25
18:41:21FromDiscord<sOkam! 🫐> yep, just comment out the warning so it doesn't stop there
18:41:55FromDiscord<.maverk> In reply to @griffith1deadly "no, because it part": ??? i don't understand
18:42:00FromDiscord<.maverk> what hsould i do ?
18:42:07FromDiscord<griffith1deadly> In reply to @.maverk "??? i don't understand": just import std/net
18:42:28FromDiscord<.maverk> i will try
18:45:04FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "yep, just comment out": https://media.discordapp.net/attachments/371759389889003532/1146878337977946204/message.txt
18:45:24FromDiscord<System64 ~ Flandre Scarlet> > confy: Done building.↵Task failed sucessfully
18:45:59*xet7 quit (Ping timeout: 244 seconds)
18:46:38FromDiscord<griffith1deadly> if confy set zig in env, need reopen console to get normal building (i think windows specific)
18:47:10FromDiscord<sOkam! 🫐> In reply to @sys64 "> confy: Done building.": right, seems like you didn't install zig, but didn't mark `cfg.zigSystemBin = off` either, so its trying to get the system one incorrectly
18:47:22FromDiscord<sOkam! 🫐> you need to do one or the other, your pick
18:47:39FromDiscord<sOkam! 🫐> if you go local, confy installs it and maintains it for you, but it costs you 400mb per project or so
18:47:47FromDiscord<sOkam! 🫐> whatever you prefer
18:48:38FromDiscord<sOkam! 🫐> (edit) "if you go local, confy installs it ... and" added "(per-project, not system wide)"
18:49:05FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "if you go local,": Is there a flag to decide if I want it local or global?
18:49:19FromDiscord<sOkam! 🫐> In reply to @griffith1deadly "if confy set zig": it doesn't touch env, that platform-specific crap gives me the creeps. both in linux and windows, its very unreliable
18:49:33FromDiscord<System64 ~ Flandre Scarlet> Now 400mb per project↵Node_Modules be like
18:49:46FromDiscord<sOkam! 🫐> In reply to @sys64 "Is there a flag": yeah, `cfg.zigSystemBin = on/off` in your build.nim file
18:49:56*SebastianM quit (Quit: -a- IRC for Android 2.1.59)
18:50:01FromDiscord<sOkam! 🫐> if you install zig, it will just work normally without changes
18:50:05FromDiscord<sOkam! 🫐> it uses the system one by default
18:51:14FromDiscord<System64 ~ Flandre Scarlet> Gotta try the offline one↵But you need to deploy a patch for the zip bug
18:51:23FromDiscord<System64 ~ Flandre Scarlet> (edit) "offline one↵But" => "local one first↵But"
18:51:35FromDiscord<sOkam! 🫐> In reply to @sys64 "Gotta try the local": yeah, the non-unix bug is easily fixable. will do
18:52:25FromDiscord<System64 ~ Flandre Scarlet> Alright! Thanks!
18:55:08FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1146880869647261716/11.PNG
18:55:14FromDiscord<.maverk> the socket is finally working
18:55:21FromDiscord<.maverk> 😃
18:55:26FromDiscord<.maverk> 🥳
18:59:02*kenran quit (Remote host closed the connection)
18:59:20*kenran joined #nim
19:11:21*xmachina quit (Quit: WeeChat 4.0.4)
19:13:14*xmachina joined #nim
19:19:07FromDiscord<System64 ~ Flandre Scarlet> Do you think this schema explains Nim compilation process well? https://media.discordapp.net/attachments/371759389889003532/1146886898661474416/image.png
19:20:57FromDiscord<.maverk> it is so good
19:21:10FromDiscord<.maverk> i will download it
19:21:14FromDiscord<System64 ~ Flandre Scarlet> Thanks!
19:21:25FromDiscord<.maverk> you are welcome
19:21:28FromDiscord<System64 ~ Flandre Scarlet> I made it
19:21:39FromDiscord<.maverk> it pretty neat
19:21:46FromDiscord<.maverk> (edit) "it ... pretty" added "is"
19:22:29FromDiscord<System64 ~ Flandre Scarlet> Thanks!↵I know there is JavaScript and stuff but I won't explain in my work because I don't use it
19:23:45FromDiscord<.maverk> yeah
19:23:51FromDiscord<.maverk> leave the unnecessary stuff
19:24:30FromDiscord<System64 ~ Flandre Scarlet> I will just mention it but that's all
19:25:35FromDiscord<.maverk> very nice
19:25:40FromDiscord<.maverk> i have one question
19:26:00FromDiscord<System64 ~ Flandre Scarlet> yeah?
19:26:20FromDiscord<.maverk> why are you using the name System64 ?? 🤔
19:28:20FromDiscord<System64 ~ Flandre Scarlet> In reply to @.maverk "why are you using": It is from Minecraft↵When I wanted to join a server, I wanted to join as System32, but it was already taken↵So I choose System64
19:28:59FromDiscord<.maverk> aaah i see
19:29:11FromDiscord<.maverk> that is nice
19:33:59*xet7 joined #nim
19:34:15FromDiscord<System64 ~ Flandre Scarlet> Thanks!
19:50:13FromDiscord<.maverk> you are welcome
20:05:12FromDiscord<sOkam! 🫐> @System64 ~ Flandre Scarlet 0.0.14 is up. Added a `doc/howto.md` file, and some extra information in the readme too↵It has the zip+zig fix applied, it shouldn't bring that error anymore and just crash with an exception when the zig binary is not found, letting you know how to fix the issue
20:05:22FromDiscord<ieltan> In reply to @sys64 "Do you think this": Super schéma ! C'est essentiellement le même qui se trouve dans le bouquin qui t'apprends Nim
20:07:07FromDiscord<System64 ~ Flandre Scarlet> In reply to @ieltan "Super schéma ! C'est": J'ai pas encore lu le livre, mais je vais y jetter un oeil, j'y apprendrai certainement des choses
20:08:37FromDiscord<ieltan> the book in question is called Nim in Action (switching to english ik) but there is the new one called Mastering Nim
20:15:24FromDiscord<Chronos [She/Her]> If only there was a way to see if someone is using a Nim library in my code... Sigh
20:15:49FromDiscord<Elegantbeef> What?
20:17:02FromDiscord<Chronos [She/Her]> I want to be able to add a codepath if someone is using the `nint128` library, but otherwise my code should work in plain Nim
20:17:26FromDiscord<Elegantbeef> `when compiles(import pkg/nint128)`
20:18:31FromDiscord<Chronos [She/Her]> What if they aren't using it in their code though, wouldn't it just add additional time to compilation?
20:18:50FromDiscord<Elegantbeef> If they arent using it the above wouldnt compile
20:18:54FromDiscord<Elegantbeef> Atleast if they're doing a proper build
20:19:14FromDiscord<Chronos [She/Her]> Oh, with nimble
20:19:16FromDiscord<jviega> Hey if I want to have nimble package A install B which requires a tool to run that needs static linking, and B provides the .a's, I'm finding if B's not previously installed, it's pwd is package A's so it can't find it's libs, and the package isn't moved into place yet
20:19:26FromDiscord<jviega> So knowing the nimble dir isn't helping me either
20:19:31FromDiscord<Chronos [She/Her]> Gucci, thanks Beef!
20:20:13FromDiscord<jviega> Anything better than a before hook that pre-installs it?
20:20:42*ced2 is now known as cedb
20:21:18FromDiscord<Chronos [She/Her]> `Error: expression expected, but found 'keyword import'` :/
20:21:27FromDiscord<jviega> Not even sure that's going to work, before doesn't go before the dependencies
20:21:37FromDiscord<Chronos [She/Her]> !eval echo compiles(import std/strutils)
20:21:38NimBotCompile failed: /usercode/in.nim(1, 15) Error: expression expected, but found 'keyword import'
20:21:49FromDiscord<Chronos [She/Her]> Yeah, that's an issue
20:22:00FromDiscord<toma400> Is there any library on how to play/manage sound, so it can be run with application?↵If it's native and not wrapper for C lib, it'd be especially amazing
20:22:17FromDiscord<toma400> (edit) "Is there any library on how to play/manage sound, so it can be run with application?↵If it's native and not wrapper for C lib, it'd be especially amazing ... " added "(not sure if possible tho)"
20:22:21FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "<@380360389377916939> 0.0.14 is up.": Thanks! Will try that!
20:22:34FromDiscord<System64 ~ Flandre Scarlet> In reply to @ieltan "the book in question": Oh, very interesting!
20:22:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4F2t
20:22:53FromDiscord<System64 ~ Flandre Scarlet> I know about Nim in Action, but not the second
20:23:14FromDiscord<Chronos [She/Her]> Huh...
20:25:54FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4F2u
20:26:20FromDiscord<Elegantbeef> You didnt tell it the type to decode to
20:34:54FromDiscord<Chronos [She/Her]> Wait
20:34:58FromDiscord<Chronos [She/Her]> Fuck I'm blind
20:36:49FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F2x
20:37:15FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F2y
20:41:12FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "with it to off?": I have an error https://media.discordapp.net/attachments/371759389889003532/1146907565091979314/message.txt
20:41:14*advesperacit quit ()
20:41:30FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F2z
20:42:01FromDiscord<System64 ~ Flandre Scarlet> ah yeah, looks better
20:42:51FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F2A
20:43:10FromDiscord<sOkam! 🫐> not finding the zig bin for some reason?
20:43:21FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/LT8w6
20:46:42FromDiscord<sOkam! 🫐> its still choking with the same zig missing error 🧩
20:49:55FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "its still choking with": So I guess I need to install it?
20:50:55*rockcavera quit (Read error: Connection reset by peer)
20:51:14*rockcavera joined #nim
20:51:14*rockcavera quit (Changing host)
20:51:14*rockcavera joined #nim
20:52:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "its still choking with": the zigcc compiler is stored in projectroot/bin/zig/
20:54:07FromDiscord<sOkam! 🫐> In reply to @sys64 "the zigcc compiler is": yep
20:54:20FromDiscord<sOkam! 🫐> but if you go the systemBin route, you don't need to install it there manually
20:54:33FromDiscord<sOkam! 🫐> just follow the standard way of installing zig on windows
20:54:55FromDiscord<sOkam! 🫐> it should not be choking like that, though. something is incorrect in the logic
21:03:04*kenran quit (Remote host closed the connection)
21:08:51FromDiscord<sOkam! 🫐> @System64 ~ Flandre Scarlet what happens if you just `zig version`? Does it give back that exact french message on that error?
21:08:57FromDiscord<jviega> In nimble's runtime, anyone offhand know how to access flags passed in via switch()? Not having an easy time googling for dollars
21:09:45FromDiscord<sOkam! 🫐> In reply to @jviega "In nimble's runtime, anyone": I couldn't find a way to do it
21:10:02FromDiscord<Elegantbeef> Nimble doesnt get switches
21:10:08FromDiscord<sOkam! 🫐> I needed those switches for easier setup of confy, and couldn't find them. So.... gave up
21:10:16FromDiscord<Elegantbeef> https://nim-lang.org/docs/compilesettings.html does exist though
21:10:27FromDiscord<jviega> Cool thx
21:11:13FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "https://nim-lang.org/docs/compilesettings.html does": is that for nimc or nimble?
21:13:46FromDiscord<Elegantbeef> No clue if it works inside a nimble file, doubt it
21:16:19FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "<@380360389377916939> what happens if": I didn't installed it yet
21:16:21*rockcavera quit (Remote host closed the connection)
21:20:58FromDiscord<sOkam! 🫐> In reply to @sys64 "I didn't installed it": that's exacly why i wanted you to do that, lol
21:21:16FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "that's exacly why i": I was taking my shower lol
21:21:22*rockcavera joined #nim
21:21:25FromDiscord<sOkam! 🫐> if im correct, it should output the exact same message you got there
21:21:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "if im correct, it": Wait what?↵That's weird because if Zig is installed, it should use it
21:21:59FromDiscord<sOkam! 🫐> but its not
21:22:27FromDiscord<sOkam! 🫐> so if its failing where I think it is failing, it should print that french message and continue (incorrectly) as if it was found
21:22:28*xmachina quit (Quit: WeeChat 4.0.4)
21:31:19FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "so if its failing": Even with Zig installed it yells that https://media.discordapp.net/attachments/371759389889003532/1146920176504291388/message.txt
21:32:42FromDiscord<sOkam! 🫐> In reply to @sys64 "Even with Zig installed": exactly, so it is failing where I thought it was
21:35:17FromDiscord<sOkam! 🫐> there is a file at `confy/builder/zig/bin.nim` where that check is being run, its failing there at the `exists()` function↵you can play around with it to see if you can find how to make it not crash, otherwise gonna have to wait until I find time to change to windows explicitely to add support for it↵its happening because windows support was fully untested so far, so its failing with bugs at things that I never had to deal with on
21:35:49FromDiscord<System64 ~ Flandre Scarlet> Windows moments
21:36:06FromDiscord<sOkam! 🫐> there is something in there that windows does different, and to my knowledge it shouldn't. but apparently my knowledge was incorrect
21:36:08FromDiscord<System64 ~ Flandre Scarlet> Windows is so developer-unfriendly
21:36:59FromDiscord<sOkam! 🫐> mac is too in some ways. its just that systems are way too different from each other, so there are too many points of conflict that can clash
21:37:34FromDiscord<System64 ~ Flandre Scarlet> Should I move to Linux?
21:37:48FromDiscord<sOkam! 🫐> depends on your goals i guess
21:38:01FromDiscord<System64 ~ Flandre Scarlet> The problem on Linux is gaming
21:38:16FromDiscord<sOkam! 🫐> personally, i don't think i will ever be able to get rid of my windows installation, just to be able to test edge cases like this
21:38:47FromDiscord<sOkam! 🫐> In reply to @sys64 "The problem on Linux": depends on the games you play. most things run fine, just -some- don't, and those you will miss and will make you think that its a huge issue... but its really not that bad
21:39:24FromDiscord<System64 ~ Flandre Scarlet> Now I only have a 500GB SSD that's close to be full
21:39:26FromDiscord<sOkam! 🫐> proton and wine work great for 99%
21:40:05FromDiscord<sOkam! 🫐> In reply to @sys64 "Now I only have": my linux install takes about 10gb. my windows is at 40+ and i don't even have anything in it.. i purposedly keep it bare 🙈
21:40:21FromDiscord<Elegantbeef> Delete your page and hibernation file
21:40:42FromDiscord<sOkam! 🫐> i don't think i have one. with it it didn't even fit the 50gb partition lol
21:40:59FromDiscord<sOkam! 🫐> while my linux installs run fine on 20gb partitions and are half empty
21:44:22FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Delete your page and": Is it dangerous to delete the page?
21:45:12FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1146923671844290640/image.png
21:46:53FromDiscord<System64 ~ Flandre Scarlet> You're probably talking about this https://media.discordapp.net/attachments/371759389889003532/1146924094386880663/image.png
21:47:41FromDiscord<Elegantbeef> Page is for when you run out of ram
21:47:54FromDiscord<Elegantbeef> hibernation file is for hibernation and is pointless in 90% of cases
21:48:54FromDiscord<Elegantbeef> With modern low power sleep and ssds, there is not much reason for that style hibernation anymore
21:49:46FromDiscord<System64 ~ Flandre Scarlet> OOF https://media.discordapp.net/attachments/371759389889003532/1146924819158401134/image.png
21:50:17FromDiscord<Elegantbeef> Quick make fun of the french unit!
21:50:31FromDiscord<Elegantbeef> Octets like that's a word
21:52:23FromDiscord<System64 ~ Flandre Scarlet> Yeah 🤣
21:52:33FromDiscord<System64 ~ Flandre Scarlet> Bit↵Octet instead of Byte
22:10:45FromDiscord<m4ul3r> I know objects are memory managed, but is there a way I can declare one at compile time and have it stored in the .data section?
22:11:11FromDiscord<jviega> Are consts not put in .data?
22:14:50FromDiscord<m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=4F3c
22:16:54FromDiscord<m4ul3r> I'm wanting to modify the object at runtime but stored at compile time, that's why i'm wanting it in .data
22:18:59FromDiscord<Elegantbeef> Consts are not generated unless used inside Nim, so you need to store the const in a variable or use codegendecl to emit it
22:38:13FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F3B
22:40:07FromDiscord<jviega> Why are they out of the question? Can't you do newStringOfCapacity() and then just & them together?
22:40:23FromDiscord<sOkam! 🫐> In reply to @jviega "Why are they out": strings are GC'ed memory
22:40:34*xmachina joined #nim
22:40:48FromDiscord<jviega> If the GC isn't on, aren't they just alloc()'d?
22:40:55FromDiscord<jviega> And you call dealloc()?
22:41:09FromDiscord<jviega> Or do it on the underlying pointer if there isn't an API for it
22:41:41FromDiscord<Elegantbeef> Since the `add` does not manually gc code
22:41:42FromDiscord<Elegantbeef> Doesnt work if you use `add` for instance
22:42:17FromDiscord<jviega> Oh right, cause add's not an in-place operation
22:42:57FromDiscord<jviega> Yeah, I mean I often drop to a tiny bit of C to do in-place stuff myself 🙂
22:44:13FromDiscord<sOkam! 🫐> could it work to first use a temporary `var thing :ptr char` and then `var thestr = cast[cstring](thing)` when its ready after the C concat process? 🤔
22:47:04FromDiscord<Elegantbeef> Time to write your own concat procedure
22:47:30FromDiscord<jviega> if you do x = a & b w/o GC, nim won't allow it because it refuses to alloc strings? Or there's no API to dealloc it?
22:47:59FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "Time to write your": `C_strcat`??
22:48:07FromDiscord<Elegantbeef> There is no dealloc
22:48:19FromDiscord<sOkam! 🫐> `C_free`
22:48:59FromDiscord<Elegantbeef> What's with the C prefix?
22:49:40FromDiscord<sOkam! 🫐> im just asking if `var one :cstring= "123"` is conceptually the same as `var two :ptr char= "123'\0'"` (minus the syntax)
22:49:53FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "What's with the C": to reflect its C's stdlib existing functions
22:49:54FromDiscord<Elegantbeef> No cause the latter is invalid
22:50:03FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "No cause the latter": duh
22:50:12FromDiscord<sOkam! 🫐> its a pseudo example beef
22:50:22FromDiscord<Elegantbeef> Well you said syntax, that's semantic analysis 😛
22:50:28FromDiscord<jviega> There's no dealloc for strings specifically you mean? Cause I use dealloc() plenty 🙂
22:50:33FromDiscord<Elegantbeef> a cstring is a more descriptive ptr char
22:50:42FromDiscord<Elegantbeef> There is no dealloc for strings, correct
22:50:47FromDiscord<sOkam! 🫐> yeah but what -more- is in there is what im asking in a way
22:50:51FromDiscord<Elegantbeef> It relies on the GC existing to dealloc
22:51:20FromDiscord<jviega> I'm sure one could write a dealloc for strings for no-mm mode 🙂
22:51:28FromDiscord<Elegantbeef> You could of course
22:52:04FromDiscord<Elegantbeef> > yeah but what -more- is in there is what im asking in a way↵This flew over my head like a jetliner
22:52:23FromDiscord<sOkam! 🫐> what else does a `cstring` have in them, other than a `ptr char` which is null-terminated?↵or where can I find the declaration of the cstring type to see it for myself?
22:52:44FromDiscord<Elegantbeef> A cstring is just a `distinct ptr char`
22:53:04FromDiscord<sOkam! 🫐> then it would work to do what i said
22:53:12FromDiscord<sOkam! 🫐> if they are nothing else than a distinct
22:54:29FromDiscord<sOkam! 🫐> i know this is ugly code for nim, im not trying to set a new standard of doing things↵i'm just trying to get the damn main function of the engine running from nim, in a dirty and hacky way, and will deal with doing things correctly in the future↵for now I would rather be able to run the engine (with its weird C ways all intact) than not be able to run it from Nim
22:55:29FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4F3F
22:55:55FromDiscord<Elegantbeef> assuming the Quake engine uses `malloc` compile with `-d:useMalloc`
22:56:05FromDiscord<Elegantbeef> Thirdly why not run with `arc` in this case
22:56:10FromDiscord<sOkam! 🫐> yeah it does use malloc for its backend
22:56:31FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "Thirdly why not run": because i want to play with mm:none.. and i want to learn how they do things in the way they did things
22:56:49FromDiscord<sOkam! 🫐> refactoring doesn't teach me their ways, it teaches me mine
22:57:30FromDiscord<summarity> Is there a way I can turn off `{.experimental: "strictDefs".}` for just one proc in a module? That proc uses templates from `std/tables` which violate this check and thus warn on compilation, but I'm only interested in issues in my code, not std code that hasn't been adapted yet.
22:57:32FromDiscord<jviega> Can you get it running from C?? Why not start it before NimMain() is called?
22:57:37FromDiscord<sOkam! 🫐> they implemented a custom allocator for dynamic alloc, but that's built on top of malloc
22:57:49FromDiscord<sOkam! 🫐> In reply to @jviega "Can you get it": wdym?
22:58:11FromDiscord<jviega> You know you can run code before main() gets called if you need to no?
22:58:25FromDiscord<sOkam! 🫐> no clue
22:58:31FromDiscord<sOkam! 🫐> i thought main was the first line run
22:59:02FromDiscord<sOkam! 🫐> by that i mean C main
22:59:03FromDiscord<jviega> No
22:59:19FromDiscord<Elegantbeef> I do not think there is a way to override strictdefs
23:00:02*marcus quit (Remote host closed the connection)
23:00:53*marcus joined #nim
23:01:00FromDiscord<jviega> I'm not a windows person so I don't know how to do it on Windows, but the rest of the world, you just declare a function like this: `attribute((constructor)) void my_pre_main(int argc, char argv[], char envp[])` (you can omit the params if you want)
23:01:30FromDiscord<sOkam! 🫐> In reply to @jviega "I'm not a windows": and what do you run in there?
23:01:43FromDiscord<jviega> Whatever starts up your engine
23:01:53FromDiscord<sOkam! 🫐> the engine eats up the entire control flow
23:02:03FromDiscord<sOkam! 🫐> it doesn't even return from its main
23:02:31FromDiscord<sOkam! 🫐> its not a modern engine, created to work like a library
23:02:47FromDiscord<sOkam! 🫐> its just a monolithic app that you build -for- not -with-
23:03:01FromDiscord<sOkam! 🫐> the only allowed way to work with it is by `dlopen`
23:03:35FromDiscord<sOkam! 🫐> im' just trying to cut that on its head, and do things in a more modern way (eventually)↵for now, i want to be able to rewrite main to start doing that over time
23:04:54FromDiscord<sOkam! 🫐> my current strategy idea is to rewrite main, and `{.emit: """the rest of the main.c file without main()".}` to make it run
23:05:48FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F3K
23:06:42FromDiscord<Elegantbeef> Well there is no `add` defined for them
23:07:38FromDiscord<Elegantbeef> Plus you likely need to pass the length of both around
23:08:35FromDiscord<sOkam! 🫐> but you used add for them?
23:08:41FromDiscord<sOkam! 🫐> or did you meant I should write it?
23:09:10FromDiscord<sOkam! 🫐> like, isn't `strcat` meant for just that?
23:10:19FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F3L
23:12:24FromDiscord<Elegantbeef> Sure, except strcat returns a nil pointer and does not care about length
23:12:27FromDiscord<Elegantbeef> returns a pointer\
23:13:31FromDiscord<Elegantbeef> The first parameter needs to be large enough to contain the concatenated string, so it's wholly awful 😄
23:13:40FromDiscord<sOkam! 🫐> its C
23:14:00FromDiscord<sOkam! 🫐> there is no other way less awful 🙈 im just trying to get that into nim so can eventually get rid of it lol
23:14:57FromDiscord<Elegantbeef> There is a less awful way you pass a length along
23:15:35FromDiscord<Elegantbeef> Take in a `char dest, int destLen, char src, int srcLen`
23:15:55FromDiscord<Elegantbeef> Although in the case of arg parsing you do not have a pascal string so need to call strlen on it
23:16:33FromDiscord<Chronos [She/Her]> https://paste.ecorous.org/ecesocihev this is... Painful
23:16:47*xmachina quit (Quit: WeeChat 4.0.4)
23:16:55FromDiscord<Chronos [She/Her]> This is the error: `/data/data/com.termux/files/home/Supernovae/crockfordbase32/test.nim(50, 8) Error: overloaded 'cb32Decode' leads to ambiguous calls`
23:17:08FromDiscord<Elegantbeef> I guess strcat\_s is what a modern C programmer would use in this regard
23:17:22FromDiscord<Elegantbeef> Just take in the first paramter as a typedesc
23:17:34FromDiscord<Elegantbeef> `Int128.decode("bleh")`
23:19:29FromDiscord<Chronos [She/Her]> That's an idea for sure
23:19:34FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F3N
23:19:52FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "That's an idea for": But also, what if something else is named decode/encode?
23:20:15FromDiscord<Elegantbeef> `myModule.decode(int128, "bleh")`
23:20:19FromDiscord<Elegantbeef> If only modules existed
23:20:20FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "But also, what if": does that something else use the -exact-same-parameters-and-types- ?
23:20:28FromDiscord<sOkam! 🫐> (edit) "?" => "in the same module?"
23:20:38FromDiscord<sOkam! 🫐> yeah exactly
23:20:39FromDiscord<Chronos [She/Her]> In reply to @heysokam "does that something else": Nope, but if another module does that
23:20:47FromDiscord<sOkam! 🫐> overloads + modules make nameclashing almost imposs
23:20:48FromDiscord<Chronos [She/Her]> Ig that's fine then
23:21:03FromDiscord<sOkam! 🫐> if another module does that, it can be qualified
23:21:13FromDiscord<Elegantbeef> Or you can force conversion
23:21:39FromDiscord<Elegantbeef> `(proc(_: typedesc[int128], _: string): int128)(decode)`
23:22:22FromDiscord<sOkam! 🫐> that's some C level syntax there lol. what is that doing exactly?
23:22:43FromDiscord<Elegantbeef> Converting an overloaded symbol to a type
23:23:06FromDiscord<sOkam! 🫐> ic
23:23:20FromDiscord<Elegantbeef> It's more meant for `let x = expr`
23:23:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4F3O
23:29:25FromDiscord<Chronos [She/Her]> Nint doesn't have modulo-
23:29:41FromDiscord<Chronos [She/Her]> That's fun. :p
23:29:41FromDiscord<Elegantbeef> `mod`
23:29:49FromDiscord<Chronos [She/Her]> Nint doesn't implement it
23:30:10FromDiscord<Elegantbeef> Do you even need to mod the entire value?
23:30:23FromDiscord<Chronos [She/Her]> Wait apparently it does
23:30:47FromDiscord<Chronos [She/Her]> Why does my code use Int128 when I'm using Uint128-
23:30:58FromDiscord<Chronos [She/Her]> Nvm
23:31:05FromDiscord<Chronos [She/Her]> No, it doesn't implement it for Int128 apparently
23:31:28FromDiscord<Chronos [She/Her]> Wait it does
23:31:30FromDiscord<Chronos [She/Her]> Then why???
23:32:19FromDiscord<Chronos [She/Her]> Okay well it works now
23:32:21FromDiscord<Chronos [She/Her]> Hm
23:32:38FromDiscord<Elegantbeef> Nim has a AI gaslighter
23:33:28FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F3Q
23:33:52FromDiscord<Elegantbeef> Right, I assume length is actual size without the null terminator
23:34:07FromDiscord<sOkam! 🫐> kk then its just create(char, len)
23:34:27FromDiscord<sOkam! 🫐> whats different between Nim's malloc and --useMalloc, btw?
23:35:39FromDiscord<Elegantbeef> Nim with `-d:useMalloc` uses C's allocator inside Nim, which means `create` and friends are fine to give ownership up
23:36:13*krux02 quit (Remote host closed the connection)
23:36:24FromDiscord<sOkam! 🫐> what does it mean to give owneship up, in terms of what nim normally does?
23:36:34FromDiscord<Elegantbeef> To no longer own a resource
23:36:46FromDiscord<sOkam! 🫐> yeah, but what does it do normally instead
23:36:48FromDiscord<Chronos [She/Her]> Now how do I convert it to an `int` :/
23:36:58FromDiscord<Elegantbeef> If you give a C library a Nim `create`d pointer and it attempts to free it i'll not work properly
23:36:59FromDiscord<sOkam! 🫐> is it using the GC, or expecting it, to work?
23:37:05FromDiscord<Elegantbeef> Since it does not know Nim's allocator strategy
23:37:20FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "If you give a": i didn't know, thought they were usable. kk
23:37:25FromDiscord<Elegantbeef> If you give it a pointer with `-d:useMalloc` it'll just work fine
23:37:32FromDiscord<sOkam! 🫐> ic
23:37:36FromDiscord<Elegantbeef> The issue is the giving up ownership
23:37:39FromDiscord<sOkam! 🫐> sounds like useMalloc is the way then
23:37:59FromDiscord<sOkam! 🫐> how does create keep that ownership? is it with refs?
23:38:04FromDiscord<Elegantbeef> Pointers are just integers, but if something takes ownership it has to use the same allocator
23:38:17FromDiscord<Elegantbeef> Create doesnt have anything to do with ownerships
23:38:28FromDiscord<Elegantbeef> If you give a pointer to a program and it attempts to deallocate it, it ostensibly owns it
23:38:44FromDiscord<Elegantbeef> This has nothing to do with C or Nim
23:38:58FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "Nim with `-d:useMalloc` uses": im just repeating like parrot, tring to understand. its what you said here, "fine to give ownership up"
23:39:02FromDiscord<Elegantbeef> if you expect a pointer is allocated with Nim's allocator and attempt to deallocate it the same issue arises
23:39:32FromDiscord<sOkam! 🫐> i thought pointers in nim were just normal C pointers, with no owner
23:39:58FromDiscord<Elegantbeef> you're missing what owner means
23:39:58FromDiscord<Elegantbeef> Owner is not a real thing
23:40:09FromDiscord<Elegantbeef> If I allocate a pointer and give it to you, then you try to deallocate it, you are the owner of that pointer
23:40:33FromDiscord<Elegantbeef> If you expect the pointer to be allocated using glibc's malloc, but it was allocated using Nim's allocator, memory corruptions will happen
23:40:44FromDiscord<Elegantbeef> Remember allocators all behave differently and have different logic in them
23:40:52FromDiscord<sOkam! 🫐> ah because of the internal logic, kk
23:41:04FromDiscord<sOkam! 🫐> i thought it was some stuff that i was missing
23:43:00FromDiscord<Elegantbeef> Chronos you probably can just grab the `lo` after modulating it
23:43:07FromDiscord<Elegantbeef> Is that the right verb, who knows?
23:43:45FromDiscord<Elegantbeef> the `lo` field should be 0..32 after `mod` afaik
23:43:49FromDiscord<Elegantbeef> well 0..31
23:43:58*krux02 joined #nim
23:44:35FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F3R
23:44:41FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "Now how do I": Yeah, just doing `int` doesn't work
23:44:57FromDiscord<Chronos [She/Her]> Don't really wanna convert it to a string and then `parseInt` it
23:44:59FromDiscord<Elegantbeef> It means you probably should do `--threads:off`
23:45:06*krux02 quit (Remote host closed the connection)
23:45:19FromDiscord<sOkam! 🫐> why so?
23:45:26FromDiscord<sOkam! 🫐> how is it related? 🧩
23:45:30FromDiscord<Elegantbeef> If only chronos read my messages
23:45:38FromDiscord<Elegantbeef> `channels_builtin`
23:46:37FromDiscord<sOkam! 🫐> so threads are not allowed on --d:useMalloc?
23:46:56FromDiscord<Chronos [She/Her]> I am blind
23:47:10FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Chronos you probably can": Oooooh okay that makes sense
23:47:11FromDiscord<Elegantbeef> `--mm:none -d:useMalloc` is probably not supported, feel free to make an issue
23:47:16FromDiscord<Chronos [She/Her]> Thanks lol didn't see that
23:47:37FromDiscord<Elegantbeef> Well threads are allowed, but not like you want to use the Nim mechanisms for threading in a `--mm:none` world
23:48:05FromDiscord<sOkam! 🫐> i see
23:49:13FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/b3912c25d3dcb78bc1c8f7d6acc3c512964d3ea8/lib/system/gc_interface.nim#L3 this probably needs PR'd to check `mm != "none"`
23:53:55FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4F3U
23:54:08FromDiscord<Chronos [She/Her]> !eval echo (compiles import pkg/nint128)
23:54:10NimBotCompile failed: /usercode/in.nim(1, 22) Error: expected: ')', but got: 'keyword import'
23:54:13FromDiscord<Chronos [She/Her]> Hold on
23:54:17FromDiscord<Chronos [She/Her]> !eval echo (compiles: import pkg/nint128)
23:54:19NimBotCompile failed: /usercode/in.nim(1, 17) Error: expression expected, but found 'keyword import'
23:54:27FromDiscord<Chronos [She/Her]> Fuck
23:54:35FromDiscord<Chronos [She/Her]> !eval echo compiles:↵ import pkg/nint128
23:54:37NimBotCompile failed: /usercode/in.nim(1, 20) Error: invalid indentation
23:54:43FromDiscord<Chronos [She/Her]> Bruh
23:55:45FromDiscord<Chronos [She/Her]> wait... Apparently it doesn't
23:55:46FromDiscord<Chronos [She/Her]> Huh?
23:55:53FromDiscord<Chronos [She/Her]> Then why does it keep running code.... Sigh
23:56:23FromDiscord<Chronos [She/Her]> I'll just send my full code
23:58:24FromDiscord<Chronos [She/Her]> Okay well that works now???
23:58:31FromDiscord<Chronos [She/Her]> That was so confusing
23:58:35*xmachina joined #nim