00:03:37 | FromDiscord | <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:42 | FromDiscord | <Chronos [She/Her]> That's probably not doable tbh |
00:03:54 | FromDiscord | <Chronos [She/Her]> Or at least with no real ude |
00:03:56 | FromDiscord | <Chronos [She/Her]> Use |
00:19:37 | FromDiscord | <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:49 | FromDiscord | <ahungry> (edit) "suggestion-" => "question -" |
00:20:29 | FromDiscord | <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:15 | FromDiscord | <Elegantbeef> Channels are your best option afaik↵(@Chronos [She/Her]) |
00:32:41 | FromDiscord | <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:38 | FromDiscord | <sOkam! 🫐> the `examples/nim_hello` folder shows the folder structure for that example |
00:38:04 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Channels are your best": Fair enough |
00:57:04 | FromDiscord | <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:23 | FromDiscord | <Elegantbeef> The Nim way of doing bidirectional would be having two channels |
00:57:44 | FromDiscord | <Elegantbeef> Though I do not do multi threading |
00:59:05 | * | mal`` quit (Quit: Leaving) |
01:08:54 | FromDiscord | <Chronos [She/Her]> Tbf it wouldn't be hard to use one channel both ways |
01:14:09 | * | mal`` joined #nim |
01:22:16 | NimEventer | New thread by maverk: Nim documention, see https://forum.nim-lang.org/t/10447 |
01:37:32 | FromDiscord | <Chronos [She/Her]> How would you generate the docs locally, if anyone knows? For the stdlib |
01:37:32 | FromDiscord | <Chronos [She/Her]> Wondering now |
01:49:54 | FromDiscord | <Elegantbeef> `koch docs` iirc |
01:51:01 | FromDiscord | <Elegantbeef> Though docs should be shipped if installed using choosenim i believe |
01:51:54 | FromDiscord | <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:18 | FromDiscord | <Chronos [She/Her]> Makes sense |
01:58:27 | FromDiscord | <Chronos [She/Her]> Heh, ChatGPT finally helped me- |
01:58:44 | FromDiscord | <Chronos [She/Her]> It outputted a Crockford Base32 encoder and decoder in Nim for me |
01:59:24 | nmz- | probably stolen from somewhere else |
02:00:35 | FromDiscord | <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:14 | FromDiscord | <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:27 | FromDiscord | <ahungry> I enjoy `nim genDepend` also |
02:02:00 | FromDiscord | <Elegantbeef> koch is the compiler build tool |
02:02:07 | FromDiscord | <Elegantbeef> It's for development |
02:03:47 | FromDiscord | <Chronos [She/Her]> Lol the code doesn't work 🥲 |
02:04:18 | FromDiscord | <Elegantbeef> Of course not |
02:04:50 | FromDiscord | <Chronos [She/Her]> Idk what I expected but |
02:04:52 | FromDiscord | <Chronos [She/Her]> Oh well |
02:05:00 | FromDiscord | <Chronos [She/Her]> It outputs `0` no matter the input value |
02:05:03 | FromDiscord | <Chronos [She/Her]> For deciding |
02:05:05 | FromDiscord | <Chronos [She/Her]> Decoding |
02:10:55 | FromDiscord | <Chronos [She/Her]> https://play.nim-lang.org/#ix=4EXQ have fun ig? Lol |
02:11:57 | FromDiscord | <Chronos [She/Her]> Weird, changing line 26 to `result = result 32 + value` makes it output `8610` instead somehow |
02:11:59 | FromDiscord | <Elegantbeef> `result = 1` |
02:12:30 | FromDiscord | <Elegantbeef> `0 32 + value` != `result = result (32 + value)` |
02:15:25 | * | edr quit (Quit: Leaving) |
02:20:27 | FromDiscord | <Chronos [She/Her]> Still gives wrong numbers, outputs `41378` now? |
02:20:52 | FromDiscord | <Chronos [She/Her]> Using `result = result 32 + value` with `result` having an initial value of 1 at the start |
02:21:22 | FromDiscord | <Elegantbeef> I didnt look at the algo, just the math |
02:23:02 | FromDiscord | <Chronos [She/Her]> This is pain |
02:28:05 | NimEventer | New Nimble package! iecook - Cook all cookies of your browser, see https://github.com/thisago/iecook |
02:33:21 | FromDiscord | <Elegantbeef> Well base32/64 rely on how the ascii table is defined |
02:33:36 | FromDiscord | <Elegantbeef> It'd be nicer if it chose 32 sequential characters |
02:33:55 | FromDiscord | <Elegantbeef> Also how is that base 32 when there are 36 characters? |
02:34:39 | FromDiscord | <Elegantbeef> Ah nvm it skips some letters |
02:42:02 | FromDiscord | <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:13 | FromDiscord | <Chronos [She/Her]> lI1, 0O |
02:57:12 | FromDiscord | <kyre58> how is the nim sublime text experience? decent? |
03:08:59 | termer | dunno |
03:09:03 | termer | use VSCode |
03:09:06 | termer | 8) |
03:11:41 | FromDiscord | <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:03 | FromDiscord | <Chronos [She/Her]> I use VSC personally, but with all editors or IDEs, you'll find Nim support is.... Lacking, unfortunately |
03:13:25 | FromDiscord | <kyre58> ah, i tried vsc but electron… |
03:13:54 | termer | You'll find that nimsuggest is a bigger hog than Electron |
03:16:54 | FromDiscord | <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:31 | FromDiscord | <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:15 | FromDiscord | <Elegantbeef> `--listCmd` or `--fullCmd` always forget |
03:42:40 | FromDiscord | <sOkam! 🫐> ty ✍️ |
03:42:53 | FromDiscord | <sOkam! 🫐> --listCmd |
03:44:31 | FromDiscord | <sOkam! 🫐> oh wait, but it prints the commands that verbosity:2 already does |
03:47:11 | FromDiscord | <sOkam! 🫐> ah i see the problem. classic `nim c` ignoring `--outdir:` being sent in the wrong position 😔 |
03:54:24 | FromDiscord | <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:52 | FromDiscord | <Elegantbeef> "wrong position? |
04:01:10 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://paste.rs/zf6Hy |
04:01:29 | FromDiscord | <sOkam! 🫐> Only the order of the args+outdir was changed |
05:07:11 | * | advesperacit joined #nim |
05:23:30 | FromDiscord | <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:41 | FromDiscord | <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:30 | FromDiscord | <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:03 | FromDiscord | <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:17 | FromDiscord | <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:29 | FromDiscord | <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:20 | FromDiscord | <enthus1ast> @ahungry\: @.maverk ^ |
07:00:59 | isaiah | hello everyone |
07:01:10 | FromDiscord | <enthus1ast> hi |
07:01:18 | PMunch | Hi |
07:01:31 | isaiah | is there something like tkinter and flask in nim |
07:02:40 | FromDiscord | <enthus1ast> we have some webserver and some gui frameworks |
07:02:57 | PMunch | You have a tcl wrapper in the Nim organization as well, not sure how supported it is though |
07:03:01 | FromDiscord | <enthus1ast> i think it depends what you need |
07:03:08 | PMunch | For flask I'd say Jester is probably the closest |
07:03:26 | PMunch | But it's been a long time since I used flask, so I might misremember |
07:03:40 | isaiah | but jester seems to have no detailed doc or resource for learning it |
07:04:05 | FromDiscord | <enthus1ast> there is not too much to learn |
07:04:42 | PMunch | It's definitely a bit of a "everything works until it doesn't" kind of situation though |
07:04:42 | isaiah | so how do you nim personally |
07:05:12 | PMunch | I'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:50 | FromDiscord | <enthus1ast> yeah looking at the source code is a good tip in general |
07:05:59 | PMunch | You could try HappyX though, more active development, and possibly better docs although I haven't had a look at them |
07:06:31 | FromDiscord | <enthus1ast> for webserver i currently tend to use mummy though |
07:06:49 | PMunch | isaiah, 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:57 | isaiah | happyx i will chcek it now. i just wish it could have the python libraries i mean written in nim |
07:07:31 | PMunch | Oh yeah, mummy might be good. Haven't checked that out either |
07:08:05 | FromDiscord | <enthus1ast> mummy itself is more barebone in some cases, but its easily extendable |
07:08:29 | PMunch | isaiah, you could always have a look at nimpy if you really want to use a Python library |
07:09:49 | isaiah | won't it better if those libraries were rewritten in nim? it could make it more faster |
07:09:52 | FromDiscord | <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:23 | FromDiscord | <enthus1ast> a non trivial gui |
07:11:14 | FromDiscord | <enthus1ast> but its definitly doable\: https://github.com/Dankr4d/BF2142Unlocker |
07:11:44 | FromDiscord | <enthus1ast> this one is done in gintro |
07:12:45 | isaiah | i will love it to be easier in nim to. it will boost nim popularity |
07:14:37 | FromDiscord | <enthus1ast> maybe |
07:15:45 | FromDiscord | <enthus1ast> maybe you can start with what you wanna do, and see for yourself if you can do it |
07:15:59 | FromDiscord | <enthus1ast> and if you stuck come here and ask \:) |
07:16:53 | isaiah | sure once my nim skills is as a good as my python i will . i prefer nim to rust |
07:18:16 | isaiah | Nim also need great books to make it easy for those starting out |
07:19:16 | FromDiscord | <enthus1ast> https://ssalewski.de/nimprogramming.html |
07:19:28 | PMunch | There's also Nim in Action and Mastering Nim |
07:20:00 | PMunch | Native Nim libraries could be faster, but sometimes you just want to do something and not worry about the speed |
07:20:20 | FromDiscord | <enthus1ast> https://narimiran.github.io/nim-basics/ |
07:20:42 | FromDiscord | <enthus1ast> and not worry about it break on production, like in python |
07:21:14 | PMunch | As 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:28 | PMunch | enthus1ast, oh yeah shipping Python programs is still a pain.. |
07:22:06 | FromDiscord | <enthus1ast> thats what i really dislike about python, they should finally do their type system |
07:40:14 | qwr | if 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:26 | qwr | and 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:23 | PMunch | Hmm, 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:21 | isaiah | i really do not know how to do that. but are you trying to build a wrapper around the c math library |
07:56:59 | FromDiscord | <enthus1ast> p"5.0" |
07:57:00 | FromDiscord | <enthus1ast> ? |
08:01:58 | FromDiscord | <odexine> where p is string->datatype yeah |
08:02:36 | PMunch | isaiah, nah I'm wrapping MAPM |
08:02:53 | PMunch | enthus1ast, why p? |
08:03:03 | PMunch | But yeah a prefix like that would work |
08:04:38 | FromDiscord | <odexine> any prefix works |
08:04:47 | FromDiscord | <odexine> prolly just a plaseholder |
08:04:49 | FromDiscord | <odexine> place |
08:13:00 | isaiah | i just checked it out its for high precision maths |
08:15:48 | PMunch | Yup |
08:15:49 | FromDiscord | <enthus1ast> p for precision \:) |
08:26:55 | * | isaiah quit (Quit: Client closed) |
08:29:53 | NimEventer | New thread by arnetheduck: Pure Nim FFT library, see https://forum.nim-lang.org/t/10449 |
08:43:20 | PMunch | Hmm, this library has a copy procedure. Anyone know how to wrap that with `=copy`? |
08:43:45 | PMunch | I have currently followed this: https://nim-lang.org/docs/destructors.html#lifetimeminustracking-hooks-nimeqcopy-hook |
08:44:17 | PMunch | But I'm not entirely sure if the `=destroy` call there might do something it shouldn't.. |
08:49:07 | FromDiscord | <Elegantbeef> Your destroy hook should be disarmed so it should do nothing if there is nothing to destroy |
08:49:39 | PMunch | Hmm, the library doesn't have anything like "in-initialized" though.. |
08:49:45 | PMunch | is* |
08:50:06 | FromDiscord | <Elegantbeef> No pointer or anything used as a sentinel either, odd |
08:51:49 | PMunch | I mean I just call an init function which returns a pointer |
08:52:13 | PMunch | I guess since Nim nil initializes things I could just use `isNil` |
08:52:35 | FromDiscord | <Elegantbeef> Right inside your `=destroy` you should have a nil check |
08:56:46 | PMunch | So this should be fine? http://ix.io/4EZ7 |
08:57:10 | PMunch | Where MapmInternal is `ptr MapmStruct`. |
08:57:40 | FromDiscord | <Elegantbeef> You do not need to check if it's not self |
08:58:01 | PMunch | Sure? |
08:58:03 | NimEventer | New 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:20 | PMunch | It is mentioned in the official docs: https://nim-lang.org/docs/destructors.html#lifetimeminustracking-hooks-nimeqcopy-hook |
08:58:21 | FromDiscord | <Elegantbeef> Ah sorry sink doesnt |
10:08:44 | * | jmdaemon quit (Ping timeout: 248 seconds) |
10:21:21 | FromDiscord | <.maverk> In reply to @enthus1ast "<@358073954994225153>\: <@1021771961040375900> ^": yes ? |
10:21:51 | FromDiscord | <.maverk> In reply to @pmunch "Account creation by itself": thanks |
10:34:50 | FromDiscord | <.maverk> https://media.discordapp.net/attachments/371759389889003532/1146754967483453460/41.PNG |
10:35:00 | FromDiscord | <.maverk> the tuple keyword is not working |
10:36:18 | NimEventer | New thread by maverk: The tuple keyword is not working, see https://forum.nim-lang.org/t/10451 |
10:59:08 | FromDiscord | <System64 ~ Flandre Scarlet> Aaaaah this crash is so confusing https://media.discordapp.net/attachments/371759389889003532/1146761081793040474/message.txt |
11:01:51 | FromDiscord | <odexine> Why the threading? |
11:02:14 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "Why the threading?": I have an instance manager that boots every game instance |
11:03:02 | FromDiscord | <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:24 | FromDiscord | <System64 ~ Flandre Scarlet> I tried quite everything, it always crashes when the server closes |
11:06:40 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "I tried quite everything, it always crashes when the ... server" added "game instance" |
11:10:26 | FromDiscord | <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:34 | FromDiscord | <griffith1deadly> you can also use it |
11:12:31 | FromDiscord | <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:06 | FromDiscord | <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:31 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah, will reduce repetition |
11:16:35 | FromDiscord | <griffith1deadly> https://github.com/qb-0/pyMeow/blob/master/src/gui.nim#L38↵like this |
11:18:06 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "https://github.com/qb-0/pyMeow/blob/master/src/gui.": Oh alright |
11:18:23 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "https://github.com/system64MC/tfe/blob/develop/serv": Sadly it doesn't fix the crash |
11:18:55 | FromDiscord | <griffith1deadly> In reply to @sys64 "Aaaaah this crash is": try debug what thread is crashing |
11:19:06 | FromDiscord | <griffith1deadly> istanceman or web or another |
11:20:30 | FromDiscord | <griffith1deadly> looks like instanceman |
11:20:33 | FromDiscord | <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:09 | FromDiscord | <griffith1deadly> In reply to @sys64 "I don't think web": crash in spawn inst.bootGameInstance2() |
11:22:22 | FromDiscord | <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:34 | FromDiscord | <griffith1deadly> (edit) "https://play.nim-lang.org/#ix=4EZA" => "https://play.nim-lang.org/#ix=4EZB" |
11:22:40 | FromDiscord | <System64 ~ Flandre Scarlet> So it crashes in this proc? |
11:23:19 | FromDiscord | <griffith1deadly> ye, look in stacktrace https://media.discordapp.net/attachments/371759389889003532/1146767167455514685/image.png |
11:23:46 | FromDiscord | <System64 ~ Flandre Scarlet> So it's not InstanceManager's fault? |
11:24:35 | FromDiscord | <griffith1deadly> it gameInstance fault↵https://github.com/system64MC/tfe/blob/develop/server/src/gameInstance.nim#L303 |
11:25:04 | FromDiscord | <griffith1deadly> try play with code to find line who crashing |
11:27:38 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4EZC |
11:28:15 | FromDiscord | <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:58 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4EZD |
11:41:13 | FromDiscord | <.maverk> does nim have optimizaton flags ? |
11:41:40 | FromDiscord | <.maverk> (edit) "optimizaton" => "optimization" |
11:41:45 | PMunch | Yes |
11:43:37 | FromDiscord | <.maverk> In reply to @PMunch "Yes": what are they ? ↵↵i used ``-d:danger`` |
11:43:41 | FromDiscord | <.maverk> but not working |
11:43:54 | FromDiscord | <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:59 | PMunch | .maverk, what do you mean "not working"? |
11:45:21 | FromDiscord | <.maverk> In reply to @PMunch ".maverk, what do you": i get a lot of errors in the screen |
11:45:24 | PMunch | -d:danger turns off a bunch of range checks, along with implying -d:release which turns off some debug features |
11:45:29 | PMunch | Errors? |
11:45:38 | FromDiscord | <.maverk> let me show you |
11:45:48 | PMunch | Well to remove errors you need to fix your code, not turn on optimizations :P |
11:47:21 | FromDiscord | <.maverk> https://media.discordapp.net/attachments/371759389889003532/1146773216245862540/91.PNG |
11:47:46 | FromDiscord | <.maverk> In reply to @PMunch "Well to remove errors": no u misunderstood then |
11:47:56 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EZK |
11:48:23 | FromDiscord | <odexine> In reply to @.maverk "": The flag goes before the file name |
11:48:42 | FromDiscord | <.maverk> let me try again |
11:48:44 | PMunch | Ah |
11:48:52 | PMunch | You need to put -d:release before the filename |
11:48:52 | * | disso-peach joined #nim |
11:49:15 | PMunch | The 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:26 | FromDiscord | <.maverk> now workes |
11:49:34 | FromDiscord | <.maverk> (edit) "workes" => "works" |
11:50:44 | * | kenran joined #nim |
11:51:09 | FromDiscord | <bung8954> @pmunch is nim LSP gc Mark and sweep required? |
11:56:47 | FromDiscord | <frobnicate> Was there an ETA on a v2 docker image? |
11:56:52 | PMunch | bung8954, 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:41 | FromDiscord | <griffith1deadly> In reply to @sys64 "nevermind, I have a": looks like norm doesnt support multithread (true) |
11:57:47 | PMunch | frobnicate, 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:40 | FromDiscord | <frobnicate> Can I just curl it or how does that work? |
11:58:57 | FromDiscord | <frobnicate> The one on docker hub is little old |
11:58:59 | FromDiscord | <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:21 | FromDiscord | <jmgomez> And nimlangserver is a no go for me |
11:59:58 | PMunch | frobnicate, uhm I guess you could curl the dockerfile from GitHub.. |
12:00:12 | PMunch | jmgomez, how it uses it as a library? |
12:00:17 | PMunch | `import nimsuggest` |
12:00:22 | FromDiscord | <frobnicate> Yeah cus I don't need the entire repo |
12:01:16 | FromDiscord | <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:25 | FromDiscord | <bung8954> @pmunch get it, I tried use nimskull compile with orc compiled but runs failed |
12:03:27 | PMunch | What 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:16 | PMunch | bung8954, I think it should work now, the compiler runs with ORC IIRC and nimsuggest is basically just the compiler |
12:04:41 | FromDiscord | <frobnicate> I've really been trying hard lately to containerise evwerything 😅 |
12:06:01 | FromDiscord | <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:48 | FromDiscord | <griffith1deadly> nimsuggest so buggy and laggy |
12:07:00 | PMunch | jmgomez, what do you mean? |
12:08:54 | FromDiscord | <odexine> are there other suggestion providers aside from nimsuggest> |
12:08:55 | FromDiscord | <odexine> (edit) "nimsuggest>" => "nimsuggest?" |
12:08:56 | FromDiscord | <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:12 | FromDiscord | <bung8954> @pmunch thanks, there must be problem at other place I'll try to figure it out |
12:15:25 | FromDiscord | <.maverk> why is ``of`` considered an operator ????? https://media.discordapp.net/attachments/371759389889003532/1146780277197250641/1.PNG |
12:20:53 | FromDiscord | <odexine> it's used in case statements |
12:21:20 | PMunch | jmgomez, 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:24 | FromDiscord | <odexine> https://nim-lang.org/docs/manual.html#statements-and-expressions-case-statement |
12:21:37 | PMunch | And `x = object of Y` |
12:22:21 | FromDiscord | <.maverk> In reply to @odexine "it's used in case": yes i know |
12:22:27 | FromDiscord | <.maverk> but operator really ? |
12:22:45 | FromDiscord | <odexine> In reply to @PMunch "And `x = object": ah i thought you asked about keywords, but its used here as an operator |
12:22:51 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "looks like norm doesnt": Wait WTF?? |
12:33:35 | * | ntat quit (Quit: leaving) |
12:38:40 | FromDiscord | <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:06 | FromDiscord | <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:08 | FromDiscord | <Phil> (edit) "norn" => "norm" |
12:50:07 | FromDiscord | <queebee> Is there a list of c compilers which can be used with `--cc` |
12:50:11 | FromDiscord | <queebee> (edit) "`--cc`" => "`--cc`?" |
12:57:36 | * | cedb quit (Ping timeout: 246 seconds) |
13:06:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "That's wild. I was": I guess I'll have to change ORM? |
13:11:44 | FromDiscord | <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:23 | FromDiscord | <Phil> The only part that interacts is the thread pool and that never was problematic for me in webdev |
13:13:23 | FromDiscord | <Phil> (edit) "The only part that interacts ... isconnection" added "with threads without being encapsulated" | "thread" => "connection" |
13:24:36 | FromDiscord | <griffith1deadly> In reply to @sys64 "I guess I'll have": debby maybe |
13:24:43 | FromDiscord | <griffith1deadly> it support multithreading |
13:25:54 | FromDiscord | <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:18 | FromDiscord | <sOkam! 🫐> In reply to @pmunch "This does indeed complicate": not sure i understand what you meant |
13:51:06 | FromDiscord | <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:52 | FromDiscord | <griffith1deadly> In reply to @sys64 "Aaaaaalright so I think": i only say because it figured in stacktrace |
13:54:18 | PMunch | sOkam, 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:53 | FromDiscord | <sOkam! 🫐> In reply to @PMunch "sOkam, you said you": yeah the snip out part is what i don't get |
13:55:41 | FromDiscord | <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:36 | FromDiscord | <sOkam! 🫐> also, how do you pass futhark on it if there is no .h file? |
14:00:34 | * | PMunch quit (Quit: Leaving) |
14:06:52 | FromDiscord | <System64 ~ Flandre Scarlet> Finally I fixed the bug...↵Seems Orc still has some problems so I moved to Arc |
14:07:52 | FromDiscord | <sOkam! 🫐> How would you map `const char argv[]` to Nim?↵`argv :cstringArray`? 🤔 |
14:08:32 | FromDiscord | <odexine> do you need to? |
14:09:39 | FromDiscord | <sOkam! 🫐> In reply to @odexine "do you need to?": yes, afaik. im with `--noMain --mm:none` |
14:15:00 | FromDiscord | <demotomohiro> You can get the contents of argv using `os.paramStr` |
14:15:45 | FromDiscord | <demotomohiro> So you cannot use it because `--noMain`? |
14:16:22 | FromDiscord | <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:21 | FromDiscord | <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:52 | FromDiscord | <.maverk> there is no signed suffix ????? |
14:21:59 | FromDiscord | <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:20 | FromDiscord | <.maverk> https://media.discordapp.net/attachments/371759389889003532/1146812214821527682/92.PNG |
14:22:39 | FromDiscord | <.maverk> no signed suffix ? |
14:22:41 | FromDiscord | <sOkam! 🫐> In reply to @.maverk "": ??? `'iN` |
14:22:55 | FromDiscord | <sOkam! 🫐> how is `'i32` not signed? |
14:22:56 | FromDiscord | <.maverk> In reply to @heysokam "??? `'iN`": no |
14:23:17 | FromDiscord | <.maverk> i mean |
14:23:32 | FromDiscord | <.maverk> machine dependent |
14:23:34 | FromDiscord | <.maverk> int |
14:23:38 | FromDiscord | <sOkam! 🫐> `42.int` |
14:23:42 | FromDiscord | <sOkam! 🫐> there you have it |
14:23:50 | FromDiscord | <.maverk> no you don't understand |
14:24:05 | FromDiscord | <sOkam! 🫐> `42'i32 == 42.int == int(42)` |
14:24:09 | FromDiscord | <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:33 | FromDiscord | <sOkam! 🫐> (edit) "`42'i32 == 42.int == int(42)` ... " added "(on 32bit systems)" |
14:24:52 | FromDiscord | <sOkam! 🫐> In reply to @.maverk "no you don't understand": suffixes are just procs |
14:24:56 | FromDiscord | <.maverk> sent a long message, see http://ix.io/4F0v |
14:25:11 | FromDiscord | <sOkam! 🫐> suffixes are just procs↵`var value : int = 42.int` |
14:25:24 | FromDiscord | <.maverk> mmmm |
14:25:27 | FromDiscord | <.maverk> oky |
14:26:38 | FromDiscord | <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:24 | FromDiscord | <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:46 | FromDiscord | <sOkam! 🫐> it was probably the code that generates it or something |
14:30:48 | FromDiscord | <solitudesf> In reply to @.maverk "i mean like this": integer literals default to int |
14:35:14 | FromDiscord | <.maverk> In reply to @solitudesf "integer literals default to": i see |
14:35:46 | FromDiscord | <demotomohiro> !eval echo typeof(123'i) |
14:35:47 | NimBot | Compile 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:17 | FromDiscord | <sOkam! 🫐> where in https://github.com/nim-lang/Nim/ is `NimMain()` called under normal usage of the language? |
14:42:43 | FromDiscord | <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:16 | FromDiscord | <odexine> In reply to @.maverk "i mean like this": because it's default, iirc |
14:55:23 | FromDiscord | <odexine> well "default" |
14:58:12 | FromDiscord | <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:03 | FromDiscord | <demotomohiro> Check os module. |
15:04:01 | FromDiscord | <acornes> i checked walkFiles but i still don't understand how it works |
15:05:46 | FromDiscord | <jeanphilippecrowley> thanks for the nickname i chosen to be the whore of Nim for a while now |
15:08:04 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F0S |
15:09:02 | FromDiscord | <acornes> thank you |
15:09:14 | FromDiscord | <sOkam! 🫐> np |
15:22:16 | FromDiscord | <System64 ~ Flandre Scarlet> Did someone already encountered a problem with ARC? |
15:23:43 | * | xmachina quit (Quit: WeeChat 4.0.4) |
15:32:37 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F0W |
15:34:18 | FromDiscord | <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:19 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F10 |
16:07:41 | FromDiscord | <sOkam! 🫐> `build.nim` is a second app that you build with the confy task. and that calls for the buildsystem itself |
16:08:55 | FromDiscord | <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:25 | FromDiscord | <sOkam! 🫐> the readme definitely needs a proper `how to` section, though. I thought nobody was using it |
16:24:21 | FromDiscord | <Chronos [She/Her]> AHA! MY ENCODER AND DECODER FINALLY FUCKING WORKS |
16:24:34 | FromDiscord | <Chronos [She/Her]> AND BECAUSE THIS IS ABSOLUTE PAIN, I'LL PROBABLY RELEASE IT ON NIMBLE |
16:25:22 | FromDiscord | <Chronos [She/Her]> Idk what to name the package tho bc it'll have a ridiculously long name |
16:25:45 | FromDiscord | <sOkam! 🫐> 👆 _[insert.evil.laughter.here]_ |
16:26:13 | FromDiscord | <sOkam! 🫐> for some reason it sounded like that in my brain 🙈 |
16:27:13 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "Idk what to name": `nimble install ridiculouslynamedencoderdecoder` sounds gud to me 😏 |
16:28:01 | FromDiscord | <Chronos [She/Her]> 😭 no, I'll probably name it `crockfordb32` |
16:28:17 | FromDiscord | <Chronos [She/Her]> It has no checksum ability or anything but |
16:28:35 | FromDiscord | <sOkam! 🫐> `ridiculouscrock` sounds kinda cool for some reason, lol |
16:28:40 | FromDiscord | <griffith1deadly> In reply to @heysokam "you don't `nimble build`": can you add to confy android and ios target, if it possible? |
16:28:57 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "`ridiculouscrock` sounds kinda cool": Sounds pain xD |
16:29:12 | FromDiscord | <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:36 | FromDiscord | <sOkam! 🫐> unless ios is the phone system or something, im really ignorant on phone stuff |
16:30:50 | FromDiscord | <Chronos [She/Her]> For android it just needs the ndk I think? But zig cc should support compiling for Android, idk tho |
16:31:08 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "For android it just": ye, ndk |
16:31:10 | FromDiscord | <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:12 | FromDiscord | <griffith1deadly> but ios idk |
16:31:59 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "For android it just": zigcc support android and ios |
16:32:54 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1c |
16:33:15 | FromDiscord | <sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4F1c" => "https://play.nim-lang.org/#ix=4F1d" |
16:33:47 | FromDiscord | <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:26 | FromDiscord | <sOkam! 🫐> In reply to @griffith1deadly "zigcc support android and": what does Nim code look like when built for android/ios? 🤔 |
16:35:01 | FromDiscord | <Chronos [She/Her]> In reply to @griffith1deadly "zigcc support android and": Neat |
16:37:51 | FromDiscord | <sOkam! 🫐> isn't `Android` actually just `OS.Linux, CPU.arm64`? 🤔 |
16:38:11 | FromDiscord | <griffith1deadly> In reply to @heysokam "isn't `Android` actually just": no |
16:38:13 | FromDiscord | <Chronos [She/Her]> Nope, Android is funky |
16:38:19 | FromDiscord | <griffith1deadly> android build produces apk binary |
16:38:24 | FromDiscord | <sOkam! 🫐> how do you build nim for android then? |
16:38:43 | FromDiscord | <griffith1deadly> example zig build file:↵https://github.com/MasterQ32/ZigAndroidTemplate/blob/master/build.zig#L84 |
16:38:51 | FromDiscord | <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:26 | FromDiscord | <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:59 | FromDiscord | <sOkam! 🫐> so if the nim compiler doesn't support building for android, then confy cannot support it for nim |
16:40:30 | FromDiscord | <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:57 | FromDiscord | <griffith1deadly> https://github.com/search?q=repo%3Ayglukhov%2Fnimx+android&type=code↵nim can be builded for android, as i see |
16:44:32 | FromDiscord | <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:41 | FromDiscord | <sOkam! 🫐> do you know where that is stored? |
16:45:21 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "`build.nim` is a second": And build.nim must be in src directory? |
16:45:53 | FromDiscord | <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:56 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1g |
16:46:22 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1h |
16:47:12 | FromDiscord | <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:22 | FromDiscord | <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:27 | FromDiscord | <sOkam! 🫐> (edit) "switch↵I'm" => "switch for nimc↵I'm" |
16:48:39 | FromDiscord | <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:27 | FromDiscord | <kyre58> Looks like SOkam is gonna support android and ios, nice. |
16:50:49 | FromDiscord | <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:10 | FromDiscord | <sOkam! 🫐> but anything else shouldn't import it, which is what that guard.nim file is telling you about |
16:51:17 | FromDiscord | <sOkam! 🫐> idk whats triggering it though |
16:51:37 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1j |
16:52:06 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1146849908800901201/image.png |
16:52:41 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1l |
16:53:26 | FromDiscord | <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:31 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1n |
16:53:43 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1o |
16:53:51 | FromDiscord | <System64 ~ Flandre Scarlet> Ah, so I need to put something? |
16:53:52 | FromDiscord | <sOkam! 🫐> but yeah like that |
16:54:12 | FromDiscord | <sOkam! 🫐> In reply to @sys64 "Ah, so I need": no "need", is jst a reference message for when you do `nimble tasks` |
16:54:26 | FromDiscord | <sOkam! 🫐> could leave it empty, tbh |
16:54:44 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1p |
16:54:51 | FromDiscord | <sOkam! 🫐> oh waaait |
16:54:59 | FromDiscord | <sOkam! 🫐> remove the file, you are on 0.0.5 |
16:55:06 | FromDiscord | <sOkam! 🫐> (edit) "file," => "package," |
16:55:34 | FromDiscord | <sOkam! 🫐> for some reason there is a bug in nim v2.0 that doesn't get the latest version from `#head` packages |
16:55:42 | FromDiscord | <sOkam! 🫐> its fixed in devel, but not in stable |
16:56:02 | FromDiscord | <sOkam! 🫐> latest version is `confy-0.0.10` |
16:57:15 | FromDiscord | <System64 ~ Flandre Scarlet> Oh, lemme try that |
16:57:29 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "latest version is `confy-0.0.10`": nimble install confy-0.0.10? |
16:58:02 | FromDiscord | <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:42 | FromDiscord | <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:10 | FromDiscord | <sOkam! 🫐> the package is tagged, so it should download 0.0.10 |
17:00:20 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/526Yk |
17:00:29 | FromDiscord | <sOkam! 🫐> still? damn 😦 |
17:01:39 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1s |
17:03:32 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1t |
17:04:07 | FromDiscord | <sOkam! 🫐> oh, this might be the issue https://github.com/heysokam/confy/blob/2239e4afc33d44e5403a459d1b673f848633a21b/src/confy/nims/guard.nim#L10-L12 |
17:04:17 | FromDiscord | <sOkam! 🫐> can you try `echo` in console? |
17:04:27 | FromDiscord | <sOkam! 🫐> `echo hello` for example |
17:05:04 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1u |
17:05:20 | FromDiscord | <sOkam! 🫐> then it has something to do with `gorgeEx("echo")` when run on windows 🤔 |
17:05:41 | FromDiscord | <System64 ~ Flandre Scarlet> Windows moment |
17:05:54 | FromDiscord | <System64 ~ Flandre Scarlet> Windows, cringe forever |
17:06:07 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1v |
17:06:32 | FromDiscord | <sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4F1v" => "https://play.nim-lang.org/#ix=4F1x" |
17:06:32 | FromDiscord | <sOkam! 🫐> edited, sry. missed the rest |
17:07:23 | FromDiscord | <sOkam! 🫐> i still don't understand why the `guard.nim` file is used at all though. that makes no sense |
17:07:32 | FromDiscord | <sOkam! 🫐> (edit) "used" => "imported" |
17:07:37 | * | Phytolizer joined #nim |
17:07:56 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1y |
17:09:13 | FromDiscord | <sOkam! 🫐> yeah there is the issue, basically. that file is being imported from nimble, and triggering the error pragma |
17:10:01 | FromDiscord | <sOkam! 🫐> could you add `echo gorgeEx("echo").exitCode` to that nims file? |
17:10:04 | * | Phytolizer left #nim (#nim) |
17:10:21 | FromDiscord | <sOkam! 🫐> maybe the command on windows returns a `1` on success or something |
17:10:23 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "could you add `echo": Gotta try after the dinner |
17:12:30 | * | SebastianM joined #nim |
17:39:54 | FromDiscord | <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:12 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F1G |
17:41:06 | FromDiscord | <System64 ~ Flandre Scarlet> And with your Hello test too https://media.discordapp.net/attachments/371759389889003532/1146862236611129507/message.txt |
17:42:12 | FromDiscord | <.maverk> guys the precedence list in the nim doc is really weird i cannot understand it |
18:09:43 | FromDiscord | <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:38 | FromDiscord | <juan_carlos> You dont speak compiler ?. |
18:30:59 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F1V |
18:31:21 | FromDiscord | <odexine> In reply to @juan_carlos "You dont speak compiler": Imagine not being the compiler |
18:32:47 | FromDiscord | <sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4F1V" => "https://play.nim-lang.org/#ix=4F1X" |
18:33:09 | FromDiscord | <sOkam! 🫐> @System64 ~ Flandre Scarlet that part its definitely not going to work without a patch for zipping on windows 😦 |
18:33:21 | FromDiscord | <sOkam! 🫐> `tar` is not an app on windows, right? |
18:33:29 | FromDiscord | <sOkam! 🫐> can you try running it, in case it is? |
18:33:34 | FromDiscord | <sOkam! 🫐> `tar -v` |
18:33:53 | FromDiscord | <sOkam! 🫐> (edit) "-v`" => "--version`" |
18:33:53 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "<@380360389377916939> that part its": I have tar |
18:34:07 | FromDiscord | <sOkam! 🫐> did you install it or is it there by dfault? |
18:34:21 | FromDiscord | <System64 ~ Flandre Scarlet> How can I check the path to the executable? |
18:35:21 | FromDiscord | <sOkam! 🫐> 🤷♂️ no clues. in linux you can just do `which tar` |
18:35:32 | * | ntat quit (Quit: leaving) |
18:37:32 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F20 |
18:38:05 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F21 |
18:38:24 | FromDiscord | <sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4F21" => "https://play.nim-lang.org/#ix=4F22" |
18:38:39 | FromDiscord | <sOkam! 🫐> idk if that will run, first time trying it, but doesn't hurt to try |
18:38:54 | FromDiscord | <.maverk> sent a code paste, see https://play.nim-lang.org/#ix=4F23 |
18:40:12 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4F24 |
18:40:44 | FromDiscord | <.maverk> should i do nimble install std/net ? |
18:41:01 | FromDiscord | <griffith1deadly> no, because it part of std in installed nim |
18:41:12 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F25 |
18:41:21 | FromDiscord | <sOkam! 🫐> yep, just comment out the warning so it doesn't stop there |
18:41:55 | FromDiscord | <.maverk> In reply to @griffith1deadly "no, because it part": ??? i don't understand |
18:42:00 | FromDiscord | <.maverk> what hsould i do ? |
18:42:07 | FromDiscord | <griffith1deadly> In reply to @.maverk "??? i don't understand": just import std/net |
18:42:28 | FromDiscord | <.maverk> i will try |
18:45:04 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "yep, just comment out": https://media.discordapp.net/attachments/371759389889003532/1146878337977946204/message.txt |
18:45:24 | FromDiscord | <System64 ~ Flandre Scarlet> > confy: Done building.↵Task failed sucessfully |
18:45:59 | * | xet7 quit (Ping timeout: 244 seconds) |
18:46:38 | FromDiscord | <griffith1deadly> if confy set zig in env, need reopen console to get normal building (i think windows specific) |
18:47:10 | FromDiscord | <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:22 | FromDiscord | <sOkam! 🫐> you need to do one or the other, your pick |
18:47:39 | FromDiscord | <sOkam! 🫐> if you go local, confy installs it and maintains it for you, but it costs you 400mb per project or so |
18:47:47 | FromDiscord | <sOkam! 🫐> whatever you prefer |
18:48:38 | FromDiscord | <sOkam! 🫐> (edit) "if you go local, confy installs it ... and" added "(per-project, not system wide)" |
18:49:05 | FromDiscord | <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:19 | FromDiscord | <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:33 | FromDiscord | <System64 ~ Flandre Scarlet> Now 400mb per project↵Node_Modules be like |
18:49:46 | FromDiscord | <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:01 | FromDiscord | <sOkam! 🫐> if you install zig, it will just work normally without changes |
18:50:05 | FromDiscord | <sOkam! 🫐> it uses the system one by default |
18:51:14 | FromDiscord | <System64 ~ Flandre Scarlet> Gotta try the offline one↵But you need to deploy a patch for the zip bug |
18:51:23 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "offline one↵But" => "local one first↵But" |
18:51:35 | FromDiscord | <sOkam! 🫐> In reply to @sys64 "Gotta try the local": yeah, the non-unix bug is easily fixable. will do |
18:52:25 | FromDiscord | <System64 ~ Flandre Scarlet> Alright! Thanks! |
18:55:08 | FromDiscord | <.maverk> https://media.discordapp.net/attachments/371759389889003532/1146880869647261716/11.PNG |
18:55:14 | FromDiscord | <.maverk> the socket is finally working |
18:55:21 | FromDiscord | <.maverk> 😃 |
18:55:26 | FromDiscord | <.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:07 | FromDiscord | <System64 ~ Flandre Scarlet> Do you think this schema explains Nim compilation process well? https://media.discordapp.net/attachments/371759389889003532/1146886898661474416/image.png |
19:20:57 | FromDiscord | <.maverk> it is so good |
19:21:10 | FromDiscord | <.maverk> i will download it |
19:21:14 | FromDiscord | <System64 ~ Flandre Scarlet> Thanks! |
19:21:25 | FromDiscord | <.maverk> you are welcome |
19:21:28 | FromDiscord | <System64 ~ Flandre Scarlet> I made it |
19:21:39 | FromDiscord | <.maverk> it pretty neat |
19:21:46 | FromDiscord | <.maverk> (edit) "it ... pretty" added "is" |
19:22:29 | FromDiscord | <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:45 | FromDiscord | <.maverk> yeah |
19:23:51 | FromDiscord | <.maverk> leave the unnecessary stuff |
19:24:30 | FromDiscord | <System64 ~ Flandre Scarlet> I will just mention it but that's all |
19:25:35 | FromDiscord | <.maverk> very nice |
19:25:40 | FromDiscord | <.maverk> i have one question |
19:26:00 | FromDiscord | <System64 ~ Flandre Scarlet> yeah? |
19:26:20 | FromDiscord | <.maverk> why are you using the name System64 ?? 🤔 |
19:28:20 | FromDiscord | <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:59 | FromDiscord | <.maverk> aaah i see |
19:29:11 | FromDiscord | <.maverk> that is nice |
19:33:59 | * | xet7 joined #nim |
19:34:15 | FromDiscord | <System64 ~ Flandre Scarlet> Thanks! |
19:50:13 | FromDiscord | <.maverk> you are welcome |
20:05:12 | FromDiscord | <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:22 | FromDiscord | <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:07 | FromDiscord | <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:37 | FromDiscord | <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:24 | FromDiscord | <Chronos [She/Her]> If only there was a way to see if someone is using a Nim library in my code... Sigh |
20:15:49 | FromDiscord | <Elegantbeef> What? |
20:17:02 | FromDiscord | <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:26 | FromDiscord | <Elegantbeef> `when compiles(import pkg/nint128)` |
20:18:31 | FromDiscord | <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:50 | FromDiscord | <Elegantbeef> If they arent using it the above wouldnt compile |
20:18:54 | FromDiscord | <Elegantbeef> Atleast if they're doing a proper build |
20:19:14 | FromDiscord | <Chronos [She/Her]> Oh, with nimble |
20:19:16 | FromDiscord | <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:26 | FromDiscord | <jviega> So knowing the nimble dir isn't helping me either |
20:19:31 | FromDiscord | <Chronos [She/Her]> Gucci, thanks Beef! |
20:20:13 | FromDiscord | <jviega> Anything better than a before hook that pre-installs it? |
20:20:42 | * | ced2 is now known as cedb |
20:21:18 | FromDiscord | <Chronos [She/Her]> `Error: expression expected, but found 'keyword import'` :/ |
20:21:27 | FromDiscord | <jviega> Not even sure that's going to work, before doesn't go before the dependencies |
20:21:37 | FromDiscord | <Chronos [She/Her]> !eval echo compiles(import std/strutils) |
20:21:38 | NimBot | Compile failed: /usercode/in.nim(1, 15) Error: expression expected, but found 'keyword import' |
20:21:49 | FromDiscord | <Chronos [She/Her]> Yeah, that's an issue |
20:22:00 | FromDiscord | <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:17 | FromDiscord | <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:21 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "<@380360389377916939> 0.0.14 is up.": Thanks! Will try that! |
20:22:34 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ieltan "the book in question": Oh, very interesting! |
20:22:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4F2t |
20:22:53 | FromDiscord | <System64 ~ Flandre Scarlet> I know about Nim in Action, but not the second |
20:23:14 | FromDiscord | <Chronos [She/Her]> Huh... |
20:25:54 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4F2u |
20:26:20 | FromDiscord | <Elegantbeef> You didnt tell it the type to decode to |
20:34:54 | FromDiscord | <Chronos [She/Her]> Wait |
20:34:58 | FromDiscord | <Chronos [She/Her]> Fuck I'm blind |
20:36:49 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F2x |
20:37:15 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F2y |
20:41:12 | FromDiscord | <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:30 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F2z |
20:42:01 | FromDiscord | <System64 ~ Flandre Scarlet> ah yeah, looks better |
20:42:51 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F2A |
20:43:10 | FromDiscord | <sOkam! 🫐> not finding the zig bin for some reason? |
20:43:21 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/LT8w6 |
20:46:42 | FromDiscord | <sOkam! 🫐> its still choking with the same zig missing error 🧩 |
20:49:55 | FromDiscord | <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:02 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "its still choking with": the zigcc compiler is stored in projectroot/bin/zig/ |
20:54:07 | FromDiscord | <sOkam! 🫐> In reply to @sys64 "the zigcc compiler is": yep |
20:54:20 | FromDiscord | <sOkam! 🫐> but if you go the systemBin route, you don't need to install it there manually |
20:54:33 | FromDiscord | <sOkam! 🫐> just follow the standard way of installing zig on windows |
20:54:55 | FromDiscord | <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:51 | FromDiscord | <sOkam! 🫐> @System64 ~ Flandre Scarlet what happens if you just `zig version`? Does it give back that exact french message on that error? |
21:08:57 | FromDiscord | <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:45 | FromDiscord | <sOkam! 🫐> In reply to @jviega "In nimble's runtime, anyone": I couldn't find a way to do it |
21:10:02 | FromDiscord | <Elegantbeef> Nimble doesnt get switches |
21:10:08 | FromDiscord | <sOkam! 🫐> I needed those switches for easier setup of confy, and couldn't find them. So.... gave up |
21:10:16 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/compilesettings.html does exist though |
21:10:27 | FromDiscord | <jviega> Cool thx |
21:11:13 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "https://nim-lang.org/docs/compilesettings.html does": is that for nimc or nimble? |
21:13:46 | FromDiscord | <Elegantbeef> No clue if it works inside a nimble file, doubt it |
21:16:19 | FromDiscord | <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:58 | FromDiscord | <sOkam! 🫐> In reply to @sys64 "I didn't installed it": that's exacly why i wanted you to do that, lol |
21:21:16 | FromDiscord | <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:25 | FromDiscord | <sOkam! 🫐> if im correct, it should output the exact same message you got there |
21:21:50 | FromDiscord | <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:59 | FromDiscord | <sOkam! 🫐> but its not |
21:22:27 | FromDiscord | <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:19 | FromDiscord | <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:42 | FromDiscord | <sOkam! 🫐> In reply to @sys64 "Even with Zig installed": exactly, so it is failing where I thought it was |
21:35:17 | FromDiscord | <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:49 | FromDiscord | <System64 ~ Flandre Scarlet> Windows moments |
21:36:06 | FromDiscord | <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:08 | FromDiscord | <System64 ~ Flandre Scarlet> Windows is so developer-unfriendly |
21:36:59 | FromDiscord | <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:34 | FromDiscord | <System64 ~ Flandre Scarlet> Should I move to Linux? |
21:37:48 | FromDiscord | <sOkam! 🫐> depends on your goals i guess |
21:38:01 | FromDiscord | <System64 ~ Flandre Scarlet> The problem on Linux is gaming |
21:38:16 | FromDiscord | <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:47 | FromDiscord | <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:24 | FromDiscord | <System64 ~ Flandre Scarlet> Now I only have a 500GB SSD that's close to be full |
21:39:26 | FromDiscord | <sOkam! 🫐> proton and wine work great for 99% |
21:40:05 | FromDiscord | <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:21 | FromDiscord | <Elegantbeef> Delete your page and hibernation file |
21:40:42 | FromDiscord | <sOkam! 🫐> i don't think i have one. with it it didn't even fit the 50gb partition lol |
21:40:59 | FromDiscord | <sOkam! 🫐> while my linux installs run fine on 20gb partitions and are half empty |
21:44:22 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Delete your page and": Is it dangerous to delete the page? |
21:45:12 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1146923671844290640/image.png |
21:46:53 | FromDiscord | <System64 ~ Flandre Scarlet> You're probably talking about this https://media.discordapp.net/attachments/371759389889003532/1146924094386880663/image.png |
21:47:41 | FromDiscord | <Elegantbeef> Page is for when you run out of ram |
21:47:54 | FromDiscord | <Elegantbeef> hibernation file is for hibernation and is pointless in 90% of cases |
21:48:54 | FromDiscord | <Elegantbeef> With modern low power sleep and ssds, there is not much reason for that style hibernation anymore |
21:49:46 | FromDiscord | <System64 ~ Flandre Scarlet> OOF https://media.discordapp.net/attachments/371759389889003532/1146924819158401134/image.png |
21:50:17 | FromDiscord | <Elegantbeef> Quick make fun of the french unit! |
21:50:31 | FromDiscord | <Elegantbeef> Octets like that's a word |
21:52:23 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah 🤣 |
21:52:33 | FromDiscord | <System64 ~ Flandre Scarlet> Bit↵Octet instead of Byte |
22:10:45 | FromDiscord | <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:11 | FromDiscord | <jviega> Are consts not put in .data? |
22:14:50 | FromDiscord | <m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=4F3c |
22:16:54 | FromDiscord | <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:59 | FromDiscord | <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:13 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F3B |
22:40:07 | FromDiscord | <jviega> Why are they out of the question? Can't you do newStringOfCapacity() and then just & them together? |
22:40:23 | FromDiscord | <sOkam! 🫐> In reply to @jviega "Why are they out": strings are GC'ed memory |
22:40:34 | * | xmachina joined #nim |
22:40:48 | FromDiscord | <jviega> If the GC isn't on, aren't they just alloc()'d? |
22:40:55 | FromDiscord | <jviega> And you call dealloc()? |
22:41:09 | FromDiscord | <jviega> Or do it on the underlying pointer if there isn't an API for it |
22:41:41 | FromDiscord | <Elegantbeef> Since the `add` does not manually gc code |
22:41:42 | FromDiscord | <Elegantbeef> Doesnt work if you use `add` for instance |
22:42:17 | FromDiscord | <jviega> Oh right, cause add's not an in-place operation |
22:42:57 | FromDiscord | <jviega> Yeah, I mean I often drop to a tiny bit of C to do in-place stuff myself 🙂 |
22:44:13 | FromDiscord | <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:04 | FromDiscord | <Elegantbeef> Time to write your own concat procedure |
22:47:30 | FromDiscord | <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:59 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "Time to write your": `C_strcat`?? |
22:48:07 | FromDiscord | <Elegantbeef> There is no dealloc |
22:48:19 | FromDiscord | <sOkam! 🫐> `C_free` |
22:48:59 | FromDiscord | <Elegantbeef> What's with the C prefix? |
22:49:40 | FromDiscord | <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:53 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "What's with the C": to reflect its C's stdlib existing functions |
22:49:54 | FromDiscord | <Elegantbeef> No cause the latter is invalid |
22:50:03 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "No cause the latter": duh |
22:50:12 | FromDiscord | <sOkam! 🫐> its a pseudo example beef |
22:50:22 | FromDiscord | <Elegantbeef> Well you said syntax, that's semantic analysis 😛 |
22:50:28 | FromDiscord | <jviega> There's no dealloc for strings specifically you mean? Cause I use dealloc() plenty 🙂 |
22:50:33 | FromDiscord | <Elegantbeef> a cstring is a more descriptive ptr char |
22:50:42 | FromDiscord | <Elegantbeef> There is no dealloc for strings, correct |
22:50:47 | FromDiscord | <sOkam! 🫐> yeah but what -more- is in there is what im asking in a way |
22:50:51 | FromDiscord | <Elegantbeef> It relies on the GC existing to dealloc |
22:51:20 | FromDiscord | <jviega> I'm sure one could write a dealloc for strings for no-mm mode 🙂 |
22:51:28 | FromDiscord | <Elegantbeef> You could of course |
22:52:04 | FromDiscord | <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:23 | FromDiscord | <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:44 | FromDiscord | <Elegantbeef> A cstring is just a `distinct ptr char` |
22:53:04 | FromDiscord | <sOkam! 🫐> then it would work to do what i said |
22:53:12 | FromDiscord | <sOkam! 🫐> if they are nothing else than a distinct |
22:54:29 | FromDiscord | <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:29 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4F3F |
22:55:55 | FromDiscord | <Elegantbeef> assuming the Quake engine uses `malloc` compile with `-d:useMalloc` |
22:56:05 | FromDiscord | <Elegantbeef> Thirdly why not run with `arc` in this case |
22:56:10 | FromDiscord | <sOkam! 🫐> yeah it does use malloc for its backend |
22:56:31 | FromDiscord | <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:49 | FromDiscord | <sOkam! 🫐> refactoring doesn't teach me their ways, it teaches me mine |
22:57:30 | FromDiscord | <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:32 | FromDiscord | <jviega> Can you get it running from C?? Why not start it before NimMain() is called? |
22:57:37 | FromDiscord | <sOkam! 🫐> they implemented a custom allocator for dynamic alloc, but that's built on top of malloc |
22:57:49 | FromDiscord | <sOkam! 🫐> In reply to @jviega "Can you get it": wdym? |
22:58:11 | FromDiscord | <jviega> You know you can run code before main() gets called if you need to no? |
22:58:25 | FromDiscord | <sOkam! 🫐> no clue |
22:58:31 | FromDiscord | <sOkam! 🫐> i thought main was the first line run |
22:59:02 | FromDiscord | <sOkam! 🫐> by that i mean C main |
22:59:03 | FromDiscord | <jviega> No |
22:59:19 | FromDiscord | <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:00 | FromDiscord | <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:30 | FromDiscord | <sOkam! 🫐> In reply to @jviega "I'm not a windows": and what do you run in there? |
23:01:43 | FromDiscord | <jviega> Whatever starts up your engine |
23:01:53 | FromDiscord | <sOkam! 🫐> the engine eats up the entire control flow |
23:02:03 | FromDiscord | <sOkam! 🫐> it doesn't even return from its main |
23:02:31 | FromDiscord | <sOkam! 🫐> its not a modern engine, created to work like a library |
23:02:47 | FromDiscord | <sOkam! 🫐> its just a monolithic app that you build -for- not -with- |
23:03:01 | FromDiscord | <sOkam! 🫐> the only allowed way to work with it is by `dlopen` |
23:03:35 | FromDiscord | <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:54 | FromDiscord | <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:48 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F3K |
23:06:42 | FromDiscord | <Elegantbeef> Well there is no `add` defined for them |
23:07:38 | FromDiscord | <Elegantbeef> Plus you likely need to pass the length of both around |
23:08:35 | FromDiscord | <sOkam! 🫐> but you used add for them? |
23:08:41 | FromDiscord | <sOkam! 🫐> or did you meant I should write it? |
23:09:10 | FromDiscord | <sOkam! 🫐> like, isn't `strcat` meant for just that? |
23:10:19 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F3L |
23:12:24 | FromDiscord | <Elegantbeef> Sure, except strcat returns a nil pointer and does not care about length |
23:12:27 | FromDiscord | <Elegantbeef> returns a pointer\ |
23:13:31 | FromDiscord | <Elegantbeef> The first parameter needs to be large enough to contain the concatenated string, so it's wholly awful 😄 |
23:13:40 | FromDiscord | <sOkam! 🫐> its C |
23:14:00 | FromDiscord | <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:57 | FromDiscord | <Elegantbeef> There is a less awful way you pass a length along |
23:15:35 | FromDiscord | <Elegantbeef> Take in a `char dest, int destLen, char src, int srcLen` |
23:15:55 | FromDiscord | <Elegantbeef> Although in the case of arg parsing you do not have a pascal string so need to call strlen on it |
23:16:33 | FromDiscord | <Chronos [She/Her]> https://paste.ecorous.org/ecesocihev this is... Painful |
23:16:47 | * | xmachina quit (Quit: WeeChat 4.0.4) |
23:16:55 | FromDiscord | <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:08 | FromDiscord | <Elegantbeef> I guess strcat\_s is what a modern C programmer would use in this regard |
23:17:22 | FromDiscord | <Elegantbeef> Just take in the first paramter as a typedesc |
23:17:34 | FromDiscord | <Elegantbeef> `Int128.decode("bleh")` |
23:19:29 | FromDiscord | <Chronos [She/Her]> That's an idea for sure |
23:19:34 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F3N |
23:19:52 | FromDiscord | <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:15 | FromDiscord | <Elegantbeef> `myModule.decode(int128, "bleh")` |
23:20:19 | FromDiscord | <Elegantbeef> If only modules existed |
23:20:20 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "But also, what if": does that something else use the -exact-same-parameters-and-types- ? |
23:20:28 | FromDiscord | <sOkam! 🫐> (edit) "?" => "in the same module?" |
23:20:38 | FromDiscord | <sOkam! 🫐> yeah exactly |
23:20:39 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "does that something else": Nope, but if another module does that |
23:20:47 | FromDiscord | <sOkam! 🫐> overloads + modules make nameclashing almost imposs |
23:20:48 | FromDiscord | <Chronos [She/Her]> Ig that's fine then |
23:21:03 | FromDiscord | <sOkam! 🫐> if another module does that, it can be qualified |
23:21:13 | FromDiscord | <Elegantbeef> Or you can force conversion |
23:21:39 | FromDiscord | <Elegantbeef> `(proc(_: typedesc[int128], _: string): int128)(decode)` |
23:22:22 | FromDiscord | <sOkam! 🫐> that's some C level syntax there lol. what is that doing exactly? |
23:22:43 | FromDiscord | <Elegantbeef> Converting an overloaded symbol to a type |
23:23:06 | FromDiscord | <sOkam! 🫐> ic |
23:23:20 | FromDiscord | <Elegantbeef> It's more meant for `let x = expr` |
23:23:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4F3O |
23:29:25 | FromDiscord | <Chronos [She/Her]> Nint doesn't have modulo- |
23:29:41 | FromDiscord | <Chronos [She/Her]> That's fun. :p |
23:29:41 | FromDiscord | <Elegantbeef> `mod` |
23:29:49 | FromDiscord | <Chronos [She/Her]> Nint doesn't implement it |
23:30:10 | FromDiscord | <Elegantbeef> Do you even need to mod the entire value? |
23:30:23 | FromDiscord | <Chronos [She/Her]> Wait apparently it does |
23:30:47 | FromDiscord | <Chronos [She/Her]> Why does my code use Int128 when I'm using Uint128- |
23:30:58 | FromDiscord | <Chronos [She/Her]> Nvm |
23:31:05 | FromDiscord | <Chronos [She/Her]> No, it doesn't implement it for Int128 apparently |
23:31:28 | FromDiscord | <Chronos [She/Her]> Wait it does |
23:31:30 | FromDiscord | <Chronos [She/Her]> Then why??? |
23:32:19 | FromDiscord | <Chronos [She/Her]> Okay well it works now |
23:32:21 | FromDiscord | <Chronos [She/Her]> Hm |
23:32:38 | FromDiscord | <Elegantbeef> Nim has a AI gaslighter |
23:33:28 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F3Q |
23:33:52 | FromDiscord | <Elegantbeef> Right, I assume length is actual size without the null terminator |
23:34:07 | FromDiscord | <sOkam! 🫐> kk then its just create(char, len) |
23:34:27 | FromDiscord | <sOkam! 🫐> whats different between Nim's malloc and --useMalloc, btw? |
23:35:39 | FromDiscord | <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:24 | FromDiscord | <sOkam! 🫐> what does it mean to give owneship up, in terms of what nim normally does? |
23:36:34 | FromDiscord | <Elegantbeef> To no longer own a resource |
23:36:46 | FromDiscord | <sOkam! 🫐> yeah, but what does it do normally instead |
23:36:48 | FromDiscord | <Chronos [She/Her]> Now how do I convert it to an `int` :/ |
23:36:58 | FromDiscord | <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:59 | FromDiscord | <sOkam! 🫐> is it using the GC, or expecting it, to work? |
23:37:05 | FromDiscord | <Elegantbeef> Since it does not know Nim's allocator strategy |
23:37:20 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "If you give a": i didn't know, thought they were usable. kk |
23:37:25 | FromDiscord | <Elegantbeef> If you give it a pointer with `-d:useMalloc` it'll just work fine |
23:37:32 | FromDiscord | <sOkam! 🫐> ic |
23:37:36 | FromDiscord | <Elegantbeef> The issue is the giving up ownership |
23:37:39 | FromDiscord | <sOkam! 🫐> sounds like useMalloc is the way then |
23:37:59 | FromDiscord | <sOkam! 🫐> how does create keep that ownership? is it with refs? |
23:38:04 | FromDiscord | <Elegantbeef> Pointers are just integers, but if something takes ownership it has to use the same allocator |
23:38:17 | FromDiscord | <Elegantbeef> Create doesnt have anything to do with ownerships |
23:38:28 | FromDiscord | <Elegantbeef> If you give a pointer to a program and it attempts to deallocate it, it ostensibly owns it |
23:38:44 | FromDiscord | <Elegantbeef> This has nothing to do with C or Nim |
23:38:58 | FromDiscord | <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:02 | FromDiscord | <Elegantbeef> if you expect a pointer is allocated with Nim's allocator and attempt to deallocate it the same issue arises |
23:39:32 | FromDiscord | <sOkam! 🫐> i thought pointers in nim were just normal C pointers, with no owner |
23:39:58 | FromDiscord | <Elegantbeef> you're missing what owner means |
23:39:58 | FromDiscord | <Elegantbeef> Owner is not a real thing |
23:40:09 | FromDiscord | <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:33 | FromDiscord | <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:44 | FromDiscord | <Elegantbeef> Remember allocators all behave differently and have different logic in them |
23:40:52 | FromDiscord | <sOkam! 🫐> ah because of the internal logic, kk |
23:41:04 | FromDiscord | <sOkam! 🫐> i thought it was some stuff that i was missing |
23:43:00 | FromDiscord | <Elegantbeef> Chronos you probably can just grab the `lo` after modulating it |
23:43:07 | FromDiscord | <Elegantbeef> Is that the right verb, who knows? |
23:43:45 | FromDiscord | <Elegantbeef> the `lo` field should be 0..32 after `mod` afaik |
23:43:49 | FromDiscord | <Elegantbeef> well 0..31 |
23:43:58 | * | krux02 joined #nim |
23:44:35 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F3R |
23:44:41 | FromDiscord | <Chronos [She/Her]> In reply to @chronos.vitaqua "Now how do I": Yeah, just doing `int` doesn't work |
23:44:57 | FromDiscord | <Chronos [She/Her]> Don't really wanna convert it to a string and then `parseInt` it |
23:44:59 | FromDiscord | <Elegantbeef> It means you probably should do `--threads:off` |
23:45:06 | * | krux02 quit (Remote host closed the connection) |
23:45:19 | FromDiscord | <sOkam! 🫐> why so? |
23:45:26 | FromDiscord | <sOkam! 🫐> how is it related? 🧩 |
23:45:30 | FromDiscord | <Elegantbeef> If only chronos read my messages |
23:45:38 | FromDiscord | <Elegantbeef> `channels_builtin` |
23:46:37 | FromDiscord | <sOkam! 🫐> so threads are not allowed on --d:useMalloc? |
23:46:56 | FromDiscord | <Chronos [She/Her]> I am blind |
23:47:10 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Chronos you probably can": Oooooh okay that makes sense |
23:47:11 | FromDiscord | <Elegantbeef> `--mm:none -d:useMalloc` is probably not supported, feel free to make an issue |
23:47:16 | FromDiscord | <Chronos [She/Her]> Thanks lol didn't see that |
23:47:37 | FromDiscord | <Elegantbeef> Well threads are allowed, but not like you want to use the Nim mechanisms for threading in a `--mm:none` world |
23:48:05 | FromDiscord | <sOkam! 🫐> i see |
23:49:13 | FromDiscord | <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:55 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4F3U |
23:54:08 | FromDiscord | <Chronos [She/Her]> !eval echo (compiles import pkg/nint128) |
23:54:10 | NimBot | Compile failed: /usercode/in.nim(1, 22) Error: expected: ')', but got: 'keyword import' |
23:54:13 | FromDiscord | <Chronos [She/Her]> Hold on |
23:54:17 | FromDiscord | <Chronos [She/Her]> !eval echo (compiles: import pkg/nint128) |
23:54:19 | NimBot | Compile failed: /usercode/in.nim(1, 17) Error: expression expected, but found 'keyword import' |
23:54:27 | FromDiscord | <Chronos [She/Her]> Fuck |
23:54:35 | FromDiscord | <Chronos [She/Her]> !eval echo compiles:↵ import pkg/nint128 |
23:54:37 | NimBot | Compile failed: /usercode/in.nim(1, 20) Error: invalid indentation |
23:54:43 | FromDiscord | <Chronos [She/Her]> Bruh |
23:55:45 | FromDiscord | <Chronos [She/Her]> wait... Apparently it doesn't |
23:55:46 | FromDiscord | <Chronos [She/Her]> Huh? |
23:55:53 | FromDiscord | <Chronos [She/Her]> Then why does it keep running code.... Sigh |
23:56:23 | FromDiscord | <Chronos [She/Her]> I'll just send my full code |
23:58:24 | FromDiscord | <Chronos [She/Her]> Okay well that works now??? |
23:58:31 | FromDiscord | <Chronos [She/Her]> That was so confusing |
23:58:35 | * | xmachina joined #nim |