00:03:52 | disruptek | tuples? |
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:17 | Prestige | Imports? |
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:16 | disruptek | i 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:15 | disruptek | at least, i /think/ she was my grandmother. |
02:03:32 | disruptek | either way, she had it comin'. |
02:15:21 | FromGitter | <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:38 | disruptek | let'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:20 | leorize[m] | lol |
03:35:39 | leorize[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:17 | sealmove | hey, can someone remind me the compiler switch for disabling caching? |
03:39:59 | FromDiscord | <juan_carlos> `-f` |
03:40:40 | sealmove | ah thanks |
03:41:04 | * | my_dude quit (Ping timeout: 272 seconds) |
03:45:38 | disruptek | she said her spirit animal was a sea otter and then granny asked me what mine was. told her, "house centipede." |
03:46:54 | disruptek | the 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:29 | FromGitter | <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:32 | leorize[m] | ah yea, I think in Windows they use `.lib` for linking with libraries that have no symbols |
04:12:53 | leorize[m] | since you're using dynamic loading you'd need the unstripped one |
04:18:06 | sealmove | wtf I've run into a reeeeeaaally weird situation |
04:20:12 | disruptek | house centipedes aren't weird; they're just misunderstood. |
04:20:21 | sealmove | I 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:22 | sealmove | and live-server *does* detect the change, but firefox's tab is not update properly |
04:21:35 | sealmove | it does a weird blinking but the page stays the same |
04:24:52 | sealmove | it's some sync error because other files are updated at the same time |
04:30:35 | sealmove | wow, live-server was confused particularly when html and css changes at the same time |
04:30:48 | sealmove | and 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:12 | FromDiscord | <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:41 | disruptek | to a particular nonzero value? not yet. |
04:58:22 | FromDiscord | <Zachary Carter> gotcha |
04:58:40 | FromDiscord | <Zachary Carter> thanks |
05:00:25 | disruptek | something 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:13 | FromDiscord | <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:45 | disruptek | don't be rude. |
05:28:07 | sealmove | didn't mean to, I even agree with not having such corner-case features |
05:28:23 | FromDiscord | <Rika> theyre just joking i believe |
05:30:43 | * | oculux joined #nim |
05:31:16 | * | oculuxe quit (Ping timeout: 272 seconds) |
05:34:57 | disruptek | rika: i will find you. |
05:35:46 | disruptek | it's really not a corner-case feature if it uses default(). |
05:53:28 | planetis[m] | there is though: https://github.com/nim-lang/Nim/blob/devel/lib/system/seqs_v2.nim#L87 |
05:53:42 | planetis[m] | but only works with --gc:arc / orc |
05:53:48 | FromDiscord | <Zachary Carter> nice thanks! |
05:54:06 | FromDiscord | <Zachary Carter> how do I enable the package level object experimental feature? |
06:00:40 | FromDiscord | <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:23 | FromDiscord | <haxscramper> @alehander42 maybe just avoid most of the special symbols altogether and use keywords? |
06:10:36 | FromDiscord | <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:42 | FromDiscord | <lqdev> dude what did you just |
06:42:46 | FromDiscord | <lqdev> paste |
06:50:01 | FromDiscord | <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:01 | FromDiscord | <ShalokShalom> They are actually quite similar, when you compare the syntax side by side. |
06:54:31 | FromDiscord | <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:39 | FromDiscord | <gour> @shad0w i've similar question to yours https://github.com/treeform/fidget/issues/91 |
06:54:40 | disbot | ➥ Why not QML? |
06:55:46 | FromDiscord | <ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/758220041555673109/Screenshot_2020-09-23-08-55-26-86.jpg |
06:55:50 | FromDiscord | <gour> @ShalokShalom do you use https://github.com/status-im/nimqml ? |
06:56:06 | FromDiscord | <ShalokShalom> @gour I would, in case Godot would not exist. |
06:56:17 | FromDiscord | <gour> (edit) '<@!255106931570638849>' => '@ShalokShalom' |
06:56:27 | FromDiscord | <ShalokShalom> I still like it, probably one of the most convenient ways to do UI |
06:57:16 | FromDiscord | <ShalokShalom> And more or less save to be developed further, since it is used in order to create an UI for Status. |
06:58:17 | FromDiscord | <gour> @ShalokShalom how in one supposed to define UI for QML, by hand or, community version of DesignerStudio can be used? |
06:58:40 | FromDiscord | <ShalokShalom> Community version of DesignerStudio? |
06:58:48 | FromDiscord | <gour> yes |
06:58:53 | FromDiscord | <ShalokShalom> That one that is free, is only for QtWidgets. |
06:59:09 | FromDiscord | <gour> > @gour I would, in case Godot would not exist.↵@ShalokShalom What is Godot? |
06:59:29 | FromDiscord | <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:29 | FromDiscord | <lqdev> @ShalokShalom you know that Qt can also be considered non-free, right? |
06:59:47 | FromDiscord | <ShalokShalom> Godot is a game engine, that is also capable of designing apps. |
06:59:58 | narimiran | Yardanico: nimpylib seems to be broken |
06:59:59 | FromDiscord | <gour> aha 🆒 |
07:00:02 | FromDiscord | <ShalokShalom> https://medium.com/swlh/what-makes-godot-engine-great-for-advance-gui-applications-b1cfb941df3b |
07:00:09 | FromDiscord | <ShalokShalom> I love it. |
07:00:25 | FromDiscord | <ShalokShalom> It also supports Nim and a half dozen of other languages. |
07:01:11 | FromDiscord | <ShalokShalom> It even ships to Xbox and Web, HTML 5 via WebAssembly and stuff like that. |
07:01:45 | FromDiscord | <ShalokShalom> > @ShalokShalom you know that Qt can also be considered non-free, right?↵@lqdev Yes, it is dual-licensed |
07:01:45 | FromDiscord | <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:12 | FromDiscord | <ShalokShalom> You can use the Figma UI designer for free |
07:02:18 | FromDiscord | <ShalokShalom> But it is closed source. |
07:02:47 | FromDiscord | <Elegant Beef> You can also just declaritvely write nim code for figet |
07:02:49 | FromDiscord | <ShalokShalom> What is a classical desktop app and why do you prefer it? |
07:02:58 | FromDiscord | <Elegant Beef> They're talking about more native apps |
07:03:02 | FromDiscord | <ShalokShalom> @Elegant Beef Yes, we just posted that. |
07:03:09 | FromDiscord | <ShalokShalom> Native? |
07:03:19 | FromDiscord | <Elegant Beef> Native GUi |
07:03:20 | FromDiscord | <ShalokShalom> Its native code. |
07:03:29 | FromDiscord | <ShalokShalom> Ah, ok. Native UI elements. |
07:03:41 | FromDiscord | <ShalokShalom> Native-looking. |
07:03:51 | FromDiscord | <Rika> not native looking, native |
07:03:52 | * | PMunch joined #nim |
07:04:03 | FromDiscord | <Rika> unless they say native looking is fine do not assume what they want |
07:04:58 | FromDiscord | <gour> @ShalokShalom there is, afaict, free community version for https://www.qt.io/blog/qt-design-studio-1.6-released |
07:04:59 | FromDiscord | <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:56 | FromDiscord | <ShalokShalom> Yuhuu 🥳 |
07:05:59 | FromDiscord | <Rika> qt is considered native in linux (i think?) because lol |
07:06:04 | FromDiscord | <ShalokShalom> I have waited so long for this. |
07:06:07 | FromDiscord | <Elegant Beef> Well GTK/QT are "native" |
07:06:10 | leorize | linux doesn't have a native toolkit :P |
07:06:17 | FromDiscord | <Rika> exactly what i mean |
07:06:26 | leorize | but gtk is currently the de facto due to it's large userbase |
07:06:35 | FromDiscord | <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:08 | FromDiscord | <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:58 | FromDiscord | <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:40 | FromDiscord | <gour> @ShalokShalom read that article about Godot. super cool! now, the question is how to use it with NIm? |
07:20:49 | FromDiscord | <gour> (edit) 'NIm?' => 'Nim?' |
07:25:39 | disruptek | if grow() works now it's news to me. i thought it was dead and buried. |
07:26:55 | * | sealmove joined #nim |
07:27:17 | sealmove | wut? "Error: undeclared identifier: 'result'" o.O |
07:29:04 | sealmove | https://play.nim-lang.org/#ix=2ytu |
07:31:03 | FromDiscord | <Clyybber> templates don't have result |
07:31:32 | sealmove | yet documentation shows one: https://nim-lang.org/docs/tut3.html#introduction-generating-code |
07:31:37 | FromDiscord | <Clyybber> and from your code it seems like you want to change that `template` -> `macro` |
07:31:52 | FromDiscord | <Clyybber> Thats a macro |
07:32:21 | sealmove | oh I am tired and blind sorry |
07:32:21 | FromDiscord | <Clyybber> https://play.nim-lang.org/#ix=2ytv works |
07:32:24 | FromDiscord | <Clyybber> :) |
07:33:17 | sealmove | for some reason my mind associated quote do with templates, but I guess they are equally legit in macros |
07:35:47 | alehander92 | ok |
07:37:06 | FromDiscord | <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:04 | disruptek | how many songs do you know about balls? |
08:01:16 | disruptek | i mean, do we really /need/ more pictures of cats on the internet? |
08:01:16 | FromDiscord | <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:09 | disruptek | better late than never. |
08:02:36 | * | Vladar quit (Remote host closed the connection) |
08:09:27 | FromDiscord | <JSGRANT> @disruptek At least one; Big Balls , ACDC. But's a good -- one. |
08:10:36 | disruptek | yeah but can you sing it? |
08:11:54 | disruptek | i'm talkin', like, Jingle Balls. songs you know, through abd through; balls to bone. |
08:13:18 | PMunch | @JSGRANT, good song indeed |
08:15:10 | FromDiscord | <JSGRANT> Jingle Balls, Batman Smalls; Joker Laid An Egg |
08:17:46 | * | bunbunbunbunny quit (Ping timeout: 256 seconds) |
08:19:43 | narimiran | disruptek: 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:33 | alehander92 | disruptek |
08:34:36 | alehander92 | why are you awake now |
08:34:41 | alehander92 | am i in USA |
08:34:50 | alehander92 | what a time to be awake |
08:42:33 | FromDiscord | <shirleyquirk> Tom scott did linguistic research about batman smells: youtu.be/V5u9JSnAAU4 |
08:42:38 | FromDiscord | <JSGRANT> I'm also in US; It's like near 4am |
08:42:50 | FromDiscord | <JSGRANT> (Missouri) |
08:43:50 | FromDiscord | <JSGRANT> neeeeeeed to try to sleep soon though |
08:46:45 | FromDiscord | <shirleyquirk> US/UK split over "robin flew away" vs "laid an egg" |
08:47:57 | PMunch | Haha, that was the first thing I thought of when JSGRANT wrote that |
08:48:28 | * | bunbunbunbunny joined #nim |
08:48:36 | FromDiscord | <gour> > @gour You can use nimqml from nim-status↵@Slyris do you use it and/or how to design UI, by hand? |
08:50:02 | FromDiscord | <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:25 | FromDiscord | <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:26 | FromDiscord | <JSGRANT> Never even heard the expression "robin flew away" before lol |
09:05:20 | * | narimiran quit (Ping timeout: 272 seconds) |
09:05:25 | FromDiscord | <Rika> as said, its a uk thing |
09:05:29 | FromDiscord | <Rika> robins are birds |
09:05:37 | FromDiscord | <JSGRANT> Well I know that bit; lol |
09:05:45 | FromDiscord | <JSGRANT> tweet tweet |
09:05:47 | FromDiscord | <Rika> i know people who dont |
09:06:06 | FromDiscord | <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:12 | FromDiscord | <JSGRANT> https://github.com/StefanSalewski/gintro is also a thing |
09:07:37 | FromDiscord | <JSGRANT> And of course there's a bunch of bindings to C/C++ immediate-mode guis |
09:08:46 | FromDiscord | <JSGRANT> oookay, bedtime for real. o/ |
09:10:22 | * | mmohammadi9812 joined #nim |
09:15:10 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ytY |
09:17:23 | FromDiscord | <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:00 | FromDiscord | <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:33 | FromDiscord | <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:33 | FromDiscord | <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:46 | FromDiscord | <Yardanico> It's nimlsp |
09:25:04 | FromDiscord | <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:45 | PMunch | @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:34 | FromDiscord | <gour> @PMunch i've added snippet mentioned for Emacs & use-package. do i need something else? |
09:29:46 | FromDiscord | <gour> _is a bit noob when it comes to LSP stuff..._ |
09:30:54 | narimiran | Yardanico: did you see my earlier message about nimpylib? |
09:32:20 | FromDiscord | <ShalokShalom> @JSGRANT Do you know GTK+ from the inside? |
09:32:22 | FromDiscord | <ShalokShalom> https://mirror.linux.org.au/pub/linux.conf.au/2014/Thursday/83-Gtk_to_Qt_-_a_strange_journey_-_Dirk_Hohndel.mp4 |
09:32:30 | PMunch | @gour, to be honest I have no idea |
09:32:33 | PMunch | Never used emacs |
09:32:40 | FromDiscord | <ShalokShalom> Can we let it die, please? 🙏 |
09:33:34 | FromDiscord | <gour> @ShalokShalom Emacs? |
09:33:42 | FromDiscord | <ShalokShalom> No |
09:33:42 | FromDiscord | <Yardanico> @narimiran no, what was it? |
09:33:50 | FromDiscord | <ShalokShalom> GTK |
09:33:55 | FromDiscord | <ShalokShalom> See the video. |
09:34:00 | FromDiscord | <gour> ahh, ok 😄 |
09:34:01 | narimiran | Yardanico: it seems to be broken |
09:34:11 | FromDiscord | <Yardanico> Hmm, what exactly? |
09:34:19 | FromDiscord | <ShalokShalom> @gour Did the link help? |
09:34:20 | narimiran | it might be `enumerate` changes |
09:34:42 | PMunch | @gour, did you see the comment I made though? |
09:34:47 | FromDiscord | <Yardanico> Seems like Juan fixed it though, no? |
09:34:51 | FromDiscord | <gour> > @gour Did the link help?↵@ShalokShalom for Godot & Nim? yes!! |
09:35:04 | FromDiscord | <Yardanico> Last commit in nimpylib passed its CI |
09:35:06 | FromDiscord | <ShalokShalom> Glad |
09:35:48 | FromDiscord | <Yardanico> I forgot that nimpylib is in the important packages list lol |
09:36:44 | FromDiscord | <Yardanico> Seems like Juan made a failing commit 7 hours ago, but fixed it 3 hours ago |
09:40:02 | narimiran | oh, i didn't see that one 3 hours ago |
09:40:34 | FromDiscord | <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:15 | PMunch | Ah I see |
09:54:23 | * | mmohammadi9812 quit (Quit: I quit (╯°□°)╯︵ ┻━┻) |
10:00:52 | * | kenran quit (Ping timeout: 260 seconds) |
10:03:18 | FromDiscord | <alehander42> @haxscramper post it to the rfc as well |
10:03:50 | FromDiscord | <alehander42> imho it's good to not overdo symbols |
10:03:55 | FromDiscord | <alehander42> but i like them 😄 |
10:04:10 | FromDiscord | <alehander42> so it's good to have more people's opinions |
10:06:45 | FromDiscord | <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:44 | FromDiscord | <haxscramper> And `<fld>: <prefix> <rhs>` or `<fld> @<var> <infix> <rhs>` for field/kv-pair captures |
10:08:23 | FromDiscord | <haxscramper> Just need to wait until someone will post code that has `@ everyone` |
10:08:53 | FromDiscord | <haxscramper> Maybe post RFC link on forum? |
10:09:15 | FromDiscord | <himu> So, I am building an interpreter in Nim. How do I store an union of types? |
10:09:21 | FromDiscord | <himu> In TypeScript I used |
10:09:58 | FromDiscord | <alehander42> @haxscramper honestly symbols look better to me, but that's why its subjective |
10:10:10 | FromDiscord | <alehander42> i think code blocks shouldnt ping |
10:10:12 | FromDiscord | <alehander42> `@everyone` |
10:10:25 | FromDiscord | <haxscramper> Not everyone uses code blocks |
10:10:33 | FromDiscord | <alehander42> well mate |
10:10:36 | FromDiscord | <alehander42> python has decorators |
10:10:41 | FromDiscord | <alehander42> ruby instance vars |
10:10:55 | FromDiscord | <alehander42> its not really a lang design argument 😄 how it would work in discord |
10:11:05 | FromDiscord | <haxscramper> For some reason I now want to do it myself |
10:11:32 | FromDiscord | <alehander42> @haxscramper it would be best to summarize your plan and maybe keyword vs symbol examples |
10:11:38 | FromDiscord | <alehander42> in the rfc |
10:11:44 | FromDiscord | <alehander42> and post a link for that in the forum |
10:11:59 | FromDiscord | <alehander42> to the comment that has it summarized (your original one or other.!) |
10:12:11 | FromDiscord | <alehander42> @himu variant types |
10:12:21 | FromDiscord | <alehander42> are usually used for "sum"-like types in nim |
10:12:31 | FromDiscord | <haxscramper> Okay, I will post all alternative syntaxes that I have in mind and then link to it. |
10:12:47 | FromDiscord | <alehander42> the compiler itself also uses those iirc |
10:12:56 | FromDiscord | <alehander42> and then we can ping everyone 😄 |
10:13:22 | FromDiscord | <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:01 | FromDiscord | <haxscramper> We want to do much more than just sum types matching, so it will be really complicated in general case |
10:14:27 | FromDiscord | <ShalokShalom> How are other languages are doing it? |
10:15:04 | FromDiscord | <haxscramper> I haven't seen any language that has pattern matching for json/seqs/sets |
10:15:34 | FromDiscord | <haxscramper> Well, maybe for seqs |
10:15:50 | FromDiscord | <alehander42> it's good to research |
10:15:56 | FromDiscord | <alehander42> i wanted to work on a project that comapres |
10:16:07 | FromDiscord | <alehander42> features in different languages for cases like that |
10:16:30 | FromDiscord | <alehander42> so one can more easily go and see in one place different approaches |
10:16:42 | FromDiscord | <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:44 | FromDiscord | <alehander42> in a web app |
10:17:18 | FromDiscord | <ShalokShalom> But you could give me exhaustion by default, most would do no json pattern matching 🙄 |
10:17:21 | FromDiscord | <alehander42> @himu hm, i think they work pretty well in rust too (they have "enums" which do it) |
10:17:28 | FromDiscord | <alehander42> but yeah they are the tool |
10:17:51 | FromDiscord | <alehander42> @ShalokShalom yes, we should do it at least for sum types |
10:17:58 | FromDiscord | <alehander42> btw i was surprised |
10:18:08 | FromDiscord | <alehander42> that haskell by default doesnt warn me about it |
10:18:09 | FromDiscord | <ShalokShalom> Type providers would be cool |
10:18:12 | FromDiscord | <ShalokShalom> https://fsharp.github.io/FSharp.Data/library/JsonProvider.html |
10:18:12 | FromDiscord | <alehander42> but fails with runtime error |
10:18:19 | FromDiscord | <alehander42> maybe its a matter of setting |
10:18:21 | FromDiscord | <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:30 | FromDiscord | <haxscramper> In general I think pattern matching on sequences is a really interesting thing |
10:18:31 | FromDiscord | <alehander42> @himu yeah borrowing might be harder |
10:18:36 | FromDiscord | <haxscramper> Basically this is a parsing |
10:18:42 | FromDiscord | <ShalokShalom> > @ShalokShalom yes, we should do it at least for sum types↵@alehander42 Yes, I would be totally down with this ❣️ |
10:18:50 | FromDiscord | <haxscramper> But this is not what we want to have in patern matching |
10:18:58 | FromDiscord | <alehander42> @ShalokShalom yes! compile time code might help with providers |
10:19:07 | FromDiscord | <alehander42> but i am not entirely sure it would be easy |
10:19:10 | FromDiscord | <ShalokShalom> Ccooool 🥳 |
10:19:17 | FromDiscord | <haxscramper> And `Option[T]` should be a special cased too |
10:19:22 | FromDiscord | <alehander42> i mean i might misunderstand theem |
10:19:24 | FromDiscord | <ShalokShalom> Easy is nothing good |
10:19:31 | FromDiscord | <ShalokShalom> But it could be simple |
10:19:33 | FromDiscord | <alehander42> so i have to play with f# |
10:19:36 | FromDiscord | <alehander42> a bit more |
10:19:40 | FromDiscord | <ShalokShalom> F# is awesome |
10:19:47 | FromDiscord | <ShalokShalom> One of my favorite languages |
10:19:54 | FromDiscord | <ShalokShalom> And type providers exist just there |
10:19:58 | FromDiscord | <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:06 | FromDiscord | <haxscramper> !eval import macros; dumpTree(`F#` is awesome) |
10:20:08 | NimBot | Compile failed: /usercode/in.nim(1, 41) Error: identifier expected, but got '[EOF]' |
10:20:10 | FromDiscord | <alehander42> but they would be probably adapted to the model |
10:20:18 | FromDiscord | <alehander42> so it wouldnt really feel as f# after all |
10:20:23 | FromDiscord | <ShalokShalom> The C# people think they have the best thing since sliced bread, the minimal version of it, called LINQ |
10:20:35 | FromDiscord | <ShalokShalom> They are completely hyped about it 😁 |
10:20:37 | FromDiscord | <alehander42> @haxscramper yeah Options are important |
10:20:42 | FromDiscord | <alehander42> yeah right |
10:20:46 | FromDiscord | <alehander42> it makes sense |
10:20:52 | FromDiscord | <alehander42> well this applies to a lot of stuff |
10:20:59 | Araq | LINQ? that's old stuff, nobody is hyped about it anymore |
10:21:03 | FromDiscord | <alehander42> dependent types and we when we can prove stuff about static ints 😄 |
10:21:16 | FromDiscord | <alehander42> but limitations are part of good design |
10:21:19 | Araq | (not that it is bad, LINQ is good) |
10:21:24 | FromDiscord | <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:25 | FromDiscord | <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:48 | FromDiscord | <ShalokShalom> Its functional features are already nearly on par with functional languages, overall |
10:21:54 | FromDiscord | <ShalokShalom> There is not that much missing. |
10:22:02 | FromDiscord | <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:43 | FromDiscord | <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:11 | FromDiscord | <alehander42> c# did add some form of matching in the latest versions |
10:23:55 | FromDiscord | <alehander42> the other thing is: most non-functional languages seem to start from somewhere not very big in matching |
10:24:09 | FromDiscord | <ShalokShalom> https://docs.microsoft.com/en-us/dotnet/fsharp/tutorials/type-providers/<@608382355454951435> |
10:24:22 | FromDiscord | <ShalokShalom> @haxscramper |
10:24:31 | FromDiscord | <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:32 | FromDiscord | <alehander42> later |
10:24:36 | FromDiscord | <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:11 | FromDiscord | <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:17 | FromDiscord | <alehander42> really, just having a way to write patty's `MyType = variant: A(b: int) B(c: string)` etc |
10:25:32 | FromDiscord | <alehander42> and pattern match on it and sequences / options / nodes / objects |
10:25:38 | FromDiscord | <alehander42> would be a big step |
10:26:05 | FromDiscord | <alehander42> @ShalokShalom yes, but what i mean is to not go overboard |
10:26:37 | FromDiscord | <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:37 | FromDiscord | <ShalokShalom> Yes |
10:26:45 | FromDiscord | <alehander42> very deeply |
10:26:53 | FromDiscord | <ShalokShalom> Sure 🤷♂️ |
10:26:58 | FromDiscord | <ShalokShalom> That is always good |
10:27:01 | FromDiscord | <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:05 | FromDiscord | <ShalokShalom> Saves much time later on. |
10:27:17 | FromDiscord | <ShalokShalom> @haxscramper Yes, that is totally awesome |
10:27:24 | FromDiscord | <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:34 | Oddmonger | lqdev : 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:03 | FromDiscord | <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:23 | FromDiscord | <lqdev> Oddmonger: cool!] |
11:45:17 | PMunch | @hax, I'd say definitely go for names instead of symbels |
11:45:22 | PMunch | symbols* |
11:45:48 | FromDiscord | <Rika> im for names instead of symbols too |
11:45:51 | FromDiscord | <haxscramper> WIll look similar to SQL |
11:46:01 | FromDiscord | <haxscramper> and LINQ |
11:46:02 | FromDiscord | <Rika> better than looking like APL |
11:50:31 | PMunch | And it will be much more readable to people who aren't familiar with the library |
11:50:47 | PMunch | And Nim tends to use names over symbols anyways |
11:53:10 | FromDiscord | <haxscramper> Would be even better if `[while @var in {1,2,3}]` was supported |
11:53:25 | FromDiscord | <haxscramper> Basically reverse list comprehension |
11:54:13 | FromDiscord | <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:54 | FromDiscord | <alehander42> PMunch this gets a bit over-verbose to imho |
12:00:16 | FromDiscord | <alehander42> i totally agree that too many symbols can be strange |
12:00:31 | FromDiscord | <alehander42> but there is a balance to have 1-2 symbol for very common stuff |
12:00:36 | FromDiscord | <alehander42> and names for the others |
12:01:01 | FromDiscord | <alehander42> e.g. `*` is ok for me, because regex uses it |
12:01:07 | FromDiscord | <alehander42> but i can see how people might disagree |
12:02:54 | PMunch | True, but most people struggle with reading regex as well.. |
12:03:52 | FromDiscord | <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:50 | FromDiscord | <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:40 | FromDiscord | <alehander42> yeah but i mean something else |
12:07:50 | FromDiscord | <alehander42> that `*` is known |
12:07:58 | FromDiscord | <alehander42> i dont want it to look all like regex |
12:08:13 | FromDiscord | <alehander42> but a symbol that is known, is easier to be accepted than a custom |
12:09:24 | Araq | Vindaar: it's called "declarative programming", looks good on the screen, impossible to debug :P |
12:09:51 | Araq | see also: makefiles, SQL... |
12:10:48 | FromDiscord | <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:07 | FromDiscord | <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:37 | FromDiscord | <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:53 | FromDiscord | <ShalokShalom> All functional programming is declarative. |
13:00:36 | FromDiscord | <ShalokShalom> Makefiles, SQL and stuff like this is just the worst of the worst, that you can do with declarative coding. |
13:00:48 | FromDiscord | <ShalokShalom> Oh, and COBOL. |
13:17:43 | Oddmonger | Makefiles are like a game with a delicate state machine with obscure state names |
13:18:03 | Oddmonger | but they are still far better than cmake |
13:24:13 | Oddmonger | for testing a define for conditional compilation, it's when var: … ? |
13:24:50 | Oddmonger | because everything after the when will be «conditionnaly compiled» |
13:25:13 | Oddmonger | says, i have: when debug: , for a portion of code i want only for debugging |
13:25:32 | Oddmonger | but after this portion, i have code i want in release _and_ debug |
13:26:00 | Oddmonger | so should i put: when release: and immediatly after else: ? |
13:26:32 | Oddmonger | no, that won't work |
13:27:19 | Oddmonger | the 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:27 | FromDiscord | <haxscramper> You can put more complex expressions in `when` + you can use `when`, `elif`, `else` for multiple tests |
13:33:18 | FromDiscord | <haxscramper> also `when defined(yourDebug)`, not just `when yourDebug` |
13:33:30 | Oddmonger | ah |
13:34:14 | Oddmonger | but when defined(debug): followed by an «else:» would produce code (after the «else:») which will be only in release |
13:34:25 | Oddmonger | not in both debug and release |
13:37:04 | FromDiscord | <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:54 | Oddmonger | in a game, i want to activate/desactivate the profiler,but only in debug mode |
13:40:34 | Oddmonger | hhuu … when defined(…) kills result |
13:40:47 | Oddmonger | i mean, i have error «result is not defined» |
13:42:54 | FromDiscord | <haxscramper> if you are talking about nim profiler: `when defined(nimprof): import nimprof` |
13:42:55 | Oddmonger | ok found it… but not very clean |
13:44:43 | Oddmonger | like this: http://ix.io/2yvn |
13:45:01 | Oddmonger | (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:22 | FromDiscord | <shirleyquirk> Code that runs in both debug and release is the default. What am I missing |
14:06:00 | FromDiscord | <Rika> yeah, just dont put in a when else |
14:06:02 | FromDiscord | <Rika> idgi either |
14:06:15 | * | mmohammadi9812 quit (Ping timeout: 258 seconds) |
14:07:19 | * | mmohammadi9812 joined #nim |
14:10:25 | FromDiscord | <shirleyquirk> defined(debug) is always false, debug is the default. |
14:10:48 | Araq | when defined(release) |
14:10:55 | Araq | or 'when not defined(release)' |
14:11:33 | FromDiscord | <shirleyquirk> not defined(release) is also true with d: danger |
14:11:48 | FromDiscord | <Rika> its not |
14:11:56 | FromDiscord | <Rika> danger defines release |
14:12:59 | FromDiscord | <shirleyquirk> https://repl.it/repls/PlumpIncompleteFormat<#371759389889003532>.nim |
14:14:26 | FromDiscord | <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:48 | FromDiscord | <slonik_az> (edit) removed '> @haxscramper,' |
14:15:04 | FromDiscord | <slonik_az> (edit) 'I'd' => '"I'd' | 'symbels↵@PMunch[IRC]:' => 'symbels"↵@PMunch[IRC]:' |
14:15:26 | FromDiscord | <Rika> one is something like `test` another is `%*` |
14:15:44 | Oddmonger | the 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:10 | FromDiscord | <slonik_az> Is symbol a superset of name then? |
14:17:45 | FromDiscord | <Rika> no, its informal terminology |
14:17:56 | FromDiscord | <Rika> symbols are just non-alphanumerics |
14:18:52 | FromDiscord | <shirleyquirk> Ugh. Works on commandline, not in nim.cfh |
14:19:36 | FromDiscord | <Rika> documented bug |
14:19:50 | FromDiscord | <shirleyquirk> TIL |
14:21:39 | Araq | Rika: it's a pita but not really a bug :P |
14:21:52 | Araq | but we need to change it anyhow |
14:22:07 | Araq | reminds me... I wanted to rewrite Nimscript suppport |
14:22:18 | FromDiscord | <Rika> its kinda a bug aint it? it should work the same in either ways |
14:24:16 | FromDiscord | <alehander42> operators |
14:24:21 | FromDiscord | <alehander42> would be more exact probably |
14:24:36 | FromDiscord | <Rika> not really, `mod` is an operator but not a symbol |
14:24:47 | FromDiscord | <alehander42> yeah .. well symbol doesnt sound good |
14:24:55 | FromDiscord | <alehander42> because we have nnkSym |
14:27:55 | FromDiscord | <Yardanico> It's not a bug that release or danger don't work in config files |
14:28:15 | FromDiscord | <Yardanico> It's due to how they are defined and evaluation order for configa |
14:28:22 | FromDiscord | <Yardanico> And there's an open issue about that already |
14:28:34 | FromGitter | <gogolxdong> Which type should be used for importc c struct, object or ref object |
14:28:56 | FromDiscord | <Yardanico> always object |
14:29:09 | FromDiscord | <Yardanico> probably you'll also need bycopy |
14:29:17 | FromDiscord | <Yardanico> Use c2nim |
14:29:24 | FromGitter | <gogolxdong> what's the matter with ref object |
14:30:38 | FromDiscord | <Yardanico> ref objects are managed references to objects |
14:30:55 | FromDiscord | <Yardanico> C doesn't have Nim references, believe it or not |
14:31:15 | FromDiscord | <Yardanico> But you can always wrap your C-imported object in a ref object |
14:34:40 | FromGitter | <gogolxdong> what's the difference between bycopy and pure, final |
14:38:31 | FromGitter | <gogolxdong> stdlib uses bycopy rarely. |
14:44:07 | FromDiscord | <Clyybber> Araq: Ping |
14:44:21 | FromDiscord | <Clyybber> gogolxdong: Not related |
14:44:32 | FromDiscord | <Clyybber> pure is for enums |
14:44:35 | FromDiscord | <Clyybber> final is for inheritance |
14:44:50 | FromDiscord | <Clyybber> and bycopy is for argument passing |
14:45:43 | FromGitter | <gogolxdong> what if C-imported object without bycopy ,what will happen when passing argument. |
14:50:56 | FromGitter | <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:14 | FromGitter | <gogolxdong> stdlib uses pure more. |
14:51:55 | FromDiscord | <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:46 | FromGitter | <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:29 | FromGitter | <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:04 | Araq | golden principle is to understand why next*: AVPacketList would take up an infinite amount of memory and next*: ref AVPacketList doesn't |
15:14:01 | Araq | clyybber: 'pure' only means something when combined with .inheritable |
15:15:29 | FromGitter | <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:44 | Araq | you don't have to "find out", you have to understand |
15:22:06 | Araq | don't hack around until stuff compiles, understand why the one thing works and the other is illogical |
15:25:36 | FromGitter | <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:46 | FromGitter | <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:36 | sealmove | nimscript 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:00 | FromDiscord | <juan_carlos> NimScript <3 |
15:59:58 | * | mmohammadi9812 quit (Ping timeout: 260 seconds) |
16:00:37 | Prestige | What editor/plugins do ppl use for nimscript? |
16:00:38 | * | abm quit (Read error: Connection reset by peer) |
16:04:54 | FromDiscord | <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:19 | Prestige | I thought I'd tried it before and ran into issues, because nims doesn't support everything that nim does |
16:25:41 | FromDiscord | <juan_carlos> Some people say only 25% of nim works on nimscript and is not true. :| |
16:25:54 | FromDiscord | <juan_carlos> ... is actually 26% :P |
16:29:21 | FromDiscord | <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:09 | Prestige | The editor is aware of the context |
16:33:19 | Prestige | Well, mine isn't |
16:33:27 | * | arecacea1 joined #nim |
16:33:37 | Prestige | It thinks I'm writing nim, not nimscript |
16:33:58 | FromDiscord | <Vindaar> oh you were talking about fancy editor features |
16:34:55 | Prestige | Right, yeah |
16:35:08 | Prestige | I'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:09 | FromDiscord | <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:55 | FromDiscord | <Vindaar> use a macro with `getType` and friends? |
17:17:06 | FromDiscord | <19> hello, can someone critique my code: https://play.nim-lang.org/#ix=2ywE↵thanks |
17:18:21 | FromDiscord | <Rika> the variables are unnecessarily var |
17:18:59 | FromDiscord | <19> ok, but is this how you are supposed to access and move around memory? |
17:19:19 | FromDiscord | <Rika> why cant you just use a sequence? or an array? |
17:19:48 | FromDiscord | <Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=2ywF |
17:20:02 | FromDiscord | <Vindaar> oops |
17:20:17 | FromDiscord | <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:18 | FromDiscord | <Vindaar> ah, nvm |
17:20:52 | FromDiscord | <Vindaar> (edit) 'https://play.nim-lang.org/#ix=2ywF' => 'https://play.nim-lang.org/#ix=2ywG' |
17:20:53 | FromDiscord | <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:05 | FromDiscord | <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:08 | FromDiscord | <Rika> you can also use UncheckedArray and itll look more nim like afaik |
17:21:16 | FromDiscord | <Vindaar> @haxscramper cool! |
17:22:54 | FromDiscord | <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:42 | FromDiscord | <19> im not used to GC stuff |
17:30:22 | * | kenran joined #nim |
17:35:24 | * | kenran quit (Ping timeout: 260 seconds) |
17:36:45 | Oddmonger | is it possible to inline functions with Nim ? I tried with templates, but… |
17:36:54 | FromDiscord | <lqdev> yes |
17:36:55 | Oddmonger | is it the way to go ? |
17:36:58 | FromDiscord | <lqdev> use the {.inline.} pragma |
17:37:05 | Oddmonger | ahh |
17:37:20 | Oddmonger | so i define proc with {.inline.} and that's all ? |
17:37:23 | FromDiscord | <lqdev> yes |
17:37:29 | Oddmonger | ok, thank you |
17:37:40 | FromDiscord | <lqdev> or if you have a set of procs that you want to inline, you can put them between {.push inline.} {.pop.} |
17:39:13 | krux02 | Oddmonger, {.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:32 | Oddmonger | ah ok |
17:39:45 | FromDiscord | <lqdev> true that |
17:40:11 | Oddmonger | i tried to do it with template, but {.inline.} is definitively the way to go, when the template has conditions |
17:40:43 | FromDiscord | <lqdev> but in most cases the C compiler _does_ oblige and inline your proc |
17:51:47 | Oddmonger | i thought by default, for :bool proc , result was set to true |
17:57:30 | FromDiscord | <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:08 | FromDiscord | <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:21 | Araq | just don't follow C programming tutorials. What's next, following Forth programming tutorials? |
18:02:48 | FromDiscord | <Recruit_main707> and yeah, youd rather do it the nim way out of the box |
18:09:47 | FromDiscord | <lqdev> Oddmonger: that's not the case :) |
18:09:57 | FromDiscord | <lqdev> `result` is always initialized to binary zero |
18:10:08 | FromDiscord | <lqdev> cast[bool](0) == false |
18:11:06 | Oddmonger | /o\ |
18:11:32 | Oddmonger | thanks for the explaination, i was sure i had read that boolean was set to true |
18:15:39 | FromDiscord | <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:32 | FromDiscord | <Recruit_main707> regions is the forgotten gc |
18:28:35 | FromDiscord | <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:38 | FromDiscord | <lqdev> """""""gc""""""" |
18:28:40 | FromDiscord | <lqdev> it's not a gc |
18:29:10 | FromDiscord | <Recruit_main707> well, when i say gc i just mean its an option of the `gc` parameter |
18:29:11 | FromDiscord | <lqdev> and i don't think it's really forgotten, just undocumented |
18:29:19 | FromDiscord | <lqdev> also superseded by ARC |
18:29:39 | FromDiscord | <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:55 | FromDiscord | <19> i just need to get used to arc/orc.↵thanks for the tips |
18:55:46 | * | my_dude quit (Quit: ZZZzzz…) |
19:01:00 | FromDiscord | <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:07 | FromDiscord | <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:34 | FromDiscord | <alehander42> @haxscramper oi |
19:03:47 | FromDiscord | <alehander42> so one thing from a first glance (maybe i was too lazy to read) |
19:03:49 | FromDiscord | <alehander42> isnot : why ? |
19:03:56 | FromDiscord | <alehander42> cant we just leave it for `else` |
19:04:04 | FromDiscord | <alehander42> and let normal nim code handle a custom error |
19:04:08 | FromDiscord | <haxscramper> This is invalid syntax |
19:04:16 | FromDiscord | <alehander42> else is not invalid |
19:04:26 | FromDiscord | <alehander42> of stuff: else: other |
19:04:27 | FromDiscord | <haxscramper> !eval opt @value else "defauilt" |
19:04:28 | NimBot | Compile failed: /usercode/in.nim(1, 12) Error: invalid indentation |
19:04:32 | FromDiscord | <alehander42> no |
19:04:37 | FromDiscord | <alehander42> i mean that if a match fail |
19:04:39 | FromDiscord | <alehander42> this is ok |
19:04:44 | FromDiscord | <alehander42> it's like `if` fail |
19:04:49 | FromDiscord | <alehander42> if thats a problem |
19:04:51 | FromDiscord | <alehander42> just use else |
19:05:10 | FromDiscord | <haxscramper> I dont' understand. There is an `else` for the whole `case` already |
19:05:13 | FromDiscord | <alehander42> yes |
19:05:20 | FromDiscord | <alehander42> but this error won't be printed out |
19:05:25 | FromDiscord | <alehander42> if another match matches |
19:05:29 | FromDiscord | <alehander42> so it makes sense only |
19:05:32 | FromDiscord | <alehander42> if no match matches |
19:05:37 | FromDiscord | <alehander42> : else |
19:06:03 | FromDiscord | <haxscramper> You suggest to have `of <pattern> else: <default>`? |
19:06:04 | * | Q-Master quit (Ping timeout: 244 seconds) |
19:06:08 | FromDiscord | <alehander42> no |
19:06:18 | FromDiscord | <alehander42> hm, i find the whole raise thing a bit strange |
19:06:23 | FromDiscord | <alehander42> because it doesnt make sense |
19:06:28 | FromDiscord | <alehander42> in a control flow construct |
19:06:44 | FromDiscord | <alehander42> if an arm doesnt match: this is not an error |
19:06:54 | FromDiscord | <alehander42> that's the point of switches/cases |
19:07:07 | FromDiscord | <alehander42> if you want: you can make it an error in the default case obviously |
19:07:29 | * | Q-Master joined #nim |
19:07:29 | FromDiscord | <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:34 | FromDiscord | <alehander42> or if there is not else: then it seems logical to have an auto-raise |
19:07:43 | FromDiscord | <alehander42> yes, but i am talking about `isnot` |
19:07:48 | * | a_chou quit (Quit: a_chou) |
19:09:11 | FromDiscord | <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:28 | FromDiscord | <alehander42> but mate |
19:09:34 | FromDiscord | <haxscramper> Well, not **is**, but *might be* |
19:09:34 | FromDiscord | <alehander42> the user specifies the error |
19:09:37 | FromDiscord | <alehander42> using nim |
19:09:39 | FromDiscord | <alehander42> that's the point |
19:09:42 | FromDiscord | <alehander42> when you have `if` |
19:09:46 | FromDiscord | <alehander42> it being false |
19:10:03 | FromDiscord | <alehander42> isn't a raise: you write the error logic inside the else |
19:10:19 | FromDiscord | <alehander42> the point is to direct the logic somewhere |
19:10:36 | FromDiscord | <haxscramper> What? `isnot` is useful if you want to create error diagnostics precisely where expectation failed |
19:11:08 | FromDiscord | <haxscramper> I don't see a lot of people writing adequate error messages tbh |
19:11:15 | FromDiscord | <haxscramper> So this is a niche feature |
19:11:32 | FromDiscord | <haxscramper> Because nobody writes good error messages anyway |
19:11:40 | FromDiscord | <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:54 | FromDiscord | <alehander42> and there is no reason to not just use code e.g. |
19:12:17 | FromDiscord | <haxscramper> I don't understand again. If you want you can just raise anywhere else |
19:12:31 | FromDiscord | <alehander42> yes, and you dont need a special dsl inside match |
19:12:33 | FromDiscord | <alehander42> for that |
19:12:35 | FromDiscord | <haxscramper> `isnot` is *specifically* made that you can raise inside of failed match arm |
19:12:46 | FromDiscord | <alehander42> but this is super bizarre |
19:12:55 | FromDiscord | <alehander42> its like if stuff isnot error |
19:13:08 | FromDiscord | <alehander42> ok, think about it |
19:13:17 | FromDiscord | <alehander42> what happens if there are next `of` branches? |
19:13:26 | FromDiscord | <alehander42> aren't they tried |
19:13:26 | FromDiscord | <haxscramper> Well, I can't use `else` as infix, so I'm playing with what I got basically in terms of keywords |
19:13:37 | FromDiscord | <alehander42> wrong level |
19:13:42 | FromDiscord | <alehander42> think about the next `of` |
19:13:54 | FromDiscord | <alehander42> what happens to the next `of` |
19:13:59 | * | kenran joined #nim |
19:14:12 | FromDiscord | <alehander42> `if`, `case` work on the base |
19:14:24 | FromDiscord | <alehander42> that whenever an arm is false, you continue with the next |
19:14:29 | FromDiscord | <alehander42> there is no "fail" concept |
19:14:32 | FromDiscord | <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:37 | FromDiscord | <haxscramper> 't even start |
19:14:54 | FromDiscord | <haxscramper> For processing partially correct input |
19:15:02 | FromDiscord | <alehander42> but it always either even matches fully or not |
19:15:09 | FromDiscord | <alehander42> arms are boolean |
19:15:10 | FromDiscord | <haxscramper> No |
19:15:16 | FromDiscord | <haxscramper> Well, not exactly |
19:15:25 | FromDiscord | <alehander42> this is surprising |
19:15:27 | FromDiscord | <alehander42> ok |
19:15:37 | FromDiscord | <haxscramper> I want to handle situation where it *should* match fully |
19:15:48 | FromDiscord | <haxscramper> But doesn't because it is a malformed |
19:15:52 | FromDiscord | <alehander42> but it always should match fully |
19:15:57 | FromDiscord | <alehander42> thats the idea of a pattern |
19:16:12 | FromDiscord | <haxscramper> Like technically this is a failure, but I don't care about trying anything else |
19:16:16 | FromDiscord | <alehander42> if you have some freedom: the patterns provides wildcards |
19:16:21 | FromDiscord | <haxscramper> So other match arms are basically useless |
19:17:15 | FromDiscord | <alehander42> this would be strange, i see what you mean |
19:17:19 | FromDiscord | <alehander42> but this is not how case works |
19:17:19 | FromDiscord | <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:22 | FromDiscord | <Clyybber> and you get a fail only on a "partial" match? |
19:17:32 | FromDiscord | <Clyybber> and not an a complete non-match |
19:17:37 | FromDiscord | <alehander42> the point of reusing case is to behave |
19:17:39 | FromDiscord | <alehander42> similarly |
19:17:46 | FromDiscord | <Clyybber> thats weird, because its not clear what a partial match is IMO |
19:17:49 | FromDiscord | <alehander42> otherwise i dont think we should use th same keyword |
19:17:56 | FromDiscord | <haxscramper> I don't **get** fail. I can, _in theory_, If i really want, provide more extensive diagnositcs |
19:18:06 | FromDiscord | <haxscramper> By utiliziing `isnot` |
19:18:16 | FromDiscord | <alehander42> yes; but then the error would actually be raised |
19:18:17 | FromDiscord | <haxscramper> Otherwise failed match is failed |
19:18:21 | FromDiscord | <Clyybber> it seems a bit like {.explain.} |
19:18:23 | FromDiscord | <alehander42> if there is no `else` |
19:18:30 | FromDiscord | <alehander42> or yeah if you explicitly |
19:18:43 | FromDiscord | <alehander42> want it e.g. `{.caseError.}` |
19:19:00 | FromDiscord | <alehander42> so this is good |
19:19:17 | FromDiscord | <alehander42> if e.g. you have of A isnot C .. of B .. end |
19:19:28 | * | kenran quit (Ping timeout: 260 seconds) |
19:19:31 | FromDiscord | <alehander42> and if it doesnt match: in the end it raises an error including your C |
19:19:35 | FromDiscord | <alehander42> with smarter diagnosis |
19:19:48 | * | gour_ quit (Remote host closed the connection) |
19:20:14 | FromDiscord | <alehander42> but otherwise it's just too custom imo: after all this is a lang construct |
19:20:14 | * | kenran joined #nim |
19:20:18 | FromDiscord | <alehander42> a *basic* primitive |
19:20:29 | FromDiscord | <haxscramper> Like "none of the arms matched, here is a first exception" kind of thing? |
19:20:35 | FromDiscord | <alehander42> which should behave generally as case does |
19:20:42 | FromDiscord | <alehander42> yeah : imo of course |
19:21:12 | FromDiscord | <haxscramper> Okay, yes, maybe `isnot` is not necessary |
19:21:17 | FromDiscord | <alehander42> i mean it can be |
19:21:20 | FromDiscord | <haxscramper> no no |
19:21:23 | FromDiscord | <haxscramper> you got the point |
19:21:25 | FromDiscord | <haxscramper> actually |
19:21:25 | FromDiscord | <alehander42> to add a special message to the error |
19:21:33 | FromDiscord | <alehander42> but not to immediately raise |
19:21:59 | FromDiscord | <haxscramper> I actually think I'm doing .. |
19:22:56 | FromDiscord | <haxscramper> > Use if inside of match arm↵@haxscramper |
19:23:01 | FromDiscord | <alehander42> and overally i think most of the matches can be made in a way to not raise , but just not match |
19:23:03 | FromDiscord | <haxscramper> Yes, |
19:23:12 | FromDiscord | <alehander42> but i agree that i am not sure what happens about |
19:23:18 | FromDiscord | <alehander42> e.g. seq match for a string |
19:23:22 | FromDiscord | <alehander42> maybe just a compile error |
19:23:35 | FromDiscord | <alehander42> compile errors are good |
19:23:36 | FromDiscord | <haxscramper> There is no `seq` actually |
19:23:45 | FromDiscord | <alehander42> yeah sorry |
19:23:48 | FromDiscord | <alehander42> collection |
19:23:49 | FromDiscord | <haxscramper> I mean `[ ]` does not impy `openarray` |
19:24:00 | FromDiscord | <haxscramper> It implies `[idx]: T` and `len(): int` |
19:25:26 | FromDiscord | <haxscramper> So I will remove `isnot` , it really is an overkill. And quite strange even just from syntax perspective |
19:25:33 | FromDiscord | <haxscramper> Kind of feels out of place |
19:26:19 | FromDiscord | <alehander42> i mean |
19:26:27 | FromDiscord | <alehander42> its a good idea for a validation lib |
19:26:34 | FromDiscord | <alehander42> but i feel its a bit too much for now |
19:27:39 | FromDiscord | <haxscramper> yes |
19:28:40 | FromDiscord | <haxscramper> updated & removed isnot |
19:31:48 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yxv |
19:31:51 | FromDiscord | <alehander42> i really like |
19:31:56 | FromDiscord | <alehander42> the rfc style tho |
19:32:04 | FromDiscord | <alehander42> well documented |
19:32:19 | FromDiscord | <alehander42> ah yeah something like this |
19:32:32 | FromDiscord | <haxscramper> I actually have this in rfc |
19:32:39 | FromDiscord | <alehander42> well for this kind of stuff you *can* probably produce a custom autogenerated error |
19:32:58 | FromDiscord | <alehander42> something like "element 1 didn't match : got 2 expected 4..5" |
19:33:03 | FromDiscord | <haxscramper> Maybe create some kind of `MatchDiagnostics` object which has all information about matches so that I can get info from it |
19:33:15 | FromDiscord | <haxscramper> Althoug this will create overhead |
19:33:18 | FromDiscord | <alehander42> in a `tryMatch` |
19:33:39 | FromDiscord | <alehander42> or `matchOrRaise` not sure of convention |
19:33:40 | FromDiscord | <haxscramper> Oh, yes |
19:33:46 | FromDiscord | <haxscramper> yes, exactly |
19:33:47 | FromDiscord | <alehander42> you can have it only for a special call |
19:33:48 | FromDiscord | <haxscramper> Perfect |
19:33:57 | FromDiscord | <alehander42> you can also just have a |
19:34:00 | FromDiscord | <alehander42> what i had in mind was |
19:35:11 | FromDiscord | <haxscramper> `tryMatch` should not open new scope thoug |
19:35:28 | FromDiscord | <alehander42> if you capture |
19:35:34 | FromDiscord | <alehander42> you can return an Option |
19:35:37 | FromDiscord | <alehander42> with a tuple |
19:35:40 | FromDiscord | <alehander42> this was another idea |
19:35:45 | FromDiscord | <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:05 | FromDiscord | <alehander42> so let a = matchCapture([@a], @[2]) |
19:36:10 | FromDiscord | <alehander42> returns some (a: 2) |
19:36:16 | FromDiscord | <alehander42> but this might be a bit too much for now |
19:36:31 | FromDiscord | <alehander42> hm, i see |
19:36:36 | FromDiscord | <alehander42> this might be also possible |
19:36:59 | FromDiscord | <alehander42> so it just introduces directly new variable |
19:37:09 | FromDiscord | <alehander42> i like it |
19:37:17 | FromDiscord | <haxscramper> Just put single arm and do `let matched = <arm>` and `if not matched: suicide()` |
19:37:21 | FromDiscord | <alehander42> but i am not sure it would be accepted |
19:37:43 | FromDiscord | <haxscramper> `let result = <arm>` is a good, but you have to repeat all variables twice |
19:38:21 | FromDiscord | <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:26 | FromDiscord | <haxscramper> 80char |
19:38:27 | * | Vladar quit (Quit: Leaving) |
19:38:56 | FromDiscord | <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:09 | FromDiscord | <haxscramper> Call it `assertMatch` instead of `tryMatch`, because it will raise on bad input |
19:41:59 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yxA |
19:42:24 | FromDiscord | <haxscramper> And it solves issue with unwanted overhead for diagnositcs as it will only be generated if `makeDiagnostics = true` |
19:44:23 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yxB |
19:45:07 | * | narimiran quit (Ping timeout: 258 seconds) |
19:45:33 | FromDiscord | <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:01 | FromDiscord | <Clyybber> Araq: Can we merge https://github.com/nim-lang/Nim/pull/15390 ? |
20:09:01 | disbot | ➥ Fix #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 | _M | I'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 | _M | e 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:36 | FromDiscord | <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:57 | FromDiscord | <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:11 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yxX |
20:55:12 | FromDiscord | <haxscramper> You basically want to wrap all procs in some kind of generic interface, probably by automatically type checking parameters at runtime |
20:55:28 | FromDiscord | <haxscramper> Mapping `/foo/bar<int>` to things is easy |
20:56:32 | * | l1x joined #nim |
20:58:08 | _M | That 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:11 | FromDiscord | <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:37 | FromDiscord | <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:44 | FromDiscord | <Vindaar> There's some kind of RTTI now again, which is used for `marshal` for ARC/ORC |
21:02:26 | FromDiscord | <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:15 | FromGitter | <Lecale> What have I done wrong now https://play.nim-lang.org/#ix=2yxZ |
21:06:09 | FromDiscord | <InventorMatt> you don't need the return statement |
21:06:20 | FromDiscord | <haxscramper> `insert` modifes string inplace |
21:06:48 | FromGitter | <Lecale> ah that would be right |
21:10:28 | FromDiscord | <dk> which exception type fits "item not found" best? |
21:11:41 | FromDiscord | <dk> I guess it's just an AssertionError then =) |
21:11:51 | FromDiscord | <haxscramper> `KeyError` or `IndexError` |
21:12:05 | FromDiscord | <dk> it's neither really |
21:12:16 | FromDiscord | <dk> because it's a find proc |
21:12:49 | FromDiscord | <j$> is there a way to get the directory of the nim config file, in the config file? |
21:14:08 | FromDiscord | <Vindaar> @j$ in a `config.nims` file? |
21:14:13 | FromDiscord | <j$> yeah |
21:15:19 | FromDiscord | <j$> getCurrentDir() |
21:15:25 | FromDiscord | <Vindaar> yes |
21:15:35 | FromDiscord | <Vindaar> because config.nims is just NimScript |
21:15:41 | FromDiscord | <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:26 | FromDiscord | <XxDiCaprioxX> Is there a dedicated module for matrixes? |
22:06:39 | * | r4vi joined #nim |
22:06:59 | FromDiscord | <Vindaar> you mean matrices in terms of linear algebra? |
22:07:37 | * | filcuc joined #nim |
22:09:41 | FromDiscord | <XxDiCaprioxX> Ah matrices is how you write the plural in english |
22:10:01 | FromDiscord | <XxDiCaprioxX> Yes I do but I dont need to use linear algebra, I want to utilize it for chess |
22:10:04 | FromDiscord | <Vindaar> yes, but that wasn't why I asked, haha |
22:10:18 | FromDiscord | <XxDiCaprioxX> Ik xD |
22:10:53 | FromDiscord | <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:58 | FromDiscord | <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) |