<< 25-10-2022 >>

00:00:16FromDiscord<huantian> The main benifot of keyring over gpg is easier for different users on different distros↵Tho if it’s just for you it doesn’t matter lol
00:00:26FromDiscord<Elegantbeef> @Patitotective are you still planning on adding openarray[char] overloads to strutils?
00:03:18FromDiscord<Elegantbeef> Finished the Unicode PR https://github.com/nim-lang/Nim/pull/20648 if you want a better reference. Otherwise just add it to the list of modules I get to copy paste 😄
00:05:21FromDiscord<Patitotective> In reply to @Elegantbeef "<@762008715162419261> are you still": gonna do it rn
00:09:41FromDiscord<wick3dr0se> In reply to @huantian "The main benifot of": Well it will be for others but I'm gonna pass the script to Nim, so it's included
00:10:25FromDiscord<wick3dr0se> Now I have to figure out passing headers with httpclient
00:11:31FromDiscord<huantian> In reply to @wick3dr0se "Well it will be": Well the script isn’t the issue, it’s that more people have a secret service client than a gpg key
00:13:54FromDiscord<wick3dr0se> As long as they have gpg installed, all this script does is require you to type in your own custom password which can be overwritten with each use & just stores a github auth token in this case. You use the password you passed on the inital run without the decrypt flag and it will reveal your token
00:15:49FromDiscord<wick3dr0se> (edit) "this" => "my" | "decrypt" => "--decrypt"
00:19:04FromDiscord<huantian> Ah I see
00:33:11FromDiscord<Patitotective> how am i supposed to test my changes 🤔 ↵if i run koch i think it will test v1.6.8 since its in my path (?)
00:38:30FromDiscord<Patitotective> beef
00:40:48*derpydoo quit (Quit: derpydoo)
00:45:15FromDiscord<Patitotective> also, ill create a draft pr so if i dont finish today you can continue working ;]
00:53:43FromDiscord<huantian> `./koch` instead of `nim r koch` i think
00:53:51FromDiscord<huantian> you need to use the koch of the nim that you're working with?
00:55:13FromDiscord<Patitotective> In reply to @huantian "you need to use": i mean, im updating a stdlib module so i want to test that module, not my v1.6.8 stdlib module
00:55:22FromDiscord<Patitotective> In reply to @huantian "`./koch` instead of `nim": isnt it the same?
00:55:33FromDiscord<huantian> I don’t think so
00:55:57FromDiscord<huantian> When I was mucking with stdlib I used the Koch in the cloned Nim directory
00:56:02FromDiscord<huantian> And it worked
01:07:19FromDiscord<Elegantbeef> `./koch test cat stdlib`
01:07:21FromDiscord<Elegantbeef> @Patitotective\:
01:10:43*mal`` quit (K-Lined)
01:10:44*def- quit (K-Lined)
01:12:04*def- joined #nim
01:13:01*arkurious quit (Quit: Leaving)
01:23:57*mal`` joined #nim
01:28:30FromDiscord<Patitotective> can i change the branch of a PR
01:28:56FromDiscord<Patitotective> im messing everything up because i had a PR in my devel branch of my Nim fork so the strutils PR had those changes :[
01:29:21FromDiscord<Patitotective> (edit) "im messing everything up because i had a PR in my devel branch of my Nim fork so the strutils PR had those changes :[ ... " added "and im rebasing and reverting stuff but that is being pushed into the PR as well :[[[["
01:43:46FromDiscord<Elegantbeef> Seems you've got it figured out?
01:44:48FromDiscord<Patitotective> ok beef so here it is https://github.com/nim-lang/Nim/pull/20650↵i havent finished it at all because im such a fricking dingus that i messed everything up and accidentally closed another PR i had and now realized i didnt have to create a draft pr since you still have to pr to my fork so dont mind me, im scared that i mess up something else
01:45:01FromDiscord<Patitotective> (edit) "ok beef so here it is https://github.com/nim-lang/Nim/pull/20650↵i havent finished it at all because im such a fricking dingus that i messed everything up and accidentally closed another PR i had and now realized i didnt have to create a draft pr since you still have to pr to my fork so dont mind me, im scared that i mess up something else ... " added "again"
01:45:40FromDiscord<Elegantbeef> You need to remove the `RTL` stuff from the string variants
01:46:01FromDiscord<Elegantbeef> It's fine if you mess things up for the most part
01:46:08FromDiscord<Elegantbeef> The only downside is you take CI for a bit
01:46:13FromDiscord<Elegantbeef> Which is bad but alas
01:47:34FromDiscord<Patitotective> In reply to @Elegantbeef "You need to remove": what does rtl do?
01:48:40FromDiscord<Elegantbeef> It emits a procedure in the C code that can be called for the runtime library afaict
01:50:49FromDiscord<Elegantbeef> it's not a commonly used feature of Nim, but it exists
01:52:02*derpydoo joined #nim
02:30:06NimEventerNew thread by bcharest: How to convert epoch (in milliseconds) to human time ?, see https://forum.nim-lang.org/t/9547
03:01:41*rockcavera quit (Read error: Connection reset by peer)
03:01:59*rockcavera joined #nim
03:02:00*rockcavera quit (Changing host)
03:02:00*rockcavera joined #nim
03:05:47*derpydoo quit (Quit: derpydoo)
04:22:03FromDiscord<ringabout> sent a code paste, see https://paste.rs/Xgk
04:26:37FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4e4h
04:52:41FromDiscord<Elegantbeef> Doesnt it use FFI so you'd need to use a compiler built with libffi?
04:53:55FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4e4m
04:54:07FromDiscord<ringabout> In reply to @Elegantbeef "Doesnt it use FFI": `getTime` is a special one, it uses compiler callback.
04:54:19FromDiscord<ringabout> (edit) "callback." => "callbacks."
04:54:33FromDiscord<Elegantbeef> Ah it's an 'annoying proc' got it
04:55:26FromDiscord<ringabout> I need to give it a type information of result in the parameter.
04:55:46FromDiscord<ringabout> (edit) "I need to give it a type information of result in the ... parameter." added "first"
04:56:35*kenran joined #nim
04:56:49FromDiscord<ringabout> I hope we can access the `PType` of the return type from `VMArgs`.
04:59:06FromDiscord<ringabout> I tried to add a callback node attached to `VmArgs` => but rejected https://github.com/nim-lang/Nim/pull/19578/commits/339fa750c5854300564bc7d2aaa9f22b7d438d25
05:02:09FromDiscord<Elegantbeef> Doesnt time store procs on it so this will likely not work as one wants?
05:05:40FromDiscord<ringabout> I'm not sure
05:25:36FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4e4s
05:27:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4e4u
05:56:31FromDiscord<Amun-Ra> What does benign pragma mean? I can't find it in the docs.
05:57:36FromDiscord<Elegantbeef> Seems it might be an old version of `gcSafe`
05:57:44FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/5602183234f59ece4fd668915da848f0753cbbb9/lib/system/inclrtl.nim#L48 declared here
05:58:04FromDiscord<Amun-Ra> Oh, thanks.
06:15:50*rockcavera quit (Remote host closed the connection)
06:21:39FromDiscord<sOkam!> do you know how to implement json's `null`into a nim type?
06:22:24FromDiscord<sOkam!> does `%` just know to create `""` instead for a string type, if the value is `null` instead of applying as nims `nil`?
06:30:25FromDiscord<sOkam!> oh i just saw that there is a special JNull type from the parser
06:33:25*PMunch joined #nim
06:44:50FromDiscord<Phil> In reply to @sOkam! "oh i just saw": One there's that, you can represent it in nim-types also as Optional value
06:45:01FromDiscord<Phil> (edit) "One" => "For one"
06:45:13FromDiscord<Phil> (edit) "In reply to @sOkam! "oh i just saw": For one there's that, ... you" added "also" | removed "also"
06:46:01FromDiscord<Phil> If you use something like jsony to directly parse into a proper nim type instead of an intermediate representation such as std/json does with its JsonNode Objects
06:46:53FromDiscord<sOkam!> oh, completely forgot about jsony. tysm
08:10:24FromDiscord<sOkam!> Is there any way to give some formatting from nim code to a json file downloaded from the web?
08:10:51FromDiscord<enthus1ast> .pretty() ?
08:11:24FromDiscord<sOkam!> where is that function from?
08:11:29FromDiscord<enthus1ast> from json
08:11:40FromDiscord<sOkam!> std/json?
08:11:47FromDiscord<enthus1ast> yes
08:11:52FromDiscord<sOkam!> ✍️
08:12:06FromDiscord<enthus1ast> https://nim-lang.org/docs/json.html#pretty%2CJsonNode%2Cint
08:12:30FromDiscord<sOkam!> is there something like that in jsony?
08:13:16FromDiscord<enthus1ast> since jsony directly creates nim objects, you could print the object
08:13:25FromDiscord<enthus1ast> eg with treeform/print
08:13:43FromDiscord<sOkam!> sure, but the idea is to save a formatted json
08:14:50FromDiscord<enthus1ast> jsony internally also imports std/json, so there are procs that also operates on JsonNode
08:15:27FromDiscord<enthus1ast> you could use jsony.fromJson("yourJson").pretty()
08:15:59FromDiscord<enthus1ast> the only thing you must do is to import json as well
08:21:13FromDiscord<sOkam!> kk
09:24:02*dnh joined #nim
09:47:05*neceve quit (Quit: ZNC - https://znc.in)
09:47:19*neceve joined #nim
10:41:19*fanta1 joined #nim
11:26:15*xet7 joined #nim
11:54:08*jmdaemon quit (Ping timeout: 272 seconds)
11:55:31NimEventerNew thread by krakengore: Nimble is unable to download and install, see https://forum.nim-lang.org/t/9548
11:58:02FromDiscord<ben_stanley> sent a long message, see http://ix.io/49IZ
12:01:06*wallabra quit (Ping timeout: 272 seconds)
12:01:49*wallabra joined #nim
12:06:05FromDiscord<Phil> In reply to @ben_stanley "Win up to $1000": <@&371760044473319454> there are scumbags in this chat!
12:07:03FromDiscord<Phil> Chat has been cleared, we good!
12:07:48FromDiscord<Phil> At this point there should be a scammer ban score and a leader board
12:08:32FromDiscord<Phil> It happens so often, might as well gamify it
12:08:50FromDiscord<Phil> (edit) "gamify" => "gameify"
12:22:08FromDiscord<PMunch> Haha, that's a great idea!
12:27:22FromDiscord<Saint> Is it normal to use a makefile if I want a project to remember certain compiler flags
12:27:41FromDiscord<Saint> Like -d:ssl or is there some built in nim way of doing it
12:28:00FromDiscord<Saint> I remember a while back there was some way I think to make nim c -r be the default when just typing nim
12:31:47*rockcavera joined #nim
12:31:48*rockcavera quit (Changing host)
12:31:48*rockcavera joined #nim
12:43:41*kenran quit (Remote host closed the connection)
12:49:36*derpydoo joined #nim
12:58:36FromDiscord<ChocolettePalette> You can use nim config files for that, not makefiles↵(@Saint)
12:58:45FromDiscord<ChocolettePalette> Or nimble or smth like that
12:59:30FromDiscord<Saint> In reply to @ChocolettePalette "You can use nim": Oh thanks, I'll look at config files. Also how would nimble solve this?
13:00:52*xet7 quit (Remote host closed the connection)
13:02:45FromDiscord<ChocolettePalette> Here is some reliable info about ithttps://nim-lang.org/docs/nimc.html#compiler-usage-configuration-filesI think that nimble is smth like a build system here but I might be wrong
13:07:09*arkurious joined #nim
13:10:21FromDiscord<Saint> I thought nimble was the package manager
13:10:27FromDiscord<Saint> 🤔
13:10:56FromDiscord<Rika> Nimble is also a build tool
13:15:25FromDiscord<ChocolettePalette> Turns out nim can also cross compile out of box, which is kinda cool doe!
13:19:58FromDiscord<Saint> In reply to @Rika "Nimble is also a": Gotcha thanks
14:03:16*PMunch quit (Quit: Leaving)
14:12:12*derpydoo quit (Ping timeout: 272 seconds)
14:34:43*dtomato4 quit (Quit: The Lounge - https://thelounge.chat)
14:35:15*dtomato4 joined #nim
14:58:06FromDiscord<Phil> In reply to @Saint "Oh thanks, I'll look": You can define nimble tasks
14:58:29FromDiscord<Phil> Those can be also commands to compile
15:00:10NimEventerNew thread by JohnLuck: Tips on how to avoid Nim pointer instability bugs?, see https://forum.nim-lang.org/t/9549
15:01:15FromDiscord<Phil> I use nimble tasks as essentially a replacement for having a dozen bashscripts lying around in my repository
15:11:21*dtomato4 quit (Quit: The Lounge - https://thelounge.chat)
15:14:06*dtomato4 joined #nim
16:03:01*fanta1 quit (Quit: fanta1)
16:26:26NimEventerNew thread by chikegar: Has 'IsNullOrEmpty' been deprecated? , see https://forum.nim-lang.org/t/9550
16:39:13*om3ga quit (Ping timeout: 252 seconds)
16:39:18*oisota1 joined #nim
16:39:25*dv^_^6 joined #nim
16:40:19*jkl quit (Ping timeout: 252 seconds)
16:40:23*jkl1337 joined #nim
16:40:42*lain quit (Ping timeout: 252 seconds)
16:40:42*lumidify quit (Ping timeout: 252 seconds)
16:40:43*om3ga joined #nim
16:41:04*oprypin quit (Ping timeout: 252 seconds)
16:41:05*oisota quit (Ping timeout: 252 seconds)
16:41:05*dv^_^ quit (Ping timeout: 252 seconds)
16:41:05*_________ quit (Ping timeout: 252 seconds)
16:41:05*oisota1 is now known as oisota
16:41:06*dv^_^6 is now known as dv^_^
16:41:24*oprypin joined #nim
16:41:25*hexeme quit (Ping timeout: 252 seconds)
16:41:27*hexeme_ joined #nim
16:42:37*lumidify joined #nim
16:43:04*_________ joined #nim
16:43:07*lain joined #nim
17:55:16*xet7 joined #nim
18:09:59FromDiscord<gibson> Is there a way to specify a proc argument to be both immutable _and_ pass-by-ref? This looks like a combination Nim doesn't allow.
18:10:35FromDiscord<gibson> Specifically, for a `string` datatype.
18:13:37FromDiscord<exelotl> Passing an immutable string is cheap, since its just length + capacity + pointer to data
18:14:13FromDiscord<Phil> I mean, I assume strings are by default actually in the heap, but why not just do ref string?
18:14:21FromDiscord<Phil> That should pass by reference, no?
18:15:21FromDiscord<auxym> refs are always sort of mutable though
18:16:01FromDiscord<exelotl> Yeah, ref is "reference counting", not "pass by reference"
18:16:13FromDiscord<auxym> But a regular (non-var) string arg should be passed by ref (under the hood) if its longer than 24 bytes
18:18:09FromDiscord<exelotl> A string is always <= 24 bytes since it just has those 3 fields (len, cap, data pointer). So those 3 fields will be passed by value but the data will not copied since the compiler knows you won't mutate it.
18:19:00FromDiscord<auxym> oh, yeah, good point.
18:30:08FromDiscord<gibson> In reply to @exelotl "Passing an immutable string": okay, I'll explore changing my `ptr string` to `ptr cstring`. Thanks.
18:45:02ehmryI'm getting a one line backtrace for a fatal exception, is there something I need to do when entering importc procs? can I manually set the stack bottom somehow?
18:48:37FromDiscord<System64 ~ Flandre Scarlet> on Nim, does sin() math function uses a lookup table or another method to calculate sine?
18:49:51*derpydoo joined #nim
18:50:48ehmryFlandre: sin uses libm
18:51:23ehmrymost of that float math stuff is done in the libc/libm
18:52:02FromDiscord<exelotl> In reply to @gibson "okay, I'll explore changing": oh that's not what I meant - I mean you should just pass `string`
18:52:27FromDiscord<exelotl> passing a string is efficient because it doesn't copy the data
18:54:04FromDiscord<gibson> sent a code paste, see https://play.nim-lang.org/#ix=4e7H
18:55:28FromDiscord<gibson> In reply to @exelotl "passing a string is": So I think that means I don't need to go to the extra effort of tracking a special pointer, and just store the string object, which includes a pointer to the underlying data.
18:57:01FromDiscord<System64 ~ Flandre Scarlet> In reply to @ehmry "Flandre: sin uses libm": Oh alright↵Also, are floats really slower than fixed point?
18:57:58ehmrymaybe? the only way to be sure is to benchmark
19:00:42FromDiscord<gibson> In reply to @gibson "So I think that": Yup, you are right; thanks. I'm not sure why so many of the stringview implementations track pointers. This simplifies the code 🙂
19:03:30FromDiscord<exelotl> you have to be careful with views. If the source string changes length or is reassigned then the view is no longer valid
19:04:25ehmryI wish we had a library for doing posit math with quires instead of float math, just to try it out
19:04:41FromDiscord<exelotl> sent a code paste, see https://paste.rs/KJI
19:05:17ehmrythe quire: https://asciinema.org/a/125169
19:08:24FromDiscord<gibson> sent a code paste, see https://paste.rs/qR4
19:09:06FromDiscord<gibson> I suppose a `when` stmt could check on mutability
19:09:27FromDiscord<gibson> (edit) "I" => "~I" | "mutability" => "mutability~ nope"
19:10:02FromDiscord<gibson> (edit) "nope" => "nope, maybe if my ctor was a template."
19:10:30FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=4e7P
19:10:41FromDiscord<gibson> Oh duh, that's great. Thank you.
19:11:08FromDiscord<exelotl> I wonder if it's sound though
19:13:28FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=4e7R
19:15:16FromDiscord<gibson> I think that's reasonable to allow. playing games with scope is always a possible foot-gun, while also possibly useful in extreme circumstances.
19:15:32FromDiscord<exelotl> yeah
19:15:58FromDiscord<exelotl> basically we need Nim's views to become stable
19:16:11FromDiscord<exelotl> they'll solve this much better than any library solution can x)
19:16:59FromDiscord<exelotl> they have a concept of the source string becoming "locked" while there is a view to it, and then able to be mutated once the view is no longer in use
19:17:12FromDiscord<exelotl> (all statically checked)
19:22:58FromDiscord<gibson> That sounds great - I didn't know they would be that powerful and flexible.↵I can't wait 🤩 but also, I can't wait 😐 ↵I'm so very much looking forward to both views and concepts.
19:47:17FromDiscord<sOkam!> Is it possible to launch an app, and exit the current nim launcher app right after without closing the other?
19:51:42FromDiscord<Prestige> nim launcher app?
19:53:25FromDiscord<sOkam!> app.exe _: made in c_↵launcher.exe _: made in nim_
19:53:48FromDiscord<sOkam!> launcher runs app, and exits, without stopping app
20:10:06FromDiscord<albassort> well
20:10:25FromDiscord<albassort> generally that kind of thing would be done in bash (batch because you're on windows) @sOkam!
20:10:50FromDiscord<albassort> because its an executable binary, nim doesn't really have any mechanism to run it
20:11:02FromDiscord<albassort> the only way to run it is to, tell your operating system to do so
20:11:29FromDiscord<albassort> so generally speaking, batch would fit this situation more than nim, depending on the complexity
20:11:52*jjido joined #nim
20:21:39FromDiscord<tsoj> sent a code paste, see https://play.nim-lang.org/#ix=4e8a
20:26:28*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
20:33:32FromDiscord<Generic> There is another overload for add for when the second parameter is a seq of the same type as the seq in the first
20:34:10FromDiscord<Generic> It will add all the elements the second seq has to the first (by copying them)
20:40:51FromDiscord<Patitotective> sent a long message, see http://ix.io/4e8d
20:43:25FromDiscord<tsoj> @Generic ahh yes that makes sense. I was even using that feature somewhere but didn't think of it here
21:33:38*derpydoo quit (Ping timeout: 272 seconds)
21:48:44FromDiscord<auxym> In reply to @sOkam! "Is it possible to": I think that's the default behavior for `osproc.startProcess` if you don't call `waitForExit` on the process object.
21:48:58FromDiscord<auxym> not 100% sure but try it it'll take you 2 minutes
21:56:55*xet7 quit (Remote host closed the connection)
22:03:53FromDiscord<Schelz> Is there any way to embed the html files inside nim program for nimview ?
22:07:49FromDiscord<Bung> staticRead and check the nimview api how it support load html string
22:10:04FromDiscord<Schelz> ok thx
22:10:55FromDiscord<susanjessy> https://t.me/+PEc8FSRwFiFiYzc0
22:11:26FromDiscord<Prestige> <@&371760044473319454>
22:12:37FromDiscord<spoon> i love random robots
22:14:04FromDiscord<PMunch> By the way, if anyone actually writes the gamification moderator bot I want a stat for how long it took the mod team to ban people
22:14:49FromDiscord<spoon> lol, join date and most recent message time should be easy to get from the api
22:16:45FromDiscord<spoon> wait- that's just reverse ban speedruns
22:23:05FromDiscord<albassort> Are nim coroutines cool
22:23:29FromDiscord<albassort> I'm reading about them now
22:23:33FromDiscord<albassort> They seem better than asynchronous stuff
22:25:03FromDiscord<albassort> Presumably they run on the same thread
22:25:15FromDiscord<albassort> Do they handle return types?
22:26:59FromDiscord<auxym> what is nim coroutines? a library?
22:27:11FromDiscord<auxym> async procs are "coroutines", in the general sense
22:27:37FromDiscord<albassort> Yes exactly but coroutines seems simpler to use
22:27:48FromDiscord<albassort> https://nim-lang.org/docs/coro.html
22:27:50FromDiscord<albassort> Look at this stuff
22:29:18FromDiscord<auxym> oh never seen that
22:39:27*jmdaemon joined #nim
22:44:47FromDiscord<exelotl> I like coroutines how Nimcoro does them. The stdlib coroutines are not very useful to me because they're tied to a scheduler. I just want interruptable functions 😅
22:46:09FromDiscord<exelotl> (edit) "interruptable" => "resumable" | "resumablefunctions ... 😅" added ""
22:48:22FromDiscord<exelotl> The closure iterators built into the language pretty much fill this role too. But they're not suitable for embedded.
23:13:27*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)