<< 17-05-2024 >>

02:05:11*FromDiscord quit (Remote host closed the connection)
02:05:34*FromDiscord joined #nim
02:40:55*def- quit (Quit: -)
02:42:17*def- joined #nim
02:56:57*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
02:57:19*SchweinDeBurg joined #nim
04:28:41*def- quit (Quit: -)
04:30:39*def- joined #nim
04:35:25FromDiscord<weltraumpert> sent a long message, see https://pasty.ee/HnfYapGK
04:39:50FromDiscord<user2m> In reply to @weltraumpert "im new in nim,": yes that's correct, but the best way to get a feel for let, var and const is simply to play with the language . also id look @ this book in conjunction with cgpt https://ssalewski.de/nimprogramming.html
04:41:37NimEventerNew thread by weltraumpert: Nim logo, see https://forum.nim-lang.org/t/11608
04:46:47*cm quit (Quit: Bye.)
04:47:07*cm joined #nim
04:53:58FromDiscord<kots> Uh, let is a variable whose value cannot be changed, isn't it?
04:58:44FromDiscord<odexine> In reply to @Elegantbeef "Yes": I HELPED YOU WITH THAT NAME
05:01:25FromDiscord<user2m> In reply to @k0ts "Uh, let is a": yeah lol I totally missed that !
05:02:55FromDiscord<kots> There's a perfectly good manual right here that explains, among other things, the difference between let and var: https://nim-lang.org/docs/manual.html
05:03:23FromDiscord<kots> There's no need to resort to things like chatgpt which are known to produce complete nonsense 90% of the time
05:16:12FromDiscord<Elegantbeef> Who is @odexine ?
05:16:30FromDiscord<Elegantbeef> They have this weird notion that they helped with "Traitor"
05:17:50FromDiscord<odexine> 💀
05:20:15FromDiscord<Elegantbeef> I'm just playing into the name
05:25:24*madprops_ is now known as madprops
05:25:25*madprops quit (Changing host)
05:25:25*madprops joined #nim
05:41:37FromDiscord<morgan> In reply to @k0ts "There's a perfectly good": yeah read the manual instead of asking the incorrect plagiarism machine
05:43:08FromDiscord<morgan> In reply to @strogon14 "<@145405730571288577>: btw, VST is": yeah when people join the logic discord and ask about vsts (logic only supports au) when they mean plugins in general
05:43:12FromDiscord<Elegantbeef> I have a name!
05:43:17FromDiscord<morgan> lol
06:25:55*rockcavera quit (Remote host closed the connection)
06:37:21FromDiscord<misigomartin> hey guys so i cant see my nim tokens on my dym wallet despite the explorer saying that the tokens are there what could be the problem?
06:38:07FromDiscord<Elegantbeef> Damn this is a first
06:38:15FromDiscord<Elegantbeef> Nim is a programming language not a shitcoin
06:46:03FromDiscord<af0rg> Liar. It's a shitcoin.
06:46:55FromDiscord<Elegantbeef> Have I been writing in shitcoin this entire time
06:46:58FromDiscord<Elegantbeef> I knew something was sticky
06:53:44FromDiscord<af0rg> That's just my gum.
06:56:55FromDiscord<Robyn [She/Her]> In reply to @misigomartin "hey guys so i": This is the Nim programming server, not the cryptocurrency, sorry!
06:57:03FromDiscord<solitudesf> In reply to @misigomartin "hey guys so i": i stole it
06:57:41FromDiscord<Elegantbeef> I thought I stole it
06:58:07FromDiscord<af0rg> I stole this honey.
06:58:27FromDiscord<Elegantbeef> Your name is aforg but you're clearly abaer
07:03:28FromDiscord<af0rg> I'm just going to borrow that now. Thank you for a new username idea.
07:08:57*Guest85 joined #nim
07:09:21*Guest85 quit (Client Quit)
07:41:46FromDiscord<odexine> its not the first time beef lol
07:42:06FromDiscord<odexine> been a few times someone has asked about a cryptocurrency called NIM (this time all caps iirc)
07:42:33FromDiscord<odexine> ah, the shortcut (ticker?) is NIM, full name is Nimiq it seems
07:46:57FromDiscord<Robyn [She/Her]> Honestly wondering if it'd be worth wrapping the Python library 'Langchain' in Nim
07:47:01FromDiscord<Robyn [She/Her]> It probably isn't but idk
07:47:15FromDiscord<Robyn [She/Her]> May just be better to wrap the REST API
08:07:55*krux02__ quit (Remote host closed the connection)
08:18:58*redj quit (Quit: No Ping reply in 180 seconds.)
08:20:31*redj joined #nim
08:24:52FromDiscord<weltraumpert> In reply to @user2m "yes that's correct, but": I don't really understand about "the similar aspect" between var and let, var value can be change while let can't, for me it's like a const, not a var.
08:30:47FromDiscord<Elegantbeef> Except const exists and is a compile time constant
08:42:39FromDiscord<weltraumpert> In reply to @Elegantbeef "Except const exists and": So, "let" is more like "const" instead of "var," right? The only difference is that "const" is evaluated at compile time, whereas "let" is evaluated at run time. Or is there something wrong in my understanding?
08:42:58FromDiscord<Elegantbeef> `let` and `var` are similar cause they're runtime values
08:43:07FromDiscord<Elegantbeef> `const` is a static value and the most different
08:43:34FromDiscord<Elegantbeef> Since `let` is at runtime it's totally possible to mutate using unsafe mechanisms
08:44:30*gst joined #nim
08:44:30FromDiscord<weltraumpert> ok now I'm understand 🤣, The book I read was too long-winded, I was almost confused because of it
08:48:25FromDiscord<griffith1deadly> In reply to @Elegantbeef "Since `let` is at": `const` also can be mutated with some unsafe mechanisms (in C for sure, in Nim idk)
08:48:59FromDiscord<Elegantbeef> Const does not have an address in Nim
08:49:12FromDiscord<Elegantbeef> So to change it you have to write in the `.data` segment
08:49:19FromDiscord<Elegantbeef> So whilst you can do it... good luck
08:50:52FromDiscord<griffith1deadly> In reply to @Elegantbeef "So to change it": `.data` also can be mofidied in runtime
08:50:53FromDiscord<griffith1deadly> so..
08:51:07FromDiscord<Elegantbeef> Sure
08:51:07FromDiscord<griffith1deadly> atleast on windows
08:51:31FromDiscord<griffith1deadly> (edit) "mofidied" => "modified"
08:51:34FromDiscord<Elegantbeef> The amount of work you have to do to change a const is more complex than `myLet.addr[] = ...`
08:51:44FromDiscord<griffith1deadly> sure
09:09:05*beholders_eye joined #nim
09:18:42*beholders_eye quit (Ping timeout: 268 seconds)
09:25:44Amun-Raconst often can't be mutated in any way in C
09:42:25FromDiscord<tamada_.> Hello, is nim stable?
09:46:11FromDiscord<solitudesf> In reply to @tamada_. "Hello, is nim stable?": ~~yeah, just dont use async, orc, threading or nimble~~↵↵stable enough
09:54:22FromDiscord<horizonrce> In reply to @tamada_. "Hello, is nim stable?": Is anything stable
09:54:31FromDiscord<horizonrce> Define "stable"
09:54:42FromDiscord<horizonrce> A lot of things are unpredictable
09:59:13Amun-Rastable? a house full of horses
10:20:13FromDiscord<abaer> dont use pointers or fuck your mother and you should be good.↵(@tamada_.)
10:21:48FromDiscord<abaer> i need a drink after reading backlog.
10:22:26Amun-Ratry not to use cast[]()
10:29:38FromDiscord<abaer> or double pointers or triple pointers. \shudders\
10:31:50FromDiscord<Phil> quadruple pointers is where the money's at
10:49:17*def- quit (Quit: -)
10:50:41*def- joined #nim
11:01:02*xutaxkamay joined #nim
11:12:15FromDiscord<goerge_lsd> anyone got a lib/project to do parallel httpget/scrape ? I did it with async and it takes 10-15 min for 18k requests.. not acceptable
11:23:24FromDiscord<griffith1deadly> In reply to @goerge_lsd "anyone got a lib/project": https://github.com/guzba/curly
11:52:19FromDiscord<nervecenter> In reply to @tamada_. "Hello, is nim stable?": Very
12:04:14FromDiscord<mobius771> Is mastering nim available in pdf or ebook? I can only find a hard copy
12:36:17*krux02 joined #nim
12:38:03strogon14you can get the amazon kindle edition
12:59:56*def- quit (Quit: -)
13:00:37*def- joined #nim
13:02:14FromDiscord<mobius771> In reply to @strogon14 "you can get the": You mean Amazon's proprietary format? No thanks
13:13:16*rockcavera joined #nim
13:14:07FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=yGLGUCEj
13:20:21FromDiscord<abaer> you forgot to do the daily sacrifice of a new born baby.↵(@sOkam! 🫐)
13:20:46strogon14mobius771: between us: there are tools to convert kindle formats to proper epub :-)
13:21:51FromDiscord<abaer> 10 to 15 minutes is not that long.↵(@goerge_lsd)
13:24:55FromDiscord<abaer> probably can find it already in pdf format uploaded to a ftp server somewhere.↵(<@709044657232936960_strogon14=5b=49=52=43=5d>)
13:26:15*lucasta joined #nim
13:40:54FromDiscord<mobius771> In reply to @strogon14 "<@1056036702789054465>: between us: there": I don't give amazon any of my $$$
13:43:09FromDiscord<mobius771> In reply to @strogon14 "<@1056036702789054465>: between us: there": Just between us though, I'd be happy to give to to Andreas or the nim community if I could purchase it from the website 😉
13:43:31*ntat joined #nim
13:53:52FromDiscord<starkiller1493> In reply to @goerge_lsd "anyone got a lib/project": https://nimble.directory/pkg/malebolgia
13:53:58FromDiscord<michaelb.eth> In reply to @mobius771 "Just between us though,": Other folks said the same in the forum when the book was first announced, and then again when there was a 2nd printing announced, but that’s not a direction the author want/ed/s to go
14:04:45FromDiscord<solitudesf> sent a code paste, see https://play.nim-lang.org/#pasty=KhyFKZBy
14:10:09FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=WSrOTBUU
15:56:32*Figworm joined #nim
16:06:11*Figworm left #nim (#nim)
16:07:30FromDiscord<morgan> cmp has three possible return values iirc, less than, equal, or greater than
16:07:41FromDiscord<morgan> idk if sort actually uses that tho
16:11:25FromDiscord<odexine> its used for the sort order parameter
17:59:05*lucasta quit (Quit: Leaving)
18:38:51FromDiscord<haywiressc> simple question but how do i print a int as binary
18:50:05*def- quit (Quit: -)
18:50:22*def- joined #nim
18:57:58FromDiscord<Robyn [She/Her]> In reply to @haywiressc "simple question but how": `std/strutils` has `toBin`
20:04:32*jmdaemon joined #nim
20:09:58*craigbro quit (Remote host closed the connection)
20:18:04*ntat quit (Quit: Leaving)
20:30:07*jmdaemon quit (Ping timeout: 260 seconds)
20:49:40FromDiscord<bulletxbt> Nim equivalent to `str.encode("utf-8")`?
20:54:35FromDiscord<threefour> Looks like Unicode strings are handled with `std/unicode`. You'd convert a string to Unicode runes via the `toRunes(s: string): seq[Rune]` proc.
20:59:21*jmdaemon joined #nim
21:02:37FromDiscord<haywiressc> In reply to @chronos.vitaqua "`std/strutils` has `toBin`": only acceps biggestint for some reason
21:02:42FromDiscord<haywiressc> (edit) removed "for some reason"
21:03:00FromDiscord<Robyn [She/Her]> In reply to @haywiressc "only acceps biggestint": And what's the issue with that?
21:03:09FromDiscord<haywiressc> i have a uint64 and want to convert to binary
21:03:17FromDiscord<bulletxbt> `json.dumps(header, sort_keys=True, separators=(',', ':')).encode('utf-8')`↵Having trouble translating this to nim, especially the encoding part
21:03:17FromDiscord<Robyn [She/Her]> https://nim-lang.org/docs/ctypes.html#BiggestInt
21:03:21FromDiscord<haywiressc> but casting it to int64 it gets values out of range
21:03:29FromDiscord<haywiressc> cuz the bit used for sign
21:04:39FromDiscord<Robyn [She/Her]> In reply to @haywiressc "i have a uint64": Aaah, well this is the code here if you want to tweak it slightly? https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/strutils.nim#L908-L928
21:04:51FromDiscord<haywiressc> ahh may be a good idea
21:05:07FromDiscord<haywiressc> I think there is conversion to binary with string formatting somehow but im not sure
21:06:01*jmdaemon quit (Ping timeout: 268 seconds)
21:06:49FromDiscord<haywiressc> feels wrong having to copy and change code of a system library idk
21:07:42FromDiscord<Robyn [She/Her]> https://play.nim-lang.org/#pasty=NoxNVywl This small modification worked easily
21:07:51FromDiscord<Robyn [She/Her]> In reply to @haywiressc "feels wrong having to": Could always submit a PR? :P
21:08:37Amun-Rahaywiressc: this is my implementation: https://play.nim-lang.org/#pasty=wCrPYQcb
21:09:12FromDiscord<haywiressc> In reply to @Amun-Ra "<@536164435136479232>: this is my": thanks
21:09:34FromDiscord<haywiressc> In reply to @chronos.vitaqua "Could always submit a": i think i will copy paste code from you guys for now
21:09:37FromDiscord<Robyn [She/Her]> In reply to @Amun-Ra "<@536164435136479232>: this is my": Only for uints?
21:09:43FromDiscord<Robyn [She/Her]> In reply to @haywiressc "i think i will": No sweat!
21:09:45Amun-RaRobyn: yes
21:10:23*jmdaemon joined #nim
21:10:32FromDiscord<Robyn [She/Her]> `SomeInteger` works perfectly fine though, any reason you didn't support it by default?
21:11:09Amun-Ratbh I don't remember ;)
21:13:18FromDiscord<Robyn [She/Her]> Fair enough haha
21:26:55*beholders_eye joined #nim
21:32:45*lucasta joined #nim
21:58:48*gst quit (Quit: Client closed)
22:16:31FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=FvloiLyd
22:26:51FromDiscord<bulletxbt> sent a code paste, see https://play.nim-lang.org/#pasty=NjsDuvdm
22:29:13*def- quit (Quit: -)
22:29:36*def- joined #nim
22:31:07*jmdaemon quit (Ping timeout: 268 seconds)
22:54:45FromDiscord<Elegantbeef> I do not recall if `stream.write(string)` works as one expects or if it writes a pointer
22:54:59FromDiscord<Elegantbeef> I know sequences write a pointer
23:07:47FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "I do not recall": String is the only one with an overload, iirc
23:09:25FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=buNMzBFH
23:14:48FromDiscord<bulletxbt> sent a code paste, see https://play.nim-lang.org/#pasty=MLRhswuW
23:15:02FromDiscord<bulletxbt> (edit) "https://play.nim-lang.org/#pasty=Euphrkny" => "https://play.nim-lang.org/#pasty=ROiefHrn"
23:16:02FromDiscord<Elegantbeef> yep there's the pointer issue
23:16:22FromDiscord<Elegantbeef> you want to do `stream.write $myJsonNode`
23:16:34FromDiscord<bulletxbt> So I don't need to encode it?
23:17:09FromDiscord<bulletxbt> I forgot to add that I redefine headerJson before writing it: `headerJson = toRunes($headerJson & repeat(0'u8.char, diff))`
23:17:14FromDiscord<bulletxbt> Does that affect anything
23:17:17FromDiscord<Elegantbeef> Nim strings are encodeless
23:17:43FromDiscord<bulletxbt> I'll try it
23:19:16FromDiscord<Elegantbeef> Most people write ascii or utf8 to them, but they have no forced encoding
23:29:12*beholders_eye quit (Read error: Connection reset by peer)
23:35:09*beholders_eye joined #nim
23:47:58FromDiscord<sOkam! 🫐> do sets qualify as `openArray[T]`?
23:56:45FromDiscord<Elegantbeef> no
23:57:02FromDiscord<Elegantbeef> Nore can they
23:57:05FromDiscord<Elegantbeef> nor\
23:57:33FromDiscord<Elegantbeef> Hashsets do not store data contiguously there are empty slots. `set`s are not arrays of values they're bits