<< 06-11-2022 >>

00:01:56FromDiscord<Phil> If you can get my pseudocode snippets above to compile anywhere I'll be wildly impressed
00:03:19FromDiscord<dlesnoff> In reply to @ChocolettePalette "There's a bug in": does it not provide an exit code? It is probably the getCpuInfo proc. Do you have a /proc/cpuinfo file?↵I don't know who you are talking to.
00:03:44*wallabra quit (Ping timeout: 276 seconds)
00:03:59FromDiscord<Phil> I'm semi sure myself since Chocolette makes the odd joke here and there
00:36:04*neceve quit (Ping timeout: 272 seconds)
00:36:41FromDiscord<⎝⪩﹏⪨⎠> What's wrong with this code? https://media.discordapp.net/attachments/371759389889003532/1038612850240913489/image.png https://media.discordapp.net/attachments/371759389889003532/1038612850576474194/image.png
00:38:11FromDiscord<ranjeet singhi (young man)> One thing that isn't wrong is that beautiful theme you are using WHAT IS IT
00:39:09FromDiscord<AmjadHD> What's the difference between `type` and `typedesc` ?
00:39:41FromDiscord<⎝⪩﹏⪨⎠> In reply to @ranjeet singhi (young man) "One thing that isn't": Darktooth + ColdCode for the screenshots.
00:42:03FromDiscord<gibson> How can `$` for `float` be influenced to produce non-scientific notation?
00:42:52FromDiscord<Elegantbeef> Your return type is `string or T`
00:42:53FromDiscord<Elegantbeef> Nim doesnt allow that really
00:42:53FromDiscord<Elegantbeef> It's one or the other not both
00:43:47FromDiscord<Elegantbeef> `strutils.formatFloat`
00:44:04FromDiscord<Elegantbeef> What you're after is an CTE error likely
00:44:24FromDiscord<⎝⪩﹏⪨⎠> In reply to @Elegantbeef "It's one or the": So instead of returning a string, I should raise an error.
00:44:39FromDiscord<Elegantbeef> No you can do it statically
00:50:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4f4e
00:50:29FromDiscord<Rika> In reply to @AmjadHD "What's the difference between": First declares a type, second is the type encapsulated as a value (kinda)
01:13:42FromDiscord<AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=4f4i
01:14:22FromDiscord<Elegantbeef> `type` is an alias for `typedesc`
01:14:39FromDiscord<Generic> oh since when?
01:14:51FromDiscord<Elegantbeef> Pre 1.0
01:15:02FromDiscord<Generic> hm, never noticed
01:15:17FromDiscord<Elegantbeef> `typedesc` is the "proper" one
01:15:27FromDiscord<Generic> it is a bit weird
01:15:47FromDiscord<Generic> because it can also be used as a function
01:16:03FromDiscord<Elegantbeef> Exactly why you should use `typeof` and `type[T]`
01:17:49FromDiscord<Elegantbeef> Sorry `typedesc[T]`
01:17:56FromDiscord<Generic> ~~I would rather have Nim to be not such a keyword hog~~
01:18:40FromDiscord<AmjadHD> In reply to @AmjadHD "Is there an option": Why is compiling `runnableExamples` necessary in docs generation ?
01:18:40FromDiscord<Generic> but alas it is far too late
01:19:10FromDiscord<Generic> also the keywords are kind of necessary to make the grammar simpler than say C++
01:19:12FromDiscord<Elegantbeef> Cause you want the code embedded in the docs to work↵(@AmjadHD)
01:19:41FromDiscord<AmjadHD> In reply to @Elegantbeef "Cause you want the": I don't.
01:20:19FromDiscord<AmjadHD> I want it to generate docs fast.
01:22:17FromDiscord<Bung> wrong example imply wrong document
01:22:43FromDiscord<Elegantbeef> Then dont use runnable examples use code blocks in your doc comment
01:25:41FromDiscord<AmjadHD> When I run `koch docs` to update the generated docs after fetching from upstream it takes a lot of time to finish, When I'm pretty sure the runnableExamples are fine because they passed the CI.
01:27:37FromDiscord<Elegantbeef> There might be a feature to do it, but idk
01:32:47FromDiscord<Hieronymus Frach> I program for fun and have been wanting to learn a new language for the past few days now. Heard about Nim from fireship, so far looks awesome! Should I learn nim coming from a python-only background?
01:33:32FromDiscord<huantian> no reason not to, do expect it to be a decent amount different from python though
01:34:00FromDiscord<Tuatarian> If you want to, go for it
01:34:07FromDiscord<Tuatarian> Not too much anybody can say
01:34:08FromDiscord<huantian> at least in some ways it's definitely different
01:37:08FromDiscord<Hieronymus Frach> In reply to @iWonderAboutTuatara "Not too much anybody": Good point considering this was also posted in the official server. I am going to give it a try and have fun with it
01:42:46FromDiscord<Tuatarian> If you're learning, I'd recommend nim by example + nim basics + official tutorial
01:43:02FromDiscord<Tuatarian> Don't need to go through those all at once but you should refer back frequently
01:43:23FromDiscord<Tuatarian> The error messages can be a bit confusing at first, feel free to Google or ask if confused
02:12:26FromDiscord<Tower> sent a code paste, see https://play.nim-lang.org/#ix=4f4v
02:13:54FromDiscord<Tower> sent a code paste, see https://play.nim-lang.org/#ix=4f4w
02:14:22FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/WdR
02:14:44FromDiscord<Elegantbeef> In type definitions Nim assumes `proc(...): .. {.closure.}` for `proc`s
02:15:03FromDiscord<Elegantbeef> which means you either need to explicitly state "I only want Nimcalls" or raise the nimcall to closure
02:15:50FromDiscord<Tower> Thank you!! what is the ELI5 of closure vs nimcall? I remember reading that closures can use external variables within its scope (or something similar), though I don't immediately see how that is relevant to what I was trying 🤔
02:16:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4f4x
02:16:45FromDiscord<Elegantbeef> Like i said nim defaults to `closure` calling conventions on procedures, and closures are not compatible with nim's default calling convention(nimcall)
02:17:05FromDiscord<Elegantbeef> The difference between a closure and nimcall is that a closure is really a tuple `(Environment, PointerProc)`
02:17:26FromDiscord<Elegantbeef> The environment holds the data you need for the storage
02:18:13FromDiscord<Elegantbeef> You can see this if you do `assert sizeof(proc()) != sizeof(proc(){.nimcall.})`
02:20:13FromDiscord<Tower> > Like i said nim defaults to closure calling conventions on procedures, and closures are not compatible with nim's default calling convention(nimcall)↵so wait, is nim's default closure, or is its default nimcall? Sorry about my misunderstanding, but your message seems to imply both
02:20:24FromDiscord<Elegantbeef> Default in type definition is closure
02:20:27FromDiscord<Tower> (edit) "> Like i said nim defaults to closure calling conventions on procedures, and closures are not compatible with nim's default calling convention(nimcall)↵so wait, is nim's default ... closure," added "calling convention"
02:20:43FromDiscord<Elegantbeef> Default as a definition is nimcall(unless anonymous)
02:20:52FromDiscord<Tower> Okay, so the type definition defaults to closure, but "regular" procs default to nimcall↵I think i get it a bit more now
02:21:05FromDiscord<Tower> Is there a benefit to having the defaults differ?
02:21:06FromDiscord<Tuatarian> how do you dealloc a variable?
02:21:24FromDiscord<Tuatarian> I'm just doing `dealloc(addr (the variable))` which segfaults
02:21:38FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4f4y
02:21:56FromDiscord<Elegantbeef> The benefit is you can inline non closures, and dont have a complex program for basic things
02:22:18FromDiscord<Elegantbeef> `dealloc(theVariable)`
02:22:18FromDiscord<Elegantbeef> If it's a variable that is a pointer you allocated
02:22:34FromDiscord<Elegantbeef> What exactly are you doing tuatara
02:22:42FromDiscord<Tuatarian> I'll just send the code
02:22:55FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=4f4z
02:22:57FromDiscord<Tuatarian> ideally I'd set precs at compile time
02:23:04FromDiscord<Tuatarian> couldn't find a very good way to do it though
02:23:08FromDiscord<Elegantbeef> You dont dealloc it
02:23:16FromDiscord<Elegantbeef> Nim's memory management will clean it up
02:23:34FromDiscord<Tuatarian> ok arc will get rid of it I guess since it's never used again?
02:23:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4f4A
02:23:59FromDiscord<Elegantbeef> Of course it will
02:24:13FromDiscord<Tuatarian> I didn't realize that worked with block
02:24:23FromDiscord<Elegantbeef> \In nim everything can be an expression
02:24:32FromDiscord<Elegantbeef> Who has the next question i'm on a streak!
02:24:32FromDiscord<Tuatarian> since I thought loops were runtime in general, but I guess you can force it to be comptime by assigning it to a comptime const
02:24:39FromDiscord<Tuatarian> super helpful, thanks!
02:24:51FromDiscord<Elegantbeef> Well is `precLines` a runtime or compile time value?
02:24:54FromDiscord<Tuatarian> comptime
02:24:57FromDiscord<Elegantbeef> Then yea
02:25:04FromDiscord<Elegantbeef> Nim allows all code to run statically if you tell it
02:25:09FromDiscord<Elegantbeef> either inside a const or a `static:` block
02:25:37FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4f4C
02:26:00FromDiscord<Elegantbeef> I say all but as you likely know it's a subset
02:26:29FromDiscord<Tuatarian> yeah
02:26:32FromDiscord<Tuatarian> thanks!
02:27:00FromDiscord<Tuatarian> I guess here precs would still be mutable, just assigned initially at comptime?
02:27:12FromDiscord<Elegantbeef> Yes
02:27:21FromDiscord<Tuatarian> how does that actually work?
02:27:35FromDiscord<Tuatarian> how does one allocate memory at comptime? or is it just done at init time
02:27:52FromDiscord<Elegantbeef> The constant is stored in the program and on initialisation it copies from the static
02:28:02FromDiscord<Elegantbeef> It's the same as `var a = const`
02:28:12FromDiscord<Elegantbeef> It's just moving the const into the definition
02:28:54FromDiscord<Tuatarian> I see
02:29:02FromDiscord<Tuatarian> thanks!
02:30:26FromDiscord<Tuatarian> gives a bit of an odd error
02:30:28FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=4f4E
02:30:46FromDiscord<Tuatarian> `/home/tuatarian/code/Heaviside/parlex.nim(17, 22) Error: type mismatch: got <proc (initialSize: int): Table[system.string, system.int]{.noSideEffect, gcsafe.}, string, int>`
02:30:53FromDiscord<Tuatarian> copying things from terminal is kind of a pain ngl
02:30:54FromDiscord<Elegantbeef> `()`
02:31:09FromDiscord<Tuatarian> oh oops
02:31:10FromDiscord<Tuatarian> thanks
02:31:48FromDiscord<Elegantbeef> I'm something of a compiler myself
02:32:34FromDiscord<!!sharpcdf!!> sent a code paste, see https://play.nim-lang.org/#ix=4f4F
02:32:42FromDiscord<!!sharpcdf!!> ive installed lfs and i added it to my repo but it didnt change anything
02:32:57FromDiscord<Elegantbeef> Why are you shipping `.so` in a git repo?
02:33:05FromDiscord<!!sharpcdf!!> and im not sure how to remove libLLVM thing
02:33:06FromDiscord<!!sharpcdf!!> im not
02:33:09FromDiscord<!!sharpcdf!!> i dont know how it got there
02:33:19FromDiscord<!!sharpcdf!!> i think i installed it while working on the repo and it accidentally got mixed in
02:34:21FromDiscord<Elegantbeef> Search your commits that add it, remove it from that commit continue
02:36:05FromDiscord<!!sharpcdf!!> how do i do that 😅 not very good with git
02:36:39FromDiscord<Elegantbeef> `git log name-status`
02:36:49FromDiscord<Elegantbeef> find the commit that adds that file
02:37:40FromDiscord<Elegantbeef> `git rebase -i commit` mark it `edit`. `git rm` said file and `git add --all`. then `git rebase --continue` until you get home
02:38:06FromDiscord<Elegantbeef> Actually you might need to do `git rebase -i HEAD~5` or however many commits back it is
02:38:38FromDiscord<!!sharpcdf!!> 🫠
02:38:55FromDiscord<Elegantbeef> Time to learn git 😛
02:39:08FromDiscord<!!sharpcdf!!> definitely need to skim over the documentation for it one of these days
02:39:45FromDiscord<Elegantbeef> Start contributing to projects, you'll learn it and make multiple mistakes
02:40:09FromDiscord<!!sharpcdf!!> its weird though because its not even in the folder of the project
02:41:26FromDiscord<Elegantbeef> I do like that you attempted to add git-lfs instead of fixing the problem
02:41:30FromDiscord<Elegantbeef> That's some fun stuff
02:52:40FromDiscord<!!sharpcdf!!> it recommended to do that so i kinda just went along lol
02:53:29FromDiscord<!!sharpcdf!!> git scares me when i somehow manage to trigger a merge and then fix conflicts with incoming changes instead of current changes and then i have a ruined project that i spent 2 days on aaaaaaaaaa
02:54:03FromDiscord<!!sharpcdf!!> git merge --abort is my best friend
02:54:35FromDiscord<!!sharpcdf!!> im thinking about just deleting the local git repo, init a new one then make a remote to the one on github
02:54:44FromDiscord<!!sharpcdf!!> that typically works without having to fix any conflicts
02:57:58FromDiscord<!!sharpcdf!!> oh no
02:58:52*thomasross quit (Quit: Leaving)
03:01:20FromDiscord<Rika> Personally use a git helper like lazy git
03:04:03FromDiscord<!!sharpcdf!!> interesting
03:04:26FromDiscord<!!sharpcdf!!> especially because ive never heard of it and i think i just lost all my work
03:04:27FromDiscord<!!sharpcdf!!> 3rd time
03:07:44FromDiscord<Elegantbeef> Always make a new branch when doing things that you're unsure of
03:07:48FromDiscord<!!sharpcdf!!> bruh somehow my commit history went back like 2 months
03:07:54FromDiscord<!!sharpcdf!!> i cant fix it
03:08:18FromDiscord<!!sharpcdf!!> im sure of it
03:09:09FromDiscord<!!sharpcdf!!> i just had trouble with the llvm thing because somehow it added to my repo
03:09:15FromDiscord<!!sharpcdf!!> and it broke everything
03:10:50FromDiscord<!!sharpcdf!!> i am extremely sad and disappointed right now
03:23:57*arkurious quit (Quit: Leaving)
03:32:07FromDiscord<Cheesy Brik> sent a code paste, see https://play.nim-lang.org/#ix=4f4M
03:32:17FromDiscord<Elegantbeef> `import std/[hashes, random]`
03:32:25FromDiscord<Cheesy Brik> (edit) "https://play.nim-lang.org/#ix=4f4M" => "https://paste.rs/TOL"
03:32:26FromDiscord<Cheesy Brik> Ah ok nice
03:49:05FromDiscord<MrNavaStar> Hi! I'm new here. Is there a good place for me to ask questions about a library? Im having trouble using the Serial library and was wondering if there was anyone who could give me a hand!
03:49:08FromDiscord<MrNavaStar> (edit) "hand!" => "hand"
03:49:55FromDiscord<Elegantbeef> Here is likely fine
03:50:24FromDiscord<MrNavaStar> okay awesome
03:50:37*mahlon quit (*.net *.split)
03:50:48FromDiscord<Elegantbeef> Might be a bit difficult for actually testing 😄
03:51:17*mahlon joined #nim
03:52:49FromDiscord<MrNavaStar> sent a code paste, see https://play.nim-lang.org/#ix=4f4N
03:53:07FromDiscord<MrNavaStar> if anyone has some clues as to what im doing wrong, that would be awesome!
03:53:36FromDiscord<Elegantbeef> you can just do `port.read(buff)` not that it'll fix anything
03:54:19FromDiscord<MrNavaStar> really? it doesn't seem to be happy about that
03:54:39FromDiscord<MrNavaStar> maybe different for async and non async?
03:54:48FromDiscord<Elegantbeef> Ah right async 😄
03:57:33FromDiscord<Elegantbeef> Kinda odd there isnt a timeout length, i wagered that'd be the problem
03:58:36FromDiscord<MrNavaStar> oh, how do I set that? This code is basically just copied from the Serial libraries examples
03:58:55*joast quit (*.net *.split)
03:58:55*Onionhammer quit (*.net *.split)
03:58:55*lain quit (*.net *.split)
03:58:55*dza quit (*.net *.split)
03:59:13*Onionhammer joined #nim
03:59:50*lain joined #nim
03:59:55FromDiscord<Elegantbeef> Yea that's my point
03:59:55FromDiscord<Elegantbeef> The library doesnt have a timeout
03:59:59FromDiscord<MrNavaStar> oooo
04:00:31*dza joined #nim
04:03:32*adium quit (*.net *.split)
04:03:32*NimEventer quit (*.net *.split)
04:03:32*termer quit (*.net *.split)
04:03:43*NimEventer joined #nim
04:04:18*termer joined #nim
04:04:45*adium joined #nim
04:05:59FromDiscord<Elegantbeef> I dont really have a way to test this afaik, so cannot say much sadly
04:06:27FromDiscord<MrNavaStar> all good, thanks anyway!
04:08:20FromDiscord<MrNavaStar> its so weird, even running a direct copy paste of their example code doesn't work
04:14:40*estiquelapice quit ()
04:15:01*estiquelapice joined #nim
04:16:26*Goodbye_Vincent quit (*.net *.split)
04:16:26*kevinsjoberg quit (*.net *.split)
04:16:26*robertmeta quit (*.net *.split)
04:16:26*gshumway quit (*.net *.split)
04:16:26*ttkap quit (*.net *.split)
04:16:48*kevinsjoberg joined #nim
04:16:54*robertmeta joined #nim
04:17:03*Goodbye_Vincent joined #nim
04:18:12*gshumway joined #nim
04:28:49FromDiscord<JeysonFlores> holy cow, I was happy because in my free-time startup I finally started to use Nim for production. I was designing a pub/sub websockt-based service for realtime notifications. I used Jester and the WS library, but suddenly when I started to test the draft, the performance was horrible
04:29:03FromDiscord<Cheesy Brik> Can someone explain to me why nim uses `result =` instead of a return keyword? It already has a yield keyword.
04:29:10FromDiscord<Elegantbeef> Did you do `-d:release`?
04:29:33FromDiscord<Require Support> In reply to @Cheesy Brik "Can someone explain to": you can use return too i think
04:29:34FromDiscord<Elegantbeef> It has both↵(@Cheesy Brik)
04:29:44FromDiscord<Elegantbeef> an implicit `result` and an explicit `return`
04:32:32*Yardanico quit (*.net *.split)
04:32:32*qwestion quit (*.net *.split)
04:32:32*syl quit (*.net *.split)
04:32:45*Yardanico joined #nim
04:32:50*Yardanico quit (Changing host)
04:32:50*Yardanico joined #nim
04:33:04FromDiscord<Cheesy Brik> In reply to @Elegantbeef "It has both (<@666999744572293170>)": Oh I see, I just read the docs, so the result var is like a store for stuff you wanna return at the end of the function not an actual return. The why is the common syntax to use result= even if return would do the same thing?
04:33:19FromDiscord<Elegantbeef> Cause `return`ing is generally for a different semantic
04:33:28FromDiscord<Elegantbeef> Nim also has implicit return
04:33:38FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/qp1
04:34:11*syl joined #nim
04:36:15FromDiscord<Cheesy Brik> In reply to @Elegantbeef "Nim also has implicit": That’s so interesting, is that evaluated at compile time to be just as efficient?
04:37:04FromDiscord<Elegantbeef> Not evaluated but yes it's converted to the same
04:38:22FromDiscord<Cheesy Brik> In reply to @Elegantbeef "Not evaluated but yes": Useful, nim continues to surprise me with how simple it can be while still giving a ton of control
04:45:47FromDiscord<Elegantbeef> Hey this is a common complaint "It has too many ways to do the same thing"
05:30:34*ltriant quit (Ping timeout: 272 seconds)
05:54:54*mahlon quit (Ping timeout: 260 seconds)
05:57:32*mahlon joined #nim
06:00:58*Onionhammer7 joined #nim
06:02:08FromDiscord<ynfle> Anyone deployed nim to aws lambda that could help me?
06:02:12*dza6 joined #nim
06:03:04*Onionhammer quit (Ping timeout: 260 seconds)
06:03:04*Onionhammer7 is now known as Onionhammer
06:03:28FromDiscord<ynfle> I'm trying to use the right `--cpu` because I am on an m1 mac
06:03:39*dza quit (Ping timeout: 260 seconds)
06:03:39*dza6 is now known as dza
07:20:30FromDiscord<ChocolettePalette> You might need to consider cross-compilation i.e. using both --os and --cpu. You need to somehow inquire about what CPU is used at AWS, which doesn't depend on your own CPU iirc
07:36:21*tanami quit (Ping timeout: 268 seconds)
07:47:10FromDiscord<soda> sent a code paste, see https://play.nim-lang.org/#ix=4f5s
07:53:51FromDiscord<Rika> Install the version of OpenSSL that starts with a 1
07:54:23FromDiscord<ringabout> What's your Nim version btw?
07:55:18FromDiscord<ringabout> I saw tge same error yesterday.
07:55:30FromDiscord<ringabout> (edit) "tge" => "the"
07:55:45FromDiscord<ringabout> In reply to @Isofruit "> (base) ~/dev/playground %": here
07:56:12FromDiscord<soda> In reply to @Rika "Install the version of": okay thanks
07:56:25FromDiscord<soda> In reply to @flywind "What's your Nim version": 1.6.6
07:56:28FromDiscord<Phil> Can confirm btw that it's still a thing
07:56:54FromDiscord<ringabout> In reply to @Isofruit "Can confirm btw that": Yeah, what's your OS?
07:56:57FromDiscord<Phil> though mine is more a choosenim issue, nimble itself worked yesterday
07:57:10FromDiscord<Phil> Arch and I'm on pretty much all the newest updates
07:57:16FromDiscord<soda> ^
07:57:40FromDiscord<ringabout> Does Arch default to OpenSSL 3?
07:57:56FromDiscord<Phil> That is a very good question that I'll need to google to figure out
07:58:23FromDiscord<soda> @ringabout yes
07:58:34FromDiscord<ringabout> There is a `getSSLVersion` in openssl libray
07:58:34FromDiscord<Phil> > (base) ~ % openssl version↵> OpenSSL 1.1.1n 15 Mar 2022
07:58:41FromDiscord<ringabout> (edit) "libray" => "library"
07:59:14FromDiscord<soda> sent a code paste, see https://play.nim-lang.org/#ix=4f5t
07:59:26FromDiscord<ringabout> (edit) "`getSSLVersion`" => "`getOpenSSLVersion`" | "library" => "library."
07:59:32FromDiscord<Phil> Grabbed the last 3 updates, rebooting and then I'll respond again
08:00:38FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4f5v
08:00:47FromDiscord<Phil> Still the same for me
08:00:51FromDiscord<soda> i just notice that everything openssl related is broken on my end
08:00:54*mahlon quit (Ping timeout: 260 seconds)
08:00:55FromDiscord<Phil> I am on devel as a sidenote
08:01:29FromDiscord<Elegantbeef> Did you rebuild choosenim with devel?
08:01:37FromDiscord<ringabout> In reply to @Isofruit "> (base) ~ %": That seems not to be a different issue.
08:02:07FromDiscord<ringabout> Probably open an issue on the issue tracker of choosenim
08:02:14FromDiscord<ringabout> (edit) removed "not"
08:02:41FromDiscord<ringabout> `choosenim` supports arch?
08:03:47*mahlon joined #nim
08:07:18FromDiscord<rakgew> sent a code paste, see https://play.nim-lang.org/#ix=4f5x
08:10:05FromDiscord<rakgew> in libusb video https://yewtu.be/watch?v=If7qsVvkIH0 (\~min25)↵for C I saw them just indexing it\: `inter = &config->interface[i];`
08:10:17FromDiscord<Elegantbeef> `interfaceArr = cast[ptr UncheckedArray[ptr LibusbConfigDescriptor](libusbGetConfig....)`
08:10:19FromDiscord<rakgew> but that did not seem to work for the nim type
08:10:43FromDiscord<Elegantbeef> Wait that's not right 😄
08:11:25FromDiscord<Elegantbeef> The wrapping uses `ptr LibUsbInterface` instead of `ptr UncheckedArray[...}`
08:11:53FromDiscord<Elegantbeef> So you will need to do `cast[ptr UncheckedArray[LibUsbInterface]](config.interfaces)[i]`
08:11:56FromDiscord<rakgew> aha - with some casting magic. thank you so much Elegantbeef!
08:12:05FromDiscord<Elegantbeef> Blame the author in this case
08:12:10FromDiscord<rakgew> yes it is a `ptr LibUsbInterface`
08:12:22FromDiscord<Elegantbeef> PR the change to use a `ptr UncheckedArray` 😄
08:13:07FromDiscord<rakgew> oh ok. thank you!
08:13:25FromDiscord<Phil> In reply to @Elegantbeef "Did you rebuild choosenim": Nope
08:13:43FromDiscord<Elegantbeef> In Nim you can only index arrays in C you can index pointers
08:14:06FromDiscord<Elegantbeef> So you need to use the UncheckedArray for collections to not have an annoying cast
08:14:42FromDiscord<Phil> However, I might as well reinstall choosenim
08:15:49FromDiscord<Phil> Reinstall of choosenim bumped me down to nim 1.6.8, on there choosenim works again
08:43:42FromDiscord<albassort> hey guys im kinda braindead
08:43:59FromDiscord<albassort> how the hell is E38184 actually 3044 in hex
08:44:07FromDiscord<albassort> what method of conversion is this
08:45:29*Goodbye_Vincent quit (Quit: )
08:46:40FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1038736160203210812/image.png
08:46:43FromDiscord<albassort> this is breaking my brain
08:47:26FromDiscord<Generic> it's UTF8
08:48:14FromDiscord<albassort> im reading that right now
08:48:25FromDiscord<albassort> different standards
08:48:34FromDiscord<albassort> dumb digital technology
08:48:41FromDiscord<Generic> it's not dumb at all
08:48:49FromDiscord<Generic> it's just something completely different
08:48:52FromDiscord<albassort> its really smart and efficient
08:49:12FromDiscord<albassort> but im hear trying to figure out how two numbers correlate and my mind was melting
08:49:50*jjido joined #nim
09:00:22FromDiscord<demotomohiro> If unicode was encoded as 3 or 4 bytes fixed size charactor, it would be much simpler and easy to understand.
09:05:15FromDiscord<Generic> UTF-16 and UTF-32 exist
09:06:00FromDiscord<Generic> though in this English-centric world we live in, UTF-8 is a good idea
09:06:16FromDiscord<Generic> besides it avoids some other issues
09:06:25FromDiscord<Generic> like it doesn't need byte order marks
09:06:57FromDiscord<&Makarov/1> hello beautiful people , pls is there any guide for leaening nim for system programming , a book or something ? cause i wanna learn some system programming and i really lack guidance ! and thanks in advance !
09:18:00*Goodbye_Vincent joined #nim
09:21:31FromDiscord<albassort> In reply to @demotomohiro "If unicode was encoded": currently searching for an index for utf-8
09:39:14FromDiscord<albassort> ok
09:39:22FromDiscord<albassort> so utf8 is unicode right
09:39:26FromDiscord<albassort> thats super cool
09:39:41FromDiscord<albassort> i cant find a single explanation for how the encoding happens
09:45:37FromDiscord<Generic> https://en.wikipedia.org/wiki/UTF-8#Encoding
09:45:39FromDiscord<Generic> ???
09:47:44FromDiscord<Horizon [She/Her]> In reply to @Isofruit "Damn I can phone": Ah, no proc 1 needs to be able to read variables in proc 3, and afaik, proc 1 also needs to be in proc 2 for macros
09:48:39FromDiscord<Generic> In reply to @&Makarov/1 "hello beautiful people ,": there are two books, Nim in Action (which is already a bit older) and Mastering Nim (which was only recently published)
09:48:54FromDiscord<Generic> I can't say much about them personally, because I haven't read either of them
09:49:02FromDiscord<&Makarov/1> In reply to @Generic "there are two books,": oooh thanks for your kind reply dear friend !
09:49:10FromDiscord<&Makarov/1> surely i'll check them !
09:49:25FromDiscord<&Makarov/1> m currently a web dev , but i didnt like much the field ! 😂
09:50:05FromDiscord<Generic> well if you're out for a Nim job, then be aware that there aren't that many out there
09:50:47FromDiscord<&Makarov/1> In reply to @Generic "well if you're out": m more into research and fun ! 😂
09:51:18FromDiscord<&Makarov/1> currently m elixir dev , and they arent many jobs in my country also 😂
09:51:56FromDiscord<Generic> oh ok, if you're coming from Elixir, Nim will be almost mainstream compared to that haha
09:54:29FromDiscord<&Makarov/1> In reply to @Generic "oh ok, if you're": wdym by mainstream ?
09:54:58FromDiscord<Bung> mainstream language I guess
09:56:06FromDiscord<&Makarov/1> alright thanks guys !
09:56:21FromDiscord<&Makarov/1> btw why they are a lot of bots here 😅
09:57:09*ltriant joined #nim
09:57:33FromDiscord<Bung> they use different clients matrix here
09:59:25FromDiscord<&Makarov/1> In reply to @Bung "they use different clients": different client for discord ?
09:59:37FromDiscord<&Makarov/1> that's new for me 😅
10:00:26FromDiscord<&Makarov/1> but why ?
10:00:38FromDiscord<that_dude> Not different discord clients
10:00:52FromDiscord<that_dude> other chat systems have been bridged with the discord channels via bots
10:01:07FromDiscord<that_dude> that way irc and matrix chat rooms (other programn) can communicate in here too
10:01:13FromDiscord<rakgew> matrix is bridged to discord (or the other way around) - for matrix there are many different clients
10:01:28FromDiscord<&Makarov/1> In reply to @rakgew "matrix is bridged to": alright , but why ? 😅
10:01:30FromDiscord<that_dude> (edit) "programn)" => "programs)"
10:01:34FromDiscord<&Makarov/1> i guess i cant use voice chat right ?
10:02:04FromDiscord<Bung> like I'd prefer irc cli client, but some channel not bridged
10:02:25FromDiscord<that_dude> In reply to @&Makarov/1 "alright , but why": For the same reason we don't only talk on facebook messenger. It's a preference where we want to talk and what client to use
10:02:30FromDiscord<Bung> now I use element client on a Pentium cpu mini pc
10:02:46FromDiscord<Phil> In reply to @Event Horizon "Ah, no proc 1": Would the template idea work? It would pretty much just split out the generating of the proc and the mechanics could all work as before, just makes the code a bit simpler to read.↵template could be called "generateProc1()" with proc1 being whatever your proc name is
10:02:55FromDiscord<&Makarov/1> In reply to @Bung "now I use element": aaah alright !
10:03:21FromDiscord<Phil> (edit) "before," => "before (since you'll still be syntactically copy-pasting code and get the same code as an end-result),"
10:04:27FromDiscord<Horizon [She/Her]> Nope, because proc 1 has a different implementation every time
10:05:41FromDiscord<Horizon [She/Her]> In reply to @Isofruit "Would the template idea": There's only one version of proc 3, but for every variation of proc 1 (which there'll be many of), there's another variation of proc 2, though proc 2 typically stays the same since proc 2 just 'wraps' proc 1
10:06:08*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
10:18:12FromDiscord<dlesnoff> In reply to @Elegantbeef "`git rebase -i commit`": I love git trickery, it seems so magic to newcomers, but is just natural when you understand commit tree, branches, and log rebasing.
10:18:54FromDiscord<dlesnoff> In reply to @flywind "Does Arch default to": good to know. I'll probably won't do a pacman -Syu for now ^^
10:29:11FromDiscord<konradmb> In reply to @&Makarov/1 "alright , but why": This site explains why in detail: https://joinmatrix.org/guide/matrix-vs-discord/
10:29:40FromDiscord<konradmb> I use both, but usually prefer Matrix
10:31:56*neceve joined #nim
10:43:05FromDiscord<&Makarov/1> In reply to @konradmb "This site explains why": alright , thaanks !
10:52:17*neceve_ joined #nim
10:53:33*neceve_ quit (Client Quit)
10:59:19FromDiscord<pyryrin> sent a code paste, see https://play.nim-lang.org/#ix=4f6b
11:00:34FromDiscord<rakgew> sent a long message, see http://ix.io/4f6e
11:04:03FromDiscord<Generic> In reply to @pyryrin "do nim seqs like": yes, conceptually they're the same data structure, though details like the growth function may differ
11:04:35FromDiscord<pyryrin> so it does kinda grow capacity wirdly or new allocation everytime you add element
11:04:44FromDiscord<pyryrin> ?
11:05:11FromDiscord<Generic> it doesn't grow with every allocation
11:05:21FromDiscord<Generic> that's the entire point
11:05:35FromDiscord<pyryrin> okay
11:08:18FromDiscord<Generic> ok I've just looked into the actual implementation
11:08:33FromDiscord<Generic> and gc:arc seqs actually only grow by as much as necessary
11:08:38FromDiscord<Generic> so I was wrong, huh
11:09:12FromDiscord<pyryrin> is it same with gc:orc
11:09:25FromDiscord<Generic> yes, they're exactly the same except for the cycle collector
11:09:42FromDiscord<pyryrin> so its basically every add is a new allocation
11:09:45FromDiscord<pyryrin> right
11:09:48FromDiscord<Generic> yeah
11:10:04FromDiscord<pyryrin> but deletion doesnt deallocate
11:10:07FromDiscord<Generic> yeah
11:10:10FromDiscord<Generic> when creating a seq you can set an initial capacity though
11:10:15FromDiscord<pyryrin> okay
11:10:51FromDiscord<Generic> though now that I know this I have to go through some code I've written which is supposed to be fast
11:10:52FromDiscord<Generic> haha
11:11:37FromDiscord<Generic> because I've always assumed add would grow by more than one element
11:34:30*neceve_ joined #nim
11:39:15FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4f6q
11:39:38*neceve_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
11:48:42FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4f6t
11:50:35FromDiscord<auxym> but IMO, the easiest or most obvious way to understand generics is container types. `proc a[T](s: seq[T] = ...` is a proc that can take a seq containing any type (homogeneously, of course)
11:53:17FromDiscord<auxym> (also note that your template could be just a proc)
11:58:33FromDiscord<sOkam!> In reply to @auxym "but IMO, the easiest": what do you mean by container types?
11:58:58FromDiscord<auxym> types that contain other types. seqs, arrays, tables, seqs, etc
11:59:08FromDiscord<auxym> (edit) "seqs," => "sets,"
11:59:38FromDiscord<sOkam!> why does that make them easier to understand? i think i'm missing why that is
12:02:15FromDiscord<auxym> maybe it's just my brain but that's what made it clicked when I started using static types (java), having only used dynamic typing (python) before.
12:03:33FromDiscord<auxym> A `seq`contains another type (eg seq of strings, or ints). Therefore `var s: seq` doens't make sense as a type definition, you have to qualify the seq with a type parameter that defines which type the seq contains: `var s: seq[int]`
12:05:24FromDiscord<auxym> from there you can realize that you can use an abstract type param (eg `T`) and the compiler will generate a new "concrete" proc implementation for you based on the contrete type you specified. And that's a generic.
12:05:35*genpaku quit (Remote host closed the connection)
12:07:52FromDiscord<ChocolettePalette> But Go has generics too...
12:08:42*genpaku joined #nim
12:32:57FromDiscord<untoreh> sent a code paste, see https://play.nim-lang.org/#ix=4f6F
12:35:09*neceve_ joined #nim
12:35:32FromDiscord<untoreh> the ultimate whackamole solution
12:35:56FromDiscord<untoreh> :p
12:36:14*neceve quit (Ping timeout: 260 seconds)
12:39:05*jmdaemon quit (Ping timeout: 255 seconds)
12:43:17FromDiscord<exelotl> That seems bad, when something is nil a not-nil type should force you to deal with it. "Create a new one and pretend nothing is wrong" might not be the right thing to do in every situation
12:43:26FromDiscord<scarf> hi, does nim has optimized container, something like c++'s `std::hive`?↵<https://plflib.org/colony.htm>↵<https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0447r15.html>
12:47:37FromDiscord<ChocolettePalette> 🐝🐝🐝↵(@scarf)
12:47:51*neceve_ is now known as neceve
12:48:52FromDiscord<Rika> Not that I know of, no
12:50:56FromDiscord<auxym> the perf characteristics sound sort of like a slotmap, and I remember had a somewhat simple slotmap implementation in nim as part of a js game library or something
12:51:15FromDiscord<auxym> https://www.youtube.com/watch?v=SHaAR7XPtNU
12:51:34FromDiscord<auxym> (edit) "the perf characteristics sound sort of like a slotmap, and I remember ... had" added "someone"
12:51:56FromDiscord<scarf> In reply to @auxym "the perf characteristics sound": thank you!
12:52:20FromDiscord<auxym> here actually: https://github.com/planetis-m/goodluck/blob/main/project2d/slottables.nim
12:58:45FromDiscord<dlesnoff> Isn't there a DS collection library somewhere ? (DS: data structure)
12:59:32FromDiscord<auxym> no, but it would be cool if someone made one :)\
12:59:41FromDiscord<auxym> Not aware of one, anyways
12:59:58*jjido joined #nim
13:00:17FromDiscord<dlesnoff> I know there is a DS list in the curated list of packages
13:01:10FromDiscord<dlesnoff> https://github.com/ringabout/awesome-nim#data-structures
13:02:00FromDiscord<dlesnoff> I am often lost on how to optimize my programs in Nim. There is often many ways to write the same thing.
13:02:56FromDiscord<Rika> Reduce reference use but not too much, pretty much that and you’ll be fine for a while
13:03:13FromDiscord<Rika> Ways to write the same thing should be almost equivalent in speed
13:03:19FromDiscord<Rika> Do you need the speed right now?
13:06:21FromDiscord<dlesnoff> Nothing that is critical, but I like to have efficiency guidelines when I code.
13:07:33FromDiscord<Rika> Then avoid excessive indirection, and perhaps inheritance and OOP as well
13:07:43FromDiscord<Rika> Use generics and object variants as much as possible
13:08:11FromDiscord<Rika> If you really need the reference semantics then there’s no choice but to go with the reference, don’t worry there
13:08:36FromDiscord<Rika> I’m not too sure on other things, perhaps preallocate your strings and sequences as much as possible
13:08:53FromDiscord<dlesnoff> For example, there is this guide on memory representation: https://zevv.nl/nim-memory/↵but it doesn't say anything apart classic memory layout representation in memory in C and to check memory alignment
13:09:25FromDiscord<dlesnoff> (edit) "alignment" => "alignment↵So it optimizes memory (by a good ordering of the fields)."
13:13:15FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4f6M
13:13:57FromDiscord<Rika> What issues are you encountering from doing what you said?
13:17:24FromDiscord<Andreas> sent a long message, see http://ix.io/4f6N
13:17:30FromDiscord<auxym> @dlesnoff if you're looking to optimize, the #1 rule is always the same: profile, profile, profile. Blind "optimization" without any instrumentation to guide you is useless
13:21:17FromDiscord<Rika> In reply to @Andreas "`cannot instantiate Atomic [type": https://nim-lang.org/docs/system.html#AtomType
13:21:39FromDiscord<Rika> References aren’t atom types it seems
13:22:26FromDiscord<Andreas> In reply to @Rika "References aren’t atom types": yep, if i use `Atomic[ ptr Node ]` the variant-object is gone ?
13:22:35FromDiscord<Rika> No
13:23:38FromDiscord<Rika> You will have double indirection and maybe some issues regarding reference
13:26:14FromDiscord<Andreas> In reply to @Rika "You will have double": hm, can you recommend some solution. I'd basically need a Atomic-ptr to be able to 'swing-the-ptr' via a CAS ?
13:27:31FromDiscord<Rika> Why do you have reference for the initial node type? Double indirection isn’t necessarily a dealbreaker, just a performance issue
13:27:56FromDiscord<Rika> The reference issue might not even exist, prolly doesn’t using ARC which I assumed anyway because you also use the new threading library
13:29:34FromDiscord<Rika> Maybe it could be more ergonomic to split the type into non and reference type like Nim sometimes does
13:29:43FromDiscord<Andreas> In reply to @Rika "The reference issue might": the linked-list contains might look like so : `Hint->Hint->Node->Node->Hint->Node`
13:29:58FromDiscord<Rika> NodeObj = object ...↵Node = ref NodeObj
13:30:49FromDiscord<Rika> In reply to @Andreas "the linked-list contains might": You don’t need that if you store the regular object in a pointer anyway, the importance is the indirection not the reference
13:30:58FromDiscord<Rika> (edit) "that" => "to worry"
13:31:24FromDiscord<Rika> The indirection is needed to store a type in itself so that it stays constant size
13:34:44FromDiscord<dlesnoff> In reply to @Jiezron "Isn't there a DS": There is this too: https://github.com/ringabout/data-structure-in-Nim
13:43:27FromDiscord<Andreas> thx, well i corrected the way the items of the linked-list point to each other. Since i don't really understand the performance-consequences of indirection in that case - i have a basic question : Does it make sense at all to declare atomic-types inside such Objects or Object-Variants. As `ref` is not (yet) a supported AtomType, that excludes as-far-as-i-understand `variant-objects` atm.↵Therefore in my case i'd need two plain `object
13:44:53FromDiscord<Rika> Why would you be unable to use variant types without references?
13:46:06FromDiscord<Rika> Maybe you misunderstood what indirection means
13:46:15FromDiscord<Rika> Pointers and references are both forms of indirection
13:46:39FromDiscord<Rika> You can use either of them to store types within themselves
14:12:29*genpaku quit (Ping timeout: 260 seconds)
14:14:22*genpaku joined #nim
14:26:03*arkurious joined #nim
14:29:10*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
14:30:09*jjido joined #nim
14:37:11*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
14:37:42FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4f79
14:37:49FromDiscord<scarf> (edit) "https://play.nim-lang.org/#ix=4f79" => "https://play.nim-lang.org/#ix=4f7a"
14:39:19*neceve quit (Ping timeout: 260 seconds)
14:39:33*neceve joined #nim
14:40:16*jonlevin joined #nim
14:50:00FromDiscord<Rika> It’s hard to tell how to fix it without knowing what’s wrong
15:04:37FromDiscord<Cheesy Brik> Are proc’s stored as objects and if so what is the type name?
15:09:07FromDiscord<Bung> borrow what ?
15:12:55FromDiscord<Phil> In reply to @Cheesy Brik "Are proc’s stored as": You mean like python? Not to my knowledge.
15:17:56FromDiscord<Cheesy Brik> In reply to @Isofruit "You mean like python?": Man that sucks, it’s one of the few things I like about oop
15:31:30FromDiscord<Cheesy Brik> Does anyone have a comparative time performance of nim compared to others such as c++, python, rust, Java, etc.
15:36:29FromDiscord<Generic> there are some benchmark sites for this out there
15:36:56FromDiscord<Generic> though their results are pretty questionable
15:37:25FromDiscord<Generic> because with languages such as Nim, C++ or Rust you more or less have access to everything your computer can deliver
15:43:16FromDiscord<sOkam!> sent a code paste, see https://paste.rs/Y9K
15:44:08FromDiscord<sOkam!> right now i only know how to pass custom types as input. but not the type itself
15:44:40FromDiscord<sOkam!> (edit) "right now i only know how to pass ... custom" added "values with"
15:45:26FromDiscord<Bung> typedesc[MyType]
15:45:34FromDiscord<sOkam!> ty!
15:46:15FromDiscord<sOkam!> wait... is that valid for any type?
15:46:46FromDiscord<sOkam!> like, the point in this usecase is to check what type the variable is inside the function
15:48:09FromDiscord<Bung> it sound more like a generic proc , why dont just just `thing[T]`
15:49:00FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4f7V
15:49:37FromDiscord<sOkam!> In reply to @Bung "it sound more like": Because I have no clue how to use them in practice, other than I learned the syntax for them today a few hours ago↵So I don't know if that's the way to do it here
15:50:31FromDiscord<sOkam!> The key is that if type is Vec3, each attribute is gonna be given to opengl with a mandatory `EGL_FLOAT`, and I would like to avoid having to type that externally outside of this function
15:50:36FromDiscord<Bung> this one is also fine
15:53:21FromDiscord<Bung> not sure if you want use a value,if it is u can just `Vec3 or Vec2 or Vec1 `
15:54:39FromDiscord<Bung> u can also try `typedesct[A] pr typedesct[B]`, but I haven't used
15:54:42FromDiscord<sOkam!> Not sure if I will need it either, so far it seems to work well with jhust the type
15:55:06FromDiscord<sOkam!> might need to refactor possibly, will keep it in mind 🤷‍♂️
15:55:23FromDiscord<Cheesy Brik> In reply to @sOkam! "Because I have no": If I’m not mistaken (also a nim newbie) you can do `thing[T](num:int; vec3:T)` then inside the proc have `assert T==MyType`
15:55:52FromDiscord<Cheesy Brik> (edit) "T==MyType`" => "T==Vec3`"
16:03:36FromDiscord<Bung> yeah , use generic proc is also an option, inside the proc u do `when T is Vec3: doTheWork`
16:04:55FromDiscord<Cheesy Brik> Was just watching this video, https://youtu.be/QM1iUe6IofM anything like the use block he suggests around 42:00 in nim? Or could you make a macro/template for it?
16:07:41FromDiscord<scarf> In reply to @Rika "It’s hard to tell": or in other words, how could i have a distinct object constructor?
16:07:49FromDiscord<scarf> (edit) "could" => "would"
16:08:37FromDiscord<Rika> have a proc return that distinct object? or convert the parent type to the distinct `vec2val.vec2dstc`
16:08:55FromDiscord<Rika> in your case that would be `like` not `dstc` mb
16:14:14FromDiscord<sOkam!> In reply to @Bung "yeah , use generic": why compiletime?
16:14:56FromDiscord<Bung> the question is why runtime
16:20:21FromDiscord<sOkam!> In reply to @Bung "the question is why": i have the same answer to both.: ❔
16:20:43FromDiscord<Cheesy Brik> I feel like using any code flow here is unnecessary just pass an error if the type doesn’t match what you want, unless you need dif behaviors for dif types but then you just overload.
16:21:29FromDiscord<sOkam!> In reply to @Cheesy Brik "I feel like using": i have to convert the typedef to somehting that opengl understands
16:23:01FromDiscord<Cheesy Brik> And you’re already using a vec3 type so as I said before you can just `assert type == Vec3` before passing it to OpenGL
16:23:18FromDiscord<Cheesy Brik> Unless I’m misunderstanding
16:23:42FromDiscord<sOkam!> In reply to @Cheesy Brik "And you’re already using": im not passing the vec3 to opengl↵i'm using vmath types to store my data, and when i register the attribute it expects EGL_FLOAT
16:24:04FromDiscord<Cheesy Brik> Ah ok I see
16:24:22FromDiscord<Cheesy Brik> Then yeh codeflow should prob be used
16:24:30FromDiscord<Cheesy Brik> (edit) "codeflow" => "code flow"
16:32:38FromDiscord<Phil> In reply to @Cheesy Brik "Man that sucks, it’s": You got to keep in mind that types in general (proc signatures count as such) are only compile-time.↵No manipulating or generating those at runtime
16:35:30FromDiscord<Phil> As for performance... I can't really perform benchmarks, for my purposes (webdev) it's been beating out my python implementation of endpoints by roughly a factor of 4-10. Mind you, in absolute terms that's the difference between 100-300ms to 5-50ms
16:36:07FromDiscord<Phil> (edit) "As for performance... I can't really perform benchmarks, for my purposes (webdev) it's been beating out my python implementation of endpoints by roughly a factor of 4-10. Mind you, in absolute terms that's the difference between 100-300ms to 5-50ms ... " added "(Django vs Prologue + Norm basically)"
16:37:15FromDiscord<Phil> Generally synthetic benchmarks don't mean much either way as it depends on the scenario. The key bit is that you can mess with memory etc. if you want with various memory modes and optimize for those.
16:39:43NimEventerNew post on r/nim by Robert_Bobbinson: Is it possible to make Android apps with Nim? Thanks., see https://reddit.com/r/nim/comments/ynv5fz/is_it_possible_to_make_android_apps_with_nim/
16:40:14FromDiscord<Cheesy Brik> In reply to @Isofruit "Generally synthetic benchmarks don't": Yeh I’d just want a general benchmark for basic comparison as I’m not really and efficiency nut and don’t work in area where it’s necessarily need but I like knowing I won’t have to wait a few minutes to get results.
16:40:24FromDiscord<Cheesy Brik> (edit) "and" => "an"
16:40:33FromDiscord<Cheesy Brik> (edit) "need" => "needed"
16:42:35FromDiscord<Phil> The thing is that even in terms of basic comparisons synthetic benchmarks will surprise you
16:42:47FromDiscord<dom96> You typically can't go wrong with any compiled language when it comes to performance.
16:42:56FromDiscord<dom96> But if you really want some benchmarks: https://www.techempower.com/benchmarks/#section=data-r21&test=json
16:43:02FromDiscord<dom96> Nim is #12 there
16:43:11FromDiscord<Phil> Let me find the most hilarious web-framework benchmarks
16:43:14*neceve_ joined #nim
16:43:26FromDiscord<Phil> I do recall some JS server being ridiculously high up there in one of them
16:43:34*neceve quit (Ping timeout: 260 seconds)
16:43:45FromDiscord<Phil> Oh, httpbeast still at the top spot, lol
16:44:59FromDiscord<Phil> Average Latency has almost half a dozen java webservers beat out cpp is a funny one https://media.discordapp.net/attachments/371759389889003532/1038856538070208532/image.png
16:45:18FromDiscord<dom96> yeah, it's pretty amazing nobody has beat it yet in Nim-land. I've mostly left it untouched since 2018.
16:45:36FromDiscord<Cheesy Brik> Is there a web assembly framework for nim yet, even tho web assembly is kinda still a bit new
16:45:44FromDiscord<Phil> Similarly you have ruby, php and js beating out cpp in minimum latency https://media.discordapp.net/attachments/371759389889003532/1038856720048472154/image.png
16:54:18*Jjp137 quit (Ping timeout: 255 seconds)
16:56:13FromDiscord<auxym> In reply to @Cheesy Brik "Man that sucks, it’s": Nim does have first-class procs, if that's what you mean. You can take procs as proc arguments, or return procs from procs, etc. As for the types, see here: https://nim-lang.org/docs/manual.html#types-procedural-type
16:57:17FromDiscord<Cheesy Brik> In reply to @auxym "Nim *does* have first-class": Ah ok, could I redefine a proc namespace like myNewProc = oldProc?
16:57:57FromDiscord<Phil> In reply to @Cheesy Brik "Ah ok, could I": Ohhhh I thought you meant stuff like you can do in python where you can literally manipulate the contents of function params or crap like that at runtime
16:58:10FromDiscord<Phil> If you just want to be able to generate procs or the like, yeah nim can do that
16:58:32FromDiscord<Cheesy Brik> In reply to @Isofruit "Ohhhh I thought you": Yeh I know what you mean, I’ve never found a use case for that
16:58:33FromDiscord<Phil> You can pass them as parameters, generate them, assign them to variables, store them in hashmaps etc.
16:58:40FromDiscord<Cheesy Brik> In reply to @Isofruit "You can pass them": Nice
16:58:59FromDiscord<Cheesy Brik> That reminds me, what’s the hash map syntax in nim
16:59:01FromDiscord<Phil> In reply to @Cheesy Brik "Nice": Note though that due to static typing, if you store them in hashmaps, all procs in there will have to be of the same signature
16:59:02FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4f8j
16:59:16FromDiscord<auxym> you can then assign to `p` any proc that fits its signature (proc type)
16:59:53FromDiscord<auxym> In reply to @Cheesy Brik "That reminds me, what’s": see the std/tables module docs
17:00:16FromDiscord<Cheesy Brik> In reply to @auxym "see the std/tables module": 👍
17:00:29FromDiscord<Phil> Instantiation has many ways, for accessing them it's the usual `table["key"]` and `table["key"] = newvalue`
17:02:36FromDiscord<Phil> Funny sidenote on that one
17:02:42FromDiscord<Phil> `[]` and `[]=` are also just procs
17:02:49FromDiscord<Phil> That you can redefine if you want
17:03:39FromDiscord<Phil> Or can define for any other type you want if you want something to behave like a table and you want to store it away in some other manner
17:04:14FromDiscord<Cheesy Brik> What’s the `` syntax mean in nim
17:04:29FromDiscord<Phil> Backtick syntax?
17:05:00FromDiscord<Cheesy Brik> Yeh what’s that used for
17:05:06FromDiscord<Phil> Ohhhh that is for symbols such as $
17:05:28FromDiscord<Phil> proc \`$\` basically just means you're defining a proc that is called "$"
17:05:39FromDiscord<Cheesy Brik> Ah ok
17:05:45FromDiscord<Phil> That's the typical "toString" for nim btw
17:05:48Amun-Rayou making special symbols "plain"
17:05:53Amun-Rayou're*
17:06:03FromDiscord<Cheesy Brik> In reply to @Isofruit "That's the typical "toString"": Yeh I knew that
17:07:43FromDiscord<Cheesy Brik> You know what I’ve always wanted to see in a language, being able to iterate on a plain int, so `for i in 10` is the same as `for i in 0..10`
17:10:22FromDiscord<auxym> In reply to @Cheesy Brik "You know what I’ve": you've come to the right place https://play.nim-lang.org/#ix=4f8n
17:11:27FromDiscord<Cheesy Brik> In reply to @auxym "you've come to the": :0, what is the items iterator, is it called when ever converting a on object to an iterator?
17:11:37FromDiscord<Cheesy Brik> (edit) "a on" => "an"
17:12:40FromDiscord<auxym> yeah, it's sort of a magic name in nim. When iterating over something that is not already an iterator, nim attempts to call an `items` iterator
17:13:06FromDiscord<Phil> Similarly echo x will try to call echo $x
17:13:12FromDiscord<Phil> if x is not a string
17:13:18FromDiscord<auxym> see also `pairs` https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-implicit-itemsslashpairs-invocations
17:13:26FromDiscord<Cheesy Brik> Ah ok, so kinda like a dunder in python , is there a list of those somewhere?
17:14:11FromDiscord<auxym> the manual is the most complete reference I guess. what's a dunder though? I know python pretty well but never heard that name
17:14:22FromDiscord<Phil> Python is a protocol driven language
17:14:34FromDiscord<Phil> There are a set of specific pre-defined methods that implement certain protocols
17:14:44FromDiscord<auxym> python has "magic" double-underscore functions like `call`, `add` etc
17:15:24FromDiscord<Phil> e.g. if you implement `str()` for an object type your type will always work in str(yourtype) calls etc.
17:15:36FromDiscord<Phil> in nim you don't really bother, `+` is just a proc
17:15:38FromDiscord<Cheesy Brik> In reply to @auxym "python has "magic" double-underscore": Dunder comes from “double underscore” :)
17:15:44FromDiscord<auxym> oh 🙂
17:16:24FromDiscord<Cheesy Brik> Anyways is there a list of procs/methods like that or is it just look through the manual and find out
17:17:30FromDiscord<Phil> I don't think so. Keep in mind that like half the things that would be dunder methods in python to make things work with like`+`, `-` etc don't apply to nim since you would just define a `+`proc directly
17:18:04FromDiscord<auxym> off the top of my head, there aren't that many anyways. in fact I can't think of anything except `$` and pairs/items. Like Phil said, operator overloading is implemented by writing a proc with backticks
17:19:05FromDiscord<Cheesy Brik> In reply to @auxym "off the top of": Does this work with custom symbols or only predefined ones
17:19:10FromDiscord<Phil> That makes it ironically more flexible than python in that regard, since you can define behaviour for example of what should happen if you try to add a database connection to a string or other silly things like that
17:19:44FromDiscord<auxym> there's converters I guess which allow you to implicitly convert any type to any other type. no special naming though, they are just defined like procs but with the `converter` keyword instead of proc/func
17:20:15FromDiscord<Phil> In reply to @Cheesy Brik "Does this work with": You can write your own `+` proc for any arbitrary combination of types
17:20:16FromDiscord<Rika> then you dont get the dumb "radd" vs "add" issue
17:20:22FromDiscord<Rika> issue -> confusion
17:20:54FromDiscord<Cheesy Brik> In reply to @Isofruit "You can write your": Heh nice
17:21:12FromDiscord<auxym> In reply to @Cheesy Brik "Does this work with": https://nim-lang.org/docs/manual.html#lexical-analysis-operators you can make any combination of them however, like you could implement your own `&?--` operator
17:21:14FromDiscord<Cheesy Brik> In reply to @Rika "then you dont get": Yes
17:21:56FromDiscord<Cheesy Brik> In reply to @auxym "https://nim-lang.org/docs/manual.html#lexical-analy": Could I use any Unicode char? Like dumb example `€`
17:22:20FromDiscord<auxym> yes but IIRC it's still considered experimental
17:22:31FromDiscord<auxym> https://nim-lang.org/docs/manual.html#lexical-analysis-unicode-operators
17:22:52FromDiscord<Cheesy Brik> In reply to @auxym "yes but IIRC it's": An ok
17:22:58FromDiscord<Cheesy Brik> (edit) "An" => "Ah"
17:23:02FromDiscord<auxym> so it might get removed in future versions, no stability guarantee, etc
17:24:26*jjido joined #nim
17:24:44FromDiscord<Cheesy Brik> Ah
17:25:00FromDiscord<Cheesy Brik> How actively is nim still devolved since it’s like 15 years old
17:25:05FromDiscord<huantian> Unicode ops is coming in 2.0
17:25:36FromDiscord<huantian> As a stable feature
17:26:32NimEventerNew thread by mantielero: Wrapping c++ function - cannot instantiate 'T2', see https://forum.nim-lang.org/t/9581
17:30:14FromDiscord<Saint> https://github.com/zevv/npeg
17:30:28FromDiscord<Saint> Anyone used this much? Or anyone used Raku Grammars much?
17:30:34FromDiscord<Saint> Just hoping to find a sort of overlap
17:36:18FromDiscord<Cheesy Brik> Does nim get rid of unused procs and vars so using large libraries with many unused procs isn’t a slow down?
17:36:20FromDiscord<Saint> By that I mean if someone is familiar with both of them
17:36:34FromDiscord<Saint> In reply to @Cheesy Brik "Does nim get rid": I'm sure the compiler does that
17:36:59FromDiscord<Saint> Actually that probably isn't true, I don't know
17:39:00FromDiscord<Cheesy Brik> In reply to @Cheesy Brik "Does nim get rid": Asking cuz I wanna create a personal utils library but don’t want unnecessary slow down
17:40:07FromDiscord<demotomohiro> @Cheesy Brik Died code elimination is turn on in -d:release
17:40:22FromDiscord<Cheesy Brik> Thx
17:43:08FromDiscord<demotomohiro> And you can read assembly code generated by backend C compiler with `--asm` option and you can see if unused variables are removed.
17:48:45ZevvSaint: I use npeg every now and then, what's up
17:51:39Zevvdon't know anything about Raku Grammars though
17:51:58*kenran joined #nim
17:57:35FromDiscord<Saint> In reply to @Zevv "<@890692135827959919>: I use npeg": Oh cool, yeah I was playing a bit with Raku's Grammar, cause people were saying it's like regex on steroids or good for text processing, but then when I discovered this for nim I was wondering if it's still worth to build stuff in Raku for the regex/text processing stuff first or just do it all in nim
17:58:09FromDiscord<Saint> Zevv: Maybe I could ask you, how good is npeg as a sort of drop in for a bit more advanced regex?
17:58:12FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4f8y
17:58:31FromDiscord<Cheesy Brik> In reply to @ShalokShalom "You mean developed? ": Yeh lmao, cool
17:59:12FromDiscord<Saint> The syntax seems pretty diff from regex, which is what Raku's grammars basically build off of, but maybe that's for the better?
17:59:42Zevvto start with, it's more verbose than regular expressions of course
18:00:07Zevvbut there's a bit more to that; regexps are great for small tasks, doing one thing
18:00:21*kenran quit (Remote host closed the connection)
18:00:23Zevvbut PEGs allow you to build up a grammar and reuse rules
18:00:26Zevvallowing for recursion
18:00:38Zevvand with npeg, you can freely mix and match the grammar definition and Nim code
18:01:11Zevvit's not ment to be a better regexp or to replace regular expressions, they both have their place
18:05:51FromDiscord<Saint> sent a code paste, see https://play.nim-lang.org/#ix=4f8A
18:06:19FromDiscord<Cheesy Brik> To me it just seems like a implementation of standard parser grammar
18:06:22FromDiscord<Saint> I meant they use a lot of standard regex notation, and you just build higher level tokens and so on
18:06:50FromDiscord<Saint> Yeah, I mean regex can also I think parse any language too, just gets unwieldy (?)
18:06:58FromDiscord<Saint> I guess that should answer my question
18:07:06Zevvlooking at raku grammars, I think it's kind of the same philosphy
18:07:17Zevvit's not strictly peg, but that's not a good or bad thing
18:08:12Zevvthe one thing npeg can do and raku grammars can not
18:08:20Zevvis draw nifty railroad graphs
18:08:28Zevvbecause, who doesn't like graphs, right
18:09:15Zevvhttps://play.nim-lang.org/#ix=4f8A
18:09:24Zevvno wrong url, http://zevv.nl/div/graph.png that one
18:13:47FromDiscord<Saint> In reply to @Zevv "no wrong url, http://zevv.nl/div/graph.png": Oh this is so cool!
18:13:55Zevvi know right
18:13:57FromDiscord<Saint> Yeah Raku's output is not that clean, pretty hard to read actually
18:14:06FromDiscord<Saint> They do it more vertically and it becomes a mess
18:14:21FromDiscord<Saint> This looks extremely legible
18:22:07FromDiscord<!!sharpcdf!!> In reply to @sharpcdf "i am extremely sad": Huge shoutout to ugit on GitHub, I got the conflicts to revert
18:22:20FromDiscord<Arouzing> Hello! rather new to nim, but loving it so far! this language will be a great tool for my custom linux tooling. I also recently found a great article that shows how to compile with musl on nim! was rather fun to get working.
18:22:25FromDiscord<!!sharpcdf!!> Just gotta figure out how to get the rest of that shit to push to the repo
18:31:07FromDiscord<huantian> In reply to @Arouzing "Hello! rather new to": Awesome to hear that!
18:58:17FromDiscord<Cheesy Brik> Want to experiment with a good gui library, anyone got one?
19:01:08FromDiscord<that_dude> In reply to @Cheesy Brik "Want to experiment with": https://github.com/nim-lang/Nim/wiki/Curated-Packages#gui is usually the goto recomendation to look at.
19:02:45FromDiscord<that_dude> To me fidget and https://github.com/ansiwave/nimwave seemed the most promising
19:03:24FromDiscord<Cheesy Brik> Weird question, could I have a nim file, compile nim code? As in it takes in nim code and compiles it. Ofc I could use the command, but I want it to be independent of having nim installed.
19:04:01FromDiscord<SREagle> sent a long message, see http://ix.io/4f8W
19:04:43*LuxuryMode joined #nim
19:07:30*Jjp137 joined #nim
19:10:37*krux02 joined #nim
19:12:32FromDiscord<that_dude> In reply to @Cheesy Brik "Weird question, could I": If you mean in more of an interpreter way, I do think yes, https://forum.nim-lang.org/t/1319, https://forum.nim-lang.org/t/7477 may be helpful in that avenue
19:13:41*PMunch joined #nim
19:14:18FromDiscord<Cheesy Brik> In reply to @that_dude "If you mean in": No I mean actually make a new exe file, I know it’s weird but it’s a for a fun idea I have.
19:15:45FromDiscord<SREagle> uhm, if you complied a nim script, this normally results in an exe which does not need nim installed?! I fail to understand you need, it seems...
19:16:03FromDiscord<SREagle> (edit) "complied" => "compiled" | "script," => "soure file,"
19:16:11*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
19:16:21FromDiscord<Cheesy Brik> In reply to @SREagle "uhm, if you compiled": I mean a nim file that can create exe files from nim code
19:17:00FromDiscord<that_dude> IIrc if you import and use the right things, you can include the nim compiler into the exe to evaluate things (I do think it's limited to nimscript) as a standalone exe
19:17:30FromDiscord<that_dude> but otherwise it sounds like you're just repackaging the compiler?
19:17:49FromDiscord<Cheesy Brik> In reply to @that_dude "but otherwise it sounds": Yeh ik, I might just do that
19:17:53FromDiscord<Cheesy Brik> Is that legal?
19:18:12FromDiscord<that_dude> 99.9% of nim is mit licensed so yeah if you can figure it out
19:18:27FromDiscord<Cheesy Brik> Yeh I’ll experiment with it
19:18:33FromDiscord<that_dude> I believe the whole compiler is mit too
19:19:33*jjido joined #nim
19:24:28PMunch@that_dude, it's not limited to NimScript
19:24:58PMunchTake nimsuggest for example, it imports the compiler to evaluate the Nim code given from the editor and report errors and such
19:28:08PMunchThis is probably a good place to start, it's the start of the compiler itself, where the command line is parsed and compilation kicked of: https://github.com/nim-lang/Nim/blob/devel/compiler/nim.nim
19:52:29*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
20:01:42FromDiscord<Phil> Every other week or so I keep getting interested into writing a normal gui app.↵Then I see the examples and how the structure of the application is within the code itself, I realize how annoying that likely is to keep the code that declares the interface properly separated from the business logic surrounding the data I want to show and said interest takes a massive hit
20:02:17FromDiscord<Phil> (edit) "the application" => "a GUI page"
20:02:41FromDiscord<Phil> (edit) "show" => "render into the interface"
20:02:52FromDiscord<Phil> (edit) "said" => "my initial"
20:04:09ZevvPMunch: is proc `[]`*[S](cs: Captures[S], range: HSlice[system.int, system.int]): seq[Capture[S]] enough?
20:04:23Zevvor do I need more than that? your title says "operators", not "operator" :)
20:06:33FromDiscord<Phil> Wait, no, I think I may have missunderstood, so QML is basically like HTML, you pass it a context to render stuff and it renders it then I guess
20:08:38FromDiscord<ShalokShalom> In reply to @Cheesy Brik "Want to experiment with": Godot 3
20:09:21FromDiscord<Cheesy Brik> Lmao, love godot, but want a pure nim library
20:09:40*tanami joined #nim
20:10:54FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4f96
20:11:14FromDiscord<ShalokShalom> You can theoretically code all in .qml with Javascript for the logic, but its discouraged.
20:12:03*jjido joined #nim
20:12:06FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4f97
20:13:07FromDiscord<ShalokShalom> In reply to @Cheesy Brik "Weird question, could I": You mean, without comping it to C, C++ etc first?↵↵There is a pure llvm compiler
20:13:41FromDiscord<Cheesy Brik> In reply to @ShalokShalom "You mean, without comping": No idrc I just want it to make an exe out of it
20:13:47FromDiscord<ShalokShalom> https://github.com/arnetheduck/nlvm
20:13:49FromDiscord<Phil> In reply to @ShalokShalom "Qml is a superset": Are QML only capable of using code defined within the QML for actions. Explicit example: Can a QML file trigger a nim proc if a button is clicked ?
20:14:24FromDiscord<Phil> From what I'm seeing so far you have the "backend language" (nim) providing a context for the QML file to draw the data from to render
20:23:41FromDiscord<sOkam!> Talking about gui, has anyone worked with nuklear in Nim?↵There are like 3-4 bindings, but all seem super abandoned
20:24:27FromDiscord<sOkam!> (edit) "Talking about gui, has anyone worked with nuklear in Nim?↵There are like 3-4 bindings, but all seem super abandoned ... " added "_(unless i misunderstood, and some behave well, which is why im asking)_"
20:24:43FromDiscord<Elegantbeef> They're almost all abandoned
20:24:56FromDiscord<Elegantbeef> Dont know if any work
20:25:00FromDiscord<sOkam!> should futhark be able to handle nuklear?
20:25:09FromDiscord<Elegantbeef> Likely
20:25:19FromDiscord<Elegantbeef> It handles many C libraries
20:25:25FromDiscord<sOkam!> last time i tried with another codebase, i found a lot of issues and support was hard to find
20:25:49FromDiscord<sOkam!> but yeah, should try at some point
20:27:18FromDiscord<Elegantbeef> Futhark is relatively easy to use and support is just screaming "Pmunch" three times in a mirror or asking here
20:30:07FromDiscord<sOkam!> Yeah, for some reason back then the screaming in the mirror didn't work 🙂↵I wish I remembered why that was. Goldfish life 🐠
20:36:09FromDiscord<albassort> What is the fastest way to filter an array based on a prefix of an input
20:36:21FromDiscord<albassort> Animal↵Ani
20:37:22FromDiscord<Elegantbeef> `var a = myColl.filterIt(it.startsWith("ani"))`
20:37:29FromDiscord<albassort> Speed normally wouldn't matter but the array is like 200000 items long
20:38:12FromDiscord<albassort> In reply to @Elegantbeef "`var a = myColl.filterIt(it.startsWith("ani"))`": But I'm performance critical
20:38:19FromDiscord<Elegantbeef> So then dont filter it
20:38:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4f9g
20:38:50FromDiscord<albassort> Filter was used in the English sense not in the programming sense
20:39:37FromDiscord<Elegantbeef> You can also multithread this and have a thread handle X amount of entries
20:40:28FromDiscord<albassort> Yeah I'm already using a similar threading architecture in my code I can just repurpose it
20:41:07FromDiscord<albassort> I still need to write macros for my threads to make my life easier
20:43:37FromDiscord<Elegantbeef> Uhh
20:43:52FromDiscord<albassort> I know I've been saying that for a year now
20:43:58FromDiscord<albassort> Macros are scary okay
20:44:04FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4f9h
20:44:20FromDiscord<Elegantbeef> I dont know why a macro is really needed for threading in this case
20:44:28FromDiscord<albassort> No just generally
20:44:40FromDiscord<albassort> Just to make the code more compact
20:44:56FromDiscord<ShalokShalom> In reply to @Isofruit "From what I'm seeing": But usually, when you use a backend language like Nim, you tend to use it for all logic
20:44:57FromDiscord<albassort> I have never needed a macro
20:45:03FromDiscord<ShalokShalom> As far as I understand
20:45:20FromDiscord<Phil> In reply to @ShalokShalom "But usually, when you": Yeah but that means you need to be able to trigger updates
20:45:23FromDiscord<ShalokShalom> In reply to @albassort "I have never needed": You probably used some unknowingly
20:45:28FromDiscord<Phil> Which means you need to trigger nim procs from inside of QML
20:45:33FromDiscord<Elegantbeef> You can just write the code more compact without macros
20:45:33FromDiscord<Elegantbeef> There are multiple things you can do before you jump to a macro
20:45:47FromDiscord<albassort> In reply to @ShalokShalom "You probably used some": I use a few, but I meant for my purposes of writing one
20:46:20FromDiscord<Phil> Personally, unless it makes the code more readable I'd use macros for that rather than just making code more compact
20:46:34FromDiscord<albassort> It makes it more readable and compact
20:46:44FromDiscord<Elegantbeef> Always use the simplest tool... cmon people
20:46:46FromDiscord<Elegantbeef> Like what's the code we're shrinking
20:46:50FromDiscord<Phil> An example where "compactness" can reach questionable levels imo is jester. Because there you can do in 7 lines and a lot of the stuff it does is hidden
20:46:54FromDiscord<albassort> I just want to write some macros to handle the typing
20:47:15FromDiscord<Phil> (edit) "An example where "compactness" can reach questionable levels imo is jester. Because there you can do ... in" added "an entire server with an endpoint"
20:47:22FromDiscord<albassort> I also really don't like that you pass tuples and I want to just completely automate that to make code look prettier
20:47:23FromDiscord<ShalokShalom> In reply to @Cheesy Brik "No idrc I just": Well, the Nim compiler does this?
20:47:31FromDiscord<ShalokShalom> This is the default way of doing things
20:47:41FromDiscord<ShalokShalom> Or do you mean an exe, like in Windows?
20:48:03FromDiscord<ShalokShalom> Idk what Nim produces on Windows, maybe an .exe anyway?
20:48:12FromDiscord<Elegantbeef> Obviously it creats an exe
21:09:02FromDiscord<Cheesy Brik> Malwarebytes is saying it found a file called Trojan.ReverseShell in a compiled nim file, something I should I worry about??
21:09:55FromDiscord<Elegantbeef> No, Nim gets falsely flagged as it's commonly used to write malware
21:09:58FromDiscord<Elegantbeef> Go has the same problem
21:10:38FromDiscord<Cheesy Brik> Ah alr, yeh I just set my nim program folder as a allow area
21:13:49FromDiscord<Cheesy Brik> Ok now I'm getting an error, `could not load: pcre64.dll`
21:17:30FromDiscord<albassort> In reply to @Elegantbeef "No, Nim gets falsely": No it's not. One guy did it
21:20:22FromDiscord<Cheesy Brik> In reply to @Cheesy Brik "Ok now I'm getting": nvm i think malware bytes removed nims path vars, reinstall fixed it 👍
21:20:53FromDiscord<Elegantbeef> "One guy did it"?↵(@albassort)
21:21:11FromDiscord<albassort> There was like one article about it a year ago
21:21:30PMunchZevv, sorry I was off watching handball. I think that would suffice, but I'm not sure how HSlice's are made considering BackwardsIndex
21:21:47FromDiscord<albassort> And now everyone who knows nothing about nim but believes they are educated, thinks that nim is primarily used for malware
21:22:00FromDiscord<Elegantbeef> Are you ok?
21:22:14FromDiscord<Elegantbeef> https://github.com/byt3bl33d3r/OffensiveNim is a relatively common path to Nim-lang.org
21:22:26PMunchsOkam, could have been early days of the library, hopefully more stuff works out of the box now :)
21:23:27PMunchAnyways, I'm off for tonight
21:23:38*PMunch quit (Quit: leaving)
21:29:26FromDiscord<ChocolettePalette> Ngl I was about to write a malware in Nim
21:29:35FromDiscord<Cheesy Brik> How can i let a template take in a symbol?
21:29:46FromDiscord<Elegantbeef> `name: untyped`
21:29:51FromDiscord<Elegantbeef> or `name: typed`
21:31:51FromDiscord<Cheesy Brik> It says it's expecting an expression
21:32:13FromDiscord<Elegantbeef> What are you trying to do
21:32:36FromDiscord<ChocolettePalette> It would've been about a so called "Amogus"\: starting a daemon which would pop-under transparent windows w/o decorations playing GIFs of amogus running AND also playing that based amogus song until you click those. But it was too difficult so I changed my mind to be a cracker/hacker/etc maybe someone might adopt and implement my idea
21:32:50FromDiscord<Cheesy Brik> sent a code paste, see https://play.nim-lang.org/#ix=4f9L
21:33:19FromDiscord<Elegantbeef> You mean an operator not a symbol, got it
21:33:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4f9M
21:33:36FromDiscord<Cheesy Brik> oh alr,
21:33:49FromDiscord<Elegantbeef> also you'll want to do `sym(a, b)`
21:37:43FromDiscord<Elegantbeef> Unrelated to the template but dont do `a = a + b` for strings
21:37:56FromDiscord<Elegantbeef> It's much slower than `a.add b`
21:38:14FromDiscord<Elegantbeef> Assuming you do `+` as an alias to `&`
21:39:09FromDiscord<Cheesy Brik> In reply to @Elegantbeef "It's much slower than": doesn't add only work with chars
21:39:17FromDiscord<Elegantbeef> No it works with strings aswell
21:40:22FromDiscord<Cheesy Brik> but not with anonymous strings
21:41:15FromDiscord<Elegantbeef> What?
21:41:37FromDiscord<Cheesy Brik> .add only works with var strings
21:42:05FromDiscord<Elegantbeef> Yes?
21:42:14FromDiscord<Elegantbeef> `&` is used for joining two strings together
21:43:02FromDiscord<Elegantbeef> It's also immutable vs. mutable strings
21:43:09FromDiscord<Elegantbeef> var is mutable
21:45:49*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
21:58:50FromDiscord<ChocolettePalette> So strings can be mutable and immutable? Why did I think that they all were immutable? Because of Python?
21:59:07FromDiscord<Elegantbeef> Likely in Nim strings are just null terminated character sequences
22:00:43FromDiscord<Cheesy Brik> Just having fun https://media.discordapp.net/attachments/371759389889003532/1038935989776814260/image.png
22:01:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fa0
22:01:27FromDiscord<ChocolettePalette> Why does it \~? o.o↵(@Cheesy Brik)
22:01:53FromDiscord<Elegantbeef> They're just aliasing operators
22:02:16FromDiscord<ChocolettePalette> But it underlined it with a yellow \~
22:02:25FromDiscord<ChocolettePalette> Must be a warning or smth
22:02:31FromDiscord<Elegantbeef> unused
22:02:36FromDiscord<ChocolettePalette> Ah!
22:04:12FromDiscord<Cheesy Brik> Yeh creating a utils library for myself
22:05:28FromDiscord<ChocolettePalette> You might want to put a \ after your `%` to make it an exportable proc or operator to use in other modules
22:07:19FromDiscord<Cheesy Brik> In reply to @ChocolettePalette "You might want to": Oh yeh forgot about exporting
22:27:17FromDiscord<Cheesy Brik> How to define unary symbol procs?
22:31:00FromDiscord<Cheesy Brik> How would I type in a func to do any type except one type
22:31:15FromDiscord<Cheesy Brik> Like take any type expect a string
22:41:13FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4fae
22:41:25FromDiscord<Cheesy Brik> thx
22:52:25FromDiscord<Cheesy Brik> I'm surprised this implementation isn't already in the random module `proc randomize[T: not int64](seed:T) = randomize(hash(seed))`
23:21:01FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4fan
23:21:29FromDiscord<voidwalker> any idea what this "url-encoded" thing is ? It's not the urlencode in the uri lib
23:24:09FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4fap
23:27:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4faq
23:39:03FromDiscord<System64 ~ Flandre Scarlet> Thanks!
23:39:53FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4fas
23:48:11FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4fav
23:53:47FromDiscord<System64 ~ Flandre Scarlet> nevermind, I fixed it
23:58:42FromDiscord<demotomohiro> @Cheesy Brik How about to use type class? https://nim-lang.org/docs/manual.html#generics-type-classes