00:00:07 | stefanos82 | if I'm using an IDE, yes I will use my mouse |
00:00:20 | stefanos82 | if I'm using Vim, I don't really need it |
00:00:42 | Araq | that would mean you never need to select text in Vim. |
00:01:01 | stefanos82 | I use my keys to highlight the areas I want to |
00:01:39 | Araq | yeah and with a mouse you could do that faster. ;-) |
00:01:46 | stefanos82 | lol |
00:02:16 | stefanos82 | to be honest, I haven't had the need to highlight any code up to now |
00:05:46 | stefanos82 | what editor did you use before VS code Araq? |
00:08:47 | CodeVance | Is there something similar to weakref list in nim? |
00:10:37 | * | xet7 quit (Quit: Leaving) |
00:12:18 | stefanos82 | CodeVance: https://github.com/nim-lang/Nim/blob/devel/tests/gc/weakrefs.nim |
00:12:26 | FromGitter | <Quelklef> woah Araq you're against keyboard-only setups? |
00:13:19 | CodeVance | thanks |
00:13:33 | FromGitter | <Quelklef> I'm surprised. It feels like the whole (programming) world is holding Vim & co. as the ultimate way to edit |
00:14:41 | stefanos82 | Nim team, to whom it may concern: this works https://nimble.directory/ |
00:14:43 | stefanos82 | this does not https://nimble.directory/docs/collections//collections/weakref.html |
00:14:56 | stefanos82 | obviously I cannot find docs/ anywhere in it |
00:15:33 | CodeVance | stefanos82: that example makes my head hurt |
00:15:46 | stefanos82 | the weakref test? |
00:15:47 | CodeVance | I want something that doesn't get in the way of the gc |
00:16:01 | Araq | keyboard-only setups are barbaric and no programmer believes in them. |
00:16:22 | FromGitter | <Quelklef> It's how I personally work |
00:16:29 | FromGitter | <Quelklef> Obviously not with Chrome etc. but |
00:16:31 | Araq | here is my reasoning: No programmer argues for a keyboard-only smart phone. |
00:16:36 | stefanos82 | Araq: that "no programmer" is definitely not me and many thousands of Vim users |
00:16:41 | CodeVance | Use what works. CTRL+SHIFT+P VSCODE ftw |
00:16:59 | FromGitter | <Quelklef> Yeah, that's because typing on a smartphone is a pain but the touch interface is otherwise quite smooth and natural |
00:16:59 | Araq | smart phones got the touch screen, an evolution of the "point to" device called mouse. |
00:17:22 | CodeVance | Araq: no programmer in their right mind should try programming on a smartphone |
00:17:27 | stefanos82 | how can you compare touch screens with keyboard now...seriously man |
00:17:38 | stefanos82 | CodeVance: EXACTLY! |
00:17:43 | FromGitter | <Quelklef> Sure, Araq, but there's a big difference |
00:17:54 | stefanos82 | I won't have thumbs by the end of my coding lol |
00:17:57 | FromGitter | <Quelklef> For many phones, the touch screen is the single interface to the phone (sans, say, volume buttons) |
00:18:02 | CodeVance | touch screen is even more intuitive than the mouse |
00:18:08 | Araq | exactly. |
00:18:14 | Araq | "even more intuitive". |
00:18:19 | FromGitter | <Quelklef> But computers have both mice and keyboards and the issue is that switching between the two is troublesome |
00:18:56 | stefanos82 | I really don't understand Araq's obsession with mouse |
00:19:04 | CodeVance | The problem is that no touch based programming language has surfaced yet which takes advantage of touch. Plus I'm not sure if touch apps are more "productive" |
00:19:17 | Araq | that's just your opinion. My keyboard is big enough so that I need to "switch" from letters to digits |
00:19:17 | FromGitter | <Quelklef> Type some code, move your hand to the mouse, make a selection, move back |
00:19:30 | FromGitter | <Quelklef> You can't just reach?? |
00:19:40 | CodeVance | Araq should go all the way. use only a roll ball |
00:20:10 | FromGitter | <Quelklef> I mean that's irrelevant anyway; that's one keyboard and doesn't generalize like your claim does |
00:20:15 | Araq | type some letters, type some digits, notice you got them wrong, change the hand positioning |
00:21:09 | CodeVance | switch windows Alt->Tab or hand on mouse -> move mouse -> look -> click |
00:21:13 | Araq | change to the cursor keys, try to scroll with them... |
00:21:30 | Araq | it's just an illusion of a frictionless device |
00:21:32 | stefanos82 | lol the whole hand movement is totally pointless when I'm just a character away from substituting the whole word or line with Vim |
00:21:54 | FromGitter | <kayabaNerve> I love how Nim files compile separately and link versus me getting 1 10,000 line piece of trash |
00:21:56 | stefanos82 | have you ever tried Vim Araq? |
00:22:05 | Araq | and what if you are nut "just a character away"? |
00:22:09 | Araq | *not |
00:22:15 | FromGitter | <Quelklef> Uh, change to cursor keys? `hjkl` |
00:22:20 | stefanos82 | Araq: OK make them two then |
00:22:24 | Araq | what if you are 10 lines away? do you then count to 10? |
00:22:37 | Araq | I did use VIM. it's stupid crap. |
00:22:42 | stefanos82 | I have line numbers enabled |
00:22:43 | FromGitter | <Quelklef> For how long? |
00:22:56 | Araq | for 6 months. |
00:23:00 | stefanos82 | LOL! |
00:23:06 | stefanos82 | I rest my case your honor |
00:23:12 | stefanos82 | no further questions! |
00:23:14 | Araq | why? |
00:23:28 | Araq | should I have used it for 10 years before realising it's bonkers? |
00:23:54 | FromGitter | <kayabaNerve> ^^ |
00:23:57 | FromGitter | <Quelklef> I think it's more like |
00:24:13 | stefanos82 | you have the same mentality as those who read a "24 hours" book and expect to become gurus |
00:24:16 | Araq | you can't even use your cursor as a primitive mark to go back after a scroll action. |
00:24:18 | FromGitter | <Quelklef> Well, first of all, that's 6mo of use, not necessarily of learning |
00:24:21 | stefanos82 | this is not the Matrix man, chill |
00:24:23 | stefanos82 | http://norvig.com/21-days.html |
00:24:45 | FromGitter | <rayman22201> I am going to stay out of the editor debate going on here but I will second @Varriount's request to review my code :-P |
00:24:52 | FromGitter | <rayman22201> https://github.com/nim-lang/Nim/pull/8260 |
00:25:02 | stefanos82 | just use / and search for the keyword you are looking for |
00:25:05 | stefanos82 | it will take you there |
00:25:26 | FromGitter | <Quelklef> Araq you should try Kakoune |
00:25:28 | Araq | I don't "search" for my cursor position |
00:25:30 | stefanos82 | you have this feature with Sublime-family, which I'm sure VS code has it and you don't like Vim that had this for decades now? |
00:25:31 | FromGitter | <Quelklef> it's like Vim but seems less arcane |
00:26:10 | stefanos82 | kakoune looks like a Vim-wanna-be |
00:26:17 | FromGitter | <Quelklef> It's the opposite |
00:26:24 | Araq | not to mention that typing speed in an editor with mouse support is not my bottleneck when programming anyway. |
00:26:32 | FromGitter | <Quelklef> It's not about typing speed |
00:27:10 | Araq | yeah, it's about productivity. and I've yet to meet a productive Vim user ;-) |
00:27:22 | stefanos82 | Araq: be honest with us now...did anyone traumatized you as a child with forced typing and since then you got obsessed with mice? |
00:27:29 | FromGitter | <Quelklef> Hmm |
00:27:52 | stefanos82 | Araq: go say that to FaceBook, Google, and the largest companies out there |
00:27:55 | FromGitter | <Quelklef> How do you feel about Emacs Araq |
00:27:58 | stefanos82 | do it as a survey |
00:28:00 | Araq | stefanos82, try to play any shooter or RTS with only a keyboard. |
00:28:24 | stefanos82 | how can you compare these two completely different subjects with keyboard vs mouse? |
00:28:25 | Araq | and be enlightened that a mouse really is a useful additional tool in your toolbox |
00:28:33 | FromGitter | <Quelklef> ??? |
00:28:40 | FromGitter | <Quelklef> You don't program in a 3d environment |
00:28:50 | FromGitter | <Quelklef> In which you have to react to threats with microsecond precision |
00:29:04 | stefanos82 | man, you are too eccentric for my taste |
00:29:06 | Araq | computer games are about productively issueing commands to a computer. |
00:29:10 | FromGitter | <Quelklef> No |
00:29:14 | FromGitter | <Quelklef> No, they're not, at all |
00:29:21 | Araq | yes, they are. |
00:29:26 | FromGitter | <Quelklef> If CS:GO was about productively killing the enemy team it'd be played by bots |
00:29:30 | Araq | realtime games are. |
00:29:30 | FromGitter | <Quelklef> It's about a fun challenge |
00:29:34 | Araq | realtime games are. |
00:29:35 | FromGitter | <Quelklef> That's why there's no aim assist |
00:29:44 | FromGitter | <Quelklef> Example, for concreteness? |
00:30:04 | Araq | just watch a professional Starcraft player |
00:30:33 | FromGitter | <Quelklef> Unfortunately, I've never played Starcraft so I can't speak on it |
00:31:09 | FromGitter | <Quelklef> I don't think the fact that people *do* play SC with the mouse means it's the right way, anyway. |
00:31:13 | Araq | so yeah, when we look at the systems where effectively issuing commands gives you a strategic advantage. |
00:31:29 | FromGitter | <Quelklef> I think you should read this: https://web.archive.org/web/20160314074451/http://archive.oreilly.com/pub/a/oreilly//news/zenclavier_1299.html |
00:31:29 | Araq | we see the combination of keyboard+mouse succeed. |
00:31:42 | FromGitter | <Quelklef> Hmmm |
00:31:43 | CodeVance | thats in a world where the commands are limited in number |
00:31:47 | FromGitter | <Quelklef> Yeah |
00:31:50 | FromGitter | <Quelklef> What he said ^ |
00:32:00 | CodeVance | Blender says one hand on keyboard one hand on mouse |
00:32:03 | FromGitter | <Quelklef> I wouldn't be surprised if there were just a few hotkeys all of which could be done with the left-hand |
00:32:09 | FromGitter | <Quelklef> Leaving the right open |
00:32:32 | FromGitter | <rayman22201> As entertaining as this is, I think we might be getting a bit off topic.... |
00:32:54 | Araq | well I'm done. feel free to disagree with me. |
00:33:06 | FromGitter | <Quelklef> Fair enough |
00:33:10 | FromGitter | <Quelklef> I still think you should read that article |
00:33:16 | FromGitter | <Quelklef> It's fun and interesting even if you disagree |
00:33:45 | stefanos82 | if I were doing some 3D programming, most probably I would need to use mouse |
00:33:48 | FromGitter | <kayabaNerve> @Quelklef No aim assist means you need to be better at what you're doing. Productivity focuses on speed, but really the concept is speed AND quality. |
00:34:03 | stefanos82 | but not with Vim and my limited professional programming skills |
00:34:13 | FromGitter | <kayabaNerve> Skill video games are about being the most productive you can be, as a personal challenge, for fun. |
00:34:30 | FromGitter | <kayabaNerve> I play Halo not for my mad skills, but rather because I love the story. |
00:34:31 | FromGitter | <Quelklef> @kayabaNerve I don't quite understand what you're saying |
00:34:43 | FromGitter | <Quelklef> "Productivity focuses on speed, but really the concept is speed AND quality." |
00:34:45 | FromGitter | <rayman22201> guys. Seriously. off-topic... |
00:34:48 | FromGitter | <kayabaNerve> But CS: GO/StarCraft? Those are all about being the most productive |
00:34:56 | FromGitter | <Quelklef> Right, for the human |
00:35:05 | FromGitter | <Quelklef> Not on the level of interfacing the goal and the human |
00:35:09 | FromGitter | <Quelklef> That's deliberately imperfect |
00:35:20 | FromGitter | <kayabaNerve> @Quelklef if I work for 10 hours, I'm productive. If all I did was write `echo "Test"`, my work sucks since it took ten hour. |
00:35:33 | FromGitter | <Quelklef> @rayman22201 I don't see anything on-topic happening that needs more precedence... |
00:35:36 | FromGitter | <Quelklef> @kayabaNerve Okay, ... |
00:35:42 | FromGitter | <rayman22201> @Quelklef lmao |
00:35:48 | FromGitter | <kayabaNerve> @Quelklef So productivity isn't speed, sorry, but time put in |
00:35:50 | FromGitter | <rayman22201> code review my stuff :-P |
00:36:02 | FromGitter | <kayabaNerve> Video games are Productivity + Quality of Work |
00:36:41 | FromGitter | <Quelklef> So you're saying the goal of a video game is to minimize the amount of effort put in while maximizing the outcome |
00:36:59 | FromGitter | <Quelklef> A *competitive* video game, let's say |
00:37:17 | CodeVance | The on topic thingy is the code review peeps |
00:37:26 | FromGitter | <Quelklef> Who's code reviewing? |
00:37:37 | FromGitter | <kayabaNerve> And the fun, in skill based games, is the personal challenge |
00:37:38 | CodeVance | <rayman22201> https://github.com/nim-lang/Nim/pull/8260 |
00:37:56 | FromGitter | <Quelklef> @CodeVance I mean there's no conversaton |
00:38:02 | FromGitter | <kayabaNerve> @Quelklef No. It's maximizing the outcode. Productivity + Quality of Work doesn't care if you passed out. It cares if you did it. |
00:38:13 | FromGitter | <kayabaNerve> Halo however, can be skill based, or can be story based, and is different |
00:38:18 | FromGitter | <kayabaNerve> CodeVance: Want to review my code? |
00:38:29 | FromGitter | <Quelklef> @kayabaNerve I think you've disconnected a bit from the original point |
00:38:35 | CodeVance | Ya cause you guys are philosophising user computer interfaces. |
00:38:45 | FromGitter | <Quelklef> Which is efficiency of the interface |
00:39:13 | FromGitter | <Quelklef> Araq pointed out that mouse/keyboard is used in video games, where you have to be really precise and quick |
00:39:23 | FromGitter | <kayabaNerve> I was just disagreeing with you disagreeing with Araq about if VGs focused on productivity |
00:39:32 | FromGitter | <kayabaNerve> Not about efficiency or different interfaces |
00:39:41 | FromGitter | <kayabaNerve> @Quelklef Logs are from IRC which doesn't handle message updates |
00:39:54 | FromGitter | <Quelklef> Ah, well |
00:39:57 | CodeVance | I think its winding down |
00:40:08 | FromGitter | <rayman22201> Honestly. Even if there isn't a higher priority on topic discussion, other people come here to see Nim related things. Not computer interface philosophy. Take it to another room. Be considerate... |
00:40:13 | FromGitter | <kayabaNerve> @rayman22201 I like the idea for a better search |
00:40:22 | CodeVance | @kayabanerve what code? |
00:40:39 | FromGitter | <kayabaNerve> CodeVance github.com/kayabaNerve/Pacman3D |
00:40:50 | CodeVance | @rayman I think it was a long day for everyone |
00:40:58 | FromGitter | <kayabaNerve> That's a broken PacMan 3D game in SFML that didn't get far I built over a couple of weeks for the GH game jam |
00:41:02 | FromGitter | <kayabaNerve> Feel free to fix it for me |
00:41:14 | stefanos82 | for some reason I feel like Araq compares golf carts with Ferrari and Lamborghini cars |
00:41:19 | CodeVance | @kayaba what dependencies I need? |
00:41:19 | FromGitter | <kayabaNerve> Great polymorphism and `[]` operator if I do say so myself |
00:41:24 | FromGitter | <Quelklef> woah stefanos |
00:41:31 | FromGitter | <Quelklef> let's not start insulting people please |
00:41:38 | stefanos82 | it's not an insult |
00:41:46 | stefanos82 | it's how *I* feel |
00:41:51 | FromGitter | <Quelklef> Uh, what |
00:41:52 | FromGitter | <kayabaNerve> I also have https://github.com/kayabaNerve/Ember which is what I'm working on since I haven't done PacMan, which is broken, in months and will never return to |
00:41:53 | FromGitter | <Quelklef> lol |
00:42:16 | FromGitter | <kayabaNerve> Dependencies are in the README but you do need to init the secp256k1 Git submodule as nimble won't do that for you |
00:42:39 | CodeVance | kayaba maybe make it a nimble project atleast so I can actually run the code without playing code-wackamole |
00:42:50 | FromGitter | <Varriount> @rayman22201 I'm going through your code right now - I may not have enough time to review it completely though. |
00:42:59 | CodeVance | I'm talking about pacman3d |
00:43:06 | FromGitter | <Quelklef> oh btw @kayabaNerve Official nim style guide is 2 spaces per indent. I just remembered cause your code does 4 as does mine (oops) |
00:43:18 | FromGitter | <rayman22201> thanks @Varriount. no rush! I appreciate you looking |
00:44:34 | CodeVance | vscode settings `[nim]: { "editor.tabSize": 2 }` |
00:45:57 | FromGitter | <kayabaNerve> @Quelklef I will fight whoever says that |
00:46:03 | FromGitter | <kayabaNerve> CodeVance: secp256k1 is |
00:46:10 | FromGitter | <kayabaNerve> Lol. It's done by the Status team. |
00:46:33 | FromGitter | <kayabaNerve> My project isn't because it has three dependencies and I haven't bothered to. |
00:46:56 | FromGitter | <kayabaNerve> And I was trying to tease you by saying PM3D. Working on it would be pointless unless you want to take over. |
00:47:18 | FromGitter | <Quelklef> I mean, go ahead and fight this link: https://nim-lang.org/docs/nep1.html |
00:47:29 | FromGitter | <Quelklef> I also prefer 4 but hey you gotta follow the standard :\ |
00:47:50 | CodeVance | no you don't |
00:47:59 | CodeVance | It's just easier with 2 spaces |
00:48:04 | CodeVance | looks the best |
00:48:11 | FromGitter | <Quelklef> I think 4 looks nicer |
00:48:24 | FromGitter | <Varriount> @rayman22201 Doesn't fuzzysearch.nim, line 101 cause a fibonacci progression? |
00:48:26 | FromGitter | <Quelklef> But I'm sure it's just because I'm used to it (Python...) |
00:48:38 | FromGitter | <kayabaNerve> 2 hurts my eyes... |
00:48:53 | FromGitter | <kayabaNerve> So I'm fighting @Varriount and dom96, the authors? |
00:49:02 | FromGitter | <Quelklef> Looks like it. |
00:49:20 | FromGitter | <kayabaNerve> Or doesn't really hurt my eyes per say, but does make me strain to verify the line ups. |
00:49:34 | FromGitter | <Quelklef> Yeah, I agree. Everything looks smushed |
00:49:35 | FromGitter | <Varriount> @kayabaNerve If you want to see my personal style, look at my commandant repo |
00:49:41 | FromGitter | <Quelklef> It does help keep lines shorter though |
00:49:43 | FromGitter | <kayabaNerve> Saying that Nim is indentation based, I'm surprised they don't use the longer and clearer 4 spaces |
00:49:44 | CodeVance | just use 4 tabs if you prefer. some day soon (hopefully it won't matter anymore) |
00:49:56 | FromGitter | <Quelklef> Well it makes it a lot easier to keep under 80chars |
00:50:16 | FromGitter | <kayabaNerve> CodeVance: Identation based editing? Get rid of tabs and spaces? Just one unit that compiles to spaces for compatibility? |
00:50:22 | FromGitter | <Quelklef> I remember getting frustrated that Python used 4 spaces because it made following pep8 frustrating |
00:50:31 | FromGitter | <Quelklef> Why do no languages use 3 spaces, huh?? |
00:50:49 | FromGitter | <rayman22201> @kayabaNerve couldn't you use a nimble task/hook to init a git submodule for secp256k1 ? |
00:50:55 | Araq | I've seen one space indentation too. |
00:51:02 | FromGitter | <Quelklef> oh lord |
00:51:02 | FromGitter | <kayabaNerve> http://nickgravgaard.com/elastic-tabstops/ |
00:51:03 | FromGitter | <kayabaNerve> This |
00:51:12 | FromGitter | <rayman22201> @Varriount Not quite fibonacci |
00:51:18 | FromGitter | <kayabaNerve> @Quelklef I wouldn't mind except it isn't even |
00:51:20 | FromGitter | <kayabaNerve> http://nickgravgaard.com/elastic-tabstops/ |
00:51:22 | Araq | was surprised how quickly it became a non-issue for reading |
00:51:25 | FromGitter | <kayabaNerve> Didn't mean to post again |
00:51:31 | FromGitter | <kayabaNerve> Sorry. Ctrl + V by accident |
00:51:36 | * | donlzx joined #nim |
00:51:41 | * | Araq shrugs |
00:51:48 | FromGitter | <Quelklef> Araq, the one-sized tabs? |
00:51:49 | FromGitter | <kayabaNerve> Araq: What if I don't want to have to make it a non-issue when I don't need to lol |
00:51:55 | FromGitter | <kayabaNerve> I think he meant two |
00:52:05 | Araq | no, I meant 'one' |
00:52:11 | FromGitter | <kayabaNerve> @rayman22201 Maybe. Not my lib and I haven't investigated tbh |
00:52:22 | FromGitter | <Quelklef> Huh. |
00:52:24 | Araq | it was written by some mad genius |
00:52:27 | FromGitter | <kayabaNerve> I can't even use Git/Nimble. My Git install has been broken for months and the only fix is an OS reinstall |
00:52:34 | FromGitter | <kayabaNerve> Oh. NVM. Sorry |
00:52:43 | Araq | but the one space indentation stopped being weird after an hour. |
00:52:56 | CodeVance | I'd like if tab size was considered a "preference" just like nim's casing |
00:53:13 | FromGitter | <Quelklef> @kayabaNerve The elastic tabstops looks like a cool idea but it means we either have to (a) introduce a new character or (b) get everyone to suddenly agree that this is the right way to do things |
00:53:38 | FromGitter | <kayabaNerve> @Quelklef I think it's done internally |
00:53:44 | FromGitter | <Quelklef> Right, that's the issue |
00:53:56 | FromGitter | <Quelklef> It means everyone who wants the code to look nice has to use a compatible editor |
00:53:59 | FromGitter | <Quelklef> I really really like the idea, though |
00:54:22 | * | Lord_Nightmare quit (Ping timeout: 264 seconds) |
00:54:26 | FromGitter | <kayabaNerve> He lists a bunch of available plugins. |
00:54:40 | FromGitter | <kayabaNerve> I think it autodetects or stores it in the software; it doesn't edit the file |
00:54:48 | FromGitter | <kayabaNerve> That was my point |
00:54:52 | FromGitter | <kayabaNerve> Now I get you |
00:54:53 | FromGitter | <kayabaNerve> NVM |
00:55:04 | FromGitter | <kayabaNerve> He said that was an issue |
00:55:06 | FromGitter | <Quelklef> Lol |
00:55:21 | FromGitter | <kayabaNerve> Just tell them to either Ctrl F their local copy or get elastic tabs lol |
00:55:43 | FromGitter | <Quelklef> hmmmmm |
00:56:35 | FromGitter | <Quelklef> Wait, does it save the file with tabstops or spaces |
00:56:40 | FromGitter | <kayabaNerve> Right now it's just deal/with it/ctrl f |
00:56:51 | FromGitter | <kayabaNerve> Lol. No idea. Hopefully spaces for compatibility |
00:57:03 | FromGitter | <Quelklef> Yeah |
00:57:06 | * | Lord_Nightmare joined #nim |
00:57:12 | FromGitter | <Quelklef> If it was just an abstract layer on top of spaces that could be useful |
00:57:19 | FromGitter | <Quelklef> if it maps each tabstop to `\t` that's iffy |
00:57:56 | * | voice_ftp quit (Quit: Leaving) |
00:58:30 | FromGitter | <kayabaNerve> Well I have a thing that force replaces tabs to spaces when I open or save a doc |
00:58:44 | FromGitter | <kayabaNerve> So I'm guessing that would solve saving for me |
00:58:46 | FromGitter | <kayabaNerve> No idea on loading |
00:58:53 | FromGitter | <Quelklef> don't ever open a `.tsv`, then... |
00:59:11 | FromGitter | <kayabaNerve> Write your own impl |
00:59:23 | FromGitter | <kayabaNerve> ... i'm horrified |
00:59:27 | FromGitter | <kayabaNerve> Back to Nim? |
00:59:44 | FromGitter | <Quelklef> eh? |
00:59:53 | FromGitter | <kayabaNerve> We're offtopic again |
00:59:59 | FromGitter | <kayabaNerve> That was an issue last time |
01:00:11 | FromGitter | <Quelklef> Who else is active right now? |
01:00:23 | FromGitter | <kayabaNerve> No idea. Still. I don't like being disliked |
01:01:47 | FromGitter | <rayman22201> @Varriount line 101 is f(n) = f(n-1) + constant* n. It grows as O(n), unlike fibonacci which is f(n) = f(n -1) + f(n-2). Which grows as O(2^n). If I remember my math correctly? |
01:02:28 | FromGitter | <Varriount> @rayman22201 Ah, ok. Also, is line 121 correct? Those function calls aren't meant to be the same? |
01:04:37 | * | stefanos82 quit (Quit: Quitting for now...) |
01:05:00 | FromGitter | <rayman22201> No, it's isAlphaAscii and isUpperAscii |
01:05:25 | FromGitter | <rayman22201> It should be either not a letter or if it is a letter, it better be uppercase |
01:06:17 | FromGitter | <kayabaNerve> @rayman22201 BTW. Sorry. I might be able to write a Nimble task but what matters is if it's executed on install versus on by the user. I'll check into it and if I can, i will |
01:06:24 | FromGitter | <rayman22201> @kayabaNerve you are still liked. I was just trying to keep the channel from going bonkers. It's not personal! |
01:07:54 | FromGitter | <Varriount> @rayman22201 Couldn't that be simplified to just checking if it's a lowercase letter? |
01:08:24 | FromGitter | <Varriount> Or rather, checking that it's not a lowercase ascii letter |
01:08:57 | FromGitter | <rayman22201> yes. I think you are right. good catch |
01:10:20 | FromGitter | <rayman22201> state machines + late night coding = obtuse tortured logic statements :-P |
01:12:07 | * | endragor joined #nim |
01:13:00 | FromGitter | <Varriount> @rayman22201 Yeah, especially when that state machine concerns string matching. |
01:13:15 | FromGitter | <Varriount> @rayman22201 Why only ascii? Is unicode not a problem? |
01:13:29 | FromGitter | <Varriount> Or just too ambigiuous |
01:14:00 | FromGitter | <rayman22201> Just didn't want to put in the work for Unicode when Ascii seems to be fine atm. |
01:14:47 | FromGitter | <rayman22201> To be truly correct I should do it. But it makes the problem a lot harder. Yeah, like you said too ambiguous |
01:16:27 | * | endragor quit (Ping timeout: 240 seconds) |
01:17:11 | FromGitter | <Varriount> Plus, the Nim codebase is mostly ascii |
01:17:30 | FromGitter | <Varriount> Unless Araq starts using umlauts in his variables. |
01:18:12 | FromGitter | <rayman22201> He is German... lol |
01:18:24 | Araq | using ü for u's derivative is common in German math. |
01:18:36 | Araq | nah, I'm kidding. |
01:19:27 | FromGitter | <rayman22201> X.X. lol You scared the crap out of me for a second there @Araq |
01:20:43 | FromGitter | <rayman22201> And I was always told Germans have no sense of humor :-P |
01:23:33 | Araq | lol, I'm only serious when talking about computer games |
01:23:58 | FromGitter | <rayman22201> lol! |
01:26:17 | * | donlzx quit (Quit: Leaving) |
01:27:50 | FromGitter | <rayman22201> @Varriount fix is pushed |
01:28:26 | * | NamPNQ joined #nim |
01:28:50 | FromGitter | <Varriount> @rayman22201 No worries, I'm actually going over your code and refactoring it somewhat. |
01:28:59 | FromGitter | <rayman22201> That's cool too |
01:34:09 | * | leorize quit (Remote host closed the connection) |
01:34:28 | * | leorize joined #nim |
01:38:00 | FromGitter | <Varriount> @rayman22201 Any particular reason for using a pure enum? |
01:38:34 | FromGitter | <rayman22201> I wanted it to be name-spaced. I thought it was more clear |
01:40:56 | * | brainpro1 is now known as brainproxy |
01:41:09 | FromGitter | <Varriount> You know, what I really want is elastic line spacing. |
01:41:41 | FromGitter | <Quelklef> oh my |
01:46:25 | FromGitter | <rayman22201> lmao. The troll level is set to max right now. |
01:48:35 | FromGitter | <rayman22201> @Varriount I have to go cook dinner. I will be afk for a bit. I'll check back in a bit though. Thanks again for the review! |
01:53:44 | * | vivus quit (Quit: Leaving) |
02:11:02 | FromGitter | <kayabaNerve> Troll level? |
02:11:12 | FromGitter | <kayabaNerve> @Varriount did you see the link I sent? |
02:14:19 | FromGitter | <Varriount> @kayabaNerve No, I didn't |
02:16:21 | FromGitter | <Varriount> @kayabaNerve I'm aware of elastic tabstops. What I would like is elastic spacing between lines. |
02:27:44 | * | leorize quit (Quit: WeeChat 2.1) |
02:29:10 | FromDiscord | <awr> does choosenim require a preexisting nim installation? |
02:43:40 | * | leorize joined #nim |
02:53:08 | FromGitter | <kaushalmodi> @rayman22201 isUpperAscii for a char X implies that X.isAlphaAscii is true. |
02:53:47 | FromGitter | <kayabaNerve> Oh. Got it. Never mind. |
02:53:57 | FromGitter | <kayabaNerve> awr: I don't believe so |
02:54:05 | FromGitter | <kaushalmodi> Also FYI isUpperAscii, isLowerAscii, isUpper, isLower for *strings* (not chars) is planned to be deprecated. @dom96 ? |
02:54:38 | FromGitter | <kayabaNerve> Why not convert the char to int and bounds check it? |
02:57:37 | FromGitter | <kaushalmodi> @kayabaNerve What's the bound check in reference to? I didn't follow. |
02:58:11 | FromGitter | <kayabaNerve> C chars are ints |
02:58:37 | FromGitter | <kayabaNerve> They can be casted in Nim and checked against an ASCII table |
02:59:02 | FromGitter | <kayabaNerve> 50 < mychar.int and mychar.int <60 |
02:59:03 | FromGitter | <kaushalmodi> Ah OK. But we already have procs for upper/lower checking |
02:59:10 | FromGitter | <kayabaNerve> It's probably exactly what the procs do |
02:59:16 | FromGitter | <kayabaNerve> Yep |
02:59:23 | FromGitter | <kaushalmodi> Why would one need to remember the ASCII codes. |
02:59:25 | FromGitter | <kayabaNerve> Just throwing it out there in case it did help |
02:59:32 | FromGitter | <kayabaNerve> I just picked two random |
02:59:52 | FromGitter | <Quelklef> @kayabaNerve You can just do `ord(c)` instead of using hardcoded numbers |
02:59:55 | FromGitter | <kaushalmodi> Nim style would be `charVar in {'a' ..'z'}` |
03:00:01 | FromGitter | <kayabaNerve> 48-57 0,9 |
03:00:22 | FromGitter | <kayabaNerve> 65-90 A-Z |
03:00:33 | FromGitter | <kayabaNerve> 97-122 a-z |
03:00:42 | * | mr_yogurt quit (Ping timeout: 256 seconds) |
03:00:47 | FromGitter | <kayabaNerve> @kaushalmodi seems slow and long as hell |
03:00:59 | FromGitter | <kaushalmodi> ? |
03:01:04 | FromGitter | <kayabaNerve> @Quelklef good thinking! I have to implement that. |
03:01:35 | FromGitter | <kayabaNerve> 2 < versus a for loop with 26 iterations that does an equality check each time |
03:02:02 | FromGitter | <kayabaNerve> And you have to make an object of every single char |
03:02:45 | FromGitter | <kaushalmodi> My background is mainly scripting. So I yet to build apps that that speed sensitive. |
03:02:51 | FromGitter | <kaushalmodi> But I get your point. |
03:03:22 | FromGitter | <kaushalmodi> My suggestion was using sets.. and I cannot comment on if that operation iterates 26 times or not.. |
03:03:38 | FromGitter | <kaushalmodi> As I don't know the internal translation of Nim sets to C |
03:04:10 | FromGitter | <kaushalmodi> *yet have to |
03:05:59 | FromGitter | <Quelklef> @kaushalmodi Use @kaushalmodi's suggestion, not mine. Less arcane and closer to your intent. |
03:06:21 | FromGitter | <Varriount> What's the question about speed? |
03:06:42 | FromGitter | <Quelklef> oops i mean @kayabaNerve |
03:06:59 | FromGitter | <kaushalmodi> @Quelklef *k a TAB? |
03:07:03 | FromGitter | <Quelklef> I highly suspect the speed differences will be trivial |
03:07:10 | FromGitter | <Quelklef> @kaushalmodi yup, haha |
03:07:20 | FromGitter | <kayabaNerve> @Varriount how does a set perform |
03:07:40 | FromGitter | <kayabaNerve> If I test an object for being in a set, it iterates over each and tests equally |
03:07:46 | FromGitter | <kayabaNerve> *equality, right? |
03:07:52 | FromGitter | <Varriount> No. A set is not a sequence. |
03:08:07 | FromGitter | <kayabaNerve> So how would it behave |
03:08:33 | FromGitter | <Quelklef> Sets are really really fast |
03:08:37 | FromGitter | <Varriount> The item would be transformed into a set item and a boolean operation would be done. |
03:08:47 | FromGitter | <Varriount> If you want, you can look at the C code. |
03:08:54 | FromGitter | <Quelklef> wait `set` is not a hash set is it |
03:09:47 | FromGitter | <citycide> this seems like a pretty important bug, should it be tagged as one? https://github.com/nim-lang/Nim/issues/8066 |
03:09:48 | FromGitter | <kayabaNerve> What's better. Set of A through Z and test if 'M' or '0' is in it OR |
03:09:58 | FromGitter | <citycide> kind of defeats the purpose of `{.pure.}` |
03:10:36 | FromGitter | <kayabaNerve> (ord('A') <= myChar) and (ord('Z') <= myChar) |
03:10:48 | FromGitter | <kayabaNerve> O have |
03:10:55 | FromGitter | <Quelklef> WHy not just do a benchmark? |
03:11:04 | FromGitter | <Varriount> Ok, say you are checking if a character `C` is in the set `{'a'..'z'}`. |
03:11:07 | FromGitter | <kayabaNerve> Fair enough. Give me ten minutes |
03:11:12 | FromGitter | <Quelklef> ill race you! |
03:11:27 | FromGitter | <kaushalmodi> Great, I'll wait for results :) |
03:11:42 | FromGitter | <kaushalmodi> Randomize the C |
03:11:54 | FromGitter | <kayabaNerve> Dude I'm eating dinner |
03:11:59 | FromGitter | <kaushalmodi> Lol |
03:12:00 | FromGitter | <Varriount> According to the generated C code, the compiler turns that into `if ord(C) >= ord('a') and ord(C) <= ord('b')` |
03:12:13 | FromGitter | <Quelklef> So they're the same |
03:12:28 | FromGitter | <kaushalmodi> Thanks, good to know |
03:12:29 | FromGitter | <Varriount> `if c in {'A'..'Z'}:` == `if (!(((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90))))` |
03:12:54 | FromGitter | <kayabaNerve> Interesting |
03:12:57 | FromGitter | <Quelklef> Good stuff! |
03:13:10 | FromGitter | <kayabaNerve> Do sets have to be linear? Yes, right? |
03:13:17 | FromGitter | <Varriount> Now, that's an optimization the compiler does when looking in ranges of characters. If the set doesn't have ranges, I imagine it does something different. |
03:13:28 | FromGitter | <Quelklef> @kayabaNerve come again? |
03:13:30 | FromGitter | <kayabaNerve> Because I test against a ton of values |
03:14:02 | FromGitter | <kaushalmodi> Sets don't have to be linear.. |
03:14:29 | FromGitter | <Varriount> `if c in {'A', 'b'}:` == `if (!(((NU8)(c)) == ((NU8)(65)) || ((NU8)(c)) == ((NU8)(98))))` |
03:14:34 | FromGitter | <kayabaNerve> 1-9, A-Z without 2 characters, a-z without 1 character. |
03:14:41 | FromGitter | <kaushalmodi> If you meant to ask if sets can be something like `{1, 3, 100}`, then yes, they can be. |
03:14:59 | FromGitter | <kayabaNerve> Yeah so I'm either using multiple sets or using order(char) |
03:15:03 | FromGitter | <Varriount> You can't really do better than the above. |
03:15:36 | FromGitter | <kayabaNerve> I might use sets just for the notation... |
03:15:47 | FromGitter | <kayabaNerve> Thanks @Varriount |
03:15:52 | FromGitter | <Varriount> Readability usually trumps optimization. |
03:15:57 | FromGitter | <Quelklef> ^ |
03:16:19 | FromGitter | <Quelklef> Using sets means your program is more closely matching your idea |
03:16:26 | FromGitter | <kaushalmodi> The speed concern you have with non-linear sets would apply to the `>`/`<` based checks too. |
03:16:37 | FromGitter | <Quelklef> Conceptually, you care about "is this in a-z" not "is the ascii representation of this ..." |
03:16:57 | FromGitter | <kaushalmodi> Sort of an aside, critbits is awesome |
03:16:57 | FromGitter | <Quelklef> And matching programs as closely as you can conceptually means the compiler can (theoretically) optimize it best |
03:17:10 | FromGitter | <kaushalmodi> It's a hybrid of tables and sets. |
03:28:51 | * | endragor joined #nim |
03:48:43 | FromGitter | <kayabaNerve> @Varriount One last set question if you're fine |
03:49:20 | FromGitter | <kayabaNerve> *able |
03:49:30 | FromGitter | <Quelklef> ask it to all |
03:49:54 | FromGitter | <kayabaNerve> How does {'A'..'Z', 'a'..'z'} compile into a check |
03:50:11 | FromGitter | <Quelklef> A check of `ord`? |
03:51:18 | FromGitter | <kayabaNerve> ('A' <= mychar && mychar <= 'Z') || ('a' <= mychar && mychar < = 'z') ⏎ ('A' == mychar) || ('B' == mychar) || ('C' == mychar) ... |
03:51:22 | FromGitter | <Quelklef> right |
03:51:30 | FromGitter | <kayabaNerve> The first or second lol |
03:51:37 | FromGitter | <kayabaNerve> We proved one range will be the first |
03:51:39 | FromGitter | <Quelklef> So, I didn't write the compiler, but I can guess with a pretty high confidence |
03:51:47 | FromGitter | <Quelklef> Wait, what? |
03:52:02 | FromGitter | <Quelklef> Oh you're saying with two ranges |
03:52:06 | FromGitter | <kayabaNerve> 'A'..'Z' is the first |
03:52:14 | FromGitter | <kayabaNerve> 'A', 'D' is the second |
03:52:22 | FromGitter | <Quelklef> right |
03:52:55 | FromGitter | <kayabaNerve> So I'm asking when there's two ranges, not next to each other, is it treated as two separate consecutive values OR a bunch of separate values |
03:53:05 | FromGitter | <Quelklef> 99% the former |
03:53:10 | FromGitter | <Quelklef> but I'll check for completeness |
03:56:55 | FromGitter | <Quelklef> `echo('a' in {'A'..'Z', 'a'..'z'})` becomes `(((NU8)(x)) >= ((NU8)(65)) && ((NU8)(x)) <= ((NU8)(90)) || ((NU8)(x)) >= ((NU8)(97)) && ((NU8)(x)) <= ((NU8)(122)))` |
03:56:59 | FromGitter | <Quelklef> So, yeah, the former |
03:57:22 | FromGitter | <Quelklef> I imagine what's happening is that `set` just contains all the ranges and items you give it |
03:57:38 | FromGitter | <Quelklef> so `{'a'..'z'}` doesn't do any "transformations" on the range, it just stores it |
03:58:05 | FromGitter | <Quelklef> And then `in` goes through and checks `_ <= _ <= *` for ranges and `* == _` for single items |
03:58:21 | FromGitter | <Quelklef> Given that IIRC `set` may only contain ordinal types, I feel like this is about correct |
03:59:53 | FromGitter | <kayabaNerve> Great. |
03:59:59 | FromGitter | <kayabaNerve> Thank you! |
04:00:05 | FromGitter | <Quelklef> Yessir! |
04:01:16 | FromGitter | <kaushalmodi> Yes, sets can contain only ordinal types |
04:02:42 | * | dorelix quit (Remote host closed the connection) |
04:12:16 | FromGitter | <kayabaNerve> I think this will be my last Q for the night |
04:12:21 | FromGitter | <kayabaNerve> BESIDES USING ORD(char) |
04:12:23 | FromGitter | <kayabaNerve> https://gist.github.com/kayabaNerve/9ed042095cb41072dc4d6fa9504d5625 |
04:12:27 | FromGitter | <kayabaNerve> How can I improve this? |
04:13:56 | FromGitter | <Quelklef> woah |
04:14:06 | FromGitter | <Quelklef> is `(int) x` a cast? I thought it was `castint (x)`? |
04:14:13 | FromGitter | <kayabaNerve> x.int |
04:14:15 | FromGitter | <kayabaNerve> int(x) |
04:14:19 | FromGitter | <kayabaNerve> castint (x) |
04:14:28 | FromGitter | <Quelklef> oh i see |
04:14:34 | FromGitter | <Quelklef> `(int)` is an expr evaluating to int |
04:14:36 | FromGitter | <Quelklef> then a command call |
04:14:38 | FromGitter | <Quelklef> ...strange |
04:14:45 | FromGitter | <kayabaNerve> `(int) x` works it's just buggy in larger expressions |
04:14:47 | FromGitter | <kayabaNerve> But I like it |
04:15:00 | FromGitter | <Quelklef> ehhhhh |
04:15:02 | FromGitter | <kayabaNerve> (I think I do ((int) x) |
04:15:33 | FromGitter | <kayabaNerve> I come from C. I think it's a great way of signaling, "I'm changing it up, no big deal, I know what I'm doing..." |
04:15:35 | FromGitter | <Quelklef> is there any pattern to these numbers |
04:15:41 | FromGitter | <Quelklef> or is it an arbitrary mapping |
04:15:47 | FromGitter | <Quelklef> Yeah but IMO it's arcane in nim |
04:15:49 | FromGitter | <kayabaNerve> But I think cast has extra powers unrelated at this level |
04:15:53 | FromGitter | <kayabaNerve> It's Base58 |
04:15:58 | FromGitter | <Quelklef> Also it's technically not a cast |
04:16:00 | FromGitter | <kayabaNerve> So there's 9 through 9 |
04:16:09 | FromGitter | <Quelklef> Wait |
04:16:11 | FromGitter | <kayabaNerve> There's 0 through 9 and A through F |
04:16:14 | FromGitter | <Quelklef> are you just, like, converting from b58? |
04:16:43 | FromGitter | <kayabaNerve> Then there's 0 through 9, A through F, and a through F with no number 0, capital letter O, capital letter I, or lower letter l |
04:16:52 | FromGitter | <kayabaNerve> Yes |
04:16:54 | FromGitter | <Quelklef> can you send me the file that has the context for this |
04:17:00 | FromGitter | <Quelklef> or is it in Ember |
04:17:16 | FromGitter | <kayabaNerve> https://github.com/kayabaNerve/Ember/blob/master/src/lib/Hex.nim |
04:17:20 | FromGitter | <kayabaNerve> https://github.com/kayabaNerve/Ember/blob/master/src/lib/Base58.nim |
04:17:37 | FromGitter | <Quelklef> I'll make a PR |
04:17:49 | FromGitter | <kayabaNerve> Two places; I just added in sets for testing if a number was in place since it did have those optimizations via https://github.com/kayabaNerve/Ember/commit/fd596a8c41ccf2fedc73588cd2677b93b27109dc |
04:17:52 | FromGitter | <kayabaNerve> Thanks lol |
04:18:35 | FromGitter | <Quelklef> is `Base16Characters` ever modified |
04:18:56 | FromGitter | <kayabaNerve> I'll try to remember why I used an array over a set. I wrote this originally and Java and ported it months ago |
04:19:07 | FromGitter | <Quelklef> to be able to iterate in order, probably? |
04:19:07 | FromGitter | <kayabaNerve> Nope. It's a const. I should prob switch it from var |
04:19:14 | FromGitter | <Quelklef> yeah |
04:19:23 | FromGitter | <Quelklef> to array or seq |
04:19:37 | FromGitter | <kayabaNerve> I have a set AND an array. |
04:19:40 | FromGitter | <Quelklef> Why? |
04:19:46 | FromGitter | <kayabaNerve> One is to test validity, one is to actually convert |
04:19:54 | FromGitter | <kayabaNerve> See my last commit |
04:19:56 | FromGitter | <Quelklef> sounds like unnecessary microoptimizations |
04:20:10 | FromGitter | <kayabaNerve> I was int casting and then checking it as you see there |
04:21:09 | FromGitter | <Quelklef> Don't use set, and don't use seq, and don't use array |
04:21:12 | FromGitter | <Quelklef> use `OrderedSet` |
04:21:18 | FromGitter | <kayabaNerve> I removed an 8 line if, and a separate line, for the letter values and cleaner code |
04:21:34 | FromGitter | <kayabaNerve> That set is another 8 lines for a total of -1 but it's so much cleaner though. See the last commit. |
04:21:39 | FromGitter | <kayabaNerve> K |
04:21:44 | FromGitter | <Quelklef> or I'll do it |
04:21:56 | FromGitter | <kayabaNerve> I'm here asking for suggestions lol. If you say to use OrderedSet, I'll look into it |
04:22:01 | FromGitter | <kayabaNerve> Up to you |
04:22:06 | FromGitter | <Quelklef> I'll just include it in a PR |
04:22:21 | FromGitter | <Quelklef> whenever I see other people's code I tend to have an urge to make intens emodifications lol |
04:22:52 | FromGitter | <kayabaNerve> LOL |
04:22:56 | * | lompik joined #nim |
04:23:02 | FromGitter | <Quelklef> /shrug |
04:23:08 | FromGitter | <kayabaNerve> I don't minf |
04:24:42 | FromGitter | <Quelklef> oh you would if I did everything |
04:26:19 | FromGitter | <Quelklef> ...what is DB/ ? |
04:27:46 | FromGitter | <data-man> @kayabaNerve and especially don't use bad advices :-D |
04:29:15 | FromGitter | <kayabaNerve> @Quelklef An empty folder |
04:29:28 | FromGitter | <Quelklef> but why |
04:29:39 | FromGitter | <kayabaNerve> I'm trying to remember why lol. I made it just two days ago... |
04:29:40 | FromGitter | <Quelklef> oh it's a BigNum, yeah? |
04:29:48 | FromGitter | <kayabaNerve> ... DB = Database |
04:29:54 | FromGitter | <kayabaNerve> You're talking about the folder, right? |
04:30:02 | FromGitter | <Quelklef> yeah sorry getting things mixed up |
04:30:05 | FromGitter | <Quelklef> BN is C BigNum? |
04:30:31 | FromGitter | <kayabaNerve> I either made it is a master folder for Lattice/Merit or a wrapper class for the filsystem and any/all custom data types |
04:30:45 | FromGitter | <kayabaNerve> I forget... |
04:30:54 | FromGitter | <Quelklef> 💭 |
04:31:01 | FromGitter | <kayabaNerve> lib/BN.nim is the BN wrapper. lib/BN/ is the C lib. |
04:31:12 | FromGitter | <Quelklef> yeah, and the C BN lib is? |
04:31:13 | FromGitter | <Quelklef> I don't know C |
04:31:16 | FromGitter | <kayabaNerve> imath |
04:31:56 | FromGitter | <Quelklef> ? |
04:31:58 | FromGitter | <kayabaNerve> https://github.com/kayabaNerve/Ember/blob/master/src/lib/BN.nim <- This is all that should matter. |
04:32:03 | FromGitter | <kayabaNerve> The name of the C library is imath. |
04:32:23 | FromGitter | <Quelklef> right but what is a BN conceptually |
04:32:31 | FromGitter | <kayabaNerve> BigNumber |
04:32:35 | FromGitter | <kayabaNerve> 0 to infinity |
04:32:43 | FromGitter | <Quelklef> that's what I was saying... |
04:32:51 | FromGitter | <kayabaNerve> Java BigNumber? GNU GMP? |
04:32:56 | FromGitter | <kayabaNerve> Multiple precision integer |
04:33:03 | FromGitter | <Quelklef> right |
04:33:14 | FromGitter | <kayabaNerve> Yeah |
04:33:15 | FromGitter | <kayabaNerve> That |
04:33:47 | FromGitter | <kayabaNerve> I use BN mainly to handle numbers in the order of 16^128 |
04:33:56 | FromGitter | <Quelklef> Hmmm... How expensive is BN creation |
04:34:10 | FromGitter | <kayabaNerve> Eh. And 20,000,000^10. |
04:34:21 | FromGitter | <Quelklef> I'm weighting the `num0 = newBN("0")` etc vars vs. having some terse `int -> BN` unary op |
04:34:30 | FromGitter | <kayabaNerve> No idea but I do think I parse hashes through there at some point |
04:34:35 | * | Lord_Nightmare quit (Ping timeout: 240 seconds) |
04:34:43 | FromGitter | <Quelklef> By the way, don't do `return` with strings. That returns `nil`. |
04:34:45 | FromGitter | <kayabaNerve> I think I only make BNs through Strings right now. Been meaning to add a new constructor for that |
04:34:52 | FromGitter | <Quelklef> Yeah |
04:34:52 | FromGitter | <kayabaNerve> I always use result IIRC |
04:35:07 | FromGitter | <kayabaNerve> Except in your new exponentiation generic |
04:35:14 | FromGitter | <Quelklef> thats... od |
04:35:30 | FromGitter | <kayabaNerve> That said, if someone edits my code to be SHA512^0 they're an idiot who deserves it... |
04:35:36 | FromGitter | <kayabaNerve> And it does default to the result |
04:35:36 | FromGitter | <Quelklef> but on Hex.nim line 25 you use return |
04:35:39 | FromGitter | <kayabaNerve> So that's not an issue |
04:35:51 | FromGitter | <Quelklef> I mean `f^0 == identity` |
04:36:07 | FromGitter | <kayabaNerve> Yeah. No. Forgot about that. Your generic is safe |
04:36:12 | FromGitter | <Quelklef> yup |
04:36:40 | FromGitter | <kayabaNerve> Hex:25 is the validity function |
04:36:45 | FromGitter | <kayabaNerve> No strings enbolbed |
04:36:51 | FromGitter | <Quelklef> `convert`? |
04:37:18 | * | donlzx joined #nim |
04:37:18 | FromGitter | <Quelklef> ah my edits may have shifted it, my bad |
04:37:25 | FromGitter | <kayabaNerve> Line 25 of src/lib/Hex.nim on master is if value[i] notin Base16Set: |
04:37:39 | FromGitter | <kayabaNerve> 1) Found it. Returns nil. |
04:37:41 | FromGitter | <Quelklef> `proc convert` contains `if valueArg < num0: return` and `convert` returns `string` |
04:37:42 | FromGitter | <Quelklef> yeah |
04:37:48 | FromGitter | <Quelklef> Is that intentional? |
04:38:19 | FromGitter | <kayabaNerve> That should be a valueError |
04:38:28 | FromGitter | <Quelklef> hmmmm |
04:38:30 | * | Lord_Nightmare joined #nim |
04:38:56 | FromGitter | <Quelklef> Okay, so the `Hex.nim` file does 3 things: |
04:39:04 | FromGitter | <Quelklef> 1) Ensure that a string dutifully represents some number |
04:39:12 | FromGitter | <Quelklef> 1) Convert BN -> string |
04:39:16 | FromGitter | <Quelklef> 1) Convert string -> BN |
04:39:33 | FromGitter | <Quelklef> 1) Formatted lists on gitter don't like being placed over multiple messages |
04:40:45 | FromGitter | <kayabaNerve> Validates a number. ⏎ Converts to a Hex string. ⏎ Reverts from a Hex string. |
04:41:00 | FromGitter | <Quelklef> Are you likely to ever need to dealt with non-base10 non-base16 numbers? |
04:41:20 | FromGitter | <kayabaNerve> Base10, Base16, Base58 |
04:41:28 | FromGitter | <Quelklef> Ok |
04:41:35 | FromGitter | <kayabaNerve> I wouldn't mind a generic Base[T] though |
04:41:39 | FromGitter | <Quelklef> Yeah I was gonna do that |
04:41:44 | FromGitter | <kayabaNerve> Main issue is the sets aren't explicit |
04:41:54 | FromGitter | <kayabaNerve> Base 58 could be Base62 but they removed 4 characters for ease |
04:42:07 | FromGitter | <Quelklef> come again? |
04:42:09 | FromGitter | <kayabaNerve> Sets != nim set. Just character grouping. |
04:42:17 | FromGitter | <kayabaNerve> So you still have to supply the specific characters involved. |
04:42:38 | FromGitter | <Quelklef> 0-9 a-z A-Z is 62 |
04:42:40 | FromGitter | <kayabaNerve> And this is performance critical. A for loop alone isn't good enough. |
04:42:41 | FromGitter | <Quelklef> yeah i see what you mean |
04:42:50 | FromGitter | <Quelklef> im a little lost im just gonna write Base[T] |
04:43:07 | FromGitter | <kayabaNerve> They remove number O, capital letter O, capital letter I, lower case letter l |
04:43:13 | FromGitter | <kayabaNerve> Zero, oh, eye, el |
04:43:18 | FromGitter | <Quelklef> Ah, for readibility |
04:43:22 | FromGitter | <Quelklef> seems reasonable |
04:43:25 | FromGitter | <kayabaNerve> Something something they look the fricking same, something something money can't not be reversed |
04:43:55 | FromGitter | <Quelklef> I mean...... Sounds like a good decision |
04:44:04 | FromGitter | <kayabaNerve> That's why I use iy |
04:44:27 | FromGitter | <kayabaNerve> I don't care about standards all too much |
04:44:28 | FromGitter | <Quelklef> Anyway, it seems that you don't call `convert` or `revert` anywhere |
04:44:34 | FromGitter | <kayabaNerve> They're public functions |
04:44:37 | FromGitter | <Quelklef> I know |
04:44:40 | FromGitter | <kayabaNerve> Check the miner and Merit functions |
04:44:41 | FromGitter | <Quelklef> I searched the project |
04:44:45 | FromGitter | <Quelklef> oh no i didnt |
04:44:50 | FromGitter | <Quelklef> i searched src/lib |
04:45:05 | FromGitter | <kayabaNerve> SHA512( ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b482e51641ecc065f9e38f9] |
04:45:14 | FromGitter | <kayabaNerve> Merit/Block.nim |
04:45:35 | FromGitter | <kayabaNerve> SHA512 takes in hex data; I have a Base58 address. I revert Base58 and convert to Hex. |
04:46:13 | FromGitter | <Quelklef> hmm |
04:47:24 | FromGitter | <Quelklef> can you write some tests so i dont fuck it all up |
04:47:32 | FromGitter | <Quelklef> for stuff besides Hex and Base58 |
04:47:46 | FromGitter | <kayabaNerve> Address.nim has the others |
04:47:49 | FromGitter | <kayabaNerve> Yeah it's in the TODO |
04:47:54 | FromGitter | <Quelklef> but like |
04:47:55 | FromGitter | <kayabaNerve> There's a lot in the TODO |
04:47:57 | FromGitter | <Quelklef> make it not in the todo |
04:48:02 | FromGitter | <kayabaNerve> I should write a TODO for the TODO |
04:48:05 | FromGitter | <kayabaNerve> Maybe do some stuff |
04:48:07 | FromGitter | <Quelklef> noooo |
04:48:44 | FromGitter | <kayabaNerve> I'll write those two tests right now for you |
04:48:53 | FromGitter | <Quelklef> What |
04:48:55 | FromGitter | <Quelklef> which ones |
04:49:36 | FromGitter | <Quelklef> @kayabaNerve |
04:51:54 | FromGitter | <kayabaNerve> The TODO now has an item to make a new TODO list that says to write the Hex and Base58 tests |
04:52:13 | FromGitter | <Quelklef> no don't write those tests |
04:52:18 | FromGitter | <Quelklef> write tests for things that use them |
04:52:28 | FromGitter | <Quelklef> because I'm about to overhaul the Hex/Base58 API |
04:53:01 | FromGitter | <kayabaNerve> @kayabaNerve ⏎ I don't mind ⏎ @Quelklef ⏎ oh you would if I did everything [https://gitter.im/nim-lang/Nim?at=5b48302c26aa91065e8f40ad] |
04:53:10 | FromGitter | <Quelklef> what |
04:53:15 | FromGitter | <kayabaNerve> Remember that? :P |
04:53:27 | FromGitter | <Quelklef> yeah? |
04:53:31 | FromGitter | <Quelklef> hey now |
04:53:34 | FromGitter | <Quelklef> I'm combining them |
04:53:38 | FromGitter | <kayabaNerve> I need tests for Hex/base58 anyways. I can't test the higher parts properly if those are malfunctioning. |
04:53:52 | FromGitter | <Quelklef> Sure, but the type is gonna be joined |
04:53:57 | FromGitter | <kayabaNerve> I can't tell you if yours work without an unit test for them. |
04:53:57 | FromGitter | <Quelklef> whatever, I can port the tests |
04:54:04 | FromGitter | <kayabaNerve> Submit your PR and I'll write a test lol |
04:57:07 | shashlick | https://github.com/genotrance/nimclipboard |
04:58:47 | FromGitter | <Quelklef> @kayabaNerve don't do `x == false`, do `not x` |
04:59:24 | FromGitter | <Quelklef> Unless `==` is overridden with some special logic |
04:59:34 | FromGitter | <Quelklef> but that case was `bool == bool` |
05:07:30 | FromGitter | <kayabaNerve> shashlick: Cool library |
05:10:53 | * | rockcavera quit (Remote host closed the connection) |
05:15:46 | FromGitter | <rayman22201> @Varriount I'm back at my computer for a bit if you are still around. |
05:16:10 | FromGitter | <rayman22201> and hello to everybody else as well :-) |
05:21:57 | FromGitter | <Quelklef> howdy |
05:22:47 | * | nsf joined #nim |
05:36:57 | FromDiscord | <awr> how do you get the length of an enum? |
05:40:47 | * | miran joined #nim |
05:47:45 | FromGitter | <Varriount> @rayman22201 Here's my current revision: https://gist.github.com/Varriount/ba8d95461e23762d2683426b83cc90b6 |
05:48:07 | FromGitter | <rayman22201> @Varriount taking a look |
05:57:33 | FromGitter | <rayman22201> Wow, so TIL: high() is cool, Nim has cool set comparision operators, and you can combine case statements with commas... |
05:59:00 | FromGitter | <rayman22201> @Varriount line 107 - 109, is prevStrChar and prevPatternChar used? |
05:59:54 | FromGitter | <Varriount> Oh yeah, I decided not to use those, as they could be confused with the strChar and patternChar variables. |
06:00:17 | FromGitter | <Varriount> The unused ones haven't been lowered, while `strChar` and `patternChar` have. |
06:00:58 | FromGitter | <rayman22201> I saw that, cool |
06:01:24 | FromGitter | <rayman22201> That's why I was confused. :-P |
06:03:10 | FromGitter | <Varriount> @rayman22201 I'm still trying to think of a way to better present lines 122-126 |
06:03:28 | FromGitter | <rayman22201> That echoAssert template was just me being silly. That can go away |
06:03:52 | FromGitter | <rayman22201> hrmmm. Yeah. Let me think |
06:05:24 | FromGitter | <Varriount> @rayman22201 What's the difference between the ScoreCard.UnmatchedChar and ScoreCard.UnmatchedLeadingChar cases? |
06:06:28 | FromGitter | <rayman22201> line 145 is the difference |
06:06:32 | FromGitter | <rayman22201> There is a bigger penalty |
06:07:16 | FromGitter | <rayman22201> on a match they are the same. on a "not match" they different |
06:08:15 | FromGitter | <rayman22201> i.e. I think you can combine those case statements |
06:10:03 | FromGitter | <rayman22201> It's a good example of flavor. What is more idiomatic "Nim", lines 111 - 115, or lines 126 - 128? |
06:12:28 | FromDiscord | <awr> i prefer 111-115 |
06:12:30 | FromGitter | <Varriount> Hm. I can't say that one is more idiomatic than the other, however I find the former more readable. |
06:13:10 | FromGitter | <Varriount> Generally if you have a condition that's so complex it spans multiple lines, it's not a bad idea to put it in it's own variable. |
06:14:13 | FromGitter | <Varriount> @rayman22201 By the way, it's probably unwise to use `expr` as a parameter name, as `expr` and `stmt` are also type names. |
06:15:15 | FromGitter | <rayman22201> In that template you mean? |
06:15:45 | FromGitter | <rayman22201> Yeah, that whole thing was silly |
06:15:53 | FromGitter | <rayman22201> good point though |
06:16:54 | FromGitter | <rayman22201> I'm also on board with 111 - 115. I also think that set notation is sexy. :-) |
06:16:55 | * | Vladar joined #nim |
06:16:56 | FromDiscord | <awr> `str[strIndex - 1] notin Letters` |
06:16:59 | FromDiscord | <awr> is this necessary? |
06:17:33 | FromDiscord | <awr> you're already checking to see if `str[strIndex - 1]` is lowercase |
06:18:04 | FromGitter | <rayman22201> It's an `or` condition |
06:18:28 | FromGitter | <rayman22201> either not a letter or a lowercase letter |
06:18:35 | FromDiscord | <awr> also you don't want `{'A', 'Z'}`, you want `{'A' .. 'Z'}` |
06:19:09 | FromDiscord | <awr> if lines 111-115 and 126-128 are meant to be functionally equivalent |
06:19:24 | FromGitter | <rayman22201> they are. That is correct |
06:19:27 | * | miran quit (Ping timeout: 240 seconds) |
06:19:41 | FromDiscord | <awr> ah ok i'm being dumb nvm |
06:19:58 | FromGitter | <rayman22201> np |
06:21:05 | FromGitter | <Varriount> awr: I ran that boolean expression through Wolfram Alpha in the hopes that it could be simplified. No such luck. |
06:21:44 | FromGitter | <rayman22201> disjoint sets :-/ |
06:22:08 | FromGitter | <Varriount> @rayman22201 I've updated the gist with some small changes. |
06:22:38 | FromGitter | <Varriount> This has actually been quiet fun. I like refactoring/styling small pieces of code like this. |
06:22:42 | FromGitter | <Varriount> *quite |
06:23:19 | FromGitter | <rayman22201> @Varriount looks great! Thanks. I appreciate the help. It's a good learning experience. |
06:24:19 | FromGitter | <rayman22201> So now.... the real question is, what should I do get your changes into the PR to give you proper credit? |
06:24:47 | FromGitter | <rayman22201> Are you ok with me just replacing the file, and mentioning you in the git commit msg? |
06:25:14 | FromGitter | <Varriount> I believe I can edit the PR |
06:25:23 | FromGitter | <rayman22201> that's better |
06:25:47 | FromGitter | <Varriount> Could you tell me how the comments in the last part of the scorecard enum should be split up? |
06:25:58 | FromGitter | <Varriount> It seems like part of that comment should go to the last element there. |
06:27:09 | FromGitter | <rayman22201> lines 31 - 33 can probably be removed. |
06:27:44 | FromGitter | <rayman22201> That information is described in later comments, and just confuses things I think. |
06:28:15 | FromGitter | <Varriount> A WordBoundryMatch is an uppercase letter preceded by a lowercase letter? |
06:28:53 | FromGitter | <rayman22201> No. I don't think I wrote a comment for WordBoundryMatch |
06:29:40 | FromGitter | <rayman22201> You aligned the comments correctly, I just think I was trying to over-describe a LeadingCharMatch |
06:30:23 | FromGitter | <data-man> @Varriount @rayman22201 maybe move this very useful proc to strutils? Or to matchers.nim (and remove deprecated from this module) |
06:30:37 | FromGitter | <Varriount> @data-man It's not unicode-aware. |
06:31:22 | FromGitter | <Varriount> Also, I'm unsure about how the parameter ordering should be for a public function. |
06:31:24 | FromGitter | <rayman22201> WordBoundryMatch should be something like "The last ConsecutiveCharMatch that immediately precedes the end of the string, end of the pattern, or a LeadingCharMatch" |
06:32:57 | FromGitter | <rayman22201> @data-man It would be much harder to make this unicode-aware, and it has some specific implementation details for dealing with the Nim Docs that wouldn't apply in the general case. |
06:34:00 | FromGitter | <Varriount> @rayman22201 https://github.com/rayman22201/Nim/tree/better-doc-search |
06:34:20 | FromDiscord | <awr> you use `inc(score, ord(scoreState))` and also `strIndex += 1` |
06:34:23 | FromGitter | <Varriount> I'm not sure how I feel about the fact that I can affect branches that are part of pull requests |
06:34:32 | FromGitter | <Varriount> awr: Nice catch |
06:34:37 | FromDiscord | <awr> i feel like you should stick to either `+=` or `inc()` and not mix the two |
06:35:17 | FromGitter | <Varriount> Yeah. |
06:35:42 | FromGitter | <Varriount> I prefer `inc`, but that's merely a stylistic preference. I'll stick with `+=` |
06:35:48 | FromGitter | <rayman22201> lol. @Varriount are you an admin on the Nim repo? |
06:36:02 | FromGitter | <Varriount> Yes. |
06:36:18 | FromGitter | <rayman22201> With great power comes great responsibility :-P |
06:36:38 | FromGitter | <Varriount> I didn't realize that Admins could do that. :/ |
06:36:52 | FromGitter | <rayman22201> I don't have a preference on `inc` vs `+=`but I agree that it should be consistent. good call |
06:37:21 | FromGitter | <Varriount> The code is still quite complicated... but I don't really think it can be made any simpler. |
06:37:58 | FromGitter | <rayman22201> I agree. Fuzzy match has an inherent complexity. I think it will provide great value to end users though |
06:39:42 | FromGitter | <Varriount> @rayman22201 I also changed the return type to a tuple - that way it can be unpacked on assignment. |
06:40:27 | FromGitter | <rayman22201> good idea. I was going to do that originally. I don't remember what compelled me change my mind... |
06:41:04 | FromDiscord | <awr> you could also probably shove the enum inside the proc and get rid of the pure pragma |
06:41:34 | FromGitter | <Varriount> Can you even define a type inside a proc? |
06:41:37 | FromDiscord | <awr> yes |
06:41:42 | FromGitter | <Varriount> O_o |
06:41:53 | FromGitter | <rayman22201> I didn't realize you could put templates inside a proc, so this is all blowing my mind! |
06:42:05 | FromDiscord | <awr> the only thing of note i've noticed you can't do inside a proc is imports |
06:42:51 | FromGitter | <rayman22201> https://media.giphy.com/media/26ufdipQqU2lhNA4g/giphy.gif |
06:43:19 | FromGitter | <rayman22201> It made the gif so large! sorry! |
06:44:26 | FromDiscord | <awr> unrelated cute nim thing i discovered a while back: `(a, b) == (c, d)` is a shortening of `(a == c) and (b == d)` |
06:46:58 | FromGitter | <Varriount> awr: My question would be what backend code that generates. |
06:47:05 | FromGitter | <Varriount> @rayman22201 https://gist.github.com/Varriount/ba8d95461e23762d2683426b83cc90b6 |
06:47:11 | FromDiscord | <awr> yeah it would be bad lol |
06:47:17 | FromDiscord | <awr> it would define multiple structs |
06:47:24 | FromDiscord | <awr> most likely |
06:47:28 | FromGitter | <Varriount> I changed the name of the states |
06:47:41 | FromGitter | <Varriount> awr: Lets take a look |
06:48:42 | FromDiscord | <awr> maybe gcc's/clang's optimizer will not make it so bad in machine code, idk |
06:48:43 | FromGitter | <rayman22201> @Varriount 👍 |
06:49:30 | FromGitter | <Varriount> awr: Well, the generated code does what you said. Creates 2 C structs and puts values in them. |
06:53:31 | FromGitter | <Varriount> @rayman22201 By the way, great job on the PR. Not many people dare touch the documentation tooling. |
06:54:37 | FromGitter | <rayman22201> Thanks :-) It's not that bad. IDK why not |
06:54:48 | FromGitter | <Varriount> May I use it in my toy command shell? |
06:54:54 | FromGitter | <rayman22201> of course |
06:55:06 | FromGitter | <rayman22201> Open Source baby! |
06:55:15 | FromGitter | <Varriount> I might try implementing some sort of helpful misspelled-command functionality. |
06:56:25 | FromGitter | <rayman22201> The Nim compiler source code is very accessible actually! It's quite nice |
06:57:29 | FromDiscord | <awr> if you wanted to stop using ord everywhere you could also plug `converter toOrd(x: ScoreCard): Ordinal = ord(a)` inside the proc |
06:58:00 | FromDiscord | <awr> alternatively |
06:58:02 | FromDiscord | <awr> proc `+=`(a: var ScoreCard; b: ScoreCard) = a += ord(b) |
06:58:18 | FromGitter | <Varriount> awr: I thought about that, but dismissed it as possibly causing problems. |
06:59:31 | FromGitter | <Varriount> @rayman22201 Should `fuzzyMatch("abc", "ABetterCrystal")` match? |
07:00:27 | FromGitter | <Varriount> Neither that nor `fuzzyMatch("ABC", "ABetterCrystal")` match. |
07:00:42 | FromGitter | <rayman22201> the case shouldn't matter on the pattern |
07:01:04 | FromGitter | <rayman22201> and I believe that is correct because I bias against single char matches |
07:01:24 | FromGitter | <rayman22201> AB is made up of two LeadingChars |
07:01:44 | FromGitter | <rayman22201> i.e. gets treated as two words of length 1 |
07:02:37 | FromGitter | <rayman22201> I did this based on testing against the Nim Docs and getting a lot of false positives from single character matches |
07:02:41 | FromGitter | <Varriount> Nope. Changing 'A' to "All" still doesn't match. |
07:02:55 | FromGitter | <Varriount> I think I broke it. :O |
07:02:59 | FromGitter | <rayman22201> lol |
07:03:01 | FromGitter | <rayman22201> possibly |
07:04:00 | FromGitter | <rayman22201> abcal would match... I think |
07:04:09 | FromGitter | <rayman22201> Allbc would not |
07:05:09 | FromGitter | <Varriount> Hm, the old code doesn't match either. |
07:05:25 | FromGitter | <rayman22201> because the pattern never "rewinds" once it finds a match. i.e. it finds the "A"... no match, no match, "B" match |
07:05:57 | FromGitter | <rayman22201> then by the end of the string, it is comparing "C" to "l", it never compares "l" to "l" |
07:06:01 | FromGitter | <rayman22201> does that make sense? |
07:06:55 | FromGitter | <rayman22201> It's an inherent limitation to this algorithm, which is technically a shortcut around doing a full combinatorial search of all possible substring matches. |
07:08:26 | FromGitter | <rayman22201> I could be convinced that this is the wrong behavior though |
07:09:52 | * | tzekid joined #nim |
07:10:12 | * | Vladar quit (Remote host closed the connection) |
07:10:32 | * | Vladar joined #nim |
07:11:08 | FromGitter | <Varriount> @rayman22201 I'm comparing against https://s3-us-west-2.amazonaws.com/forrestthewoods.staticweb/lib_fts/tests/fuzzy_match/fts_fuzzy_match_test.html |
07:12:05 | FromGitter | <rayman22201> Yeah. I deviated from his algorithm |
07:12:40 | FromGitter | <rayman22201> It was giving a lot of false positives (in my subjective opinion) on the Nim Doc data-set. |
07:14:02 | FromGitter | <rayman22201> His algo gives the leadingChar match the bonus right away, and it saves the previous score and outputs the best score as the final score. |
07:14:37 | FromGitter | <Varriount> Ah, ok. |
07:15:08 | FromGitter | <Varriount> @rayman22201 What instructions did you follow to build the documentation? |
07:15:18 | FromGitter | <Varriount> I have to admit, I've never tinkered around with it. |
07:16:02 | FromGitter | <rayman22201> I used ./koch web |
07:16:08 | FromGitter | <Varriount> Thanks. |
07:17:22 | FromGitter | <rayman22201> You have to move the `dochack.js` file into the web directory manually after you build it. IDK why\ |
07:27:11 | * | jamesroseman joined #nim |
07:27:41 | FromGitter | <Varriount> Ah, thanks. |
07:28:37 | FromGitter | <rayman22201> Yeah. It's a little wonky, but it works. Also, blast from the past because you get to see the old Nim website! :-P |
07:28:39 | zacharycarter | Now I'm playing with components and karax and they're just not rendering at all lmao |
07:29:08 | FromGitter | <rayman22201> if it doesn't render it can't have bugs :-P |
07:29:36 | zacharycarter | https://gist.github.com/zacharycarter/20c1c9bab1238334d9b1f7a0ddca3105 |
07:29:39 | zacharycarter | right? |
07:29:44 | FromGitter | <Varriount> @rayman22201 Is there some sort of web server you have to activate? |
07:30:14 | FromGitter | <rayman22201> @Varriount you have to use your own. It just spits out html |
07:30:23 | FromGitter | <Varriount> :( |
07:30:25 | zacharycarter | https://github.com/pragmagic/karax/blob/master/examples/carousel/carousel.nim |
07:30:34 | zacharycarter | not sure what I'm doing different from this examle |
07:30:46 | FromGitter | <rayman22201> @Varriount I agree. very sad panda |
07:31:24 | FromGitter | <rayman22201> I just use the built in python simple web server `python -m SimpleHTTPServer 8000` |
07:31:34 | FromGitter | <rayman22201> it just serves a directory on a port |
07:31:38 | FromGitter | <rayman22201> good enough for testing |
07:31:41 | zacharycarter | +1 to that |
07:35:15 | * | yglukhov[i] joined #nim |
07:35:16 | FromGitter | <Varriount> Yep, I used that. |
07:35:29 | FromGitter | <Varriount> I broke the match. `high` doesn't match anything is system.nim |
07:39:04 | FromGitter | <rayman22201> hrmmmm |
07:39:18 | FromGitter | <alehander42> @zacharycarter i've used monaco with components |
07:39:21 | FromGitter | <alehander42> so it should be possible |
07:39:31 | * | yglukhov[i] quit (Remote host closed the connection) |
07:40:00 | FromGitter | <rayman22201> @Varriount it matches system.nim for me? |
07:40:41 | FromGitter | <rayman22201> https://screenshots.firefox.com/6C6mhaVDLGMQnBEX/192.168.11.14 |
07:40:53 | FromGitter | <rayman22201> Not as high on the list as I would like but it does match |
07:41:35 | FromGitter | <Varriount> Is the current page not searched? |
07:41:49 | FromGitter | <alehander42> but I didn't know about component initialize :D |
07:42:02 | FromGitter | <alehander42> I think you're missing markDirty() maybe |
07:42:12 | FromGitter | <rayman22201> @Varriount It actually searches `theindex.html` no matter what page you are on |
07:42:31 | FromGitter | <rayman22201> it uses `theindex.html` as a database |
07:42:42 | FromGitter | <alehander42> I markDirty a component if I need to redraw it |
07:45:57 | FromGitter | <rayman22201> @Varriount maybe you are somehow still using the old version of `dochack.nim`? |
07:51:35 | FromGitter | <rayman22201> I hate to leave you in the middle of a problem, but it's almost 1 am in my time zone and if I don't go to bed soon my wife might kill me. |
07:55:59 | FromGitter | <Varriount> @rayman22201 that's fine. |
07:59:01 | * | jamesroseman quit (Ping timeout: 256 seconds) |
08:12:43 | * | PMunch joined #nim |
08:13:02 | * | yglukhov[i] joined #nim |
08:36:27 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
08:39:13 | * | yglukhov[i] joined #nim |
08:40:45 | * | yglukhov[i] quit (Read error: Connection reset by peer) |
08:41:22 | * | yglukhov[i] joined #nim |
08:47:58 | * | yglukhov_ joined #nim |
08:48:01 | * | yglukhov[i] quit (Ping timeout: 248 seconds) |
08:51:32 | * | BitPuffin joined #nim |
09:00:37 | * | endragor quit (Remote host closed the connection) |
09:01:05 | * | endragor joined #nim |
09:05:46 | * | endragor quit (Ping timeout: 256 seconds) |
09:20:27 | * | NimBot joined #nim |
09:34:16 | * | krux02 joined #nim |
09:44:15 | * | tzekid quit (Ping timeout: 252 seconds) |
09:57:04 | dom96 | Lots of discussion last night :) |
10:03:17 | PMunch | I really want to make a parser for the Nim IRC logs. Spit out some nice graphs of activity and count new users |
10:03:34 | PMunch | Would be nice to see after things like FOSDEM if we had more actual engagement |
10:06:00 | dom96 | totally |
10:06:02 | dom96 | Please do it |
10:06:26 | dom96 | I've been planning to try and draw up a "user count" graph based on the IRC logs |
10:06:31 | * | NamPNQ quit (Ping timeout: 256 seconds) |
10:06:38 | dom96 | All the joins, parts and quits are in there so it should be possible. |
10:06:56 | dom96 | It might not be 100% accurate all the time though as NimBot has reconnected sometimes. |
10:07:28 | dom96 | It's all available in JSON so it should be a nice project |
10:07:48 | * | TheLemonMan joined #nim |
10:08:52 | TheLemonMan | it seems nimble has some problems when you build a library that has arraymancer as dependency |
10:09:37 | TheLemonMan | nimble init, add 'requires arraymancer', nimble test -> silent compiler error |
10:12:26 | dom96 | Does `nimble build` work? |
10:13:00 | TheLemonMan | yep, even though it does nothing for a lib |
10:13:24 | TheLemonMan | "Info ???(???, 0) Error: internal error: n is not nil" |
10:13:32 | PMunch | dom96, wait, is the IRC logs available as JSON as well? |
10:15:28 | dom96 | PMunch: yep. Except that for some silly reason I decided to use the .logs extension and not the .json one |
10:15:29 | dom96 | https://irclogs.nim-lang.org/13-07-2018.logs |
10:15:51 | dom96 | oh, because its prefixed by a timestamp |
10:15:54 | dom96 | so it's not really json |
10:16:22 | dom96 | It's marshal it seems |
10:16:25 | dom96 | That sucks a bit |
10:17:13 | dom96 | I might have to change that |
10:18:14 | dom96 | Such a waste of space with all these damn nulls |
10:20:15 | krux02 | {"Field0": null, "Field1": null} |
10:21:02 | PMunch | Oh wow, that is a messy format :P |
10:21:28 | PMunch | Almost think it would be easier to parse the HTML |
10:22:28 | FromGitter | <tim-st> what was nims equivalent to pythons enumerate? |
10:22:30 | * | NamPNQ joined #nim |
10:22:51 | FromGitter | <tim-st> for idx, elem in enumerate(data)... |
10:23:45 | PMunch | for key, value in myTable: |
10:23:49 | PMunch | Oh wait |
10:23:57 | PMunch | For tables you actually have to use pair |
10:24:28 | PMunch | But for seqs this should work: for idx, val in @[4, 5 ,6] |
10:24:50 | FromGitter | <tim-st> oh, I see it works out of the box^^, thanks |
10:24:56 | krux02 | dom96: curl https://irclogs.nim-lang.org/13-07-2018.logs | sed -e 's/"Field[0-9]*": null//g' -e 's/{, }//g' -e 's/,\( ,\)*/,/g' |
10:25:11 | PMunch | !eval for idx, val in @[4, 5, 6]: echo "idx: ", idx, ", value: ", val |
10:25:13 | NimBot | idx: 0, value: 4↵idx: 1, value: 5↵idx: 2, value: 6 |
10:25:19 | FromGitter | <tim-st> yes, thanks |
10:25:45 | krux02 | it breaks a bit the json though |
10:26:31 | krux02 | there is a better json sed tool though |
10:26:39 | dom96 | PMunch: What might be easier is to hack NimBot to output proper JSON when .json is requested :) |
10:27:05 | PMunch | Would that work retroactively though? |
10:27:28 | PMunch | I mean if NimBot is able to read that so could my program |
10:27:42 | dom96 | true, you could also steal NimBot's parsing code |
10:27:59 | dom96 | I'll probably convert all of these logs to json eventually |
10:29:36 | krux02 | I mean there is no point in serializing null fields. |
10:29:42 | PMunch | log = log.multiReplace({"\n": "↵", "\r": "↵", "\l": "↵", |
10:29:42 | PMunch | "\1": "💩"}) |
10:29:48 | PMunch | What's the poop doing there? :P |
10:30:05 | krux02 | a field with value null is almost equivalent to no field with that name at all |
10:32:00 | PMunch | almost |
10:33:08 | PMunch | dom96, it seems like it just reads the file and de-marshals it: https://github.com/nim-lang/nimbot/blob/master/src/irclogrender.nim#L22 |
10:35:01 | dom96 | It's so that you can't trick Nimble to output a /me ACTION CTCP using !eval ;) |
10:38:09 | dom96 | or any other CTCP for that matter |
10:38:27 | dom96 | You could get NimBot to request every client's version if it wasn't for the poop |
10:41:39 | PMunch | Aaah, makes sense |
10:43:03 | dom96 | And I love to troll people, so poop it was |
10:43:16 | Yardanico | :D |
10:50:52 | dom96 | yay https://github.com/nim-lang/nimforum/pull/179 |
10:51:00 | dom96 | Perfect way to contribute to NimForum ^^ |
10:51:09 | * | jamesroseman joined #nim |
10:52:20 | TheLemonMan | it seems that nimble somehow ends up registering twice the same passes |
10:55:34 | * | jamesroseman quit (Ping timeout: 264 seconds) |
11:05:38 | * | nsf quit (Quit: WeeChat 2.1) |
11:11:13 | Yardanico | As I understand I can't do "iter: varargs[A] | Iterable[A]" (iter is an argument of a proc and Iterable is a concept)? |
11:12:30 | Yardanico | oh, I think I can, but not if there's some argument after "Iter" |
11:13:03 | TheLemonMan | sweet korean jesus, I think I've finally managed to pinpoint this madness |
11:13:39 | krux02 | what is Iterable[A] |
11:14:16 | Yardanico | krux02, it's a concept Iterable[T] = concept x \n for elem in x: \n elem is T |
11:14:38 | krux02 | I really recommend to not use concepts yet. |
11:14:56 | krux02 | They are about to be broken in the future, because they are poorly designed. |
11:19:06 | krux02 | Yardanico, you can always to ``proc foo[T](iter: T)`` it is as powerful as if you would use the concept |
11:19:45 | krux02 | it is just the error messages when you call foo with incompatible types that are affected. |
11:21:35 | dom96 | TheLemonMan: What's the problem? |
11:21:54 | TheLemonMan | dom96, you forgot to call cleanup() in some places in nimscriptsupport.nim |
11:22:23 | TheLemonMan | eg. when you do an early return in execTask/execHook |
11:22:34 | Araq | :-) |
11:22:42 | dom96 | I wasn't the only one that touched this code :P |
11:22:47 | Araq | destructors would have solved this :P |
11:22:59 | TheLemonMan | ...or a `defer: cleanup()` |
11:23:02 | Araq | it's the one feature C++ got right. |
11:23:18 | Araq | 'defer: cleanup()' stinks :P |
11:23:45 | Araq | but they are now getting exceptions right too... we need to steal it |
11:24:28 | TheLemonMan | stealing is the ultimate form of appreciation, isn't it? :) |
11:24:35 | Araq | indeed. |
11:25:11 | TheLemonMan | dom96, `git blame` is never wrong! |
11:26:04 | TheLemonMan | I wonder why nobody stumbled across this bug before |
11:26:09 | * | NamPNQ quit (Remote host closed the connection) |
11:26:22 | dom96 | TheLemonMan: link to blame? :) |
11:28:12 | TheLemonMan | dom96, https://github.com/nim-lang/nimble/blame/master/src/nimblepkg/nimscriptsupport.nim#L597 :P |
11:30:10 | dom96 | Oh well, my bad :) |
11:34:29 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
11:35:26 | krux02 | Araq: what is c++ changing in exceptions? |
11:36:14 | krux02 | All I read was they might become an optional feature of the compiler |
11:45:26 | * | adeohluwa joined #nim |
12:12:22 | * | nsf joined #nim |
12:12:23 | Araq | krux02: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r1.pdf |
12:23:27 | FromGitter | <Bennyelg> What is wrong here?: ⏎ ⏎ ```proc `<`*(o: Job, other: Job): bool = ⏎ o.atTime < other.atTime``` [https://gitter.im/nim-lang/Nim?at=5b4899bfba5f154b3b9b5321] |
12:24:33 | krux02 | Bennyelg: Well first of all, I don't recommend to overload the `<` operator for that |
12:24:38 | FromGitter | <Bennyelg> Oh I missed something in the definition of the Job object |
12:24:42 | FromGitter | <Bennyelg> why not? |
12:24:51 | FromGitter | <Bennyelg> and how you suggest to do ? |
12:25:05 | krux02 | you should only use operator overloading where the meaning of the operator is clear. |
12:25:27 | krux02 | Meaning `<` is the comparison operator when something is lass than something else. |
12:25:56 | FromGitter | <Bennyelg> but this is what I mean here |
12:26:08 | FromGitter | <Bennyelg> if my job at Time is < then other |
12:26:19 | krux02 | exactly |
12:26:25 | krux02 | **at Time** |
12:26:29 | krux02 | very imortant information |
12:26:33 | krux02 | don't discard that |
12:27:17 | krux02 | if you discard that you actually compare by time, your code really becomes unreadable. |
12:27:40 | FromGitter | <Bennyelg> I dont understand you :| what do you mean by discard it ? Im not ignoring it |
12:28:01 | FromGitter | <survivorm> the point why c++ overloading operators often becomes a mess |
12:28:02 | FromGitter | <Bennyelg> it will be used later on like if Jobx < Joby : do this |
12:28:07 | FromGitter | <tim-st> what is the default cap of string? |
12:28:10 | krux02 | well the `<` operator doesn't say the reader of the code that it compares by `atTime` |
12:28:21 | FromGitter | <Bennyelg> I see |
12:28:27 | FromGitter | <Bennyelg> so what do you suggesting ? |
12:28:34 | FromGitter | <survivorm> even if the reader later is you |
12:28:43 | krux02 | I wast to say the ``a.atTime < b.atTime`` is much more readable than ``a < b`` when a and be are of type Job |
12:28:58 | FromGitter | <Bennyelg> ok, I agree |
12:29:02 | FromGitter | <Bennyelg> thanks, will change this. |
12:29:10 | Araq | krux02: I agree to fwiw. |
12:29:24 | Araq | there is no inherent ordering in "Jobs" |
12:29:37 | FromGitter | <Bennyelg> fwiw = ? |
12:29:50 | krux02 | yea I also have to look it up |
12:29:55 | Yardanico | fwiw = for what it's worth |
12:30:08 | FromGitter | <Bennyelg> oh |
12:30:10 | FromGitter | <Bennyelg> its worth |
12:30:14 | FromGitter | <tim-st> anyone knows string default capacity? |
12:30:20 | FromGitter | <kaushalmodi> for what it's worth used as "my opinion, take it or leave it" |
12:30:21 | FromGitter | <Bennyelg> I need to change my beaver of programming |
12:30:22 | FromGitter | <tim-st> 8 byte? |
12:30:24 | * | MyMind joined #nim |
12:30:32 | krux02 | no default is no capacity at all |
12:30:45 | FromGitter | <tim-st> oh, ok, thanks |
12:31:15 | FromGitter | <tim-st> and the growthfactor? |
12:31:41 | FromGitter | <tim-st> or if I add one byte how much is then created? |
12:31:48 | zacharycarter | Anyone have any idea why these karax components don't render at all? - https://gist.github.com/zacharycarter/20c1c9bab1238334d9b1f7a0ddca3105 |
12:32:10 | * | Sembei quit (Ping timeout: 264 seconds) |
12:32:46 | krux02 | tim-st: normally a string grows by a factor of two, but that wouldn't help with zero does it? |
12:32:46 | FromGitter | <Bennyelg> so what do you say about? ⏎ ⏎ ```t1.hasPriorityOver(t2)``` [https://gitter.im/nim-lang/Nim?at=5b489beeba5f154b3b9b5cb4] |
12:33:07 | FromGitter | <tim-st> yes, because of this I wanted to know how start work |
12:33:14 | FromGitter | <tim-st> is it 0,1,2,4,...? |
12:33:31 | FromGitter | <tim-st> and if so isnt that bad? |
12:33:34 | FromGitter | <Bennyelg> or it is still hiding the idea |
12:33:46 | krux02 | tim-st: I just looked it up |
12:34:04 | krux02 | an empty string literal has a capacity of 7 |
12:34:32 | krux02 | so 8 if you include the 0 byte that you can't use for data. |
12:34:36 | FromGitter | <tim-st> ok, thanks, and if I create newStringOfCap(<7) does it work? |
12:34:50 | krux02 | I think so |
12:34:57 | FromGitter | <tim-st> ok, thanks |
12:35:16 | krux02 | I tested it |
12:35:29 | krux02 | it doesn't crash, but you will still get a string of cap 7 |
12:35:31 | FromGitter | <tim-st> works? |
12:35:36 | FromGitter | <tim-st> ok, hm |
12:35:55 | FromGitter | <tim-st> if I know I need only 4 byte thats not good |
12:36:24 | krux02 | well if you really want to store a lot of tiny strings, use something else as data structure than string |
12:36:58 | FromGitter | <tim-st> yes, but often when it's about dynamic size only string and seq is possible |
12:37:07 | FromGitter | <tim-st> obviously seq would have the same problems |
12:37:29 | FromGitter | <tim-st> And I dont want to to plain c hacks or so |
12:38:15 | krux02 | you are ignoring the overhead of the pointer to the string (8 bytes) the size and capacity values (16 bytes) and the entry in the data table for allocated memory X bytes and the alignment of the allocated blocks |
12:38:44 | FromGitter | <tim-st> no, I know that ptr has sizeof(int) |
12:38:56 | krux02 | well then divide everything by 2 |
12:39:33 | krux02 | let s = newStringOfCap(4) |
12:39:33 | krux02 | echo cast[ptr tuple[a,b:int]](s)[] |
12:39:41 | krux02 | try that |
12:40:12 | FromGitter | <tim-st> cannot see it you have to write `...` |
12:40:13 | krux02 | still the 4 unused bytes will really be the smallest thing in the overhead costs |
12:40:27 | krux02 | http://ix.io/1h1Z |
12:40:29 | krux02 | better? |
12:40:38 | FromGitter | <tim-st> no, have 80/tcp blocked |
12:40:46 | Yardanico | lol |
12:41:20 | krux02 | ```let s = newStringOfCap(4); echo cast[ptr tuple[a,b:int]](s)[]``` |
12:41:26 | FromGitter | <tim-st> thanks^^ |
12:42:17 | FromGitter | <tim-st> that's interesting, thanks! |
12:42:21 | FromGitter | <survivorm> > so what do you say about? ⏎ ⏎ ```t1.hasPriorityOver(t2)``` ⏎ ⏎ That's still about jobs and their ordering? [https://gitter.im/nim-lang/Nim?at=5b489e2d641ecc065f9f78b8] |
12:44:20 | krux02 | tim-st: try this: ```let s = "Hi!"; echo cast[ptr tuple[len,cap:int; data:array[8,char]]](s)[]``` |
12:44:36 | krux02 | it should give you some insights of the internal representation of string |
12:45:33 | FromGitter | <survivorm> @Bennyelg If so, i'd better use something like `order(t1,t2)` if you plan to have something else than time-based ordering. Else, i'd stay with `atTime` |
12:45:53 | FromGitter | <tim-st> krux02: thanks I already assumed it looks like this, if the memory is initialized |
12:46:06 | FromGitter | <tim-st> maybe unitalized would be better for string? |
12:46:36 | FromGitter | <tim-st> oh, maybe it is internally |
12:47:16 | FromGitter | <tim-st> *uninitialized |
12:50:24 | krux02 | http://ix.io/1h25 |
12:50:33 | FromGitter | <tim-st> tcp80 |
12:50:41 | krux02 | why is it blocked? |
12:50:45 | krux02 | what is the point? |
12:50:50 | krux02 | to make the internet use horrible? |
12:50:57 | FromGitter | <tim-st> because only shit pages use http nowadays |
12:51:32 | FromGitter | <tim-st> it's like a quality filter |
12:51:46 | krux02 | ah, it is you who did that? |
12:51:52 | FromGitter | <tim-st> yes |
12:52:00 | krux02 | then it is your fault |
12:52:22 | FromGitter | <kaushalmodi> krux02: I've read good things about https://transfer.sh/ |
12:52:52 | krux02 | ix.io isn't a shit pages, it's a minimal code hoster, and https for code snippents. what's the point? |
12:54:06 | Yardanico | @tim-st I don't think it's good to assume that "only shit pages use http" |
12:54:26 | FromGitter | <tim-st> it's not an assumption, it's what I've seen |
12:54:41 | Yardanico | but ix.io is not a "shit page" |
12:54:42 | krux02 | well it is a correlation |
12:54:47 | FromGitter | <kaushalmodi> I'm with @tim-st. Why wouldn't a non-negligent dev not upgrade to https? |
12:54:48 | FromGitter | <tim-st> yes |
12:54:58 | Yardanico | there's a lot of "shit https pages" so should I block https ? |
12:55:19 | zacharycarter | well |
12:55:20 | FromGitter | <tim-st> Yardanico: for this there is the next step qulity filter |
12:55:30 | zacharycarter | I did find it amusing when Jenkins launched JenkinsX and it was being served up over HTTP |
12:55:35 | zacharycarter | the new site anyway |
12:55:51 | zacharycarter | like - if you're launching a site these days, it's so easy to get it up on HTTPS |
12:55:58 | zacharycarter | why wouldn't you? and benefit from the protocol security? |
12:56:08 | zacharycarter | but I think blocking port 80 is a bit extreme |
12:56:28 | krux02 | I don't see the point of https for pure non-interactive html. |
12:57:03 | FromGitter | <tim-st> lol is that your own website? |
12:57:09 | zacharycarter | Yeah there probably isn't one |
12:57:26 | * | Lord_Nightmare quit (Ping timeout: 244 seconds) |
12:57:49 | FromGitter | <tim-st> when I need a page with quality over http I use google cache |
12:58:27 | zacharycarter | how do you dev locally? |
12:58:29 | zacharycarter | or do you just not block localhost traffic? |
12:58:30 | krux02 | well you see where you approach fails |
12:58:35 | zacharycarter | or do you never dev on port 80? |
12:58:44 | Yardanico | zacharycarter, maybe he doesn't do web development |
12:58:55 | FromGitter | <tim-st> local isnt blocked only remote |
12:59:00 | zacharycarter | what if you want to look at a geocities page? |
12:59:03 | zacharycarter | or angelfire? |
12:59:04 | zacharycarter | you're totally fucked |
12:59:30 | krux02 | I don't do web development. And to be honest I am tired of all these hip web developers. |
12:59:40 | FromGitter | <tim-st> me too |
12:59:50 | zacharycarter | I'm offended! |
13:00:04 | FromGitter | <tim-st> I really dislike like you need a monster cpu machine to visit google nowadays |
13:00:11 | FromGitter | <tim-st> I turnt off js all over there |
13:00:23 | Yardanico | lol |
13:00:41 | zacharycarter | no one liked my geocities / angelfire joke :( |
13:00:48 | * | zacharycarter going to go sit in a corner now |
13:00:54 | FromGitter | <tim-st> well I have a local geo ip database |
13:00:58 | krux02 | yea being on the internet is fine and everything, but the internet is really horrible these days thangs to facebook google and advertisement companies. |
13:01:14 | FromGitter | <tim-st> yes |
13:01:26 | zacharycarter | aren't you using react / redux / yarn / every other fb js library in existance on your website? |
13:01:56 | zacharycarter | no? |
13:01:56 | krux02 | I wish more websites would be plain html |
13:02:05 | zacharycarter | psh! |
13:02:27 | Yardanico | krux02, yeah, I totally agree with that |
13:04:14 | zacharycarter | there was something out there the other day |
13:04:17 | zacharycarter | about brutalist web design |
13:04:48 | krux02 | being able to pay money over the internet is what made indie games possible, but it also cause all these advertisements for useless crap. |
13:05:10 | FromGitter | <narimiran> @tim-st you're the guy who also doesn't use git, right? :) |
13:05:10 | zacharycarter | https://www.uxbrutalism.com/ |
13:05:27 | FromGitter | <narimiran> you use .zip archive, IIRC? |
13:05:34 | zacharycarter | okay now tim-st is sounding lik the hipster |
13:05:36 | FromGitter | <tim-st> yes |
13:05:36 | zacharycarter | lol |
13:05:49 | Yardanico | lool |
13:06:05 | Yardanico | i have no more questions to tim-st :) |
13:06:06 | FromGitter | <tim-st> well my code never has bugs, why should I use it |
13:06:18 | zacharycarter | lolololol |
13:06:26 | zacharycarter | that should go on a wall |
13:06:28 | zacharycarter | above your desk |
13:06:31 | FromGitter | <kaushalmodi> hehe, that rests the case I guess :P |
13:06:39 | * | FromGitter * narimiran drops mic |
13:07:13 | krux02 | well zip files is what was used for the linux kernel for years until git was developed. |
13:07:43 | zacharycarter | yeah but now we have git |
13:07:43 | FromGitter | <tim-st> maybe I would use if there is a local software |
13:07:49 | krux02 | git was developed to automate the process that was applied already manually with "tar ball and patches" |
13:07:58 | krux02 | local software? |
13:08:01 | FromGitter | <kaushalmodi> @tim-st What do you mean "local"? |
13:08:03 | FromGitter | <tim-st> for git |
13:08:08 | zacharycarter | it's like using notepad instead of vim |
13:08:08 | krux02 | git init |
13:08:08 | FromGitter | <kaushalmodi> `git` *is* local |
13:08:21 | FromGitter | <tim-st> with web like github in local |
13:08:24 | FromGitter | <tim-st> *gui |
13:08:25 | krux02 | zacharycarter, but that is something I could understand |
13:08:32 | FromGitter | <kaushalmodi> ah. look at gitea |
13:08:35 | Yardanico | @tim-st gogs? gitlab? |
13:08:36 | FromGitter | <narimiran> you can have private repos on gitlab for free |
13:08:42 | krux02 | notepad is better for some use cases, especially when you don't use it day to day. |
13:08:57 | FromGitter | <kaushalmodi> there's also barebones super awesome stagit |
13:09:04 | krux02 | opening a readme.txt, I think notepad is better suitable than vim |
13:09:09 | FromGitter | <tim-st> @kaushalmodi thanks |
13:09:11 | zacharycarter | well I mean with the intention of using it as a ide |
13:09:13 | zacharycarter | or writing code |
13:09:25 | zacharycarter | like - why use an inferior tool for the job? |
13:09:31 | zacharycarter | git is pretty easy to get a handle on |
13:09:44 | FromGitter | <tim-st> I dont want to upload my code, it solves at least two unsolved problems |
13:09:47 | FromGitter | <kaushalmodi> @tim-st This is dogfooded using stagit: http://git.2f30.org/stagit/ |
13:09:56 | zacharycarter | you don't have to with git |
13:09:57 | krux02 | well I think git is quite horrible to learn. |
13:10:03 | krux02 | but I learned it on the command line. |
13:10:06 | FromGitter | <kaushalmodi> I like it for its minimalism to just show the git log and diffs (no issues, etc like gitea) |
13:10:07 | krux02 | maybe things are better now |
13:10:07 | Yardanico | @tim-st you can self-host gogs or gitlab |
13:10:13 | Yardanico | or some other solutions |
13:10:22 | FromGitter | <tim-st> Yardanico: thanks, will look into this |
13:10:36 | FromGitter | <narimiran> @tim-st you can use git locally, without uploading to anything (without remote repo) |
13:10:50 | FromGitter | <tim-st> I need a gui |
13:10:51 | Yardanico | gogs even supports sqlite as a DB |
13:11:12 | krux02 | I am at university, it I can actually use git to clone projects from other user accounts in the file system |
13:11:14 | FromGitter | <narimiran> @tim-st vscode has nice git interface |
13:11:20 | krux02 | that is quite funny |
13:11:30 | krux02 | git really doesn't need the internet to work |
13:11:52 | FromGitter | <tim-st> ok, sounds good, maybe I will install it, though I dont feel the need |
13:11:54 | Araq | 'git log' is broken when it comes to merged branches, or maybe rebased ones |
13:11:55 | krux02 | you can really use git and send pull requests by snail mail. |
13:11:57 | zacharycarter | anyway - Araq: if I split up the carousel example into two source files - |
13:11:57 | zacharycarter | https://gist.github.com/zacharycarter/8fa2ff48bea8505d051a7049c5253bb1 - nothing renders :/ |
13:12:01 | FromGitter | <kaushalmodi> krux02: Folks link git with internet because of Github popularity |
13:12:20 | FromGitter | <kaushalmodi> To their credit Github helps proliferate (one of my fav words) git |
13:12:25 | FromGitter | <kaushalmodi> *helped |
13:12:56 | FromGitter | <kaushalmodi> *that's all for off-topic chat from me for now :)* |
13:13:23 | zacharycarter | I still think I need to make the rotten gitatoes site |
13:13:31 | zacharycarter | which ranks github repos on freshness |
13:13:47 | FromGitter | <tim-st> did someone try nimsuggest on a late dev version? does it still go to 100% cpu? |
13:13:54 | Yardanico | it depends on the code |
13:14:03 | FromGitter | <tim-st> ? |
13:14:11 | Yardanico | if compiler hangs on your code - nimsuggest will hang too |
13:14:18 | FromGitter | <narimiran> for me - it happens sometimes, not always |
13:14:28 | krux02 | I disabled nimsuggest, because for me it isn't reliable. |
13:14:37 | FromGitter | <tim-st> is it already known, what causes the staying at 100% |
13:14:41 | FromGitter | <tim-st> i mean which kind of code |
13:14:47 | Yardanico | there's a lot of code which does this |
13:14:57 | FromGitter | <tim-st> but it was not in 0.18.0 |
13:15:00 | Yardanico | if I would care I think I can submit like 10-30 bug reports with different code samples |
13:15:01 | Yardanico | there is |
13:15:14 | FromGitter | <tim-st> krux02: do you have something instead that suggest a bit? |
13:15:16 | Yardanico | it was like this in 0.18.0 too |
13:15:35 | FromGitter | <tim-st> hm, didnt had that before |
13:15:46 | krux02 | tim-st: just word based completion |
13:15:51 | Yardanico | as I said, it depends on your code |
13:15:57 | FromGitter | <tim-st> ok |
13:15:58 | Yardanico | nim compiler still has a lot of crashes with invalid nim code |
13:16:03 | Yardanico | and hangs too |
13:16:08 | krux02 | my code seems to break nimsuggest regularly |
13:16:18 | FromGitter | <tim-st> but my code is valid and it goes to 100 |
13:16:47 | FromGitter | <tim-st> after devel update |
13:16:49 | Araq | recently it got worse because I listened to that banned fool and increased the VM instruction count limit |
13:17:02 | FromGitter | <tim-st> ah, that makes sense, ok |
13:17:10 | FromGitter | <tim-st> two 1 billion^^ |
13:17:12 | FromGitter | <tim-st> *to |
13:18:58 | krux02 | tim-st: word based completion isn't too bad. It does completion of function names in comments and it doesn't spam the completion with symbols that aren't used at all. But it certainly doesn't help to explore a library. |
13:19:06 | Araq | lesson learned, don't listen to fools. |
13:19:22 | krux02 | yes |
13:19:37 | FromGitter | <tim-st> yes, but which editor does it good? |
13:19:40 | FromGitter | <tim-st> sublime? |
13:19:46 | FromGitter | <tim-st> I have vscode currently |
13:19:56 | FromGitter | <tim-st> and I like go to definition |
13:19:56 | Yardanico | vscode does that too |
13:20:02 | krux02 | I think any editor can enable it somehow |
13:20:14 | FromGitter | <tim-st> Yaradnico: but vscode has nimsuggest |
13:20:19 | FromGitter | <tim-st> which goes to 100 |
13:20:39 | krux02 | can't you disable nimsuggest in vscode? |
13:20:49 | krux02 | I have emacs and I did disable nimsuggest. |
13:20:56 | FromGitter | <tim-st> I dont see an option |
13:21:02 | Yardanico | just remove nimsuggest binary :) |
13:21:12 | krux02 | that could work :P |
13:21:27 | FromGitter | <tim-st> maybe making `lint` off does it |
13:21:42 | zacharycarter | I don't know how you use emacs krux02 - did you write a lot of lisp or something before? |
13:21:49 | zacharycarter | or how you got into it rather I guess is better wording |
13:24:06 | krux02 | zacharycarter, I had some scheme introduction like 10 years ago, that is all lisp I was ever in contact with |
13:24:59 | FromGitter | <kaushalmodi> zacharycarter: Unsolicited reply.. I got introduced to emacs during my grad school coop |
13:25:01 | krux02 | but emacs lisp really isn't that bad. |
13:25:24 | krux02 | a big criticism on emacs list is that all functions are in one global namespace |
13:25:45 | krux02 | but that actually makes it very explorable, because all functions are uniquely identified by there name |
13:25:53 | krux02 | and you can always jump to the definition |
13:25:58 | krux02 | no matter where it is defined |
13:26:25 | yglukhov_ | Araq: doesn't compilerRtl imply that a symbol might be dllexported/imported or smth? |
13:26:43 | Araq | yeah |
13:27:00 | krux02 | and the syntax of lisp is easy, instead of f(a,b) it is (f a b) |
13:27:12 | yglukhov_ | Araq: but we don't need it for nim*mem functions, do we? |
13:27:41 | krux02 | zacharycarter, the only thing that makes me nervous from time to time is "dynamic scoping" |
13:28:28 | Araq | yglukhov_: the appveyor tests were red. |
13:28:47 | Araq | I think if you don't import/export it you get name clashes |
13:29:19 | zacharycarter | krux02: gotcha |
13:30:13 | krux02 | zacharycarter, one of the most amazing things about emacs lisp is its introspection. |
13:30:16 | zacharycarter | anyone have any insight into why splitting some Nim -> JS code into two modules, instead of one, would cause rendering issues with karax? |
13:30:33 | Araq | zacharycarter: it doesn't make sense :P |
13:30:41 | zacharycarter | I need to figure out a better way to debug Nim JS code |
13:30:48 | krux02 | the key sequence C-h f asks you for a function name, and then you call all information about it |
13:30:54 | zacharycarter | Araq: I know right? but it seems to be a thing! |
13:30:55 | * | donlzx quit (Remote host closed the connection) |
13:31:00 | yglukhov_ | Araq: are you sure about Appveyor? looks pretty green to me. |
13:31:03 | Araq | but components need to be re-designed |
13:31:11 | zacharycarter | ah okay |
13:31:17 | krux02 | so you do not only get the documentation, but also on what keys sequence that function is bound. |
13:31:36 | krux02 | so it is like an always up to date reference documentation built into the editor |
13:32:14 | krux02 | but when you look videos about with the topic "look how awesome emacs is" then it is most likely that you will some some completely useless feature |
13:32:15 | FromGitter | <tim-st> I asked this yesterday too I think, does someone know, if cstring -> string is possible without copy? |
13:32:27 | zacharycarter | I'll stay away from them then - regarding that hook that would allow you to call some init code after something is first rendered - what is that something? Is it a VNode once it's converted to a DOM node? Would that be the best place to put the hook? Like have an optional field on the VNode type for a callback? |
13:32:32 | zacharycarter | krux02: that does sound nice |
13:32:38 | krux02 | Araq: can you the gdb pretty printer PR |
13:32:53 | Araq | yglukhov_: https://ci.appveyor.com/project/Araq/nim/build/5063/tests |
13:33:42 | krux02 | here is the link again https://github.com/nim-lang/Nim/pull/8263 |
13:34:18 | krux02 | you recommended to change the nim-gdb start script from bash to nim. |
13:34:20 | Araq | tim-st the string owns its data, it's impossible |
13:34:25 | yglukhov_ | Araq: I suppose that one was before i changed compilerRtl to compilerproc. it was one of the failed attempts. but now it's good, isn't it? |
13:34:30 | krux02 | I did not do it, because I don't really see the advantage |
13:35:12 | Araq | yglukhov_: now it's green but from my understanding only because the defaults are unchanged |
13:35:12 | FromGitter | <tim-st> Araq: ok, thanks, then I will probably overload it somehow for both |
13:35:19 | krux02 | the start script is inspired by rust-gdb. They do it the same way, but they also proved a rust-lldb start script |
13:35:30 | krux02 | I don't have lldb support. |
13:35:40 | Araq | so how do I start this on Windows then? |
13:35:51 | Araq | do you *now* see the advantage? |
13:36:05 | krux02 | Araq: well how do you use gdb from windows in the first place? |
13:36:17 | Araq | by typing 'gdb' into the command line |
13:36:30 | krux02 | yes that still works |
13:36:47 | Araq | but nim-gdb doesn't. |
13:37:00 | krux02 | but you have to run "source path/to/nim-gdb.py" before the pretty printers are activated. |
13:37:05 | yglukhov_ | Araq: `nim*mem` procs are used regardless. only their implementation is changed based on -d:nimNoLibc. previous dll failures were caused by compilerRtl pragma. |
13:37:19 | krux02 | I would port it to bat as well |
13:37:27 | krux02 | then nim-gdb would work on windows as well |
13:37:37 | krux02 | but I don't have windows so I can't test it. |
13:37:44 | Araq | just let it be. I'll add the one line to koch.nim. |
13:37:51 | krux02 | but the script is 3 lines, it should be trivial to port |
13:38:09 | krux02 | ok |
13:38:58 | Araq | that can then also fix the fact that fucking gdb needs the .exe extension explicitly |
13:39:16 | krux02 | well it needs a file path |
13:39:20 | krux02 | doesn't it? |
13:39:33 | krux02 | on linux it doesn't need the .exe extension :P |
13:39:49 | Araq | yeah and we have already established that's dumb. |
13:40:06 | Araq | and makes tooling harder to develop. .gitignore and all that. |
13:41:08 | krux02 | well to be honest I do like the extensionless binaries on linux |
13:41:37 | krux02 | it doesn't allow multiple executables of the same name in the same folder |
13:41:45 | krux02 | disabling ambiguities. |
13:41:48 | Araq | yes, you like them. they are objectively bad though. |
13:41:56 | krux02 | why? |
13:41:58 | FromGitter | <narimiran> krux02: how do you (easily) gitignore them? (extensionless binaries) |
13:42:18 | Araq | amen. |
13:42:30 | FromGitter | <kaushalmodi> @narimiran Don't put binaries with source code |
13:42:42 | FromGitter | <kaushalmodi> ignore the binary containing folder |
13:42:45 | FromGitter | <kaushalmodi> nimble has `binDir` |
13:42:56 | FromGitter | <narimiran> @kaushalmodi tell that to nim's default settings |
13:43:00 | Araq | yes, workarounds exist. congrats. |
13:43:09 | Araq | still makes it objectively bad. |
13:43:09 | krux02 | narimiran[m], well for nim I haven't found a solution, but for c++ I just ignore the bin/ or build/ folder that also all the other generated files. |
13:43:19 | FromGitter | <kaushalmodi> @narimiran Difficult to tell that as Araq is pro-Windows :P |
13:43:23 | yglukhov_ | gitignore *, unignore */, unignore *.* |
13:43:48 | Araq | and btw it's not "binaries" that are extension-less, it's "executables" |
13:44:02 | Araq | so shell scripts are also affected |
13:44:08 | Araq | and shouldn't be .gitignored. |
13:44:18 | FromGitter | <narimiran> yglukhov_: can you please use backticks, because this way gitter fucks up your message containing `*` |
13:44:30 | krux02 | no also text files are extension less. |
13:44:37 | Araq | it's a clusterfuck. and now let me work on something important. |
13:44:39 | yglukhov_ | narimiran: `gitignore *, unignore */, unignore *.*` |
13:44:54 | FromGitter | <narimiran> thanks, much clearer |
13:45:05 | Araq | you're of course free to like bad technology. |
13:45:44 | krux02 | files are identified by the header of the file, and for scripts that is done with the "#!" directive, you you are all right, for gitignore that is not that nice. |
13:45:44 | FromGitter | <kaushalmodi> Araq: I see the trend.. whatever you don't use/prefer is bad technology |
13:46:11 | krux02 | kaushalmodi: I mean he does't use it for a reason |
13:46:18 | krux02 | or am I wrong? |
13:46:39 | Araq | the real trend here is your resistance to listen to good arguments. |
13:47:20 | krux02 | i like my linux operating system. Apple people like theirs, and windows people like theirs. That is just how it is. We are all heavily invested in learing how to use our operating system. There is no way we can stay objective. |
13:47:38 | Araq | I learned all of them. |
13:47:39 | FromGitter | <kaushalmodi> krux02: exactly |
13:47:45 | Araq | and invested in all of them. |
13:47:52 | Araq | Unix stayed bad. |
13:48:34 | * | floppydh quit (Quit: WeeChat 2.1) |
13:48:38 | krux02 | depends on the Unix flavor. |
13:48:50 | krux02 | MaxOS I don't like at all. |
13:49:00 | krux02 | Manjaro Linux. Really nice to use. |
13:49:07 | PMunch | +1 for Manjaro |
13:49:38 | krux02 | I also like the unix pipe |
13:49:46 | Yardanico | also Antergos if you want pure Arch repositories |
13:49:49 | Araq | so which flavor of Unix fixes fucking file extensions? or that lib*.so atrocity? |
13:50:01 | Yardanico | (because some people use Manjaro and say "it's the same as arch") |
13:50:22 | krux02 | Araq: none will ever do it, because that is really a minor issue after you got used to it. |
13:50:36 | Araq | no, it continues to cause problems to this day. |
13:50:45 | krux02 | and fixing isn't really possible. At best you would create another incompatible convention. |
13:50:56 | krux02 | and that doesn't help anybody. |
13:51:11 | Araq | it would help me, I believe in progress. |
13:51:18 | FromGitter | <narimiran> +2 for manjaro |
13:52:34 | Yardanico | Use antergos :) |
13:52:48 | krux02 | the libXXX.so thing is really weird thing. But yea it isn't that bad. |
13:53:09 | Araq | it makes the contents of /usr/lib unreadable. |
13:53:30 | krux02 | why? |
13:54:29 | Araq | libread libthis libsentence libplease. liband libsee libit libwith libyour libown libeyes. |
13:55:02 | Yardanico | Araq, it's easy to read that sentence |
13:55:07 | Yardanico | brain can just ignore "lib" prefix :P |
13:55:14 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
13:55:18 | Araq | doesn't work for my brain :D |
13:55:34 | PMunch | Haha, yeah the lib thing is a bit strange. Wonder how they settled on that.. |
13:56:04 | FromGitter | <kaushalmodi> Also, no one uses `ls *foo*.bar`? |
13:56:05 | krux02 | Araq: ls | sed -e 's/^lib//' -e 's/\.so.*$//' |
13:56:42 | FromGitter | <kaushalmodi> I'm really surprised these things are even an issue |
13:57:04 | Araq | I'm surprised these things STILL are an issue. after 40 years. |
13:57:31 | * | vivus joined #nim |
13:57:39 | FromGitter | <kaushalmodi> But who visually parses file names? |
13:57:45 | FromGitter | <kaushalmodi> `ls` was built for future |
13:58:07 | krux02 | ls /usr/lib | sed -e 's/^lib\(.*\)\.so.*$/\1/' |
13:58:59 | FromGitter | <narimiran> let's revolutionize programming languages by releasing Nim v1.0 in the near future, and leave revolution of unix for some other folks.... |
13:59:05 | krux02 | Araq: this should solve your libXXX.so problems once and for all: ls /usr/lib | sed -e 's/^lib\(.*\)\.so.*$/\1.dll/' |
13:59:25 | FromGitter | <kaushalmodi> @narimiran I agree |
13:59:40 | krux02 | that are some readable regular expressions :P |
13:59:41 | * | TheLemonMan joined #nim |
13:59:42 | Araq | 1. that only works if I don't use an UI based file browser (heresy, I know) |
14:00:00 | Araq | 2. a workaround is not a fix. |
14:00:18 | krux02 | well /usr/lib should really not be opened by a UI based file browser |
14:00:24 | krux02 | they are useless in that folder |
14:00:27 | TheLemonMan | for some reason if I build nimble stand-alone it picks out the wrong libpath, is there any magic spell I have to do to make it build? |
14:00:47 | TheLemonMan | working with nimble is proving to be a damn pita |
14:01:02 | FromGitter | <kaushalmodi> TheLemonMan: How do you build it? |
14:01:45 | TheLemonMan | nim c src/nimble.nim ? that's what the readme says |
14:01:55 | FromGitter | <kaushalmodi> I use `koch tools` |
14:02:06 | krux02 | yes I use koch tools as well |
14:02:14 | krux02 | you can look into koch |
14:02:21 | FromGitter | <kaushalmodi> here's my build script (https://gist.github.com/c9d7a469a3c478d3bd88689be9b012f1) |
14:02:41 | TheLemonMan | I know, but I need to build a patched version of nimble |
14:03:01 | FromGitter | <kaushalmodi> Shouldn't editing nimble.nim and running koch tools work? |
14:03:39 | TheLemonMan | to further complicate the matter I wanted this to work with my stable choosenim toolchain |
14:04:10 | FromGitter | <kaushalmodi> hmm, that's out of my scope now :) |
14:04:59 | Araq | TheLemonMan: I use 'nim c --noNimblePath --path:../nim/compiler src/nimble' in a cloned nimble |
14:18:16 | TheLemonMan | no luck, even though I've set --path to point to the choosenim directory |
14:21:08 | TheLemonMan | yay, another bug in nimble |
14:21:44 | * | jamesroseman joined #nim |
14:21:59 | Araq | there is also a NIMLIB environment variable you can set |
14:22:22 | Araq | though it might be named differently, I don't use environment vars, creates fragile builds |
14:22:58 | FromGitter | <tim-st> is there a "rule" when the use of `likely` is useful? already at 51% ? |
14:23:36 | vivus | is the IRC client lib included in nim-core or is it a nimble package ? |
14:23:49 | krux02 | what do you mean with likely? |
14:24:01 | FromGitter | <tim-st> if likely(a > b)... |
14:24:03 | TheLemonMan | tim-st, no |
14:24:07 | Yardanico | @tim-st not really |
14:24:18 | krux02 | no likely is for almost 100% useful |
14:24:22 | Yardanico | likely() just maps to C compiler's intrinsics |
14:24:24 | FromGitter | <tim-st> I think I read it's a bit costly going in the wrong direction |
14:24:35 | TheLemonMan | you should really use it after (extensive) profiling |
14:25:13 | FromGitter | <tim-st> ok, but if someone knows internal details I think it can be calculated before profiling easily |
14:25:24 | FromGitter | <tim-st> of course if has to imeplemented somehow |
14:25:34 | FromGitter | <tim-st> so there is a real percentage number |
14:25:51 | krux02 | it is costly, but it is just one of many components that might go wrong, and "pretty costly" is also relative. |
14:26:00 | krux02 | cache miss is more costly |
14:26:15 | FromGitter | <tim-st> ok, thanks, so 60% likely is already ok? |
14:27:51 | TheLemonMan | it depends, numbers without context are meaningless, that's why you profile |
14:27:53 | krux02 | I would use it for this ``` if unlikely(not isInitialized): initialize ``` but that is just a guess |
14:28:07 | FromGitter | <tim-st> ok, I think it's this topic: https://en.wikipedia.org/wiki/Branch_predictor |
14:28:32 | krux02 | my thoughts are by default the first branch pick really matters, but for a check of isInitialized, the first brach is the one that should never be taken again |
14:28:50 | krux02 | but I don't know, I never actually measured it. |
14:29:05 | FromGitter | <tim-st> ok |
14:29:38 | krux02 | the cpu also does it's own branch prediction, you don't actually have to tell it what braches are likely. |
14:29:39 | Yardanico | @tim-st from some website: "But don’t use “likely()” and “unlikely()” macros blindly. If prediction is correct, it means there is zero cycle of jump instruction, but if prediction is wrong, then it will take several cycles, because processor needs to flush it’s pipeline which is worst than no prediction." |
14:30:12 | FromGitter | <tim-st> Yardanico: thanks, so I think it should be > 80% |
14:30:25 | krux02 | so |
14:30:26 | krux02 | no |
14:30:32 | Araq | and don't benchmark on Haswell CPUs. their predictors are so good that you cannot draw any conclusions for the processors where likely matters, eg. ARM |
14:30:49 | krux02 | I would say use it only for 99% and above |
14:31:03 | Yardanico | Araq, I have Haswell CPU :P |
14:31:18 | FromGitter | <tim-st> 99% is quite high I think |
14:31:18 | Yardanico | i5-4460 |
14:31:35 | FromGitter | <tim-st> if it goes wrong it takes "some cpu cycles" extra |
14:31:48 | FromGitter | <tim-st> between 10 and 20 clock cycles. |
14:31:57 | krux02 | I actually prefer branch-less code when it's possible and performance matters |
14:32:09 | FromGitter | <tim-st> sure, but often you need them |
14:32:24 | FromGitter | <tim-st> from "between 10 and 20 clock cycles." I think it can be calculated qquite good |
14:32:48 | TheLemonMan | calculate what? |
14:32:49 | krux02 | so insead of ``if xyz: a += b`` I do ``a += int(xyz) * b`` |
14:33:15 | FromGitter | <tim-st> the probability number at which it makes sense to use likely at minimum |
14:33:39 | Yardanico | krux02, hmm |
14:34:15 | krux02 | but I don't know how well compilers actually do this themself. |
14:34:28 | TheLemonMan | that depends on the cpu (a black-box) and on your actual algorithm/implementation |
14:34:39 | TheLemonMan | you can't pull universally true values out of thin air |
14:34:54 | krux02 | the ``*`` operator can be replaced by a bitmask, but I don't know the right operation for that now |
14:35:13 | FromGitter | <tim-st> I think in fact it can be done, if we assume the upper number to be "20 cycles" |
14:35:19 | FromGitter | <tim-st> because of this I asked |
14:36:56 | TheLemonMan | for a given cpu with a given architecture and a given sequence of instructions you *might* be able to do so |
14:37:10 | krux02 | TheLemonMan, the CPU I have is not a black box. it is: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz |
14:37:54 | krux02 | but then I would only optimize on my cpu. But it is better than optimization to no CPU at all. |
14:38:18 | TheLemonMan | krux02, I'm delighted Intel decided to share the blueprints of the branch predictor with you :) that's what I meant with black box |
14:42:33 | FromGitter | <tim-st> ok, my idea was to look at different cpus old and new, if the difference range between them is high then it's individual but if it differs only in max 20% one could say use likely if it's at least 70% for all cpus |
14:42:46 | FromGitter | <tim-st> and maybe someone did that already |
14:42:48 | Araq | „The branch predictor appears to have been redesigned in the Haswell, but very little is known about its construction. |
14:42:49 | Araq | The measured throughput for jumps and branches varies between one branch per clock cycle and one branch per two clock cycles for jumps and predicted taken branches. |
14:42:49 | Araq | Predicted not taken branches have an even higher throughput of up to two branches per clock cycle. |
14:42:51 | Araq | The high throughput for taken branches of one per clock was observed for up to 128 branches with no more than one branch per 16 bytes of code. If there is more than one |
14:42:53 | Araq | branch per 16 bytes of code then the throughput is reduced to one jump per two clock cycles. If there are more than 128 branches in the critical part of the code, and if they are |
14:42:54 | Araq | spaced by at least 16 bytes, then apparently the first 128 branches have the high throughput and the remaining have the low throughput. |
14:42:56 | Araq | These observations may indicate that there are two branch prediction methods: a fast method tied to the µop cache and the instruction cache, and a slower method using a |
14:42:58 | Araq | branch target buffer.“ |
14:43:00 | Araq | from http://www.agner.org/optimize/microarchitecture.pdf |
14:43:40 | FromGitter | <tim-st> ok thanks Araq |
14:45:53 | * | miran joined #nim |
14:46:57 | * | Lord_Nightmare joined #nim |
14:48:56 | krux02 | Araq: can you merge the get-sym-id branch that I made a while ago? |
14:49:05 | Araq | no. |
14:49:10 | krux02 | :/ |
14:49:22 | Araq | code shouldn't use sym-ids, it should use hashes |
14:49:30 | krux02 | but I don't have an alternative that is feasible to resolve identifier name collisions. |
14:49:50 | Araq | any count table will do, no? |
14:49:51 | krux02 | I don't want to reimplement the compiler logic that does symbol name collsion resolution |
14:50:10 | Araq | yes, instead you exposed the bad, outdated compiler logic. |
14:50:58 | Araq | that we have to ignore in the C++ codegen in order to reduce build times. |
14:51:02 | krux02 | Araq: then can you expose the "modern" compiler logic that lets me generate non colliding identifier names? |
14:51:17 | Araq | I tried to make you do it :P |
14:52:40 | krux02 | I really would, but my time for my master thesis is really becoming a narrow window |
14:52:59 | Araq | ok, so tell me what you need |
14:53:22 | Araq | non colliding identifier names can mean ident_file_line_col |
14:53:46 | Araq | and then if these are the same due to generic instantiations we need a _count suffix |
14:55:38 | krux02 | maybe the file_line_col could work |
14:56:01 | krux02 | I want ``for i in 1 .. 10:`` to abe able to compile to glsl. |
14:56:26 | krux02 | the problem is that the iterator already introduces the symbol ``i`` |
14:57:15 | krux02 | so the generated glsl has two local variables ``i``. |
14:57:53 | krux02 | I will try to get the file_line_col hash now |
14:58:47 | * | PMunch quit (Quit: Leaving) |
14:59:37 | * | ng0 joined #nim |
15:02:52 | krux02 | I hope that all the symbols have lineinfo |
15:03:04 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
15:07:56 | Araq | they do. |
15:09:58 | * | natrys joined #nim |
15:13:43 | krux02 | even genSym symbols? |
15:14:24 | krux02 | why, why does getImpl on a type have OpenSymChoice? |
15:25:07 | krux02 | I don't want OpenSymChoice ever in my macro ast |
15:28:44 | krux02 | really the ast's need to be more stable |
15:29:17 | krux02 | I got a PR on glm that created all the different types with a template. I thought yea this makes glm more maintainable. |
15:29:45 | krux02 | I accepted it, and now all the types ast representations are completely incompatible |
15:40:00 | krux02 | Araq: when I work for Nm , I would really like to work on the ast that is exposed by the macro module. |
15:40:25 | krux02 | I think in many many cases the AST is just weird and bonkers. |
15:41:10 | krux02 | especially on getImpl |
15:41:21 | Araq | agreed |
15:43:51 | Araq | krux02: but before you patch the implementation, patch the spec. |
15:44:01 | Araq | the "after sem" AST is not in the spec at all |
15:44:20 | Araq | and ideally it's as close to the before sem AST as possible. |
15:45:38 | Araq | an OpenSymChoice is well designed though. |
15:53:31 | krux02 | araq: yes an OpenSymChoice is well designed. But a fully typechecked ast should not have it. |
16:07:19 | krux02 | Araq: OpenSymChoice is great for the ast of a non instanced generic and for the result of bindSym |
16:12:13 | * | jamesroseman quit (Ping timeout: 244 seconds) |
16:13:42 | krux02 | Araq: but I think when I call get getImpl on a generic function symbol that is fully typed. then I don't want the generic instance, I want the specialized instance. I wouldn't want it to to be different from the ast that I would get, if the function would not be generic in the first place. |
16:22:35 | * | yglukhov_ quit (Remote host closed the connection) |
16:32:15 | * | krux02 quit (Quit: Leaving) |
16:35:01 | * | nsf quit (Quit: WeeChat 2.1) |
16:54:11 | Araq | lol deprecation warnings are fixed *now* after we removed the deprecated symbols. |
16:54:21 | Araq | that might mean something... |
17:02:11 | * | jamesroseman joined #nim |
17:02:30 | * | krux02 joined #nim |
17:04:20 | miran | i have some string (e.g. "1, 15, 22") which i want to convert to seq[uint16] |
17:04:49 | miran | to convert to seq[uint], i have used `split(", ").map(parseUInt)` |
17:05:40 | miran | but how to convert it now to seq[uint16]? or is there some direct way string -> seq[uint16]? |
17:06:10 | Araq | https://www.zdnet.com/article/the-return-of-spectre/ |
17:06:55 | Araq | miran: mapIt(uint16(parseUInt(it)) maybe |
17:09:08 | miran | Araq: thanks, it does the job |
17:17:18 | * | Trustable joined #nim |
17:26:10 | * | yglukhov[i] joined #nim |
17:35:09 | * | yglukhov[i] quit (Remote host closed the connection) |
17:43:00 | miran | ok, this is something i haven't experienced before.... i have `let foo = createFoo()` and this works fine |
17:43:20 | miran | but if i change it to `const foo = createFoo()`, the compilation hangs |
17:44:24 | miran | to be more precise: compilation with `-d:release` hangs, without that flag it works |
17:44:27 | * | jamesroseman quit (Ping timeout: 240 seconds) |
17:45:10 | * | jamesroseman joined #nim |
17:48:49 | miran | the same thing happens both in stable and in devel |
17:57:17 | Araq | createFoo is not statically evaluable |
17:57:29 | Araq | and the compiler fails to tell you this :P |
17:58:12 | miran | Araq: and compiler doesn't have that problem without `-d:release`? |
17:59:14 | Araq | it probably miscompiles it either way |
18:00:46 | miran | well, without release flage it takes unreasonably long time to compile, but in the end it runs fine |
18:01:17 | miran | i guess i won't use `const` and that's it :) |
18:03:44 | Araq | can you report it properly please? |
18:04:09 | Yardanico | new exercism version is live! nim track is not yet on the main list, but you can access it by URL https://exercism.io/my/tracks/nim (it should be added to the main list soon) |
18:04:24 | miran | Araq: ok, i'll see if i can make some basic example |
18:04:54 | Yardanico | and yeah, I'll be a mentor for Nim track on exercism |
18:05:23 | Araq | Yardanico: nice. what does that mean? |
18:05:27 | skrylar | eeh, well time to add bicubic and then this module is prolly done-ish |
18:05:32 | Araq | can you mentor me too? :-) |
18:05:37 | Yardanico | no :P |
18:05:44 | Yardanico | Araq, I'll review people's solutions on exercises in nim track |
18:05:48 | miran | Araq: it is this code: https://github.com/narimiran/AdventOfCode2017/blob/master/nim/day12.nim |
18:06:04 | skrylar | i don't think anyone actually uses tricubic o.O |
18:06:04 | miran | the problem is on the line 13, if you change it to `const` |
18:06:32 | Yardanico | so people write solutions in Nim for exercises like "output hello world" and I check their code, maybe give some advices on code style/features |
18:06:59 | Yardanico | but of course someone can do their solutions in "independent" mode if they don't want to be mentored |
18:07:09 | miran | Yardanico: only 27 exercises? how to make that 100? |
18:07:17 | Araq | miran: that code looks evaluable at compile-time |
18:07:19 | Yardanico | miran, just port them from other languages |
18:07:47 | Araq | also wow 'func' is getting popular :-) |
18:07:52 | Yardanico | miran, some instructions (I asked nim track maintainer https://github.com/exercism/nim/pull/85#issuecomment-396347753) |
18:08:09 | FromGitter | <kaushalmodi> Yardanico: I had started off on exercism.. first 6 problems went fine |
18:08:18 | miran | Araq: yeah, func is great, and the reason i want to use `const` is to have `func dfs` also :) |
18:08:36 | FromGitter | <kaushalmodi> and then in 7: ⏎ ⏎ > Implement a basic reactive system. ⏎ ⏎ > Reactive programming is a programming paradigm that focuses on how values ... [https://gitter.im/nim-lang/Nim?at=5b48eaa473026160f59e56bf] |
18:08:54 | miran | if you check my commits in that repo, you can see that recently i have decided to use `func` wherever i could |
18:09:25 | FromGitter | <Yardanico> @kaushalmodi yeah, there's a lot of exercises with different difficulty |
18:10:01 | FromGitter | <kaushalmodi> coding might not be difficult.. but it looks like I might need a CS course to understand that problem statement :) |
18:10:14 | FromGitter | <Yardanico> there's a test suite |
18:10:33 | FromGitter | <Yardanico> you can implement the code by looking at tests :) |
18:10:58 | * | nsf joined #nim |
18:11:05 | FromGitter | <kaushalmodi> yeah.. but that react test suite is a different beast |
18:11:08 | miran | Yardanico: how much time does it take to port the exercises from other languages? |
18:12:03 | FromGitter | <kaushalmodi> @Yardanico You already might be knowing what I am talking about.. but for others, I'm talking about this (https://gist.github.com/fc41c71b19aa6c25a156662ea8c17a20). |
18:12:49 | Araq | hmm it's the weekend already |
18:14:02 | Araq | could add a component system to Karax that actually works |
18:26:58 | Yardanico | miran, well, usually it's easy, but also it would take some time to add all required information to configuration files, etc |
18:27:08 | Yardanico | you can just port exercises from Python :P |
18:34:32 | miran | Yardanico: in couple of weeks i'll be on a vacation.... i might do that (rather than enjoy my free time) :) |
18:37:10 | * | dddddd joined #nim |
18:41:56 | Araq | "rather than" ? programming in Nim is pure joy. |
18:42:15 | Yardanico | Araq, of course it is :) |
18:42:58 | FromGitter | <tim-st> nearly pure joy, `assert(not true)` -> `assert not true` |
18:42:59 | miran | Araq: yeah, but that is not programming, that is just a lot of manual labour translating exercise tasks from other languages.... |
18:45:21 | * | brainpro1 joined #nim |
18:45:57 | * | brainproxy quit (Ping timeout: 240 seconds) |
18:52:17 | Araq | py2nim |
18:53:00 | Yardanico | Araq, but we want idiomatic Nim :) |
18:58:01 | FromGitter | <tim-st> Araq: do you think it can be recognized in nim for these types to have same size? |
18:58:02 | FromGitter | <tim-st> echo sizeof((0i8, 0i16, 0i8)) ⏎ echo sizeof((0i8, 0i8, 0i16)) |
18:58:30 | FromGitter | <tim-st> I saw pragma pack can have downsides, but I think not on this specific type |
19:02:27 | Araq | these types don't have the same size |
19:02:42 | FromGitter | <tim-st> I know, but why? |
19:02:58 | FromGitter | <tim-st> I mean they could have |
19:03:30 | FromGitter | <tim-st> with #pragma pack(1) they have same size |
19:08:39 | Araq | alignment. |
19:09:54 | FromGitter | <tim-st> so the developer should take care himself that the tuple is sorted by size to get best performance? |
19:12:45 | FromGitter | <tim-st> I read "unaligned memory access is slower" but if this is true for the type I've shown above, why is the second not aligned? |
19:13:18 | FromGitter | <tim-st> and if the second is not slower, why isnt the first transformed to the second to save 33% space at same performance? |
19:15:38 | Araq | https://en.wikipedia.org/wiki/Data_structure_alignment |
19:17:07 | FromGitter | <tim-st> ok, but I mean the types have the same content and one is 33% smaller, isnt that a thing to exploit? |
19:17:13 | FromGitter | <tim-st> (by default) |
19:33:10 | CodeVance | I wish there was a way to make an unordered enum? For porting c code |
19:33:45 | Yardanico | what do you mean "unordered"? |
19:34:43 | CodeVance | type MyEnum = enum[a=3,b=2,c=4] |
19:37:37 | FromGitter | <kaushalmodi> CodeVance: I don't think that's legal.. does that compile? |
19:38:29 | CodeVance | nope |
19:38:33 | CodeVance | I don't know how to do one line enum def |
19:38:55 | CodeVance | but they basically aren't ordered 1,2,3 |
19:39:44 | FromGitter | <kaushalmodi> got it |
19:39:52 | FromGitter | <kaushalmodi> so you meant to do: ⏎ ⏎ ```type ⏎ MyEnum = enum ⏎ a=3, b=2, c=4``` [https://gitter.im/nim-lang/Nim?at=5b49000873026160f59e8fcc] |
19:40:03 | FromGitter | <kaushalmodi> but that wouldn't compile too |
19:40:08 | FromGitter | <amscotti_twitter> Hi, I'm having some issues using `filterIt`, I have the same code working with just a `filter` and a `proc` but I can't seem to get `filterIt` working. I get an `lib/pure/collections/sequtils.nim(398, 7) Error: internal error: environment misses: result` error when building it. My code is at https://gist.github.com/amscotti/a51e1a34f085623678b6eba5c017d4ec if anyone wants to take a look at it, line 20 is the |
19:40:08 | FromGitter | ... `filterIt` I'm trying to run. |
19:40:11 | FromGitter | <kaushalmodi> > Error: invalid order in enum 'b' |
19:41:50 | * | krux02 quit (Read error: Connection reset by peer) |
19:42:59 | FromGitter | <kaushalmodi> CodeVance: would stringified enums work for your use case? |
19:43:04 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4900c8641ecc065fa0c6b5] |
19:43:23 | FromGitter | <kaushalmodi> outputs: ⏎ ⏎ ```3 0 ⏎ 2 1 ⏎ 4 2 ⏎ cool 3``` [https://gitter.im/nim-lang/Nim?at=5b4900db95e03e3d7b483ffd] |
19:43:33 | CodeVance | amscott just surround with () |
19:43:44 | CodeVance | kaushalmodi I need the vals to be uint32 what does a stringify do ? |
19:44:43 | CodeVance | @amscotti_twitter surround the expressions with () |
19:45:20 | FromGitter | <kaushalmodi> I am afraid someone else would have to answer that internal detail. From what it looks, it sets the "name" or `$` of the enum to that string, but the ordinal values are as usual in int |
19:45:35 | FromGitter | <Varriount> Huh, I didn't know you could use strings as an enum value |
19:45:41 | Araq | CodeVance: c2nim reorders the enum |
19:45:45 | Araq | use c2nim. |
19:46:11 | FromGitter | <amscotti_twitter> @CodeVance, Cool I'll give that a try. Thanks! |
19:46:40 | CodeVance | @araq I don't want the source code to reorder it XD. I'll just write a macro to reorder it. I was hoping there was a builtin pragma or something |
19:47:28 | CodeVance | @amscotti_twitter looking at it now it works on latest devel nim without () as well |
19:47:31 | skrylar | i concur that forced ordering of enums is :E |
19:47:55 | * | stefanos82 joined #nim |
19:49:10 | FromGitter | <kaushalmodi> skrylar: Now what does ":E" mean? |
19:50:46 | FromGitter | <kaushalmodi> May be https://en.wikipedia.org/wiki/List_of_emoticons needs an update :P |
19:52:12 | CodeVance | its not there |
19:52:22 | CodeVance | its a monster with teeth |
19:52:43 | FromGitter | <kaushalmodi> lol found this: https://www.urbandictionary.com/define.php?term=%3AE |
19:52:51 | CodeVance | But I don't know what that's supposed to mean? |
19:52:54 | FromGitter | <kaushalmodi> what a difference an open parenthesis can make |
19:53:20 | CodeVance | :E |
19:53:21 | CodeVance | emoticon |
19:53:22 | CodeVance | An emoticon that means freaked-out. |
19:59:35 | * | krux02 joined #nim |
20:01:18 | * | fvs left #nim ("ERC (IRC client for Emacs 26.1)") |
20:01:53 | Araq | meh ok, add some sort() proc to the compiler |
20:04:01 | FromDiscord | <exelotl> question: `when defined(windows)` or `when defined(Windows)` ? |
20:05:57 | * | jamesroseman quit (Ping timeout: 240 seconds) |
20:07:27 | * | jamesroseman joined #nim |
20:08:31 | FromGitter | <kaushalmodi> seems like both work (based on what I see on grepping though Nim repo) |
20:08:58 | CodeVance | windows no caps |
20:09:12 | CodeVance | the first letter cap is the only one that matters |
20:09:23 | CodeVance | What really ? kaus |
20:09:29 | FromGitter | <kaushalmodi> .. though the capital Windows cases show up only in the deprecated libs |
20:09:33 | Araq | actually for 'defined' no cap matters |
20:09:47 | FromGitter | <kaushalmodi> no I take that back |
20:09:53 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b490710c02eb83d7c716b54] |
20:11:57 | * | jamesroseman quit (Ping timeout: 240 seconds) |
20:12:48 | CodeVance | How to make pragma for enum |
20:17:06 | * | lompik quit (Ping timeout: 268 seconds) |
20:20:53 | * | endragor joined #nim |
20:21:25 | * | jamesroseman joined #nim |
20:25:44 | * | endragor quit (Ping timeout: 268 seconds) |
20:33:48 | Araq | CodeVance: I don't think you can write a {.mymacro.} on an enum |
20:34:03 | Araq | but mymacro: type Foo = enum ... will work |
20:34:21 | CodeVance | okay thanks |
20:36:45 | CodeVance | no that syntax does not work |
20:37:27 | CodeVance | oh |
20:37:30 | CodeVance | I misread your post |
20:45:09 | CodeVance | are destructors fast? |
20:46:07 | Araq | sure |
20:46:21 | Araq | but use the C++ backend for them, they introduce hidden try-finallys |
20:46:46 | dom96 | are destructors stable? |
20:48:12 | Araq | hardly, but I might have a "hello world" working with the new destructor based strings |
20:57:58 | stefanos82 | Araq: will the new destructor going to get introduced with 0.19 or with 1.0? |
20:58:50 | Araq | 0.19 |
20:58:55 | stefanos82 | very nice |
20:59:17 | stefanos82 | in other words, with the release of 0.19 the default backend will be C++? |
20:59:27 | skrylar | eww |
20:59:33 | CodeVance | araq is there any advice you'd have for game dev with nim? |
21:00:09 | Araq | 0.19 will ship with --gc:destructors but I doubt we can make that mode the default |
21:00:48 | stefanos82 | I got a bit confused now. |
21:00:54 | Araq | CodeVance: yeah, let me prepare a gist |
21:00:58 | FromGitter | <kaushalmodi> Delving in HSlice.. are tuples and HSlice related? (based on `$` of HSlice looks like {a,b) tuple) |
21:01:08 | stefanos82 | will you introduce try / finally for C as well in the form of macros? |
21:01:37 | FromGitter | <kaushalmodi> *(a,b) tuple |
21:01:44 | Araq | try-finally already works for the C target, I don't understand this question |
21:01:55 | CodeVance | @kaushalmodi hslices are ordinals |
21:01:56 | * | endragor joined #nim |
21:02:21 | stefanos82 | well, you said "but use the C++ backend for them, they introduce hidden try-finallys", unless you meant Nim's try finally operators |
21:02:43 | Araq | I meant Nim's. |
21:03:01 | Araq | the destructor injections are implemented as an AST to AST transformation. |
21:03:02 | stefanos82 | ah OK, that makes it clearer now; thank you. |
21:03:13 | Araq | so all backends are affected automatically. |
21:03:14 | FromGitter | <kaushalmodi> CodeVance: Really? |
21:03:22 | CodeVance | no |
21:03:27 | CodeVance | I'm mistaken |
21:03:34 | FromGitter | <kaushalmodi> ```hs4=(a: 0.1, b: 'a') is of type HSlice[system.float64, system.char]``` [https://gitter.im/nim-lang/Nim?at=5b4913a5866e0c6b15a584a1] |
21:03:45 | CodeVance | I was thinking of range |
21:03:45 | FromGitter | <kaushalmodi> yeah.. because it seems to handle any type thrown into it |
21:04:07 | FromGitter | <kaushalmodi> That `(a: 0.1, b: 'a')` reminds me of tuples |
21:04:24 | FromGitter | <kaushalmodi> so I was wondering if tuples can be assigned using HSlices or if they are at all related |
21:04:38 | FromGitter | <kaushalmodi> *Spoiler: I was unable to assign hslices to tuples |
21:04:39 | Araq | that's just $ for objects, I think |
21:04:58 | FromGitter | <kaushalmodi> Araq: thanks |
21:04:59 | Araq | don't draw too many conclusions from system.$ |
21:05:06 | FromGitter | <kaushalmodi> ok |
21:05:16 | Araq | (I want to remove it for objects, but nobody agrees with me) |
21:05:17 | CodeVance | use repr instead? |
21:05:17 | FromGitter | <kaushalmodi> While you are here.. are HSlices and sets related? |
21:05:23 | Araq | no. |
21:05:28 | FromGitter | <kaushalmodi> ok .. |
21:05:38 | FromGitter | <kaushalmodi> so HSlices and interators are related right? |
21:05:51 | Araq | https://nim-lang.org/docs/system.html#HSlice |
21:05:53 | FromGitter | <kaushalmodi> I am just trying to piece things together |
21:05:56 | Araq | no magic. |
21:06:06 | Araq | just what system.nim says it is. |
21:06:10 | FromGitter | <kaushalmodi> Yes, I read that |
21:06:16 | FromGitter | <kaushalmodi> but was looking for more info |
21:06:26 | * | endragor quit (Ping timeout: 268 seconds) |
21:06:35 | FromGitter | <kaushalmodi> it says lower and upper bounds.. but a and b can be different types |
21:06:40 | FromGitter | <kaushalmodi> so how do bounds apply there? |
21:07:02 | Araq | https://nim-lang.org/docs/system.html#items.i,HSlice[T,T] |
21:07:37 | Araq | simple, it needs to be the same T for iteration. |
21:07:39 | FromGitter | <kaushalmodi> ah! makes sense |
21:07:57 | FromGitter | <kaushalmodi> but then the "bounds" shouldn't be part of hslice doc, right? |
21:08:31 | FromGitter | <kaushalmodi> this works.. so trying to make some sense out of that: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4914ce66c1e833a9e63faa] |
21:08:43 | FromGitter | <kaushalmodi> ```code paste, see link``` |
21:15:29 | * | Vladar quit (Quit: Leaving) |
21:24:33 | * | gb00s quit (Quit: The Lounge - https://thelounge.github.io) |
21:31:33 | FromGitter | <kaushalmodi> wow.. this works (understanding signatures feels awesome!): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b491a34641ecc065fa10877] |
21:31:47 | FromGitter | <kaushalmodi> *prints `def`* |
21:33:12 | FromGitter | <kaushalmodi> technically that enum should have been: ⏎ ⏎ ```type ⏎ MyEnum = enum ⏎ Sixth = 5, ⏎ echo str[3 .. Sixth]``` [https://gitter.im/nim-lang/Nim?at=5b491a986534bc5d2e59220c] |
21:33:19 | * | rockcavera joined #nim |
21:36:57 | * | miran quit (Ping timeout: 264 seconds) |
21:37:51 | * | jamesroseman quit (Ping timeout: 240 seconds) |
21:40:30 | * | nsf quit (Quit: WeeChat 2.1) |
21:41:52 | * | jamesroseman joined #nim |
21:45:57 | * | jamesroseman quit (Ping timeout: 240 seconds) |
21:50:13 | FromGitter | <Yardanico> @amscotti hi, if you're here - what's the reason of https://github.com/exercism/nim/blob/master/config.json#L3 being disabled? |
21:50:24 | FromGitter | <Yardanico> with that setting there's no Nim on v2 website |
21:50:43 | FromGitter | <Yardanico> @amscotti_twitter |
21:53:31 | dom96 | https://github.com/exercism/nim/pull/99 |
21:53:38 | * | rockcavera quit (Remote host closed the connection) |
21:53:44 | Yardanico | oh |
21:53:49 | * | Trustable quit (Remote host closed the connection) |
21:56:38 | dom96 | Why so impatient? |
21:57:21 | Yardanico | dom96, idk :P |
22:00:37 | Araq | CodeVance: https://gist.github.com/Araq/b0ccaf122406a561fec71e5051d8028b |
22:01:01 | Araq | never tried to really develop a game with this idea, but it looks nice on paper |
22:01:23 | Araq | and I'm not this short document gets my point across. |
22:04:22 | * | brainpro1 quit (Ping timeout: 256 seconds) |
22:04:49 | CodeVance | hmm its supposed to generate what type of code though? |
22:04:57 | CodeVance | Araq: |
22:07:31 | CodeVance | hmm it would be interesting, but also a lot of work |
22:08:01 | Araq | it would produce "real" types and more importantly |
22:08:22 | Araq | accessors that ensure these invariants |
22:09:24 | * | brainpro1 joined #nim |
22:12:26 | * | gb00s joined #nim |
22:15:12 | CodeVance | You could run a "defragment" process just like the "gc" Then leave reshuffeling for later |
22:15:40 | CodeVance | or not run reshuffeling at all |
22:15:50 | CodeVance | just overwrite with 'new' object |
22:16:54 | CodeVance | which is basically what the paper link says |
22:18:30 | CodeVance | araq how fast is this `for i in 0..<1: sleep(1)` does it have any overhead? |
22:18:57 | Araq | sleep(1)? |
22:19:23 | Araq | for 2 iterations? |
22:19:34 | Araq | or one |
22:19:41 | CodeVance | for zero |
22:19:47 | CodeVance | :facepalm: |
22:20:39 | CodeVance | basically is an empty for loop zero cost |
22:20:47 | Araq | sure |
22:20:53 | FromGitter | <tim-st> I compiled nim devel some minutes ago and the code with `regex` just wont compile nothing happens |
22:22:22 | FromGitter | <tim-st> also suddenly the regex cannot evaluated at compile time |
22:24:08 | FromGitter | <tim-st> it just chills: `[Done] exited with code=1 in 167.589 seconds` |
22:24:59 | CodeVance | nre? |
22:24:59 | CodeVance | pcre? |
22:25:06 | CodeVance | re? |
22:25:18 | FromGitter | <tim-st> `regex` as written above... |
22:25:34 | CodeVance | the package? |
22:25:44 | FromGitter | <tim-st> yes |
22:25:58 | FromGitter | <tim-st> `const reContents = re"(?s)<h2>\s*?<span(?:(?:\s.*?>)|>).*?</span>\s*?</h2>"` |
22:26:30 | FromGitter | <tim-st> worked at 0.18.0 |
22:29:43 | FromGitter | <tim-st> ok, I updated the version, it seems the devel required a new version |
22:30:59 | CodeVance | I'm running the tests now |
22:31:01 | FromGitter | <tim-st> compilation doesnt work though :( |
22:31:40 | FromGitter | <tim-st> I have gcc processes running but nothing is working all processes just chill |
22:31:54 | * | CodeVance sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/UsYSMiIIxdAQXwWNEkfEwpce > |
22:33:35 | CodeVance | https://travis-ci.org/nim-lang/Nim/builds |
22:33:37 | FromGitter | <tim-st> I can compiled some code, it has to do with regex |
22:33:55 | CodeVance | Maybe you used a broken devel |
22:34:33 | FromGitter | <tim-st> how do I know? |
22:35:44 | CodeVance | use the travis-ci link look if you are on a green commit |
22:36:55 | FromGitter | <tim-st> shit I think I got a red version |
22:37:44 | FromGitter | <tim-st> dd47013017d75a2b1a8c80e12f273e18e86f7d72 |
22:38:32 | CodeVance | No that's right. |
22:38:53 | FromGitter | <tim-st> ok, then it's maybe a bug in regex |
22:39:07 | CodeVance | then clone the nim-regex repo |
22:39:14 | CodeVance | go into that then nimble install |
22:39:18 | CodeVance | Which was what I did |
22:39:24 | CodeVance | then nimble test |
22:39:43 | CodeVance | I literally cloned the repo a few seconds ago |
22:40:19 | FromGitter | <tim-st> nimble test? |
22:41:55 | FromGitter | <tim-st> doesnt work, thanks for the help though, will try tomorrow |
22:42:22 | Araq | probably a regression in Nim's VM |
22:42:29 | Araq | we'll have a look. |
22:42:53 | FromGitter | <tim-st> seems more like todo with compiler |
22:43:05 | Araq | Nim's development is speeding up, but sadly it means more regressions too |
22:43:17 | CodeVance | If that fails. In the console type nim -v |
22:43:34 | FromGitter | <tim-st> I mean with gcc |
22:43:38 | CodeVance | Well I can tell you my commit |
22:44:41 | CodeVance | is your path setup? did you reinstall your computer |
22:44:54 | CodeVance | your on windos right? |
22:45:27 | FromGitter | <tim-st> maybe I didnt clean some old files, but deleted nimcache folders |
22:45:36 | FromGitter | <tim-st> nim and gcc in path, yes |
22:45:56 | CodeVance | #54a85b4ff56393e7279f244fe8557ebb36f864ee |
22:47:04 | FromGitter | <tim-st> not sure what it is, I look tomorrow, a smaller example with same proc compiles |
22:47:09 | CodeVance | restart not reinstall :X |
23:01:05 | FromGitter | <rayman22201> Hey Nim people. How do you represent the regex `a{3}` or `a{3,5}` with the Nim Peg DSL? |
23:07:34 | * | byte512 quit (Ping timeout: 264 seconds) |
23:07:52 | shashlick | Just use nitely/regex - pure Nim regex |
23:10:01 | * | byte512 joined #nim |
23:10:52 | CodeVance | AnA <- a |
23:11:51 | CodeVance | a <- "a" |
23:11:52 | CodeVance | acollection <- a a a |
23:11:52 | CodeVance | is what I think |
23:12:47 | CodeVance | PEG isn't a regex replacement. its for a parser |
23:14:17 | FromGitter | <rayman22201> I am aware, but straight from the manual, "The current implementation has been designed as a more powerful replacement for regular expressions." |
23:14:29 | FromGitter | <rayman22201> unless the manual is wrong |
23:15:44 | FromGitter | <rayman22201> https://nim-lang.org/docs/pegs.html |
23:16:04 | FromGitter | <rayman22201> That being said, is there a pure regex engine in Nim devel? |
23:16:14 | FromGitter | <rayman22201> pure Nim regex engine |
23:18:26 | FromGitter | <data-man> @rayman22201 https://github.com/nitely/nim-regex |
23:20:20 | skrylar | https://nim-lang.org/docs/basic2d.html y dis 404 |
23:21:43 | FromGitter | <rayman22201> @data-man thanks 👍 |
23:25:07 | FromGitter | <rayman22201> another random question. How can I send terminal escape sequences though echo? |
23:25:14 | FromGitter | <rayman22201> through echo? |
23:25:27 | * | donlzx joined #nim |
23:25:32 | * | donzx joined #nim |
23:25:46 | Araq | terminal.nim |
23:25:55 | * | donlzx left #nim (#nim) |
23:27:51 | FromGitter | <kaushalmodi> @rayman22201 Check out a "sugar" package for colorful echoes in nimble.. `fab` |
23:28:02 | FromGitter | <rayman22201> thanks again :-) |
23:28:03 | FromGitter | <kaushalmodi> It uses terminal |
23:29:57 | FromDiscord | <exelotl> if I have the following: `proc setFlag(val:cint) {.importc.}` where val is 0 or 1 |
23:30:23 | FromDiscord | <exelotl> what would be the best way to let people use `true` and `false` instead? |
23:35:29 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:38:14 | skrylar | add a template that accepts a boolean and then in turn calls setFlag(val.cint)? |
23:49:34 | Araq | Error: system module needs: newSeq |
23:50:04 | Araq | bah, picky compiler. yeah, I haven't yet implemented newSeq... |
23:57:08 | * | natrys quit (Quit: natrys) |
23:58:40 | * | rockcavera joined #nim |