00:00:52 | * | konkrrrrrr quit (Ping timeout: 246 seconds) |
00:08:45 | * | a_chou joined #nim |
00:11:26 | FromDiscord | <Elegant Beef> is it normal for your nas to use a GUI? |
00:12:40 | FromDiscord | <exelotl> So hyped for Nim 1.4 |
00:22:32 | * | arecacea1 quit (Remote host closed the connection) |
00:24:22 | * | arecacea1 joined #nim |
00:28:59 | * | a_chou quit (Ping timeout: 240 seconds) |
00:30:23 | * | a_chou joined #nim |
00:33:38 | disruptek | oh yeah? |
00:35:20 | FromDiscord | <hobbledehoy> What's new in 1.4? I have heard stuff about orc but that's it |
00:35:39 | FromDiscord | <hobbledehoy> (edit) 'orc but that's it' => 'orc, what else is new?' |
00:36:55 | * | krux02 quit (Remote host closed the connection) |
00:50:17 | * | aenesidemus joined #nim |
00:54:18 | * | gmaggior quit (Ping timeout: 272 seconds) |
01:05:42 | * | lritter quit (Ping timeout: 272 seconds) |
01:07:26 | * | gmaggior joined #nim |
01:11:23 | disruptek | nothing leaps out at me, and orc isn't the default gc, so... we probably should adopt a changelog action into our release process. |
01:11:45 | FromDiscord | <ThothLoki> anyone make some guis here? |
01:11:53 | FromDiscord | <ThothLoki> i am referencing nigui |
01:14:01 | FromDiscord | <ThothLoki> i have a for loop that is making a list of elements. it is taking a list of tuples and building a [label] [textbox] [button] [button]↵↵my main problem is that all of the labels and buttons are named the same, so a proc doesnt work well because the buttons do not know which textbox to edit |
01:14:52 | disruptek | sounds like a fun ux. |
01:14:57 | FromDiscord | <Rika> usually there are internal IDs to elements like these since theyre usually named the same |
01:15:37 | FromDiscord | <Rika> also disruptek: what makes you think i know how to tinker with CPS xd i might try |
01:16:46 | FromDiscord | <ThothLoki> and that is what i am trying to find, the internal IDs |
01:16:49 | * | Zectbumo quit (Remote host closed the connection) |
01:18:16 | FromDiscord | <Rika> from the gui libraries ive used, you can manually set the IDs |
01:18:21 | FromDiscord | <Rika> but i dont know if nigui does that |
01:19:20 | FromDiscord | <ThothLoki> are you tlaking about something like `var tb = newTextBox()` where the tb is the ID? |
01:20:40 | FromDiscord | <Rika> something more of xxx.setID(num) |
01:21:08 | FromDiscord | <acek7> wassup |
01:21:55 | FromDiscord | <ThothLoki> nothing that i can see in nigui |
01:24:20 | * | Tanger joined #nim |
01:29:42 | FromDiscord | <ThothLoki> @Rika what gui lib do you use? |
01:29:57 | * | apahl quit (Ping timeout: 260 seconds) |
01:30:31 | FromDiscord | <Rika> i was using imgui a while back |
01:31:46 | * | apahl joined #nim |
01:31:57 | FromDiscord | <ThothLoki> i notice their github has no examples |
01:32:05 | FromDiscord | <ThothLoki> is there a place i can fine the syntax? |
01:36:06 | disruptek | rika: just make something silly with it and you'll understand how it differs from the native closure iterators. |
01:36:47 | FromDiscord | <Rika> okay, ill look into it |
01:37:02 | FromDiscord | <Rika> @ThothLoki what do you mean? |
01:37:08 | FromDiscord | <Rika> which github? |
01:37:31 | FromDiscord | <ThothLoki> https://github.com/nimgl/imgui |
01:37:39 | FromDiscord | <ThothLoki> so you have any place better? |
01:37:57 | FromDiscord | <Rika> one moment |
01:38:44 | FromDiscord | <Rika> you can actually translate most examples in the original lib https://github.com/ocornut/imgui |
01:39:19 | FromDiscord | <ThothLoki> wtf. now there are two? |
01:39:35 | FromDiscord | <Rika> no |
01:39:42 | FromDiscord | <Rika> the 2nd one is the original C lib |
01:39:47 | FromDiscord | <Rika> C++* |
01:39:54 | FromDiscord | <Rika> the first one are Nim bindings |
01:40:07 | * | abm quit (Quit: Leaving) |
01:41:31 | FromDiscord | <ThothLoki> hmmm. lemme take a look |
01:42:15 | * | vicfred quit (Quit: Leaving) |
01:43:32 | * | Zectbumo joined #nim |
01:48:37 | * | dgb quit (Quit: WeeChat 2.7.1) |
02:11:47 | * | arecacea1 quit (Remote host closed the connection) |
02:13:21 | * | arecacea1 joined #nim |
02:21:06 | * | oprypin quit (Remote host closed the connection) |
02:21:17 | * | shad0w_ joined #nim |
02:23:33 | * | oprypin joined #nim |
02:24:01 | * | FromGitter quit (Remote host closed the connection) |
02:24:31 | * | FromGitter joined #nim |
02:36:47 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:38:31 | * | muffindrake joined #nim |
02:40:13 | * | dgb joined #nim |
03:01:43 | * | lritter joined #nim |
03:06:12 | * | a_chou quit (Ping timeout: 256 seconds) |
03:06:28 | FromDiscord | <Avatarfighter> @Elegant Beef the UI in the NAS is to have an interface to change settings and stuff |
03:15:13 | FromGitter | <gogolxdong> Is there any video player library like ffmpeg? |
03:16:46 | * | a_chou joined #nim |
03:20:14 | * | a_chou quit (Remote host closed the connection) |
03:26:56 | Prestige | I'm reading the write tracking article and came across this: func select(cond: bool; a, b: const Node): Node |
03:27:12 | Prestige | Is there a reason cond is separated by ; instead of , ? |
03:31:02 | * | apahl quit (Ping timeout: 260 seconds) |
03:31:59 | * | apahl joined #nim |
03:37:42 | FromDiscord | <juan_carlos> ; cuts the grouping of types |
03:38:07 | FromDiscord | <juan_carlos> a,b,c: string --> all string |
03:38:31 | FromDiscord | <juan_carlos> a,b: int ;c: string --> c string, a,b int |
03:38:51 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:38:54 | FromDiscord | <juan_carlos> a,b ; c: string --> error :P |
03:39:15 | FromDiscord | <juan_carlos> You kinda group stuff up with ; |
03:39:42 | Prestige | in that needed? |
03:40:02 | FromDiscord | <juan_carlos> Yes and No. |
03:40:14 | FromDiscord | <juan_carlos> Depends if you want to group stuff or not. |
03:40:33 | Prestige | I can't do func select(cond: bool, a, b: const Node): Node ? |
03:41:17 | FromDiscord | <juan_carlos> Yes |
03:42:47 | * | aeldemeryde[m] left #nim ("User left") |
03:46:52 | * | vicfred joined #nim |
04:04:44 | * | thomasross quit (Ping timeout: 256 seconds) |
04:05:08 | Prestige | oh I can |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:37 | * | supakeen joined #nim |
04:47:03 | * | vicfred quit (Quit: Leaving) |
04:59:00 | * | narimiran joined #nim |
04:59:45 | FromDiscord | <acek7> is there a way to get this into an epub format |
04:59:49 | FromDiscord | <acek7> http://ssalewski.de/nimprogramming.html#_part_i_introduction |
05:02:34 | * | vicfred joined #nim |
05:25:14 | * | solitudesf joined #nim |
05:32:42 | FromGitter | <StefanSalewski> What is the concrete problem reading it as plain html? |
05:33:04 | FromDiscord | <acek7> i just wanna read it in bed as well as at the computer |
05:33:12 | FromDiscord | <acek7> im lazy ok |
05:33:37 | FromGitter | <StefanSalewski> Maybe you can try saving it to disk, browsers like firefox have a "save as". |
05:35:51 | FromGitter | <StefanSalewski> When part I and II are ready I may try to make a ebub, but epub is not that easy and needs some testing on various devices. |
05:37:41 | FromGitter | <StefanSalewski> Someone requests a PDF, but PDF is only really good for printout. We should not kill trees for printout, so no PDF from me, sorry. Bye. |
05:49:14 | * | kenran joined #nim |
05:52:44 | * | lritter quit (Quit: Leaving) |
06:09:56 | * | gmaggior quit (Quit: Leaving) |
06:14:28 | FromDiscord | <gour> _is considering to try/use wxnim for desktop gui app, it would be nice to include it in the https://github.com/nim-lang/Nim/wiki/Curated-Packages#gui list 💭_ |
06:17:34 | * | orazovae[m] joined #nim |
06:25:22 | * | kenran quit (Quit: leaving) |
06:26:30 | * | PMunch joined #nim |
06:29:43 | * | letto quit (Quit: Konversation terminated!) |
06:31:32 | * | letto joined #nim |
06:34:03 | * | Trustable joined #nim |
06:34:45 | Araq | hi gour, nice that you're still around |
06:44:54 | * | gour joined #nim |
06:45:07 | * | muffindrake quit (Ping timeout: 240 seconds) |
06:45:15 | gour | Araq: hiya, i'm glad that Nim is kicking nicely around ;) |
06:45:45 | * | superbia quit (Ping timeout: 240 seconds) |
06:47:31 | * | muffindrake joined #nim |
06:47:45 | gour | i've defintely decided to use Nim for computational part of my application, iow. to have it available as library; then for UI part i'll try with some Nim bindings (e.g. wxnim) and if that ends up as not satisfactorily, the other option is (which i'd like to avoid) using nimporter/pyqt |
06:49:21 | FromDiscord | <hobbledehoy> aren't there already qt bindings for nim? |
06:49:48 | FromDiscord | <flywind> !repo nimqml |
06:49:49 | disbot | https://github.com/filcuc/nimqml -- 9nimqml: 11Qt Qml bindings for the Nim programming language 15 72⭐ 9🍴 7& 1 more... |
06:50:40 | FromDiscord | <gour> hmm, that's interesting, but no update for almost 1 yr? |
06:51:02 | FromDiscord | <flywind> You can use this fork, https://github.com/status-im/nimqml |
06:51:39 | FromDiscord | <flywind> There is also a client building with this fork, https://github.com/status-im/nim-status-client |
06:52:15 | FromDiscord | <gour> > You can use this fork, https://github.com/status-im/nimqml↵@flywind ahh, that's better 🙂 |
06:56:27 | Araq | the time it took you to decide on Nim could have been used for app development. you could have written your app in Lazarus. 5 times by now ;-) |
06:59:07 | gour | Araq: heh, i had difficult situation at home, could not do much...btw, i was also seriously considering fpc/lazarus :-) |
07:00:22 | gour | btw, fidget also looks interesting, but don't like dependency on Figma...so QML sounds better in comparison |
07:00:57 | Araq | it doesn't have that dependency. If I understand it correctly, you can import the Figma code |
07:01:11 | Araq | but you can also write it by hand, it's declarative |
07:01:31 | gour | other GUI options are nice, but, imho, not mature enough. however, considering that one of the Nim's "features" is "much better Python", it would be nice to have few mature options for GUI |
07:02:21 | Araq | I consider Python's UI support quite bad fwiw |
07:02:37 | gour | Araq: yeah, but why not having QML import then which is, at least, open-source, has free builder etc. |
07:03:43 | gour | Araq: heh, there is Pyqt/pyside2 and wxpython, among others...much better than what is available for many other languages...e.g. Go, not sure about Rust since its syntax creates pain in my eyes |
07:06:54 | Araq | well pyqt is a QT wrapper, we have one too. Same for wxPython |
07:07:37 | FromDiscord | <flywind> pyqt5 has a great ide support(eric 6). |
07:07:56 | gour | right, but they're maintained and up-to-date |
07:08:12 | gour | moreover, there is good docs, books etc. |
07:09:01 | Araq | good point |
07:10:27 | * | Vladar joined #nim |
07:23:50 | * | arecacea1 quit (Remote host closed the connection) |
07:24:24 | * | arecacea1 joined #nim |
07:32:51 | * | shad0w_ quit (Remote host closed the connection) |
07:35:28 | * | Trustable quit (Remote host closed the connection) |
07:38:13 | * | solitudesf quit (Ping timeout: 256 seconds) |
07:49:22 | FromDiscord | <flywind> If i use lock in closure environment and I want call them multi times, how can I deinit lock instead of using global locks. |
07:49:31 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2ymr |
07:50:49 | * | solitudesf joined #nim |
07:51:42 | Araq | well a lock protects something and in your snippet it doesn't do anything |
07:51:51 | Araq | the lock must live for as long as the thing you protect |
07:53:12 | FromDiscord | <Rika> why cant you put the lock in the closure? |
07:53:26 | FromDiscord | <Rika> or, oh |
07:53:26 | FromDiscord | <Rika> i see |
07:54:16 | FromDiscord | <flywind> I think, it will be used in shared heap(arc/orc) in which closure environment is shared by every thread. |
07:58:02 | FromDiscord | <flywind> I want to make closure variables thread-safe in arc/orc https://github.com/planety/prologue/blob/0a92a863922ccf5b8e23cb31fea45b542d7588fa/src/prologue/middlewares/sessions/memorysession.nim#L40 |
08:06:41 | Oddmonger | following the discussion from yesterday about .nim.cfg for builds, i wonder if i can display strings from within this file ? |
08:06:53 | Oddmonger | i've searched here, but found nothing: https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L55 |
08:06:57 | Araq | lol what |
08:07:10 | Oddmonger | what i want to do is: |
08:07:12 | Araq | you mean you need an 'echo'? use a .nims file instead then |
08:08:03 | Oddmonger | yes echo, and testing if variables are defined or not, and then exit if not defined |
08:08:41 | FromDiscord | <Rika> nims file |
08:08:49 | Araq | when not defined(mymum): quit "I miss my mum" |
08:08:50 | Oddmonger | ah nim script, didn't knew that |
08:09:21 | Oddmonger | fine, i've found nims doc, thank you Rika and Araq |
08:10:08 | Oddmonger | so for building with Nim, there is : .nim.cfg (local config for module), nims (~ Makefile ?) and nimble (package distribution) ? |
08:21:00 | Araq | the nimble file can include your .nims file |
08:21:07 | Araq | that's the beauty of the system |
08:21:16 | Araq | and you can ignore the nim.cfg entirely |
08:22:24 | FromDiscord | <Recruit_main707> nimble is also makefile -ish |
08:26:01 | Araq | offtopic but an interesting read, http://solidsoftware.com.au/Information/Article/C++/Article1.html |
08:27:23 | * | Vladar quit (Quit: Leaving) |
08:30:49 | * | Tanger quit (Quit: Leaving) |
08:32:13 | * | lmariscal quit (Ping timeout: 256 seconds) |
08:34:21 | Oddmonger | ahhh Borland C++ :') |
08:35:10 | Oddmonger | but Borland ruled in Pascal land, and they disappeared with the Pascal's decline |
08:38:34 | * | krux02 joined #nim |
08:41:20 | Araq | they disappeared when MS bought their employees |
08:45:09 | Oddmonger | but when you thought of Pascal, you were thinking Turbo-Pascal. When you thought about C++, you weren't thinking of Turbo-C++ |
08:45:51 | Araq | no? what were you thinking then? I had both Delph and C++Builder fwiw |
08:45:58 | Araq | *Delphi |
08:46:01 | Oddmonger | Aztec :) |
08:46:41 | Araq | Aztec C++? are you kidding me? never heard of that one |
08:47:11 | Oddmonger | i thouhgt it was this one, but i cannot remember of the name |
08:47:35 | Araq | Zortech? |
08:47:46 | Oddmonger | no, it was djgpp |
08:48:08 | Oddmonger | terrible name, no wonder why i forgot it |
08:48:20 | Araq | that was GNU C++ for DOS iirc |
08:48:45 | Araq | you would use that when you had no money for real tools :P |
08:48:58 | Oddmonger | i was using it with Dos yes, and i had no money :) |
08:49:16 | Oddmonger | but is has dos extender, already |
08:49:53 | FromDiscord | <Clyybber> Araq: Can you close https://github.com/nim-lang/RFCs/issues/161 I don't have permissions to do so |
08:49:55 | disbot | ➥ Multi-line string literals (blocks of lines) ; snippet at 12https://play.nim-lang.org/#ix=2ymL |
08:50:15 | Araq | and then the free compilers took over and destroyed the compiler market entirely. For good. But let's not talk about that, everything is great in open-source land |
08:50:51 | FromDiscord | <ShalokShalom> https://tenor.com/view/magic-shia-labeouf-snl-skit-fingers-gif-4860090 |
08:51:15 | Oddmonger | well, there is still still VS which tends to become… ok favourite editor for Unity's teenagers :þ |
08:52:19 | FromDiscord | <Recruit_main707> vs is a very good ide |
08:52:58 | Oddmonger | yes, that's everybody says, but nobody talk about compilers side now :) |
08:53:14 | Oddmonger | that sounds a bit weird to me, VS reduced to its editor part |
08:53:32 | FromDiscord | <Recruit_main707> cant you change the used compiler? |
08:54:31 | Oddmonger | maybe MS is selling an editor now, and not compilers :) |
09:06:16 | * | haxscramper joined #nim |
09:07:01 | FromDiscord | <Elegant Beef> Well VS is used for C# a lot and supports WPF, so for WPF you cant get a better tool really |
09:08:07 | PMunch | Hmm, the hover information from nimsuggest doesn't include which exceptions it can throw.. |
09:08:08 | haxscramper | alehander92: I'm not really sure about adding a lot of escape hatches. I'm actuall in favor of making syntax /a little/ overloaded but completely disallowing any custom transformation/logic for patterns. The only thing that I think /might/ be added is custom predicates but they are not necessary in overwhelming majority of cases. |
09:09:16 | haxscramper | And certainly no custom matcher/unpacker procs as it will make learning this thing more complicated. If one needs to check if something matches regex then use `"string" =~ re"<regex>"`. Same goes for different patterns |
09:09:28 | haxscramper | This is really nice to have but a little to specific for stdlib |
09:10:38 | haxscramper | If `caseStmtMacros` are no longer experimental it would be quite easy to write custom matcher. And again - just nesting conditions/patterns is more declarative and easier to understand than more 'compact' syntax |
09:12:36 | haxscramper | I think only predicate expressions that are really necessary are `fld: in {set}` and `val: == something`. |
09:23:06 | * | Zectbumo quit (Remote host closed the connection) |
09:35:03 | * | opal quit (Ping timeout: 240 seconds) |
09:38:00 | * | opal joined #nim |
09:49:15 | FromDiscord | <alehander42> sorry, escape hatches was a comment about something else and not to you |
09:49:16 | FromDiscord | <alehander42> iirc 😄 |
09:49:51 | FromDiscord | <alehander42> yes, i agree that one should be very careful with custom matchers |
09:50:13 | FromDiscord | <alehander42> but it is important to think a bit of that, because otherwise the design might be too hard to change later |
09:50:20 | FromDiscord | <alehander42> even if we don't support that |
09:50:28 | FromDiscord | <alehander42> also |
09:50:38 | FromDiscord | <alehander42> it's cool to have a construction-like syntax imo |
09:50:55 | FromDiscord | <alehander42> iirc that's the way e.g. haskell does it and it makes it a bit easier to learn |
09:51:22 | FromDiscord | <ShalokShalom> Is the function in Nim already guaranteed to be pure? |
09:51:26 | FromDiscord | <alehander42> those are just notes on stuff i remembered thinking about |
09:51:29 | FromDiscord | <ShalokShalom> I heard this is about to be implemented |
09:51:43 | FromDiscord | <ShalokShalom> Despite the fact, that the documentation already states, it is. |
09:51:58 | FromDiscord | <alehander42> not necessarily comments on your design, just stuff that might be interesting to compare to as thought |
09:52:18 | FromDiscord | <haxscramper> By construction-like syntax you mean what exactly? |
09:52:21 | FromDiscord | <alehander42> e.g. |
09:52:41 | FromDiscord | <alehander42> sets to use the {a, b, c} thing, seq-s @[a, b, c] objects A(..) |
09:53:01 | FromDiscord | <alehander42> and even variants to have patty-like constructor helpers so one can construct them similarly to the way you match |
09:53:04 | FromDiscord | <haxscramper> > Is the function in Nim already guaranteed to be pure?↵@ShalokShalom Nim `func` is guaranteed to have no side effects. Last addition to that check is deep immutability for ref types |
09:53:15 | FromDiscord | <alehander42> as this is closer to the way sum types are matched in other places imo |
09:53:32 | FromDiscord | <alehander42> @ShalokShalom this needs a flag |
09:53:38 | FromDiscord | <alehander42> or experimental pragma |
09:53:41 | FromDiscord | <alehander42> strictFuncs i think |
09:53:48 | FromDiscord | <alehander42> so it's opt in |
09:54:21 | FromDiscord | <ShalokShalom> @haxscramper Thanks a lot. |
09:54:23 | FromDiscord | <ShalokShalom> Since when? |
09:54:35 | FromDiscord | <ShalokShalom> Can you send the commit please? |
09:55:15 | FromDiscord | <alehander42> did you have a look at gara? it's totally not great, but it might also have some examples of that (and the variant thing i am talking about is e.g. https://github.com/alehander92/gara/issues/5 : originally patty !) |
09:55:16 | disbot | ➥ Macro to generate variant objects |
09:55:23 | FromDiscord | <ShalokShalom> @alehander42 Thanks a lot, this will become standard, nonetheless? |
09:55:35 | FromDiscord | <alehander42> no idea : ask Araq |
09:55:38 | Oddmonger | in a nims file, how to user a variable with the «-- …» sugar syntax ? |
09:55:55 | Oddmonger | --out:myvar , will create a «myvar» file |
09:56:15 | Oddmonger | switch("out", myvar) , is ok |
09:56:25 | FromDiscord | <alehander42> on the other hand i kinda dig the $ @ thing : sounds a bit like perl i guess |
09:56:43 | FromDiscord | <haxscramper> @alehander42 I used gara and even made a PR several months ago with some minor fixes. |
09:56:46 | FromDiscord | <alehander42> but i am a little cautious with the many symbols |
09:56:48 | FromDiscord | <alehander42> oh sorry |
09:56:50 | FromDiscord | <haxscramper> Using `[a, b, c]` vs `@[a, b, c]` for int-indexable is preferrable because not everything is a sequence and prefxi `@` does not add anything really. `A( ... )` is mostly useful for case objects |
09:57:02 | FromDiscord | <alehander42> yes, but it's more general |
09:57:04 | FromDiscord | <haxscramper> For sets - yes, I like the idea actually |
09:57:14 | FromDiscord | <alehander42> it's about construction being the opposite of extraction |
09:57:20 | FromDiscord | <alehander42> and being consistent |
09:57:28 | FromDiscord | <alehander42> but this is subjective (if this should be a goal) |
09:57:42 | FromDiscord | <alehander42> (one opposite: of course destructors are a more obvious one) |
09:59:59 | FromDiscord | <haxscramper> If you match regular object you are not really interested in the name itself I think, only in fields. When working with case objects you are also interested in checking kind field. I think `Kind( ... )` is better (closer to various ML/Haskell languages, better conveys intention). If you need to check kind against multiple values (e.g. all string literal nodes for example) can use `(kind: in StringLiterals)` |
10:00:36 | FromDiscord | <haxscramper> So this is not construction/destruction but type-definition/match-pattern |
10:00:40 | FromDiscord | <alehander42> yes, i agree |
10:00:45 | FromDiscord | <alehander42> but this is the reason |
10:00:54 | FromDiscord | <alehander42> why it's good to be able to construct them like that as well |
10:01:07 | FromDiscord | <alehander42> so that's why we had the idea to e.g. use ~Kind |
10:01:14 | FromDiscord | <alehander42> iirc |
10:01:33 | FromDiscord | <alehander42> but yeah, Kind(..) is also very close |
10:01:54 | FromDiscord | <Recruit_main707> @ShalokShalom its a pretty recent commit /the pure funcs one) so it might be in the latest nightly build, or at least in devel |
10:01:59 | FromDiscord | <alehander42> one thing that surprises me is kind: in : i expect this to be literally invalid syntax, is it valid |
10:02:05 | FromDiscord | <haxscramper> We can just support both `Kind( ... )` and `Obj( ... )` and make kind test true for lattern one |
10:02:09 | FromDiscord | <alehander42> id imagine .kind in |
10:02:12 | FromDiscord | <haxscramper> *always true |
10:02:14 | FromDiscord | <alehander42> (but it's probably also invalid?) |
10:02:31 | FromDiscord | <ShalokShalom> @Recruit_main707 Oh, thanks a lot |
10:02:36 | FromDiscord | <ShalokShalom> Thats what I have hoped for. |
10:02:43 | FromDiscord | <ShalokShalom> Sad that I need to pragma. |
10:02:46 | FromDiscord | <alehander42> yes, the only problem is if it's obvious enough |
10:02:49 | FromDiscord | <ShalokShalom> Hope this is in the next release. |
10:02:54 | FromDiscord | <alehander42> that they are two different kinds of matches |
10:02:59 | FromDiscord | <haxscramper> !eval import macros; dumpLisp((e: in 12)) |
10:03:01 | NimBot | <no output> |
10:03:11 | FromDiscord | <ShalokShalom> Is there some way to define alternative keywords and operators? |
10:03:15 | FromDiscord | <alehander42> !eval import macros; dumpTree: .a in 2 |
10:03:16 | NimBot | Compile failed: /usercode/in.nim(1, 26) Error: expression expected, but found '.' |
10:03:20 | FromDiscord | <ShalokShalom> Like, as an example a pipe? |
10:03:29 | FromDiscord | <alehander42> !eval import macros; dumpTree: a: in 2 |
10:03:31 | NimBot | Compile failed: /usercode/in.nim(1, 29) Error: expression expected, but found 'keyword in' |
10:03:55 | FromDiscord | <alehander42> yes, you can define `->` |
10:03:56 | FromDiscord | <alehander42> function |
10:04:04 | FromDiscord | <haxscramper> > Like, as an example a pipe?↵@ShalokShalom `` proc`|`(a, b: int) = echo a, b` `` for infix `|` |
10:04:12 | FromDiscord | <alehander42> yea* ^ |
10:04:13 | orazovae[m] | Hello people. I want to build a simple program to determinify an automaton. |
10:04:20 | orazovae[m] | The first step is to reduce all edges with multiple letters to multiple edges with one letter. |
10:04:48 | FromDiscord | <ShalokShalom> @haxscramper So | becomes the pipe in this example? Very convenient and nice ^^ |
10:04:51 | FromDiscord | <Recruit_main707> i didnt understand a single thing about this message, so im gonna guess i cant help you lol |
10:04:52 | orazovae[m] | I would also like to have a taste in manual memory management. So how do I allocate memory for a Vertex and initialize its values? |
10:05:20 | FromDiscord | <lqdev> Vertex(field1: value1, field2: value2, …) |
10:05:40 | FromDiscord | <Recruit_main707> is your Vertex stack or heap allocated |
10:05:46 | FromDiscord | <ShalokShalom> @Recruit_main707 Someone else has mentioned that I need a pragma for now, to activate this. I hope for a default implementation in the next version of Nim. |
10:06:24 | FromDiscord | <alehander42> i doubt it: func is already used a lot |
10:06:29 | FromDiscord | <haxscramper> > !eval import macros; dumpTree: a: in 2↵@alehander42 This is treated as type definition I think, and `.a` is just invalid in general |
10:06:30 | orazovae[m] | https://pastebin.com/xyt8c7e6 here is my code |
10:06:30 | FromDiscord | <alehander42> i am not sure what the plan is |
10:06:40 | FromDiscord | <ShalokShalom> @haxscramper Does this implementation limit the pipe to ints? |
10:06:56 | FromDiscord | <haxscramper> Yes. This is just regular proc basically |
10:07:14 | FromDiscord | <lqdev> orazovae: Vertex is small, don't allocate it on the heap. also you don't need inheritance so remove the `of RootObj` |
10:07:27 | FromDiscord | <alehander42> noo |
10:07:28 | FromDiscord | <ShalokShalom> > yes, you can define `->`↵> function↵@alehander42 And how? ↵As haxscramper just showed? |
10:07:28 | FromDiscord | <haxscramper> If you want something crazy can do `` macro `|`(a, b: untyped) = echo `` |
10:07:36 | FromDiscord | <alehander42> yes ^ |
10:07:38 | FromDiscord | <ShalokShalom> @haxscramper Why crazy? |
10:07:41 | FromDiscord | <alehander42> but man |
10:07:42 | FromDiscord | <lqdev> if you want to do manual memory management you also must not use seq and ref |
10:07:48 | FromDiscord | <ShalokShalom> Sounds sane to me. |
10:07:53 | FromDiscord | <alehander42> i dont like the a: b = value |
10:08:00 | FromDiscord | <alehander42> i mean on the other hand maybe i do |
10:08:01 | FromDiscord | <Recruit_main707> or regions :P |
10:08:04 | FromDiscord | <haxscramper> > @haxscramper Why crazy?↵@ShalokShalom Operator macros are not really sane thing to use IMHO |
10:08:07 | FromDiscord | <ShalokShalom> I come from F#, so pipes are mandatory to me. |
10:08:08 | FromDiscord | <alehander42> but it means if i dont capture it |
10:08:15 | FromDiscord | <alehander42> i need to write a = 0, b = 1 |
10:08:16 | FromDiscord | <ShalokShalom> @haxscramper Ah 🤪 |
10:08:24 | FromDiscord | <alehander42> which is a bit strange |
10:08:28 | orazovae[m] | And several questions: what's the difference between inheriting with `ref` and without. For example: type Automaton = ref object of RootObj |
10:08:33 | FromDiscord | <ShalokShalom> And how would you do a type agnostic thing sane then? |
10:08:41 | FromDiscord | <lqdev> orazovae: `ref` means managed pointer |
10:08:43 | FromDiscord | <haxscramper> Wait a second, I think I just had an idea for something really bad |
10:08:46 | FromDiscord | <lqdev> aka GC'd |
10:08:58 | FromDiscord | <alehander42> we really need threads |
10:09:05 | FromDiscord | <alehander42> in the chat 😄 |
10:09:07 | FromDiscord | <lqdev> you really should not use inheritance when you don't need it |
10:09:55 | FromDiscord | <alehander42> what do you mean type agnostic |
10:09:58 | PMunch | orazovae and `of RootObj` adds the fields from what you inherit from, along with adding some hidden fields to do runtime method overloading |
10:10:03 | FromDiscord | <alehander42> you can use a generic probably |
10:10:19 | FromDiscord | <Recruit_main707> orazovae: here you have an example of manual memory management https://play.nim-lang.org/#ix=2yn8 |
10:10:22 | FromDiscord | <alehander42> ohh PMunch |
10:10:33 | PMunch | @alehander42, huh? |
10:10:41 | FromDiscord | <alehander42> btw haxscramer Pmunch's macroutils have a thing that reminds me a bit of pattern matching |
10:10:45 | FromDiscord | <alehander42> it's like quote matching |
10:11:00 | FromDiscord | <alehander42> not really important for this rfc, but just cool to take a look at |
10:11:07 | FromDiscord | <haxscramper> > Wait a second, I think I just had an idea for something really bad↵@haxscramper https://play.nim-lang.org/#ix=2yn9 |
10:11:22 | FromDiscord | <haxscramper> Variadic pipe operators |
10:11:26 | orazovae[m] | 2. in function parameters, what's the difference between passing something by `ref`and passing with `var`. They both let you modify the passed object, right? |
10:11:32 | FromDiscord | <alehander42> the extract thing |
10:11:45 | FromDiscord | <ShalokShalom> > what do you mean type agnostic↵@alehander42 ↵ proc`|`(a, b: int) = echo a, b` This sounds very strongly like something that is limited to integers. |
10:12:00 | FromDiscord | <alehander42> PMunch we were discussing @haxscramper 's ideas for https://github.com/nim-lang/RFCs/issues/245 |
10:12:01 | disbot | ➥ Early version of RFC: Pattern matching ? ; snippet at 12https://play.nim-lang.org/#ix=2sbl |
10:12:06 | FromDiscord | <Recruit_main707> orazovae, check the last message of this thread:https://forum.nim-lang.org/t/1787 |
10:12:09 | PMunch | orazovae[m], passing by var means you can change the original memory location, passing by ref means you can edit whatever the reference points to |
10:12:14 | FromDiscord | <haxscramper> > not really important for this rfc, but just cool to take a look at↵@alehander42 Yes, I saw this one. Really cool but only for NimNode so not applicable here. But nice thing to have really |
10:12:14 | FromDiscord | <ShalokShalom> @haxscramper And is this now truly serious and nonsense? |
10:12:24 | FromDiscord | <Recruit_main707> it shows the difference between ref and var arguments |
10:12:29 | FromDiscord | <alehander42> @ShalokShalom yes: so then you can use generics or maybe template |
10:12:41 | PMunch | If you do pass in a var to a ref type you are able to change the ref to point to another object |
10:12:50 | FromDiscord | <Recruit_main707> ^ |
10:13:09 | FromDiscord | <alehander42> something i really need to write about now |
10:13:10 | FromDiscord | <alehander42> thanks |
10:13:39 | PMunch | @alehander42 var vs. ref? |
10:14:10 | PMunch | ~varvsref is https://forum.nim-lang.org/t/1787#11158 |
10:14:10 | orazovae[m] | Sorry for disturbance. I would usually google questions like these but I don't find it quite as easy to find answers for nim as it is for other languages. |
10:14:11 | disbot | varvsref: 11https://forum.nim-lang.org/t/1787#11158 |
10:14:34 | FromDiscord | <alehander42> PMunch my nil stuff |
10:14:34 | FromDiscord | <haxscramper> > And is this now truly serious and nonsense?↵@ShalokShalom ? Just example of what you can do with term rewriting templates |
10:14:36 | FromDiscord | <ShalokShalom> @haxscramper Do you know FSharp pipes? |
10:14:43 | FromDiscord | <ShalokShalom> Since I think you confuse them |
10:14:45 | PMunch | orazovae[m], no worries :) Nim can indeed be a bit harder to find help for, but this IRC channel will help you out with pretty much anything |
10:14:54 | FromDiscord | <ShalokShalom> I mean forward pipes, usually done with maps. |
10:15:04 | FromDiscord | <Recruit_main707> and the discord server too :) |
10:15:19 | PMunch | Well yeah, but they are linked to each other :P |
10:15:38 | PMunch | So it's the same stream of information |
10:15:46 | FromDiscord | <Recruit_main707> xD |
10:15:51 | FromDiscord | <alehander42> :)) |
10:16:06 | FromDiscord | <alehander42> mate |
10:16:19 | FromDiscord | <alehander42> wow discord is trying to detect my |
10:16:22 | FromDiscord | <alehander42> browser discord accoun |
10:16:24 | FromDiscord | <alehander42> from an app |
10:16:31 | FromDiscord | <alehander42> huh i didnt know they do that |
10:16:49 | FromDiscord | <ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/757908248689901628/Screenshot_2020-09-14-20-05-48-53_7a4090f09f6554852d748ee9fd6f40d3.jpg |
10:16:58 | FromDiscord | <ShalokShalom> You pass one function into the next |
10:17:08 | FromDiscord | <ShalokShalom> The triangle is |> |
10:17:28 | FromDiscord | <ShalokShalom> Fira Code transforms it into the ligature. 😉 |
10:18:17 | FromDiscord | <haxscramper> > I mean forward pipes, usually done with maps.↵@ShalokShalom https://play.nim-lang.org/#ix=2ync |
10:18:48 | FromDiscord | <haxscramper> I just did a quick google search for `|>` operator so this is probably very primitive alternative |
10:18:49 | FromDiscord | <ShalokShalom> Ah yeah, yes |
10:18:59 | FromDiscord | <ShalokShalom> But again, limited to integer? |
10:19:10 | FromDiscord | <ShalokShalom> Thanks a lot |
10:19:21 | FromDiscord | <haxscramper> No, fully generic `` func `|>`[A, B](x: A, f: A -> B): B = f(x) `` |
10:19:31 | FromDiscord | <ShalokShalom> Oh, thanks a lot |
10:20:12 | FromDiscord | <ShalokShalom> I was confused by the line below, but this is obviously just the setup for the example 😂 |
10:20:28 | * | Sembei joined #nim |
10:20:35 | FromDiscord | <ShalokShalom> How is type inference in Nim? |
10:20:56 | FromDiscord | <Clyybber> inferred |
10:21:02 | FromDiscord | <alehander42> ok |
10:21:20 | FromDiscord | <ShalokShalom> Has it a Hindley-Milner type system, or so? |
10:21:22 | FromDiscord | <alehander42> i am trying the general discord screen sharing |
10:21:29 | FromDiscord | <alehander42> i am going to work a bit on stuff |
10:21:56 | FromDiscord | <Clyybber> @ShalokShalom Nope |
10:22:07 | FromDiscord | <Clyybber> No general return type inference |
10:22:14 | FromDiscord | <ShalokShalom> So pure deduction? |
10:22:16 | FromDiscord | <haxscramper> @alehander42 I will remove `$a` for variable captures and replace it with just `a` for variable, add non-trailling pattern matches. |
10:22:29 | FromDiscord | <Clyybber> Except for literals and iterators |
10:22:47 | FromDiscord | <ShalokShalom> I would like to infer the name of a binding as its default type, is this possible? |
10:22:48 | FromDiscord | <Clyybber> Literals in the sense that you can do var x: uint = 1 |
10:22:55 | FromDiscord | <haxscramper> I'm not really sure what `{a, b, c}` should do though |
10:22:57 | FromDiscord | <alehander42> @haxscramper but how would you separate if from the case of a: existingA |
10:23:09 | FromDiscord | <alehander42> @haxscramper well it is good for capturing |
10:23:16 | FromDiscord | <Clyybber> And iterators in the sense that you can do `for i in x:` and `for i, v in x:` |
10:23:17 | FromDiscord | <alehander42> e.g. stuff like {@a} (old syntax sorry) |
10:23:31 | FromDiscord | <haxscramper> Maybe `when declared(a)` ? |
10:23:34 | FromDiscord | <alehander42> or {2, *@others} |
10:23:44 | FromDiscord | <Clyybber> @ShalokShalom Please elaborate |
10:24:16 | FromDiscord | <ShalokShalom> Like that const test = "super" is inferred as type test instead string. |
10:24:32 | FromDiscord | <Clyybber> huh? |
10:24:36 | FromDiscord | <ShalokShalom> (edit) 'test' => '*test*' | 'string.' => '*string*.' |
10:24:39 | FromDiscord | <Clyybber> thats incredibly cursed |
10:24:51 | FromDiscord | <alehander42> no, it's just surprising |
10:24:55 | FromDiscord | <alehander42> but you can do that with a macro |
10:24:59 | FromDiscord | <ShalokShalom> I like to have more refined types |
10:25:02 | FromDiscord | <ShalokShalom> Yes? |
10:25:36 | FromDiscord | <Rika> why dont we have return type inference? |
10:25:52 | FromDiscord | <ShalokShalom> I see less sense in a type system, when you have 40 different ints, 60 strings and 10 floats, which you are *NOT* supposed to combine with each other |
10:25:52 | FromDiscord | <Rika> is it thought as dumb, is it hard to squeeze in, or what |
10:25:53 | FromDiscord | <haxscramper> > or {2, *@others}↵@alehander42 `{2}` means `len(set) == 1 and contains(set, 2)`, `{2, *@others}` means `len(set) >= 1 and contains(set, 2)` followed by `for val in set: if val != 2: other.incl val`. Correct? |
10:26:08 | FromDiscord | <Recruit_main707> generic returns 👀 |
10:26:30 | FromDiscord | <ShalokShalom> > but you can do that with a macro↵@alehander42 How? 👀 |
10:26:32 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yne |
10:26:52 | FromDiscord | <ShalokShalom> I already have my pipe, that would save my day ^^ |
10:28:59 | FromDiscord | <ShalokShalom> What does ```import sugar``` do? ↵So, what does sugar do, sounds like syntactic sugar? 👀 |
10:29:10 | FromDiscord | <Clyybber> yep, its a module with macros |
10:29:12 | FromDiscord | <ShalokShalom> Ah, found it. |
10:30:17 | FromDiscord | <ShalokShalom> Hnn, two arrows, and both for procedures? |
10:30:25 | FromDiscord | <ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/757911672898715679/Screenshot_2020-09-22-12-29-48-88.jpg |
10:30:45 | FromDiscord | <ShalokShalom> I guess I can just copy the while lib and change that to a pure func. |
10:31:12 | FromDiscord | <ShalokShalom> Seems like I could change Nim into a fully-fledged functional language 😊 |
10:31:15 | FromDiscord | <haxscramper> Is there a way to make regular proc into infix? Like this operators I can use `` `|`(a, b) `` for prefix notation |
10:31:50 | FromDiscord | <Clyybber> @ShalokShalom You can attach pragmas with those macros |
10:31:56 | FromDiscord | <ShalokShalom> Hnnn |
10:32:03 | FromDiscord | <Clyybber> so you can have f: (int, int) {.noSideeffect.} -> int |
10:32:04 | FromDiscord | <ShalokShalom> That means? They change its behavior? |
10:32:15 | FromDiscord | <Clyybber> It makes it a pure functions |
10:32:18 | FromDiscord | <Clyybber> (edit) 'makes' => 'make' |
10:32:25 | FromDiscord | <Clyybber> (edit) 'make' => 'makes' | 'functions' => 'function' |
10:32:39 | FromDiscord | <ShalokShalom> Aah. Yeah, I read about {.noSideeffect} |
10:33:14 | FromDiscord | <ShalokShalom> But I would save noise, by simply creating my own version of sugar, I guess? |
10:33:36 | FromDiscord | <Clyybber> sure, there has been a proposal to add special syntax for func versions of these macros |
10:33:46 | FromDiscord | <ShalokShalom> But this pragma thing is definitely useful. |
10:33:52 | FromDiscord | <Clyybber> I think they used ==> and --> |
10:33:58 | FromDiscord | <ShalokShalom> Uff |
10:34:09 | FromDiscord | <ShalokShalom> I dont plan to use proc at all, so... |
10:34:21 | FromDiscord | <Recruit_main707> thats gonna be hard |
10:34:28 | FromDiscord | <Clyybber> what is? |
10:34:33 | FromDiscord | <ShalokShalom> I use Godot and it's C++ API to do this |
10:34:37 | FromDiscord | <Recruit_main707> i just try to write func, and if it errors, i sure proc xD |
10:34:39 | FromDiscord | <ShalokShalom> Nim is for the logic. |
10:34:53 | FromDiscord | <Rika> @haxscramper anything stropped is infix afaik |
10:35:02 | FromDiscord | <ShalokShalom> Godot/GDScript |
10:35:08 | FromDiscord | <haxscramper> > @alehander42 I will remove `$a` for variable captures and replace it with just `a` for variable, add non-trailling pattern matches.↵And disallow multiple uses for the same variable in single pattern |
10:35:25 | FromDiscord | <Rika> so something like ```proc `test`() = discard``` is infix |
10:35:28 | FromDiscord | <Clyybber> @Rika Nope, anything that uses only operator symbols and has two args is |
10:35:33 | FromDiscord | <Rika> really? |
10:35:37 | FromDiscord | <Rika> ah |
10:35:38 | FromDiscord | <Rika> no |
10:35:44 | FromDiscord | <Rika> also some certain words |
10:35:44 | FromDiscord | <Clyybber> But its a funny idea |
10:35:45 | FromDiscord | <Rika> are infix |
10:35:47 | FromDiscord | <Rika> but not all words |
10:35:52 | FromDiscord | <Clyybber> Only operators |
10:35:58 | FromDiscord | <Clyybber> like not and or mod div |
10:35:59 | FromDiscord | <ShalokShalom> I mean, I like -> for types, that is exactly as in GDScript, so I dont need to adapt. |
10:36:04 | FromDiscord | <Rika> operators makes me think "symbols" |
10:36:33 | FromDiscord | <ShalokShalom> Yeah, me too |
10:36:36 | FromDiscord | <Clyybber> @Rika Having custom infix operators that can also be words would make the parsing dependent on the semantics |
10:36:38 | FromDiscord | <ShalokShalom> But we are wrong. |
10:36:46 | FromDiscord | <ShalokShalom> I always forget this. |
10:36:56 | FromDiscord | <Rika> ok |
10:37:13 | FromDiscord | <ShalokShalom> How to register something as operator, in the first place? |
10:37:18 | FromDiscord | <Rika> you dont |
10:37:25 | FromDiscord | <ShalokShalom> I mean, is this samething the user can do? |
10:37:28 | FromDiscord | <Clyybber> @ShalokShalom Simply use operator symbols |
10:37:34 | FromDiscord | <Rika> only certain combinations of alphanum characters and most symbols are |
10:37:48 | FromDiscord | <haxscramper> And maybe add support for binding checks in form of `(fld: variable.matchesPredicate())`. I just really love how rust macros handle pattern matching with tree categories |
10:37:55 | FromDiscord | <Clyybber> @ShalokShalom https://nim-lang.github.io/Nim/manual#lexical-analysis-operators |
10:38:06 | FromDiscord | <ShalokShalom> @Clyybber Yeah, I plan to do so. |
10:38:16 | FromDiscord | <ShalokShalom> >> is already in use? |
10:38:26 | FromDiscord | <Clyybber> maybe somewhere |
10:38:29 | FromDiscord | <ShalokShalom> Does the macro overwrite default behavior? |
10:38:36 | FromDiscord | <Clyybber> but not without importing some weird shit |
10:38:37 | FromDiscord | <ShalokShalom> I mean in the core language |
10:38:42 | FromDiscord | <ShalokShalom> Superb |
10:38:43 | FromDiscord | <Clyybber> what macro? |
10:38:58 | FromDiscord | <ShalokShalom> So both |> and >> are free. |
10:39:01 | FromDiscord | <Clyybber> the core language also uses custom operators |
10:39:08 | FromDiscord | <Clyybber> they are defined in system.nim |
10:39:23 | FromDiscord | <ShalokShalom> Thats all very good. |
10:39:29 | FromDiscord | <Rika> also thankfully `>>` isnt shr in this language so you have that |
10:39:34 | FromDiscord | <ShalokShalom> The language is much more flexible than Rust. |
10:39:39 | FromDiscord | <Rika> easily |
10:39:48 | FromDiscord | <ShalokShalom> And also far less noisy. |
10:40:27 | FromDiscord | <ShalokShalom> So, the 'use my own type for each binding' issue? Is this possible? |
10:40:42 | FromDiscord | <ShalokShalom> > Like that const test = "super" is inferred as type *test* instead *string*. |
10:41:48 | * | abm joined #nim |
10:41:51 | FromDiscord | <Rika> you can probably make a macro for that |
10:42:50 | * | Trustable joined #nim |
10:43:39 | FromDiscord | <ShalokShalom> Thanks a lot |
10:44:00 | FromDiscord | <Clyybber> *but* its really cursed and I don't get why you would ever want that |
10:44:03 | FromDiscord | <Rika> hey |
10:44:05 | FromDiscord | <Rika> dont judge |
10:44:12 | FromDiscord | <Rika> nim itself is pretty cursed on its own |
10:44:14 | FromDiscord | <Clyybber> vvvvv |
10:44:16 | FromDiscord | <haxscramper> By they way, macro has full access to types. It involves some workarounds though and not really pretty in general |
10:47:25 | FromDiscord | <ShalokShalom> @Clyybber I dont plan to use this all the time |
10:47:47 | FromDiscord | <ShalokShalom> I dont get why people use 40 different integers, which they dont like to match. |
10:48:11 | FromDiscord | <ShalokShalom> To me, primitive types are cursed, at least on tbe surface. |
10:48:17 | FromDiscord | <Rika> hey, *sometimes* its useful, but to that point it sounds more hindrance than useful |
10:48:40 | FromDiscord | <ShalokShalom> I use the type system to shape my code. |
10:48:55 | FromDiscord | <Clyybber> well, its useful if you intend to code efficiently |
10:48:57 | FromDiscord | <ShalokShalom> You can even implement business logic in it. |
10:49:09 | FromDiscord | <Rika> why tho |
10:49:35 | FromDiscord | <ShalokShalom> @Clyybber You mean in terms of performance? I think such custom types get compiled into their primitive forms, at least other languages do that. |
10:49:43 | FromDiscord | <ShalokShalom> https://nim-lang.github.io/Nim/manual#lexical-analysis-operators |
10:49:58 | FromDiscord | <Clyybber> what custom types? |
10:50:05 | FromDiscord | <Clyybber> I'm talking about using uint8 when you need it |
10:50:28 | FromDiscord | <Clyybber> for example |
10:50:35 | FromDiscord | <ShalokShalom> Sounds superb, while I dont see any documentation (here or otherwhere) about the types shr, shl and so on, it seems not being linked. |
10:50:54 | FromDiscord | <Clyybber> shr shl are not types |
10:50:56 | FromDiscord | <Rika> shr is not a type |
10:51:01 | FromDiscord | <ShalokShalom> > I'm talking about using uint8 when you need it↵@Clyybber In case Iike it so performant as possible, I can do it |
10:51:06 | FromDiscord | <ShalokShalom> Sorry, operators. |
10:51:10 | FromDiscord | <ShalokShalom> I am still sleepy. |
10:51:15 | FromDiscord | <Rika> you can find those in `system` |
10:51:25 | FromDiscord | <Rika> https://nim-lang.org/docs/system.html#shr%2Cint%2CSomeInteger |
10:51:27 | FromDiscord | <Clyybber> theres a search box |
10:51:27 | FromDiscord | <ShalokShalom> I mean, the docs to it. |
10:51:29 | FromDiscord | <ShalokShalom> Tha ms |
10:51:36 | FromDiscord | <ShalokShalom> Yeah, didnt find any? |
10:51:46 | FromDiscord | <ShalokShalom> (edit) 'Tha ms' => 'Thanks.' |
10:52:02 | FromDiscord | <Clyybber> typing in `shr` into the search box yields a bunch of shr for me |
10:52:13 | FromDiscord | <Rika> works for me https://media.discordapp.net/attachments/371759389889003532/757917154971615242/unknown.png |
10:52:21 | FromDiscord | <Rika> albeit broken theme still |
10:52:26 | FromDiscord | <ShalokShalom> Yeah, I am on mobile |
10:52:26 | FromDiscord | <Clyybber> @Rika using the stable docs, cursed |
10:52:30 | FromDiscord | <Rika> dont worry, its fixed next stable |
10:52:35 | FromDiscord | <Rika> well |
10:52:36 | FromDiscord | <Clyybber> I know |
10:52:38 | FromDiscord | <Rika> i mean |
10:52:42 | FromDiscord | <Rika> i was talking to shalok |
10:52:47 | FromDiscord | <Clyybber> oh |
10:52:57 | FromDiscord | <Clyybber> yeah search bar doesn't appear for me at all on mobile |
10:53:01 | FromDiscord | <ShalokShalom> I used find in the methods page 🙈 |
10:53:07 | FromDiscord | <Rika> regards me using stable docs, its because i didnt realize devel docs was also built |
10:53:18 | FromDiscord | <Rika> and im too lazy to replace my search box |
10:53:18 | FromDiscord | <ShalokShalom> Like, the build in one from the browser. |
10:53:21 | FromDiscord | <Clyybber> @Rika https://nim-lang.github.io/Nim/manual |
10:53:28 | FromDiscord | <Clyybber> @ShalokShalom gotcha |
10:53:33 | FromDiscord | <Rika> > and im too lazy to replace my search box |
10:53:43 | FromDiscord | <Clyybber> I I don't understand |
10:53:57 | FromDiscord | <Rika> ive known for a while already, im just lazy to switch |
10:54:00 | FromDiscord | <ShalokShalom> Documentation is Nim is complete and overall good |
10:54:02 | FromDiscord | <Clyybber> do you have the nim manual set up as a search engine somehow? |
10:54:05 | FromDiscord | <Rika> docs arent complete |
10:54:20 | FromDiscord | <Clyybber> nothing is ever complete |
10:54:33 | FromDiscord | <Rika> no, i have some jank version of search (basically `https://nim-lang.org/docs/%s.html`) |
10:54:38 | FromDiscord | <Rika> i type down module names |
10:54:42 | FromDiscord | <ShalokShalom> While it had been the reason for my last leave of Nim as a language, since it's so convoluted and unorderly |
10:54:46 | FromDiscord | <Rika> i know most of them by heart already so its not hard for me to remember |
10:55:30 | FromDiscord | <ShalokShalom> It has obviously been grown over the years and grew so big, that it became to big for the structure... All is all over the place. 🙄 |
10:55:41 | FromDiscord | <Clyybber> eh, I think its fine |
10:55:47 | FromDiscord | <Rika> i think it can be better |
10:55:52 | FromDiscord | <ShalokShalom> Yeah, you already know it... |
10:55:55 | FromDiscord | <Clyybber> you can make it better :P |
10:56:04 | FromDiscord | <ShalokShalom> I did suggest this |
10:56:22 | FromDiscord | <ShalokShalom> I actually already had setup some examples and was ready to port it |
10:56:31 | FromDiscord | <Rika> i think they mean you directly contributing code to nim |
10:56:35 | FromDiscord | <Rika> ah |
10:56:36 | FromDiscord | <Rika> what happened? |
10:56:42 | FromDiscord | <ShalokShalom> But Andreas meant in the last minute 'meh' lets leave it that way. |
10:56:42 | FromDiscord | <Clyybber> the issue with docs is that the people who see the problems can't fix them and the people who could fix them don't see the problems |
10:57:09 | FromDiscord | <ShalokShalom> I considered a dedicated docs instance, and also sorting the current version. |
10:57:30 | FromDiscord | <ShalokShalom> Jekyll offers documentation templates |
10:58:02 | FromDiscord | <ShalokShalom> https://vsoch.github.io/docsy-jekyll/ |
10:58:51 | FromDiscord | <ShalokShalom> I could work with you together, since I see lots of potential descriptions being improvable |
10:59:14 | FromDiscord | <ShalokShalom> I just know I dont quite get them, while I have no idea what how to improve them. |
10:59:48 | FromDiscord | <Clyybber> ~improvingdocs is the issue with docs is that the people who see the problems can't fix them and the people who could fix them don't see the problems |
10:59:48 | disbot | improvingdocs: 11the issue with docs is that the people who see the problems can't fix them and the people who could fix them don't see the problems |
11:00:16 | FromDiscord | <Clyybber> just archiving since I like that quote |
11:00:30 | FromDiscord | <ShalokShalom> Yeah, I honestly see myself willing to do that and in cooperation with the community, also able |
11:00:44 | FromDiscord | <Clyybber> what do you want to improve, the styling? |
11:00:45 | FromDiscord | <ShalokShalom> I would study Nim in the process, so its a clear win to me anyway |
11:01:00 | FromDiscord | <ShalokShalom> No, the consistency and that all in in one place |
11:01:09 | FromDiscord | <Clyybber> how is jekyll related though? |
11:01:13 | FromDiscord | <ShalokShalom> Now it feels like hundreds of different sources got collected. |
11:01:35 | FromDiscord | <Clyybber> https://nim-lang.github.io/Nim/lib.html |
11:01:36 | FromDiscord | <ShalokShalom> @Clyybber The webpage is in Jekkyl and Andreas said he would never accept Hugo |
11:01:43 | FromDiscord | <Clyybber> Ah, I see |
11:01:53 | FromDiscord | <ShalokShalom> I would also use any other one that is accepted by the community |
11:02:12 | FromDiscord | <Clyybber> did you see the page I linked? |
11:02:26 | FromDiscord | <ShalokShalom> I really dont care about the underlying technique, more about the readability. |
11:02:30 | FromDiscord | <Clyybber> yeah, I think the tech is fine |
11:02:45 | FromDiscord | <haxscramper> Isn't there an `edit` button for every proc? It tooke me less than ten seconds to edit random documentation - https://github.com/nim-lang/Nim/compare/devel...haxscramper:patch-1 |
11:03:16 | FromDiscord | <ShalokShalom> @Clyybber Yes, this reads interesting and that I have never seen it, suggests its relatively well hidden. |
11:03:24 | FromDiscord | <Clyybber> Heh, nope not at all |
11:03:27 | FromDiscord | <Clyybber> its the second link |
11:03:28 | FromDiscord | <haxscramper> Maybe streamline this process (remove CI checks for documentation patches and automatically assign 'doc patch' label so they can be quickly processed) |
11:03:30 | FromDiscord | <Clyybber> on all pages |
11:03:35 | FromDiscord | <Clyybber> its right below manual |
11:03:39 | FromDiscord | <ShalokShalom> @haxscramper I am not concerned about the editability. |
11:03:51 | FromDiscord | <ShalokShalom> I am concerned about the acceibiltiy. |
11:03:55 | FromDiscord | <Clyybber> You just missed it :) |
11:03:57 | FromDiscord | <ShalokShalom> (edit) 'acceibiltiy.' => 'accessibility.' |
11:04:46 | FromDiscord | <Clyybber> maybe its hidden on mobile tho |
11:04:46 | FromDiscord | <Clyybber> not sure |
11:04:46 | FromDiscord | <ShalokShalom> Yeah, I also missed the documentation for newbies, since I clicked on docs instead on learn. 🙈 |
11:05:01 | FromDiscord | <ShalokShalom> Its just all over the place. |
11:05:16 | * | NimBot joined #nim |
11:05:21 | FromDiscord | <ShalokShalom> Like one, nice documentation |
11:05:39 | FromDiscord | <haxscramper> Something closer to haxe/rust documentation where they have something closer to a book |
11:05:59 | FromDiscord | <ShalokShalom> I also think that being able to link from one place to the other would help. |
11:06:00 | FromDiscord | <Rika> maybe we need to move the more technical info in manual to an actual spec or so |
11:06:21 | FromDiscord | <ShalokShalom> Like in that case, that I just showed about the operators: shl, div and so on. |
11:06:35 | FromDiscord | <haxscramper> Yes, like starting beginner manual with EBNF description of the language is a bit unnecessary IMO |
11:06:35 | FromDiscord | <Yardanico> Current manual is more or less a spec |
11:06:43 | FromDiscord | <ShalokShalom> @haxscramper Yes, totally. |
11:06:44 | FromDiscord | <Yardanico> Well it's not a beginner manual |
11:06:52 | FromDiscord | <Yardanico> It is a complete manual of the language |
11:07:05 | FromDiscord | <Rika> then we need a beginner manual 🙂 |
11:07:35 | FromDiscord | <haxscramper> Separate it into sections that are marked as 'beginner' and 'spec' then. No need to have to separate documents, but splitting current one is probably not that bad of an idea |
11:07:58 | FromDiscord | <haxscramper> *splitting into smaller sections |
11:08:14 | FromDiscord | <Clyybber> > Its just all over the place.↵Its not, its linked together by https://nim-lang.github.io/Nim/lib.html |
11:08:30 | FromDiscord | <Clyybber> We can't accomodate for every link someone might miss |
11:08:34 | FromDiscord | <haxscramper> 'beginner', 'spec', 'advanced' and 'horrible-hacks-with-term-rewriting-macros' |
11:08:39 | FromDiscord | <Rika> LOL |
11:08:57 | FromDiscord | <ShalokShalom> > Something closer to haxe/rust documentation where they have something closer to a book↵@haxscramper This is my goal. And I think both Gitbook and the Jekkyl theme can do that. |
11:09:30 | FromDiscord | <ShalokShalom> I just dont wanna do it, and then it gets rejected 🤷♂️ |
11:09:56 | FromDiscord | <Clyybber> I don't like the book approach |
11:10:04 | FromDiscord | <Clyybber> Sections and scrolling is fine |
11:10:05 | FromDiscord | <ShalokShalom> > then we need a beginner manual 🙂↵@Rika There is one? |
11:10:13 | FromDiscord | <Clyybber> There is a tutorial |
11:10:26 | FromDiscord | <Clyybber> https://nim-lang.org/docs/tut1.html |
11:10:28 | FromDiscord | <ShalokShalom> @Clyybber Youn still have sections and scrolling in books? |
11:10:34 | FromDiscord | <ShalokShalom> Its just more ordered. |
11:10:37 | FromDiscord | <Clyybber> But you have to switch pages |
11:10:40 | FromDiscord | <Clyybber> its unneccessary |
11:10:55 | FromDiscord | <haxscramper> I think this should be a one big rst document but then just split it into several pages when rendering html. Like with org-mode you can write whole website and then present it in chunks with necessary size |
11:10:59 | FromDiscord | <Rika> > I just dont wanna do it, and then it gets rejected 🤷♂️↵@ShalokShalom you can always make one without it being put in the nim repo cant ya? |
11:11:03 | FromDiscord | <ShalokShalom> I dont like that either. But we dont need to do it that way. |
11:11:15 | FromDiscord | <ShalokShalom> @Rika Yes.... Just for myself. |
11:11:18 | FromDiscord | <Clyybber> https://nim-lang.org/docs/tut2.html |
11:11:20 | FromDiscord | <Clyybber> https://nim-lang.org/docs/tut3.html |
11:11:25 | FromDiscord | <Rika> or for other people to link as well |
11:11:42 | FromDiscord | <Clyybber> @ShalokShalom were you aware of these pages? |
11:11:43 | FromDiscord | <ShalokShalom> And then I ask myself, if I truly like to port the whole documentation, just to use it myself. |
11:11:51 | FromDiscord | <ShalokShalom> @Clyybber Yes. |
11:12:03 | FromDiscord | <ShalokShalom> They are one of the most newbie friendly docs I found. |
11:12:13 | FromDiscord | <Clyybber> Hmm, but why do we need to port the whole documentation to something else? |
11:12:21 | FromDiscord | <Clyybber> I don't see how the current one is fundamentally broken |
11:12:24 | FromDiscord | <ShalokShalom> I was already on my way to complain back then and then I found them. |
11:12:27 | FromDiscord | <Clyybber> :D |
11:12:43 | FromDiscord | <Clyybber> Maybe they should be linked below the manual |
11:13:04 | FromDiscord | <ShalokShalom> @Clyybber The documentation is not broken, just its presentation and overall searchability. |
11:13:17 | FromDiscord | <ShalokShalom> Its just a confusing mess now. |
11:13:32 | FromDiscord | <Clyybber> I disagree, I don't get the point about searchability |
11:13:43 | FromDiscord | <Clyybber> we have a search box |
11:13:47 | FromDiscord | <ShalokShalom> Surely not, when I invest couple of hours into it. But this is not, how you get new people on board. |
11:14:04 | FromDiscord | <ShalokShalom> @Clyybber I used that one previously and it yielded millions of results. |
11:14:22 | FromDiscord | <Clyybber> So we should improve the search algo/heuristics |
11:14:28 | FromDiscord | <ShalokShalom> Every single instance of a word or anything gets listed, not by priority. |
11:14:44 | FromDiscord | <ShalokShalom> Yes, that too. And the said implementations have this by default. |
11:15:05 | FromDiscord | <ShalokShalom> Also, Learn/Docs under one tab and Andreas is against this |
11:15:07 | FromDiscord | <Clyybber> Its far more effort to redo the whole docs than to just tweak the existing |
11:15:28 | FromDiscord | <ShalokShalom> While he said also, that he would like the combination prior to that in the forum. |
11:16:04 | FromDiscord | <Clyybber> IMO to improve docs its not necessary to switch doc backends |
11:16:24 | FromDiscord | <Clyybber> So regarding the presentation, how can we improve? |
11:16:35 | FromDiscord | <Clyybber> And do you have some specific pages in mind? |
11:17:09 | FromDiscord | <ShalokShalom> As said: Put them all under one roof. |
11:17:21 | FromDiscord | <ShalokShalom> Not spread across multiple documents. |
11:17:30 | FromDiscord | <Clyybber> Huh? |
11:17:31 | FromDiscord | <ShalokShalom> I want to access all docs from one page. |
11:17:38 | FromDiscord | <Clyybber> But I linked you the page |
11:17:40 | FromDiscord | <ShalokShalom> And links between all important parts. |
11:17:45 | FromDiscord | <Clyybber> which links all stdlib docs |
11:17:54 | FromDiscord | <Clyybber> Theres always a link to the manual |
11:18:01 | FromDiscord | <ShalokShalom> The libs, yes. And this is not, how I imagine it. |
11:18:04 | FromDiscord | <Clyybber> Theres always a link to the stdlib docs |
11:18:16 | FromDiscord | <Clyybber> The thing which I didn't find a link to is the tutorial |
11:18:26 | FromDiscord | <ShalokShalom> I dont know, how you can navigate with that page and nothing else, I cant do it. |
11:18:53 | FromDiscord | <ShalokShalom> The only thing that would really help me, is something like Docsy and Gitbook, personally. |
11:19:20 | FromDiscord | <Clyybber> please list concrete problems, I don't know docsy or gitbook |
11:19:30 | FromDiscord | <ShalokShalom> You already know 80% of the language, I know less than 1% 🤷♂️ |
11:19:54 | FromDiscord | <Clyybber> I mean, I'm a dev, but I started out as you did |
11:19:57 | FromDiscord | <Rika> basically search shit is what im getting from this |
11:20:13 | FromDiscord | <Rika> i mean, search is shit |
11:20:14 | FromDiscord | <Clyybber> yeah, thats noted, but about the presentation part I'm wondering |
11:20:30 | FromDiscord | <Clyybber> @ShalokShalom what does docsy or gitbook do differently? |
11:22:04 | FromDiscord | <Clyybber> I know radare and crystal use gitbook and its cool |
11:22:29 | FromDiscord | <Clyybber> hmm I think I know one thing that would make this section index much nicer |
11:23:02 | FromDiscord | <Clyybber> That is having the section list be "before" the actual text |
11:23:28 | FromDiscord | <Clyybber> I don't know how to say that in terms of webdev but @Rika might know |
11:23:46 | FromDiscord | <Rika> wait what im no web dev |
11:24:01 | FromDiscord | <Clyybber> hmm, actually thats already the case. |
11:24:06 | FromDiscord | <Clyybber> sorry rika :P |
11:24:10 | FromDiscord | <Rika> though i dont understand what you mean anyway |
11:24:17 | FromDiscord | <Rika> so even if i were i wouldnt be able to help |
11:24:42 | FromDiscord | <Clyybber> @ShalokShalom Please look at the docs on desktop, mobile docs I find shitty too :D |
11:25:04 | FromDiscord | <Clyybber> Because they don't have the sidebar with the search box headers and so on |
11:25:12 | FromDiscord | <ShalokShalom> I did start on desktop |
11:25:16 | FromDiscord | <ShalokShalom> Now I am on mobile |
11:25:52 | FromDiscord | <ShalokShalom> @Clyybber Is there anything else next to turning pages, that you dislike about Gitbook? |
11:25:58 | FromDiscord | <Rika> i think the sidebar should scroll with the browser viewpoint |
11:26:15 | FromDiscord | <Rika> or rather the sidebar is not anchored with the docpage |
11:26:43 | FromDiscord | <Clyybber> @ShalokShalom Not really, but I don't see why we would need to replace current docgen with gitbook to fix its presentation |
11:26:55 | FromDiscord | <Clyybber> So thats why I'm bugging you about concrete points :D |
11:28:07 | FromDiscord | <ShalokShalom> Since its not all under one hood |
11:28:23 | FromDiscord | <ShalokShalom> And mainly because the separate points take too much space |
11:28:33 | FromDiscord | <ShalokShalom> Its very spacious, how its now. |
11:29:00 | FromDiscord | <Clyybber> Hmm, do you think it would help to make the sidebar go with scrolling? |
11:29:06 | FromDiscord | <Clyybber> so that its always in view? |
11:29:17 | FromDiscord | <ShalokShalom> https://nim-lang.org/documentation.html |
11:29:39 | FromDiscord | <ShalokShalom> No, I think those points being index entries, small and on the side, that helps. |
11:29:49 | * | Trustable quit (Remote host closed the connection) |
11:30:19 | FromDiscord | <Clyybber> Ah sure |
11:31:24 | FromDiscord | <Clyybber> Yeah, I think that can be improved |
11:31:53 | FromDiscord | <Clyybber> @ShalokShalom For easily nagivating the manual for example, what do you think about making the sidebar always be in view? |
11:32:13 | FromDiscord | <Clyybber> So that you don't have to scroll to the top to search for another section |
11:34:29 | FromDiscord | <ShalokShalom> Which sidebar? |
11:34:49 | FromDiscord | <ShalokShalom> Ah, you mean that one in the desktop view? |
11:34:52 | FromDiscord | <Clyybber> Yeah |
11:34:59 | FromDiscord | <ShalokShalom> Yes, and also making it available on mobile. |
11:35:18 | FromDiscord | <Clyybber> yep agree |
11:35:27 | FromDiscord | <ShalokShalom> Like, by swiping or clicking, while less critical, since most use the desktop, when coding. |
11:35:49 | FromDiscord | <ShalokShalom> Also, sorting it out, so that learn and documentation can be one. |
11:36:08 | FromDiscord | <Clyybber> we should simply link the tutorial in the sidebar |
11:36:14 | FromDiscord | <ShalokShalom> I dont get why switching between the two is senseful, personally. |
11:36:22 | FromDiscord | <ShalokShalom> Yes, you can? |
11:36:29 | FromDiscord | <ShalokShalom> And all the other content? |
11:36:30 | FromDiscord | <Clyybber> there is value in seperating spec and tutorial |
11:37:28 | FromDiscord | <Clyybber> The other stuff doesn't belong IMO |
11:38:49 | FromDiscord | <ShalokShalom> I would more sort the whole thing into categories and subcategories, so we can fit more into less space. |
11:40:10 | FromDiscord | <ShalokShalom> How are those elements called, who are similar to drop down menus, so categories who flip content visible and invisible? |
11:40:21 | FromDiscord | <ShalokShalom> https://nim-lang.org/learn.html |
11:40:40 | FromDiscord | <Clyybber> dropdowns? |
11:40:49 | FromDiscord | <ShalokShalom> Yes |
11:40:49 | * | arecacea1 quit (Remote host closed the connection) |
11:40:55 | FromDiscord | <ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/757929410346090576/Screenshot_2020-09-22-13-40-33-45_3aea4af51f236e4932235fdada7d1643.jpg |
11:41:02 | FromDiscord | <ShalokShalom> This whole page could be one simple line |
11:41:11 | FromDiscord | <ShalokShalom> And not one full page. |
11:41:26 | FromDiscord | <Clyybber> Hey, please look at the desktop layout |
11:41:34 | FromDiscord | <Clyybber> I know mobile is kinda bad |
11:41:35 | FromDiscord | <Clyybber> :D |
11:41:39 | FromDiscord | <ShalokShalom> Yes, it does the same thing |
11:41:46 | FromDiscord | <ShalokShalom> It just has more space to waste |
11:41:59 | FromDiscord | <Rika> one line? i dont see how |
11:42:06 | * | arecacea1 joined #nim |
11:42:07 | FromDiscord | <ShalokShalom> And it overwhelms newbies as well, since there are still so much objects on the screen. |
11:42:15 | FromDiscord | <ShalokShalom> @Rika Community ressources |
11:42:27 | FromDiscord | <ShalokShalom> Click and you see the content that is associated |
11:42:36 | FromDiscord | <Rika> eeh why |
11:42:44 | FromDiscord | <Clyybber> But now instead of scrolling you have to click and then scroll |
11:42:48 | FromDiscord | <ShalokShalom> Because it saves screen space. |
11:43:03 | FromDiscord | <Clyybber> I think reducing the line spacing could help |
11:43:08 | FromDiscord | <ShalokShalom> You would have that all in the sidebar, like Gitbook. |
11:43:14 | FromDiscord | <ShalokShalom> That too. |
11:43:21 | FromDiscord | <Clyybber> But all of that doesn't belong in the sidebar |
11:43:26 | FromDiscord | <Clyybber> some of it are blogs |
11:43:53 | FromDiscord | <ShalokShalom> While its still unnecessary content. I dont stress newbies with lots of documents, they are overwhelmed with. |
11:44:19 | FromDiscord | <Clyybber> who actually gets stressed by information? |
11:44:27 | FromDiscord | <Clyybber> Its not like you *have* to click or read it |
11:44:41 | FromDiscord | <Rika> i dont get it |
11:44:51 | FromDiscord | <Rika> why would this stress someone |
11:45:02 | FromDiscord | <Rika> no one's holding you at gunpoint forcing you to read everything |
11:45:02 | FromDiscord | <Clyybber> I think we could make it smaller, by reducing the space between Header and Description but other than that I think its fine |
11:46:30 | FromDiscord | <ShalokShalom> That would already help |
11:46:38 | FromDiscord | <ShalokShalom> I would still dislike it |
11:46:51 | FromDiscord | <ShalokShalom> > no one's holding you at gunpoint forcing you to read everything↵@Rika My eyes do |
11:47:44 | FromDiscord | <Clyybber> @ShalokShalom I say start with uncontroversial small improvements |
11:47:51 | FromDiscord | <ShalokShalom> > some of it are blogs↵@Clyybber Blogs could get into a dedicated 'Community section' together with the links to social media, since 'Learn and Documentation' could get merged. |
11:47:58 | FromDiscord | <Clyybber> I think this is nim-lang/website territory tho |
11:48:04 | FromDiscord | <ShalokShalom> @Clyybber That fine for sure. |
11:48:06 | FromDiscord | <Clyybber> so you'd have to change that in that repo |
11:48:24 | FromDiscord | <ShalokShalom> Yes, I already had the PRs ready. |
11:48:35 | FromDiscord | <ShalokShalom> That is actually quite easy to manage. |
11:48:40 | FromDiscord | <Clyybber> @ShalokShalom but many learning resources come from the community |
11:48:51 | FromDiscord | <Clyybber> so I'm not sure how much it makes sense to seperate the two |
11:49:01 | * | waleee-cl joined #nim |
11:49:27 | FromDiscord | <ShalokShalom> I also thought about a split between the docs for developing on the language from that one who show you how to use the language and put the dev docs onto the same page as 'source' |
11:49:45 | FromDiscord | <Clyybber> also if its not too much to ask for, include screenshots in the PR description so that people can vote without building the website/docs themselves |
11:49:47 | FromDiscord | <ShalokShalom> So effectively making 'Source' 'Development ' |
11:50:01 | FromDiscord | <ShalokShalom> Yes, good idea. |
11:50:53 | FromDiscord | <Clyybber> Yeah, the fact that internal compiler docs is linked in the sidebar is a bit weird to me |
11:51:01 | FromDiscord | <Clyybber> IMO it should be linked from docs/intern |
11:52:40 | FromDiscord | <ShalokShalom> 👌 |
11:53:32 | FromDiscord | <ShalokShalom> > @ShalokShalom but many learning resources come from the community↵@Clyybber Yeah, Community resources still stay there. I thought you mean regular blogs, unrelated to docs. |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:40 | * | supakeen joined #nim |
12:15:37 | * | shad0w_ joined #nim |
12:26:09 | * | Kaivo quit (Quit: WeeChat 2.9) |
12:39:29 | Oddmonger | what's wrong with putting « --warning[LockLevel]:off » in a task of a nims file ? |
12:39:42 | Oddmonger | the other parameters are accepted, but not this one |
12:39:53 | Oddmonger | Error: invalid command line option: '--warning[LockLevel]' |
12:40:16 | Oddmonger | nothing in the forum about that (and not in google too) |
12:40:41 | FromDiscord | <Clyybber> does it work from the command line? |
12:40:51 | FromDiscord | <Clyybber> I don't see warning[LockLevel] in the list of warnings |
12:40:54 | Oddmonger | it was working in .nim.cfg |
12:41:23 | Oddmonger | and it seems to be real parameter: https://forum.nim-lang.org/t/1394#8680 |
12:41:24 | FromDiscord | <Clyybber> Ah, gotcha |
12:41:43 | FromDiscord | <Clyybber> Use https://nim-lang.github.io/Nim/nimscript#warning%2Cstring%2Cbool |
12:42:24 | Oddmonger | ahhh , thank you |
13:06:37 | * | nyd joined #nim |
13:17:12 | * | Trustable joined #nim |
13:31:27 | * | opal quit (Remote host closed the connection) |
13:32:41 | * | opal joined #nim |
13:35:26 | * | superbia joined #nim |
14:03:11 | Oddmonger | ah … i'd like to set « --hints » on or off , depending of a sentry file put in /tmp. If the sentry file has been accessed less than one minute, hints are off when compiling. But i don't have access to getLastAccessTime from os module, in nimscripts |
14:06:26 | Oddmonger | anyway that's not serious, but i wonder why os module is forbidden from nimscripts |
14:12:53 | * | PMunch quit (Quit: leaving) |
14:13:45 | FromDiscord | <lqdev> it's not |
14:13:58 | FromDiscord | <lqdev> you can do `from os import getLastAccessTime` afaik |
14:14:06 | Oddmonger | oh |
14:15:14 | Oddmonger | still i get : this proc is not available on the NimScript target; usage of 'getLastAccessTime' is an {.error.} defined at … |
14:16:06 | Oddmonger | but maybe that's another problem (i had read some modules were unavailable in nim scripts and took that explaination) |
14:16:24 | Araq | yes, only some procs from os.nim are supported in nimscript |
14:16:39 | Araq | for two reasons: we like to encourage reproducible builds |
14:16:59 | Araq | and it's not always that easy to make the VM support the operation |
14:17:19 | Oddmonger | ok |
14:17:48 | Oddmonger | may be i could parametrize nohint instead |
14:18:29 | Araq | if I wanted a system where everything could be done and nothing understood, I know where to find makefiles and autoconf and config.h files produced from a 40_000 line shell script |
14:18:37 | * | Trustable quit (Remote host closed the connection) |
14:19:43 | Oddmonger | you are hard with Make :) |
14:19:58 | Oddmonger | but i understand your point of view |
14:20:16 | Oddmonger | no need to remake what's already make |
14:20:34 | FromDiscord | <haxscramper> `quote do:` affects line info for all interpolated nodes: is this an intended behaviour that should be worked around using temporary from `copyNimNode` or a bug? https://play.nim-lang.org/#ix=2yoL |
14:21:50 | Araq | Oddmonger: what do you suggest? parametrize hint with what? |
14:23:19 | Oddmonger | i wanted to say with my bad english: passing a parameter when launching compilation, for turning hints on or off. Like: « nim debug --hintsoff project » |
14:23:42 | Oddmonger | for the moment, i'm doing « nim debug project », no parameters for the moment |
14:30:16 | * | sealmove joined #nim |
14:30:46 | sealmove | Is it possible to use `from` and `as` in one `import` statement? |
14:32:15 | * | shad0w_ quit (Remote host closed the connection) |
14:33:08 | Araq | !eval from (strutils as su) import toLowerAscii |
14:33:10 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: invalid module name: '(strutils as su)' |
14:33:20 | Araq | !eval from strutils as su import toLowerAscii |
14:33:22 | NimBot | <no output> |
14:33:40 | Araq | !eval from strutils as su import toLowerAscii; echo toLowerAscii('A') |
14:33:43 | NimBot | a |
14:33:51 | Araq | seems to work fine |
14:33:57 | FromDiscord | <Clyybber> !eval from strutils as su import toLowerAscii; echo su.toLowerAscii('A') |
14:34:00 | NimBot | a |
14:34:17 | Araq | !eval from strutils as su import nil; echo su.toLowerAscii('A') |
14:34:19 | NimBot | a |
14:35:39 | FromDiscord | <slonik_az> sent a long message, see http://ix.io/2yoQ |
14:36:01 | FromDiscord | <slonik_az> I am following nimble docs to the letter |
14:36:11 | FromDiscord | <gour> i'm trying to install wxnim(using nimble), but it says: "Package not found" ? |
14:36:34 | FromDiscord | <shashlick> @slonik_az it's a new features only in devel |
14:36:41 | FromDiscord | <shashlick> What version of Nim you using |
14:38:40 | FromDiscord | <slonik_az> sent a code paste, see https://play.nim-lang.org/#ix=2yoS |
14:38:42 | FromDiscord | <shashlick> Araq: thoughts on https://gist.github.com/genotrance/469a590858cde5c91005aafc8bbcfe81 |
14:40:25 | FromDiscord | <shashlick> @slonik_az that's not the latest - 9/2 |
14:40:38 | Araq | everything you write makes lots of sense, I need to **finally try out** all this new exciting stuff and then I can comment :-) |
14:41:28 | FromDiscord | <shashlick> @slonik_az namedBin was only added on the 11th |
14:42:23 | FromDiscord | <shashlick> Araq: I still need to respond to zah but I'm hoping to solve both his and your requirement with a simpler user workflow |
14:43:39 | FromDiscord | <shashlick> Given 1.4 is around the corner though, I don't think it will be in time - especially since there's no agreement |
14:43:55 | FromDiscord | <shashlick> The other package structure proposal has also stalled |
14:45:48 | FromDiscord | <slonik_az> @shashlick thanks for the help. ↵The nimble docs are totally confusing. The experimental features are not marked as such in the giant REDME file that serves as the documentation on github and is linked from the main nim's doc page for the stable release.↵I installed Nim using recommended `choosenim` route and was expected to get installation that is consistent with the docs found on Nim portal https://nim-lang.org/documentation.ht |
14:45:55 | alehander92 | :) |
14:46:21 | FromDiscord | <shashlick> I agree - no devel vs stable docs |
14:46:34 | FromDiscord | <shashlick> I'll look into it |
14:46:42 | * | arecacea1 quit (Remote host closed the connection) |
14:47:06 | * | arecacea1 joined #nim |
14:47:23 | FromDiscord | <slonik_az> Actually there are dev version of the docs under https://nim-lang.github.io/Nim/ |
14:47:32 | FromDiscord | <alehander42> @haxscramper i think kinda yeah for sets |
14:47:57 | FromDiscord | <alehander42> not super important tho |
14:48:09 | FromDiscord | <shashlick> @slonik_az that's for Nim, not nimble |
14:49:07 | FromDiscord | <alehander42> does someone want to watch me streaming |
14:49:27 | FromDiscord | <slonik_az> @shashlick : you are right |
14:50:35 | Araq | gour: wxnim is not on Nimble |
14:51:24 | FromDiscord | <shashlick> I think nimble also needs a devel vs stable |
14:51:43 | Araq | you need to git clone it yourself, https://github.com/PMunch/wxnim |
14:52:05 | FromDiscord | <Clyybber> @shashlick Do you have a link to your package structure proposal? |
14:52:12 | FromDiscord | <alehander42> ill be https://discord.gg/9kDkaj |
14:52:27 | FromDiscord | <shashlick> https://github.com/nim-lang/nimble/wiki/Package-structure-and-Interop |
14:52:51 | FromDiscord | <haxscramper> > I think kinda yeah for sets↵@alehander42 No, I think this is easy to support actually. Working on it right now. I decided to use `@` for captures always. I think is not really possible in the end to get rid of some kind of prefix for variable capture (because in situation like `fld: enumValue` is it not clear whether `.fld == enumValue` should be generated or `(enumValue = .fld; true)`. Not without type information, which I really |
14:53:36 | FromDiscord | <Clyybber> @alehander42 Huh, how did you create such a link? |
14:53:41 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yoZ |
14:53:48 | FromDiscord | <alehander42> yeah i just shared it somehow |
14:53:49 | FromDiscord | <Clyybber> ah found it! |
14:53:57 | FromDiscord | <haxscramper> Or `Asgn([@lhs is Ident(), @rhs]):` |
14:54:38 | sealmove | I can't figure out how to use block argument syntax with htmlgen macros... |
14:54:40 | FromDiscord | <haxscramper> > not super important tho↵@alehander42 Basic syntax for checking if set contains some value and capturing all 'other' values should be supported I think |
14:55:02 | sealmove | for example `echo h1("Nim")` works fine, but `echo h1: "Nim"` doesn't |
14:55:16 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yp0 |
14:55:49 | FromDiscord | <alehander42> a prfix sounds cool to me |
14:56:36 | FromDiscord | <Clyybber> @shashlick Looks good to me! |
14:56:37 | FromDiscord | <haxscramper> Because we basically have (1) literal values, (2) arrays/sequences, (3) sets, (4) key-value pairs and (5) objects. Should support all of them in one way or another |
14:56:59 | FromDiscord | <Clyybber> @alehander42 Doesn't look like you are streaming tho |
14:57:08 | FromDiscord | <alehander42> huh |
14:57:17 | FromDiscord | <Clyybber> sealmove: Thats an echo issue |
14:57:25 | FromDiscord | <alehander42> well i see it , but i have no idea how |
14:57:28 | FromDiscord | <haxscramper> E.g. `==`, `[idx]`, `in`, `key in table and table[key] == <...>` and `.fld == ` |
14:57:34 | FromDiscord | <alehander42> it's in th right of the screen |
14:57:36 | FromDiscord | <alehander42> for me |
14:57:43 | sealmove | but it's the same problem when trying to save the macro result in a string |
14:57:59 | FromDiscord | <Clyybber> sealmove: Its a problem with the code block syntax |
14:58:22 | FromDiscord | <Clyybber> Its the same reason why `result.add quote: ...` doesn't work |
14:58:31 | FromDiscord | <haxscramper> It works |
14:58:32 | FromDiscord | <Clyybber> and you have to do `result.add quote do: ...` |
14:58:40 | FromDiscord | <haxscramper> Sometimes |
14:59:02 | FromDiscord | <Clyybber> I wanted to fix that for quite some time |
15:00:05 | sealmove | oh, `do` keyword helps, nice |
15:00:46 | Araq | how is it fixable? |
15:01:36 | FromDiscord | <alehander42> @haxscramper sounds ok |
15:01:40 | FromDiscord | <Clyybber> by making it bind to the most recent call |
15:01:49 | FromDiscord | <alehander42> but what do you mean for .a == |
15:01:52 | FromDiscord | <alehander42> isn't it fld: |
15:04:00 | FromDiscord | <alehander42> Araq |
15:04:09 | FromDiscord | <alehander42> i wrote a SeqOfDistinct impl |
15:04:14 | FromDiscord | <alehander42> and it seems useful to me |
15:04:15 | FromDiscord | <haxscramper> `expr.fld == Value` |
15:04:22 | FromDiscord | <alehander42> especially with many handles / indices |
15:04:29 | FromDiscord | <alehander42> so i want to keep it |
15:04:31 | Araq | alehander42: totally agree |
15:04:50 | FromDiscord | <alehander42> ok |
15:04:54 | Araq | keep it and put it into a helper module for all us compiler devs |
15:04:59 | FromDiscord | <alehander42> so happy, i was ready to argue |
15:05:16 | FromDiscord | <alehander42> yeah: about that, that was my plan as well |
15:05:35 | FromDiscord | <alehander42> but it seems to me eventually it can be useful for stdlib too one day, as distinct types are a good practice |
15:05:42 | FromDiscord | <alehander42> but fusion might also be it |
15:05:45 | FromDiscord | <alehander42> anyway this is offtopic |
15:07:35 | * | nyd quit (Quit: nyd) |
15:10:09 | FromDiscord | <alehander42> Araq btw what's the logic for assigning symbol id-s to dot expr fields |
15:10:23 | FromDiscord | <alehander42> as they are not really like separate expressions |
15:10:45 | FromDiscord | <alehander42> it seems Nilable(field: ..) and a.field.a : here i think i get different symbol id-s for field |
15:11:09 | Araq | no idea what you mean |
15:11:29 | Araq | maybe you refer to 'let obj.field = f()' which is introduced by lambda lifting |
15:12:12 | FromDiscord | <alehander42> well e.g. in a.field.a you have a dot expr where you have a nkSym field as well, right |
15:14:19 | FromDiscord | <alehander42> oh man i found it |
15:14:28 | FromDiscord | <alehander42> in a.field.a i have a nkHiddenDeref as well |
15:14:38 | FromDiscord | <alehander42> so that's why i get a different hash |
15:15:41 | FromDiscord | <shashlick> @Clyybber thanks - please feel free to comment on the forum post to get it moving 😄 |
15:19:22 | FromDiscord | <alehander42> so @haxscramper |
15:20:08 | FromDiscord | <haxscramper> yes? |
15:20:41 | FromDiscord | <haxscramper> I'm implementing `*_` right now, maybe in `+-3` hours I will have some kind of finalized syntax description |
15:20:51 | * | Vladar joined #nim |
15:22:06 | * | shad0w_ joined #nim |
15:22:19 | FromDiscord | <alehander42> is it possible that your adblocker somehow prevents it @Clyybber : i read an old forum like https://www.reddit.com/r/discordapp/comments/6ge7bw/cant_connect_to_voice_chat_on_the_browser_version/ |
15:22:34 | FromDiscord | <alehander42> yes so about unification |
15:22:36 | FromDiscord | <haxscramper> Although i would like to use `..` instead. Maybe treat `@a .. @b` to capture variables? |
15:22:42 | FromDiscord | <alehander42> let's say we dont have a: @a, b: @a |
15:22:52 | FromDiscord | <alehander42> then how can i say that i want .a to be equal to .b |
15:22:56 | FromDiscord | <alehander42> even without capturing? |
15:23:22 | FromDiscord | <haxscramper> Use if inside of match arm |
15:25:01 | FromDiscord | <haxscramper> I don't think it is a good idea to mix unification with pattern matching too much. They are really similar, but nim is not a ML/prolog so I'd better leave predicate checking to `if` |
15:26:49 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ypb |
15:27:10 | FromDiscord | <Clyybber> Araq: I take it https://github.com/nim-lang/Nim/pull/15386 is good to merge when its green? |
15:27:11 | disbot | ➥ Fix forward declarations in shadow scope contexts |
15:27:41 | shad0w_ | i have no scope, bot. |
15:27:49 | FromDiscord | <Clyybber> lol |
15:28:19 | Araq | add Cooldome's test too |
15:28:26 | FromDiscord | <Clyybber> Ok |
15:28:35 | Araq | I don't like test overfitting |
15:29:03 | Araq | ("great, the tiny reduced example works now. And in the real world it still doesn't.") |
15:29:08 | FromDiscord | <alehander42> but how would the if |
15:29:15 | FromDiscord | <alehander42> ah it would be just inside |
15:29:19 | FromDiscord | <alehander42> other posibility is jut to |
15:29:29 | FromDiscord | <alehander42> make it (a: @a, b: @b) and a == b |
15:29:41 | FromDiscord | <shashlick> Araq: this is my only pending nimble change - https://github.com/nim-lang/nimble/pull/852 |
15:29:42 | disbot | ➥ Localdeps flag support |
15:29:42 | FromDiscord | <alehander42> and can be a good alternative |
15:30:03 | sealmove | Stupid question again, how do you write this htmlgen block syntax? I can't even find an amountable example on the internet. This doesn't compile: https://play.nim-lang.org/#ix=2ypc |
15:30:05 | FromDiscord | <alehander42> imho for some cases so we dont need to have like nested ifs too much |
15:30:22 | FromDiscord | <haxscramper> It only makes sense to support something like this if you want to make several patterns that just check for equality of internal captures, which is what `if` is for IMO |
15:30:35 | FromDiscord | <Clyybber> Araq: I was wary of including the big one since it loops for a bit |
15:30:40 | FromDiscord | <Clyybber> But I guess its fine |
15:30:47 | Araq | huh? |
15:31:00 | Araq | you can usually reduce the number of loop iterations |
15:32:22 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ypd |
15:33:34 | Araq | haxscramper: symbol injecting macros are really problematic with today's Nim |
15:34:00 | Araq | usually you can test it inside a ' proc g[T](x: T) = ...' to see what I mean |
15:34:29 | FromDiscord | <Clyybber> Araq: Ok, added it. |
15:34:37 | FromDiscord | <Clyybber> Should I attach merge_if_green? |
15:34:39 | Araq | in fact, I consider an interesting, terrible language design problem |
15:36:23 | FromDiscord | <haxscramper> > haxscramper: symbol injecting macros are really problematic with today's Nim↵I didn't have any problems with macro injectsions basically ever. And I certainly have very convoluted combinations of macro-insideof-generic-inside-of-callback-proc |
15:36:39 | FromDiscord | <haxscramper> Like I *really* can't remember any problems at all. |
15:36:51 | Araq | :-) |
15:36:52 | FromDiscord | <haxscramper> With both typed and untyped macros |
15:37:15 | Araq | you're special, ask mratsim for a rant |
15:37:53 | Araq | I wrote a 'unsemAst' proc for typed macros once |
15:38:05 | * | WilhelmVonWeiner quit (Read error: Connection reset by peer) |
15:38:12 | * | WilhelmVonWeiner joined #nim |
15:38:32 | FromDiscord | <haxscramper> Well, I sometimes write code that makes me feel sorry for the compiler, but maybe I just got lucky and somehow dodged everything |
15:38:36 | * | WilhelmVonWeiner is now known as Guest90270 |
15:38:38 | FromDiscord | <mratsim> you called? |
15:39:09 | FromDiscord | <mratsim> I'm not ranting, I'm thoroughly documenting while preparing a generic sandwich |
15:39:37 | Araq | I'm not talking about generic sandwiches |
15:39:46 | FromDiscord | <mratsim> - https://github.com/nim-lang/RFCs/issues/44↵- https://github.com/nim-lang/Nim/issues/8677 |
15:39:47 | disbot | ➥ [Meta] Generics/Static early symbol resolution |
15:40:13 | FromDiscord | <mratsim> No one is allowed to talk about generic swandwich |
15:40:16 | FromDiscord | <mratsim> it's a very secret club |
15:40:45 | FromDiscord | <haxscramper> Oh, youi mean this type of injection. Sorry, for some reason I just thought about `{.inject.}` |
15:41:06 | Araq | bummer |
15:41:23 | FromDiscord | <haxscramper> Yes, I got just destroyed by this when writing nimtrs |
15:41:45 | FromDiscord | <haxscramper> And hparse too. And basically anything that involves iteration over hashset too |
15:42:29 | Araq | yeah yeah, enough of it. :-/ |
15:42:37 | * | Guest90270 quit (Client Quit) |
15:42:52 | * | WilhelmV1nWeiner joined #nim |
15:42:59 | * | shad0w_ quit (Ping timeout: 240 seconds) |
15:42:59 | FromDiscord | <shashlick> Araq: looks like nimterop is passing all tests with `--gc:arc -d:useMalloc` |
15:43:48 | FromDiscord | <alehander42> hmmmm |
15:43:55 | FromDiscord | <alehander42> but and is a good escape hatch |
15:44:19 | * | gour_ joined #nim |
15:44:22 | Araq | haxscramper: so ... any ideas? |
15:45:08 | * | WilhelmV1nWeiner quit (Client Quit) |
15:45:22 | Araq | I think one problem is 'untyped' is simply the wrong thing. |
15:45:24 | FromDiscord | <haxscramper> About symbol injection? None. I'm not really familiar with compiler to comment on anything like that yet. |
15:45:52 | Araq | forget about the compiler, how do we write DSLs that compose better |
15:46:41 | * | sagax quit (Remote host closed the connection) |
15:46:41 | FromDiscord | <haxscramper> Be very careful when choosing DSL primitives, preferrably enhance existing language constructs instead of inventing new ones |
15:47:22 | FromDiscord | <haxscramper> I can plug things inside of `case` easily because it is just an advanced version of default language construct |
15:47:44 | Araq | you cannot introduce variable bindings via '@x' |
15:48:02 | FromDiscord | <mratsim> @ is taken for seq conversion btw |
15:48:02 | * | gour quit (Ping timeout: 258 seconds) |
15:48:05 | FromDiscord | <alehander42> but with @Araq you maybe can! |
15:48:28 | FromDiscord | <haxscramper> > @ is taken for seq conversion btw↵@mratsim isn't it just an operator with couple overloads? |
15:48:34 | FromDiscord | <mratsim> yes |
15:48:40 | FromDiscord | <alehander42> ->a might be a good dsl |
15:48:45 | FromDiscord | <alehander42> b: ->a |
15:48:48 | FromDiscord | <mratsim> a "T" overload I think |
15:49:10 | FromDiscord | <alehander42> even ruby added -> i think |
15:49:15 | FromDiscord | <mratsim> ah maybe not |
15:49:16 | FromDiscord | <alehander42> so its not super rare |
15:49:21 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ypk |
15:49:22 | FromDiscord | <mratsim> you need to do @[foo] |
15:49:25 | Araq | ->a is ugly but that's all that the point |
15:49:29 | Araq | *all not |
15:49:34 | FromDiscord | <haxscramper> Which one? I think `.._` is better |
15:49:40 | Araq | argh |
15:49:42 | * | Araq dies |
15:49:43 | FromDiscord | <alehander42> no, ruby added `=>` |
15:49:57 | FromDiscord | <shashlick> Araq: tests still fail without `-d:useMalloc` but there's a dll load involved |
15:50:03 | FromDiscord | <mratsim> ~> is better :p |
15:50:03 | disbot | >: 11better :p |
15:50:15 | FromDiscord | <haxscramper> `*&$#&(*@&($` |
15:50:15 | FromDiscord | <alehander42> no @haxscramper i mean `->` instead of `@a` |
15:50:18 | FromDiscord | <mratsim> >~> |
15:50:27 | FromDiscord | <alehander42> but i kinda think we need a way to bind |
15:50:31 | FromDiscord | <shashlick> Araq: I also updated that issue stating how nimrtl cannot be compiled today with gc:arc |
15:50:35 | * | Kaivo joined #nim |
15:50:38 | FromDiscord | <alehander42> and how to do it with `lhs =` ? |
15:50:43 | FromDiscord | <mratsim> can't we just reuse the "bind" keyword |
15:50:58 | Araq | shashlick, yeah, will work on it after 1.2.x is out |
15:51:05 | FromDiscord | <alehander42> A(a = b:, c: 4) ? |
15:51:13 | FromDiscord | <mratsim> I don't like how "distinct" is reused but here it seems like there is no ambiguity |
15:51:16 | FromDiscord | <alehander42> A(a = b: _, c: 4) |
15:51:20 | FromDiscord | <alehander42> hm, maybe |
15:52:00 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ypr |
15:52:47 | FromDiscord | <alehander42> i imagined it more `->ident`, but this probably better |
15:52:48 | * | thomasross joined #nim |
15:52:58 | FromDiscord | <alehander42> but thhe other posibilities ssemsto be |
15:52:58 | FromDiscord | <haxscramper> Spacing is irrelevant |
15:53:04 | FromDiscord | <mratsim> ah regarding symbol resolution, bind many, bind once is also a fun one to read on https://github.com/nim-lang/RFCs/issues/153 |
15:53:06 | disbot | ➥ Use a keyword different from `distinct` for `bind many` behaviour ; snippet at 12https://play.nim-lang.org/#ix=2yps |
15:53:41 | FromDiscord | <alehander42> we can have also `A(a = a: _, b: 2) |
15:53:44 | FromDiscord | <alehander42> (edit) '2)' => '2)`' |
15:53:53 | FromDiscord | <alehander42> and A(a: bind a, b: 2) |
15:53:54 | FromDiscord | <haxscramper> I will just use `const pattVarPrefix {.strdefine.}: string = "->"` |
15:54:13 | FromDiscord | <alehander42> noo we dont want everyone to use his own binding syntax imho |
15:54:31 | FromDiscord | <haxscramper> > we can have also `A(a = a: _, b: 2)`↵@alehander42 `Error: expected: ')', but got: ':'` |
15:54:45 | FromDiscord | <alehander42> yeah, but a parser fix can make it work |
15:54:59 | FromDiscord | <alehander42> and it seems Araq is ok with parser fixes for the matching |
15:55:10 | FromDiscord | <haxscramper> No. no parser fixes for simple macro dsl, this is just overkill I think |
15:55:17 | FromDiscord | <alehander42> but it's not about this only |
15:55:19 | Araq | no, I'm not |
15:55:22 | FromDiscord | <alehander42> but for "better dsls" |
15:55:28 | FromDiscord | <alehander42> ok, i just remembered a comment |
15:55:34 | FromDiscord | <alehander42> but maybe it was only about guards |
15:55:45 | FromDiscord | <alehander42> well then how can we have binding with `=` |
15:55:55 | FromDiscord | <alehander42> we'd need a different syntax in dsl-s |
15:56:01 | Araq | I'm talking about the general 'it' problem, how do we know that 'mapIt(it == 3)' introduces the 'it' symbol |
15:56:33 | FromDiscord | <alehander42> yeah but here the dsl usr introduces it in case |
15:56:34 | disruptek | hope. |
15:56:35 | FromDiscord | <haxscramper> `a = fld: patt()` is the same as `fld: @a is patt()` or `fld: -> a is patt()` |
15:56:36 | Araq | how do we know that '@@x' (for example!) introduces a new local variable x inside the pattern matching macro |
15:56:47 | FromDiscord | <alehander42> which is a bit different than mapIt where the macro always does |
15:57:11 | FromDiscord | <alehander42> disruptek hope is good |
15:57:20 | Araq | and do we need to know this? |
15:57:28 | disruptek | nope. |
15:57:51 | FromDiscord | <alehander42> we do: but for now documentation + convention |
15:57:56 | FromDiscord | <haxscramper> > how do we know that '@@haxscramper' (for example!) introduces a new local variable x inside the pattern matching macro↵this is the same as `mapIt`, `foldl` and others. `re.=~`. Just write in documentation that `@XXX` creates variable with type of matched field |
15:57:56 | FromDiscord | <alehander42> seem ok-ish |
15:58:11 | FromDiscord | <alehander42> the point is to be something that most dsl-s can reuse as convention |
15:58:20 | disruptek | why do you think we need to know? |
15:58:27 | FromDiscord | <alehander42> maybe even something checkable with a tool |
15:58:43 | FromDiscord | <haxscramper> `@XXX` is good enough. Already used for all pattern matching libraries in nim |
15:58:54 | Araq | disruptek: because of the open/closed symbol lookups inside generic code |
15:58:55 | FromDiscord | <alehander42> "does this expansion produces locals not annotated like @ or ->" |
15:59:09 | FromDiscord | <alehander42> or "not annotated in its pragma" |
15:59:25 | disruptek | it should be valud code if `it` is not a thing. what else? |
15:59:33 | FromDiscord | <alehander42> mapIt can have metainfo in its declaration |
16:00:04 | disruptek | i mean, if you omit it, thats fine, no? |
16:00:10 | FromDiscord | <haxscramper> > maybe even something checkable with a tool↵I'm porting https://hal.archives-ouvertes.fr/hal-01054552/document to nim. I want to write too that does ast diffing for old source code and compiled one |
16:00:43 | Araq | template foo() = let x = 3 # ok, 'x' is gensym'ed. We can do this because we understand 'let' |
16:01:04 | FromDiscord | <alehander42> very cool, i had in mind something more specific tho |
16:01:05 | Araq | template mylet(name, x) = let name = x; template foo() = mylet(x, 3) # er... |
16:01:21 | FromDiscord | <alehander42> something that just plugs in expansion pass and detects locals which are producd |
16:01:21 | FromDiscord | <haxscramper> Is it possible to use effect for this? |
16:01:44 | Araq | that's the design problem I'm talking about |
16:02:09 | FromDiscord | <alehander42> hmm |
16:05:10 | Araq | one option would be to have (let x) as a construct that introduces 'x', mapIt(let it, it == 0) |
16:05:54 | Araq | or one or more operators that do the same. these have to be built into the language |
16:08:47 | * | snowolf quit (Remote host closed the connection) |
16:11:09 | FromDiscord | <alehander42> but why for mapIt |
16:11:23 | FromDiscord | <alehander42> this makes sense for stuff that generates various symbols |
16:11:34 | FromDiscord | <alehander42> but mapIt can just have a pragma {.gen: ["it"].} |
16:11:51 | FromDiscord | <alehander42> and the compiler can know it whenever it needs to (or is it about code readability) |
16:12:15 | Araq | mapIt can be specialized as you outlined |
16:12:27 | Araq | but now the same problem comes up for pattern matching |
16:12:39 | FromDiscord | <alehander42> yes, I agree |
16:13:12 | FromDiscord | <alehander42> hm, so stuff like |
16:13:19 | FromDiscord | <alehander42> A(a: let local) ? |
16:13:46 | FromDiscord | <alehander42> or `of let local, A(a: local)` |
16:13:54 | FromDiscord | <alehander42> i cant really see it working with the current syntax |
16:13:59 | FromDiscord | <alehander42> if it's not an op |
16:14:42 | FromDiscord | <alehander42> but cant the compiler just write down the newly generated local symbols automatically while expanding |
16:14:54 | * | snowolf joined #nim |
16:15:11 | Araq | the problem is that in an 'untyped' context there is no expansion |
16:16:37 | FromDiscord | <alehander42> eh, there is some step where one replaces the old ast with the result of the macro |
16:16:50 | FromDiscord | <alehander42> but yeah doesnt make sense |
16:17:17 | FromDiscord | <alehander42> what i imagind was filtring |
16:17:24 | FromDiscord | <alehander42> the untyped output for stuff like var and let sections |
16:17:38 | FromDiscord | <alehander42> and just annotating that those idents are "new" |
16:17:51 | sealmove | is there a proc to prettify html? |
16:19:40 | FromDiscord | <haxscramper> Maybe annotate all elements that might generate identifiers with `gen`? Like `quote do:` etc. and make it a compilation error if new identifier is introduced in generated code? Although it won't work with things like `ident("UserDefinedInput")` - e.g. actual name of the variable won't be known in general |
16:21:23 | FromDiscord | <haxscramper> Some kind of ast fingerprinting to differentiate between generated and user-provided one and check only generated |
16:23:47 | FromDiscord | <alehander42> yeah the compiler knows enough to recognize new ident decls |
16:24:15 | FromDiscord | <alehander42> even without any annotation |
16:25:13 | * | WilhelmV1nWeiner joined #nim |
16:27:06 | * | WilhelmV1nWeiner is now known as WilhelmVonWeiner |
16:33:01 | FromDiscord | <haxscramper> In case if I match `IfStmt([*ElseIf([_, @bodies]), @bodies])` it is logical to expect `@bodies` to be a seq of all nodes. |
16:33:37 | FromDiscord | <haxscramper> Support for optional captures is a good idea? `[_, ?@secondElement]` where it would be injected as `Option[]` |
16:34:31 | FromDiscord | <alehander42> yeah, optionals sound good, but not sure if they are easy to support |
16:34:39 | FromDiscord | <haxscramper> Pretty easy |
16:34:53 | FromDiscord | <alehander42> but actually often i'd want a default or value |
16:35:03 | FromDiscord | <alehander42> because option requires me to do additional match |
16:35:06 | FromDiscord | <alehander42> but yeah |
16:35:41 | FromDiscord | <haxscramper> `IfStmt([*ElseIf([_, @bodies]), newEmptyNode() ?@ bodies])` looks good? |
16:36:15 | FromDiscord | <haxscramper> https://github.com/haxscramper/nimtrs#regex-like-pattern-matching-termpattern |
16:36:35 | FromDiscord | <alehander42> it's a cool thing to have |
16:36:50 | FromDiscord | <haxscramper> E.g. 'search until' for variadic patterns? |
16:37:06 | FromDiscord | <alehander42> but i wonder if other people might |
16:37:09 | FromDiscord | <alehander42> expect unification |
16:37:25 | FromDiscord | <alehander42> e.g. A(a: @b, b: @b) where |
16:37:27 | FromDiscord | <alehander42> those are seq-s |
16:38:36 | FromDiscord | <haxscramper> Well, I can just die with long error message about how we don't support unification. Variable is either a seqence (has been used at least once in variadic context) or a single instance. If this is a single instance it should be used only once |
16:38:41 | FromDiscord | <haxscramper> Although ... |
16:38:52 | FromDiscord | <alehander42> yeah but if they are both seq-s |
16:40:37 | FromDiscord | <alehander42> Araq i hit many bugs running it on stdlib/test you said |
16:40:42 | FromDiscord | <alehander42> thanks, a good way to test it |
16:41:03 | FromDiscord | <alehander42> going out for a travel to Plovdiv |
16:41:07 | FromDiscord | <alehander42> bbl 🙂 |
16:41:15 | FromDiscord | <haxscramper> Alright I will try to have variadic patterns, alternatives and unification but for some reasone I'm not sure if this is really simple |
16:41:46 | * | D_ quit (Remote host closed the connection) |
16:42:42 | * | D_ joined #nim |
16:48:06 | * | shad0w_ joined #nim |
16:48:51 | * | shad0w_ quit (Remote host closed the connection) |
17:01:13 | * | sagax joined #nim |
17:02:13 | * | a_chou joined #nim |
17:07:28 | * | a_chou quit (Remote host closed the connection) |
17:10:49 | FromDiscord | <Avatarfighter> Ello party people what is up |
17:11:05 | * | Ergpopler joined #nim |
17:11:11 | Ergpopler | AYOOO |
17:11:14 | * | lmariscal joined #nim |
17:11:19 | Ergpopler | anyone here |
17:11:28 | FromDiscord | <Avatarfighter> ya whats up |
17:11:45 | Ergpopler | damn IRC pretty fire ngl |
17:12:16 | Ergpopler | Konversation |
17:30:34 | * | mmohammadi9812 joined #nim |
17:36:35 | FromDiscord | <exelotl> I'm on quassel following yardanico's recommendation (but I don't use it for #nim since I already have discord for that) |
17:37:43 | FromDiscord | <exelotl> My verdict is: quassel desktop client is kinda garbage, but quasseldroid is the best client ever. xD |
17:37:49 | Oddmonger | i'm sure i can have a proc in a table… but how ? https://play.nim-lang.org/#ix=2yq9 |
17:39:03 | FromDiscord | <lqdev> it's `proc ()` not `proc` |
17:39:27 | FromDiscord | <lqdev> `proc` is a generic type that matches any proc with any formal params |
17:39:36 | Oddmonger | ohhh |
17:39:44 | Oddmonger | omg |
17:39:47 | Oddmonger | thank you |
17:40:30 | FromDiscord | <lqdev> i'd recommend that you put the proc type in a typedef tho, otherwise it can get messy real quick with a lot of repetition |
17:40:42 | FromDiscord | <lqdev> unless it's only used once ofc |
17:41:49 | Oddmonger | hum i think i'm going nowhere with this table…maybe there are better options for linking a parameter to an action |
17:42:40 | Oddmonger | the error message is even funnier than before |
17:43:46 | * | solitudesf quit (Read error: Connection reset by peer) |
17:44:05 | FromDiscord | <Avatarfighter> what are you trying to do oddmonger? |
17:44:09 | * | solitudesf joined #nim |
17:44:56 | Oddmonger | i want to parse command line, and being able to display recognized commands |
17:45:10 | Oddmonger | so the same table for parsing and displaying help |
17:45:57 | FromDiscord | <Avatarfighter> so based on the inputs you're calling a proc in a table? |
17:47:17 | * | confundus joined #nim |
17:47:19 | Oddmonger | yes |
17:49:53 | Oddmonger | my best try: https://play.nim-lang.org/#ix=2yqc |
17:50:52 | * | confundus quit (Client Quit) |
17:54:53 | * | natrys joined #nim |
17:55:32 | FromDiscord | <lqdev> what's the error? |
17:56:55 | Oddmonger | rror: type mismatch: got <array[0..0, tuple of (string, proc (){.locks: 0.})]> |
17:56:56 | Oddmonger | but expected one of: |
17:56:58 | Oddmonger | proc (pairs: openArray[tuple of (string, fx)]): Table[system.string, in.fx]{.noSideEffect, locks: <unknown>.} |
17:57:37 | * | natrys quit (Client Quit) |
17:57:50 | Oddmonger | if it expects a function with no side effects, it won't work anyway (as my function sets global var) |
17:58:25 | * | natrys joined #nim |
18:08:09 | FromDiscord | <lqdev> odd |
18:08:54 | * | oculuxe joined #nim |
18:09:42 | * | oculux quit (Ping timeout: 265 seconds) |
18:10:59 | Oddmonger | at least it's not a stupid error (errrm … i hope) |
18:16:26 | Zevv | Clyybber. I'm so sorry, but I hate it :/ |
18:17:28 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
18:20:33 | * | sealmove quit (Quit: WeeChat 2.8) |
18:33:40 | disruptek | hate what? |
18:34:40 | FromDiscord | <Clyybber> Zevv: I know :D |
18:34:47 | FromDiscord | <Clyybber> And I understand you |
18:35:01 | FromDiscord | <Clyybber> disruptek: My npeg PR |
18:35:19 | FromDiscord | <Clyybber> disruptek: this one https://github.com/zevv/npeg/pull/26 |
18:35:19 | disbot | ➥ Allow capturing on the LHS of a rule definition |
18:36:11 | * | arecacea1 quit (Remote host closed the connection) |
18:36:52 | * | arecacea1 joined #nim |
18:40:16 | * | Zectbumo joined #nim |
18:43:21 | * | mmohammadi98122 joined #nim |
18:43:39 | * | mmohammadi98122 quit (Client Quit) |
18:44:05 | * | mmohammadi9812 quit (Ping timeout: 240 seconds) |
18:45:35 | * | gmaggior joined #nim |
18:51:33 | FromDiscord | <Clyybber> disruptek: do you like that? :D |
18:55:40 | * | gour_ quit (Remote host closed the connection) |
19:02:34 | Zevv | I hate all of it |
19:02:58 | Zevv | I'll merge it if you promise not to tell anyone npeg can do that |
19:04:07 | FromDiscord | <Nisha (LGBTQ+)> Heya everyone, could you guys give me the repos of all of the websocket libs you know of? |
19:04:14 | * | sealmove joined #nim |
19:04:30 | Zevv | and if you refactor the duplicate code inside parseGrammar |
19:04:36 | Zevv | just put it into a nested proc or something |
19:09:21 | * | mmohammadi9812 joined #nim |
19:10:03 | FromDiscord | <Clyybber> Yeah, locally I have a TODO there |
19:10:15 | FromDiscord | <Nisha (LGBTQ+)> :P |
19:10:29 | FromDiscord | <Clyybber> @Nisha (LGBTQ+) I know theres treeform/ws |
19:10:35 | FromDiscord | <Clyybber> Other than that I don't know any :D |
19:10:48 | FromDiscord | <Nisha (LGBTQ+)> Alright, thanks :P |
19:15:10 | * | narimiran quit (Ping timeout: 246 seconds) |
19:15:37 | * | sealmove quit (Quit: WeeChat 2.8) |
19:22:25 | disruptek | clyybber: if zevv says it's bad, it's bad. |
19:27:31 | * | vicfred quit (Quit: Leaving) |
19:29:48 | FromDiscord | <Clyybber> Heh |
19:30:38 | FromDiscord | <Clyybber> Zevv: I pushed a change, I first put it into a nested proc but in the end I typed more than I saved so I do it differently now |
19:31:31 | FromDiscord | <Clyybber> let me know if it fits your coding style |
19:36:02 | FromDiscord | <Clyybber> and I promise I won't tell anyone (except for Yardanico :) |
19:39:58 | * | FromDiscord quit (Remote host closed the connection) |
19:40:12 | * | FromDiscord joined #nim |
19:40:24 | * | FromDiscord quit (Remote host closed the connection) |
19:40:37 | * | FromDiscord joined #nim |
19:40:49 | * | FromDiscord quit (Remote host closed the connection) |
19:41:02 | * | FromDiscord joined #nim |
19:41:27 | * | FromDiscord quit (Remote host closed the connection) |
19:41:40 | * | FromDiscord joined #nim |
19:42:21 | * | FromDiscord quit (Remote host closed the connection) |
19:42:39 | * | FromDiscord joined #nim |
19:46:59 | * | Ergpopler quit (Ping timeout: 240 seconds) |
20:01:18 | * | gmaggior quit (Ping timeout: 260 seconds) |
20:03:08 | * | jacereda joined #nim |
20:03:09 | jacereda | Hi |
20:03:13 | jacereda | is there a clean way to handle converting a set of enum flags into a bitflags type? Something like expressing that any of the enum flags are implicitly convertible to the bitflags type? |
20:09:02 | * | vicfred joined #nim |
20:14:12 | * | gmaggior joined #nim |
20:31:19 | Zevv | clyybber: fair enough, I'll merge the change but not the test. otherwise people might realize this is possible and use ut |
20:34:02 | * | waleee-cl joined #nim |
20:39:50 | Zevv | https://github.com/zevv/npeg/commit/fc986c00b541e723fc5e1536872a01b7c074f351 |
20:40:32 | Zevv | is that cool or what. That you just can type `>patt` in nim and that's also valid. |
20:46:18 | disruptek | clyybber: would you really merge this shit if it were your project? |
20:46:44 | * | Jjp137 quit (Quit: Leaving) |
20:47:00 | * | Jjp137 joined #nim |
20:47:15 | * | haxscramper quit (Remote host closed the connection) |
20:48:16 | disruptek | jacereda: cast[int](flags); give your enum the {.size: sizeof(cint).} ... all this is in the manual. |
20:48:19 | disruptek | ~manual |
20:48:20 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
20:54:43 | * | opal quit (Ping timeout: 240 seconds) |
20:56:27 | jacereda | disruptek: I don't want to use casts, anyways, krux02 gave me the solution, just use set[] |
20:57:00 | * | Trustable joined #nim |
21:08:03 | * | Vladar quit (Remote host closed the connection) |
21:21:38 | disruptek | you don't need to cast if you follow the manual. |
21:27:28 | FromGitter | <Lecale> Why did I decide to convert something from python to nim when I don't know python? |
21:35:34 | * | mmohammadi9812 quit (Quit: I quit (╯°□°)╯︵ ┻━┻) |
21:40:12 | * | Kaivo quit (Quit: WeeChat 2.9) |
21:48:05 | * | solitudesf quit (Ping timeout: 240 seconds) |
21:50:19 | * | natrys quit (Quit: natrys) |
22:04:27 | * | fowl quit (Ping timeout: 240 seconds) |
22:05:23 | * | NimBot joined #nim |
22:09:07 | * | Trustable quit (Remote host closed the connection) |
22:23:10 | * | gmaggior quit (Ping timeout: 260 seconds) |
22:36:03 | * | gmaggior joined #nim |
22:40:25 | FromGitter | <deech> Superficial thing but have trailing commas been discussed? |
23:21:51 | * | Zectbumo quit (Remote host closed the connection) |
23:22:34 | disruptek | for what? echo? |
23:23:20 | * | Zectbumo joined #nim |
23:25:48 | * | opal joined #nim |
23:35:36 | FromGitter | <deech> eg. `@[1,2,3,]` |
23:47:04 | * | jacereda left #nim ("ERC (IRC client for Emacs 27.1)") |
23:55:35 | disruptek | that's permitted afaik. |
23:57:02 | FromGitter | <deech> I'll be damned. It does for seqs, could have sworn I ran into a case with collections where it didn't. |