<< 23-09-2020 >>

00:03:52disruptektuples?
00:13:01*abm quit (Quit: Leaving)
00:23:49*krux02 quit (Remote host closed the connection)
00:26:06*my_dude joined #nim
00:26:59*my_dude quit (Client Quit)
00:27:20*my_dude joined #nim
00:33:17PrestigeImports?
00:39:45*arecacea1 quit (Remote host closed the connection)
00:40:17*my_dude quit (Quit: ZZZzzz…)
00:40:34*arecacea1 joined #nim
00:40:48*my_dude joined #nim
00:40:49*my_dude quit (Client Quit)
01:09:11*aenesidemus quit (Quit: Leaving)
01:25:16disrupteki put my grandmother in a coma once.
01:28:16*apahl quit (Ping timeout: 244 seconds)
01:30:30*apahl joined #nim
01:52:38*my_dude joined #nim
01:52:48*Zectbumo quit (Remote host closed the connection)
01:58:18*vicfred quit (Remote host closed the connection)
01:58:43*vicfred joined #nim
02:00:07*a_chou joined #nim
02:03:15disruptekat least, i /think/ she was my grandmother.
02:03:32disruptekeither way, she had it comin'.
02:15:21FromGitter<gogolxdong> Why do I have avcodec-58.dll under the path and nimffmpeg still hint me could not load: avcodec(|-55|-56|-57|-58|-59).dll
02:22:06*gmaggior quit (Ping timeout: 260 seconds)
02:23:59*skrzyp1 joined #nim
02:27:33*planetis[m] quit (*.net *.split)
02:27:33*einichi quit (*.net *.split)
02:27:33*skrzyp quit (*.net *.split)
02:27:33*EastByte quit (*.net *.split)
02:33:53*einichi joined #nim
02:33:53*planetis[m] joined #nim
02:33:53*EastByte joined #nim
02:34:33*gmaggior joined #nim
02:34:38disrupteklet's blame leorize.
02:37:07*muffindrake quit (Ping timeout: 240 seconds)
02:39:43*muffindrake joined #nim
02:47:01*Zectbumo joined #nim
02:52:25*hnOsmium0001 joined #nim
02:58:20*arecacea1 quit (Remote host closed the connection)
02:58:39*arecacea1 joined #nim
03:10:18*gmaggior quit (Quit: Leaving)
03:20:42*a_chou quit (Remote host closed the connection)
03:35:20leorize[m]lol
03:35:39leorize[m]@gogolxdong the architecture probably mismatches
03:35:39*FromDiscord quit (Remote host closed the connection)
03:35:54*FromDiscord joined #nim
03:38:58*sealmove joined #nim
03:39:17sealmovehey, can someone remind me the compiler switch for disabling caching?
03:39:59FromDiscord<juan_carlos> `-f`
03:40:40sealmoveah thanks
03:41:04*my_dude quit (Ping timeout: 272 seconds)
03:45:38disruptekshe said her spirit animal was a sea otter and then granny asked me what mine was. told her, "house centipede."
03:46:54disruptekthe doctors say she stroked out sometime after viewing a photo on google, but the point is, i obviously cannot be held responsible for that shit.
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:32*supakeen joined #nim
04:11:29FromGitter<gogolxdong> @leorize https://play.nim-lang.org/#ix=2ysK I've compared two dlls which are correspondingly from msys2 mingw-w64-x86_64-ffmpeg and built from source , arch are the same, also I noticed symbols were stripped for the one built from source code , then I tried cross compile FFmpeg with --disable-stripping and got a working one.
04:12:32leorize[m]ah yea, I think in Windows they use `.lib` for linking with libraries that have no symbols
04:12:53leorize[m]since you're using dynamic loading you'd need the unstripped one
04:18:06sealmovewtf I've run into a reeeeeaaally weird situation
04:20:12disruptekhouse centipedes aren't weird; they're just misunderstood.
04:20:21sealmoveI am using Nim to generate html and I am running live-server to update html on file change. When I change any file in the server directory firefox's tab gets refreshed. It woks with any event on the filesystem except when I overwrite the html with nim c -r myprogram_that_generates_the_html_file
04:20:27*waleee-cl quit (Quit: Connection closed for inactivity)
04:20:51*leorize joined #nim
04:21:22sealmoveand live-server *does* detect the change, but firefox's tab is not update properly
04:21:35sealmoveit does a weird blinking but the page stays the same
04:24:52sealmoveit's some sync error because other files are updated at the same time
04:30:35sealmovewow, live-server was confused particularly when html and css changes at the same time
04:30:48sealmoveand ends up updating neither
04:37:25*thomasross quit (Ping timeout: 264 seconds)
04:37:37*mmohammadi9812 joined #nim
04:50:12*narimiran joined #nim
04:51:47*vicfred quit (Quit: Leaving)
04:53:23*rockcavera quit (Remote host closed the connection)
04:54:12FromDiscord<Zachary Carter> is there a way to resize a sequence and initialize any newly added elements to some value? C++'s `std::vector::resize` does this apparently
04:56:41disruptekto a particular nonzero value? not yet.
04:58:22FromDiscord<Zachary Carter> gotcha
04:58:40FromDiscord<Zachary Carter> thanks
05:00:25disrupteksomething using default() would be a good inclusion for system, i guess.
05:04:08*shad0w_ joined #nim
05:05:53*shad0w_ quit (Remote host closed the connection)
05:06:12*shad0w_ joined #nim
05:06:15*shad0w_ quit (Remote host closed the connection)
05:09:20*bunbunbunbunny joined #nim
05:14:52*gour joined #nim
05:15:13FromDiscord<sealmove> We don't even have memset :D i doubt it will be added
05:15:26*oculuxe quit (Ping timeout: 272 seconds)
05:17:12*oculux joined #nim
05:17:53*solitudesf joined #nim
05:24:09*oculuxe joined #nim
05:24:27*oculux quit (Ping timeout: 260 seconds)
05:25:45disruptekdon't be rude.
05:28:07sealmovedidn't mean to, I even agree with not having such corner-case features
05:28:23FromDiscord<Rika> theyre just joking i believe
05:30:43*oculux joined #nim
05:31:16*oculuxe quit (Ping timeout: 272 seconds)
05:34:57disruptekrika: i will find you.
05:35:46disruptekit's really not a corner-case feature if it uses default().
05:53:28planetis[m]there is though: https://github.com/nim-lang/Nim/blob/devel/lib/system/seqs_v2.nim#L87
05:53:42planetis[m]but only works with --gc:arc / orc
05:53:48FromDiscord<Zachary Carter> nice thanks!
05:54:06FromDiscord<Zachary Carter> how do I enable the package level object experimental feature?
06:00:40FromDiscord<Zachary Carter> meh nevermind I don't like how it works
06:05:31*maier joined #nim
06:05:39*maier is now known as kenran
06:10:23FromDiscord<haxscramper> @alehander42 maybe just avoid most of the special symbols altogether and use keywords?
06:10:36FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ytc
06:17:20*sealmove quit (Read error: Connection reset by peer)
06:34:34*arecacea1 quit (Remote host closed the connection)
06:35:04*arecacea1 joined #nim
06:42:42FromDiscord<lqdev> dude what did you just
06:42:46FromDiscord<lqdev> paste
06:50:01FromDiscord<gour> morning. i must say that fidget is nice idea, but wonder how does it compare with QML and whether they are capable for full-fledged desktop app?
06:50:02*Vladar joined #nim
06:53:01FromDiscord<ShalokShalom> They are actually quite similar, when you compare the syntax side by side.
06:54:31FromDiscord<ShalokShalom> I am actually quite a big fan of QML and while I think it is still equipped with a bit more features, I guess you can use both for desktop applications.
06:54:39FromDiscord<gour> @shad0w i've similar question to yours https://github.com/treeform/fidget/issues/91
06:54:40disbotWhy not QML?
06:55:46FromDiscord<ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/758220041555673109/Screenshot_2020-09-23-08-55-26-86.jpg
06:55:50FromDiscord<gour> @ShalokShalom do you use https://github.com/status-im/nimqml ?
06:56:06FromDiscord<ShalokShalom> @gour I would, in case Godot would not exist.
06:56:17FromDiscord<gour> (edit) '<@!255106931570638849>' => '@ShalokShalom'
06:56:27FromDiscord<ShalokShalom> I still like it, probably one of the most convenient ways to do UI
06:57:16FromDiscord<ShalokShalom> And more or less save to be developed further, since it is used in order to create an UI for Status.
06:58:17FromDiscord<gour> @ShalokShalom how in one supposed to define UI for QML, by hand or, community version of DesignerStudio can be used?
06:58:40FromDiscord<ShalokShalom> Community version of DesignerStudio?
06:58:48FromDiscord<gour> yes
06:58:53FromDiscord<ShalokShalom> That one that is free, is only for QtWidgets.
06:59:09FromDiscord<gour> > @gour I would, in case Godot would not exist.↵@ShalokShalom What is Godot?
06:59:29FromDiscord<ShalokShalom> There is a different one, I think its name is QtDesignStudio, or something and that one is paid and capable of QML.
06:59:29FromDiscord<lqdev> @ShalokShalom you know that Qt can also be considered non-free, right?
06:59:47FromDiscord<ShalokShalom> Godot is a game engine, that is also capable of designing apps.
06:59:58narimiranYardanico: nimpylib seems to be broken
06:59:59FromDiscord<gour> aha 🆒
07:00:02FromDiscord<ShalokShalom> https://medium.com/swlh/what-makes-godot-engine-great-for-advance-gui-applications-b1cfb941df3b
07:00:09FromDiscord<ShalokShalom> I love it.
07:00:25FromDiscord<ShalokShalom> It also supports Nim and a half dozen of other languages.
07:01:11FromDiscord<ShalokShalom> It even ships to Xbox and Web, HTML 5 via WebAssembly and stuff like that.
07:01:45FromDiscord<ShalokShalom> > @ShalokShalom you know that Qt can also be considered non-free, right?↵@lqdev Yes, it is dual-licensed
07:01:45FromDiscord<gour> ok, i'm more for 'classical' desktop app...plan to write library part in Nim, but looking about UI options as well...if not, possibly using PyQt via nimporter
07:02:12FromDiscord<ShalokShalom> You can use the Figma UI designer for free
07:02:18FromDiscord<ShalokShalom> But it is closed source.
07:02:47FromDiscord<Elegant Beef> You can also just declaritvely write nim code for figet
07:02:49FromDiscord<ShalokShalom> What is a classical desktop app and why do you prefer it?
07:02:58FromDiscord<Elegant Beef> They're talking about more native apps
07:03:02FromDiscord<ShalokShalom> @Elegant Beef Yes, we just posted that.
07:03:09FromDiscord<ShalokShalom> Native?
07:03:19FromDiscord<Elegant Beef> Native GUi
07:03:20FromDiscord<ShalokShalom> Its native code.
07:03:29FromDiscord<ShalokShalom> Ah, ok. Native UI elements.
07:03:41FromDiscord<ShalokShalom> Native-looking.
07:03:51FromDiscord<Rika> not native looking, native
07:03:52*PMunch joined #nim
07:04:03FromDiscord<Rika> unless they say native looking is fine do not assume what they want
07:04:58FromDiscord<gour> @ShalokShalom there is, afaict, free community version for https://www.qt.io/blog/qt-design-studio-1.6-released
07:04:59FromDiscord<ShalokShalom> Qt is not native, no cross-platform UI solution is truly native. Some use some native elements, I guess. But native means, to use the native library that macOS and Windows provides you.
07:05:56FromDiscord<ShalokShalom> Yuhuu 🥳
07:05:59FromDiscord<Rika> qt is considered native in linux (i think?) because lol
07:06:04FromDiscord<ShalokShalom> I have waited so long for this.
07:06:07FromDiscord<Elegant Beef> Well GTK/QT are "native"
07:06:10leorizelinux doesn't have a native toolkit :P
07:06:17FromDiscord<Rika> exactly what i mean
07:06:26leorizebut gtk is currently the de facto due to it's large userbase
07:06:35FromDiscord<gour> > What is a classical desktop app and why do you prefer it?↵@ShalokShalom well, the nature of the app is a bit 'retro' - e.g. http://saravali.de/screenshots.html
07:07:08FromDiscord<gour> > Qt is not native, no cross-platform UI solution is truly native. Some use some native elements, I guess. But native means, to use the native library that macOS and Windows provides you.↵@ShalokShalom wxWidgets?
07:07:58FromDiscord<gour> otherwise, it seems that Gintro is the most mature option for nim, atm?
07:13:45*superbia quit (Read error: Connection reset by peer)
07:17:38*Trustable joined #nim
07:20:40FromDiscord<gour> @ShalokShalom read that article about Godot. super cool! now, the question is how to use it with NIm?
07:20:49FromDiscord<gour> (edit) 'NIm?' => 'Nim?'
07:25:39disruptekif grow() works now it's news to me. i thought it was dead and buried.
07:26:55*sealmove joined #nim
07:27:17sealmovewut? "Error: undeclared identifier: 'result'" o.O
07:29:04sealmovehttps://play.nim-lang.org/#ix=2ytu
07:31:03FromDiscord<Clyybber> templates don't have result
07:31:32sealmoveyet documentation shows one: https://nim-lang.org/docs/tut3.html#introduction-generating-code
07:31:37FromDiscord<Clyybber> and from your code it seems like you want to change that `template` -> `macro`
07:31:52FromDiscord<Clyybber> Thats a macro
07:32:21sealmoveoh I am tired and blind sorry
07:32:21FromDiscord<Clyybber> https://play.nim-lang.org/#ix=2ytv works
07:32:24FromDiscord<Clyybber> :)
07:33:17sealmovefor some reason my mind associated quote do with templates, but I guess they are equally legit in macros
07:35:47alehander92ok
07:37:06FromDiscord<ShalokShalom> @gour https://pragmagic.github.io/godot-nim/v0.7.8/index.html
07:45:04*sealmove quit (Read error: Connection reset by peer)
07:55:22*Trustable quit (Remote host closed the connection)
07:56:04disruptekhow many songs do you know about balls?
08:01:16disrupteki mean, do we really /need/ more pictures of cats on the internet?
08:01:16FromDiscord<Slyris> > ok, i'm more for 'classical' desktop app...plan to write library part in Nim, but looking about UI options as well...if not, possibly using PyQt via nimporter↵@gour You can use nimqml from nim-status
08:02:09disruptekbetter late than never.
08:02:36*Vladar quit (Remote host closed the connection)
08:09:27FromDiscord<JSGRANT> @disruptek At least one; Big Balls , ACDC. But's a good -- one.
08:10:36disruptekyeah but can you sing it?
08:11:54disrupteki'm talkin', like, Jingle Balls. songs you know, through abd through; balls to bone.
08:13:18PMunch@JSGRANT, good song indeed
08:15:10FromDiscord<JSGRANT> Jingle Balls, Batman Smalls; Joker Laid An Egg
08:17:46*bunbunbunbunny quit (Ping timeout: 256 seconds)
08:19:43narimirandisruptek: jerry lee lewis - great balls of fire
08:25:44*apahl quit (Ping timeout: 244 seconds)
08:26:28*krux02 joined #nim
08:26:44*apahl joined #nim
08:27:33*vicfred joined #nim
08:29:04*bunbunbunbunny joined #nim
08:33:25*bunbunbunbunny quit (Ping timeout: 240 seconds)
08:34:33alehander92disruptek
08:34:36alehander92why are you awake now
08:34:41alehander92am i in USA
08:34:50alehander92what a time to be awake
08:42:33FromDiscord<shirleyquirk> Tom scott did linguistic research about batman smells: youtu.be/V5u9JSnAAU4
08:42:38FromDiscord<JSGRANT> I'm also in US; It's like near 4am
08:42:50FromDiscord<JSGRANT> (Missouri)
08:43:50FromDiscord<JSGRANT> neeeeeeed to try to sleep soon though
08:46:45FromDiscord<shirleyquirk> US/UK split over "robin flew away" vs "laid an egg"
08:47:57PMunchHaha, that was the first thing I thought of when JSGRANT wrote that
08:48:28*bunbunbunbunny joined #nim
08:48:36FromDiscord<gour> > @gour You can use nimqml from nim-status↵@Slyris do you use it and/or how to design UI, by hand?
08:50:02FromDiscord<acek7> as far as nim GUI stuff, which nim gui library is the most developed?
08:54:10*mmohammadi9812 quit (Ping timeout: 246 seconds)
08:55:25FromDiscord<lqdev> probably none.
08:57:00*hnOsmium0001 quit (Quit: Connection closed for inactivity)
08:58:50*bunbunbunbunny quit (Quit: Lost terminal)
09:02:34*guelosk[m] quit (Quit: Idle for 30+ days)
09:04:26FromDiscord<JSGRANT> Never even heard the expression "robin flew away" before lol
09:05:20*narimiran quit (Ping timeout: 272 seconds)
09:05:25FromDiscord<Rika> as said, its a uk thing
09:05:29FromDiscord<Rika> robins are birds
09:05:37FromDiscord<JSGRANT> Well I know that bit; lol
09:05:45FromDiscord<JSGRANT> tweet tweet
09:05:47FromDiscord<Rika> i know people who dont
09:06:06FromDiscord<JSGRANT> @acek7 https://github.com/trustable-code/NiGui/ && https://github.com/treeform/fidget are pretty high up there ; But yeah, there's no "defacto" at this point
09:07:12FromDiscord<JSGRANT> https://github.com/StefanSalewski/gintro is also a thing
09:07:37FromDiscord<JSGRANT> And of course there's a bunch of bindings to C/C++ immediate-mode guis
09:08:46FromDiscord<JSGRANT> oookay, bedtime for real. o/
09:10:22*mmohammadi9812 joined #nim
09:15:10FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ytY
09:17:23FromDiscord<haxscramper> Variadic match would use `any`, search-until is `until` or `incl`. For optional match use `opt`. Capture wll be in form `<kwd> @<var>` or `<kwd> @<var> <op> <rhs>` (`@middle is "d"` for example)
09:18:49*zedeus quit (Ping timeout: 264 seconds)
09:19:00FromDiscord<haxscramper> And just in general (question for everyone) would you rather prefer DSL to introduce keywords or work with special symbols like `?@`, `*@`, `.._` ?
09:20:23*Zectbumo quit (Remote host closed the connection)
09:20:36*zedeus joined #nim
09:21:33FromDiscord<Ricky Spanish> is there a way to donwload other external dependencies other than using nimterop 😆 , i realized for the gpu distro of onnxruntime i need to also have the following dll's available ```**cublas64_10.dll**↵**cudnn64_7.dll**↵**curand64_10.dll**↵**cufft64_10.dll**``` which dont seem to be picked up from the system install, so is there a simple way to make ur library just donwload from url, extract and dump these files to the out
09:24:01*narimiran joined #nim
09:24:33FromDiscord<gour> @PMunch hello, i am trying to make nimlsp to work within Emacs, but keep getting `LSP :: nimls has exited (exited abnormally with code 1)` any hint?
09:24:46FromDiscord<Yardanico> It's nimlsp
09:25:04FromDiscord<Ricky Spanish> ok it picks up the dlls assuming the exe is launched from same drive as the one cuda is installed on otherwise it goes bottoms up
09:25:45PMunch@gour, I think what Yardanico was trying to say is that it seems you have written `nimls` somewhere in your config instead of `nimlsp`
09:29:34FromDiscord<gour> @PMunch i've added snippet mentioned for Emacs & use-package. do i need something else?
09:29:46FromDiscord<gour> _is a bit noob when it comes to LSP stuff..._
09:30:54narimiranYardanico: did you see my earlier message about nimpylib?
09:32:20FromDiscord<ShalokShalom> @JSGRANT Do you know GTK+ from the inside?
09:32:22FromDiscord<ShalokShalom> https://mirror.linux.org.au/pub/linux.conf.au/2014/Thursday/83-Gtk_to_Qt_-_a_strange_journey_-_Dirk_Hohndel.mp4
09:32:30PMunch@gour, to be honest I have no idea
09:32:33PMunchNever used emacs
09:32:40FromDiscord<ShalokShalom> Can we let it die, please? 🙏
09:33:34FromDiscord<gour> @ShalokShalom Emacs?
09:33:42FromDiscord<ShalokShalom> No
09:33:42FromDiscord<Yardanico> @narimiran no, what was it?
09:33:50FromDiscord<ShalokShalom> GTK
09:33:55FromDiscord<ShalokShalom> See the video.
09:34:00FromDiscord<gour> ahh, ok 😄
09:34:01narimiranYardanico: it seems to be broken
09:34:11FromDiscord<Yardanico> Hmm, what exactly?
09:34:19FromDiscord<ShalokShalom> @gour Did the link help?
09:34:20narimiranit might be `enumerate` changes
09:34:42PMunch@gour, did you see the comment I made though?
09:34:47FromDiscord<Yardanico> Seems like Juan fixed it though, no?
09:34:51FromDiscord<gour> > @gour Did the link help?↵@ShalokShalom for Godot & Nim? yes!!
09:35:04FromDiscord<Yardanico> Last commit in nimpylib passed its CI
09:35:06FromDiscord<ShalokShalom> Glad
09:35:48FromDiscord<Yardanico> I forgot that nimpylib is in the important packages list lol
09:36:44FromDiscord<Yardanico> Seems like Juan made a failing commit 7 hours ago, but fixed it 3 hours ago
09:40:02narimiranoh, i didn't see that one 3 hours ago
09:40:34FromDiscord<gour> > @gour, did you see the comment I made though?↵@PMunch[IRC]#0000 it looks that the problem is solved. i did reference nim-lsp too early in my `init.el` - before lsp; forward declaration 😉
09:40:35*abm joined #nim
09:42:15PMunchAh I see
09:54:23*mmohammadi9812 quit (Quit: I quit (╯°□°)╯︵ ┻━┻)
10:00:52*kenran quit (Ping timeout: 260 seconds)
10:03:18FromDiscord<alehander42> @haxscramper post it to the rfc as well
10:03:50FromDiscord<alehander42> imho it's good to not overdo symbols
10:03:55FromDiscord<alehander42> but i like them 😄
10:04:10FromDiscord<alehander42> so it's good to have more people's opinions
10:06:45FromDiscord<haxscramper> So keyword one looks better than symbols? We will still have `opt @var ? default` and other things, but in general it would be `<kwd> @<var>` or `<kwd> @<var> <infix> <rhs>`
10:07:44FromDiscord<haxscramper> And `<fld>: <prefix> <rhs>` or `<fld> @<var> <infix> <rhs>` for field/kv-pair captures
10:08:23FromDiscord<haxscramper> Just need to wait until someone will post code that has `@ everyone`
10:08:53FromDiscord<haxscramper> Maybe post RFC link on forum?
10:09:15FromDiscord<himu> So, I am building an interpreter in Nim. How do I store an union of types?
10:09:21FromDiscord<himu> In TypeScript I used
10:09:58FromDiscord<alehander42> @haxscramper honestly symbols look better to me, but that's why its subjective
10:10:10FromDiscord<alehander42> i think code blocks shouldnt ping
10:10:12FromDiscord<alehander42> `@everyone`
10:10:25FromDiscord<haxscramper> Not everyone uses code blocks
10:10:33FromDiscord<alehander42> well mate
10:10:36FromDiscord<alehander42> python has decorators
10:10:41FromDiscord<alehander42> ruby instance vars
10:10:55FromDiscord<alehander42> its not really a lang design argument 😄 how it would work in discord
10:11:05FromDiscord<haxscramper> For some reason I now want to do it myself
10:11:32FromDiscord<alehander42> @haxscramper it would be best to summarize your plan and maybe keyword vs symbol examples
10:11:38FromDiscord<alehander42> in the rfc
10:11:44FromDiscord<alehander42> and post a link for that in the forum
10:11:59FromDiscord<alehander42> to the comment that has it summarized (your original one or other.!)
10:12:11FromDiscord<alehander42> @himu variant types
10:12:21FromDiscord<alehander42> are usually used for "sum"-like types in nim
10:12:31FromDiscord<haxscramper> Okay, I will post all alternative syntaxes that I have in mind and then link to it.
10:12:47FromDiscord<alehander42> the compiler itself also uses those iirc
10:12:56FromDiscord<alehander42> and then we can ping everyone 😄
10:13:22FromDiscord<ShalokShalom> And think about the exhaustiveness because people are lazy and doing mistakes and insisting on correctness and completeness is a good thing 🙄
10:14:01FromDiscord<haxscramper> We want to do much more than just sum types matching, so it will be really complicated in general case
10:14:27FromDiscord<ShalokShalom> How are other languages are doing it?
10:15:04FromDiscord<haxscramper> I haven't seen any language that has pattern matching for json/seqs/sets
10:15:34FromDiscord<haxscramper> Well, maybe for seqs
10:15:50FromDiscord<alehander42> it's good to research
10:15:56FromDiscord<alehander42> i wanted to work on a project that comapres
10:16:07FromDiscord<alehander42> features in different languages for cases like that
10:16:30FromDiscord<alehander42> so one can more easily go and see in one place different approaches
10:16:42FromDiscord<himu> @alehander42 Shit! Variant Types is so easy to implement! Damn! I spent 4 days in Rust figuring that out. I was a noob though back then
10:16:44FromDiscord<alehander42> in a web app
10:17:18FromDiscord<ShalokShalom> But you could give me exhaustion by default, most would do no json pattern matching 🙄
10:17:21FromDiscord<alehander42> @himu hm, i think they work pretty well in rust too (they have "enums" which do it)
10:17:28FromDiscord<alehander42> but yeah they are the tool
10:17:51FromDiscord<alehander42> @ShalokShalom yes, we should do it at least for sum types
10:17:58FromDiscord<alehander42> btw i was surprised
10:18:08FromDiscord<alehander42> that haskell by default doesnt warn me about it
10:18:09FromDiscord<ShalokShalom> Type providers would be cool
10:18:12FromDiscord<ShalokShalom> https://fsharp.github.io/FSharp.Data/library/JsonProvider.html
10:18:12FromDiscord<alehander42> but fails with runtime error
10:18:19FromDiscord<alehander42> maybe its a matter of setting
10:18:21FromDiscord<himu> yeah. I used enums. Which work as well. But then I had a new issues with pointers and stuff. I come from Java/javaScript background
10:18:30FromDiscord<haxscramper> In general I think pattern matching on sequences is a really interesting thing
10:18:31FromDiscord<alehander42> @himu yeah borrowing might be harder
10:18:36FromDiscord<haxscramper> Basically this is a parsing
10:18:42FromDiscord<ShalokShalom> > @ShalokShalom yes, we should do it at least for sum types↵@alehander42 Yes, I would be totally down with this ❣️
10:18:50FromDiscord<haxscramper> But this is not what we want to have in patern matching
10:18:58FromDiscord<alehander42> @ShalokShalom yes! compile time code might help with providers
10:19:07FromDiscord<alehander42> but i am not entirely sure it would be easy
10:19:10FromDiscord<ShalokShalom> Ccooool 🥳
10:19:17FromDiscord<haxscramper> And `Option[T]` should be a special cased too
10:19:22FromDiscord<alehander42> i mean i might misunderstand theem
10:19:24FromDiscord<ShalokShalom> Easy is nothing good
10:19:31FromDiscord<ShalokShalom> But it could be simple
10:19:33FromDiscord<alehander42> so i have to play with f#
10:19:36FromDiscord<alehander42> a bit more
10:19:40FromDiscord<ShalokShalom> F# is awesome
10:19:47FromDiscord<ShalokShalom> One of my favorite languages
10:19:54FromDiscord<ShalokShalom> And type providers exist just there
10:19:58FromDiscord<alehander42> but just keep in mind: all of those are cool , but nim remains an imperative language, so i'd like to get many of those features
10:20:06FromDiscord<haxscramper> !eval import macros; dumpTree(`F#` is awesome)
10:20:08NimBotCompile failed: /usercode/in.nim(1, 41) Error: identifier expected, but got '[EOF]'
10:20:10FromDiscord<alehander42> but they would be probably adapted to the model
10:20:18FromDiscord<alehander42> so it wouldnt really feel as f# after all
10:20:23FromDiscord<ShalokShalom> The C# people think they have the best thing since sliced bread, the minimal version of it, called LINQ
10:20:35FromDiscord<ShalokShalom> They are completely hyped about it 😁
10:20:37FromDiscord<alehander42> @haxscramper yeah Options are important
10:20:42FromDiscord<alehander42> yeah right
10:20:46FromDiscord<alehander42> it makes sense
10:20:52FromDiscord<alehander42> well this applies to a lot of stuff
10:20:59AraqLINQ? that's old stuff, nobody is hyped about it anymore
10:21:03FromDiscord<alehander42> dependent types and we when we can prove stuff about static ints 😄
10:21:16FromDiscord<alehander42> but limitations are part of good design
10:21:19Araq(not that it is bad, LINQ is good)
10:21:24FromDiscord<ShalokShalom> > but just keep in mind: all of those are cool , but nim remains an imperative language, so i'd like to get many of those features↵@alehander42 Well, Nim is an imperative first, multi paradigm language, no?
10:21:25FromDiscord<haxscramper> > The C# people think they have the best thing since sliced bread, the minimal version of it, called LINQ↵@ShalokShalom I'm not familliar with LINQ, but would you recommend looking into it for pattern matching ideas?
10:21:48FromDiscord<ShalokShalom> Its functional features are already nearly on par with functional languages, overall
10:21:54FromDiscord<ShalokShalom> There is not that much missing.
10:22:02FromDiscord<alehander42> @haxscramper i'd look at scala as well, iirc @krux02 had some good insights from it (and its also not functional-only)
10:22:43FromDiscord<ShalokShalom> @haxscramper No. I was speaking about LINQ in favor of type providers, their origin and more attractive(and competent) version in F#
10:23:11FromDiscord<alehander42> c# did add some form of matching in the latest versions
10:23:55FromDiscord<alehander42> the other thing is: most non-functional languages seem to start from somewhere not very big in matching
10:24:09FromDiscord<ShalokShalom> https://docs.microsoft.com/en-us/dotnet/fsharp/tutorials/type-providers/<@608382355454951435>
10:24:22FromDiscord<ShalokShalom> @haxscramper
10:24:31FromDiscord<alehander42> so maybe its indeed ok to focus on the most important things and ensure its easy to do it for more situations
10:24:32FromDiscord<alehander42> later
10:24:36FromDiscord<ShalokShalom> (edit) 'https://docs.microsoft.com/en-us/dotnet/fsharp/tutorials/type-providers/<@608382355454951435>' => 'https://docs.microsoft.com/en-us/dotnet/fsharp/tutorials/type-providers/ @haxscramper'
10:25:11FromDiscord<ShalokShalom> > the other thing is: most non-functional languages seem to start from somewhere not very big in matching↵@alehander42 Nim is unlike those languages and more flexible?
10:25:17FromDiscord<alehander42> really, just having a way to write patty's `MyType = variant: A(b: int) B(c: string)` etc
10:25:32FromDiscord<alehander42> and pattern match on it and sequences / options / nodes / objects
10:25:38FromDiscord<alehander42> would be a big step
10:26:05FromDiscord<alehander42> @ShalokShalom yes, but what i mean is to not go overboard
10:26:37FromDiscord<alehander42> it's a big design space with many language ideas, so i feel it would take months / years to properly research it
10:26:37FromDiscord<ShalokShalom> Yes
10:26:45FromDiscord<alehander42> very deeply
10:26:53FromDiscord<ShalokShalom> Sure 🤷‍♂️
10:26:58FromDiscord<ShalokShalom> That is always good
10:27:01FromDiscord<haxscramper> > Nim is unlike those languages and more flexible?↵@ShalokShalom in nim you just go do like "you can probably make a macro for that" in 90% of the cases
10:27:05FromDiscord<ShalokShalom> Saves much time later on.
10:27:17FromDiscord<ShalokShalom> @haxscramper Yes, that is totally awesome
10:27:24FromDiscord<ShalokShalom> I saw it yesterday 🥳
10:47:19*xace quit (Ping timeout: 260 seconds)
10:47:28*superbia joined #nim
10:54:51*kenran joined #nim
11:11:48*Trustable joined #nim
11:15:34Oddmongerlqdev : hello, finally i had answer to my problem with the table of functions : https://forum.nim-lang.org/t/6848
11:18:21*guelosk[m] joined #nim
11:34:53*mmohammadi9812 joined #nim
11:37:50*tane joined #nim
11:42:03FromDiscord<haxscramper> It seems like forum updater stopped working (last update on september 19), so I will just put it here manually - https://forum.nim-lang.org/t/6850
11:44:11*noonien joined #nim
11:44:23FromDiscord<lqdev> Oddmonger: cool!]
11:45:17PMunch@hax, I'd say definitely go for names instead of symbels
11:45:22PMunchsymbols*
11:45:48FromDiscord<Rika> im for names instead of symbols too
11:45:51FromDiscord<haxscramper> WIll look similar to SQL
11:46:01FromDiscord<haxscramper> and LINQ
11:46:02FromDiscord<Rika> better than looking like APL
11:50:31PMunchAnd it will be much more readable to people who aren't familiar with the library
11:50:47PMunchAnd Nim tends to use names over symbols anyways
11:53:10FromDiscord<haxscramper> Would be even better if `[while @var in {1,2,3}]` was supported
11:53:25FromDiscord<haxscramper> Basically reverse list comprehension
11:54:13FromDiscord<haxscramper> Can use `whilst` though. Or something simiar - need to look for lisp `loop` macro keywords
11:54:19*waleee-cl joined #nim
11:59:54FromDiscord<alehander42> PMunch this gets a bit over-verbose to imho
12:00:16FromDiscord<alehander42> i totally agree that too many symbols can be strange
12:00:31FromDiscord<alehander42> but there is a balance to have 1-2 symbol for very common stuff
12:00:36FromDiscord<alehander42> and names for the others
12:01:01FromDiscord<alehander42> e.g. `*` is ok for me, because regex uses it
12:01:07FromDiscord<alehander42> but i can see how people might disagree
12:02:54PMunchTrue, but most people struggle with reading regex as well..
12:03:52FromDiscord<Vindaar> but regex is hard, because of a lot of important rules one has to keep in mind while parsing each character carefully
12:04:37*mmohammadi98126 joined #nim
12:04:44*mmohammadi9812 quit (Ping timeout: 258 seconds)
12:04:44*mmohammadi98126 is now known as mmohammadi9812
12:04:50FromDiscord<Vindaar> and also there isn't really "wrong" regex. it simply won't match what you want
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:35*supakeen joined #nim
12:07:40FromDiscord<alehander42> yeah but i mean something else
12:07:50FromDiscord<alehander42> that `*` is known
12:07:58FromDiscord<alehander42> i dont want it to look all like regex
12:08:13FromDiscord<alehander42> but a symbol that is known, is easier to be accepted than a custom
12:09:24AraqVindaar: it's called "declarative programming", looks good on the screen, impossible to debug :P
12:09:51Araqsee also: makefiles, SQL...
12:10:48FromDiscord<haxscramper> Oh, yes. Should I add some kind of `--d:traceMatch` to pretty-print all matches?
12:15:46*mmohammadi9812 quit (Ping timeout: 246 seconds)
12:19:30*rockcavera joined #nim
12:20:07FromDiscord<alehander42> sounds good to me in principle
12:20:11*mmohammadi9812 joined #nim
12:31:03*queen quit (Remote host closed the connection)
12:31:32*queen joined #nim
12:35:25*mmohammadi9812 quit (Ping timeout: 240 seconds)
12:39:50*mmohammadi9812 joined #nim
12:51:18*uvegbot quit (Ping timeout: 244 seconds)
12:52:29*shad0w_ joined #nim
12:53:02*zyklon joined #nim
12:58:09*Kaivo joined #nim
12:58:37FromDiscord<ShalokShalom> > Vindaar: it's called "declarative programming", looks good on the screen, impossible to debug :P↵@Araq[IRC]#0000 Good thing is, good declarative code doesn't need to be debugged so hard 😅
12:58:53FromDiscord<ShalokShalom> All functional programming is declarative.
13:00:36FromDiscord<ShalokShalom> Makefiles, SQL and stuff like this is just the worst of the worst, that you can do with declarative coding.
13:00:48FromDiscord<ShalokShalom> Oh, and COBOL.
13:17:43OddmongerMakefiles are like a game with a delicate state machine with obscure state names
13:18:03Oddmongerbut they are still far better than cmake
13:24:13Oddmongerfor testing a define for conditional compilation, it's when var: … ?
13:24:50Oddmongerbecause everything after the when will be «conditionnaly compiled»
13:25:13Oddmongersays, i have: when debug: , for a portion of code i want only for debugging
13:25:32Oddmongerbut after this portion, i have code i want in release _and_ debug
13:26:00Oddmongerso should i put: when release: and immediatly after else: ?
13:26:32Oddmongerno, that won't work
13:27:19Oddmongerthe only possibility i see is to put the «when debug:» at the end of the unit compilation, when i don't want code for anything else than debug
13:27:28*shad0w_ quit (Remote host closed the connection)
13:31:43*shad0w_ joined #nim
13:31:45*Vladar joined #nim
13:32:27FromDiscord<haxscramper> You can put more complex expressions in `when` + you can use `when`, `elif`, `else` for multiple tests
13:33:18FromDiscord<haxscramper> also `when defined(yourDebug)`, not just `when yourDebug`
13:33:30Oddmongerah
13:34:14Oddmongerbut when defined(debug): followed by an «else:» would produce code (after the «else:») which will be only in release
13:34:25Oddmongernot in both debug and release
13:37:04FromDiscord<haxscramper> What do you want to do exactly?
13:37:18*krux02 quit (Remote host closed the connection)
13:37:19*shad0w_ quit (Ping timeout: 246 seconds)
13:37:51*krux02 joined #nim
13:38:54Oddmongerin a game, i want to activate/desactivate the profiler,but only in debug mode
13:40:34Oddmongerhhuu … when defined(…) kills result
13:40:47Oddmongeri mean, i have error «result is not defined»
13:42:54FromDiscord<haxscramper> if you are talking about nim profiler: `when defined(nimprof): import nimprof`
13:42:55Oddmongerok found it… but not very clean
13:44:43Oddmongerlike this: http://ix.io/2yvn
13:45:01Oddmonger(i was talking about Orx profiler, sorry)
13:47:29*skrzyp1 is now known as skrzyp
13:48:28*mmohammadi98120 joined #nim
13:49:35*shad0w_ joined #nim
13:50:58*mmohammadi9812 quit (Ping timeout: 272 seconds)
13:50:58*mmohammadi98120 is now known as mmohammadi9812
13:54:37*matthias_ joined #nim
13:59:22FromDiscord<shirleyquirk> Code that runs in both debug and release is the default. What am I missing
14:06:00FromDiscord<Rika> yeah, just dont put in a when else
14:06:02FromDiscord<Rika> idgi either
14:06:15*mmohammadi9812 quit (Ping timeout: 258 seconds)
14:07:19*mmohammadi9812 joined #nim
14:10:25FromDiscord<shirleyquirk> defined(debug) is always false, debug is the default.
14:10:48Araqwhen defined(release)
14:10:55Araqor 'when not defined(release)'
14:11:33FromDiscord<shirleyquirk> not defined(release) is also true with d: danger
14:11:48FromDiscord<Rika> its not
14:11:56FromDiscord<Rika> danger defines release
14:12:59FromDiscord<shirleyquirk> https://repl.it/repls/PlumpIncompleteFormat<#371759389889003532>.nim
14:14:26FromDiscord<slonik_az> > @haxscramper, I'd say definitely go for names instead of symbels↵@PMunch[IRC]: I am a Nim newbie. What is the difference between a name and a symbol?
14:14:48FromDiscord<slonik_az> (edit) removed '> @haxscramper,'
14:15:04FromDiscord<slonik_az> (edit) 'I'd' => '"I'd' | 'symbels↵@PMunch[IRC]:' => 'symbels"↵@PMunch[IRC]:'
14:15:26FromDiscord<Rika> one is something like `test` another is `%*`
14:15:44Oddmongerthe ix.io i've posted is working, it was just for showing my solution
14:15:56*matthias_ is now known as _M
14:17:10FromDiscord<slonik_az> Is symbol a superset of name then?
14:17:45FromDiscord<Rika> no, its informal terminology
14:17:56FromDiscord<Rika> symbols are just non-alphanumerics
14:18:52FromDiscord<shirleyquirk> Ugh. Works on commandline, not in nim.cfh
14:19:36FromDiscord<Rika> documented bug
14:19:50FromDiscord<shirleyquirk> TIL
14:21:39AraqRika: it's a pita but not really a bug :P
14:21:52Araqbut we need to change it anyhow
14:22:07Araqreminds me... I wanted to rewrite Nimscript suppport
14:22:18FromDiscord<Rika> its kinda a bug aint it? it should work the same in either ways
14:24:16FromDiscord<alehander42> operators
14:24:21FromDiscord<alehander42> would be more exact probably
14:24:36FromDiscord<Rika> not really, `mod` is an operator but not a symbol
14:24:47FromDiscord<alehander42> yeah .. well symbol doesnt sound good
14:24:55FromDiscord<alehander42> because we have nnkSym
14:27:55FromDiscord<Yardanico> It's not a bug that release or danger don't work in config files
14:28:15FromDiscord<Yardanico> It's due to how they are defined and evaluation order for configa
14:28:22FromDiscord<Yardanico> And there's an open issue about that already
14:28:34FromGitter<gogolxdong> Which type should be used for importc c struct, object or ref object
14:28:56FromDiscord<Yardanico> always object
14:29:09FromDiscord<Yardanico> probably you'll also need bycopy
14:29:17FromDiscord<Yardanico> Use c2nim
14:29:24FromGitter<gogolxdong> what's the matter with ref object
14:30:38FromDiscord<Yardanico> ref objects are managed references to objects
14:30:55FromDiscord<Yardanico> C doesn't have Nim references, believe it or not
14:31:15FromDiscord<Yardanico> But you can always wrap your C-imported object in a ref object
14:34:40FromGitter<gogolxdong> what's the difference between bycopy and pure, final
14:38:31FromGitter<gogolxdong> stdlib uses bycopy rarely.
14:44:07FromDiscord<Clyybber> Araq: Ping
14:44:21FromDiscord<Clyybber> gogolxdong: Not related
14:44:32FromDiscord<Clyybber> pure is for enums
14:44:35FromDiscord<Clyybber> final is for inheritance
14:44:50FromDiscord<Clyybber> and bycopy is for argument passing
14:45:43FromGitter<gogolxdong> what if C-imported object without bycopy ,what will happen when passing argument.
14:50:56FromGitter<gogolxdong> An object type can be marked with the ``pure`` pragma so that its type field ⏎ which is used for runtime type identification is omitted. This used to be ⏎ necessary for binary compatibility with other compiled languages.
14:51:14FromGitter<gogolxdong> stdlib uses pure more.
14:51:55FromDiscord<Clyybber> huh TIL
14:55:44*mmohammadi9812 quit (Ping timeout: 265 seconds)
14:56:49*a_chou joined #nim
14:59:03*xace joined #nim
15:01:46FromGitter<gogolxdong> ```code paste, see link``` ⏎ ⏎ Error: illegal recursion in type 'AVPacketList' [https://gitter.im/nim-lang/Nim?at=5f6b63591c5b0d210ac7b34d]
15:02:50*NimBot joined #nim
15:07:13*mutantturkey left #nim (#nim)
15:11:29FromGitter<gogolxdong> Some types like AVFormatContext which isn't recursive object got the same error , ref object resolves , have no idea what's the golden principle.
15:13:04Araqgolden principle is to understand why next*: AVPacketList would take up an infinite amount of memory and next*: ref AVPacketList doesn't
15:14:01Araqclyybber: 'pure' only means something when combined with .inheritable
15:15:29FromGitter<gogolxdong> yes, I have changed next to ref object, and non-recursive object got the same error using object . The only way I found out works is using ref object.
15:21:44Araqyou don't have to "find out", you have to understand
15:22:06Araqdon't hack around until stuff compiles, understand why the one thing works and the other is illogical
15:25:36FromGitter<gogolxdong> I'm using nimffmpeg , it uses raw pointer, malloc and free as usual. I'm trying to make it pure.
15:29:14*Trustable quit (Remote host closed the connection)
15:31:46FromGitter<gogolxdong> Time to go to bed, see you!
15:33:49*kenran quit (Ping timeout: 264 seconds)
15:34:07*aenesidemus joined #nim
15:37:24*sealmove joined #nim
15:37:36sealmovenimscript can use `walkDir()` now :D <3
15:38:25*mmohammadi9812 joined #nim
15:44:40*gour_ joined #nim
15:48:08*gour quit (Ping timeout: 272 seconds)
15:56:00FromDiscord<juan_carlos> NimScript <3
15:59:58*mmohammadi9812 quit (Ping timeout: 260 seconds)
16:00:37PrestigeWhat editor/plugins do ppl use for nimscript?
16:00:38*abm quit (Read error: Connection reset by peer)
16:04:54FromDiscord<juan_carlos> Just Nim, is the same syntax.
16:05:51*mmohammadi9812 joined #nim
16:16:13*hnOsmium0001 joined #nim
16:19:38*mmohammadi9812 quit (Quit: I quit (╯°□°)╯︵ ┻━┻)
16:22:11*mmohammadi9812 joined #nim
16:23:19PrestigeI thought I'd tried it before and ran into issues, because nims doesn't support everything that nim does
16:25:41FromDiscord<juan_carlos> Some people say only 25% of nim works on nimscript and is not true. :|
16:25:54FromDiscord<juan_carlos> ... is actually 26% :P
16:29:21FromDiscord<Vindaar> Prestige, I'm not quite following. What does that have to do with your editor?
16:33:03*arecacea1 quit (Remote host closed the connection)
16:33:09PrestigeThe editor is aware of the context
16:33:19PrestigeWell, mine isn't
16:33:27*arecacea1 joined #nim
16:33:37PrestigeIt thinks I'm writing nim, not nimscript
16:33:58FromDiscord<Vindaar> oh you were talking about fancy editor features
16:34:55PrestigeRight, yeah
16:35:08PrestigeI'm using neovim with nimlsp atm
16:42:58*thomasross joined #nim
17:06:49*vicfred quit (Remote host closed the connection)
17:07:14*vicfred joined #nim
17:13:09FromDiscord<haxscramper> Is it possible to check if arbitrary expression has a type or not? Something like `echo (echo true) is void`
17:14:58*shad0w_ quit (Remote host closed the connection)
17:15:21*shad0w_ joined #nim
17:15:55FromDiscord<Vindaar> use a macro with `getType` and friends?
17:17:06FromDiscord<19> hello, can someone critique my code: https://play.nim-lang.org/#ix=2ywE↵thanks
17:18:21FromDiscord<Rika> the variables are unnecessarily var
17:18:59FromDiscord<19> ok, but is this how you are supposed to access and move around memory?
17:19:19FromDiscord<Rika> why cant you just use a sequence? or an array?
17:19:48FromDiscord<Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=2ywF
17:20:02FromDiscord<Vindaar> oops
17:20:17FromDiscord<19> im just trying to play around with manual stuff. just to learn if this is how its done. ideally i would use GC
17:20:18FromDiscord<Vindaar> ah, nvm
17:20:52FromDiscord<Vindaar> (edit) 'https://play.nim-lang.org/#ix=2ywF' => 'https://play.nim-lang.org/#ix=2ywG'
17:20:53FromDiscord<Rika> 19 thats one way to do it yes but it's C-style so its not a great idea to use it ever
17:21:05FromDiscord<haxscramper> @Vindaar yes, that's exactly what I need. I just want to convert `void` expressions to `true`, so that's precisely what I wanted
17:21:08FromDiscord<Rika> you can also use UncheckedArray and itll look more nim like afaik
17:21:16FromDiscord<Vindaar> @haxscramper cool!
17:22:54FromDiscord<19> thanks @Rika. the thing is im following a C programming tutorial with nim and he does some pointer manipulation and bit shifting. so im trying to do that in nim and then ill find a way to do that without the manual c-style stuff.
17:23:42FromDiscord<19> im not used to GC stuff
17:30:22*kenran joined #nim
17:35:24*kenran quit (Ping timeout: 260 seconds)
17:36:45Oddmongeris it possible to inline functions with Nim ? I tried with templates, but…
17:36:54FromDiscord<lqdev> yes
17:36:55Oddmongeris it the way to go ?
17:36:58FromDiscord<lqdev> use the {.inline.} pragma
17:37:05Oddmongerahh
17:37:20Oddmongerso i define proc with {.inline.} and that's all ?
17:37:23FromDiscord<lqdev> yes
17:37:29Oddmongerok, thank you
17:37:40FromDiscord<lqdev> or if you have a set of procs that you want to inline, you can put them between {.push inline.} {.pop.}
17:39:13krux02Oddmonger, {.inline.} just propagates the inlining to the C compiler, it doesn't do the inlining on it's own. The effect should be the same though.
17:39:32Oddmongerah ok
17:39:45FromDiscord<lqdev> true that
17:40:11Oddmongeri tried to do it with template, but {.inline.} is definitively the way to go, when the template has conditions
17:40:43FromDiscord<lqdev> but in most cases the C compiler _does_ oblige and inline your proc
17:51:47Oddmongeri thought by default, for :bool proc , result was set to true
17:57:30FromDiscord<Recruit_main707> @19 i still think regions is a better option than gc none (and arc even a better one, but thats not manual memory management), if you are gonna go without gc, check regions
17:59:08FromDiscord<Recruit_main707> it will make things cleaner in general, and remove some ugly casts by just using `new` since managed pointers, aka `refs` are not managed automatically
18:01:21Araqjust don't follow C programming tutorials. What's next, following Forth programming tutorials?
18:02:48FromDiscord<Recruit_main707> and yeah, youd rather do it the nim way out of the box
18:09:47FromDiscord<lqdev> Oddmonger: that's not the case :)
18:09:57FromDiscord<lqdev> `result` is always initialized to binary zero
18:10:08FromDiscord<lqdev> cast[bool](0) == false
18:11:06Oddmonger/o\
18:11:32Oddmongerthanks for the explaination, i was sure i had read that boolean was set to true
18:15:39FromDiscord<19> @Recruit_main707 im still figuring it out. do you mean regions as in "memory arenas"? im not against GC, im just too used to C/C++
18:20:36*sealmove quit (Quit: WeeChat 2.8)
18:23:18*arecacea1 quit (Remote host closed the connection)
18:23:48*arecacea1 joined #nim
18:27:32FromDiscord<Recruit_main707> regions is the forgotten gc
18:28:35FromDiscord<Recruit_main707> it allows you to have memory regions where you allocate stuff and can deallocate it all at once, (or individually if you will)
18:28:38FromDiscord<lqdev> """""""gc"""""""
18:28:40FromDiscord<lqdev> it's not a gc
18:29:10FromDiscord<Recruit_main707> well, when i say gc i just mean its an option of the `gc` parameter
18:29:11FromDiscord<lqdev> and i don't think it's really forgotten, just undocumented
18:29:19FromDiscord<lqdev> also superseded by ARC
18:29:39FromDiscord<Recruit_main707> all gc options are sperseded by arc though
18:35:39*eburk joined #nim
18:50:24*antranigv quit (Quit: ZNC 1.7.5 - https://znc.in)
18:50:25*my_dude joined #nim
18:50:54*antranigv joined #nim
18:52:55FromDiscord<19> i just need to get used to arc/orc.↵thanks for the tips
18:55:46*my_dude quit (Quit: ZZZzzz…)
19:01:00FromDiscord<lqdev> there isn't really anything to get used to in a lang with automatic memory management tbh
19:01:02*Zectbumo joined #nim
19:01:07FromDiscord<lqdev> just forget about managing memory altogether
19:01:12*Q-Master joined #nim
19:01:47*shad0w_ quit (Remote host closed the connection)
19:03:34FromDiscord<alehander42> @haxscramper oi
19:03:47FromDiscord<alehander42> so one thing from a first glance (maybe i was too lazy to read)
19:03:49FromDiscord<alehander42> isnot : why ?
19:03:56FromDiscord<alehander42> cant we just leave it for `else`
19:04:04FromDiscord<alehander42> and let normal nim code handle a custom error
19:04:08FromDiscord<haxscramper> This is invalid syntax
19:04:16FromDiscord<alehander42> else is not invalid
19:04:26FromDiscord<alehander42> of stuff: else: other
19:04:27FromDiscord<haxscramper> !eval opt @value else "defauilt"
19:04:28NimBotCompile failed: /usercode/in.nim(1, 12) Error: invalid indentation
19:04:32FromDiscord<alehander42> no
19:04:37FromDiscord<alehander42> i mean that if a match fail
19:04:39FromDiscord<alehander42> this is ok
19:04:44FromDiscord<alehander42> it's like `if` fail
19:04:49FromDiscord<alehander42> if thats a problem
19:04:51FromDiscord<alehander42> just use else
19:05:10FromDiscord<haxscramper> I dont' understand. There is an `else` for the whole `case` already
19:05:13FromDiscord<alehander42> yes
19:05:20FromDiscord<alehander42> but this error won't be printed out
19:05:25FromDiscord<alehander42> if another match matches
19:05:29FromDiscord<alehander42> so it makes sense only
19:05:32FromDiscord<alehander42> if no match matches
19:05:37FromDiscord<alehander42> : else
19:06:03FromDiscord<haxscramper> You suggest to have `of <pattern> else: <default>`?
19:06:04*Q-Master quit (Ping timeout: 244 seconds)
19:06:08FromDiscord<alehander42> no
19:06:18FromDiscord<alehander42> hm, i find the whole raise thing a bit strange
19:06:23FromDiscord<alehander42> because it doesnt make sense
19:06:28FromDiscord<alehander42> in a control flow construct
19:06:44FromDiscord<alehander42> if an arm doesnt match: this is not an error
19:06:54FromDiscord<alehander42> that's the point of switches/cases
19:07:07FromDiscord<alehander42> if you want: you can make it an error in the default case obviously
19:07:29*Q-Master joined #nim
19:07:29FromDiscord<haxscramper> What I'm saying is: we woin't guarantee that match failure doesn't raise. Feel free to blow up however you like
19:07:34FromDiscord<alehander42> or if there is not else: then it seems logical to have an auto-raise
19:07:43FromDiscord<alehander42> yes, but i am talking about `isnot`
19:07:48*a_chou quit (Quit: a_chou)
19:09:11FromDiscord<haxscramper> > if an arm doesnt match: this is not an error↵@alehander42 It is, when I work with some user input I often have `if A then expect B too`. And when there is no `B` it is an error
19:09:28FromDiscord<alehander42> but mate
19:09:34FromDiscord<haxscramper> Well, not **is**, but *might be*
19:09:34FromDiscord<alehander42> the user specifies the error
19:09:37FromDiscord<alehander42> using nim
19:09:39FromDiscord<alehander42> that's the point
19:09:42FromDiscord<alehander42> when you have `if`
19:09:46FromDiscord<alehander42> it being false
19:10:03FromDiscord<alehander42> isn't a raise: you write the error logic inside the else
19:10:19FromDiscord<alehander42> the point is to direct the logic somewhere
19:10:36FromDiscord<haxscramper> What? `isnot` is useful if you want to create error diagnostics precisely where expectation failed
19:11:08FromDiscord<haxscramper> I don't see a lot of people writing adequate error messages tbh
19:11:15FromDiscord<haxscramper> So this is a niche feature
19:11:32FromDiscord<haxscramper> Because nobody writes good error messages anyway
19:11:40FromDiscord<alehander42> well sorry but this is a bit limiting: people can handle the error in many ways: error result exception trace message etc
19:11:54FromDiscord<alehander42> and there is no reason to not just use code e.g.
19:12:17FromDiscord<haxscramper> I don't understand again. If you want you can just raise anywhere else
19:12:31FromDiscord<alehander42> yes, and you dont need a special dsl inside match
19:12:33FromDiscord<alehander42> for that
19:12:35FromDiscord<haxscramper> `isnot` is *specifically* made that you can raise inside of failed match arm
19:12:46FromDiscord<alehander42> but this is super bizarre
19:12:55FromDiscord<alehander42> its like if stuff isnot error
19:13:08FromDiscord<alehander42> ok, think about it
19:13:17FromDiscord<alehander42> what happens if there are next `of` branches?
19:13:26FromDiscord<alehander42> aren't they tried
19:13:26FromDiscord<haxscramper> Well, I can't use `else` as infix, so I'm playing with what I got basically in terms of keywords
19:13:37FromDiscord<alehander42> wrong level
19:13:42FromDiscord<alehander42> think about the next `of`
19:13:54FromDiscord<alehander42> what happens to the next `of`
19:13:59*kenran joined #nim
19:14:12FromDiscord<alehander42> `if`, `case` work on the base
19:14:24FromDiscord<alehander42> that whenever an arm is false, you continue with the next
19:14:29FromDiscord<alehander42> there is no "fail" concept
19:14:32FromDiscord<haxscramper> > what happens if there are next `of` branches?↵@alehander42 This is made for cases where input data should not match *partially*. It either matches whol arm or doesn
19:14:37FromDiscord<haxscramper> 't even start
19:14:54FromDiscord<haxscramper> For processing partially correct input
19:15:02FromDiscord<alehander42> but it always either even matches fully or not
19:15:09FromDiscord<alehander42> arms are boolean
19:15:10FromDiscord<haxscramper> No
19:15:16FromDiscord<haxscramper> Well, not exactly
19:15:25FromDiscord<alehander42> this is surprising
19:15:27FromDiscord<alehander42> ok
19:15:37FromDiscord<haxscramper> I want to handle situation where it *should* match fully
19:15:48FromDiscord<haxscramper> But doesn't because it is a malformed
19:15:52FromDiscord<alehander42> but it always should match fully
19:15:57FromDiscord<alehander42> thats the idea of a pattern
19:16:12FromDiscord<haxscramper> Like technically this is a failure, but I don't care about trying anything else
19:16:16FromDiscord<alehander42> if you have some freedom: the patterns provides wildcards
19:16:21FromDiscord<haxscramper> So other match arms are basically useless
19:17:15FromDiscord<alehander42> this would be strange, i see what you mean
19:17:19FromDiscord<alehander42> but this is not how case works
19:17:19FromDiscord<haxscramper> You wrote `{"hello": 12}` when I wanted string - I don't really want to try anything else with "hello", because I know it won't match
19:17:22FromDiscord<Clyybber> and you get a fail only on a "partial" match?
19:17:32FromDiscord<Clyybber> and not an a complete non-match
19:17:37FromDiscord<alehander42> the point of reusing case is to behave
19:17:39FromDiscord<alehander42> similarly
19:17:46FromDiscord<Clyybber> thats weird, because its not clear what a partial match is IMO
19:17:49FromDiscord<alehander42> otherwise i dont think we should use th same keyword
19:17:56FromDiscord<haxscramper> I don't **get** fail. I can, _in theory_, If i really want, provide more extensive diagnositcs
19:18:06FromDiscord<haxscramper> By utiliziing `isnot`
19:18:16FromDiscord<alehander42> yes; but then the error would actually be raised
19:18:17FromDiscord<haxscramper> Otherwise failed match is failed
19:18:21FromDiscord<Clyybber> it seems a bit like {.explain.}
19:18:23FromDiscord<alehander42> if there is no `else`
19:18:30FromDiscord<alehander42> or yeah if you explicitly
19:18:43FromDiscord<alehander42> want it e.g. `{.caseError.}`
19:19:00FromDiscord<alehander42> so this is good
19:19:17FromDiscord<alehander42> if e.g. you have of A isnot C .. of B .. end
19:19:28*kenran quit (Ping timeout: 260 seconds)
19:19:31FromDiscord<alehander42> and if it doesnt match: in the end it raises an error including your C
19:19:35FromDiscord<alehander42> with smarter diagnosis
19:19:48*gour_ quit (Remote host closed the connection)
19:20:14FromDiscord<alehander42> but otherwise it's just too custom imo: after all this is a lang construct
19:20:14*kenran joined #nim
19:20:18FromDiscord<alehander42> a *basic* primitive
19:20:29FromDiscord<haxscramper> Like "none of the arms matched, here is a first exception" kind of thing?
19:20:35FromDiscord<alehander42> which should behave generally as case does
19:20:42FromDiscord<alehander42> yeah : imo of course
19:21:12FromDiscord<haxscramper> Okay, yes, maybe `isnot` is not necessary
19:21:17FromDiscord<alehander42> i mean it can be
19:21:20FromDiscord<haxscramper> no no
19:21:23FromDiscord<haxscramper> you got the point
19:21:25FromDiscord<haxscramper> actually
19:21:25FromDiscord<alehander42> to add a special message to the error
19:21:33FromDiscord<alehander42> but not to immediately raise
19:21:59FromDiscord<haxscramper> I actually think I'm doing ..
19:22:56FromDiscord<haxscramper> > Use if inside of match arm↵@haxscramper
19:23:01FromDiscord<alehander42> and overally i think most of the matches can be made in a way to not raise , but just not match
19:23:03FromDiscord<haxscramper> Yes,
19:23:12FromDiscord<alehander42> but i agree that i am not sure what happens about
19:23:18FromDiscord<alehander42> e.g. seq match for a string
19:23:22FromDiscord<alehander42> maybe just a compile error
19:23:35FromDiscord<alehander42> compile errors are good
19:23:36FromDiscord<haxscramper> There is no `seq` actually
19:23:45FromDiscord<alehander42> yeah sorry
19:23:48FromDiscord<alehander42> collection
19:23:49FromDiscord<haxscramper> I mean `[ ]` does not impy `openarray`
19:24:00FromDiscord<haxscramper> It implies `[idx]: T` and `len(): int`
19:25:26FromDiscord<haxscramper> So I will remove `isnot` , it really is an overkill. And quite strange even just from syntax perspective
19:25:33FromDiscord<haxscramper> Kind of feels out of place
19:26:19FromDiscord<alehander42> i mean
19:26:27FromDiscord<alehander42> its a good idea for a validation lib
19:26:34FromDiscord<alehander42> but i feel its a bit too much for now
19:27:39FromDiscord<haxscramper> yes
19:28:40FromDiscord<haxscramper> updated & removed isnot
19:31:48FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yxv
19:31:51FromDiscord<alehander42> i really like
19:31:56FromDiscord<alehander42> the rfc style tho
19:32:04FromDiscord<alehander42> well documented
19:32:19FromDiscord<alehander42> ah yeah something like this
19:32:32FromDiscord<haxscramper> I actually have this in rfc
19:32:39FromDiscord<alehander42> well for this kind of stuff you *can* probably produce a custom autogenerated error
19:32:58FromDiscord<alehander42> something like "element 1 didn't match : got 2 expected 4..5"
19:33:03FromDiscord<haxscramper> Maybe create some kind of `MatchDiagnostics` object which has all information about matches so that I can get info from it
19:33:15FromDiscord<haxscramper> Althoug this will create overhead
19:33:18FromDiscord<alehander42> in a `tryMatch`
19:33:39FromDiscord<alehander42> or `matchOrRaise` not sure of convention
19:33:40FromDiscord<haxscramper> Oh, yes
19:33:46FromDiscord<haxscramper> yes, exactly
19:33:47FromDiscord<alehander42> you can have it only for a special call
19:33:48FromDiscord<haxscramper> Perfect
19:33:57FromDiscord<alehander42> you can also just have a
19:34:00FromDiscord<alehander42> what i had in mind was
19:35:11FromDiscord<haxscramper> `tryMatch` should not open new scope thoug
19:35:28FromDiscord<alehander42> if you capture
19:35:34FromDiscord<alehander42> you can return an Option
19:35:37FromDiscord<alehander42> with a tuple
19:35:40FromDiscord<alehander42> this was another idea
19:35:45FromDiscord<haxscramper> So I can do things like `tryMatch(<user input>, [all @elems is Json()]` and just use `@elems` down the line, knowing theyare all valid
19:36:05FromDiscord<alehander42> so let a = matchCapture([@a], @[2])
19:36:10FromDiscord<alehander42> returns some (a: 2)
19:36:16FromDiscord<alehander42> but this might be a bit too much for now
19:36:31FromDiscord<alehander42> hm, i see
19:36:36FromDiscord<alehander42> this might be also possible
19:36:59FromDiscord<alehander42> so it just introduces directly new variable
19:37:09FromDiscord<alehander42> i like it
19:37:17FromDiscord<haxscramper> Just put single arm and do `let matched = <arm>` and `if not matched: suicide()`
19:37:21FromDiscord<alehander42> but i am not sure it would be accepted
19:37:43FromDiscord<haxscramper> `let result = <arm>` is a good, but you have to repeat all variables twice
19:38:21FromDiscord<haxscramper> like with `a` it doesn't look that bad, but if you have 2-3 adequately named variables it is a question whether or not it will fit on the line
19:38:26FromDiscord<haxscramper> 80char
19:38:27*Vladar quit (Quit: Leaving)
19:38:56FromDiscord<haxscramper> > but i am not sure it would be accepted↵Any pattern that is supposed to be used in `if`, like `=~` already injects variables in the same scope
19:40:09FromDiscord<haxscramper> Call it `assertMatch` instead of `tryMatch`, because it will raise on bad input
19:41:59FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yxA
19:42:24FromDiscord<haxscramper> And it solves issue with unwanted overhead for diagnositcs as it will only be generated if `makeDiagnostics = true`
19:44:23FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yxB
19:45:07*narimiran quit (Ping timeout: 258 seconds)
19:45:33FromDiscord<haxscramper> `any` is unnecessary actually. I'm already confused which one I should use where and what is the difference between `any` and `all`
19:51:56*kenran quit (Ping timeout: 256 seconds)
20:02:39*mmohammadi9812 quit (Quit: I quit (╯°□°)╯︵ ┻━┻)
20:09:01FromDiscord<Clyybber> Araq: Can we merge https://github.com/nim-lang/Nim/pull/15390 ?
20:09:01disbotFix #15389
20:11:03*FromDiscord quit (Remote host closed the connection)
20:11:17*FromDiscord joined #nim
20:15:36*arecacea1 quit (Remote host closed the connection)
20:16:09*arecacea1 joined #nim
20:27:59*kinkinkijkin joined #nim
20:28:08*queen quit (Read error: Connection reset by peer)
20:37:03*solitudesf quit (Ping timeout: 260 seconds)
20:38:55*mmohammadi9812 joined #nim
20:47:56*mmohammadi9812 quit (Quit: I quit (╯°□°)╯︵ ┻━┻)
20:49:39_MI'm trying to create a sort of proc router that takes a string pattern (think "/foo/bar<int>"), at compile time it maps it to a procedure accepting the arguments from the pattern ("proc someFoo(bar: int)"), and then later at run time it checks a procedure would check a value against the pattern and call the appropriate proc with the correct values. I've tried a couple diff approaches but come up short. Any tips on a best way to tackl
20:49:42_Me this?
20:50:21*alehander92 quit (Ping timeout: 244 seconds)
20:50:26*jholland__ quit (Ping timeout: 244 seconds)
20:50:28*hnOsmium0001 quit (Ping timeout: 256 seconds)
20:50:46*d10n-work quit (Ping timeout: 244 seconds)
20:50:53*l1x quit (Ping timeout: 246 seconds)
20:50:57*sirn quit (Ping timeout: 244 seconds)
20:51:03*euantorano quit (Ping timeout: 260 seconds)
20:51:03*kwilczynski quit (Ping timeout: 260 seconds)
20:51:03*zielmicha__ quit (Ping timeout: 260 seconds)
20:51:22*waleee-cl quit (Ping timeout: 260 seconds)
20:51:38*npgm_ quit (Ping timeout: 260 seconds)
20:52:11*sirn joined #nim
20:52:12*jholland__ joined #nim
20:52:34*npgm_ joined #nim
20:52:36FromDiscord<haxscramper> If you need to call arbitrary proc (with arbitrary signature) you would probably need to have some kind of case object to keep track of all potential types (or use `typeinfo` from stdlib).
20:52:39*zielmicha__ joined #nim
20:52:51*d10n-work joined #nim
20:52:57FromDiscord<haxscramper> And then automatically generate wrapper prorcs that will be added into dispatcher
20:53:09*waleee-cl joined #nim
20:53:20*euantorano joined #nim
20:53:28*alehander92 joined #nim
20:53:40*hnOsmium0001 joined #nim
20:54:09*kwilczynski joined #nim
20:54:11FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yxX
20:55:12FromDiscord<haxscramper> You basically want to wrap all procs in some kind of generic interface, probably by automatically type checking parameters at runtime
20:55:28FromDiscord<haxscramper> Mapping `/foo/bar<int>` to things is easy
20:56:32*l1x joined #nim
20:58:08_MThat makes sense. I had tried building a wrapper proc but ran into type issues that might be solved by using object variants to cover the potential types that could match.
20:58:11FromDiscord<haxscramper> Something like https://play.nim-lang.org/#ix=2yxY to get type of the proc and then start hacking around with more macros
20:59:09*kinkinkijkin quit (Remote host closed the connection)
20:59:37FromDiscord<haxscramper> https://nim-lang.org/docs/typeinfo.html I'm not sure but it won't work with ARC/ORC since it relies on some internals of GC. But I may be mistaken
21:00:44FromDiscord<Vindaar> There's some kind of RTTI now again, which is used for `marshal` for ARC/ORC
21:02:26FromDiscord<haxscramper> But you can always roll your own one which just performs recursive conversion of input data to shallow copy which only uses pointers.
21:05:15FromGitter<Lecale> What have I done wrong now https://play.nim-lang.org/#ix=2yxZ
21:06:09FromDiscord<InventorMatt> you don't need the return statement
21:06:20FromDiscord<haxscramper> `insert` modifes string inplace
21:06:48FromGitter<Lecale> ah that would be right
21:10:28FromDiscord<dk> which exception type fits "item not found" best?
21:11:41FromDiscord<dk> I guess it's just an AssertionError then =)
21:11:51FromDiscord<haxscramper> `KeyError` or `IndexError`
21:12:05FromDiscord<dk> it's neither really
21:12:16FromDiscord<dk> because it's a find proc
21:12:49FromDiscord<j$> is there a way to get the directory of the nim config file, in the config file?
21:14:08FromDiscord<Vindaar> @j$ in a `config.nims` file?
21:14:13FromDiscord<j$> yeah
21:15:19FromDiscord<j$> getCurrentDir()
21:15:25FromDiscord<Vindaar> yes
21:15:35FromDiscord<Vindaar> because config.nims is just NimScript
21:15:41FromDiscord<j$> yeah
21:38:06*PMunch quit (Quit: leaving)
21:43:52*my_dude joined #nim
21:47:14*tane quit (Quit: Leaving)
22:02:12*r4vi quit (Ping timeout: 260 seconds)
22:02:26FromDiscord<XxDiCaprioxX> Is there a dedicated module for matrixes?
22:06:39*r4vi joined #nim
22:06:59FromDiscord<Vindaar> you mean matrices in terms of linear algebra?
22:07:37*filcuc joined #nim
22:09:41FromDiscord<XxDiCaprioxX> Ah matrices is how you write the plural in english
22:10:01FromDiscord<XxDiCaprioxX> Yes I do but I dont need to use linear algebra, I want to utilize it for chess
22:10:04FromDiscord<Vindaar> yes, but that wasn't why I asked, haha
22:10:18FromDiscord<XxDiCaprioxX> Ik xD
22:10:53FromDiscord<Vindaar> well there's neo and arraymancer:↵- https://github.com/unicredit/neo↵- https://github.com/mratsim/Arraymancer/
22:11:35*abm joined #nim
22:11:58FromDiscord<XxDiCaprioxX> alright thanks
22:41:04*filcuc quit (Quit: Konversation terminated!)
22:50:07*alehander92 quit (Ping timeout: 240 seconds)
22:50:08*stever quit (Read error: Connection reset by peer)
22:50:14*surma quit (Read error: Connection reset by peer)
22:50:27*waleee-cl quit (Ping timeout: 240 seconds)
22:50:27*npgm_ quit (Ping timeout: 240 seconds)
22:50:42*zielmicha__ quit (Read error: Connection reset by peer)
22:50:43*jholland__ quit (Read error: Connection reset by peer)
22:50:47*ormiret quit (Read error: Connection reset by peer)
22:50:57*euantorano quit (Ping timeout: 260 seconds)
22:50:57*sirn quit (Ping timeout: 260 seconds)
22:51:32*d10n-work quit (Ping timeout: 260 seconds)
22:51:41*stever joined #nim
22:51:48*nikita` quit (Ping timeout: 260 seconds)
22:51:48*hoek quit (Ping timeout: 260 seconds)
22:52:21*noonien quit (Ping timeout: 272 seconds)
22:52:34*euantorano joined #nim
22:52:49*nikita` joined #nim
22:53:54*alehander92 joined #nim
22:53:59*d10n-work joined #nim
22:54:10*noonien joined #nim
22:54:11*npgm_ joined #nim
22:54:22*sirn joined #nim
22:54:29*waleee-cl joined #nim
22:54:54*surma joined #nim
22:55:10*jholland__ joined #nim
22:55:15*ormiret joined #nim
22:55:42*zielmicha__ joined #nim
22:58:51*hoek joined #nim
23:36:27*snowolf quit (Remote host closed the connection)
23:40:35*snowolf joined #nim
23:47:29*arecacea1 quit (Remote host closed the connection)
23:48:24*arecacea1 joined #nim
23:50:06*krux02 quit (Remote host closed the connection)