00:04:25 | * | gmaggior quit (Ping timeout: 260 seconds) |
00:06:42 | disruptek | i always thought of it as a sugarfree sweetener. |
00:15:07 | Yardanico | but it's sugar |
00:15:10 | Yardanico | 🤔 |
00:15:33 | Yardanico | is word "sugar" offensive to people with diabetes |
00:16:20 | Prestige | haha |
00:16:26 | * | gmaggior joined #nim |
00:19:07 | * | ElegantBeef quit (Remote host closed the connection) |
00:27:49 | FromDiscord | <ElegantBeef> https://github.com/beefytech/Beef/issues/14 |
00:27:50 | disbot | ➥ Project name and logo can hurt people's sensibilities |
00:27:53 | FromDiscord | <ElegantBeef> Beeflang has similar issues 😄 |
00:28:41 | disruptek | i went through the same shit when i launched bigdickdigital.com. |
00:28:45 | Yardanico | @ElegantBeef HAHAHHA |
00:28:48 | Yardanico | this is same as rubocop |
00:28:51 | disruptek | buncha pussies. |
00:28:58 | Yardanico | exactly |
00:29:11 | Yardanico | https://github.com/rubocop-hq/rubocop/issues/8091 |
00:29:12 | disbot | ➥ Is it time to change the name? |
00:29:13 | Yardanico | https://metaredux.com/posts/2020/06/08/the-rubocop-name-drama-redux.html |
00:29:15 | Yardanico | https://timriley.info/writing/2020/06/08/rubyists-we-must-do-better/ |
00:29:30 | Yardanico | @ElegantBeef ^ |
00:29:57 | FromDiscord | <ElegantBeef> It's such a non solution and it hurts |
00:30:27 | FromDiscord | <ElegantBeef> Like if the project was name `racialSlur#2321` then yea obviously it should be changed cause you're actively being a cunt |
00:31:45 | FromDiscord | <krabbypatty> why can't I do `from std/with import with` |
00:32:46 | Yardanico | you can though? |
00:33:00 | Yardanico | ah nvm |
00:33:12 | FromDiscord | <krabbypatty> Error: undeclared identifier: 'with' |
00:33:33 | Yardanico | yeah you can report it |
00:33:48 | FromDiscord | <krabbypatty> ok I'll open an issue |
00:33:51 | Yardanico | but anyway you wouldn't see "from x import y" imports often |
00:34:03 | FromDiscord | <krabbypatty> I use those exclusively :p |
00:34:05 | Yardanico | because nim is statically compiled and all ambiguity is resolved at compile-time |
00:34:18 | Yardanico | and any normal editor with a nim plugin supports go to definition/etc |
00:34:34 | FromDiscord | <krabbypatty> github doesn't |
00:34:41 | Yardanico | github isn't a good editor |
00:34:48 | Yardanico | believe it or not :) |
00:34:52 | FromDiscord | <krabbypatty> people use github for code reviews |
00:34:57 | Yardanico | that's their fault :P |
00:35:15 | Yardanico | but really you'll see that most nim programmers just know where stuff comes from |
00:35:19 | Yardanico | by looking at code |
00:35:37 | Yardanico | also "from x import y" breaks ufcs |
00:35:40 | FromDiscord | <krabbypatty> 🤷♂️ I highly dislike it |
00:35:42 | FromDiscord | <krabbypatty> no it doesn't |
00:35:44 | Yardanico | it does lol |
00:35:46 | Yardanico | in full |
00:35:47 | FromDiscord | <krabbypatty> how so |
00:36:17 | FromDiscord | <krabbypatty> from sequtils import mapIt |
00:36:19 | Yardanico | from sequtils import mapIt; let a = @[1, 2, 3]; echo a.mapIt(it + 3) |
00:36:21 | Yardanico | simplest example |
00:36:21 | FromDiscord | <krabbypatty> @[1,2,3].mapIt |
00:36:24 | FromDiscord | <krabbypatty> yeah |
00:36:25 | FromDiscord | <krabbypatty> that works |
00:37:35 | Yardanico | well anyway you can use that syntax if you want |
00:37:40 | Yardanico | just know that most nim programmers dislike it |
00:37:44 | Yardanico | in general |
00:37:46 | FromDiscord | <krabbypatty> lol |
00:37:50 | FromDiscord | <krabbypatty> no new language I know of does this |
00:37:56 | FromDiscord | <krabbypatty> import is an antipattern everywhere |
00:38:01 | Yardanico | why should it be ? |
00:38:03 | FromDiscord | <ElegantBeef> Not many languages usu UFCS |
00:38:05 | FromDiscord | <ElegantBeef> (edit) "usu" => "use" |
00:38:07 | Yardanico | we have proper export/import |
00:38:18 | FromDiscord | <krabbypatty> what does UFCS have to do with import |
00:38:26 | Yardanico | @krabbypatty please read https://narimiran.github.io/2019/07/01/nim-import.html |
00:38:27 | FromDiscord | <krabbypatty> I still use UFCS and I type out all my imporst explicitly |
00:38:29 | Yardanico | please |
00:38:45 | Yardanico | yeah ufcs will work with "from x import y" |
00:38:48 | Yardanico | not with "from x import nil" |
00:38:53 | Yardanico | the same as "import x" in python |
00:39:21 | FromDiscord | <krabbypatty> i'm not advocating for the second |
00:39:22 | Yardanico | I just want to look at your code when you'll have tens of "from x import y, z, x" statements |
00:39:24 | FromDiscord | <ElegantBeef> C# is the same as nim in the regard of importing all exposed symbols |
00:39:37 | FromDiscord | <krabbypatty> Yes, I have tens of those |
00:39:49 | Yardanico | yeah that makes me cry internally :) |
00:39:52 | FromDiscord | <krabbypatty> And those are trivial for tooling to add manially |
00:39:55 | FromDiscord | <krabbypatty> Automatically |
00:40:07 | Yardanico | same goes for normal imports |
00:40:20 | Yardanico | but it's far from trivial really |
00:40:23 | Yardanico | nim has macros/templates/etc |
00:40:29 | FromDiscord | <krabbypatty> So the same argument for "tooling can find definitions in your editor" goes to "tooling can add imports automatically based on call site" |
00:40:40 | Yardanico | but it's not limited to "from x import y" |
00:40:48 | Yardanico | it will work just fine for normal imports then |
00:41:01 | Yardanico | because the tooling will still to know all procs available in a module |
00:41:09 | Yardanico | and just add "import module" if a proc is used |
00:41:25 | FromDiscord | <krabbypatty> I'm saying tooling could add `from sequtils import map` |
00:41:26 | Yardanico | anyway, you're free to use "from x import y", snake_case, or something else, but I personally don't like that :) |
00:41:32 | Yardanico | @krabbypatty same for "import x" |
00:41:35 | FromDiscord | <krabbypatty> when you type map<TAB> in your editor |
00:41:47 | FromDiscord | <krabbypatty> typescript is a perfect example of this |
00:41:51 | Yardanico | same goes for normal imports |
00:41:55 | FromDiscord | <krabbypatty> yes |
00:41:55 | Yardanico | there would be no difference |
00:41:59 | FromDiscord | <krabbypatty> there is |
00:42:02 | FromDiscord | <krabbypatty> when you don't have tooling |
00:42:05 | Yardanico | and please read the article I linked |
00:42:06 | FromDiscord | <krabbypatty> and for new developers |
00:42:10 | FromDiscord | <krabbypatty> I will |
00:42:47 | Yardanico | just know that nim code usually doesn't have "from x import y" |
00:42:52 | FromDiscord | <krabbypatty> but when you don't have tooling, and that is much more common than you're claiming (e.g. code reviews on github/gitlab/bitbucket, using cat on a terminal, etc etc), the implicit imports are much more useful |
00:43:01 | FromDiscord | <krabbypatty> explicit |
00:43:03 | Yardanico | I'm doing code reviews for nim PRs just fine |
00:43:10 | FromDiscord | <krabbypatty> I'm not saying you aren't |
00:43:11 | FromDiscord | <krabbypatty> lol |
00:43:25 | FromDiscord | <krabbypatty> people use python with import just fine too |
00:43:26 | Yardanico | @krabbypatty if you are for "explicit is better than implicit", then nim isn't for you ;) |
00:43:42 | Yardanico | of course it some cases it makes sense, but not in all |
00:43:57 | FromDiscord | <krabbypatty> hmm I don't see why it doesn't |
00:44:00 | FromDiscord | <krabbypatty> it's perfectly compatible with UFCS |
00:44:06 | Yardanico | yeah, UFCS is about from x import nil |
00:44:18 | Yardanico | @krabbypatty because nim has a lot of features you might consider "implicit" |
00:44:19 | Yardanico | like macros |
00:44:34 | FromDiscord | <krabbypatty> I don't consider macros implicit |
00:44:41 | Yardanico | anyway, let's stop I guess, you are free to use any import syntax you want, I just explained that most nim code doesn't use that |
00:44:50 | FromDiscord | <krabbypatty> and implicit vs explicit isn't even my argument. I'm saying there's zero benefit to `import x` except typing less |
00:45:01 | FromDiscord | <krabbypatty> and tooling can automate the "typing less" part so that you don't type at all |
00:45:10 | Yardanico | but we don't have that tooling :) and let's stop |
00:47:27 | Yardanico | you can also consider making a forum thread if you want to discuss this in more depth and with more information - https://forum.nim-lang.org/ |
00:47:44 | FromDiscord | <krabbypatty> eh it's not like nim will change now |
00:47:50 | Yardanico | well, it's not about changing |
00:47:57 | Yardanico | it's about reasoning, you can add your arguments about tooling too |
00:48:04 | Yardanico | constructive criticism can be useful |
00:48:28 | FromDiscord | <krabbypatty> you're right |
00:48:46 | FromDiscord | <krabbypatty> thanks, I might create a forum thread |
00:53:38 | * | bunbunbunbunny joined #nim |
00:55:54 | FromDiscord | <ElegantBeef> I dont really like the importing of specific identifiers but to each their own |
00:58:01 | * | silvernode joined #nim |
01:02:38 | FromDiscord | <exelotl> Is that a thing with say, JS editor plugins? Like the editor can turn `import { foo } from './mymodule'` intob`import { foo, bar } from './mymodule'` the first time you try to use `bar` in the file |
01:02:45 | FromDiscord | <krabbypatty> Yea |
01:02:55 | FromDiscord | <krabbypatty> With typescript you can |
01:05:57 | FromDiscord | <exelotl> Ah I see, it makes sense for JS/TS, but maybe its challenging for Nim because templates and macros will mean that you're implicitly using a lot of symbols that you didn't type yourself? Although I'm aware that usually that's not actually an issue, like a template can access a private variable from the module where it came from... So maybe that's not it... |
01:06:38 | FromDiscord | <krabbypatty> sent a long message, see http://ix.io/2BjJ |
01:06:59 | FromDiscord | <ElegantBeef> What about proc name overlap? |
01:07:07 | FromDiscord | <ElegantBeef> Also what's the benefit of each proc getting imported instead of the full file |
01:07:23 | FromDiscord | <ElegantBeef> It creates noise, makes it more tedious and certainly requires tooling to keep up with |
01:07:27 | FromDiscord | <krabbypatty> Readability for beginners and places where you don't have tooling |
01:07:45 | FromDiscord | <krabbypatty> Whereas the only benefit I see for import x is typing less |
01:07:53 | FromDiscord | <ElegantBeef> Without tooling you have to manually scroll up and add the proc and module |
01:08:05 | FromDiscord | <ElegantBeef> Whereas just importing the module gives you all exported symbols |
01:08:25 | FromDiscord | <krabbypatty> Right, but that's basically typing less |
01:09:04 | FromDiscord | <krabbypatty> You're saving 5 seconds right now at the cost of not remembering where the proc comes from in the future |
01:09:11 | FromDiscord | <krabbypatty> Or someone on your team not knowing |
01:11:28 | FromDiscord | <krabbypatty> @exelotl I think you're right in the general case |
01:11:29 | Yardanico | "at the cost of not remembering where the proc comes from in the future" only in environments without proper tooling |
01:11:58 | FromDiscord | <krabbypatty> In practice the only implicit usage of stmbols I've run into is echo requiring $ |
01:11:59 | Yardanico | yes "github code review as you said", but I can't think of any other case |
01:12:20 | FromDiscord | <krabbypatty> Terminal, any code review, any slack snippet, any terminal, git diffs |
01:12:31 | FromDiscord | <krabbypatty> Lol typed terminal twice |
01:12:57 | Yardanico | "terminal" you can use vim/neovim in a terminal just fine |
01:13:06 | Yardanico | "any code review" you can review code in editors |
01:13:24 | FromDiscord | <ElegantBeef> The funny thing is to keep up with your explict imports you want tooling |
01:13:36 | FromDiscord | <krabbypatty> this is much less common than you're claiming |
01:13:51 | Yardanico | and these issues are much less common than you're claiming |
01:13:57 | Yardanico | about "people not knowing there stuff comes from" |
01:13:59 | FromDiscord | <ElegantBeef> Without tooling you need to know where proc comes from |
01:14:03 | FromDiscord | <krabbypatty> Uhhh they haven't been for me |
01:14:21 | FromDiscord | <krabbypatty> @ElegantBeef what do you mean? |
01:14:31 | FromDiscord | <krabbypatty> You always have to know where it comes from |
01:14:35 | Yardanico | idk, before nim I only knew python on a ~medium level and haven't had any issues becoming accustomed to the nim way at all |
01:14:57 | Yardanico | and no I didn't use "from x import *" in python |
01:15:00 | FromDiscord | <ElegantBeef> No if i'm writting code in an editor without tooling, you write `a.Ident` you now need to import `ident` wherever it comes from |
01:15:14 | FromDiscord | <krabbypatty> Working in languages with import -type imports has always been a nightmare for me |
01:15:22 | FromDiscord | <krabbypatty> Nim is slightly better because its statically typed |
01:16:14 | FromDiscord | <krabbypatty> @ElegantBeef but you'd already have to `import` the correct package anyway |
01:16:33 | FromDiscord | <exelotl> Sidenote: I'm currently using Nim without tooling because Nimsuggest regularly gets stuck using 100% CPU. Its totally manageable for a solo project, but I'd like it to work again at some point lol |
01:16:36 | FromDiscord | <ElegantBeef> Yea and if the module is already imported you dont have to remember where it comes from, it's just there |
01:16:45 | FromDiscord | <krabbypatty> @exelotl sometimes mine does that too |
01:16:51 | FromDiscord | <krabbypatty> I just restart vim then lol |
01:16:57 | FromDiscord | <krabbypatty> but you can try switching to nim devel |
01:17:06 | FromDiscord | <exelotl> It got too frequent for me haha |
01:18:03 | FromDiscord | <krabbypatty> @ElegantBeef IMO it's a tradeoff between saving your time versus saving everyone else's (including yours) time in the future |
01:18:47 | FromDiscord | <ElegantBeef> Doesnt importing an entire module save everyones time, since you have everything exposed and never have to worry about importing a new module, in a tooless environment or a tooled one |
01:18:57 | FromDiscord | <krabbypatty> for writing sure |
01:19:06 | FromDiscord | <krabbypatty> for reading you can't claim it possibly saves time |
01:19:25 | Yardanico | it's gonna be fun to see how you will use explicit import with libs like https://github.com/mratsim/Arraymancer :) |
01:20:20 | FromDiscord | <krabbypatty> I don't use that so I don't know why it'd be harder |
01:20:51 | FromDiscord | <krabbypatty> but it's not like you couldn't have exceptions |
01:21:02 | leorize[m] | custom operators |
01:21:04 | FromDiscord | <krabbypatty> like people in python using `from numpy import ` but importing explicitly for everthing else |
01:21:17 | FromDiscord | <ElegantBeef> Python also doesnt have export control |
01:21:23 | FromDiscord | <krabbypatty> yep |
01:21:24 | FromDiscord | <krabbypatty> which sucks |
01:21:25 | FromDiscord | <krabbypatty> lol |
01:21:35 | FromDiscord | <ElegantBeef> Nim does meaning you only get what's designed to be imported |
01:21:44 | FromDiscord | <krabbypatty> https://media.discordapp.net/attachments/371759389889003532/767920454164938782/unknown.png |
01:21:46 | Yardanico | and there's also whole dead code elimination always |
01:21:47 | FromDiscord | <krabbypatty> I already import operators manually |
01:21:48 | FromDiscord | <ElegantBeef> You can argue that qualified imports do the same |
01:21:49 | FromDiscord | <krabbypatty> so I don't see the problem |
01:21:51 | FromDiscord | <krabbypatty> lol |
01:21:56 | Yardanico | @krabbypatty my eyes :(( |
01:22:01 | FromDiscord | <ElegantBeef> So you can argue that you should only use qualified code |
01:22:10 | leorize[m] | I'd recommend just writing things the idiomatic way for a while to get a feel of it |
01:22:17 | Yardanico | also python differs from nim much in "from x import y" |
01:22:26 | Yardanico | since nim doesn't have "classes" so you have to import operators manually like you did |
01:22:29 | Yardanico | and procs operating on types |
01:22:35 | FromDiscord | <krabbypatty> why does the screenshot bother you? |
01:22:44 | leorize[m] | it's easy to dismiss something when you have a negative bias for it |
01:23:13 | FromDiscord | <krabbypatty> I just don't see the point. |
01:23:17 | FromDiscord | <krabbypatty> It saves me 5 seconds |
01:23:39 | FromDiscord | <ElegantBeef> Do you use `import x as nil` so you can increase so you know exactly where a proc comes from? |
01:23:48 | FromDiscord | <krabbypatty> I use it exactly once in my codebase |
01:23:48 | FromDiscord | <ElegantBeef> (edit) "Do you use `import x as nil` so you can increase ... so" added "readabillity" |
01:23:56 | FromDiscord | <krabbypatty> for `terminal` |
01:24:03 | FromDiscord | <ElegantBeef> So you arent consistant in your goal for readabillity imo |
01:24:08 | FromDiscord | <krabbypatty> what do you mean? |
01:24:19 | FromDiscord | <krabbypatty> I can always know where a proc comes from by reading the whole file |
01:24:20 | Yardanico | you have to scroll up to know where something comes from |
01:24:27 | FromDiscord | <krabbypatty> yes |
01:24:29 | FromDiscord | <krabbypatty> that's my goal |
01:24:36 | FromDiscord | <ElegantBeef> If you were so concerned with knowing where stuff comes from without tooling or extra reading you'd know where it comes from inline |
01:24:40 | FromDiscord | <krabbypatty> I can know statically, without tooling, with pure human reasoning where a proc comes from |
01:25:01 | FromDiscord | <ElegantBeef> What if two modules have 2 procs with the same name? |
01:25:22 | FromDiscord | <krabbypatty> you can still import both I think? |
01:25:32 | leorize[m] | look, just try the normal way for like a month or so |
01:25:39 | FromDiscord | <ElegantBeef> Yes but you dont have any clue which is being used without knowing the parameters |
01:25:39 | leorize[m] | this sort of thing is really subjective |
01:25:40 | FromDiscord | <krabbypatty> oh I get what you're saying |
01:25:45 | leorize[m] | you can bike shed about it forever |
01:25:51 | FromDiscord | <krabbypatty> you can still find out types statically |
01:25:58 | FromDiscord | <krabbypatty> in most cases |
01:26:00 | FromDiscord | <ElegantBeef> Not with type inference |
01:26:58 | Yardanico | @ElegantBeef well you *can* make it work if you make it a part of nimsuggest somehow |
01:27:04 | FromDiscord | <krabbypatty> you're right 🙂 if you don't know the return types of some procs that might happen |
01:27:21 | FromDiscord | <krabbypatty> I don't think that makes what I'm saying inconsitent |
01:27:23 | FromDiscord | <krabbypatty> inconsistent |
01:27:43 | Yardanico | most of us just don't see how is it better than "import x" :) |
01:27:54 | Yardanico | but anyway, a forum thread will have a longer discussion than a random one in a real-time chat |
01:28:20 | FromDiscord | <ElegantBeef> I also am a firm believe that tooling exists, use it |
01:28:25 | FromDiscord | <ElegantBeef> (edit) "believe" => "believer" |
01:28:31 | Yardanico | you missed if* |
01:28:39 | * | apahl quit (Ping timeout: 246 seconds) |
01:28:42 | FromDiscord | <ElegantBeef> nope |
01:29:04 | FromDiscord | <ElegantBeef> I believe that tooling exists, and you should use it 😛 |
01:29:22 | Yardanico | it doesn't |
01:29:28 | Yardanico | I mean the one krabby wants |
01:29:34 | Yardanico | to automatically insert imports |
01:29:53 | FromDiscord | <krabbypatty> The difference between the tooling I'm suggesting is that it is only under your control - I can't control GitHub and how their code review is implemented, or people's environments to ensure that they always code review under VSCode with proper LSP support, or that they never read git logs in a terminal |
01:30:18 | FromDiscord | <krabbypatty> With the tooling I'm suggesting it's completely under my control, and people in environments without tooling can still collaborate effectively |
01:30:21 | FromDiscord | <ElegantBeef> Well you can use github's vscode |
01:30:40 | * | apahl joined #nim |
01:30:42 | FromDiscord | <krabbypatty> and I'm saying "people in environments without tooling" but honestly that's everyone 🙂 |
01:30:54 | FromDiscord | <krabbypatty> I highly doubt you're always reading code in an editor with proper LSP support |
01:31:03 | FromDiscord | <ElegantBeef> If i'm modifying it i am |
01:31:22 | Yardanico | 99% same here |
01:31:31 | FromDiscord | <krabbypatty> same |
01:31:32 | Yardanico | @krabbypatty nim has plugins for a lot of editors |
01:31:36 | FromDiscord | <krabbypatty> I'm talking about reading, not modifying |
01:31:52 | Yardanico | well, I read mostly in the editor too |
01:31:55 | FromDiscord | <ElegantBeef> I'm not going to go with code introspection without goto definition |
01:32:05 | Yardanico | sometimes from the phone on github, and somehow I still manage to understand what's going on in the code |
01:32:11 | Yardanico | even if I don't know where that exact proc comes from |
01:32:14 | Yardanico | you know, context.. |
01:32:34 | FromDiscord | <ElegantBeef> C# doesnt have explict proc imports as the convention either and it's fine |
01:32:43 | Yardanico | just be prepared that looking at almost any nim project will be a nightmare for you then :) |
01:32:45 | FromDiscord | <krabbypatty> ¯\_(ツ)_/¯ |
01:32:48 | FromDiscord | <krabbypatty> there's no point discussing |
01:32:51 | FromDiscord | <ElegantBeef> You say `using Namespace` and then get all tokens that are exposed from there |
01:32:54 | FromDiscord | <krabbypatty> most people in the nim community disagree with me |
01:32:58 | FromDiscord | <ElegantBeef> It's completely subjective |
01:33:03 | Yardanico | well, you can put it on the forum, some people are not here |
01:33:07 | FromDiscord | <ElegantBeef> Yea |
01:33:09 | Yardanico | maybe people on the forum will make better arguments for/against it :) |
01:33:12 | FromDiscord | <krabbypatty> but I think it's one of the few bad design decisions that nim made |
01:33:13 | FromDiscord | <ElegantBeef> Also some people are not us |
01:33:16 | FromDiscord | <krabbypatty> and no other modern language does |
01:33:19 | FromDiscord | <ElegantBeef> C#! |
01:33:34 | FromDiscord | <ElegantBeef> Unless C# isnt modern anymore 😄 |
01:33:38 | FromDiscord | <krabbypatty> it isn't |
01:33:45 | FromDiscord | <ElegantBeef> Doesnt rust do the same with namespaces? |
01:34:02 | FromDiscord | <exelotl> I totally see the merit in krab's approach, even though its not for me, the only criticisms I have are "if you're already familiar with the project then it's just ugly noise" and "that's not how we do things around here" |
01:34:04 | FromDiscord | <krabbypatty> I mean it has modern features, but I'm saying languages created since ~2010 have mostly avoided that mistake |
01:34:14 | Yardanico | "mistake" |
01:34:14 | Yardanico | meh |
01:34:22 | Yardanico | D does the same btw |
01:34:23 | FromDiscord | <ElegantBeef> Nim isnt modern then by your own definition 😛 |
01:34:27 | Yardanico | yeah that too |
01:34:45 | Yardanico | same goes for rust |
01:35:08 | FromDiscord | <krabbypatty> lol that's exactly what I'm saying, I think Nim is great but that's one of the few design decisions that I disagree with. Most other modern languages (D and C# aren't modern, they might be good languages but they aren't modern) don't do this |
01:35:14 | FromDiscord | <ElegantBeef> I understand that it could be benefical in some specific cases, but so would qualified imports, based of similar reasoning |
01:35:25 | FromDiscord | <ElegantBeef> (edit) "of" => "off" |
01:35:28 | Yardanico | @krabbypatty "modern" itself is subjective :) |
01:35:34 | FromDiscord | <krabbypatty> rust doesn't do this I think, not by default |
01:35:40 | FromDiscord | <ElegantBeef> But yea make a forum post and see what people say! |
01:35:43 | FromDiscord | <krabbypatty> you can `use a::` |
01:35:48 | Yardanico | well, people use "use" usually |
01:35:51 | FromDiscord | <ElegantBeef> I'd like name spaces though |
01:35:52 | Yardanico | us |
01:36:03 | FromDiscord | <krabbypatty> yeah but with use I think you know what you're getting? |
01:36:21 | FromDiscord | <krabbypatty> like if you do `use std::env` |
01:36:22 | Yardanico | same with import? |
01:36:25 | FromDiscord | <krabbypatty> you have to call `env::args` |
01:36:26 | Yardanico | you know what you're getting |
01:36:42 | Yardanico | procs in nim modules are not just randomly thrown together |
01:36:47 | Yardanico | "tables" module is for tables |
01:36:51 | Yardanico | for any operations involving them |
01:36:55 | Yardanico | "strutils" is for string utilities |
01:36:56 | Yardanico | etc |
01:37:02 | Yardanico | it all makes sense |
01:37:09 | FromDiscord | <krabbypatty> I meant that you know by looking at the name |
01:37:18 | FromDiscord | <krabbypatty> it's not implicit like `import x` in nim |
01:37:26 | Yardanico | yeah, I'm talking about a different thing |
01:37:48 | Yardanico | but still, if you see "import tables" and then see mytable["myname"] - it's only logical that this comes from the tables module |
01:37:59 | Yardanico | strutils/sequtils/os/asyncdispatch/etc |
01:38:35 | * | Tanger joined #nim |
01:38:38 | Yardanico | see https://forum.nim-lang.org/t/6728#41767 |
01:38:57 | Yardanico | for one forum thread about that |
01:39:18 | Yardanico | it's about fully explicit imports though |
01:39:27 | FromDiscord | <krabbypatty> the fact that this forum thread exists kinda proves my point about beginners |
01:39:42 | Yardanico | does it? |
01:39:56 | FromDiscord | <ElegantBeef> Beginners coming from languages that arent |
01:39:59 | FromDiscord | <ElegantBeef> (edit) "Beginners coming from languages that arent ... " added "nim" |
01:40:15 | FromDiscord | <krabbypatty> That's the definition of beginner 😛 |
01:40:25 | Yardanico | I understand your point, but we really rarely hear that someone dislikes these imports |
01:40:29 | FromDiscord | <ElegantBeef> Well they have a preconcieved notion on how a language should work |
01:40:34 | Yardanico | yeah survivorship bias whatever |
01:40:41 | Yardanico | @ElegantBeef exactly |
01:40:44 | FromDiscord | <krabbypatty> I interpreted that differently |
01:40:59 | FromDiscord | <krabbypatty> > Where does DF comes from? (I know it's defined in nimdata, but the unqualified imports don't tell me...) I'm using Emacs with nim-mode, however I couldn't figure out how nim-mode can tell me where DF comes from. |
01:40:59 | Yardanico | when you're programming, you develop your own "taste" |
01:41:03 | FromDiscord | <krabbypatty> > So I'm a bit at a loss... I'm sure these are typical beginner's troubles and they'll evaporated with more experience, but at the moment I can't see how... |
01:41:38 | FromDiscord | <ElegantBeef> > Hey @aEverr, thanks for this. Super cool.↵> ↵> I was not aware how general in Nim the loose coupling of functions and objects/variables is - and that it is called Uniform Function Call Syntax. |
01:41:55 | Yardanico | @ElegantBeef well we're talking about a bit different thing |
01:42:02 | FromDiscord | <ElegantBeef> Yea now |
01:42:03 | Yardanico | but yes, imports like that in Nim make much less sense |
01:42:12 | Yardanico | because nim has "loose coupling of objects" |
01:42:16 | Yardanico | you don't have "classes" |
01:42:19 | Yardanico | you have objects, procs, etc |
01:42:39 | FromDiscord | <krabbypatty> yes `import nil` in most cases doesn't make senses |
01:42:49 | FromDiscord | <ElegantBeef> We could always ask the author of that post they're in the discord 😄 |
01:42:50 | FromDiscord | <krabbypatty> in very few cases I find it useful tho |
01:43:21 | FromDiscord | <krabbypatty> https://nim-lang.org/ |
01:43:31 | Yardanico | ? |
01:44:27 | disruptek | look, i don't know how to say this. |
01:44:38 | disruptek | sometimes the end isn't the beginning of the end, or the end of the beginning. |
01:44:42 | disruptek | it's just the fucking end. |
01:44:53 | FromDiscord | <ElegantBeef> So poetic |
01:45:01 | FromDiscord | <krabbypatty> true |
01:46:14 | disruptek | in future, procs will follow /their/ types as far as imports go. |
01:46:39 | FromDiscord | <krabbypatty> what do you mean? |
01:46:57 | * | sagax quit (Quit: Konversation terminated!) |
01:47:06 | disruptek | if you get a table as a return value from somewhere, you'll be able to use table procs against it without a separate import. |
01:47:20 | FromDiscord | <krabbypatty> huh |
01:47:40 | Yardanico | disruptek: do you mind me making a repo of your quotes |
01:47:49 | FromDiscord | <krabbypatty> that's even worse 😦 |
01:49:00 | disruptek | making a repo about shit i've said says more about you than it does me. |
01:49:28 | Yardanico | 😘 |
01:49:44 | Yardanico | is that a "yes" |
01:49:44 | FromDiscord | <krabbypatty> > if you get a table as a return value from somewhere, you'll be able to use table procs against it without a separate import. |
01:49:46 | FromDiscord | <krabbypatty> is there an rfc for this |
01:49:59 | Yardanico | no(t yet? idk) |
01:50:46 | disruptek | if you want an example of a nim-2 feature, this is one. |
01:51:28 | FromDiscord | <krabbypatty> what's the reasoning for it |
01:51:36 | FromDiscord | <krabbypatty> sounds like a very bad idea |
01:51:46 | disruptek | types aren't that useful without procs. |
01:52:06 | FromDiscord | <krabbypatty> I agree |
01:52:07 | * | kenran joined #nim |
01:53:42 | disruptek | if i don't use some types from tables, i don't want to have to export all of tables just so you get the procs you need. |
01:53:48 | FromDiscord | <krabbypatty> wait |
01:53:52 | FromDiscord | <krabbypatty> are you talking about something like |
01:54:01 | FromDiscord | <krabbypatty> from tables import Table |
01:54:09 | disruptek | on the other hand, i don't want to have to export individual procs, guessing about what exists or what you might want. |
01:54:12 | FromDiscord | <krabbypatty> this imports automatically all the procs that operate on `Table` as their first arg? |
01:54:40 | disruptek | it's more like my example, where you import a proc with a return value that is defined outside your module. |
01:54:53 | disruptek | today, you can't do anything with it. |
01:55:04 | disruptek | eventually, it will arrive more fully-formed. |
01:55:38 | * | Pisuke quit (Ping timeout: 272 seconds) |
01:55:52 | FromDiscord | <krabbypatty> > on the other hand, i don't want to have to export individual procs, guessing about what exists or what you might want. |
01:56:04 | FromDiscord | <krabbypatty> I don't get this |
01:56:12 | FromDiscord | <krabbypatty> will explicit exports not be a thing anymore? |
01:56:23 | disruptek | they will. |
01:56:31 | disruptek | but there will be implicit imports, too. |
01:56:59 | disruptek | anyway, it's just a goal to polish out a small wart. |
01:57:04 | * | kenran quit (Ping timeout: 246 seconds) |
01:57:05 | * | Pisuke joined #nim |
01:57:28 | FromDiscord | <krabbypatty> so what's the small wart? types not being useful by themselves? |
01:57:39 | disruptek | yes. |
01:57:52 | FromDiscord | <krabbypatty> I agree that might be an issue, I think that solution is am uch bigger wart though |
01:58:10 | FromDiscord | <ElegantBeef> What's the way to check if a generic is not a type `when not T is A`? |
01:58:12 | disruptek | well, there is plenty of time to object and discuss alternatives. |
01:58:17 | disruptek | isnot |
01:58:30 | FromDiscord | <krabbypatty> so the issue is that in languages like rust, python, JS etc when you import a type, you're importing all their methods along with the import |
01:58:52 | FromDiscord | <krabbypatty> e.g. when you do use std::collection::HashMap` you're bringing HashMap::new() , .isnert, etc too |
01:59:11 | FromDiscord | <krabbypatty> You could just have nim do that |
01:59:20 | disruptek | that's kinda the idea. |
01:59:22 | FromDiscord | <krabbypatty> from tables import Table would bring every proc that operates on a table as its first argument |
01:59:26 | FromDiscord | <krabbypatty> but you're saying that |
01:59:33 | FromDiscord | <krabbypatty> I wouldn't even need to type out that import line |
02:00:01 | disruptek | well, i dunno. an explicit import might still be explicitly limiting. |
02:00:05 | disruptek | after all, it's explicit. |
02:00:18 | disruptek | that's why i used a different example. |
02:00:26 | disruptek | i'm trying to emphasize the implicit nature. |
02:00:53 | FromDiscord | <krabbypatty> seems like I'd end up with files with 0 imports |
02:00:56 | FromDiscord | <krabbypatty> not knowing where anything comes from |
02:01:13 | disruptek | how do you figure? |
02:01:46 | disruptek | you can't do much with tables without importing tables, for example. |
02:02:26 | disruptek | but if you use a lib that gives you a table-like object, you shouldn't have to intuit that you need a particular import to use that object. |
02:03:04 | disruptek | that the supplier should be able to change the implementation of that object without leaving you with broken imports. |
02:03:14 | FromDiscord | <krabbypatty> so if I had a table from string to seq[something] |
02:03:28 | FromDiscord | <krabbypatty> and I did table["a"] |
02:03:42 | FromDiscord | <krabbypatty> did I just import all of sequtils? |
02:03:53 | FromDiscord | <ElegantBeef> Why would it? |
02:04:01 | Yardanico | it's all just an unwritten rfc yet |
02:04:01 | disruptek | well, most seq operations are defined in system. |
02:04:04 | Yardanico | not even discussed |
02:04:06 | Yardanico | @krabbypatty |
02:04:06 | Prestige | What is {lvalue}? Seeing it in a c wrapper, haven't found details really |
02:04:06 | FromDiscord | <ElegantBeef> Seqs can be used without sequtils |
02:04:08 | Yardanico | don't worry |
02:04:14 | Yardanico | Prestige: assignment target/location |
02:04:21 | Yardanico | but need more context |
02:04:41 | FromDiscord | <notchris> Hello all! I'm trying to figure out how a certain type works. The procedure says the second value is of `type GlslVec2 = Vector2f` |
02:04:45 | Prestige | this: proc setVec2UniformArray*(shader: Shader, name: cstring, vectorArray: (var GlslVec2){lvalue}, length: int) {.cdecl, importc: "sfShader_setVec2UniformArray".} |
02:05:03 | Prestige | It's about notchris' question |
02:05:04 | disruptek | ah, it's an optimization. |
02:05:04 | FromDiscord | <notchris> TY! |
02:05:30 | Yardanico | Prestige: AST-based overloading |
02:05:42 | FromDiscord | <krabbypatty> I get that it's unwritten, I'm just discussing it |
02:05:43 | Yardanico | https://nim-lang.org/docs/manual_experimental.html#ast-based-overloading |
02:05:54 | Prestige | Thanks |
02:05:57 | Yardanico | haven't seen lvalue even once though |
02:05:57 | FromDiscord | <krabbypatty> but if it doesn't import sequtils then it sounds inconsistent |
02:06:01 | Yardanico | guess it works as well |
02:06:08 | disruptek | how so? |
02:06:15 | FromDiscord | <krabbypatty> so it would jus import everything in the file that the type is defined? |
02:06:18 | FromDiscord | <notchris> It's odd because I was expecting it to be an array of vec2s |
02:06:19 | Yardanico | Prestige: you can find all constraints in https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros-parameter-constraints |
02:06:28 | Yardanico | they all work for ast based overloading as well |
02:06:33 | Prestige | awesome |
02:06:37 | Yardanico | "The matching AST must be an lvalue." |
02:06:50 | disruptek | no, it would only introduce operations for the type. |
02:07:10 | disruptek | look, don't let it concern you. this is probably years away. |
02:07:16 | FromDiscord | <krabbypatty> what does that mean? import everything in the file that the type is defined that has that type as its first parameter? |
02:07:16 | FromDiscord | <krabbypatty> lol ok |
02:07:27 | disruptek | no, it would only introduce operations for the type. |
02:08:07 | FromDiscord | <krabbypatty> I'll wait for the rfc then 😛 |
02:21:01 | * | opal quit (Remote host closed the connection) |
02:22:14 | * | opal joined #nim |
02:34:43 | * | CcxWrk quit (Remote host closed the connection) |
02:36:12 | * | muffindrake quit (Ping timeout: 246 seconds) |
02:38:35 | * | muffindrake joined #nim |
02:39:01 | * | CcxWrk joined #nim |
03:02:51 | FromDiscord | <shassard> has anyone else noticed nim 1.4.0 leaving pkgs folders all over your hard drive (on linux)? this seems to happen if I run the nim command in any directory, even empty ones. |
03:03:33 | FromDiscord | <flywind> can reproduce in windows |
03:04:01 | FromDiscord | <ElegantBeef> what command just `nim`? |
03:04:03 | FromDiscord | <shassard> any idea if a bug was reported? I was trying to search in github issues but that pulls up too many unrelated issues. |
03:04:04 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/767946203077672981/unknown.png |
03:04:18 | FromDiscord | <shassard> yeah, just plain old nim without args does it. |
03:04:25 | FromDiscord | <ElegantBeef> Not an issue here |
03:04:29 | disruptek | funny. |
03:05:49 | FromDiscord | <shassard> I guess I'll try my luck and file a github issue |
03:08:34 | * | bunbunbunbunny quit (Ping timeout: 260 seconds) |
03:21:19 | Prestige | Where did you see them created? |
03:22:44 | FromDiscord | <shassard> They're created in any folder where the nim executable is run. |
03:22:51 | FromDiscord | <shassard> https://github.com/nim-lang/Nim/issues/15648 |
03:22:53 | disbot | ➥ nim creates empty pkgs folders in the pwd when run ; snippet at 12https://play.nim-lang.org/#ix=2Bk7 |
03:28:19 | Prestige | Hmm not happening on my system |
03:29:53 | FromDiscord | <shashlick> It's a choosenim bug |
03:30:23 | FromDiscord | <shashlick> https://github.com/dom96/choosenim/pull/235 |
03:30:24 | disbot | ➥ Fix nimble issue 864 |
03:31:04 | FromDiscord | <shassard> good find! |
03:31:07 | FromDiscord | <shashlick> Use the older choosenim and switch versions |
03:31:29 | FromDiscord | <shashlick> It will recreate the shims and issue goes away |
03:31:40 | FromDiscord | <shashlick> Will post fix tomorrow hopefully |
03:41:25 | * | astronavt quit (Ping timeout: 240 seconds) |
03:45:25 | * | tiorock joined #nim |
03:45:25 | * | tiorock quit (Changing host) |
03:45:25 | * | tiorock joined #nim |
03:45:25 | * | rockcavera quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
03:45:25 | * | tiorock is now known as rockcavera |
03:46:27 | * | rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services))) |
03:46:28 | * | rockcavera joined #nim |
03:52:12 | * | silvernode quit (Quit: Leaving) |
03:53:02 | * | kenran joined #nim |
03:58:13 | * | kenran quit (Ping timeout: 265 seconds) |
04:05:49 | * | mbomba joined #nim |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:43 | * | supakeen joined #nim |
04:06:55 | * | Tanger is now known as mister_dotnet |
04:08:16 | * | mbomba quit (Quit: WeeChat 2.9) |
04:08:50 | * | mbomba joined #nim |
04:09:09 | * | mbomba left #nim (#nim) |
04:15:32 | * | antranigv quit (Ping timeout: 256 seconds) |
04:15:57 | * | antranigv joined #nim |
04:16:08 | * | bunbunbunbunny joined #nim |
04:18:47 | * | rockcavera quit (Remote host closed the connection) |
04:21:34 | * | mbomba joined #nim |
04:35:04 | * | mbomba quit (Quit: WeeChat 2.9) |
04:57:03 | * | apahl quit (Ping timeout: 260 seconds) |
04:57:59 | * | apahl joined #nim |
05:22:44 | * | user0 joined #nim |
05:32:38 | * | solitudesf joined #nim |
05:32:38 | * | sealmove quit (Read error: Connection reset by peer) |
05:47:38 | mister_dotnet | What's happened to the nim docs? |
05:47:52 | * | mister_dotnet is now known as TangersTongle |
05:47:58 | mipri | what about them? |
05:48:34 | TangersTongle | They've finally sorted procs into like groups eh? |
05:49:01 | TangersTongle | Couldn't make the proc list alphabetical though eh? |
05:49:45 | TangersTongle | But the html is all borked |
05:49:51 | mipri | borked how? |
05:50:34 | mipri | looks like the procs are in source order |
05:51:03 | TangersTongle | https://imgur.com/a/Y4VJf9D |
05:51:35 | TangersTongle | It's great, don't get me wrong |
05:51:52 | mipri | eh I wouldn't defend that shit, I just don't see it |
05:52:07 | mipri | ah... there it is actually. |
05:53:14 | mipri | HTML pages never did this when only tables were used for layout :p |
05:53:53 | * | kenran joined #nim |
05:56:54 | TangersTongle | Haha |
05:58:26 | * | narimiran joined #nim |
05:58:55 | * | kenran quit (Ping timeout: 246 seconds) |
06:00:00 | * | filcuc joined #nim |
06:04:57 | * | oculux quit (Quit: blah) |
06:05:17 | * | oculux joined #nim |
06:16:30 | * | Vladar joined #nim |
06:17:14 | Prestige | Another random thing... Is it just me, or is the dark mode toggle not there on mobile? |
06:18:04 | FromDiscord | <Rika> it wasnt there before |
06:18:43 | Prestige | Yeah I meant in general, not just recently |
06:23:40 | * | PMunch joined #nim |
06:23:49 | FromDiscord | <Rika> ah i see |
06:24:00 | FromDiscord | <Rika> i dont know why nim docs hide the sidebar in mobile |
06:24:39 | Prestige | It would be fine if we had a way to hide and expand the sidebar |
06:28:07 | PMunch | What is up with the new sidebar, so much less readable.. |
06:28:40 | PMunch | Not to mention it is now about twice as long.. |
06:30:10 | Zevv | i like it |
06:30:25 | Zevv | well, not the fact that its twice as long. |
06:30:53 | Zevv | but i do like the fact that there is not 12 times `[]` in some module and I have to click'em all to find the right signature |
06:31:04 | narimiran | PMunch, Zevv: devel docs have wrap, stable has the old cached version (already fixed, but not seen just yet) |
06:32:24 | narimiran | Prestige: yeah, we need that toggle; until it is here, it is just hidden |
06:33:20 | Prestige | I read docs with my left eye and irc with my right eye, on mobile |
06:33:26 | Prestige | It's a party |
06:37:29 | * | filcuc quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/) |
06:37:52 | * | filcuc joined #nim |
06:44:15 | PMunch | narimiran, wrap? |
06:44:32 | * | gmaggior quit (Quit: Leaving) |
06:44:42 | PMunch | Oh, fixing that wrapping error :P |
06:45:08 | * | nc-x joined #nim |
06:45:56 | narimiran | PMunch: see https://nim-lang.github.io/Nim/lib.html for some examples of it |
06:46:17 | narimiran | (yeah, i know it is (sometimes) ugly, but there are no spaces in the names where you could make a line break) |
06:46:37 | PMunch | And Zevv, I would rather have only one of each symbol, and then have to scroll to the correct one (or have a small section with the signatures when there's more than one so you click the sidebar to go to the section and then either scroll or click the one you needed) |
06:47:20 | PMunch | narimiran, well you could break on commas at least.. |
06:48:07 | PMunch | And I see now that part of the problem I have with the new docs is that the colour of the sections and procedures are way too close.. |
06:48:12 | * | nc-x quit (Remote host closed the connection) |
06:50:26 | narimiran | PMunch: i played with `line-break`parameter. it allows for several options, and only the current one does any line breaking |
06:51:29 | * | xet7 quit (Quit: Leaving) |
06:51:57 | PMunch | Ah, I see, but aren't there a zero-width character that enables line-breaks? |
06:52:56 | PMunch | Ah yes, this thing: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr |
06:53:37 | * | xet7 joined #nim |
06:54:10 | PMunch | Or U+200B ZERO-WIDTH SPACE |
06:55:47 | * | krux02 quit (Remote host closed the connection) |
06:56:06 | * | arecacea1 quit (Remote host closed the connection) |
06:56:49 | * | arecacea1 joined #nim |
07:00:15 | narimiran | interesting idea! |
07:01:43 | FromDiscord | <nikki> assigning to stuff in result is such a great way to deal with nrvo and constructors |
07:05:50 | Araq | wow thanks. I never heard anyone else to give it credit :-) |
07:06:40 | ForumUpdaterBot | New thread by Anta40: Nim on MacOS: annoying macos cannot verify...., see https://forum.nim-lang.org/t/6959 |
07:06:42 | PMunch | Ey, I've said multiple times that I like result :) |
07:07:01 | FromDiscord | <ElegantBeef> I've never said it cause much like result i thought it was implicit |
07:07:03 | Araq | yes but you didn't make the connection to NRVO and constructors ;-) |
07:07:39 | Araq | but yeah, sorry, I do know 'result' has its fans (me included) |
07:08:03 | FromDiscord | <ElegantBeef> If you're fishing for praise... uhhh the VM is cool 😛 |
07:08:33 | PMunch | Well nrvo is part of the reason I like it :) That and the fact I don't have to name my returns :P |
07:10:14 | FromDiscord | <ElegantBeef> So current state pmunch is i'm using json for all nimscript -> nim communication and i dont support all types yet |
07:10:26 | FromDiscord | <ElegantBeef> But i've got some lovely demos out of it |
07:11:17 | FromDiscord | <ElegantBeef> Also the VM evaluating time is only slow in debug, in release it's almost instant |
07:11:44 | FromDiscord | <nikki> it's cool for by-value operators too |
07:11:47 | FromDiscord | <nikki> like vector addition |
07:11:59 | PMunch | @ElegantBeef, oh nice! |
07:12:33 | FromDiscord | <nikki> (result var i mean) which is still kinda about construction. C math apis would have out-params for this reason |
07:12:33 | FromDiscord | <ElegantBeef> If you care to see the speed! <https://streamable.com/90r58l> |
07:13:42 | FromDiscord | <ElegantBeef> A tad disappointed i cant use a binary stream for VM -> nim interop |
07:14:37 | PMunch | Ooh, that is nice indeed |
07:15:06 | PMunch | Why can't you do that? |
07:15:29 | FromDiscord | <ElegantBeef> There isnt a way in the vm to convert to bytes |
07:15:35 | PMunch | And I wonder how much perf you're missing by going via JSON |
07:15:53 | FromDiscord | <ElegantBeef> Cant cast to an `UncheckedArray[byte]` or `copyMem` |
07:16:03 | PMunch | Ah right, I guess there would be a way to do it though, somehow.. |
07:16:42 | FromDiscord | <ElegantBeef> Well i imagine it doesnt matter too much, but yea json can serialize unnamed tuples so i have to manually handle those and there are some other limitations |
07:16:54 | FromDiscord | <ElegantBeef> cant |
07:18:00 | FromDiscord | <ElegantBeef> I tried it on fidget(not much as it uses templates) and it also worked easily there for the procs, so other than a few edge cases it's pretty good all around |
07:18:25 | FromDiscord | <ElegantBeef> I'd say i'm slightly concerned about the json performance impact, but if performance is an issue "Just fucking compile the code" 😄 |
07:19:29 | PMunch | Haha, fair enough :P |
07:19:49 | PMunch | Basically you just want to do non-performance critical stuff in NimScript |
07:20:06 | FromDiscord | <ElegantBeef> Or use it for rapid prototyping |
07:20:15 | * | jwm224 quit (Ping timeout: 265 seconds) |
07:20:29 | FromDiscord | <ElegantBeef> Since even with HCR your going to be slower than the VM revaluating |
07:21:47 | FromDiscord | <ElegantBeef> Also do you know if implementRoutine overrides the functionality or adds to the functionality of the proc? |
07:22:04 | PMunch | Overrides |
07:22:12 | * | jwm224 joined #nim |
07:22:16 | FromDiscord | <ElegantBeef> Cause i implemented name mangling for the non user facing procs, then realized i never looked into that |
07:23:48 | PMunch | There are parts of the stdlib that are overridden by implementRoutine when it's run under NimScript |
07:24:02 | FromDiscord | <ElegantBeef> `circfillCompcxcyrrPt` that's a totally unique name that is highly unlikely to conflict, yes 😄 |
07:24:04 | PMunch | And there are some that just have {.error.} in them IIRC |
07:25:08 | * | bunbunbunbunny quit (Ping timeout: 256 seconds) |
07:25:57 | * | bung joined #nim |
07:25:58 | FromDiscord | <ElegantBeef> Mangling is due to using a single string for parameters, since all the nim facing procs are turned into `proc procName(str: string): string`, if you were curious |
07:26:33 | FromDiscord | <ElegantBeef> Now what's the eta on Pimo... 2132? |
07:40:05 | * | lbart quit (Ping timeout: 240 seconds) |
07:45:03 | * | opal quit (Ping timeout: 240 seconds) |
07:47:37 | * | opal joined #nim |
07:48:09 | * | lbart joined #nim |
07:49:46 | PMunch | Aaah, that makes sense @Elegant |
07:49:55 | PMunch | And I hope to have it done by 2030 :P |
07:50:07 | * | Kiloneie joined #nim |
07:50:24 | PMunch | I mean I have a prototype that works, but it's nowhere close to good enough to use |
07:50:53 | * | bunbunbunbunny joined #nim |
07:51:40 | FromDiscord | <ElegantBeef> Ah |
07:51:56 | FromDiscord | <haxscramper> I think I've seen high-level overview of nim macro expansion loop (how macros are repeatedly expanded etc.), but I cannot find it in manualy now |
07:52:13 | FromDiscord | <haxscramper> nor in the compiler internals, tutorials etc. |
07:52:21 | FromDiscord | <ElegantBeef> I'm overly happy to have a way to script nim regardless, but will be happy to see someone other than me use it |
07:52:33 | FromDiscord | <haxscramper> I'm basically looking for higher-level overview of semantic pass in compiler |
07:52:48 | PMunch | Yeah I plan to do something cool with it (that will tie into PiMO) |
07:54:03 | FromDiscord | <ElegantBeef> I wish i could help hax i'm uncertain what you even mean, so i probably dont know |
07:54:47 | * | kenran joined #nim |
07:55:02 | FromDiscord | <ElegantBeef> Just remembered my least favourite thing, declaration order matters you have to declare all your exported procs then `import nimscripter` do to that const table |
07:56:00 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
07:56:37 | * | bunbunbunbunny quit (Ping timeout: 264 seconds) |
07:57:17 | FromDiscord | <ElegantBeef> (edit) Just remembered my least favourite thing, declaration order matters you have to declare all your exported procs then `import nimscripter` due to that const table |
07:59:25 | * | kenran quit (Ping timeout: 240 seconds) |
08:05:45 | Araq | the plan is "IC first, then weaken the declaration order requirements" |
08:06:12 | * | bunbunbunbunny joined #nim |
08:07:13 | * | bunbunbunbunny quit (Client Quit) |
08:18:27 | FromDiscord | <ElegantBeef> Ah, my dumb hypothetical solution having 0 idea about anything, was just have a "late bind" marker which means it'd evaluate after all files were evaluate, but "Better to remain silent and be thought a fool than to speak and to remove all doubt," 😄 |
08:51:18 | Araq | so why are you on IRC then? :P |
08:56:37 | bung | let decompressed = decompress(cast[seq[byte]](result)) result = cast[seq[char]](result) |
08:56:47 | bung | am I casting wrong ? |
08:57:21 | bung | nvm , wrong pass |
09:18:39 | PMunch | Hmm, is there a way to get the input the same way as argv formats it? |
09:19:08 | PMunch | commandLineParams seems to split the parameters in an unexpected way for my use-case |
09:21:25 | PMunch | Oh, never mind |
09:21:38 | PMunch | It was justbecause running it through "nimble run" that it messed up |
09:24:01 | * | TangersTongle quit (Quit: Leaving) |
09:24:51 | * | leorize[m] quit (Quit: killed) |
09:24:52 | * | lnxw37d4 quit (Quit: killed) |
09:24:52 | * | k0mpjut0r quit (Quit: killed) |
09:24:52 | * | hnOsmium0001[m] quit (Quit: killed) |
09:24:52 | * | jaens[m] quit (Quit: killed) |
09:24:52 | * | GitterIntegratio quit (Quit: killed) |
09:24:53 | * | leorize[m]1 quit (Quit: killed) |
09:24:53 | * | reversem3 quit (Quit: killed) |
09:24:53 | * | inamiyar[m] quit (Quit: killed) |
09:24:55 | * | BitPuffin quit (Quit: killed) |
09:24:59 | * | unclechu quit (Quit: killed) |
09:24:59 | * | Helios quit (Quit: killed) |
09:25:03 | * | VijayMarupudi[m] quit (Quit: killed) |
09:25:05 | * | nikki93[m] quit (Quit: killed) |
09:25:05 | * | themoon[m] quit (Quit: killed) |
09:25:06 | * | stisa[m] quit (Quit: killed) |
09:25:06 | * | MTRNord[m] quit (Quit: killed) |
09:25:09 | * | ee7[m] quit (Quit: killed) |
09:25:10 | * | planetis[m] quit (Quit: killed) |
09:25:11 | * | solitudesf1 quit (Quit: killed) |
09:25:11 | * | silvernode[m] quit (Quit: killed) |
09:25:17 | * | guelosk[m] quit (Quit: killed) |
09:25:18 | * | brainbomb[m] quit (Quit: killed) |
09:30:07 | * | kenran joined #nim |
09:34:38 | * | unclechu joined #nim |
09:37:20 | * | lbart quit (Ping timeout: 272 seconds) |
09:39:12 | * | sagax joined #nim |
09:43:03 | * | NimBot joined #nim |
09:44:16 | * | lbart joined #nim |
09:44:16 | * | lbart quit (Changing host) |
09:44:16 | * | lbart joined #nim |
09:48:21 | * | lbart quit (Read error: Connection reset by peer) |
09:49:31 | * | lbart joined #nim |
09:49:31 | * | lbart quit (Changing host) |
09:49:31 | * | lbart joined #nim |
09:59:03 | * | brainbomb[m] joined #nim |
09:59:03 | * | BitPuffin joined #nim |
09:59:03 | * | inamiyar[m] joined #nim |
09:59:03 | * | GitterIntegratio joined #nim |
09:59:03 | * | k0mpjut0r joined #nim |
09:59:03 | * | leorize[m] joined #nim |
09:59:03 | * | Helios joined #nim |
09:59:03 | * | planetis[m] joined #nim |
09:59:04 | * | leorize[m]1 joined #nim |
09:59:04 | * | MTRNord[m] joined #nim |
09:59:04 | * | reversem3 joined #nim |
09:59:04 | * | jaens[m] joined #nim |
09:59:04 | * | hnOsmium0001[m] joined #nim |
09:59:04 | * | stisa[m] joined #nim |
09:59:04 | * | lnxw37d4 joined #nim |
09:59:04 | * | themoon[m] joined #nim |
09:59:09 | * | guelosk[m] joined #nim |
09:59:10 | * | silvernode[m] joined #nim |
09:59:10 | * | solitudesf1 joined #nim |
09:59:10 | * | nikki93[m] joined #nim |
09:59:10 | * | VijayMarupudi[m] joined #nim |
09:59:12 | * | ee7[m] joined #nim |
10:03:45 | bung | can I avoiding copy `pkt1 = pkt[pos ..< pos + pkt1Len]` they both are seq[char] |
10:06:05 | * | kenran quit (Quit: leaving) |
10:15:08 | * | Kiloneie quit (Quit: Leaving) |
10:23:48 | * | lritter joined #nim |
10:55:20 | * | Zevv quit (Ping timeout: 265 seconds) |
10:56:47 | * | jaens[m] left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days") |
11:00:36 | * | Zevv joined #nim |
11:13:24 | Araq | with toOpenArray and experimental view types |
11:14:31 | bung | how I store that after toOpenArray |
11:15:55 | bung | oh , I see with that experimental enabled it could be declare as variable type |
11:19:05 | Araq | but beware, view types are still so broken we couldn't announce them for 1.4 :-( |
11:20:34 | FromGitter | <jrfondren> oh yeah, just got a codegen error |
11:24:40 | bung | hmm,the error message not well,Error: cannot borrow from , it is not a path expression; see https://nim-lang.github.io/Nim/manual_experimental.html#view-types-algorithm-path-expressions for details |
11:26:52 | * | idf quit (Ping timeout: 246 seconds) |
11:28:29 | FromGitter | <ynfle> (https://files.gitter.im/5602f03e0fc9f982beb19f61/yziy/Screen-Shot-2020-10-20-at-2.28.15-PM.png) |
11:28:54 | FromGitter | <ynfle> Docs are broken on https://nim-lang.org/docs/unittest.html |
11:28:54 | * | lbart quit (Read error: No route to host) |
11:29:25 | mipri | that's known, and I think fixed in devel |
11:29:45 | FromGitter | <ynfle> > Tests can be nested, however, failure of a nested test will not mark the parent test as failed. Setup and teardown are inherited. Setup can be overridden locally. ⏎ ⏎ How can I override `setup` locally? |
11:30:16 | * | lbart joined #nim |
11:30:16 | * | lbart quit (Changing host) |
11:30:16 | * | lbart joined #nim |
11:31:14 | bung | var pkt1: openArray[char] pkt1 = pkt[0].unsafeAddr.toOpenArray(pos, pos + pkt1Len - 1) |
11:31:45 | bung | not sure error occurs this line or not, am I doing right ? |
11:35:16 | Araq | just use array indexing instead. |
11:38:23 | * | abm joined #nim |
11:39:04 | * | Zevv quit (Quit: leaving) |
11:39:25 | * | Zevv joined #nim |
11:40:03 | FromDiscord | <krabbypatty> I just read about NRVO and now I think I get why it has been said that assigning to result is faster than returning |
11:40:34 | FromDiscord | <krabbypatty> Is that the only optimization/benefit of result or is there anything else? 🙂 |
11:41:15 | FromGitter | <jrfondren> I think it often makes for shorter code, especially when result is implicitly initialized |
11:42:27 | FromDiscord | <krabbypatty> > assigning to stuff in result is such a great way to deal with nrvo and constructors |
11:42:45 | FromDiscord | <krabbypatty> so by constructors I assume they're talking about the same thing as you? |
11:43:02 | FromDiscord | <krabbypatty> e.g. you don' tneed to do initTable[string, string] if your retutrn type is already a Table[string, string] |
11:43:03 | FromDiscord | <Rika> yeah |
11:43:09 | FromDiscord | <krabbypatty> I see |
11:43:16 | bung | Araq you mean slice ? |
11:44:30 | Araq | no, I mean a 'var i: int' variable |
11:44:39 | Araq | that keeps track of your position |
11:44:56 | FromDiscord | <krabbypatty> from what I'm reading C++ compilers do NRVO without having something like Nim's result variable though |
11:45:01 | FromDiscord | <krabbypatty> by analyzing the function |
11:45:04 | FromDiscord | <krabbypatty> are there any limitations to that? |
11:45:20 | FromDiscord | <Rika> you need to analyze the functio |
11:45:23 | FromDiscord | <Rika> (edit) "functio" => "function" |
11:45:42 | FromDiscord | <krabbypatty> ok yeah, but is it just _harder_ or are there any situations where it's impossible to do NRVO without result |
11:46:06 | bung | Araq that need change subsequenc calls args |
11:46:07 | Araq | no such situation is known to me |
11:46:10 | FromDiscord | <Rika> not that i know of, its just much easier |
11:46:17 | FromDiscord | <krabbypatty> hmm I see |
11:46:35 | FromDiscord | <krabbypatty> so with result I assume the compiler just checks for the inclusion of a `return` in the AST? |
11:46:42 | FromDiscord | <Rika> well you have to consider how hard it is to analyze a function |
11:46:43 | FromDiscord | <krabbypatty> whereas without it you'd need some type of control flow analysis |
11:47:12 | Araq | nah, it's pretty much |
11:47:26 | Araq | T foo() # ABI turns it into |
11:47:31 | Araq | void foo(T*) |
11:47:40 | FromDiscord | <krabbypatty> ok yeah |
11:48:11 | Araq | bung, so be it then |
11:48:38 | Araq | (actually the parameter should be openArray[] and then in the call you can use toOpenArray) |
11:49:02 | Araq | (then you get away with not naming the slice and no experimental feature is required) |
11:49:05 | FromDiscord | <krabbypatty> speaking of result, I wish we had a Result[T, E] in the stdlib :p |
11:53:05 | FromGitter | <ynfle> Is there a way to have an array with an undefined length at compile time using generics or somethings? I remember seeing that in the docs somewhere |
11:53:22 | FromGitter | <jrfondren> that's openArray[T] |
11:53:41 | FromDiscord | <krabbypatty> ok wait, a question is how does nim know what the constructor of the type is when using result? |
11:54:06 | FromDiscord | <krabbypatty> because I assume there's a difference between `var s: Table[string, string]` and `var s: Table[string, string] = initTable[String, String]()` |
11:54:32 | FromGitter | <ynfle> > that's openArray[T] ⏎ ⏎ That doesn't work for variables at least not stably |
11:54:32 | FromDiscord | <krabbypatty> how does nim know to call initTable when I'm using result? or it doesn't? and what are the implications of that? |
11:55:32 | FromDiscord | <Rika> it doesnt, it uses some sort of default(T) (which cant be overridden) |
11:56:52 | FromDiscord | <krabbypatty> ok. what are the implications of that? |
11:57:02 | FromDiscord | <krabbypatty> is there any point in using newSeq and initTable? |
11:57:18 | FromDiscord | <krabbypatty> if that implicit default(T) already exists |
11:58:37 | FromDiscord | <krabbypatty> ok the docs say that we don't need initTable, but it doesn't say anything about newSeq |
11:58:58 | FromDiscord | <Rika> needs newseq |
11:59:04 | FromDiscord | <Rika> refs are nil by default; |
11:59:09 | FromDiscord | <krabbypatty> @Rika also you said that can't be overriden, so I assume I can't have it for my own custom types |
11:59:37 | narimiran | rant: we had lots of complaints about "iff", but nobody ever complained about "eg" |
11:59:52 | FromDiscord | <krabbypatty> @Rika wait but I thought seq wasn't a ref? |
12:00:01 | FromDiscord | <krabbypatty> e.g. this works: `var s: seq[int]; s.add(1)` |
12:00:46 | narimiran | you don't need `newSeq` anymore |
12:00:58 | narimiran | seqs are not nil |
12:01:11 | FromDiscord | <Rika> oh |
12:01:12 | FromDiscord | <Rika> forgot |
12:01:24 | FromDiscord | <Rika> when i see "newXXX" i just assume ref type |
12:01:37 | * | rockcavera joined #nim |
12:01:57 | FromDiscord | <krabbypatty> hmm does this naturally arise from nim's default values for specific types? e.g. seq must have a length somewhere, but that's initialized to zero because it's an int |
12:02:02 | narimiran | https://narimiran.github.io/nim-basics/#_result_variable |
12:02:11 | FromDiscord | <krabbypatty> or does nim have special knowledge of constructors for each type in the stdlib |
12:02:18 | narimiran | check that "Beware!" part |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:12 | FromDiscord | <krabbypatty> it seems weird for result to exist without a notion of constructors in nim |
12:06:43 | * | supakeen joined #nim |
12:08:09 | Araq | there is a notion of construction in Nim but it's not like C++ does it |
12:09:06 | FromDiscord | <krabbypatty> what is it? |
12:16:14 | * | TomDotTom joined #nim |
12:18:02 | * | natrys joined #nim |
12:20:17 | Araq | for a start, to construct an object use the ObjectType(field: value, ...) syntax |
12:20:43 | Araq | that's a "notion" of construction right here. |
12:23:36 | FromDiscord | <krabbypatty> ok so am I correct in saying that the notion arises naturally from default values given to primitive types? |
12:23:48 | FromDiscord | <krabbypatty> e.g. seq's length is initialized to 0 because the default of an int is 0 |
12:25:00 | Araq | well I remember a version of Nim that lacked even the ObjectType(...) syntax, so no, that notion doesn't naturally arise from default values |
12:25:21 | FromDiscord | <krabbypatty> so how does nim know how to construct a seq? |
12:25:43 | FromDiscord | <krabbypatty> in `var s: seq[int]` |
12:26:20 | Araq | well a 'seq' is built-in and its default value is @[] but ok, you can argue that it's the underlying length field which is 0 |
12:26:49 | FromDiscord | <krabbypatty> basically what I'm getting at, is this default value hardcoded inside the compiler |
12:26:57 | FromDiscord | <krabbypatty> or does it come from length being 0 by default |
12:27:00 | FromDiscord | <krabbypatty> because to me the latter is worse |
12:27:17 | Araq | it's hardcoded and there is an accepted RFC to tweak it |
12:27:27 | FromDiscord | <krabbypatty> ok I see, that makes sense |
12:27:39 | FromDiscord | <krabbypatty> so at some point we'd be able to specify our own constructors? |
12:27:53 | FromDiscord | <krabbypatty> and then those would be called when I do `var s: MyType` |
12:28:21 | Araq | read https://github.com/nim-lang/RFCs/issues/252 for the details |
12:28:22 | disbot | ➥ User-defined implicit initialization hooks ; snippet at 12https://play.nim-lang.org/#ix=2xc2 |
12:28:52 | FromDiscord | <krabbypatty> Thanks! |
12:29:40 | Araq | and there have been extensive discussion about this elsewhere too |
12:30:44 | Araq | summary: C++'s excessive support for constructors didn't avoid the need for make_unique so why copy its complexity. |
12:32:29 | FromDiscord | <krabbypatty> I was mostly concerned about it being the latter (constructors just arising from the default values of primitive types) |
12:32:43 | FromDiscord | <Clyybber> constructors that arise from default values are fine |
12:32:56 | FromDiscord | <krabbypatty> because coupled with `result` usage I can easily see that leading to bugs |
12:33:04 | FromDiscord | <krabbypatty> users being trained not to use newSeq, initTable etc |
12:33:21 | FromDiscord | <krabbypatty> and then when you have a type where the default values don't make sense you'll get a bad state for your type |
12:33:28 | FromDiscord | <krabbypatty> if you use `result` |
12:33:56 | Araq | that's true, not really related to 'result' and I'm fighting for a better solution :-) |
12:34:13 | FromDiscord | <Clyybber> I don't think constructors as a language concept itself make sense though, you will still end up with "createSomeObj" even though SomeObj has a constructor itself |
12:34:16 | FromDiscord | <haxscramper> The only types that are really broken from default initialization are ones that use `enum` or `range` fields. For cases where you have fragile internal state - yes, there are some issues with it |
12:34:25 | FromDiscord | <krabbypatty> I mean custom types. |
12:34:30 | FromDiscord | <haxscramper> But if you really need to make it explicit use `{.requiresinit.}` |
12:34:32 | FromDiscord | <Clyybber> so constructors vs proc that constructs something but is not a constructor is really arbitrary |
12:34:35 | FromDiscord | <krabbypatty> e.g. a stack where my stackTop should be -1 |
12:34:56 | FromDiscord | <Clyybber> @krabbypatty default values would solve that |
12:35:48 | FromDiscord | <krabbypatty> I guess yeah |
12:35:53 | FromDiscord | <haxscramper> And since `{.requiresinit.}` basically makes type non default-initlizable you can work with `-1` even now, without bugs. |
12:36:04 | FromDiscord | <haxscramper> There are just some ergonomics issues with it |
12:36:12 | FromDiscord | <krabbypatty> you might want some runtime component in some cases though |
12:36:20 | FromDiscord | <krabbypatty> like a random type that calls time() for its seed |
12:37:02 | Araq | I think if we allow '= value' in objects and make the other .requiresInit we have the best of both worlds |
12:37:12 | FromDiscord | <haxscramper> `.requiresinit.` cover it. It explicitly requires you to call all initializers, so you just can't forget to call it |
12:37:19 | FromGitter | <ynfle> Do i have to declare my own `.items` & `.pairs` if I have `type mySeq = seq[int]`? |
12:37:26 | FromDiscord | <krabbypatty> you can forget to add it |
12:38:05 | FromDiscord | <lqdev> Araq: that would be a nice addition to the language :) |
12:38:12 | FromDiscord | <haxscramper> Araq: `` =value `` as C++ assignment operator where it implicitly converts things on assignment? |
12:38:13 | FromDiscord | <krabbypatty> and then default values for primitive types would lead to bugs, but that's another dicussion 🙂 |
12:38:29 | FromDiscord | <lqdev> right now you have to create an explicit constructor proc with tons of arguments if your object is big |
12:38:50 | FromGitter | <ynfle> I thought if it's not `distinct` you don't have to `{.borrow.}` |
12:39:00 | FromDiscord | <haxscramper> E.g. relaxing requirement on `=` operator prototype, so you can have something else that `(a: var T, b: T)`? |
12:39:09 | Araq | the "runtime component" is usually a misfeature, then your constructor can fail and you're in the C++ world of unclear rules where constructors are functions and functions are not constructors and everything is messy |
12:39:38 | FromDiscord | <krabbypatty> well I'm mostly concerned about type safety and correctness |
12:39:45 | Araq | when I write '= value' I mean inside object declarations |
12:41:01 | Araq | krabbypatty: so do I. But C++ is not the gold standard to follow here even though I admire Stroustrup |
12:41:48 | FromDiscord | <krabbypatty> oh I don't care for C++ 😛 from the RFC it actually seems like I can use functions in the default value initialization |
12:41:56 | FromDiscord | <krabbypatty> so it's more like a lazy initialization |
12:42:04 | FromDiscord | <krabbypatty> so in my Random example you'd still be able to use seed = time()? |
12:42:27 | FromDiscord | <haxscramper> No, current final version only allows constexpr for expressions, not arbitrary code in `=init` |
12:42:42 | FromDiscord | <krabbypatty> hmm ok |
12:42:42 | Araq | you'd be forced to write 'seed = time()' |
12:43:08 | Araq | you can't forget it but it not really hidable |
12:43:12 | Araq | *it's |
12:43:40 | FromDiscord | <krabbypatty> then we go back to the issue of needing .requiresInit. for those cases :p I think that can lead to bugs when authors forget to add .requiresInit. and users forget to call the constructor proc. that's why I dislike the whole concept of default values for primitive types |
12:43:49 | FromDiscord | <krabbypatty> but that's a discussion for another day |
12:47:29 | FromDiscord | <krabbypatty> I read the RFC thread and it seems sensible to start with the more restrictive option of only allowing constexprs tho |
12:48:38 | * | bung quit (Quit: Lost terminal) |
12:51:05 | FromDiscord | <krabbypatty> you could go the other way and instead of allowing implicit initialization hooks, require that a explicit proc (e.g. tagged with .constructor.) is always called |
12:51:22 | FromDiscord | <krabbypatty> that idea is probably full of problems tho |
12:51:45 | FromDiscord | <krabbypatty> and I'm not sure it can be enforced at compile-time |
12:53:53 | leorize[m]1 | it can, requiresInit analysis is pretty good now |
12:53:54 | leorize[m]1 | troublesome for seq though |
13:00:54 | * | rockcavera left #nim (#nim) |
13:00:54 | * | rockcavera joined #nim |
13:04:39 | * | letto quit (Read error: Connection reset by peer) |
13:09:32 | * | letto joined #nim |
13:21:16 | FromDiscord | <scott> is there a simple way to do this https://play.nim-lang.org/#ix=2Bn0, without calling the `default()` function every time? Something like this but which works? https://play.nim-lang.org/#ix=2Bn1 |
13:21:34 | mipri | https://www.manning.com/books/nim-in-action - interesting pricing. you pay them extra if you don't want the printed book |
13:22:46 | narimiran | mipri: hahaha, excellent :D |
13:22:51 | FromDiscord | <scott> weird sale shenanegans. what even is a "livebook"? haha |
13:23:04 | mipri | that's just their web reader |
13:23:10 | FromDiscord | <scott> omg |
13:23:18 | FromDiscord | <scott> that's not a selling point, guys |
13:23:19 | FromDiscord | <Rika> @scott what doesnt work on your examples |
13:23:45 | mipri | scott: your second link only fails because you have a space in front of the 'proc' |
13:24:06 | mipri | of getOrDo |
13:24:13 | FromDiscord | <scott> @Rika I don't want to call the method passed as the `otherwise` argument in the first link |
13:24:24 | FromDiscord | <scott> mipri, oh, whoops |
13:24:28 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2Bn3 but it works?? |
13:25:07 | FromDiscord | <scott> yes, I see. that's not in the stdlib at all? |
13:26:24 | FromDiscord | <Rika> well nim isnt really focused on functional |
13:27:09 | narimiran | you don't do `default()`, but you do `default` |
13:27:32 | Araq | proc get*[T](self: Option[T], otherwise: T): T # what you asked for? |
13:28:04 | FromDiscord | <Rika> they dont want the otherwise proc to run if its not needed |
13:28:15 | narimiran | https://nim-lang.github.io/Nim/options.html#get%2COption[T]%2CT |
13:28:16 | FromDiscord | <scott> Araq, no I want otherwise to be `proc(): T` not `T` |
13:28:25 | narimiran | https://nim-lang.github.io/Nim/options.html#map%2COption[T]%2Cproc(T) |
13:29:06 | FromDiscord | <scott> narimiran, no, map only applies the function if the value is `some`, I want it to only be applied if the value is `none` |
13:29:59 | FromDiscord | <scott> do you think a PR would be accepted for this? I don't want to overstep my bounds as someone new around here but this seems easy enough to add and I don't want to ask anyone to take away time from their current projects |
13:29:59 | Araq | IMHO you really want an 'if' statement instead of emulating control flow with lazy functions |
13:30:00 | FromDiscord | <Rika> is it that undesirable to use your own proc or |
13:30:00 | narimiran | ok, but what's wrong with your version of it? (when you remove that extra space as pointed out by mipri) |
13:30:01 | FromDiscord | <Clyybber> basically get but with template semantics |
13:30:23 | FromDiscord | <Clyybber> narimiran: nothing, hes asking why it isn't in stdlib |
13:31:37 | FromDiscord | <scott> > is it that undesirable to use your own proc or↵↵Idk it's less that and more just trying to learn the language and was confused when I didn't find this proc in the options module, after having used optionals in a bunch of languages. |
13:31:39 | Araq | scott: I would accept a PR but the question of template vs proc callback type isn't an easy one |
13:32:06 | Araq | see our map vs mapIt design in sequtils |
13:32:13 | FromDiscord | <scott> ah |
13:32:18 | FromDiscord | <Rika> languages with optionals tend to be functional languages as well dont they? |
13:32:50 | Araq | Rika: FP is everywhere now |
13:32:53 | FromDiscord | <scott> not always, see C++, Java, Crystal. Lots of OOP languages are tacking on semi-functional features, like `map` and `fold`. |
13:32:55 | FromDiscord | <scott> yeah that |
13:33:29 | FromDiscord | <Rika> eeeh okay |
13:33:45 | FromDiscord | <scott> what are the pros and cons of templates vs proc args? |
13:35:07 | FromDiscord | <Rika> templates are funky when used like a proc i feel |
13:35:24 | FromDiscord | <Rika> see as ar/q says, map vs mapIt |
13:35:27 | FromDiscord | <Rika> in sequtils |
13:35:43 | Araq | templates don't depend on a good backend optimizer and save some keystrokes |
13:36:12 | Araq | the cost is worse error messages |
13:36:25 | FromDiscord | <scott> interesting. |
13:36:28 | Araq | and multi-eval bugs when the template wasn't reviewed by us :P |
13:36:42 | FromDiscord | <Rika> scott if you dont mind a 3rd party maybe look at optionsutil |
13:36:50 | FromDiscord | <Rika> ...i think is the name |
13:37:03 | leorize[m]1 | !repo optionsutil |
13:37:04 | disbot | https://github.com/PMunch/nim-optionsutils -- 9nim-optionsutils: 11Utility macros for easier handling of options in Nim 15 21⭐ 1🍴 |
13:42:56 | leorize[m]1 | Araq: have you got a plan for 1.6.0? |
13:50:51 | FromDiscord | <scott> why do you guys only do even numbers? |
13:51:19 | FromDiscord | <haxscramper> Odd number is devel versions |
13:57:17 | FromDiscord | <scott> ah |
14:05:48 | * | arecacea1 quit (Remote host closed the connection) |
14:06:43 | * | arecacea1 joined #nim |
14:22:04 | Araq | leorize[m]1, IC |
14:22:44 | Araq | bugfixes for viewtypes and ORC aside, the plan is to merge the new not-nil implementation |
14:23:23 | Araq | and then have IC for 1.6. and then once we have IC, remove some or all restrictions wrt to declaration ordering and recursive modules |
14:26:54 | FromDiscord | <scott> what is IC? |
14:27:21 | narimiran | incremental compilation |
14:27:48 | FromDiscord | <Clyybber> speaking of which disruptek/ |
14:28:46 | * | tane joined #nim |
14:36:21 | FromDiscord | <scott> woah, the compiler is already super fast, that would be nuts |
14:47:41 | federico3 | I want distributed IC |
14:51:07 | FromDiscord | <haxscramper> Multithreaded macros when |
14:52:20 | leorize[m]1 | what the even is multithreaded macros? |
14:53:05 | leorize[m]1 | Araq: sounds solid |
14:53:40 | * | nc-x joined #nim |
14:57:27 | * | nc-x quit (Remote host closed the connection) |
15:06:51 | * | Sembei joined #nim |
15:08:44 | * | Pisuke quit (Ping timeout: 256 seconds) |
15:22:24 | disruptek | clyybber: new problem is out-of-order introductions, so i have to bump the counters globally and currently, it seems that either it's not that simple or there's a bug. |
15:23:01 | FromDiscord | <Clyybber> you mean syncing the id->name mappings is bugged? |
15:23:33 | * | Sembei quit (Ping timeout: 260 seconds) |
15:25:00 | disruptek | the case we're talking about is mutable-name with existing global counters that we want to propogate into local conflicts, so, yes, id->name where we already have a globally cached value for that id. |
15:26:04 | disruptek | or something. who the fuck knows anymore. |
15:26:06 | * | Sembei joined #nim |
15:29:47 | FromDiscord | <Clyybber> its a tree |
15:29:58 | disruptek | yes. |
15:30:08 | FromDiscord | <Clyybber> the local conflicts have to be derived from the global ones |
15:30:10 | disruptek | but, like, our impl isn't. for reasons. |
15:30:25 | FromDiscord | <Clyybber> is there a case where local conflicts influence global ones? |
15:30:39 | disruptek | yes, because they arrive first. |
15:32:29 | FromDiscord | <Clyybber> but C has shadowing, why do we care? |
15:32:52 | * | tane quit (Quit: Leaving) |
15:32:59 | disruptek | well, we still need to be able to reference global symbols in local scope. |
15:33:20 | FromDiscord | <Clyybber> yeah, but if we do that we will know while processing the local scope |
15:33:49 | FromDiscord | <Clyybber> and when we process that reference to a global symbol in a local scope, we can handle it accordingly |
15:34:19 | disruptek | tell me more. |
15:34:29 | FromDiscord | <Clyybber> e.g. incrementing the global counter by the local counter |
15:34:49 | disruptek | let me push what i wrote yesterday and you can see what i'm talking about. |
15:34:59 | FromDiscord | <Clyybber> ok |
15:35:01 | disruptek | note the bumpCounter() introduced in cgendata and used in mangler. |
15:35:17 | disruptek | it does that thing. |
15:35:46 | disruptek | it's a hackish design that i increasingly dislike. |
15:36:32 | FromDiscord | <shashlick> @dom96 - do you want to release a new version of choosenim |
15:38:25 | FromDiscord | <Clyybber> disruptek: My point is, just give the global a name whenever you encounter it, it doesn't matter wether you encounter it while processing global scope or while processing local scope |
15:38:45 | disruptek | ah, but then everything gets a counter. |
15:39:09 | FromDiscord | <dom96> @shashlick it would be nice if we could resolve https://forum.nim-lang.org/t/6950 too for the release |
15:39:15 | FromDiscord | <Clyybber> disruptek most stuff probably yeah |
15:39:19 | disruptek | what's slowly happening here is that mangling is turning into current mangling. |
15:39:24 | disruptek | and that defeats the purpose. |
15:39:26 | FromDiscord | <Clyybber> its still better |
15:39:26 | FromDiscord | <dom96> but if you want to quickly cut a new version I don't mind |
15:39:34 | disruptek | it's lame and lazy. |
15:39:53 | FromDiscord | <Clyybber> disruptek: so whats your better idea? |
15:40:11 | FromDiscord | <Clyybber> we could also just append another _ to either global or local symbols hahahaha |
15:40:23 | disruptek | like you said, model the c scope since that's exactly the semantic we need to reproduce. |
15:40:56 | FromDiscord | <shashlick> @dom96 - what exactly is the fix for that forum post |
15:40:58 | disruptek | when the frontend is fixed, we can remove _. or we can rewrite it before codegen. |
15:41:11 | disruptek | s/rewrite it/rewrite incoming ast/ |
15:41:22 | FromDiscord | <dom96> @shashlick no idea |
15:42:07 | FromDiscord | <shashlick> okay - can we move the latest version file from nim-lang.org to github itself - that way we can bump updates without requiring website access |
15:42:33 | FromDiscord | <shashlick> and the nim-lang.org file can simply redirect to the github file |
15:42:46 | FromDiscord | <Clyybber> disruptek: there is no fixing the frontend |
15:42:56 | disruptek | why not? |
15:43:05 | FromDiscord | <Clyybber> because order independence is a nice thing |
15:43:15 | FromDiscord | <Clyybber> disruptek: lets just think about the different ways to solve this |
15:43:30 | disruptek | the complexity exists no matter where. |
15:43:44 | disruptek | you cannot pretend it doesn't because it's "nicer." |
15:43:49 | FromDiscord | <Clyybber> how about this |
15:44:13 | FromDiscord | <Clyybber> globals with a counter of 0 also always get the suffix |
15:44:19 | FromDiscord | <Clyybber> then when we are in a local scope |
15:44:27 | FromDiscord | <Clyybber> we always have a place left for a global |
15:44:44 | FromDiscord | <Clyybber> hmm, but that only works when the global is _0 |
15:44:59 | disruptek | we already do this. |
15:45:10 | FromDiscord | <Clyybber> we reserve places? |
15:45:31 | disruptek | see line 114 in mangler, maybeAddCounter. |
15:45:40 | disruptek | _ == _0 |
15:45:53 | FromDiscord | <shashlick> @dom96 - let me know and I can switch the download file as part of this PR |
15:46:17 | FromDiscord | <dom96> @shashlick I dunno, I'd rather have a separation here |
15:46:23 | FromDiscord | <dom96> let's consider this for later |
15:46:28 | FromDiscord | <Clyybber> disruptek: Yeah, my point is, lets not do that for globals that we encounter in a local scope |
15:46:50 | disruptek | what do you propose instead? |
15:46:50 | FromDiscord | <Clyybber> If we encounter a global first in a local scope, lets give it the _0 instead of just _ |
15:46:58 | FromDiscord | <Clyybber> give it the _0 instead of the \_ |
15:47:02 | disruptek | same difference. |
15:47:05 | FromDiscord | <shashlick> @dom96 - okay cause any releases require this editing so depends on your availability |
15:47:30 | FromDiscord | <Clyybber> disruptek: No, because then your locals stay beautiful |
15:47:35 | FromDiscord | <Clyybber> We can also do it the other way around |
15:47:49 | disruptek | dude, you don't get to pick the order in which this stuff arrives. |
15:47:55 | FromDiscord | <Clyybber> exactly |
15:47:58 | disruptek | you don't get to choose how many globals appear, either. |
15:48:09 | FromDiscord | <Clyybber> thats why you gotta reserve places or append numbers |
15:48:18 | disruptek | we do append numbers. |
15:48:26 | FromDiscord | <Clyybber> my earlier solution would work, but you said it would append numbers everywhere |
15:48:28 | FromDiscord | <Clyybber> which you don't want |
15:49:07 | disruptek | i looked at ropes. |
15:49:10 | FromDiscord | <Clyybber> I say do the simple stuff first, update the local and the global counters when we encounter a global in a local scope |
15:49:29 | FromDiscord | <Clyybber> when we got something working we can think about ways to improve it further |
15:49:50 | FromDiscord | <Clyybber> and more importantly, we can actually test them then |
15:50:22 | * | hnOsmium0001 joined #nim |
15:50:22 | disruptek | we can always test stuff by keeping an oracle. |
15:50:30 | disruptek | the oracle mangles the old way. |
15:51:25 | FromDiscord | <Clyybber> pls no |
15:51:45 | disruptek | well, everything works except megatest, in the prior commit. |
15:52:05 | FromDiscord | <shashlick> @dom96 - added a changelog entry - https://github.com/dom96/choosenim/pull/235 - will merge when done and tag to v0.7.4 |
15:52:05 | disbot | ➥ Fix nimble issue 864 |
15:52:18 | FromDiscord | <Clyybber> disruptek: Cool, lets make everything work now |
15:52:24 | disruptek | neat idea. |
15:52:35 | FromDiscord | <Clyybber> without changing the way the frontend supplies us |
15:52:40 | disruptek | of course. |
15:53:16 | FromDiscord | <Clyybber> so lets do it? |
15:53:16 | disruptek | i have a bloodletting at noon and then i will get to work. |
15:53:40 | FromDiscord | <enthus1ast> how can i test if threads are enabled? (i've tried various, combinations of `when defined(Thread)` `when defined(Channel)` |
15:53:51 | FromDiscord | <Clyybber> disruptek no blood works faster ay? |
15:53:56 | disruptek | you have to check compileSetting("threads") or some shit. |
15:54:01 | disruptek | that should get you closer with grep. |
15:54:20 | FromDiscord | <enthus1ast> thank you for your google fo:) |
15:54:41 | disruptek | yeah, it's annoying. |
15:55:15 | Yardanico | !status |
15:55:17 | FromDiscord | Uptime - 1 day, 4 hours, and 8 minutes |
15:57:18 | FromDiscord | <enthus1ast> `when compileOption("threads")` it is |
15:57:48 | FromDiscord | <enthus1ast> its in system.nim |
15:57:56 | * | tane joined #nim |
15:58:11 | FromDiscord | <19> hello, im trying to statically link sdl2 with nimx by following the commands from here https://github.com/nim-lang/sdl2 but it says `cannot find -lSDL2main` and `cannot find -lSDL2` |
15:58:19 | disruptek | enthus1ast: that's the one! |
15:58:35 | * | filcuc quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/) |
15:59:42 | FromDiscord | <enthus1ast> @19 do you have the static library next to your nim file? |
16:00:09 | FromDiscord | <19> no, i thought it can pick it up from the env variables |
16:01:07 | FromDiscord | <enthus1ast> this i dont know, my guess it that it depends on the linker search path that your os has configured |
16:01:31 | FromDiscord | <19> alright, ill put the lib next to the nim file, thank you very much |
16:01:55 | FromDiscord | <enthus1ast> you can also specify the linker search path with `--passl` |
16:02:03 | FromDiscord | <19> i could distribute the dll with the exe |
16:02:09 | FromDiscord | <19> oh okay, thank you |
16:02:39 | FromDiscord | <enthus1ast> you are aware that for static linking you need an lib file, not dll right? |
16:02:47 | FromDiscord | <enthus1ast> or .a |
16:02:55 | FromDiscord | <19> yes im saying as an alternative solution |
16:06:43 | * | nature joined #nim |
16:16:02 | FromDiscord | <Avatarfighter> Hello hello everyone 😄 |
16:16:13 | ForumUpdaterBot | New thread by Clonk: Writing binary data to SQLite, see https://forum.nim-lang.org/t/6962 |
16:46:56 | FromGitter | <ynfle> Is there a binary tree implemention for nim in the std library? |
16:47:06 | FromGitter | <ynfle> *implementation |
16:48:24 | FromDiscord | <haxscramper> https://nim-lang.github.io/fusion/src/fusion/btreetables.html I'm not sure about it's status (e.g. supported/deprecated etc.), but `import fusion/btreetables` works fine |
16:49:31 | FromDiscord | <Avatarfighter> Fusion ships with nim now? |
16:49:38 | FromDiscord | <Avatarfighter> I didn't realize you could just import it |
16:49:55 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/pull/15061 |
16:49:55 | disbot | ➥ koch: bundle nim-lang/fusion with Nim |
16:50:15 | FromDiscord | <Avatarfighter> oh wow |
16:52:02 | FromDiscord | <haxscramper> Although `btreetables` has severe name clashes with types from regular `tables`, not sure why author choose this naming instead of something like `Map` or only `OrderedTable` |
16:52:37 | FromDiscord | <lqdev> BinTable |
16:52:41 | FromDiscord | <lqdev> or TreeTable |
16:53:16 | FromDiscord | <Avatarfighter> is there any difference between htmlparser in stdlib and fusion? |
16:54:04 | FromGitter | <ynfle> I'm confused is a table or binary tree? |
16:54:17 | FromDiscord | <haxscramper> In this module yes |
16:54:59 | FromDiscord | <Avatarfighter> ynfle: Its a binary tree with the interface of a table from what I'm understanding |
16:55:01 | FromGitter | <ynfle> I want a data structure that has a left and right and data section. Simple binary tree |
16:55:10 | FromGitter | <ynfle> Oh ok |
16:59:12 | FromDiscord | <haxscramper> Yeah, very nice thing to have in stdlib, but naming issues ... I wonder if PR with api that changes all names to `Map` or `TreeTable` would be accepted |
16:59:56 | FromDiscord | <haxscramper> Since it is super confusing to have two identically named types (let alone all procs etc.) in stdlib (well, fusion is technically not a part of, but still really close) |
17:00:42 | Zevv | Hello there, fellow Nimmers! |
17:00:59 | FromDiscord | <Avatarfighter> What's up fellow Nimgineer |
17:01:26 | Zevv | notmuch, notmuch. doing some catching up on the forum and the prs. |
17:01:26 | * | rockcavera quit (Ping timeout: 256 seconds) |
17:01:29 | Zevv | missed a lot I see |
17:01:42 | FromDiscord | <Avatarfighter> haxscramper: do you know what the differences between stdlib htmlparser and fusion htmlparser are? |
17:03:29 | * | rockcavera joined #nim |
17:04:07 | * | Zevv quit (Quit: Lost terminal) |
17:04:29 | * | Zevv joined #nim |
17:04:46 | * | Zevv quit (Client Quit) |
17:05:02 | * | Zevv joined #nim |
17:05:03 | * | Zevv quit (Changing host) |
17:05:03 | * | Zevv joined #nim |
17:05:24 | Zevv | disruptek: https://github.com/nim-lang/Nim/pull/15655 |
17:05:25 | disbot | ➥ experiment showing how iterators can (almost) be implemented with a library solution |
17:05:29 | FromDiscord | <haxscramper> Judging from diff - very little (~20 lines, fusion one has more) |
17:06:00 | * | nature quit (Ping timeout: 258 seconds) |
17:06:02 | FromDiscord | <Avatarfighter> weird |
17:06:06 | * | Zevv quit (Client Quit) |
17:06:14 | FromDiscord | <Avatarfighter> i dont understand why fusion has htmlparser and the stdlib too tbh |
17:06:45 | leorize[m]1 | @Avatarfighter we forgot to remove the stdlib one :P |
17:06:45 | leorize[m]1 | bung fixed htmlparser and moved it to fusion on Araq request |
17:06:47 | * | Zevv joined #nim |
17:07:08 | FromDiscord | <Avatarfighter> oh what we're going to lose stdlib htmlparser? |
17:07:12 | FromDiscord | <Avatarfighter> darn it |
17:07:35 | FromDiscord | <haxscramper> I think I will make issue for treetables in fusion. Something like `BTable`, `BTreeTable`, `TreeTable` or `Map` |
17:08:55 | FromDiscord | <Avatarfighter> yeah that's smart |
17:09:24 | FromDiscord | <Avatarfighter> to access a module in fusion such as htmlparser all i need to do is `import fusion/htmlparser` right? |
17:10:10 | * | rockcavera quit (Ping timeout: 272 seconds) |
17:10:28 | FromDiscord | <Avatarfighter> yup |
17:10:30 | FromDiscord | <Avatarfighter> cool thanks 😄 |
17:10:40 | * | gangstacat quit (Quit: Ĝis!) |
17:14:08 | disruptek | zevv: i know, i saw it. |
17:14:25 | * | gangstacat joined #nim |
17:23:11 | * | rockcavera joined #nim |
17:24:03 | Zevv | cool |
17:24:30 | * | krux02 joined #nim |
17:25:11 | * | krux02 quit (Read error: Connection reset by peer) |
17:26:19 | * | krux02 joined #nim |
17:28:25 | * | krux02 quit (Remote host closed the connection) |
17:30:37 | * | krux02 joined #nim |
17:33:24 | disruptek | maybe you can add something? i think you have ideas about what you want to do with cps that i haven't really internalized. |
17:35:13 | * | gmaggior joined #nim |
17:36:13 | Zevv | I did |
17:36:36 | disruptek | oh nice. |
17:36:37 | disruptek | lol |
17:36:45 | Zevv | lol what |
17:38:06 | FromDiscord | <shashlick> @dom96 - v0.7.4 is built and ready - can you please update the file on nim-lang.org |
17:42:35 | * | Jesin quit (Quit: Leaving) |
17:47:08 | * | TomDotTom quit (Ping timeout: 265 seconds) |
17:51:22 | Zevv | oh man now he's asking all kind of complicated questions and I forgot all of that stuff |
17:52:31 | * | Jesin joined #nim |
17:53:36 | FromGitter | <ynfle> https://play.nim-lang.org/#ix=2Bou Why can this have side effects? |
17:55:30 | Zevv | I think it's the rand() |
17:55:43 | FromDiscord | <Yardanico> rand |
17:55:56 | FromDiscord | <Yardanico> It's a side effect since it access a global random state |
17:56:30 | FromGitter | <ynfle> Oh ok thanks |
17:56:30 | FromDiscord | <haxscramper> Are there plans to generate error message pointing to location where sideffect occurs in function body? |
17:56:37 | Zevv | excellent question |
17:57:53 | FromGitter | <ynfle> didn't distruptek have a module that remove everything but the error? |
17:58:05 | disruptek | !repo dust |
17:58:06 | disbot | https://github.com/disruptek/dust -- 9dust: 11DUST is Unattended Syntax Truncation 15 4⭐ 0🍴 7& 1 more... |
17:58:36 | FromGitter | <iffy> Sometimes I forget to return something from a proc (like this for Futures: https://play.nim-lang.org/#ix=2Box ). Is there some compile-time flag I can enable to detect/prevent this? (Returning Futures and JsonNode are my most common mistakes) |
18:00:58 | disruptek | not sure what the state of dust is. i hack it to solve very particular problems. |
18:01:14 | disruptek | but feel free to ask for help with your problem. |
18:01:51 | * | lritter quit (Quit: Leaving) |
18:03:32 | * | rockcavera quit (Read error: Connection reset by peer) |
18:07:30 | FromGitter | <ynfle> Will it detech sideeffects? |
18:08:04 | disruptek | it's designed to minimize any semantic error, so, yes. |
18:09:45 | FromGitter | <ynfle> 👍 |
18:12:57 | leorize[m]1 | @iffy maybe make an RFC to request that `{.requiresInit.}` can be attached to procs? |
18:13:26 | leorize[m]1 | actually we can experiment with adding `{.requiresInit.}` to `Future[T]` |
18:14:07 | disruptek | make Future a concept. |
18:14:31 | Yardanico | that sounds deep |
18:14:36 | disruptek | oh nevermind, i forgot we don't have concepts. |
18:14:50 | FromGitter | <iffy> But in the Future... |
18:15:03 | * | disruptek 😉 |
18:16:27 | FromGitter | <iffy> leorize: beyond backward compatibility, what's the argument for not making all types {.requiresInit.} by default? I think I don't understand the use case for having uninitialized stuff |
18:17:36 | leorize[m]1 | 0-init can be valid |
18:18:14 | leorize[m]1 | though there are plans to make requiresInit default, indeed |
18:18:17 | FromDiscord | <dom96> @shashlick done |
18:18:18 | disruptek | i think it's fine once we have defaults. |
18:18:31 | disruptek | without defaults, i don't like it. |
18:18:51 | leorize[m]1 | once nil checking gets in we should be a step closer |
18:19:20 | disruptek | to me, the identDefs tweak to typedefs syntax seems the right way |
18:21:11 | FromGitter | <iffy> Where do I put the pragma? This doesn't find the problem compile-time: https://play.nim-lang.org/#ix=2BoF |
18:24:33 | FromGitter | <iffy> @leorize I'm not sure letting me put {.requiresInit.} on procs would prevent me from making the mistake (since the problem is me forgetting to do something -- having to remember to do another thing will not help me) :). If there was a compiler flag that put it on all procs, that would help forgetful me. Glad there are plans to make it default. |
18:24:34 | leorize[m]1 | if it can be put into proc headers it means that `{.push.}` will then apply it to procs |
18:24:39 | disruptek | there are still some parts of stdlib that cannot be fixed thusly. |
18:24:52 | disruptek | i'm thinking of ioselectors here. |
18:26:53 | FromGitter | <iffy> okay; I could remember to do it once per file |
18:28:23 | disruptek | clyybber: another idea: there's some implicit ordering information delivered to us by comparison of identities themselves. not sure how to use this information yet, though, based upon your "order irrelevant" demand. |
18:30:14 | FromDiscord | <UNIcodeX> @disruptek https://github.com/planety/prologue/issues/89#issuecomment-712840105 |
18:30:16 | disbot | ➥ --gc:orc --threads:on slower than --threads:off ; snippet at 12https://play.nim-lang.org/#ix=2BoK |
18:31:40 | disruptek | i would copy the example and link the thread by referencing one or the other in, uh, one or the other. |
18:32:55 | FromDiscord | <Yardanico> ~ystream live doing random stuff |
18:32:55 | disbot | no matching footnotes for `ystream` with regexps `live, doing, random, stuff`. 🙁 |
18:32:58 | FromDiscord | <Yardanico> ~ystream |
18:32:58 | disbot | ystream: 11Stream at https://twitch.tv/yardanico, voice chat either on Mumble (mumble://uberalles.mumbl.io/) or in Discord (https://discord.com/invite/ezDFDw2) -- Yardanico |
18:38:35 | FromDiscord | <UNIcodeX> @disruptek will do. |
18:38:49 | FromGitter | <iffy> @leorize: have a link for the RFC/forum about "plans to make requiresInit default?" I'd like to read that before drafting an RFC |
18:44:11 | Zevv | vi |
18:45:02 | * | rockcavera joined #nim |
18:45:42 | FromDiscord | <Avatarfighter> vim moment |
18:46:43 | Zevv | -EWRONGTERM |
18:47:35 | FromDiscord | <scott> I've been seeing semicolons used to separate arguments in proc defs, like `proc(a: A; b: B) = somethingElse(a, b)`, what's up with that? |
18:48:48 | disruptek | it's just better. |
18:49:03 | Zevv | it's for coding in the dark, it allows you to have more pixels on |
18:49:08 | disruptek | lol |
18:49:15 | FromDiscord | <scott> lol wtf |
18:49:17 | FromGitter | <jrfondren> same as comma, except it allows you to use a comma: proc(a, b, c: int; d: float) |
18:49:27 | * | Zevv quit (Quit: Lost terminal) |
18:49:39 | FromDiscord | <scott> oh so just like when writing a list in plaintext |
18:49:50 | disruptek | what? no. |
18:49:51 | disruptek | THIS |
18:49:52 | * | Zevv joined #nim |
18:49:52 | disruptek | IS |
18:49:53 | disruptek | NIM |
18:49:58 | Zevv | but seriously, I can't find it in the grammar |
18:50:03 | disruptek | oh c'mon. |
18:50:05 | FromDiscord | <haxscramper> Yes. It is also necessary when you have `using` declaration |
18:50:17 | * | rockcavera quit (Read error: Connection reset by peer) |
18:50:21 | FromDiscord | <scott> never seen that one before |
18:50:44 | * | rockcavera joined #nim |
18:50:47 | disruptek | , is dark-mode for proc signatures. |
18:50:57 | disruptek | i love it. |
18:51:00 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features#using-statement |
18:51:17 | FromDiscord | <haxscramper> And manual link |
18:54:25 | FromGitter | <iffy> using! where have you been? |
18:55:51 | disruptek | who knows stuff about click farming? |
18:57:04 | FromDiscord | <Avatarfighter> I do but my battery is about to die |
18:57:14 | disruptek | i fucking knew it. |
18:57:18 | FromDiscord | <Avatarfighter> LOL |
18:57:28 | FromDiscord | <Avatarfighter> could've just asked me directly smh |
18:57:36 | disruptek | i was hoping i was wrong about you. |
18:57:48 | FromDiscord | <Avatarfighter> I am a man of many crafts disruptek |
18:57:54 | * | arecacea1 quit (Remote host closed the connection) |
18:57:55 | disruptek | yeah, yeah, great. |
18:58:00 | FromDiscord | <Avatarfighter> ahah |
18:58:04 | FromDiscord | <Avatarfighter> what you need anyways? |
18:58:10 | disruptek | i need clicks farmed. |
18:58:12 | disruptek | duh. |
18:58:23 | FromDiscord | <Avatarfighter> On what a website? an ad? |
18:58:29 | FromDiscord | <Avatarfighter> cookie cliker? |
18:58:31 | disruptek | airbnb and similar. |
18:58:32 | FromDiscord | <Avatarfighter> clicker |
18:58:43 | FromDiscord | <Avatarfighter> o |
18:58:44 | disruptek | wtf is a cookie clicker? |
18:59:17 | FromDiscord | <Avatarfighter> you've never played that game? |
18:59:22 | disruptek | i have two flies in my house and only jerry likes watching me code. |
18:59:27 | disruptek | go figure. |
18:59:38 | * | arecacea1 joined #nim |
18:59:38 | FromDiscord | <Avatarfighter> rip |
19:00:05 | FromDiscord | <Avatarfighter> the thing with click farming is that its a bit illegal |
19:00:16 | disruptek | i never would have guessed. |
19:00:46 | FromDiscord | <Avatarfighter> I’m glad you couldn’t have guessed. |
19:01:18 | FromDiscord | <Avatarfighter> well ig if you want to talk abt it and you have a signal or something lmk |
19:01:33 | disruptek | what's really weird is, when i put timmy's code on the screen, larry gets interested. |
19:01:55 | disruptek | here's my signal: 🖕 |
19:02:03 | disruptek | are you afraid to talk on irc? |
19:03:43 | disruptek | i guess that's a `yes.` |
19:03:45 | FromDiscord | <Avatarfighter> What no im just too lazy to get my other laptop |
19:03:48 | FromDiscord | <scott> about potentially illegal shit? he should be |
19:03:56 | FromDiscord | <scott> also it's discord which is worse |
19:03:59 | FromDiscord | <Avatarfighter> yeah lol |
19:04:12 | FromDiscord | <Avatarfighter> What you’re suggesting you want to do is straight up fraud |
19:04:50 | Zevv | click farmers, you can just hire those, right? |
19:04:52 | disruptek | so what? |
19:05:03 | FromDiscord | <scott> so be smart about doing illegal shit |
19:05:06 | FromDiscord | <Avatarfighter> Zevv: you can also just use a fuckton of proxies |
19:05:07 | disruptek | talking about crime isn't illegal. |
19:05:11 | FromDiscord | <Avatarfighter> not that i would know |
19:05:22 | disruptek | trust me. |
19:05:24 | FromDiscord | <scott> actually it can be |
19:05:30 | Zevv | can't you just curl those clicks? |
19:05:32 | disruptek | i'm very trustworthy. |
19:05:32 | FromDiscord | <scott> "conspiracy" or whatever |
19:05:39 | Zevv | does it really involve mice and webbrowsers? |
19:05:50 | disruptek | it involves cell phones, usually. |
19:05:57 | FromDiscord | <scott> Zevv you can use selenium I bet |
19:06:06 | FromDiscord | <Avatarfighter> good thing we’re discussing crime theory instead of actual crimes |
19:06:17 | Zevv | phones. Why not boot a fuckton of AOSP emulators |
19:06:23 | Yardanico | updated sqlite database of all messages in #nim (how far irclogs permits) https://drive.google.com/file/d/1ChoIQhKGCTDjliv-ME7XlRMySzGXJLPR/view?usp=sharing |
19:06:27 | Zevv | or, for what it's worth, just one |
19:06:37 | Yardanico | id/timestamp/author/message/service/kind |
19:06:38 | Zevv | Yardanico: graph that shit man, nobody likes plain text |
19:06:40 | FromDiscord | <scott> Zevv, probably cheaper just to hire people with actual shitty phones TBH |
19:06:40 | disruptek | i think phones work out to be cheaper. |
19:06:43 | FromDiscord | <Avatarfighter> Zevv: Devices get fingerprinted, emulators come back as the same device etc |
19:06:53 | Yardanico | 1.3mil entries |
19:06:54 | Zevv | Avatarfighter: Not my emulators |
19:06:57 | FromDiscord | <Avatarfighter> Clicks are usually just ips |
19:07:06 | FromDiscord | <Avatarfighter> Wym Zevv |
19:07:06 | Zevv | I'm up to my elbows in low level android shit over the last years |
19:07:11 | FromDiscord | <Avatarfighter> hehe |
19:07:37 | FromDiscord | <Avatarfighter> Wait do ur android emulators allow adb ? |
19:07:38 | FromDiscord | <scott> "Android device required, will pay minimum wage plus lunch", is cheaper than "spin up a 5-billion core server on AWS to run android's shitty inefficient Java engine to run a browser you could just emulate with selenium |
19:07:50 | Zevv | Avatarfighter sure why not |
19:07:52 | FromDiscord | <scott> (edit) "selenium" => "selenium"" |
19:08:05 | Zevv | scott: that's pretty true. it's also pretty sad |
19:08:09 | FromDiscord | <Avatarfighter> Can I use your emulators for something? |
19:08:17 | disruptek | yes. |
19:08:25 | FromDiscord | <Avatarfighter> or just one to debug an antibot |
19:08:29 | Zevv | you can use them to watch HBO or disney on a deprecated set top box |
19:08:32 | Zevv | I'm not proud of it |
19:08:34 | Zevv | but it pays the bills |
19:08:41 | FromDiscord | <Avatarfighter> Thats so cool |
19:08:58 | FromDiscord | <scott> woah, that using statement is pretty cool |
19:09:03 | FromDiscord | <scott> also, Zevv, that was my point. |
19:09:06 | FromDiscord | <scott> 😦 |
19:09:08 | * | natrys quit (Quit: natrys) |
19:09:09 | Zevv | hehe |
19:09:43 | FromDiscord | <Avatarfighter> i need « real data » from an android app to emulate its requests but it doesnt work for the android emulators ive tried |
19:10:18 | FromDiscord | <Avatarfighter> And not everyone with an android is willing to run my code for some reason that I can’t explain |
19:10:28 | Zevv | I can |
19:10:41 | FromDiscord | <Avatarfighter> 😔 |
19:11:07 | FromDiscord | <Avatarfighter> Do you have a link to download your emulator? |
19:11:50 | FromDiscord | <Avatarfighter> disruptek: what are you trying to do with clicks? Boost an ad? |
19:11:53 | Zevv | nah, it's commercial stuff. We run a custom android port on Someone Elses Computers, and remote & render the OpenGL and streaming video+audio on a settop box |
19:12:08 | Zevv | so the AOSP think's its running on a phone, but it's actually cloudified stuff |
19:12:34 | disruptek | clyybber: okay, so adding _ breaks {.emit: "throw e;".} which is fun. |
19:12:40 | FromDiscord | <Avatarfighter> oh that’s really cool zevv |
19:12:51 | Zevv | yeah that's what I thought when I got started with all that |
19:12:57 | FromDiscord | <Avatarfighter> streaming android stadia style |
19:13:06 | FromDiscord | <Avatarfighter> @ElegantBeef would enjoy this |
19:13:34 | Zevv | the project has grown over this magic high-water-mark where I do no longer enjoy working on projects |
19:13:58 | FromDiscord | <Avatarfighter> Are you burnt out? |
19:14:01 | disruptek | yes. |
19:14:06 | Zevv | oh no way. I'm just old and cynical |
19:14:17 | Zevv | really, I spend 25% of my days ranting |
19:14:49 | FromDiscord | <Avatarfighter> disruptek what was that yes to lmao |
19:14:54 | Zevv | let's put all this frigging shit in frigging containers stacked on other frigging containers and put more frigging other stuff in other frigging containers on top |
19:15:07 | Zevv | no one understand a single *shit* about what stuf actually *does* |
19:15:20 | disruptek | oooh zevv, my pants are getting tight. |
19:15:30 | Zevv | so they come crying when it breaks, and I pull out my strace, ignore container boundaries and namespaces and just peek my way into kernel space |
19:16:05 | Zevv | point my finger on some nifty deadlock in CEPHfs kernel drivers, and ask once more, with my friendliest voice and intonation, why the frigging HELL they think it is a good idea to use CEPH in the first place |
19:16:12 | Zevv | hmm this is all logged, right |
19:16:22 | Zevv | I am not a smart man |
19:16:30 | disruptek | don't worry; names are anonymized. |
19:16:33 | disruptek | i think. |
19:16:38 | Zevv | You are not a smart man |
19:16:49 | * | supakeen puts Zevv in a container |
19:17:26 | Zevv | there is no such thing. containers are an illusion |
19:17:38 | Zevv | but really, this kubernetes stuff? what the hell, really?! |
19:17:42 | Zevv | I will now shut up |
19:17:51 | * | supakeen SECCOMP_SET_MODE_NO_RANT Zevv |
19:18:44 | FromDiscord | <Avatarfighter> kubernetes 🤪 |
19:19:16 | FromDiscord | <haxscramper> clybbernetes |
19:21:41 | FromDiscord | <shashlick> @haxscramper how's your c++ wrapping work going |
19:22:33 | FromDiscord | <haxscramper> I'm trying to figure out how to determine correct way for wrapping forward-declared template classes that are defined in different file |
19:22:42 | FromDiscord | <haxscramper> aka `std::string` |
19:22:58 | Zevv | and are you having fun yet? |
19:23:16 | FromDiscord | <haxscramper> Not the worst think that I had to do today |
19:23:18 | FromDiscord | <shashlick> Use code reordering pragma |
19:23:54 | FromDiscord | <haxscramper> It is not related to nim code, I need to figure out how to squeeze more information from libclang |
19:25:10 | FromDiscord | <haxscramper> It has `getCanonicalType` which is used for working with multiple-declarations-single-definition, but due to how files are parsed it the first place I cannot see actual type definition, so I need to defer analysis |
19:26:09 | FromDiscord | <haxscramper> Since right now I just parse file & wrap everything I see, but I should probably analyze dependency graph and let user decide what should be considered "API header file" |
19:26:54 | * | lbart quit (Read error: No route to host) |
19:27:51 | disruptek | so what's the worst thing you had to do today? |
19:28:07 | * | lbart joined #nim |
19:28:07 | * | lbart quit (Changing host) |
19:28:07 | * | lbart joined #nim |
19:28:12 | disruptek | i had to let bentley's health insurance lapse. the fucking dog has better healthcare than i do. |
19:28:14 | * | rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services))) |
19:28:15 | * | rockcavera joined #nim |
19:28:39 | disruptek | also, i poured a bottle of piss all over my pantleg. life in the country! |
19:29:11 | FromDiscord | <scott> what the actual fuck is your life disruptek |
19:29:13 | FromDiscord | <haxscramper> Electronics homework windows-only proprietary BS that uses literall ungoogle-able alternative to VHDL & i have to run it in wine |
19:29:35 | disruptek | c'mon, i'm a fungi. |
19:30:04 | FromDiscord | <scott> must be nice |
19:30:06 | FromDiscord | <scott> the simple life |
19:30:11 | FromDiscord | <scott> just play your part in the food chain |
19:30:37 | disruptek | i make people feel better about their code. |
19:31:05 | Zevv | code shaming is a thing, you know |
19:31:14 | disruptek | just doing my part. |
19:31:23 | Zevv | and we all appreciate you for that |
19:31:38 | FromDiscord | <Yardanico> i'll revert to the old way of mentioning people ("ping nick", "Nick: hello" at the start of the message, or "@nick") |
19:32:09 | Prestige | Sounds good |
19:32:39 | disruptek | i think irc people should be able to :nimdog: or whatever. |
19:32:40 | Prestige | will I be able to do partial mentions, like @yard |
19:33:13 | FromDiscord | <scott> maybe `nick,`? I think hexchat autocompletes to that if you start typing someone's name at the beginning of the message |
19:33:23 | Zevv | I used to live with a mate in this huge empty building that use to house an insurance company or something. It was huge and cold, and I chose to live in the library, which was on the far end of the toilets. We left after 2.5 years, I think we left almost 500 botles of piss |
19:33:46 | Zevv | it could have been much worse, right, in 2.5 years |
19:34:00 | FromDiscord | <scott> half of me is like "wtf" the other half is "that sounds kinda nice, all that space" |
19:34:06 | disruptek | depends on how big your bottles are. |
19:34:12 | FromDiscord | <Yardanico> @scott maybe |
19:34:32 | Zevv | oh it was pretty great. we had this rock band from romania we met somewhere on the street live with us for 3 months. |
19:34:34 | voidpi | Zevv: if you kept logs you can view them with bitline! |
19:34:37 | Zevv | some artists in residence. and the parties. |
19:34:54 | Zevv | I view my life with bitline |
19:35:03 | voidpi | Zevv: it compiles ok void btw |
19:35:12 | voidpi | in void I mean |
19:35:17 | Zevv | what's void? |
19:35:20 | voidpi | linux |
19:35:24 | Zevv | ah right cool |
19:35:32 | Zevv | if it compiles, ship it |
19:35:50 | voidpi | yes PM |
19:36:09 | disruptek | i'd say 3000ml is about the maximum acceptable bottle size. |
19:36:28 | disruptek | anywhere below that, you should be fine. |
19:36:33 | * | FromDiscord quit (Remote host closed the connection) |
19:36:46 | * | FromDiscord joined #nim |
19:36:56 | Yardanico | @Yardanico: hi |
19:36:57 | voidpi | you can always water the trees |
19:36:59 | FromDiscord | <Yardanico> 123 |
19:37:05 | Yardanico | ping yardanico |
19:37:06 | disruptek | christ, this again? |
19:37:10 | Yardanico | disruptek: :D |
19:37:13 | Yardanico | not for long |
19:37:16 | Yardanico | but yeah it works now |
19:37:21 | Yardanico | both irc way and @ way |
19:37:28 | Yardanico | well irc way only at the start |
19:37:36 | Zevv | no graphs, no game |
19:37:43 | Yardanico | Zevv: you have graphomania |
19:37:48 | disruptek | no socks, no shoes. |
19:38:52 | Yardanico | !status |
19:38:54 | FromDiscord | Uptime - 2 minutes |
19:39:00 | Yardanico | !getlastid |
19:39:02 | FromDiscord | UID of Yardanico who sent/edited a message most recently on Discord is 177365113899057152 |
19:39:23 | Yardanico | !getdiscid disruptek |
19:39:25 | FromDiscord | disruptek#7015 has Discord UID: 667097779541377047 |
19:39:40 | * | rockcavera quit (Ping timeout: 246 seconds) |
19:39:42 | disruptek | look at that. i'm a fuckin' badass. |
19:39:46 | Yardanico | 777 |
19:40:47 | Zevv | Yardanico: I do, I do |
19:40:57 | * | TomDotTom joined #nim |
19:42:17 | supakeen | where are the graps? |
19:42:21 | Yardanico | grapes? |
19:42:25 | supakeen | graphs |
19:42:30 | Zevv | grapes are cool too |
19:42:52 | supakeen | do i need to give Zevv graphs? |
19:42:53 | Zevv | "grap" * ("h" | "e") * "s" |
19:43:08 | supakeen | Zevv: https://i.imgur.com/89qkXOR.png there you go |
19:43:13 | FromGitter | <matrixbot> `BarrOff` Hello, is there a way to use pointer arithmetic? Could not find anything about this in the manual |
19:43:21 | Zevv | supakeen: you're kidding right |
19:43:33 | supakeen | i thought you had graphomania |
19:43:43 | FromDiscord | <Vindaar> you guys want graphs? gotta talk to me |
19:43:45 | Zevv | I recently got some kid telling me "No use grafana, that's waay better then ntop" |
19:43:49 | Yardanico | lol |
19:44:03 | Zevv | I waited for him after work with some friends. we beat him up. |
19:44:14 | supakeen | hah jokes on you i work from home |
19:44:22 | Zevv | I know where your house lives |
19:44:30 | FromDiscord | <dom96> oh, are we sharing our graphs? https://media.discordapp.net/attachments/371759389889003532/768197971836928060/unknown.png |
19:44:44 | supakeen | yay graphs |
19:45:07 | supakeen | be careful, Zevv will beat you up too :( |
19:45:08 | FromDiscord | <Yardanico> i've shared a lot of nimble graphs in the past |
19:45:15 | FromDiscord | <dom96> pff, I can take him |
19:45:26 | Zevv | bitline graphs are cooler then that |
19:45:30 | FromDiscord | <Avatarfighter> You guys have good looking graphs wtf |
19:45:32 | Zevv | because they render at 100+ fps |
19:46:10 | FromDiscord | <dom96> Still can't believe how stable this damn game I wrote is |
19:46:16 | FromDiscord | <Yardanico> I did graphs like this with neo4j for nimble packages https://media.discordapp.net/attachments/371759389889003532/768198399093768192/ev86AAK.png |
19:46:31 | supakeen | its a real graph! |
19:46:32 | Zevv | dom96: well, is that because of *you* or because of the *language* you used? |
19:46:37 | FromDiscord | <dom96> I remember the days when Nim services leaked memory left and right |
19:46:58 | disruptek | i'm old enough to remember when async leaked. |
19:46:58 | supakeen | dom96: what's your backend for your stats? |
19:47:03 | Zevv | look at my graphs http://zevv.nl/div/.old/2020-10-11%2022-10-48.mp4 |
19:47:12 | FromDiscord | <dom96> I mean... both. I found a leak in Nim and fixed it |
19:47:21 | FromDiscord | <dom96> supakeen: prometheus |
19:47:22 | Zevv | dom96: great stuff |
19:47:23 | supakeen | Zevv: is that grafana ;) |
19:47:34 | * | supakeen runs away |
19:48:05 | Zevv | I have now reached that fragile level of alcohol where I don't care about your shit anymore |
19:48:11 | Zevv | but I'm also no quite drunk |
19:48:30 | FromDiscord | <dom96> I think disruptek has had a bad effect on you |
19:48:32 | disruptek | i'm like that all the time. |
19:49:51 | Zevv | I think we share some traits |
19:50:59 | FromDiscord | <dom96> Anybody got contacts at LWN? |
19:51:03 | FromDiscord | <dom96> Cause this shit ain't cool https://lwn.net/SubscriberLink/834571/e8d7adc0d9b669bc/ |
19:51:07 | * | krux02 quit (Remote host closed the connection) |
19:51:14 | * | rockcavera joined #nim |
19:51:22 | Zevv | yeah let's wait for these guys after work, and beat'em up |
19:51:29 | * | ForumUpdaterBot quit (Remote host closed the connection) |
19:51:51 | Zevv | but really, I think LWN loves input from guest writers. |
19:52:29 | Zevv | "We will currently pay $300 for well-done articles from new authors" |
19:52:29 | FromDiscord | <dom96> Cool, who wants to write the same article but about Nim? |
19:52:36 | Zevv | y |
19:52:38 | * | ForumUpdaterBot joined #nim |
19:52:44 | Zevv | yeah, we really need someone with writing experience |
19:52:49 | FromDiscord | <dom96> oh nice, you get to promote Nim /and/ you get $300 |
19:52:59 | TomDotTom | dom96: Last time I tried it was a RPITA to create a deployable binary with Julia |
19:54:33 | ForumUpdaterBot | New thread by Xendi: Console dropdown how?, see https://forum.nim-lang.org/t/6965 |
19:56:33 | FromDiscord | <scott> author of that article doesn't even seem to have any published julia projects https://github.com/Cyberax?tab=repositories |
19:56:41 | FromDiscord | <Yardanico> maybe private |
19:56:50 | FromDiscord | <scott> true |
19:57:02 | Zevv | so, dom96 will be earning $300 this week, right? |
19:57:12 | Yardanico | or miran :P |
19:58:37 | FromDiscord | <dom96> I got other projects on my plate that are way more fun |
19:58:40 | supakeen | hah i'm doing a little presentation this weekend about nim i think |
19:58:47 | FromDiscord | <scott> I'd do it but I literally just started learning nim this week |
19:59:04 | FromDiscord | <scott> supakeen do it |
19:59:07 | FromDiscord | <scott> write it up |
19:59:15 | supakeen | i mean it's just slides |
19:59:31 | FromDiscord | <haxscramper> @scott Can write section about learning experience etc. |
20:00:46 | FromDiscord | <scott> idk I'm not really your typical learner. |
20:00:48 | * | narimiran quit (Ping timeout: 258 seconds) |
20:01:11 | FromDiscord | <scott> nim is like my 20th language. by this point I have a process for learning new languages that wouldn't apply to your typical beginner |
20:02:10 | FromDiscord | <scott> I make a lot of assumptions your typical Python or C programmer wouldn't |
20:02:38 | FromDiscord | <haxscramper> Well, from my experience nim is good when you already know something (usually python, C++ maybe some FP/LISP) and want to get a better language that combines all neat features, so it might be a good think actually |
20:02:53 | FromDiscord | <scott> fair point |
20:03:06 | Zevv | I think Nim as few surprises when coming from below |
20:03:22 | Zevv | but when coming from above, it'll hit you in the face every now and then I guess |
20:03:23 | FromDiscord | <scott> Nim has more than a few surprises regardless haha |
20:03:40 | FromDiscord | <scott> not sure what you mean by above/below though |
20:03:47 | Zevv | Read "C", "Python" |
20:03:53 | FromDiscord | <scott> oh I see |
20:04:11 | supakeen | if you know the problems nim is solving because you come from c some things are easier |
20:04:13 | Zevv | If you come from C, Nim is very cool and natural, it's just C done right |
20:04:14 | supakeen | p much |
20:04:23 | Zevv | if you come from python and think "Heeeey this all looks familiar" |
20:04:24 | supakeen | if you don't then it's 'harder' |
20:04:29 | FromDiscord | <scott> yeah, so true |
20:04:49 | supakeen | or well, harder, i doubt that we write plenty of small things in nim at work and about half of those don't have experience with things 'lower' than nim :) |
20:05:55 | supakeen | just used to different limitations |
20:22:11 | FromDiscord | <ElegantBeef> @Avatarfighter god damn it if you mention stadia to me again, i might purge my nim repos and go learn rust to distance myself from you 😛 |
20:22:58 | FromDiscord | <Yardanico> @ElegantBeef write in V instead |
20:23:01 | FromDiscord | <Yardanico> :nimDog: |
20:23:09 | FromDiscord | <scott> @ElegantBeef I'm not sure what your beef is with stadia but it's not worth it haha |
20:23:34 | FromDiscord | <ElegantBeef> Dont worry it's a joke |
20:23:51 | FromDiscord | <scott> I figured haha |
20:24:41 | * | xioren joined #nim |
20:24:45 | * | rockcavera quit (Ping timeout: 240 seconds) |
20:24:57 | * | rockcavera joined #nim |
20:25:58 | FromDiscord | <ElegantBeef> If curious my issue with stadia is it's the single most efficient DRM 😄 |
20:26:16 | FromDiscord | <scott> oh haha that's a damn good reason |
20:31:53 | FromDiscord | <alehander42> ?? |
20:31:56 | FromDiscord | <alehander42> guys |
20:31:57 | FromDiscord | <alehander42> hey |
20:32:01 | FromDiscord | <Idefau> hey |
20:32:03 | FromDiscord | <alehander42> i need to go back to the not nil stuff |
20:32:05 | FromDiscord | <alehander42> how is it |
20:32:58 | FromDiscord | <alehander42> disruptek whaaat |
20:33:04 | FromDiscord | <alehander42> i havent moved to crystal 😄 |
20:34:15 | FromDiscord | <alehander42> i write rust |
20:34:26 | FromDiscord | <alehander42> a bit, but i mostly debug it and try to fix stuff |
20:34:39 | FromDiscord | <alehander42> so yeah how is the pattern matching stuff going @haxscramper |
20:35:03 | FromDiscord | <alehander42> (i also did some go these weeks and a bit lua) |
20:35:13 | FromDiscord | <haxscramper> It is technically done, I just don't have time to sit down, stare at it for like whole day to finalize my thoughts |
20:35:23 | FromDiscord | <alehander42> i kinda .. started digging some rust features |
20:35:34 | FromDiscord | <haxscramper> And since fusion is now shipped with nim I will most likely be PRing it to fusion, not stdlib |
20:36:09 | FromDiscord | <alehander42> but i should keep calm and not do the "lets do those 2 things in nim " stuff |
20:36:19 | FromDiscord | <alehander42> hm, cool |
20:36:29 | FromDiscord | <alehander42> i should try it one of those days |
20:36:47 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2BpL |
20:36:56 | FromDiscord | <alehander42> 😮 |
20:37:01 | FromDiscord | <alehander42> sounds good |
20:37:11 | FromDiscord | <Avatarfighter> Lmao i felt like it was so relevant @ElegantBeef |
20:37:22 | * | rockcavera quit (Remote host closed the connection) |
20:37:36 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2BpM |
20:37:59 | FromDiscord | <haxscramper> Or write HTML templating with full DSL only by defining enum + node type |
20:38:22 | FromDiscord | <Avatarfighter> You would love karax |
20:38:27 | FromDiscord | <Avatarfighter> !repo karac |
20:38:29 | disbot | https://github.com/nodeschool/karachi -- 9karachi: 11Repository for organizing the karachi nodeschools events 15 20⭐ 10🍴 7& 29 more... |
20:38:31 | FromDiscord | <Avatarfighter> whoops |
20:38:37 | FromDiscord | <Avatarfighter> !repo karax |
20:38:39 | disbot | https://github.com/pragmagic/karax -- 9karax: 11Karax. Single page applications for Nim. 15 607⭐ 50🍴 7& 14 more... |
20:38:46 | FromDiscord | <Avatarfighter> html dsl |
20:38:53 | FromDiscord | <alehander42> haha |
20:39:01 | FromDiscord | <haxscramper> I reused the same parser so syntax is the same |
20:39:04 | FromDiscord | <Avatarfighter> ah |
20:39:11 | FromDiscord | <alehander42> sounds .. intriguing |
20:39:19 | FromDiscord | <alehander42> a good idea to make it eneral! |
20:39:20 | FromDiscord | <alehander42> general |
20:39:30 | FromDiscord | <haxscramper> But the point is - it wasn't even indended feature, I just realized I could do this in like ~80 lines |
20:39:43 | FromDiscord | <alehander42> again a HN post |
20:39:50 | FromDiscord | <alehander42> about nim today, a language written in nim |
20:40:29 | FromDiscord | <Avatarfighter> HN loves us |
20:40:37 | FromDiscord | <Avatarfighter> i see nim on it a little too often |
20:40:45 | FromDiscord | <alehander42> haha indeed |
20:40:55 | FromDiscord | <ElegantBeef> If they loved nim so much why dont they use it 😄 |
20:41:10 | FromDiscord | <Avatarfighter> 😳 |
20:44:58 | FromDiscord | <shashlick> Link? |
20:45:01 | FromDiscord | <Idefau> i want to sleep with Nim |
20:45:39 | FromDiscord | <hobbledehoy> https://news.ycombinator.com/item?id=24834636↵This one? |
20:47:24 | * | TomDotTom quit (Ping timeout: 272 seconds) |
20:47:50 | FromDiscord | <haxscramper> @alehander42 I also decided that DSL parser + some implementation details should also be exported & documented, so people might either reuse codegen part of parser for DSL |
20:48:20 | FromDiscord | <haxscramper> Things like https://haxscramper.github.io/hmisc/src/hmisc/macros/matching.html#Match |
20:59:56 | * | Vladar quit (Quit: Leaving) |
21:07:57 | FromDiscord | <tomck> I'm trying to use the 'with' macro i saw mentioned here, but it's saying `Error: cannot open file: with`: https://nim-lang.org/docs/with.html#with.m%2Ctyped%2Cvarargs%5Buntyped%5D↵↵I'm just using `import with`. Am i being silly, is something wrong here? |
21:08:07 | Yardanico | import std/with |
21:08:13 | Yardanico | new nim stdlib modules are in std namespace |
21:08:15 | Yardanico | "namespace" |
21:08:34 | FromDiscord | <tomck> errrrrrr |
21:08:41 | FromDiscord | <tomck> so what about sequtils & everything else |
21:08:45 | FromDiscord | <tomck> that still works |
21:08:54 | Yardanico | yes, but for all new modules it's only std/stuff |
21:08:56 | Yardanico | you can do the same for old ones |
21:08:59 | Yardanico | which is the recommended way |
21:08:59 | FromDiscord | <tomck> or is it just new modules? Should i be writing `import std/` for 'forwards compatibility'? |
21:09:12 | Yardanico | import std/[sequtils, times, strutils, with] |
21:09:14 | FromDiscord | <tomck> oh so it's recommended to write just sequtils, not std/sequtils? |
21:09:16 | Yardanico | you can do it like that |
21:09:21 | Yardanico | @tomck it's better to use std now |
21:09:22 | FromDiscord | <tomck> i see |
21:09:25 | FromDiscord | <tomck> right, ok |
21:09:38 | FromDiscord | <tomck> cool, thanks |
21:09:43 | FromDiscord | <scott> _revises open nim file_ |
21:10:31 | FromDiscord | <scott> it's not really very clear in the discord app there that I did the /me thing :/ |
21:27:03 | FromDiscord | <Clyybber> disruptek why |
21:27:10 | disruptek | why what? |
21:27:15 | FromDiscord | <Clyybber> why does it break the emit |
21:27:16 | * | tane quit (Quit: Leaving) |
21:27:24 | disruptek | because e_ != e. |
21:27:39 | FromDiscord | <Clyybber> but old mangling isn't e either |
21:27:46 | disruptek | why not? |
21:27:48 | FromDiscord | <Clyybber> right? |
21:28:02 | FromDiscord | <Clyybber> old mangling is e_18r81948929482ihe9s |
21:28:10 | FromDiscord | <Clyybber> figuratively speaking |
21:31:06 | FromDiscord | <Clyybber> disruptek |
21:31:21 | disruptek | well, i guess not, right? |
21:31:35 | disruptek | i'm not making this stuff up. |
21:31:41 | disruptek | much as i'd like to. |
21:31:58 | FromDiscord | <Clyybber> why does old mangle not mangle it |
21:32:33 | FromDiscord | <Clyybber> isn't emit supposed to use ` anyways? |
21:33:00 | FromDiscord | <Clyybber> I don't remember, but can you try throw `e` |
21:34:01 | disruptek | /home/adavidoff/git/Nim/nimcache/tests/compiler/tcppCompileToNamespace.nim_f6f87c9fdcf8b3c3f07f93f1ee8712c9/stdlib_system.nim.cpp:3222:9: error: ‘e’ was not declared in this scope; did you mean ‘e_’? |
21:34:06 | disruptek | 3222 | throw e; |
21:34:08 | disruptek | | ^ |
21:34:09 | disruptek | does that help? |
21:34:11 | disruptek | | e_ |
21:34:58 | disruptek | it's literally pushCurrentException(e_); throw e; |
21:35:15 | disruptek | might just be a codegen bug due to laziness. |
21:35:38 | disruptek | anyway, i am trying to figure out foo_int. |
21:36:42 | disruptek | tfThread had some special handling once but i took it out. now it seems to be biting me again. |
21:39:44 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:44:15 | FromDiscord | <kodkuce> is nim community growing it feels like more post and stuff |
21:44:42 | FromDiscord | <scott> this is just after a release, it's pretty common for a surge of community activity after a major release |
21:45:18 | Zevv | kodkuce: Ive heard there's dozens of us |
21:45:26 | FromDiscord | <ElegantBeef> Atleast 10 |
21:45:40 | FromDiscord | <scott> I know that's why I'm here. As soon as I heard Nim had ARC I started trying to learn |
21:46:27 | * | gmaggior quit (Quit: Leaving) |
21:46:49 | FromDiscord | <scott> at least 560 of us! https://github.com/nim-lang/Nim/graphs/contributors |
21:47:03 | FromDiscord | <Yardanico> that's not the best way to measure :) |
21:47:04 | FromDiscord | <Clyybber> disruptek ah ok, did you implemennt the solution to the order problem? |
21:47:06 | FromDiscord | <Yardanico> also check github nim projects |
21:47:41 | FromDiscord | <Yardanico> there are at least 473 nim repos on github updated in the last month |
21:47:44 | FromDiscord | <Yardanico> https://github.com/search?q=language%3Anim+pushed%3A%3E2020-09-21 |
21:49:55 | disruptek | clyybber: yep. |
21:51:56 | FromDiscord | <kodkuce> hmm duno i feal like it got 30% buff |
21:52:01 | Yardanico | nah |
21:52:09 | Yardanico | there are a lot of people who use nim but don't chat here at all |
21:52:30 | FromDiscord | <kodkuce> i was saying in total, forums, reddit hacker news |
21:52:53 | FromDiscord | <scott> reddit and HN definitely blow up at release time for any language |
21:52:55 | FromDiscord | <kodkuce> like in last 2-3 months we got 30% more people |
21:52:59 | Yardanico | not really :) |
21:53:07 | Yardanico | reddit and hacker news are just active after articles and new releases |
21:53:08 | FromDiscord | <kodkuce> :( |
21:54:18 | leorize[m]1 | this release was big though |
21:54:18 | leorize[m]1 | and a lot more positive |
21:54:59 | leorize[m]1 | we saw a bigger boom in activity compared to 1.2 release for sure (I guess it's kinda expected when people stay home) |
21:55:12 | disruptek | ironic, because it doesn't actually have any banner features. |
21:55:29 | FromDiscord | <Recruit_main707> True |
21:55:37 | disruptek | i think it's more about "hmm, .4 release of stable. i guess it's getting usable." |
21:56:07 | disruptek | "it's starting to look like there might be something to this nim thing..." |
21:56:12 | FromDiscord | <scott> personally, I don't know why, but I didn't hear about ARC at 1.2. If I had I would've gotten more involved then. I really do think some of it comes down to luck or timing |
21:56:17 | FromDiscord | <dom96> Yardanico: sshshhhh |
21:56:36 | FromDiscord | <scott> @disruptek ↵↵This but unironically lol |
21:56:48 | Yardanico | he wasn't ironic :) |
21:57:17 | leorize[m]1 | we're on a steady path to world domination :P |
21:57:31 | disruptek | also, people that talk about nim at a 1.4 release are people that played with it as a result of the 1.2 release. and so on. |
21:57:39 | FromDiscord | <Recruit_main707> It’s all coming together.gif |
22:02:22 | * | a_b_m joined #nim |
22:03:32 | FromGitter | <matrixbot> `✾ Lum` hi there |
22:04:26 | leorize[m]1 | hi, please join our chat via the matrix irc bridge to avoid being double bridged |
22:04:28 | leorize[m]1 | ~matrix |
22:04:28 | Yardanico | don't use matrix->gitter |
22:04:29 | disbot | matrix: 11Nim channels on Matrix can be found at +nim:asra.gr (https://matrix.to/#/+nim:asra.gr) |
22:04:32 | Yardanico | yeah this |
22:05:44 | * | abm quit (Ping timeout: 256 seconds) |
22:06:29 | * | Lum[m] joined #nim |
22:06:40 | leorize[m]1 | welcome :) |
22:07:11 | FromDiscord | <ElegantBeef> Nice got anon tuples to be parseably by json in nim, but not nimscript |
22:08:24 | FromDiscord | <ElegantBeef> `attempt to access a nil address` ah yes so much information |
22:08:29 | Yardanico | import segfaults |
22:08:36 | Yardanico | and enable stack traces |
22:08:45 | Yardanico | oh, well if you're in the vm it won't help much probably |
22:10:01 | * | Lum[m] is now known as lum[m] |
22:10:41 | FromDiscord | <ElegantBeef> any ideas what's wrong here https://play.nim-lang.org/#ix=2Bqh |
22:10:43 | leorize[m]1 | snippets please if it's the VM :P |
22:10:55 | FromDiscord | <iWonderAboutTuatara> Are variables destroyed with each iter of a loop? |
22:11:19 | leorize[m]1 | it depends on what you mean by destroyed |
22:11:30 | FromDiscord | <ElegantBeef> Yea leorize i was getting it, just had to format it since there's the large amount of docs for the `to` proc |
22:11:39 | FromDiscord | <iWonderAboutTuatara> Is the value reset |
22:12:08 | FromDiscord | <ElegantBeef> They're scoped variables |
22:12:14 | leorize[m]1 | @iWonderAboutTuatara yes |
22:12:47 | FromDiscord | <iWonderAboutTuatara> Are they destroyed/dealloced? |
22:12:59 | FromDiscord | <iWonderAboutTuatara> Also, is there a for/else or while/else or equivalent |
22:13:16 | FromDiscord | <scott> in regards to the latter question, yes |
22:13:26 | FromDiscord | <iWonderAboutTuatara> What's the syntax for it? |
22:13:29 | FromDiscord | <iWonderAboutTuatara> I looked and didn't find |
22:14:21 | FromDiscord | <scott> crap, nvm, must've been thinking of another language https://play.nim-lang.org/#ix=2Bqj |
22:14:45 | FromDiscord | <scott> oh, I was thinking of pony. sorry |
22:15:52 | FromDiscord | <ElegantBeef> I'm guessing there is an issue with the VM in that the result isnt intialized? |
22:16:05 | FromDiscord | <iWonderAboutTuatara> No worries |
22:16:29 | FromDiscord | <iWonderAboutTuatara> Should be possible via macros or templates but the syntax will be too ugply to be worth it |
22:17:06 | FromDiscord | <scott> sent a code paste, see https://play.nim-lang.org/#ix=2Bqm |
22:18:56 | * | rockcavera joined #nim |
22:19:16 | FromDiscord | <ElegantBeef> Leorize here is a usable example https://play.nim-lang.org/#ix=2Bqo |
22:19:29 | FromDiscord | <ElegantBeef> Works in nim but not the vm |
22:22:25 | * | sagax quit (Ping timeout: 244 seconds) |
22:23:38 | FromDiscord | <ElegantBeef> Weirdly the issue is just with anon tuples https://play.nim-lang.org/#ix=2Bqs |
22:23:47 | leorize[m]1 | https://play.nim-lang.org/#ix=2Bqp <- you can open a bug report now |
22:25:35 | FromDiscord | <ElegantBeef> I assume any of these examples will suffice? |
22:29:57 | * | NimBot joined #nim |
22:30:14 | FromDiscord | <ElegantBeef> @Avatarfighter look what you made me due, i found a bug... |
22:30:19 | FromDiscord | <ElegantBeef> (edit) "due," => "do," |
22:30:46 | leorize[m]1 | you can open a report with both :P |
22:30:48 | FromDiscord | <Avatarfighter> whoops 🤷 |
22:31:16 | FromDiscord | <ElegantBeef> I mean it's the same error so doesnt really matter as it's the same issue |
22:32:42 | FromDiscord | <ElegantBeef> After this is fixed i'll probably PR to add support to the json library for serializing/deserializing tuples |
22:32:53 | FromDiscord | <ElegantBeef> As someone forgot to actually allow the serializing of them |
22:33:43 | FromDiscord | <ElegantBeef> https://github.com/nim-lang/Nim/blob/devel/lib/pure/json.nim#L361 |
22:33:54 | FromDiscord | <ElegantBeef> it's meant for objects/ tuples but only... accepts objects |
22:34:45 | FromDiscord | <scott> how will that work? For example, what if you try to `parseJson("[\"one\", 2, 3.0]").to(tuple[float, string, int])`, vs `parseJson("[\"one\", 2, 3.0]").to(tuple[string, int, float])` since most JSON serializers don't pay attention to order |
22:35:38 | FromDiscord | <scott> idk, maybe they do, but a JSON list to a tuple doesn't seem like a straightforward conversion to me |
22:35:43 | FromDiscord | <ElegantBeef> It stores the data in `field0`, `field1`, `field2` |
22:36:21 | FromDiscord | <ElegantBeef> So you can only parse it into the proper tuple type with the same ordering |
22:36:32 | disruptek | i serialize named tuples to objects and unnamed to array. |
22:36:33 | FromDiscord | <scott> oh ok |
22:36:35 | disruptek | !repo jason |
22:36:36 | disbot | https://github.com/disruptek/jason -- 9jason: 11JSON done right 🤦 15 29⭐ 1🍴 |
22:37:08 | FromDiscord | <ElegantBeef> Im weary of all serializing libraries that arent in the stdlib 😄 |
22:37:20 | disruptek | weary or wary? |
22:37:24 | disruptek | or are you wooly? |
22:38:00 | FromDiscord | <ElegantBeef> wary |
22:38:05 | FromDiscord | <ElegantBeef> Due to needing it to run in the VM 😄 |
22:38:06 | FromDiscord | <scott> disruptek, I was talking about deserializing a JSON `Array<Union<Int, Float, String>>` into a tuple of arbitrary order of all 3 types |
22:38:21 | FromDiscord | <ElegantBeef> I serialize anon tuples into an object aswell |
22:38:25 | FromDiscord | <ElegantBeef> As it makes the most sense |
22:38:40 | disruptek | only if they have name. |
22:38:42 | disruptek | only if they have names. |
22:38:49 | disruptek | no names, no sense. |
22:38:51 | FromDiscord | <scott> @ElegantBeef huh?> |
22:38:52 | FromDiscord | <scott> (edit) "huh?>" => "huh?" |
22:39:03 | disruptek | there's no such thing as Union in JSON. |
22:39:08 | FromDiscord | <ElegantBeef> Well without names it's fine since tuples are ordered pairs |
22:39:19 | FromDiscord | <ElegantBeef> and nim lets us extract the `field#` using `fieldPairs` |
22:39:30 | disruptek | eh field# is a hack. |
22:39:30 | FromDiscord | <ElegantBeef> well order groups rather |
22:39:31 | FromDiscord | <scott> disruptek, I meant the typescript type notation for the JSON representation of some data |
22:39:42 | disruptek | typescript can kiss my ass. |
22:39:52 | FromDiscord | <scott> fair enough |
22:39:52 | disruptek | it's right up there with bob marley and van morrison. |
22:39:54 | FromDiscord | <ElegantBeef> Well yes, but considering my main goal is nimscript interop i think it's fine |
22:39:58 | FromDiscord | <Avatarfighter> I love typescript |
22:40:32 | FromDiscord | <ElegantBeef> Named tuples serialize no problem as they're just fugly objects, anon tuples practically just have fieldnames as their properties |
22:40:57 | disruptek | how is that not more accurately an array? |
22:41:21 | disruptek | Field0, Field1 ... this is just noise. |
22:41:21 | FromDiscord | <nikki> i don't like typescript either but i wanna hear why you dislike it |
22:41:28 | FromDiscord | <scott> but my point is that the type of `["one", 2, 3.0]` is ambiguous. Is it an array of a union type or a tuple of 3 values? If it's a tuple, how do you deserialize it? I.E. do you associate by order or by type |
22:41:44 | FromDiscord | <ElegantBeef> Tuples are ordered so if my goal is to save tuples yes |
22:42:01 | FromDiscord | <ElegantBeef> An array works aswell as field names |
22:42:07 | disruptek | first of all, if the types aren't the same, it's not an array or even a seq. |
22:42:10 | disruptek | obvs. |
22:42:29 | FromDiscord | <ElegantBeef> Yea which is why i didnt use an array, as tuples arent uniformed types |
22:42:36 | FromDiscord | <ElegantBeef> the field names are free and sitting there |
22:42:42 | disruptek | it's a tuple because it's immutable and so, what else? |
22:43:01 | disruptek | the field names aren't free, for two reasons: |
22:43:12 | disruptek | they cost money to serialize, and they cost money to deserialize. |
22:43:25 | FromDiscord | <scott> but JSON doesn't have tuples, only arrays |
22:43:29 | FromDiscord | <ElegantBeef> I meant free as in they're not something i have to implement |
22:43:31 | disruptek | not my problem. |
22:43:46 | disruptek | i only care about compile-time serialization/deserialization. |
22:43:49 | FromDiscord | <ElegantBeef> I was using index but the index couldnt be evaluated at compile time 😄 |
22:43:55 | disruptek | wut |
22:47:03 | FromDiscord | <ElegantBeef> Guess you dont need the index |
22:48:01 | FromDiscord | <ElegantBeef> This works fine aswell i guess https://play.nim-lang.org/#ix=2Bqx |
22:48:19 | FromDiscord | <ElegantBeef> But still have that vm issue i cant work around |
22:48:55 | * | PMunch quit (Quit: leaving) |
22:48:56 | * | rockcavera quit (Read error: Connection reset by peer) |
22:49:06 | * | tiorock joined #nim |
22:49:06 | * | tiorock quit (Changing host) |
22:49:06 | * | tiorock joined #nim |
22:49:06 | * | tiorock is now known as rockcavera |
22:51:07 | * | tiorock joined #nim |
22:51:07 | * | tiorock quit (Changing host) |
22:51:07 | * | tiorock joined #nim |
22:51:07 | * | rockcavera is now known as Guest45396 |
22:51:07 | * | Guest45396 quit (Killed (card.freenode.net (Nickname regained by services))) |
22:51:07 | * | tiorock is now known as rockcavera |
22:53:05 | * | rockcavera quit (Killed (beckett.freenode.net (Nickname regained by services))) |
22:53:05 | * | rockcavera joined #nim |
23:08:12 | FromDiscord | <notchris> Hello all, does anyone remember the question from yesterday regarding csfml and how it has procedures for passing uniforms to gl shaders |
23:08:54 | FromDiscord | <notchris> So I was able to pass values to a shader, worked alright, but now im thinking for some reason that when i pass an array of vec2s, its not getting the whole array |
23:09:31 | FromDiscord | <notchris> The length of this array is 3, correct? `var col: colors = [vec3(255.0, 0, 255.0), vec3(255.0, 0, 0), vec3(255.0, 255.0, 0)]` |
23:09:51 | leorize[m]1 | yes |
23:10:01 | FromDiscord | <notchris> Good so im not crazy 😄 |
23:10:20 | FromDiscord | <notchris> So then i pass the array to the shader via this procedure |
23:10:25 | leorize[m]1 | it'd be better if you can tell us how you did it so we can diagnose the issue |
23:10:30 | FromDiscord | <notchris> ` wbShader.setVec3UniformArray("colors", col[0], 3)` |
23:10:42 | FromDiscord | <notchris> And the question from yesterday was about the second parameter |
23:11:01 | FromDiscord | <notchris> `graphics.setVec3UniformArray: proc (shader: Shader, name: cstring, vectorArray: var Vector3f, length: int){.cdecl.}` |
23:11:16 | FromDiscord | <notchris> Specifically `vectorArray: var Vector3f` |
23:11:32 | FromDiscord | <notchris> Which appears to want to have me pass only the first array item |
23:11:46 | leorize[m]1 | what wrapper are you using? |
23:11:57 | FromDiscord | <notchris> lemme grab the doc one sec |
23:12:42 | FromDiscord | <notchris> im using `https://github.com/oprypin/nim-csfml` |
23:12:51 | * | rockcavera quit (Remote host closed the connection) |
23:12:52 | FromDiscord | <notchris> But i think Prestige shared a more recent doc |
23:12:55 | FromDiscord | <notchris> looking |
23:14:01 | FromDiscord | <scott> oh man oprypin just has to show up everywhere lol |
23:15:24 | FromDiscord | <notchris> someone you know? 😄 |
23:15:35 | leorize[m]1 | the wrapper looks terrible by today standards though |
23:15:37 | leorize[m]1 | but I guess sfml is not really popular in Nim |
23:16:31 | FromDiscord | <notchris> 😦 |
23:16:41 | FromDiscord | <notchris> i thought it would be fun to try, maybe im better off with sdl2? |
23:16:42 | FromDiscord | <scott> yes he's a very common contributor to Crystal, for example https://github.com/oprypin/crsfml |
23:17:01 | FromDiscord | <dom96> it works well |
23:17:06 | FromDiscord | <dom96> I used his wrapper before |
23:17:16 | FromDiscord | <notchris> Ooo never heard of crystal, cool |
23:17:30 | FromDiscord | <notchris> so if im passing everything right, maybe its my shader? |
23:17:39 | FromDiscord | <notchris> but someone in the OpenGL IRC told me the shader should be fine |
23:17:55 | FromDiscord | <notchris> Which makes me wonder if the uniform array values are being passed correctly |
23:18:09 | FromDiscord | <dom96> the only complaint I have about it IIRC is that it was inconsistent with SFML's method names |
23:18:30 | FromDiscord | <notchris> Well that and the latest doc isnt online |
23:18:30 | FromDiscord | <scott> yeah I've been doing a lot of crystal the past couple years but development has pretty much ground to a halt and it's got a lot of significant problems, while nim's development is at a really nice steady pace |
23:18:36 | FromDiscord | <notchris> you have to generate your own to have latest doc |
23:18:38 | leorize[m]1 | judging from his activities I guess he jumped ship to crystal |
23:18:39 | leorize[m]1 | wrapping array as `var` is terrible |
23:18:54 | FromDiscord | <notchris> so am i right to only pass the first array item |
23:18:55 | FromDiscord | <notchris> ? |
23:19:05 | FromDiscord | <notchris> is it really passing the whole array |
23:19:19 | leorize[m]1 | @scott that's weird considering how crystal seems to have much better tooling regarding FFI compared to nim :P |
23:19:35 | leorize[m]1 | @notchris it should be correct |
23:19:37 | leorize[m]1 | but the wrapper is still terrible in that aspect |
23:19:49 | FromDiscord | <notchris> well the thing is |
23:19:51 | leorize[m]1 | can't say much because that might have been the only way to do it a few years back |
23:19:59 | FromDiscord | <notchris> the shader apparently is correct, but nim spits out this error |
23:20:07 | FromDiscord | <notchris> `Error: unhandled exception: value out of range: 2 notin 0 .. 1 [RangeDefect]` |
23:20:08 | FromDiscord | <scott> I haven't tried FFI in Nim yet, but writing Crystal bindings was a genuine pleasure. They definitely have that down for sure |
23:20:30 | FromDiscord | <notchris> in any case, maybe i should consider a different renderer |
23:20:38 | FromDiscord | <notchris> i just liked how easy it was to pass uniforms |
23:20:45 | FromDiscord | <ElegantBeef> Checkout aglet |
23:20:57 | FromDiscord | <ElegantBeef> !repo aglet |
23:20:57 | FromDiscord | <notchris> Ooo i think i saw that one briefly, lemme check it out again |
23:20:58 | disbot | https://github.com/liquid600pgm/aglet -- 9aglet: 11A safe, high-level, optimized OpenGL wrapper and context manager. 15 12⭐ 1🍴 |
23:21:15 | FromDiscord | <notchris> Oh dang |
23:21:17 | FromDiscord | <ElegantBeef> Super easy to use |
23:21:24 | FromDiscord | <notchris> yeah this doesn't look too bad 😄 |
23:21:40 | FromDiscord | <ElegantBeef> It also feels like idiomatic nim 😄 |
23:22:11 | FromDiscord | <notchris> it just sucks that |
23:22:17 | FromDiscord | <notchris> glsl is not easy to debug in vscode |
23:22:17 | FromDiscord | <Recruit_main707> Crystal bindings work in a similar way to nim ones if I remember correctly |
23:22:24 | leorize[m]1 | @scott yep their tooling on FFI appears to be top-notch. Nim only has a strong FFI facility, the tooling to make them is not very mature yet |
23:22:31 | FromDiscord | <ElegantBeef> use nimsl instead 😄 |
23:23:00 | FromDiscord | <ElegantBeef> Nimsl implements a faux gpu so you can debug shaders like they're cpu code |
23:23:22 | FromDiscord | <notchris> oh yeah @ElegantBeef any time i try to use aglet |
23:23:25 | FromDiscord | <notchris> i get `SIGABRT: Abnormal termination.` |
23:23:32 | FromDiscord | <notchris> from any of the examples |
23:23:42 | leorize[m]1 | ping @lqdev |
23:23:59 | FromDiscord | <ElegantBeef> What OS? |
23:24:22 | FromDiscord | <scott> sent a code paste, see https://play.nim-lang.org/#ix=2BqK |
23:24:51 | FromDiscord | <notchris> osx 10.15 @ElegantBeef |
23:25:00 | FromDiscord | <ElegantBeef> Ah mac + opengl D: |
23:25:03 | FromDiscord | <notchris> i know i know |
23:25:08 | FromDiscord | <scott> then you would be able to call `SomeLib.function 1, 2`. How would that work in Nim? |
23:25:10 | FromDiscord | <notchris> but i usually have no problem with gl |
23:25:11 | FromDiscord | <ElegantBeef> It's' 3.3 though i believe |
23:25:13 | FromDiscord | <Yardanico> @scott proc function(a, b: cint): cint {.importc.} |
23:25:31 | FromDiscord | <Yardanico> @scott proc function(a, b: cint): cint {.importc, header: "myheader.h".} |
23:25:31 | FromDiscord | <scott> hah, seriously? That's even nicer |
23:25:44 | FromDiscord | <ElegantBeef> So it should work on mac, although he recently did just showcase it in #gamedev working there |
23:25:59 | FromDiscord | <ElegantBeef> Did you try most recent aglet version chris? |
23:26:15 | FromDiscord | <notchris> yeah i just reinstalled on nimble |
23:26:20 | FromDiscord | <notchris> i could make an issue |
23:26:36 | FromDiscord | <notchris> nimble pulls latest, right? |
23:26:41 | FromDiscord | <ElegantBeef> just for shits and gigs `nimble install aglet@#head` |
23:26:49 | FromDiscord | <notchris> yeah lemme try |
23:27:06 | FromDiscord | <ElegantBeef> It should fetch most recent, but eh software will be software |
23:27:18 | FromDiscord | <notchris> Yeah it fails at `glfwCreateWindow` |
23:27:21 | FromDiscord | <notchris> with sigabrt |
23:27:32 | FromDiscord | <ElegantBeef> I hope you have glfw installed 😄 |
23:27:45 | leorize[m]1 | update your glfw I guess? |
23:27:49 | FromDiscord | <notchris> hmm i should |
23:27:54 | FromDiscord | <notchris> lemme check my brew version |
23:28:20 | FromDiscord | <notchris> 3.3.2? |
23:28:24 | FromDiscord | <ElegantBeef> 3.3.2.1 here |
23:28:35 | FromDiscord | <notchris> reinstalling rn |
23:28:35 | FromDiscord | <ElegantBeef> Actually i dont have either installed 😄 |
23:28:41 | FromDiscord | <notchris> lets see if that helps |
23:29:03 | FromDiscord | <scott> buen suerte |
23:29:23 | FromDiscord | <notchris> gracias, no es justo |
23:29:31 | FromDiscord | <notchris> mas dificil |
23:29:42 | FromDiscord | <Recruit_main707> buena, but not bad |
23:29:43 | FromDiscord | <notchris> my spanish is awful sorry |
23:30:00 | FromDiscord | <ElegantBeef> My spanish is aswell, considering i dont know any spanish |
23:30:13 | FromDiscord | <Recruit_main707> Bruh |
23:30:14 | FromDiscord | <scott> thanks @Recruit_main707 |
23:30:48 | FromDiscord | <notchris> omg |
23:30:54 | FromDiscord | <notchris> it must have been glfw |
23:30:59 | FromDiscord | <notchris> reinstalled on brew and now it works |
23:31:16 | FromDiscord | <ElegantBeef> Yay we did it! |
23:31:17 | FromDiscord | <notchris> 😅 |
23:31:19 | FromDiscord | <notchris> WOO |
23:31:28 | FromDiscord | <ElegantBeef> I'm still confused why i can open a window without glfw installed |
23:31:34 | FromDiscord | <notchris> 😮 |
23:31:57 | FromDiscord | <scott> _hates the partyparrot thing_ |
23:32:04 | FromDiscord | <notchris> you should have said 'gl' |
23:32:09 | FromDiscord | <notchris> would have also been funny btw |
23:32:30 | FromDiscord | <notchris> drumhit |
23:35:32 | FromDiscord | <scott> at least the partyparrot isn't as bad as on slack where it's animmated even when the window is unfocused. So distracting when you're trying to work |
23:36:24 | FromDiscord | <exelotl> I'm kinda scarred by partyparrot tbh |
23:38:05 | FromDiscord | <exelotl> at my previous job there weren't really any good emotes besides that, so it became the default reaction for almost every situation |
23:38:21 | FromDiscord | <scott> oh god |
23:38:28 | FromDiscord | <scott> I'm so sorry |
23:38:30 | FromDiscord | <ElegantBeef> You guys are all laid off, but it's ok cause we have :partyparrot:! |
23:39:27 | FromDiscord | <Yardanico> tfw #main has more offtopic than #offtopic |
23:41:20 | * | astronavt joined #nim |
23:46:40 | FromDiscord | <MiniApple> hi |
23:46:55 | FromDiscord | <MiniApple> ~~is nim popular?~~ |
23:47:49 | mipri | https://www.tiobe.com/tiobe-index/ - top 100 but not top 50. |
23:49:13 | FromDiscord | <Yardanico> huh |
23:49:18 | mipri | http://www.modulecounts.com/ has nimble < dub, but with a more promising slope, and crystal and Julia several thousand modules ahead though no particular slope difference. |
23:49:22 | FromDiscord | <Yardanico> they actually added zig in this release and told its exact position |
23:49:27 | FromDiscord | <Yardanico> "Adrian Arroyo Calle suggested to add the Zig language to the TIOBE index. Zig meets all criteria and enters the TIOBE index at position #114. Thanks for this suggestion, Adrian!" |
23:56:48 | FromDiscord | <MiniApple> oh lol thank |
23:57:28 | FromDiscord | <Yardanico> but yeah, nim isn't "popular" in the main definition of "popular" |
23:58:16 | FromDiscord | <MiniApple> is there some game engine? |
23:58:57 | FromDiscord | <ElegantBeef> You can use godot |
23:59:05 | FromDiscord | <MiniApple> hmm |
23:59:05 | mipri | and there were some NimConf 2020 videos about games: https://www.youtube.com/channel/UCDAYn_VFt0VisL5-1a5Dk7Q/videos |
23:59:38 | FromDiscord | <MiniApple> ok |
23:59:49 | FromDiscord | <ElegantBeef> You can also make your own engine using SDL2 or opengl 😄 |
23:59:53 | FromDiscord | <MiniApple> @ElegantBeef i don't like game engine like godot,unity,unreal |