<< 21-12-2022 >>

00:03:24*ltriant joined #nim
00:24:37NimEventerNew question by Noah: Installing Nim on windows 11, see https://stackoverflow.com/questions/74870209/installing-nim-on-windows-11
00:24:58FromDiscord<nqeron> I'm new to nim - mainly just testing it out and stuff, but I'm having some trouble installing it - as can be seen by the post above
00:25:39FromDiscord<Elegantbeef> Antiviruses falsely flag Nim software as a virus
00:25:51FromDiscord<Elegantbeef> The only way to install it is to disregard your antivirus and say "I'm the boss"
00:27:35FromDiscord<nqeron> would you recommend using choosenim over trying to force the main download to work?
00:30:21FromDiscord<nqeron> ok - it seems to have created a .nimble directory, but not a bin subdirectory?
00:30:55FromDiscord<Elegantbeef> Choosenim and friends are the best way to install languages
00:31:42FromDiscord<Elegantbeef> Might be antivirus stopping it
00:31:49FromDiscord<Elegantbeef> I dont know though, dont use windows
00:34:14FromDiscord<nqeron> I used to use a mac as my main development machine, but it's now sluggish and constantly low on memory
00:45:52FromDiscord<nqeron> Ok - I disabled my antivirus for Nim - that seems to help.
00:48:54FromDiscord<jtv> AV products tend to make things sluggish and eat memory
00:51:38FromDiscord<Elegantbeef> They also like to make things not work
00:52:34FromDiscord<jtv> sent a long message, see http://ix.io/4jab
01:17:07FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4jag
02:23:54FromDiscord<Boston> Group policy disabling windows defender is the best thing you can do for sanity
02:30:05FromDiscord<Boston> In reply to @auxym "link the c#, maybe": If anyone wants a go at it, please do https://media.discordapp.net/attachments/371759389889003532/1054948847278903316/c_recieve_broadcast.txt
02:36:41FromDiscord<cia.gov> proper way to walk a directory?
02:42:15FromDiscord<Gumbercules> https://nim-lang.org/docs/os.html#walkDirRec.i%2Cstring
02:42:24FromDiscord<cia.gov> thx
02:42:33FromDiscord<Gumbercules> Yw
02:43:28FromDiscord<Gumbercules> Non-recursive version also exists above I believe
02:49:37FromDiscord<auxym> In reply to @Boston "If anyone wants a": ah, so you are trying to receive from a server which is broadcasting? I thought you wanted to write a server
02:51:16FromDiscord<Boston> In reply to @auxym "ah, so you are": think of it as two clients reading each others messages, its an embedded device that sends udp packets out of its own ethernet port to the broadcast address and the PC connected to that port listens to any packet that isnt from itself
02:51:50FromDiscord<Boston> theres more to that UDP client class that sends messages to this device, and i have successfully implemented that bit
03:04:48FromDiscord<auxym> sent a long message, see http://ix.io/4jav
03:07:05FromDiscord<Boston> Both have their own IP address, the PC's adapter being 192.158.1.1 and the Device IP being 192.168.1.206, both of them send their messages to 192.168.1.255 and both will read any packet that ends up at 192.168.1.255 but through a combination of filtering the sending IP and some unique data contained in the datagram can pick out packets meant for them
03:08:25FromDiscord<Boston> I have successfully ported the send function in Nim, and i can see in wireshark that the device receives' it and replies correctly however I can not get the reply packet into Nim
03:08:27FromDiscord<auxym> they are sending to which port though? pretty sure you will have to bind to that port (so as a server, sort of)
03:09:05FromDiscord<Boston> the PC sends to port 0x11ab and the Device sends to 0x11aa
03:10:03FromDiscord<auxym> right, so on PC, bind port 0x11aa and listen for stuff from there. as in https://github.com/mashingan/nim-etc/blob/master/udp-server/server.nim
03:10:12FromDiscord<auxym> sorry, got to go though. good luck
03:10:18FromDiscord<Boston> Thanks
03:51:20FromDiscord<albassort> alright so
03:51:51FromDiscord<albassort> sent a code paste, see https://paste.rs/phy
03:51:56FromDiscord<albassort> (ocr)
03:52:35FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4jay" => "https://paste.rs/1bF"
03:52:44FromDiscord<Elegantbeef> Linux binaries require atleast the libc they were compiled with
03:52:52FromDiscord<albassort> which is very strange because... I compiled it on this platform, how could it compile against a newer they were compiled against
03:53:01FromDiscord<albassort> but it was compiled against its own libc
03:53:16FromDiscord<Elegantbeef> Well that makes no sense
03:53:42FromDiscord<albassort> no i didn't how did this happen
03:53:48FromDiscord<albassort> dang old bash script
03:56:21FromDiscord<Elegantbeef> So no issue?
04:15:28*arkurious quit (Quit: Leaving)
04:22:30FromDiscord<albassort> new issues
04:22:31FromDiscord<albassort> but not this one
05:22:36*sagax joined #nim
06:14:42FromDiscord<array.in.a.matrix> is nim able to use javascript modules from npm?
06:18:36FromDiscord<array.in.a.matrix> oh i think i need to write wrappers for them
07:27:28FromDiscord<dizzyliam [they/them]> Is it possible to use sqlite .commands via std/db_sqlite
07:27:32FromDiscord<dizzyliam [they/them]> (edit) "std/db_sqlite" => "std/db_sqlite?"
07:28:06FromDiscord<dizzyliam [they/them]> I'm getting syntax errors trying it through `exec`
07:45:25FromDiscord<Phil> In reply to @karma_corrections "Is it possible to": Stuff like `.tables`?
07:45:32FromDiscord<Phil> Not to my knowledge
07:45:53FromDiscord<Phil> `exec` for example is purely for firing SQL
07:55:41*junaid_ joined #nim
08:28:15*junaid_ quit (Remote host closed the connection)
08:33:30FromDiscord<Bung> it seems sugar defined proc will not implicitly convert to closure make it fails to match to proc argument.
08:33:50FromDiscord<Elegantbeef> It should
08:34:02FromDiscord<Elegantbeef> Atleast i seen it emitted a `closure` typed proc earlier
08:34:48FromDiscord<Bung> I've seen two related issues in this situation
08:35:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jbf
08:35:40FromDiscord<Bung> the funny thing is they are both hidden in original issue, when origianl solved it comes up.
08:36:43FromDiscord<Bung> you may try some proc argument passing
08:37:40FromDiscord<Bung> the original issue am looking in https://github.com/nim-lang/Nim/issues/16541
08:40:10FromDiscord<Elegantbeef> Oh this is just Nim generics 'working'
08:40:25FromDiscord<Elegantbeef> Implicit conversions do not happen to generics
08:41:20FromDiscord<Elegantbeef> Well the compiletime segfault isnt
08:42:14FromDiscord<Bung> is it possible "Implicit conversions do not happen to generics"
08:42:24FromDiscord<Bung> fix that
08:42:40FromDiscord<Elegantbeef> Well it should be a compile time error
08:43:10FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/AMs
08:44:34FromDiscord<Elegantbeef> I say should just due to the rule that implicit conversions do not happen in the case of ambiguity
08:45:12FromDiscord<Elegantbeef> It's written somewhere 😄
08:45:42FromDiscord<Elegantbeef> I cannot presently find it in the manual so might be a fever dream
08:47:25FromDiscord<Bung> ok, then I'll make this CT error for now.
08:56:18FromDiscord<Bung> I know why the two issues are homogeneous, when user want use sugar the same time they want use generic..
09:00:14FromDiscord<Bung> `tuple[x: var int]` is invalid I guess ?
09:02:13FromDiscord<Elegantbeef> Without `views` yes
09:06:04FromDiscord<Bung> hmm, it didn't mentioned in manual, even view types section
09:06:27FromDiscord<Bung> in fact , it's first time see that
09:07:40FromDiscord<Elegantbeef> Well view types allow you to use `var T` as a field of an object
09:09:16FromDiscord<Bung> is that in manual? for a plain object
09:11:32FromDiscord<Phil> View type stuff? Best I can find: https://nim-lang.org/docs/manual_experimental.html#view-types
09:11:42FromDiscord<Elegantbeef> Yes that's them
09:12:34FromDiscord<Bung> but still I dont see example code like that a object filed type is `var T`
09:13:13FromDiscord<Elegantbeef> It's valid
09:16:37FromDiscord<Bung> I guess I need try myself, I even cant find a search result in nim repo
09:16:55FromDiscord<Elegantbeef> Yea views only really exist as a opt in feature
09:16:58FromDiscord<Elegantbeef> They're practically unusable
09:17:13FromDiscord<Elegantbeef> `var T` as a field is just a mutable borrow of memory
09:18:45FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jbn
09:18:58FromDiscord<Elegantbeef> `var T` and `lent T` in object definitions are just memory safe `ptr T` in theory
09:19:01FromDiscord<arkanoid> I really wish a page full of examples how to work with generic/typeclasses even in complex scenarios. I'm basically stuck in a loop trying to refactor my generic-based types into something more typeclassy
09:20:08FromDiscord<Elegantbeef> What's the hitch?
09:20:33FromDiscord<Bung> hmm, in such case I see it only meaningfully with stricfunc
09:20:55FromDiscord<Elegantbeef> I dont follow bung?
09:21:20FromDiscord<Elegantbeef> The entire point of view types is to allow borrowing memory safely instead of using a ptr
09:21:25FromDiscord<Bung> I mean `data: var int` can just be `data: int`
09:21:32FromDiscord<Elegantbeef> No it cannot
09:21:37FromDiscord<Elegantbeef> That wouldnt back propagate to `a`
09:22:22FromDiscord<Elegantbeef> view types are borrowing memory so `data: var int` is really a `data: ptr int` but safe
09:22:31FromDiscord<Elegantbeef> It's safe in that the compiler will ensure you do not have dangling pointer
09:23:29FromDiscord<Bung> hmm, didn't know that , it's complex situation in other language too I think
09:23:49FromDiscord<Elegantbeef> Views are akin to rust's borrow checker
09:24:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jbo
09:25:05FromDiscord<Elegantbeef> Rust is the most well known language with similar semantics to what view types are to offer
09:28:29FromDiscord<Bung> I see it changes a , without view type it will not.
09:29:49FromDiscord<Bung> does it have another name "borrow memory"
09:30:41FromDiscord<Elegantbeef> Yes
09:37:45FromDiscord<Bung> that's cool , I was think of that's a pass field by ref or value problem.
10:08:37FromDiscord<4zv4l> sent a code paste, see https://paste.rs/Yds
10:19:26FromDiscord<Rika> `cast[proc]` is nonsensical; `cast[proc(): int]` + the calling convention perhaps but i cannot help you with that because i dont know
10:23:17FromDiscord<amadan> You also need to make sure you are casting a pointer and not some values `cast[proc () {.cdecl.}](addr shellcode[0])()` (Replace the proc type with the correct one)
10:25:08FromDiscord<Bung> I'd say most time cast to proc wont work.
10:28:56FromDiscord<4zv4l> In reply to @amadan "You also need to": almost work, I get a segault
10:29:08FromDiscord<4zv4l> I compiled like this↵`nim c --passC:"-z execstack"`
10:33:52FromDiscord<Rika> In reply to @Bung "I'd say most time": most likely, yes
10:35:10FromDiscord<4zv4l> why not ?
11:21:40FromDiscord<cia.gov> is there a way to list all the processes on my windows computer using nim. i found an article but all it does is list all the PIDs, and i need the names.
11:22:04FromDiscord<cia.gov> (edit) "is there a way to list all the processes on my windows computer using nim. i found an article but all it does is list all the PIDs, and i need the names. ... " added "https://forum.nim-lang.org/t/5390"
11:23:20FromDiscord<Phil> That software targetted at only unix or only windows?
11:24:23FromDiscord<cia.gov> mine or the one in the article?
11:25:27FromDiscord<Bung> cia try psutils package
11:25:32FromDiscord<Phil> Yours, as I'm semi-sure the OS-api's to get that kind of information differ between linux and windows and I don't see any nim-lib providing it, so you're likely either wrapping a C-lib to do this or interacting with the shell
11:26:43FromDiscord<Phil> In reply to @Bung "cia try psutils": you mean posix_utils?
11:27:20FromDiscord<cia.gov> In reply to @Isofruit "Yours, as I'm semi-sure": well yes it does differ, im just looking on how to do it in windows.
11:27:35FromDiscord<4zv4l> any equivalent or wrapper around this in Nim ?↵https://man7.org/linux/man-pages/man2/mprotect.2.html
11:28:33FromDiscord<Phil> In reply to @cia.gov "well yes it does": Bung's suggestion was pretty good, psutil-nim has the solution for you:↵https://github.com/juancarlospaco/psutil-nim/blob/master/doc/windows/functions/pid_name.md
11:29:05*alice quit (Ping timeout: 260 seconds)
11:29:13FromDiscord<Phil> Basically I think it makes sense to skim through python's psutil docs and then use whatever you find there with psutil-nim as that module appears to be a direct port
11:29:30FromDiscord<Bung> https://github.com/johnscillieri/psutil-nim
11:29:52FromDiscord<Bung> the original one which contains my contribution
11:30:39FromDiscord<Phil> Ah, yeah good point, didn't notice that the juancarlospaco one was a fork
11:30:46*jmcantrell quit (Ping timeout: 265 seconds)
11:31:31FromDiscord<cia.gov> https://media.discordapp.net/attachments/371759389889003532/1055085103098908674/image.png
11:32:54FromDiscord<Bung> nim version and os ?
11:33:21FromDiscord<cia.gov> `Nim Compiler Version 1.6.10 [MacOSX: amd64]`
11:33:25FromDiscord<chri> but int is not int32 as from as i remember
11:34:59FromDiscord<Bung> sadly, mac support added by me is two years ago
11:35:38FromDiscord<cia.gov> sent a code paste, see https://play.nim-lang.org/#ix=4jbV
11:35:46FromDiscord<cia.gov> with adding a `.int` to the end of the function calls
11:36:12FromDiscord<Bung> so create a PR
11:36:22*alice joined #nim
11:36:34FromDiscord<Phil> In reply to @cia.gov "ive fixed it by": int by default is plattform dependant, but given that any computer nowadays is 64 bit based int by default tends to be int64
11:36:55FromDiscord<Phil> And you get no auto-conversion from int32 to int64 (and thus none from int32 to int)
11:37:01FromDiscord<Bung> no, don't do that
11:37:54FromDiscord<Phil> In reply to @Bung "no, don't do that": What would be the detrimental effect? At worst he wastes 4 bytes converting from int32 to int64
11:39:19FromDiscord<Bung> int on 16bit os will match int16
11:39:45FromDiscord<Phil> In that case he wastes 48 bit = 6 byte, also not a big deal
11:39:48FromDiscord<cia.gov> In reply to @Bung "sadly, mac support added": sadly `pid_name` doesn't work on mac either
11:40:21FromDiscord<Bung> so another PR
11:40:42FromDiscord<cia.gov> i couldn't be asked to make a PR
11:42:50FromDiscord<Bung> just a suggestion
11:44:43FromDiscord<cia.gov> i know, if i ever actually add the features i need, ill make a PR but for now im gonna set this part of my code aside
11:44:49FromDiscord<cia.gov> as its not needed
11:45:12*jmcantrell joined #nim
11:47:24FromDiscord<kaddkaka> sent a code paste, see https://paste.rs/0dJ
11:48:46FromDiscord<Phil> sent a code paste, see https://paste.rs/uPg
11:48:53FromDiscord<kaddkaka> yes
11:49:38FromDiscord<Phil> Ohhhh wait, so you have "up, left, right, down" and for each of those you want to call count and then multiply that together
11:49:48FromDiscord<kaddkaka> yes
11:50:42FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jbW
11:50:53FromDiscord<Phil> That'd be how I'd do it
11:51:08FromDiscord<Phil> If you're performance sensitive you'd do it in a normal for-loop:
11:51:43FromDiscord<kaddkaka> oh mapIt, great, yeah or use zerofunctional as pointed yesterday I guess 😉
11:51:55FromDiscord<kaddkaka> (edit) "oh mapIt, great, yeah or use zerofunctional as pointed ... yesterday" added "out"
11:52:02FromDiscord<kaddkaka> (https://github.com/zero-functional/zero-functional)
11:52:59FromDiscord<Phil> In reply to @kaddkaka "oh mapIt, great, yeah": I don't write that much functional and even more rarely do I need to chain the operators so `std/sequtils` typically doesn't bother me 😛
11:53:40FromDiscord<Phil> And I was actually not around when zero-functional got dropped, assuming it got mentioned somewhere yesterday
11:53:45FromDiscord<kaddkaka> I feel the code gets much more succinct and to the point
11:53:48FromDiscord<Phil> But good to know!
11:54:23FromDiscord<kaddkaka> It would be cool if Nims standard library could optimize in the same way as that library in the future 🙂
11:54:37FromDiscord<Phil> In reply to @kaddkaka "I feel the code": You won't find me disagreeing, it also gets more correct / forbids ways to do things wrongly, just didn't have a usecase that required more than 1 operator at a time, or the 1-2 times where I did have to the performance implications were irrelevant
11:55:02FromDiscord<kaddkaka> 👍
11:55:28FromDiscord<Phil> The good ol case of "sequtils is good enough for me" ^^
11:58:19FromDiscord<kaddkaka> I guess there is also the collect macro, but I dont really get it 😛 https://nim-lang.org/docs/sugar.html#collect.m%2Cuntyped%2Cuntyped
11:58:54FromDiscord<kaddkaka> or rather
11:58:58FromDiscord<kaddkaka> it's not very pretty
11:59:01FromDiscord<Phil> In reply to @kaddkaka "I guess there is": That's a minor convenience way of writing bog standard for-loops and not having to instantiate a seq[int] variable and adding to it
11:59:11FromDiscord<Phil> And yeah, not that easily readable in my eyes either
11:59:49FromDiscord<Phil> I can imagine it being pretty useful if you have to do fairly complex scenarios where you'd need to otherwise chain 4+ functional operators together
12:00:05FromDiscord<Phil> And don't want to add the zero-functional package as dependency
12:01:26FromDiscord<4zv4l> how can I get the page start address of a variable ?
12:01:36FromDiscord<4zv4l> so I can use `mprotect` on it
12:05:04FromDiscord<Phil> In reply to @4zv4l "how can I get": I have no idea of anything when it comes to memory layout but Vindaar explained some hacky magic to me once on an unrelated topic that does play around with memory layout and mprotect so maybe that can help you:↵https://discord.com/channels/371759389889003530/371759607934353448/1054033069826392104
12:08:18FromDiscord<4zv4l> thanks a lot !
12:08:39FromDiscord<4zv4l> can you show me how you imported the mprotect function and constants ? because I'm not quite sure I did it the best way
12:08:54FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4jc1
12:10:38FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=4jc2
12:11:40FromDiscord<Phil> In reply to @4zv4l "thanks a lot !": I was actually not the one writing that, I was copy-pasting the code that vindaar wrote to refer to them as I asked questions line by line
12:12:00FromDiscord<Phil> But I'm like 30% certain mprotect is in posx_utils
12:12:38FromDiscord<Phil> In reply to @4zv4l "can you show me": Yep, std/posix it is: https://nim-lang.org/docs/posix.html
12:12:50FromDiscord<Phil> https://nim-lang.org/docs/posix.html#mprotect%2Cpointer%2Cint%2Ccint
12:13:14FromDiscord<Phil> If that doesn't suit your needs, then the way it's done there can just be copy pasted as well
12:13:28FromDiscord<Phil> (edit) "it's" => "of importing that is"
12:13:58FromDiscord<4zv4l> thanks it seems to be almost good
12:14:31FromDiscord<Phil> In reply to @kaddkaka "So my first usage": I mean, it beats having to have a `var x: seq[sth] = @[]` before the let call
12:14:32FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4jc3
12:14:51FromDiscord<Phil> Erm... Beeeeef?
12:15:20FromDiscord<Phil> (edit) "In reply to @kaddkaka "So my first usage": I mean, it beats having to have a `var x: seq[sth] = @[]` before the let call ... " added "and an `x.add line` inside the loop"
12:15:27FromDiscord<Rika> In reply to @kaddkaka "So my first usage": Couldn’t you just directly toSeq the lines iterator
12:16:49FromDiscord<kaddkaka> In reply to @Rika "Couldn’t you just directly": seems like an idea!
12:17:17FromDiscord<Phil> Wait, I thought that was a demonstrative question that the collect macro in use looks clunky, that was an actual one?↵My bad
12:17:50FromDiscord<kaddkaka> cool, I didnt know about that! `let map: Map = toSeq(lines("input"))`
12:18:35FromDiscord<Phil> I'm partial to object call syntax so if it works I'd likely go for `lines("input").toSeq()`
12:18:48FromDiscord<kaddkaka> I mix a lot
12:18:51FromDiscord<Phil> Fair
12:19:07FromDiscord<kaddkaka> Too beginner to have settled an opinion perhaps 😛
12:20:03FromDiscord<4zv4l> In reply to @amadan "You also need to": oui sure about that one ?
12:20:14FromDiscord<Phil> Being a beginner never stopped me on having strong opinions, only made it easier to adjust them later after learning more xP
12:20:19FromDiscord<kaddkaka> `lines("input").toSeq()` arguably beats ` toSeq(lines("input"))` because the distance between the farthest `(``)` pair is shorted
12:20:25FromDiscord<4zv4l> (edit) "oui" => "you"
12:20:29FromDiscord<amadan> In reply to @4zv4l "you sure about that": the proc signature? no
12:20:30FromDiscord<kaddkaka> (edit) "shorted" => "shorter"
12:20:37FromDiscord<4zv4l> the addr of shellcode array
12:20:51FromDiscord<Rika> Looks correct to me
12:20:56FromDiscord<amadan> oh, that I'm kinda sure about
12:21:05FromDiscord<4zv4l> I get this when using that
12:21:06FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4jc5
12:21:10FromDiscord<Phil> In reply to @kaddkaka "`lines("input").toSeq()` arguably beats `": I'd argue the `lines("input").toSeq()`follows the order of your thoughts better. Get the lines from input, then turn it into a seq, done
12:21:56FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4jc6
12:22:07FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=4jc7
12:22:24FromDiscord<amadan> So Nim is putting the array directly there (so it becomes an r value)
12:23:43FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4jc8
12:23:43FromDiscord<4zv4l> even with the mprotect
12:25:19FromDiscord<amadan> Where did you find the shellcode from? iirc it needs to be written for your specific CPU (segfaults for me also though)
12:25:46FromDiscord<4zv4l> it's a correct shellcode, I made it works in C and Zig
12:25:59FromDiscord<4zv4l> for example
12:26:05FromDiscord<4zv4l> this is the zig code
12:26:06FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4jca
12:28:03FromDiscord<4zv4l> and with gdb the pointers it gives me isn't the pointer to the shellcode at all
12:28:16FromDiscord<4zv4l> while with zig when it segault before, it showed me the addr of the shellcode
12:32:21FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4jcd
12:32:36FromDiscord<4zv4l> the actual return is int32
12:32:51FromDiscord<4zv4l> I put u8 in zig because main cannot returns a i32
12:33:32FromDiscord<4zv4l> it can only be a pointer issue
12:33:51FromDiscord<4zv4l> either the pointer to the mprotect isn't right (the page pointer)↵either the shell_code pointer isn't right
12:33:58FromDiscord<4zv4l> and from what I see I think both are wrong
12:34:27FromDiscord<4zv4l> https://media.discordapp.net/attachments/371759389889003532/1055100940354588812/image.png
12:34:28FromDiscord<4zv4l> this isn't my shellcode
12:35:26FromDiscord<4zv4l> this in other hand (with zig) is my shellcode https://media.discordapp.net/attachments/371759389889003532/1055101186614767677/image.png
12:36:50FromDiscord<Rika> Set a break point before the call and check the value of the pointer
12:37:21FromDiscord<Rika> The call is perhaps working but maybe the contents is causing the fault
12:43:42FromDiscord<Gumbercules> @4zv4l you're also doing an `alignCast` in your zig code
12:43:59*jmdaemon quit (Ping timeout: 260 seconds)
12:44:04FromDiscord<Gumbercules> to get the pointer to pass to `mprotect`
12:44:25FromDiscord<Rika> I think that is equivalent to the and not calculation he does with the page variable
12:45:54NimEventerNew thread by evad: Windows Defender detected Trojan.AndroidOS/Multiverze in Nim-1.6.10_64.zip, see https://forum.nim-lang.org/t/9744
12:46:33FromDiscord<Gumbercules> gotcha
12:47:16FromDiscord<kaddkaka> How do the equivalent of applying `allIt` to an iterator? `toSeq` doesn't feel right
12:49:52FromDiscord<4zv4l> In reply to @Rika "The call is perhaps": wdym ?
12:49:57FromDiscord<4zv4l> the zig code works with the mprotect
12:50:05FromDiscord<4zv4l> in the Nim code, the call doesn't work
12:50:11FromDiscord<4zv4l> the pointer isn't right
12:50:21FromDiscord<4zv4l> or gdb should show me what's at that memory address
12:58:15FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=4jch
12:58:46FromDiscord<kaddkaka> But inserting a `toSeq` solves it. 🤔
13:00:51FromDiscord<vindaar> that's because `allIt` only works on actual collections and not iterators
13:01:17FromDiscord<vindaar> (imo sequtils needs a big overhaul)
13:13:14*PMunch joined #nim
13:40:06FromDiscord<albassort> so is nim suggest just totally broken on 1.9.1
13:40:22FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1055117526310334534/image.png
13:40:30FromDiscord<albassort> compiles fine
13:40:38FromDiscord<albassort> but nimsuggest don't like it
13:40:51*Phytolizer joined #nim
13:42:24Amun-Rawhat's up with that weird indent?
13:42:36Amun-Raah, nvm, I'm blind
13:44:39Amun-Rawhat does nimsuggest say?
13:45:19FromDiscord<albassort> template of construct
13:57:00*oddish joined #nim
13:58:33*oddish quit (Client Quit)
13:59:55FromDiscord<albassort> oh i see
13:59:58FromDiscord<albassort> its giving me runtime errors
14:00:07FromDiscord<albassort> interesting
14:00:22FromDiscord<albassort> good job?
14:00:40FromDiscord<albassort> does't give me any errors tho
14:00:48FromDiscord<albassort> (edit) "tho" => "tho, just says its broken"
14:00:55FromDiscord<albassort> so i gotta run it to see the actual problem
14:01:07FromDiscord<albassort> in this case, nimyal broke
14:01:12FromDiscord<albassort> (edit) "nimyal" => "nimyaml"
14:05:28FromDiscord<kaddkaka> `incl` of `hashset` was hard to find 🙈 https://nim-lang.org/docs/sets.html
14:21:13NimEventerNew Nimble package! ttop - Monitoring tool with historical snapshots, see https://github.com/inv2004/ttop
14:28:23FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=4jcG
14:29:39PMunch@kaddkaka, `var rope = newSeq[Pos](10)`
14:29:50PMunchAnd what do you mean incl was hard to find?
14:31:09FromDiscord<kaddkaka> In reply to @PMunch "<@185793553539137537>, `var rope =": It was not in the top example, and I was searching for `add` and `push`
14:31:52FromDiscord<kaddkaka> so it took me a while to find `incl`
14:33:05PMunchAah I see
14:34:32FromDiscord<kaddkaka> Btw, is there a way to give an "extra name" to a variable? Something like a reference to the last entry in a seq: `let p: ptr Pos = rope[^1]`
14:37:01PMunch`template last = rope[^1]`
14:37:27FromDiscord<leorize> don't forget `: untyped`
14:37:44FromDiscord<kaddkaka> hmm? do I need an untyped for that template?
14:38:04PMunchAh, I was just in the playground testing if it needed the :untyped :P
14:38:25FromDiscord<leorize> yes, you need a return type if you want to use the expression
14:39:03PMunchOtherwise Nim complains that `rope[^1]` has to be used or discarded
14:39:23PMunchYou could of course use `: Pos` instead
14:39:36FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=4jcP
14:41:05FromDiscord<kaddkaka> it's a bit verbose, but works I guess. perhaps I could create some template/macro to shorten it into something like: `head := rope[0]` or `head aliases rope[0]`
14:42:01PMunchI was just about to say that if you do this a lot you could of course define a simple template for it: https://play.nim-lang.org/#ix=4jcQ
14:56:38*Phytolizer quit (Ping timeout: 260 seconds)
14:58:52FromDiscord<Phil> Wait, why wouldn't a proc work?
15:01:10FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jd1
15:01:34FromDiscord<Phil> Actually, you can even make those funcs
15:01:49FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4jd1" => "https://play.nim-lang.org/#ix=4jd2"
15:04:32FromDiscord<Rika> In reply to @kaddkaka "Btw, is there a": they wanted specifically something without referencing rope or parens
15:04:34FromDiscord<Rika> (edit) "In reply to @kaddkaka "Btw, is there a": they wanted specifically something without referencing rope or ... parens" added "without"
15:04:43FromDiscord<Rika> (edit) "or" => "and"
15:07:44FromDiscord<Phil> Ah, without possibly making a copy, okay that would be likely a fair bit harder with a generic when you can do it with just a template to substitute the code
15:23:27FromDiscord<Yandall> @Phil I made something https://media.discordapp.net/attachments/371759389889003532/1055143468403535954/image.png
15:26:53FromDiscord<Phil> Okay that is slick
15:27:16FromDiscord<Phil> I assume when you tested for p you can enter any kind of querySelector-string ?
15:27:21FromDiscord<Phil> (edit) "querySelector-string" => "css-selector-string"
15:27:30FromDiscord<Yandall> Yes,
15:27:48FromDiscord<Yandall> (edit) "Yes, ... " added "I use nimquery for that"
15:29:44FromDiscord<Phil> Now the big question is: Did you use templates or procs for this?↵I'm mostly asking because test-suites at least for me always behaved funky when `check` wasn't used inside of the template itself (that's why I suggested templates for this)↵Basically, what does the printed output of that test-suite look like?
15:30:29FromDiscord<Yandall> https://media.discordapp.net/attachments/371759389889003532/1055145239788146788/image.png
15:30:45FromDiscord<Yandall> I used templates for all the checks
15:30:50FromDiscord<Phil> Sweet!
15:32:33FromDiscord<Phil> Generally I really like the syntax, let me think if I can think of anything else that would make sense in the package, but generally this is definitely good enough to publish.↵Depending on how much frill you want to add surrounding this I can help guide you through, since I had to do something similar not too long ago
15:33:05FromDiscord<Phil> Frill being:↵- Docs↵- Pipeline that auto-publishes doc to github pages↵- Pipeline that auto-runs test-suite on changes
15:33:41FromDiscord<Yandall> Those pipelines would be great
15:33:42FromDiscord<Phil> But imo this can get by with just a small reference what procs are all available and publishing to nimble
15:34:19FromDiscord<Phil> In that case give me a bit to get off work, sadly this won't be all that straightforward since I also had to copy quite a bit and imo CI/CD pipelines are always enormously painful
15:34:55FromDiscord<Phil> (edit) "In that case give me a bit to get off work, sadly this won't be all that straightforward since I also had to copy quite a bit and imo CI/CD pipelines are always enormously painful ... " added "to set up"
15:35:03FromDiscord<Phil> But so worth it in the long-term
15:35:22FromDiscord<Yandall> Right, I'll just finish writing the docs for this
15:35:50FromDiscord<Phil> In terms of documentation I think it suffices to just throw quick `##` doc comments underneath each proc, doesn't have to be too complicated
15:36:04FromDiscord<Phil> If you feel really invested you can add runnable examples
15:36:29FromDiscord<Phil> Those have the benefit that when you later use nims doc-tools, they'll be made part of the documentation
15:36:49FromDiscord<Yandall> I'll do that to some procs just for fun
15:38:22FromDiscord<Phil> In reply to @Yandall "I'll do that to": https://nim-lang.org/docs/system.html#runnableExamples%2Cstring%2Cuntyped↵Here some docs around runnable examples
15:38:40FromDiscord<Yandall> Thanks
16:27:04FromDiscord<Phil> In reply to @Yandall "Thanks": Alrighty, finally off.↵First thing you may want to do is write a simple command that generates docs for you as that's what can be used by the pipeline later and just generally makes your life easier
16:27:56FromDiscord<Phil> A nice mechanism to do so is nimble tasks.↵You may have noticed that there are nimble files.↵Well you can define tasks in them using nim-code that will run and can be executed via `nimble <TaskName>`.
16:29:07FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jdl
16:30:33FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jdm
16:30:58FromDiscord<Phil> `exec` in this context basically just executes whatever string you provide it in a shell
16:31:22FromDiscord<Phil> so `exec "echo lala"` is the same as typing `echo lala` in a bash shell
16:36:44FromDiscord<Phil> Luckily you won't need to do anything like that for your tests, as that `nimble test` already exists by default (In some cases such as web-applications you'll have to plug your own in there because your test-setup is likely more involved and may require specific flags etc., but you don't have to worry about that for now)
16:36:55FromDiscord<Phil> (edit) removed "that"
16:38:10FromDiscord<Yandall> In reply to @Isofruit "For you that could": What does the --git option?
16:38:13FromDiscord<Phil> If you want examples for all the kinds of things that nimble files can looks like, here 2 examples:↵https://github.com/planety/prologue/blob/devel/prologue.nimble↵https://github.com/PhilippMDoerner/Snorlogue/blob/main/snorlogue.nimble
16:39:05FromDiscord<Yandall> (edit) "option?" => "option do?"
16:41:22FromDiscord<Phil> In reply to @Yandall "What does the --git": If you looked at nim docs you may have seen a "see source" grey hyperlink here and there, that option is used to generate the hyperlinks
16:41:23FromDiscord<Phil> See https://nim-lang.org/docs/docgen.html#related-options-see-source-switch
16:42:36FromDiscord<Yandall> Ohh so that what is does
16:42:45FromDiscord<Yandall> Very cool
16:44:36FromDiscord<Phil> Alrighty, once you got the task down (feel free to try it out and open the docs in your browser, should work well enough. Don't commit the docs themselves though, you want github to take care of that).
16:44:55FromDiscord<Phil> (edit) "(feel" => "we can continue.↵Feel" | "that)." => "that."
16:47:10FromDiscord<Phil> (Sidenote for everybody else: I happily take corrections on anything I'm writing here, I'm not insanely knowledgeable about the setup either, I've just done it once or twice)
16:49:38FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jdt
16:50:01FromDiscord<Phil> This will generate a link in the docs where "FormField" will be a clickable hyperlink that'll automatically jump you to the definition of FormField on the page
16:50:46FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jdv
16:51:40*pro joined #nim
16:52:20*pro left #nim (#nim)
16:54:09FromDiscord<Phil> Got the docs down so far?
16:55:13FromDiscord<Yandall> Right now I'm a little busy, but I'll write you when I get it
16:56:25FromDiscord<Phil> We can split this over time no problem, it's a fair bit as you'll also need to define a dockerfile, a docker-compose file and then a couple workflow files for github
16:56:43FromDiscord<Phil> So we can do this step by step
16:59:00FromDiscord<Phil> I think I may just write that down as we go along.↵I don't have a blog myself, but I'm sure somebody here would be willing to publish it somewhere
16:59:09FromDiscord<Phil> IIRC at least beef, ringabout and demo have blogs
17:28:20FromDiscord<Boston> @auxym from our conversation earlier, which net recv proc do you think I should be using
17:58:31FromDiscord<auxym> In reply to @Boston "<@882793909246369864> from our conversation": they are all mostly equivalent I think? The easiest is probably this one: https://nim-lang.org/docs/net.html#recv%2CSocket%2Cint%2Cint
17:58:51*wallabra quit (Ping timeout: 260 seconds)
18:06:59FromDiscord<Hoss> How are folks doing networking with nim? ZMQ? Is there a popular web server or library for building web apps? Something that could take advantage of running the same code in js?
18:10:03*wallabra joined #nim
18:13:19FromDiscord<Phil> sent a long message, see https://paste.rs/PeT
18:13:33FromDiscord<Phil> (edit) "https://paste.rs/7Kd" => "https://paste.rs/Km2"
18:13:47FromDiscord<Phil> Popular webservers are httpbeast (for windows: Httpx, it's a fork) and asynchttp and I honestly don't know any others
18:14:01FromDiscord<Phil> I only know those two because prologue allows their use
18:14:15FromDiscord<Phil> As for networking, good question, haven't looked into that yet
18:14:42FromDiscord<Phil> Apparently there's an asyncrabbitmq package
18:17:51Amun-Rais an object returned from function malloced?
18:20:11FromDiscord<Hoss> Thanks Phil. Any idea how concurrency works with these? Is there any lightweight concurrency mechanism or do people use “OS” threads?
18:23:24FromDiscord<willyboar> There are more web frameworks but that @Phil mention is the most popular. There also: phoon, akane, basolato, rosencrantz and scorper. Also for servers there is also guildestern and zfcore ( I think this is the right name) but the last I never test it.
18:24:56FromDiscord<willyboar> There is also whip but is broken after nim or httpbeast latest release
18:34:36FromDiscord<Hoss> Seems like most things use httpbeast?
18:51:14FromDiscord<willyboar> Nope! Akane, rosencrantz and phoon use std/asynchttpserver
18:51:53FromDiscord<willyboar> Scorper use its own if I remember right
18:55:02FromDiscord<willyboar> You can check some of them in this basic benchmark: https://github.com/the-benchmarker/web-frameworks
19:16:00FromDiscord<Phil> Mandatory disclaimer that benchmarks are to be taken with a GINORMOUS amount of salt and are 99% of the time completely worthless
19:19:09NimEventerNew thread by samdze: Create a ref to a C allocated object to manage its memory, see https://forum.nim-lang.org/t/9745
19:27:25FromDiscord<nqeron> Is there a way to create a type that resolves to one of two types?
19:28:39FromDiscord<exelotl> You can do like↵type Something = Foo | Bar
19:29:29FromDiscord<nqeron> I think I tried that, but when I use that type in another type, e.g. type G = (P, Something), I was having issues
19:30:08FromDiscord<nqeron> well, technically I'm using a named tuple
19:31:30FromDiscord<exelotl> Ah right, to use a typeclass in another type the only way is to do it as a generic constraint
19:31:39FromDiscord<exelotl> Ah sorry g2g
20:17:30*blackbeard420 quit (Quit: ZNC 1.8.2 - https://znc.in)
20:19:12FromDiscord<willyboar> In reply to @Isofruit "*Mandatory disclaimer that benchmarks": True but it is nice to see all this frameworks together. Also examples are a nice resource to start.
20:25:20FromDiscord<narimiran> Quick question for `choosenim` users:↵↵Does `choosenim "#version-2-0"` work for you?
20:40:15FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4je8
20:40:38FromDiscord<narimiran> In reply to @auxym "On W10, build fails": Thanks!
20:50:10*jmdaemon joined #nim
20:53:06FromDiscord<geekrelief> is it possible to run a nimble task with the same name as one of the builtin commands? I'm on devel and trying to run `nimble setup` seems to run the nimble command instead of the nimble task from https://github.com/jmgomez/NimForUE/blob/c0f154d2b664eeac1023e50ab1afd32b1f8b9e59/NimForUE.nimble#L19 The weird thing is that for most others they're able to run the task.
20:55:35*LuxuryMode joined #nim
21:03:25NimEventerNew thread by miran: Nim version 2.0 RC1, see https://forum.nim-lang.org/t/9746
21:05:37FromDiscord<Hoss> good day to start learning about Nim I guess!
21:12:29FromDiscord<nqeron> Is there a way to create a default constructor for a generic type. e.g. if I have ` type Some[N: int] = array[N, array[N, int]] `, how could I call default(Some[N])?
21:31:33FromDiscord<federico3> the database clients have been moved out of the stdlib?! \:(
21:33:24FromDiscord<Yepoleb> Yeah, not too long ago
21:37:19FromDiscord<federico3> a bundle of Nimble libraries shipped as an extension to the compiler would really help
21:46:25FromDiscord<treeform> I don't see it as a problem, its so easy to install libs
21:51:42FromDiscord<Phil> How is it regarding the docs? Are they still hosted and accessible on the general nim lib page?
21:55:14FromDiscord<Elegantbeef> Nope they're no longer in the stdlib 😄
21:55:52FromDiscord<Elegantbeef> In theory the docs could be hosted on the nim website but I dont know if they will be
21:56:10FromDiscord<Phil> That sucks a whole lot of balls
21:56:38FromDiscord<Elegantbeef> Well the nimble.directory is supposed to generate docs
21:57:53PMunch@federico3, it should be easy enough to create a meta-package which just requires a bunch of packages for a "Nimble standard library" kind of thing
21:58:03FromDiscord<Elegantbeef> Treeform's also got nimdocs though it's opt-in n an author basis
21:58:04PMunchI've done that in the past for docker containers
21:58:33FromDiscord<Elegantbeef> I very much think the stdlib should be it's own package
21:58:37PMunchAnd there has been some talk about making Nimble documentation more easily accessible on the main site
21:58:42FromDiscord<Elegantbeef> So it can develop without the language
22:00:52PMunchI would really like to make a push for removing HTML generation of documentation, so the compiler only spits out JSON. And then ship a nim-doc tool which can generate the standard HTML. That would make it very easy to add new documentation targets because you're ensured that all the stuff in the HTML documentation would be accessibly through the JSON documentation. And it would be a lot easier to consume this documentation into e.g. a database for some "Nim
22:00:52PMunchdocumentation website"
22:01:33FromDiscord<willyboar> In reply to @Elegantbeef "I very much think": I've only see gleam do that
22:01:57PMunchMy initial goal when I first started looking at the Nim jsondoc target was exactly that. Create a Nim documentation website which allowed more features, better searching, and the ability to supply comments similar to the Clojure documentation
22:02:13PMunchThose comments where incredibly helpful when I first started out learning Clojure
22:02:18FromDiscord<Elegantbeef> I'm simple the Nim doc generator is fine for me
22:02:38PMunchIt's fine, but it could be so much better
22:03:12FromDiscord<albassort> @Rika you do somethin with your hair?
22:03:14FromDiscord<willyboar> Agree with pmunch
22:04:28FromDiscord<willyboar> It would be easy to have different doc gens and choose what suites best for you
22:06:08FromDiscord<gcao> sent a code paste, see https://paste.rs/Tgk
22:06:13FromDiscord<albassort> nah
22:06:21FromDiscord<Elegantbeef> Yes
22:06:23FromDiscord<Phil> Instead of splitting out HTML generation from the docs, why not just have generating JSON as an alternative to the current HTML, useable via flag?↵That would require less tooling change, while at the same time enabling 3rd party doc-gen tools
22:06:27FromDiscord<gcao> (edit) "https://play.nim-lang.org/#ix=4jej" => "https://play.nim-lang.org/#ix=4jei"
22:06:35FromDiscord<albassort> oh i misreead
22:06:38FromDiscord<albassort> (edit) "misreead" => "misread"
22:06:39FromDiscord<Elegantbeef> sleepasync stops the current operation and allows background tasks be done
22:06:46FromDiscord<albassort> keep in mind it stays on the same cpu
22:07:31FromDiscord<albassort> so if you're using 100% of the cpu on a complex operation, it wont allow you do really do anything else
22:07:39FromDiscord<amadan> In reply to @Isofruit "Instead of splitting out": Kinda already do with `jsondoc` command. But it still has html in the description for stuff
22:07:59FromDiscord<Phil> That just means the current tooling needs a slight refactor
22:08:08FromDiscord<Phil> Not that you need to swap out the entire process
22:09:06FromDiscord<albassort> I think something I'd like to see in nim is something akin to interfaces to make callback procedures a litter nicer
22:09:32FromDiscord<Elegantbeef> There are already multiple solutions to interfaces
22:09:37FromDiscord<albassort> because currently theres no special mechanism, and it works, but it requires a lot of type fiddling to make sure---
22:09:38FromDiscord<Phil> You mean module-wide interfaces?
22:09:51FromDiscord<albassort> no procedure local
22:09:55FromDiscord<albassort> like
22:09:59FromDiscord<Phil> What about concepts?
22:10:08FromDiscord<Elegantbeef> https://github.com/yglukhov/iface
22:10:40FromDiscord<Elegantbeef> https://github.com/beef331/traitor
22:10:44FromDiscord<Phil> What I would love would be module-wide interfaces so I can swap out module files as I need/want them
22:10:47FromDiscord<albassort> yes but i meant specifically the overwriting part of interfaces
22:10:52FromDiscord<gcao> For better use of cpu, should sleepAsync be preferred in most cases? if I want to juggle between multiple tasks in the same thread
22:11:02FromDiscord<Elegantbeef> "Overwriting part of interfaces"?
22:11:22FromDiscord<albassort> In reply to @gcao "For better use of": Threading shouldn't happen unless absolutely necessarily
22:11:36FromDiscord<Elegantbeef> We already have modules↵(@Phil)
22:11:54FromDiscord<albassort> In reply to @Elegantbeef ""Overwriting part of interfaces"?": for example, in a class that implements a interface, you write a function that gets called, that "overwrites" the interfaced method
22:12:07FromDiscord<albassort> currently you type your paramaters
22:12:23FromDiscord<Elegantbeef> Most interfaces are static that i know of
22:12:26FromDiscord<Elegantbeef> So there is no overwritting
22:12:44FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jel
22:12:46FromDiscord<Elegantbeef> They force you to declare a method for a given type and then you can categorise your types to said interface
22:12:47FromDiscord<albassort> java is a whacky thing beef
22:13:06FromDiscord<Phil> In reply to @Elegantbeef "We already have modules": Yeah but I deal with database and often enough that I often enough have compile-time switches determining for which DB I'm compiling and I would love to see an error message along the line of "this module does not implement all required procs" instead of "this proc in this completely unrelated module is missing"
22:13:18FromDiscord<Elegantbeef> So then why not make them?↵(@Phil)
22:13:28FromDiscord<Phil> (edit) removed "and often" | removed "often enough"
22:13:52FromDiscord<gcao> even if it's a single-threaded program, I may be writing code to talk to db, socket. I guess async socket, sleep async should be used, just like in Node.js, callback based non-blocking calls are the default
22:14:01FromDiscord<Phil> In reply to @Elegantbeef "So then why not": Becuase I can't think of how
22:14:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jem
22:14:46FromDiscord<Elegantbeef> Well there you go you now have a module interface!
22:14:51FromDiscord<albassort> sent a code paste, see https://paste.rs/4Ks
22:14:54FromDiscord<Elegantbeef> Can even turn it into a template
22:15:11FromDiscord<albassort> im sorry beef but we can do better
22:15:51FromDiscord<albassort> @Phil so, like, a meta type called "module" which is a collection of procs and templates
22:16:01FromDiscord<albassort> and you can use that as a parameter
22:16:10FromDiscord<albassort> thats kinda how my brain imagined it
22:16:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jeo
22:16:35FromDiscord<Elegantbeef> There we go you now can define in your importing module what procedures must be exported in your submodules
22:16:40FromDiscord<Elegantbeef> Module level interfaces done
22:17:34FromDiscord<Phil> sent a long message, see https://paste.rs/XCo
22:17:47FromDiscord<Elegantbeef> Yes
22:17:59FromDiscord<Elegantbeef> It doesnt even need to export them
22:18:18FromDiscord<Elegantbeef> You just use `ensureProcExists` after importing
22:18:26FromDiscord<Elegantbeef> You dont always export the modules you use sometimes you consume them directly
22:18:35FromDiscord<albassort> :WaltCook: writing nim so disgusting I didn't know you could write it
22:18:50FromDiscord<albassort> (edit) "writing" => "beef making" | "beef makingnim ... so" added "code"
22:19:14FromDiscord<Phil> I mean, at times I have had to resort to equally unpretty means
22:19:27FromDiscord<Phil> sent a code paste, see https://paste.rs/eUB
22:19:48FromDiscord<albassort> hey guys why did nobody tell me about {.error.}
22:19:52FromDiscord<albassort> this is bullshit
22:20:01FromDiscord<albassort> i've been using asserts and raiseassert
22:20:08FromDiscord<Phil> Nobody told me about the `convert` keyword either
22:20:16FromDiscord<albassort> what the fuck is that
22:20:24FromDiscord<Phil> (edit) "`convert`" => "`converter`"
22:20:28FromDiscord<vindaar> `{.error.}` and `assert` are for CT and RT respectively
22:20:51FromDiscord<albassort> yea i didn't know about that I've been doing RT Errors
22:20:57FromDiscord<albassort> (edit) "Errors" => "errors"
22:20:58FromDiscord<vindaar> (and obv don't serve the same purpose)
22:21:47FromDiscord<albassort> @Phil explain converter
22:22:13FromDiscord<Elegantbeef> I mean it doesnt matter that the internals are ugly
22:22:19FromDiscord<Elegantbeef> As long as we get what we want and it's readable
22:22:28FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=
22:22:31FromDiscord<albassort> o shit
22:22:43FromDiscord<Phil> Implicit type conversion
22:22:45FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jep
22:23:02FromDiscord<Elegantbeef> Do people even read the tutorial/manual ever?
22:23:06FromDiscord<albassort> I HAVE
22:23:09FromDiscord<albassort> MANY TIMES
22:23:23FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1055249148485570601/image.png
22:23:28FromDiscord<Phil> you can literally throw a string into a proc expecting an int and nim will implicitly call the converter
22:23:30FromDiscord<albassort> its mentioned basically never
22:23:38FromDiscord<albassort> never in the docs, rarely in code
22:23:46FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1055249243457200228/image.png
22:23:49FromDiscord<albassort> 16 times on the tutortial
22:24:03FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1055249316563910666/image.png
22:24:15FromDiscord<albassort> of course im not gonna see it
22:24:34FromDiscord<albassort> for every mention of converter theres 21 mentions of a procedure
22:24:38FromDiscord<albassort> anyway, L take beef
22:25:01FromDiscord<Elegantbeef> "L take beef"
22:25:02FromDiscord<Elegantbeef> What
22:25:04FromDiscord<Phil> In reply to @Elegantbeef "image.png": 0 times in nim tutorial part 1, 2 and 3.↵There's only a section in the nim manual but I am convinced that manual is more for reference than actual studying
22:25:27FromDiscord<Elegantbeef> The manual explains a lot
22:25:41FromDiscord<Phil> take as in "take of a situation", an opinion of something.↵And L as in lose.
22:26:01FromDiscord<Phil> An "L take" is a Lose/Loser opinion/interpretation of a something
22:26:18FromDiscord<Elegantbeef> Lol
22:26:28FromDiscord<auxym> In reply to @narimiran "Quick question for `choosenim`": on my arch linux laptop, the build seems stuck in an infinite loop. it turns my cpu into a heater and never completes
22:26:34FromDiscord<albassort> I barely remember what concepts are and im still not sure how to properly use them
22:26:35FromDiscord<Phil> "Take the L" and "Take the W" are in a similar vein
22:26:54FromDiscord<albassort> im sure i can use them in more places
22:27:18FromDiscord<Phil> In reply to @albassort "I barely remember what": My code is strictly speaking the perfect breeding ground for concepts given how I use copious amounts of generics basically everywhere
22:27:30FromDiscord<Phil> Still almost never use em
22:27:32FromDiscord<Elegantbeef> Sure but those are full sentences↵(@Phil)
22:27:45FromDiscord<Elegantbeef> I can read full sentences
22:27:54FromDiscord<Phil> In reply to @Elegantbeef "Sure but those are": So is "Bad opinion Beef"
22:27:55FromDiscord<albassort> beef hasn't met a zoomer before
22:28:09FromDiscord<Phil> This times you just add abbreviations to it
22:28:10FromDiscord<Elegantbeef> You realise i'm technically one right?
22:28:30*PMunch quit (Quit: leaving)
22:28:31FromDiscord<albassort> i think of you as more an eldritch concept
22:28:35FromDiscord<albassort> (edit) removed ""
22:28:40FromDiscord<albassort> logic itself
22:28:45FromDiscord<albassort> something that has existed and always will exist
22:28:48FromDiscord<Phil> Which is the thing I tell everybody never to do because abbreviations are evil and you're guaranteeing that sooner or later somebody will not understand you and make communication harder!
22:28:56FromDiscord<Elegantbeef> I'm only 23, i just avoid speaking inanely
22:29:00FromDiscord<Phil> If I see an abbreviation in your code it illicits violent thoughts
22:29:12FromDiscord<albassort> 4 years is a big age cap
22:29:21FromDiscord<Phil> Ohhhhh you youngins
22:29:25FromDiscord<Elegantbeef> Ah you write `newHyperTextTransferProtocolClient`↵(@Phil)
22:29:38FromDiscord<albassort> when i was playing with my GBA in 2008 you were learning divison or somethin
22:29:46FromDiscord<Phil> In reply to @Elegantbeef "Ah you write `newHyperTextTransferProtocolClient`": You got me there: Abbreviations that aren't industry standards
22:30:00FromDiscord<Elegantbeef> Ah so you also write `integer`? 😛
22:30:07FromDiscord<albassort> wasn't my gba was my sisters gba
22:30:22FromDiscord<Elegantbeef> Nah 2008 i was playing on GBA
22:30:22FromDiscord<Phil> In reply to @Elegantbeef "Ah so you also": That, similarly to "i" for index, are coding industry standards 😛
22:30:28FromDiscord<Elegantbeef> Still have my gbasp in front of me
22:30:29FromDiscord<Phil> GBA wouldn't count for example
22:30:47FromDiscord<albassort> in my old room i have my gamecube
22:31:38FromDiscord<Phil> ... the fact I have the SNES I played as a kid on in a box collecting dust somewhere is illiciting strange feelings rn
22:31:56FromDiscord<Elegantbeef> The snes and nes i had as a kid were sadly sold 😄
22:31:57FromDiscord<albassort> hah old man you'll die before transhumanism
22:31:59FromDiscord<Phil> Though nothing manages to make me feel as old as looking up when LotR was released
22:32:06FromDiscord<albassort> I may be 90 when it happens
22:32:48FromDiscord<albassort> my mom sold our nes's when i was a kid
22:32:56FromDiscord<albassort> (edit) "nes's" => "nes"
22:33:06FromDiscord<albassort> i wonder where my sisters old apple tower went
22:33:13FromDiscord<albassort> ...how did she even get that wth
22:33:17FromDiscord<Elegantbeef> The trash where it belongs!
22:33:38FromDiscord<Elegantbeef> In summary there you go phil you now have module interfaces, you can praise my supreme intelligence later
22:34:20FromDiscord<Phil> In reply to @Elegantbeef "In summary there you": ~~By calling for you the next time somebody with a macro question shows up~~
22:34:32FromDiscord<Elegantbeef> Hey i dont mind
22:35:02FromDiscord<albassort> heres what i want
22:35:41FromDiscord<Phil> In reply to @albassort "heres what i want": A macro course covering 2 dozen examples in detail?
22:36:08FromDiscord<Elegantbeef> Macros are just so hard to write good tutorials for
22:36:11FromDiscord<Elegantbeef> There's just so much to worry about
22:36:28FromDiscord<Elegantbeef> You're literally writing user defined compiler passess
22:36:40FromDiscord<Phil> I think going through examples one after another is the way to go
22:37:00FromDiscord<Phil> Showing a lot of ways how you can use them and how they achieve what they want
22:37:20FromDiscord<Phil> From there those examples can be the basis for your own macros and you can branch out from there
22:37:30FromDiscord<Phil> (pun intended)
22:37:53FromDiscord<Elegantbeef> Meh the AST is awful to explain
22:38:41FromDiscord<Phil> You make a statement, write circles around the individual node-elements, give them names and show how you can mix them around, no?
22:38:47FromDiscord<Phil> (edit) "write" => "draw"
22:40:01FromDiscord<Elegantbeef> It's all fine and dandy for untyped ast and how it works
22:40:08FromDiscord<Elegantbeef> Type ast is where demons lie
22:40:54FromDiscord<Phil> That can be chapter 2 😛
22:41:03FromDiscord<Phil> Or "The advanced chapter for big boy macros"
23:11:52FromDiscord<@thatrandomperson5-6310e3b26da03> How would i make a lz77 compression algo in nim as described here\: https://en.wikipedia.org/wiki/LZ77_and_LZ78↵Im mainly stumped on how to get the longest reapted occurence and all these values
23:29:52NimEventerNew thread by JohnAD: OpenGPT seems to sort-of work with Nim also., see https://forum.nim-lang.org/t/9747
23:30:36FromDiscord<federico3> That still depends on pulling stuff from the Internet using Nimble↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)