<< 01-09-2023 >>

00:01:56FromDiscord<Chronos [She/Her]> What's a license that'd be good for saying 'you can use this in any way you want'
00:02:47FromDiscord<Elegantbeef> https://en.wikipedia.org/wiki/WTFPL
00:02:50FromDiscord<Elegantbeef> Or just MIT
00:06:53FromDiscord<Chronos [She/Her]> CC0 also works
00:29:05*jmdaemon joined #nim
00:29:44FromDiscord<Chronos [She/Her]> Wait can I not convert between int types at runtime!
00:29:46FromDiscord<Chronos [She/Her]> ?
00:30:14FromDiscord<Elegantbeef> of course you can
00:30:32FromDiscord<Chronos [She/Her]> Wanted to do `int(num div 32.T)` but I'm getting a type mismatch
00:30:49FromDiscord<Chronos [She/Her]> `T` being a `uint` in this case and num is also the same type as T
00:33:02FromDiscord<Chronos [She/Her]> Pls explain all-knowing beef-
00:33:17FromDiscord<Elegantbeef> No clue you did not provide an error message for me to even guess you just said words
00:33:21FromDiscord<Elegantbeef> I can say things all day long
00:35:05FromDiscord<Chronos [She/Her]> Literally just `/data/data/com.termux/files/home/Supernovae/crockfordbase32/src/crockfordb32.nim(21, 25) Error: type mismatch: got 'int' for 'int(num div T(32))' but expected 'uint'`-
00:36:08FromDiscord<Elegantbeef> You're returning `int` but need `uint`
00:36:37FromDiscord<Chronos [She/Her]> Wait
00:36:39FromDiscord<Chronos [She/Her]> Ah shit
00:36:47FromDiscord<Chronos [She/Her]> I am so dumb
00:37:08FromDiscord<Chronos [She/Her]> Wait no I'm not
00:37:13FromDiscord<Chronos [She/Her]> I'm not returning a uint
00:37:33FromDiscord<Chronos [She/Her]> Nvm I'm still fucking stupid lol
00:37:39*xmachina quit (Quit: WeeChat 4.0.4)
01:04:43FromDiscord<Chronos [She/Her]> Trying to create tests now but doing that is a bit harder bc I can't figure out how to reliably add that to the path
01:04:56FromDiscord<Chronos [She/Her]> (Since it's not a project dep, no way to have optional deps in Nimble afaik)
01:11:02*azimut joined #nim
01:43:29FromDiscord<Chronos [She/Her]> Anyone have a GitHub Action for releasing GitHub Pages for Nim docs?
01:43:35FromDiscord<Chronos [She/Her]> For my package
01:44:05FromDiscord<Chronos [She/Her]> @Phil sorry to ping you, but ik you did docs stuff for Owlkettle, do you have any/know of a pre-made action for this?
01:47:53FromDiscord<sOkam! 🫐> Is there any difference between: `array[4, cchar]` and `cstring "123"`?↵does an array in Nim have any extra information added to it, or is it fully compatible with a `char thing[4]` in C?
02:10:25FromDiscord<Elegantbeef> cstrings are just pointers
02:10:34FromDiscord<Elegantbeef> C arrays are odd
02:24:09FromDiscord<sOkam! 🫐> what are Nim arrays when it comes to what C understands of them?
02:24:25FromDiscord<Elegantbeef> They're static arrays just the same as C arrays
02:28:57FromDiscord<sOkam! 🫐> so if I cast `array[4, cchar]` to `cstring`, assuming the array ends in `'\0'`, they are gonna behave the same?
02:30:34FromDiscord<Elegantbeef> Yes
02:30:41FromDiscord<Elegantbeef> Well no
02:30:50FromDiscord<Elegantbeef> `ptr array[4, cchar]`
02:31:41FromDiscord<Chronos [She/Her]> Submitted my thing as a package! (It works)
02:33:10FromDiscord<sOkam! 🫐> ptr array?
02:33:17FromDiscord<sOkam! 🫐> are arrays not ptr?
02:34:52FromDiscord<Elegantbeef> Nope
02:35:06FromDiscord<sOkam! 🫐> then arrays are not the same as C arrays
02:35:42FromDiscord<Elegantbeef> I mean they are, but they're not
02:36:04FromDiscord<sOkam! 🫐> basically, as its usual in C, `char thing[N]` and `char ` are sent interchangably everywhere
02:36:29FromDiscord<sOkam! 🫐> so i have separate code that defines a char array of N, but that is sent to a function that wants a ptr char
02:36:39FromDiscord<sOkam! 🫐> so... i mapped it as a cstring, but its technically not
02:36:48FromDiscord<sOkam! 🫐> and don't know how to correlate them
02:37:09FromDiscord<Elegantbeef> use the array but make it explicitly pass by `ptr T`
02:37:25FromDiscord<Elegantbeef> Or `var T`
02:37:39FromDiscord<sOkam! 🫐> then I cannot pass a cstring to it, or assign a cstring to the input
02:37:49FromDiscord<Elegantbeef> Well you do not have a cstring
02:37:51FromDiscord<Elegantbeef> You have an array
02:37:56FromDiscord<sOkam! 🫐> the problem is in the conversion, i can change the argument of the importc no problem, but not convert
02:38:13FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "Well you do not": i have both, they are used interchangably
02:38:24FromDiscord<sOkam! 🫐> C is type unsafe 🤷‍♂️
02:39:01FromDiscord<Elegantbeef> Right but you're not wrapping it as C so you do not have to live with the silly lack of helpful type information
02:39:08FromDiscord<sOkam! 🫐> if I can `cast[one](other)` then all good. but I wanted to know what is compatible with what
02:39:36FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "Right but you're not": definitely, but the code is full of array[char] and ptr char everywhere
02:39:57FromDiscord<Chronos [She/Her]> https://github.com/nim-lang/packages/pull/2699 anyone with perms? Flutters eyelashes
02:40:26FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "Right but you're not": How would you map them?
02:40:40FromDiscord<sOkam! 🫐> the input function requires a size and a char
02:40:49FromDiscord<sOkam! 🫐> and its built with cstrings in my code
02:41:24FromDiscord<sOkam! 🫐> i mapped the char as a cstring.... but... that is taking an array[cchar] as input in reality
02:42:43FromDiscord<sOkam! 🫐> This: https://github.com/JBustos22/oDFe/blob/fa9eff61890dbbaca896c77816cce3c01a579a6b/code/unix/unix_main.c#L881↵And this: https://github.com/JBustos22/oDFe/blob/fa9eff61890dbbaca896c77816cce3c01a579a6b/code/unix/unix_main.c#L901-L910↵Is what I mean
02:43:57FromDiscord<Elegantbeef> The first is a `array[YourSize, cchar]`
02:44:04FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F4k
02:44:23FromDiscord<sOkam! 🫐> and if I want to send a cstring, i need to know how to convert cstring to array[N, cchar]
02:44:34FromDiscord<sOkam! 🫐> (edit) "cchar]" => "cchar], or the other way around"
02:44:39FromDiscord<Elegantbeef> Right `con_title` should be a `array[Size,Cchar]`
02:44:46FromDiscord<Elegantbeef> `cast[cstring](myArr.addr)` if you want to use a cstring, but don't
02:45:07FromDiscord<sOkam! 🫐> so they are compatible by casting? that's what I needed to know
02:45:16FromDiscord<sOkam! 🫐> what would you use as alternative to that?
02:45:40FromDiscord<Elegantbeef> The array type
02:45:54FromDiscord<sOkam! 🫐> ?
02:46:19FromDiscord<Elegantbeef> `commadLine: cstring, title: array[Size, cchar], ...`
02:46:19FromDiscord<sOkam! 🫐> then how do you get a cstring to an array[cchar] if you don't cast?
02:46:39FromDiscord<sOkam! 🫐> but you are saying to use array... and they are -mixed in the C code-
02:46:52FromDiscord<sOkam! 🫐> they are mixing them because its C and they are compatible
02:47:00*dza quit (Ping timeout: 244 seconds)
02:47:09FromDiscord<sOkam! 🫐> all im asking is what would you do if you say to not mix them
02:48:21FromDiscord<Elegantbeef> Use the correct type where needed and not cast
02:51:07FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "Use the correct type": beef, but they are used interchangeably in the code im translating, because that is legal in C
02:51:20FromDiscord<sOkam! 🫐> I don't want to do type-unsafe stuff either
02:57:51FromDiscord<sOkam! 🫐> i guess the function should take a `ptr cchar` after all 🤷‍♂️
03:02:52*rockcavera quit (Remote host closed the connection)
03:05:41*rockcavera joined #nim
03:57:43*cm quit (Quit: Bye.)
04:06:55*cm joined #nim
04:26:53FromDiscord<Phil> In reply to @chronos.vitaqua "<@180601887916163073> sorry to ping": In general?↵Sure, look at basically any of my larger library projects
04:30:06FromDiscord<Phil> This can act as example:↵- Snorlogue docs: https://github.com/PhilippMDoerner/Snorlogue/blob/main/.github/workflows/docs.yml↵- nimword docs: https://github.com/PhilippMDoerner/nimword/blob/main/.github/workflows/docs.yml↵- Step 5 of my nim-setup for a doc-compilation workflow: https://github.com/PhilippMDoerner/NimSetup/blob/main/Github%20Project%20Setup.md
04:30:39FromDiscord<Phil> (edit) "This" => "These"
04:32:55FromDiscord<Phil> It's less pre-made actions and more you need to provide your own workflow files
04:45:17*disso-peach joined #nim
04:45:49*disso-peach quit (Client Quit)
06:01:38*genr8eofl quit (Remote host closed the connection)
06:01:57*genr8eofl joined #nim
06:07:07*advesperacit joined #nim
06:19:02*cm_ joined #nim
06:19:40*termer_ joined #nim
06:21:12*advesperacit_ joined #nim
06:25:54*advesperacit quit (*.net *.split)
06:25:54*cm quit (*.net *.split)
06:25:54*marcus quit (*.net *.split)
06:25:54*termer quit (*.net *.split)
06:25:54*cm_ is now known as cm
06:34:09*marcus joined #nim
06:44:49*PMunch joined #nim
06:47:15advesperacit_Is there a way to check if a pointer points to allocated memory and avoid segfaulting?
06:50:40*ntat joined #nim
06:51:13PMunchWell, you can always set up a handler for the SIGSEGV signal before access, then attempt the access and record the result
06:51:50termer_advesperacit_ Not procedurally
06:52:21advesperacit_myptr == nil was what I needed, I must have misspelled my real variable name somehow
06:52:38termer_You can set up sigsegv handling like PMunch said, but other than that, you just have to write things safely
06:52:43FromDiscord<odexine> that only checks if the pointer points to an address
06:52:54FromDiscord<odexine> that doesnt check if the address can be accessed by the process
06:52:57termer_advesperacit_ use isNil for that
06:53:06termer_but it'll only check if it's nil
06:53:24termer_you can't use it to avoid use after free
06:53:45termer_fortunately, if you don't use unsafe lang features, you should have no use after free problems
06:54:02*termer_ quit (Quit: ZNC 1.7.5+deb4 - https://znc.in)
06:54:27*termer joined #nim
06:55:11termertest
06:55:13termerI'm back baby
06:55:52advesperacit_thanks, I'll see if it works as I want it to, otherwise I'll have to rethink
06:58:12termerbest of luck
07:01:02PMunchadvesperacit_, you probably don't want to check if memory is accessible, that smells like a logic error
07:02:52termerlet me tell you guys about the funniest function I wrote today
07:03:22termerC function that adds 2 uint8_t values together and returns it as an int
07:03:23FromDiscord<odexine> lets hear it then
07:03:32termerThen I made a wrapper
07:03:34FromDiscord<odexine> what about that is funny
07:03:54termerproc add(a: auto, b: auto): int
07:03:57PMunchI don't think he was done :P
07:04:15termerthen you can use it to pass any value in
07:04:28termersince everything is at least a byte, you can use it on anything lol
07:04:50termerI found it mildly entertaining to put various values in
07:05:09termerit turns out, "abc" added with 1 is 4 in Nim
07:05:31termerfigures since I assumed the length was the first value in the string struct
07:05:57termerauto keyword is funny to use in a wrapper proc
07:06:03PMunchThat is actually pretty funny
07:06:26termerthanks
07:06:31termerI thought so myself
07:06:40termerthat's what I did while bored at work
07:15:33*kenran joined #nim
07:30:05PMunchHmm, anyone here played around with vimspector?
07:43:24termernope, no idea what that is
07:54:30PMunchBasically a debugger UI for Vim
08:38:24*rockcavera quit (Remote host closed the connection)
08:47:35NimEventerNew thread by miran: This Month with Nim: July and August 2023, see https://forum.nim-lang.org/t/10452
08:50:20*nexus joined #nim
08:50:37*nexus quit (Client Quit)
09:15:55*PMunch quit (Ping timeout: 245 seconds)
09:24:11*ntat quit (Quit: leaving)
09:28:02*azimut quit (Remote host closed the connection)
09:28:29*azimut joined #nim
09:29:47FromDiscord<firasuke> Nim is just a joy to write in!
09:37:12*PMunch joined #nim
09:39:58FromDiscord<haoyu233> Take over the memory allocated for seq, maybe we can do something interesting
09:40:35FromDiscord<haoyu233> sent a code paste, see https://play.nim-lang.org/#ix=4F5Z
09:41:31FromDiscord<haoyu233> just for fun
09:42:56FromDiscord<haoyu233> sent a code paste, see https://play.nim-lang.org/#ix=4F62
09:49:47FromDiscord<toma400> I was a bit sceptical about new `type mismatch` stacktrace upgrade, but it's actually pretty amazing after quickly getting used to ❤️ ↵The only thing I wish was for more "smart" stacktrace, so when you use `.add()` on Array, for example, it doesn't complain only on type mismatch, but also point you to that arrays are not mutable/do not have the function.↵It's small thing, but each of such small issues is why I even complain on s
09:52:06*ntat joined #nim
10:05:29*ntat quit (Quit: leaving)
10:07:36*_________ quit (Quit: leaving)
10:09:18*_________ joined #nim
10:36:30NimEventerNew thread by arnetheduck: Unittest2 face lift, see https://forum.nim-lang.org/t/10453
10:46:47*_________ quit (Quit: leaving)
10:47:27FromDiscord<System64 ~ Flandre Scarlet> I sometimes need to compute many waveforms↵How can I reach maximum parallelism here for the sequence part? https://media.discordapp.net/attachments/371759389889003532/1147120529132761158/wavExport.nim
10:48:12*_________ joined #nim
10:48:37FromDiscord<firasuke> I am unable to register at the forum, why is that?
10:53:57FromDiscord<odexine> Have you done so before?
10:59:53FromDiscord<System64 ~ Flandre Scarlet> Is it possible to run multiple threads at once and to wait them all?
11:01:35PMunchYes
11:01:50FromDiscord<cosmicstella> hello, i have been using nim quite often in the last few weeks, but i have not found any vscode extension or separate ide/editor for it that actually works and doesn't break randomly.
11:01:56FromDiscord<cosmicstella> what is your suggestion?
11:02:21PMunchHmm, I thought the VSCode extension by Saem was about as good as it got for Nim
11:02:29FromDiscord<cosmicstella> for example, i have tried several vscode extensions and hover information just doesn't work, when i save a file other than the main file all the errors get suppressed, etc
11:02:48FromDiscord<cosmicstella> In reply to @PMunch "Hmm, I thought the": yeah sadly i haven't been able to find anything better
11:03:30PMunchThe IDE tooling support for Nim is unfortunately quite bad.. Personally it's not a big issue since I rarely use those kind of features anyways. But it would certainly be nice to have.
11:03:39PMunchCurrently I'm using NimLSP in Vim which works okay
11:04:45FromDiscord<cosmicstella> does it have autocomplete?
11:05:24PMunchIt has some kind of autocomplete I think, as I said I don't really use it much
11:06:56FromDiscord<Phil> In terms of autocomplete the intellij extension is better, but apparently that has its own issues
11:07:27FromDiscord<Phil> The main issue here being is that basically no authority bar the compiler really can know what symbols are available where and when and how they will screw you
11:07:56FromDiscord<Phil> That means the only tooling that can reliably hand you that information is nimsuggest and that isn't all that fast as it pretty much just goes through the compiler
11:08:08FromDiscord<Phil> (edit) "That means the only tooling that can reliably hand you that information is nimsuggest and that isn't all that fast as it pretty much just goes through the compiler ... " added "from what I understand"
11:08:17FromDiscord<vindaar> sent a long message, see http://ix.io/4F6q
11:08:19FromDiscord<vindaar> your real bottlenecks currently are
11:09:15FromDiscord<cosmicstella> In reply to @isofruit "That means the only": the speed doesn't matter, can i slap nimsuggest on an editor with an extension and be fine?
11:09:39FromDiscord<Phil> nimsuggest pretty much is what nimsaem is using afaik
11:10:30FromDiscord<Phil> So the bits and bobs where it isn't capable that likely is because it's not using the compiler in those places or sth
11:12:27FromDiscord<System64 ~ Flandre Scarlet> In reply to @vindaar "it's a bit hard": Synthesize is an expensive operation
11:12:43FromDiscord<System64 ~ Flandre Scarlet> It computes the entire modular synth
11:12:48FromDiscord<odexine> In reply to @cosmicstella "the speed doesn't matter,": The buggy part is nimsuggest
11:13:30FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "The buggy part *is*": I also encounter problems with ORC
11:24:34FromDiscord<mratsim> In reply to @sys64 "I sometimes need to": `synth.synthesize` doesn't look like it's thread-safe.↵↵Otherwise you can use weave parallelFor
11:26:01FromDiscord<System64 ~ Flandre Scarlet> In reply to @mratsim "`synth.synthesize` doesn't look like": I can clone the synth
11:26:19FromDiscord<mratsim> In reply to @sys64 "I sometimes need to": and f.write isn't either.↵↵Here you can use data parallelism but only if output can be written in very specific positions in an array. No appending to file or calling a stateful function (which synth.synthesize looks like)
11:28:01FromDiscord<mratsim> in that case you can do wuick prototyping with OpenMP with system.`||`, or use Weave (you need to passc:-fopenmp and passl:-fopenmp if you use OpenMP),↵↵Example: https://github.com/mratsim/Arraymancer/blob/e2df3dd7509588e3a863c690389649ced790344a/src/arraymancer/laser/openmp.nim#L222-L223
11:28:21FromDiscord<mratsim> (edit) "wuick" => "quick"
11:29:09FromDiscord<mratsim> In reply to @sys64 "I can clone the": for f.write, seems you write 3 bytes for sure, so preallocate an array of the appropriate size ahead of time
11:30:04FromDiscord<System64 ~ Flandre Scarlet> In reply to @mratsim "for f.write, seems you": The synth has an array that contains the synthesized waveform
11:43:06FromDiscord<firasuke> In reply to @odexine "Have you done so": Yes and I deactivated or deleted my account in order to create a new one
11:44:04FromDiscord<odexine> You’re gonna have to contact a forum moderator for that
11:44:28FromDiscord<firasuke> Oh ok, do we have any forum moderators here?
11:44:29FromDiscord<odexine> @PMunch or @Phil I believe are forum moderators, not sure
11:45:07PMunchfirasuke, what's the issue?
11:45:33FromDiscord<firasuke> In reply to @PMunch "<@248208053952970752>, what's the issue?": oh I am unable to register on the forum
11:45:43PMunchUnable how?
11:46:12FromDiscord<firasuke> I had an old account that I deleted, now I am trying to create a new account that has the same email address as the previous deleted account
11:47:08PMunchDo you get an error?
11:48:15FromDiscord<firasuke> the fields just turn red without explaining why
11:49:21PMunchCould you PM me the e-mail address you where trying to use?
11:51:54FromDiscord<firasuke> alright, just did that
11:53:52PMunchYou did?
11:58:36*jmdaemon quit (Ping timeout: 248 seconds)
11:58:58FromDiscord<odexine> He did on your discord account I assume
12:03:36*ntat joined #nim
12:04:22PMunchSo did I, but I can't see anything there
12:06:33FromDiscord<firasuke> oh
12:06:50FromDiscord<firasuke> I can't PM your bot account xD
12:07:07FromDiscord<firasuke> @PMunch this
12:07:09FromDiscord<Phil> @pmunch His discord account
12:07:50FromDiscord<odexine> Why are there TWO
12:08:03FromDiscord<firasuke> I have no idea, these are two different accounts
12:10:19PMunchI don't know either, at some point I just suddenly had two accounts..
12:10:32FromDiscord<pmunch> This is the one I use
12:12:25PMunchHmm, it seems the forum is struggling. It throws a 502 Bad Gateway when I try to make a new account..
12:12:47PMunch@Araq, could you have a look? I believe you're the only one with admin access to the forum at the moment.
12:14:02FromDiscord<firasuke> I also just received an email confirmation from the forum, when i tried to activate it it showed this
12:14:15FromDiscord<firasuke> https://media.discordapp.net/attachments/371759389889003532/1147142373583896646/image.png
12:15:13PMunchHmm, strange
12:15:19PMunchSomething is wrong with the forum basically
12:15:37PMunchBut I think Araq is the only person with the level of access required to fix it
12:22:43FromDiscord<firasuke> I see
12:23:35FromDiscord<firasuke> Can someone create a new forum post indicating that registration is not possible with "Unknown Error Occurred" when trying to sign up, so that Araq sees it?
12:25:10FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4F6B
12:52:25PMunchI already pinged him here firasuke, so he should see it
12:53:58PMunchI've also contacted him in the moderators chat, so he should be aware of it
12:54:21FromDiscord<System64 ~ Flandre Scarlet> Can a threaded proc return a value?
12:55:19PMunchNope
12:56:54FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Nope": Oh, that's quite a problem
12:57:19FromDiscord<firasuke> In reply to @PMunch "I've also contacted him": Oh ok, thanks
12:59:21PMunchSystem64_~_Flandre_Scarlet, not really. You set up a channel or add the resulting data to a shared data structure
13:03:37FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4F6Q
13:04:52FromDiscord<odexine> Yes but it will be a copy
13:05:31FromDiscord<odexine> Not sure of this but it also might be quite slow since that’s a pretty large object
13:08:44FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "Not sure of this": In worst cases I can only pass the outputInt array
13:08:51PMunchYeah that's a pretty substantial object.. You could definitely pass it through a channel though..
13:09:28FromDiscord<odexine> In reply to @sys64 "In worst cases I": That only roughly 1/3rds the size, still pretty big
13:09:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "That only roughly 1/3rds": So I can pass it by reference?
13:10:17PMunchIt all depends on how your program works
13:10:21FromDiscord<odexine> Doing that in a threaded context is tricky
13:10:35PMunchI guess the Malgolgia Locker type could help you
13:10:44PMunchOr a UniqueRef?
13:21:42PMunchRight, so it seems to be a known bug where you use the same name + email address as a previously registered user
13:21:46PMunchhttps://github.com/nim-lang/nimforum/issues/346
13:23:59FromDiscord<firasuke> oh ok
13:29:26FromDiscord<Chronos [She/Her]> In reply to @isofruit "These can act as": Makes sense, thank you!
13:32:23*ntat quit (Quit: leaving)
13:37:27FromDiscord<griffith1deadly> In reply to @PMunch "Yeah that's a pretty": threading/channels is not good for this?
13:48:08PMunchWell I believe they copy the object to ensure that it's thread safe
13:48:20PMunchSo with large objects you will incur quite a bit of overhead
13:48:49PMunchBut you might be able to pass a UniqueRef over a channel without issues.
13:51:35FromDiscord<griffith1deadly> In reply to @PMunch "Well I believe they": doesn't isolate involve moving an object?
13:52:39PMunchPossibly, I don't remember the details
13:53:46FromDiscord<griffith1deadly> if so, is this a good way to transfer large objects?
14:07:02*rockcavera joined #nim
14:09:23FromDiscord<firasuke> With Nim 2.0 and ORC being the default memory management strategy, is it still advised to use the `-d:useMalloc` switch, also what's the difference between specifying `--gc:orc` and `--mm:orc` (which is the newer flag?), also where can I find the latest documentation about the nim compiler options, I can't seem to find the `--gcc.exe` anywhere?
14:11:23FromDiscord<odexine> mm is newer
14:11:35FromDiscord<demotomohiro> I think you need to use `-d:useMalloc` only when --os:standalone or use valgrind.
14:12:03FromDiscord<demotomohiro> iirc, --gc and --mm is same.
14:12:26FromDiscord<odexine> it is the same but mm is the newer flag
14:12:36FromDiscord<odexine> i do not know if gc will be removed in a future version
14:13:22FromDiscord<vindaar> https://nim-lang.github.io/Nim/nimc.html
14:13:40FromDiscord<firasuke> ok cool, what if I am on a Linux system that uses `mimalloc` as it's default memory allocator, will passing `useMalloc` allow my Nim program to benefit from that, or it has no effect and `LD_PRELOAD` already does the job
14:13:54FromDiscord<firasuke> In reply to @odexine "it is the same": thanks
14:14:01FromDiscord<firasuke> In reply to @vindaar "https://nim-lang.github.io/Nim/nimc.html": thanks for the link
14:14:23FromDiscord<odexine> In reply to @firasuke "ok cool, what if": you will need to use usemalloc and ld_preload, nim's allocator uses mmap iirc
14:15:23FromDiscord<firasuke> oh ok, thanks for pointing that out
14:16:00*PMunch quit (Quit: Leaving)
14:23:12*blop quit (Ping timeout: 246 seconds)
14:25:40*blop joined #nim
14:27:40*kenran quit (Quit: ERC 5.6-git (IRC client for GNU Emacs 30.0.50))
14:32:19*blop_ joined #nim
14:34:24*blop quit (Ping timeout: 246 seconds)
14:38:31FromDiscord<enthus1ast> @.elcritch\: In figuro, it seems that it currently emits a click event on a "button down", i think it would be better when a click event is emitted on a "button up", the biggest benefit is, that when you've clicked wrong, the user has the chance to move the mouse from the button and release the click without activating the buttons action.
14:39:24FromDiscord<enthus1ast> the KFC pos system i've suported for years had exactly this issue....
14:42:14FromDiscord<enthus1ast> this was especially problematic since it was a touch based system. The older kfc system did not had this issue, and this one bug/issue created a lot of service calls \:)
14:46:26NimEventerNew Nimble package! crockford-base32 - A simple implementation of Crockford Base32., see https://github.com/Yu-Vitaqua-fer-Chronos/Crockford-Base32-Nim
15:03:13FromDiscord<odexine> thats a name
15:16:58termerTo touch on -d:useMalloc, I use it often because I prefer memory to be returned to the OS often, and Nim's allocator doesn't do that as much
15:17:16termerHowever, every once in a while you'll see different behavior because of it
15:17:35termerso far I've found one library that doesn't compile with that flag (nim-sys)
15:18:10FromDiscord<jviega> You do realize with virtual memory that's not a big deal. freed pages eventually fall out of the page table and don't show back upswapped in
15:18:23FromDiscord<jviega> (edit) "upswapped in" => "up"
15:22:31FromDiscord<firasuke> In reply to @termer "To touch on -d:useMalloc,": oh ok, thanks for your insight on this
15:22:41FromDiscord<Chronos [She/Her]> In reply to @NimEventer "New Nimble package! crockford-base32": Eyyyy
15:22:56FromDiscord<Chronos [She/Her]> In reply to @odexine "thats a name": The package name is crockfordb32 when importing lol
15:23:01termerjviega, I'm not an expert on how it works
15:23:18FromDiscord<Chronos [She/Her]> I'm probably gonna make a ULID impl but there's already one that exists, so idk what to name mine lil
15:23:20FromDiscord<Chronos [She/Her]> Lol
15:23:46termerWhat I do know is that a bunch of memory on the Nim allocator wasn't been returned to the OS whenever I used it and it confuse me for a long time making me think it was a leak
15:24:38FromDiscord<jviega> Yeah, you'll waste cycles returning memory, which is why Nim won't do it often. It doesn't actually make a significant difference.
15:25:21termerIt does for me because I have a poverty mindset when it comes to RAM lol
15:25:47FromDiscord<jviega> In fact, when you malloc, you tend to have very fragmented memory anyway, keeping more pages resident than needed. That's why plenty of garbage collectors use memory pools, and return entire pools.
15:26:04termerI do know that much
15:26:38termerwhat I can say though is that Nim often waits a very long time to return anything, and you can end up with huge memory usage in a short period of time
15:27:06FromDiscord<jviega> Compile with -release, the binaries tend to be MUCH faster
15:28:03termerI never said it affected speed
15:28:20FromDiscord<jviega> Oh, I misread that
15:28:34FromDiscord<jviega> "memory usage" is VIRTUAL memory usage, not physical memory usage
15:28:48termerwhat do you mean
15:28:55FromDiscord<jviega> Once physical memory fills up, the OS swaps out the least-recently used stuff
15:29:09termerThe RSS is higher with Nim allocator
15:29:14FromDiscord<jviega> It's still "in memory" but it's not in memory until it gets swapped back in
15:29:15termerthat's all I'm saying here
15:29:54termerThese days I don't worry too much about memory memory management though since 1. I avoid allocations whenever possible for performance reasons and 2. I don't use asyncdispatch anymore lol
15:30:00FromDiscord<jviega> So I'm saying an app "using a lot of memory" is not an issue whatsoever
15:30:15FromDiscord<jviega> Because it's all about how much is resident when memory is full
15:30:40FromDiscord<Chronos [She/Her]> `nint` doesn't seem to support swapping the endian of an Int128 :/
15:31:06FromDiscord<odexine> what is nint
15:31:07FromDiscord<Chronos [She/Her]> https://rockcavera.github.io/nim-nint128/nint128/nint128_endians.html
15:31:10FromDiscord<odexine> where is it from more specifically
15:31:18termerFor a long time I worked with VMs with 1GiB of less of RAM, so that sort of thing mattered
15:31:24FromDiscord<Chronos [She/Her]> nint128, implements 128-bit integers
15:31:28termeranything that wasn't hot would find itself in swap
15:31:38FromDiscord<Chronos [She/Her]> Nint is just the package
15:31:42FromDiscord<odexine> In reply to @chronos.vitaqua "`nint` doesn't seem to": `swapBytes`
15:31:56FromDiscord<jviega> Yeah, back when ram was cheap, bus speeds were slow, and hard drives didn't have caches
15:32:14FromDiscord<jviega> I remember it. That's a non-issue in the real world.
15:32:28FromDiscord<Chronos [She/Her]> In reply to @odexine "`swapBytes`": Only for UInts
15:32:31termerI don't think RAM was ever cheap
15:32:32FromDiscord<jviega> Erm, was NOT cheap
15:32:48FromDiscord<Chronos [She/Her]> I'm doing it on a signed int
15:32:51termerok yeah I thought you were fucking with me
15:32:58FromDiscord<jviega> per MB it's super cheap compared to way back when, are you kidding me
15:33:12termerit is NOW
15:33:40termerLike I said, my mindset is that of a kid without a lot of money to spare for larger VMs
15:34:02FromDiscord<jviega> Not a reason to go give people bad advice 🙂
15:34:03termerso I just allocated a lot of swap and traded CPU for less RAM usage
15:34:14termerBad advice? I just said the natural consequence
15:34:19termerI didn't say to use it
15:34:48termerBut your RSS will be lower with malloc, and it'll return the memory to the OS more often, that's just itd behavior
15:34:54termerI'm not saying to use it
15:35:05FromDiscord<jviega> The natural consequence is you spend more cycles returning memory, with no difference in performance due to cache misses
15:35:24termerRight
15:36:24termerNot related to the reasons I said, but anyone working on a nonstandard OS or no OS at all like in the case of embedded will need to use malloc
15:36:30termerbut that's not a problem most will face
15:37:51termerjviega, If you want to talk traumatic memory experiences, try running multiple JVMs on the same 512MiB VM
15:37:53FromDiscord<odexine> non-posix + uncommon would need malloc
15:37:57termernow THAT was hell
15:38:20termerThat's why I really appreciate the fact that Nim heavily prefers stack
15:38:32termerit's a lot more reliable that way
15:38:40termererr, predictable
15:48:07*ntat joined #nim
17:18:03*krux02 joined #nim
17:20:02FromDiscord<System64 ~ Flandre Scarlet> > Thread 1 received signal SIGTRAP, Trace/breakpoint trap.↵What is SIGTRAP?
17:27:34*ntat quit (Ping timeout: 250 seconds)
17:38:58termerhttps://en.wikipedia.org/wiki/Signal_(IPC)
17:56:34FromDiscord<Prestige> Since nim 2.0 it seems I can't cast a string to `Pcuchar`, is there a work around for this?
17:56:58FromDiscord<Prestige> ah the playground is down again
17:59:51FromDiscord<System64 ~ Flandre Scarlet> The worst one https://media.discordapp.net/attachments/371759389889003532/1147229345795027005/image.png
18:20:20FromDiscord<demotomohiro> In reply to @avahe "Since nim 2.0 it": Why dont you convert string to cstring?
18:21:54FromDiscord<Prestige> Would that allow me to use it as a Pcuchar?
18:23:41FromDiscord<sOkam! 🫐> cstring is ptr cchar, not cuchar 🤔
18:24:01FromDiscord<demotomohiro> `Pcuchar` is `ptr cuchar`?
18:24:09FromDiscord<Prestige> Yeah
18:25:22FromDiscord<demotomohiro> Even if you cast a string to `ptr cuchar`, you dont get a vaild pointer.
18:26:20FromDiscord<demotomohiro> I think you need to do `cast[ptr cuchar](someString.cstring)`.
18:30:52FromDiscord<Prestige> hmm using cstring seems to get rid of those errors at least
18:36:56FromDiscord<Chronos [She/Her]> I'm debating on if I should store a random value as a string or as a big int/int128
18:43:42FromDiscord<demotomohiro> I think it depends on what to do with the random value.
18:58:26FromDiscord<jviega> Do you mean "random value" literally?
18:58:50FromDiscord<jviega> What are you going to do w/ it?
19:04:11FromDiscord<Chronos [She/Her]> In reply to @jviega "Do you mean "random": Yep, from urandom
19:05:02FromDiscord<Chronos [She/Her]> In reply to @jviega "What are you going": ULID requires it in the format, I'll have to use it as an int, it seems like
19:05:23FromDiscord<jviega> I have a library to produce ulids
19:05:27FromDiscord<jviega> It does all that
19:06:41FromDiscord<jviega> https://github.com/crashappsec/nimutils
19:06:54FromDiscord<jviega> If you want a random ulid just call getUlid()
19:07:49FromDiscord<jviega> You can also do: `secureRand[uint64]()` or `randString(12)`
19:13:40FromDiscord<jviega> There's basically no docs right now, but the ulid stuff is in encodings.nim where the b32 implementation is
19:16:33FromDiscord<Chronos [She/Her]> Oh epic!
19:16:47FromDiscord<Chronos [She/Her]> I just made a crockford base32 impl yesterday lmao
19:21:13FromDiscord<jviega> That has both variants
19:26:29FromDiscord<.elcritch> In reply to @enthus1ast "<@703717429230174229>\: In figuro, it": oh good idea! That's an awesome insight from KFC of all places 🤣 Yah I've used that trick a few times myself. You're quick, I literally just got clicking wired in last night! Getting "click out" working was challenging. Events are one of the trickier things to get right. BTW, feel free to ping me in appdev channel, less traffick there
19:33:54FromDiscord<Chronos [She/Her]> In reply to @jviega "That has both variants": Neat!
19:34:14FromDiscord<Chronos [She/Her]> I'll likely just finish my own out of wanting to actually contribute more things in Nim lol
19:34:52FromDiscord<sOkam! 🫐> @System64 ~ Flandre Scarlet was this the french error you were getting? https://media.discordapp.net/attachments/371759389889003532/1147253257635381431/image.png
19:37:51*dza joined #nim
19:46:45FromDiscord<flyx> hi folks! I'm getting `Error: undeclared identifier: 'shallowCopy'` from the cligen package, how can that happen? that's a symbol from `system` and should always be available, right?
19:52:46FromDiscord<jviega> It’s not in 2.0 iirc
19:53:05FromDiscord<jviega> Or at least not with all memory managers
19:57:13FromDiscord<Prestige> I think you need to pass --deepcopy:on ?
20:01:18*azimut quit (Ping timeout: 246 seconds)
20:04:39FromDiscord<flyx> nope, it works with `--gc:refc` though. but now I get another error… I think cligen just isn't compatible with Nim 2 yet
20:10:27*blop joined #nim
20:13:12*blop_ quit (Ping timeout: 246 seconds)
20:24:22FromDiscord<Elegantbeef> Shallow copy is not in orc/arc as it's just a `{.cursor.}`
20:24:56FromDiscord<sOkam! 🫐> In reply to @heysokam "<@380360389377916939> was this the": I managed to reproduce the exact error you got. Working on it, to see what's causing the probl https://media.discordapp.net/attachments/371759389889003532/1147265856271822869/image.png
20:41:33FromDiscord<sOkam! 🫐> @ElegantBeouf is there a way to completely erase a tag from graffitti forever, so it doesn't get found and readded back ever again?
20:42:19FromDiscord<sOkam! 🫐> there is some old-ass 4.1.2 version in the git history of `nglfw`, but it is conflicting with my current latest version which is in sync with glfw at `3.3.8.2` 😔
20:44:38FromDiscord<Elegantbeef> Nope not without rewriting git historry
20:47:28FromDiscord<sOkam! 🫐> idm rewriting it. what would I need to find and remove exactly?
20:47:57FromDiscord<Elegantbeef> Removing the commit that changed the nimble file to that version
20:48:07FromDiscord<Elegantbeef> Unless you mean you have local tags you keep pushing
20:48:11FromDiscord<Elegantbeef> In that case delete local tags
20:48:46FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "Unless you mean you": no its just some old commit form before I forked, afaik
21:03:43FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "<@380360389377916939> was this the": Yes
21:11:39*advesperacit_ quit ()
21:14:20*nullie joined #nim
21:20:23nullieDoes nim support operator overloading?
21:21:22FromDiscord<Phil> yes
21:21:24FromDiscord<Elegantbeef> Yes
21:22:29nullieI remember reading something like "operators won't cause function calls" and then thought that it does not
21:22:49FromDiscord<sOkam! 🫐> @System64 ~ Flandre Scarlet found the bug. it was exactly what I thought it was, this line is not behaving correctly on windows https://media.discordapp.net/attachments/371759389889003532/1147280423278354643/image.png
21:23:30FromDiscord<Elegantbeef> inb4 'zig.exe'
21:23:39FromDiscord<sOkam! 🫐> How do you properly check for the existance of a command in a cross-platform way in Nim? 🤔
21:24:04FromDiscord<sOkam! 🫐> I thought that line would do it, but apparently exit codes are not the same
21:25:08FromDiscord<sOkam! 🫐> or at least how do you do it on windows specifically?
21:28:04FromDiscord<Elegantbeef> `where zig` on windows `which zig` on \nix i believe
21:33:15FromDiscord<sOkam! 🫐> oh that works, i thought that would be returning local files for the cwd, but apparently not (at least not on win)
21:36:34FromDiscord<sOkam! 🫐> apparently the autodownloader for zig in confy is invaluable in windows↵TIL there is no real way to install automatically, you need to set it up manually. even zigup stores things in local, not homedir
21:39:27FromDiscord<jviega> Store your config in the binary… that’s what I do!
21:40:54FromDiscord<sOkam! 🫐> In reply to @jviega "Store your config": wdym?
21:41:47*Arthur quit (Server closed connection)
21:42:04*Arthur joined #nim
21:42:27FromDiscord<jviega> Self edit your exe
21:43:03FromDiscord<jviega> I have an elf library for it, not PE tho I don’t do Windows
21:43:26FromDiscord<sOkam! 🫐> i don't understand what that does or how it works
21:43:50FromDiscord<sOkam! 🫐> how is that going to solve resolving PATH and updating versions?
21:48:08FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "`where zig` on windows": just for reference, `os.findExe` is a lot more reliable, even if it searches first at the local folder... because the output of `where zig` could be in a different language and its much more difficult to filter
21:49:44FromDiscord<sOkam! 🫐> plus it seems like `where` doesn't even want to work some times 🤷‍♂️
21:50:22FromDiscord<System64 ~ Flandre Scarlet> I have a question, is it possible to do 24 bits RGB on a terminal with Nim? If yes, how?
21:51:15FromDiscord<Elegantbeef> https://nim-lang.org/docs/colors.html#rgb%2Crange%5B%5D%2Crange%5B%5D%2Crange%5B%5D
21:51:37FromDiscord<Elegantbeef> https://nim-lang.org/docs/terminal.html#ansiForegroundColorCode%2CColor
21:53:47FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "https://nim-lang.org/docs/terminal.html#ansiForegro": Oh alright so I can print colored text?
21:55:46*rockcavera quit (Read error: Connection reset by peer)
21:56:19*rockcavera joined #nim
21:56:19*rockcavera quit (Changing host)
21:56:19*rockcavera joined #nim
22:01:27*jmdaemon joined #nim
22:27:34FromDiscord<m4ul3r> Is it possible to turn `--overflowChecks:off` at compile time? ↵I have a proc that overflows (expected) and can't use the `{.compileTime.}` pragma on the proc
22:30:12*krux02 quit (Remote host closed the connection)
22:30:20FromDiscord<Elegantbeef> No use a uint
22:33:07FromDiscord<m4ul3r> sick, i was returning a uint, but int inside proc. Changing all to uint works
22:37:02*via quit (Server closed connection)
22:37:09*via joined #nim
22:47:48FromDiscord<sOkam! 🫐> @System64 ~ Flandre Scarlet I fixed the zig resolving bug, but I'm testing the downloader and its crashing because of a `zippy` conflict with the way I'm working with the files↵I'm waiting for an answer from treeform, and will push the bugfix when its solved
22:52:26*robertmeta quit (Server closed connection)
22:52:34*robertmeta joined #nim
23:04:12FromDiscord<System64 ~ Flandre Scarlet> Alright! We are close!
23:20:22FromDiscord<fakenullie> C++, D, and Rust have operator overloading, so the + operator might call a function.
23:20:53FromDiscord<fakenullie> So it doesn't mean that operators are not overloaded?
23:21:08FromDiscord<Elegantbeef> What?
23:24:09FromDiscord<fakenullie> Ah, sorry, got nim and zig mixed up
23:26:04FromDiscord<System64 ~ Flandre Scarlet> This is funny how terminals can do pixel art
23:26:33FromDiscord<sOkam! 🫐> In reply to @sys64 "This is funny how": if you don't know about `illwill`, you must 🙂↵its awesome for that type of stuff
23:26:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "if you don't know": Will check it out
23:27:10FromDiscord<sOkam! 🫐> there is a couple of pixel-like examples
23:27:12FromDiscord<System64 ~ Flandre Scarlet> Btw https://media.discordapp.net/attachments/371759389889003532/1147311726598037584/image.png
23:27:14FromDiscord<sOkam! 🫐> (edit) "there is a couple of pixel-like examples ... " added "in their repo"
23:27:26FromDiscord<sOkam! 🫐> In reply to @sys64 "Btw": damn nice
23:27:33FromDiscord<System64 ~ Flandre Scarlet> I did the art too
23:28:42FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "if you don't know": Ah yeah, sounds nice!
23:39:07FromDiscord<sOkam! 🫐> How do you run a `shell` command from the VM during compilation?↵`gorgeEx` is not running a shell, its running a process, and `execShellCmd` does not work on the VM↵I've been relying on `gorgeEx( "sh -c myCommand arg1 arg2" )`, but that is only correct for posix↵How do can you run a command at compile time only, as if it was the user who run it, in a way that works across systems?
23:40:03FromDiscord<sOkam! 🫐> or, at least, how do you run a command without a shell on windows specifically from the VM?
23:55:34FromDiscord<jviega> `staticExec()` runs a shell on Unix and Mac
23:55:40FromDiscord<jviega> I'd assume on Windows too
23:56:17FromDiscord<jviega> On nix staticExec() will essentially give you "sh -c" for free.
23:56:33FromDiscord<sOkam! 🫐> In reply to @jviega "`staticExec()` runs a shell": gorgeEx and staticExec are aliases
23:56:45FromDiscord<jviega> Well then you don't have to do the sh -c anyway 🙂
23:56:47FromDiscord<sOkam! 🫐> the problem is running the command on windows with it
23:57:03FromDiscord<jviega> It certainly wouldn't work on windows (sh -c) except with WSL
23:57:10FromDiscord<sOkam! 🫐> yeah exactly
23:57:22FromDiscord<sOkam! 🫐> but i believe WSL would signal being on linux, right?
23:57:39FromDiscord<jviega> staticExec("...") doesn't work if you pass windows shell commands?
23:57:45FromDiscord<jviega> I'd be shocked
23:57:49FromDiscord<sOkam! 🫐> i haven't tried on windows, tbh
23:58:00FromDiscord<sOkam! 🫐> only tried with sh -c whcih failed (obviously)
23:58:02FromDiscord<jviega> I'll bet $100 it works
23:58:09FromDiscord<jviega> You don't even need the sh -c on other boxes 🙂
23:58:13FromDiscord<sOkam! 🫐> let me try, thought i needed to call a shell
23:58:23FromDiscord<jviega> It runs via a shell
23:58:47FromDiscord<jviega> I've written several lines of shell script when things were easier from sh than nims
23:58:47FromDiscord<sOkam! 🫐> but on linux it wasn't working i believe
23:58:52FromDiscord<jviega> It works 100%
23:58:55FromDiscord<jviega> I do it all the time
23:59:04FromDiscord<sOkam! 🫐> plus... its not really outputting the result like a shell, its containing it (which obliterates compiler progress)
23:59:24FromDiscord<jviega> It returns the output, which you can then echo
23:59:31FromDiscord<sOkam! 🫐> you realize what that means?
23:59:33FromDiscord<jviega> It doesn't pass stdout to the subprocess
23:59:37FromDiscord<sOkam! 🫐> what about compiler progress
23:59:38FromDiscord<sOkam! 🫐> its gone
23:59:46FromDiscord<sOkam! 🫐> sure... echoed... all at once?
23:59:59FromDiscord<jviega> Yeah but doing sh -c isn't going to change that.