<< 13-07-2018 >>

00:00:07stefanos82if I'm using an IDE, yes I will use my mouse
00:00:20stefanos82if I'm using Vim, I don't really need it
00:00:42Araqthat would mean you never need to select text in Vim.
00:01:01stefanos82I use my keys to highlight the areas I want to
00:01:39Araqyeah and with a mouse you could do that faster. ;-)
00:01:46stefanos82lol
00:02:16stefanos82to be honest, I haven't had the need to highlight any code up to now
00:05:46stefanos82what editor did you use before VS code Araq?
00:08:47CodeVanceIs there something similar to weakref list in nim?
00:10:37*xet7 quit (Quit: Leaving)
00:12:18stefanos82CodeVance: https://github.com/nim-lang/Nim/blob/devel/tests/gc/weakrefs.nim
00:12:26FromGitter<Quelklef> woah Araq you're against keyboard-only setups?
00:13:19CodeVancethanks
00:13:33FromGitter<Quelklef> I'm surprised. It feels like the whole (programming) world is holding Vim & co. as the ultimate way to edit
00:14:41stefanos82Nim team, to whom it may concern: this works https://nimble.directory/
00:14:43stefanos82this does not https://nimble.directory/docs/collections//collections/weakref.html
00:14:56stefanos82obviously I cannot find docs/ anywhere in it
00:15:33CodeVancestefanos82: that example makes my head hurt
00:15:46stefanos82the weakref test?
00:15:47CodeVanceI want something that doesn't get in the way of the gc
00:16:01Araqkeyboard-only setups are barbaric and no programmer believes in them.
00:16:22FromGitter<Quelklef> It's how I personally work
00:16:29FromGitter<Quelklef> Obviously not with Chrome etc. but
00:16:31Araqhere is my reasoning: No programmer argues for a keyboard-only smart phone.
00:16:36stefanos82Araq: that "no programmer" is definitely not me and many thousands of Vim users
00:16:41CodeVanceUse what works. CTRL+SHIFT+P VSCODE ftw
00:16:59FromGitter<Quelklef> Yeah, that's because typing on a smartphone is a pain but the touch interface is otherwise quite smooth and natural
00:16:59Araqsmart phones got the touch screen, an evolution of the "point to" device called mouse.
00:17:22CodeVanceAraq: no programmer in their right mind should try programming on a smartphone
00:17:27stefanos82how can you compare touch screens with keyboard now...seriously man
00:17:38stefanos82CodeVance: EXACTLY!
00:17:43FromGitter<Quelklef> Sure, Araq, but there's a big difference
00:17:54stefanos82I won't have thumbs by the end of my coding lol
00:17:57FromGitter<Quelklef> For many phones, the touch screen is the single interface to the phone (sans, say, volume buttons)
00:18:02CodeVancetouch screen is even more intuitive than the mouse
00:18:08Araqexactly.
00:18:14Araq"even more intuitive".
00:18:19FromGitter<Quelklef> But computers have both mice and keyboards and the issue is that switching between the two is troublesome
00:18:56stefanos82I really don't understand Araq's obsession with mouse
00:19:04CodeVanceThe 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:17Araqthat's just your opinion. My keyboard is big enough so that I need to "switch" from letters to digits
00:19:17FromGitter<Quelklef> Type some code, move your hand to the mouse, make a selection, move back
00:19:30FromGitter<Quelklef> You can't just reach??
00:19:40CodeVanceAraq should go all the way. use only a roll ball
00:20:10FromGitter<Quelklef> I mean that's irrelevant anyway; that's one keyboard and doesn't generalize like your claim does
00:20:15Araqtype some letters, type some digits, notice you got them wrong, change the hand positioning
00:21:09CodeVanceswitch windows Alt->Tab or hand on mouse -> move mouse -> look -> click
00:21:13Araqchange to the cursor keys, try to scroll with them...
00:21:30Araqit's just an illusion of a frictionless device
00:21:32stefanos82lol 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:54FromGitter<kayabaNerve> I love how Nim files compile separately and link versus me getting 1 10,000 line piece of trash
00:21:56stefanos82have you ever tried Vim Araq?
00:22:05Araqand what if you are nut "just a character away"?
00:22:09Araq*not
00:22:15FromGitter<Quelklef> Uh, change to cursor keys? `hjkl`
00:22:20stefanos82Araq: OK make them two then
00:22:24Araqwhat if you are 10 lines away? do you then count to 10?
00:22:37AraqI did use VIM. it's stupid crap.
00:22:42stefanos82I have line numbers enabled
00:22:43FromGitter<Quelklef> For how long?
00:22:56Araqfor 6 months.
00:23:00stefanos82LOL!
00:23:06stefanos82I rest my case your honor
00:23:12stefanos82no further questions!
00:23:14Araqwhy?
00:23:28Araqshould I have used it for 10 years before realising it's bonkers?
00:23:54FromGitter<kayabaNerve> ^^
00:23:57FromGitter<Quelklef> I think it's more like
00:24:13stefanos82you have the same mentality as those who read a "24 hours" book and expect to become gurus
00:24:16Araqyou can't even use your cursor as a primitive mark to go back after a scroll action.
00:24:18FromGitter<Quelklef> Well, first of all, that's 6mo of use, not necessarily of learning
00:24:21stefanos82this is not the Matrix man, chill
00:24:23stefanos82http://norvig.com/21-days.html
00:24:45FromGitter<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:52FromGitter<rayman22201> https://github.com/nim-lang/Nim/pull/8260
00:25:02stefanos82just use / and search for the keyword you are looking for
00:25:05stefanos82it will take you there
00:25:26FromGitter<Quelklef> Araq you should try Kakoune
00:25:28AraqI don't "search" for my cursor position
00:25:30stefanos82you 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:31FromGitter<Quelklef> it's like Vim but seems less arcane
00:26:10stefanos82kakoune looks like a Vim-wanna-be
00:26:17FromGitter<Quelklef> It's the opposite
00:26:24Araqnot to mention that typing speed in an editor with mouse support is not my bottleneck when programming anyway.
00:26:32FromGitter<Quelklef> It's not about typing speed
00:27:10Araqyeah, it's about productivity. and I've yet to meet a productive Vim user ;-)
00:27:22stefanos82Araq: 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:29FromGitter<Quelklef> Hmm
00:27:52stefanos82Araq: go say that to FaceBook, Google, and the largest companies out there
00:27:55FromGitter<Quelklef> How do you feel about Emacs Araq
00:27:58stefanos82do it as a survey
00:28:00Araqstefanos82, try to play any shooter or RTS with only a keyboard.
00:28:24stefanos82how can you compare these two completely different subjects with keyboard vs mouse?
00:28:25Araqand be enlightened that a mouse really is a useful additional tool in your toolbox
00:28:33FromGitter<Quelklef> ???
00:28:40FromGitter<Quelklef> You don't program in a 3d environment
00:28:50FromGitter<Quelklef> In which you have to react to threats with microsecond precision
00:29:04stefanos82man, you are too eccentric for my taste
00:29:06Araqcomputer games are about productively issueing commands to a computer.
00:29:10FromGitter<Quelklef> No
00:29:14FromGitter<Quelklef> No, they're not, at all
00:29:21Araqyes, they are.
00:29:26FromGitter<Quelklef> If CS:GO was about productively killing the enemy team it'd be played by bots
00:29:30Araqrealtime games are.
00:29:30FromGitter<Quelklef> It's about a fun challenge
00:29:34Araqrealtime games are.
00:29:35FromGitter<Quelklef> That's why there's no aim assist
00:29:44FromGitter<Quelklef> Example, for concreteness?
00:30:04Araqjust watch a professional Starcraft player
00:30:33FromGitter<Quelklef> Unfortunately, I've never played Starcraft so I can't speak on it
00:31:09FromGitter<Quelklef> I don't think the fact that people *do* play SC with the mouse means it's the right way, anyway.
00:31:13Araqso yeah, when we look at the systems where effectively issuing commands gives you a strategic advantage.
00:31:29FromGitter<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:29Araqwe see the combination of keyboard+mouse succeed.
00:31:42FromGitter<Quelklef> Hmmm
00:31:43CodeVancethats in a world where the commands are limited in number
00:31:47FromGitter<Quelklef> Yeah
00:31:50FromGitter<Quelklef> What he said ^
00:32:00CodeVanceBlender says one hand on keyboard one hand on mouse
00:32:03FromGitter<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:09FromGitter<Quelklef> Leaving the right open
00:32:32FromGitter<rayman22201> As entertaining as this is, I think we might be getting a bit off topic....
00:32:54Araqwell I'm done. feel free to disagree with me.
00:33:06FromGitter<Quelklef> Fair enough
00:33:10FromGitter<Quelklef> I still think you should read that article
00:33:16FromGitter<Quelklef> It's fun and interesting even if you disagree
00:33:45stefanos82if I were doing some 3D programming, most probably I would need to use mouse
00:33:48FromGitter<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:03stefanos82but not with Vim and my limited professional programming skills
00:34:13FromGitter<kayabaNerve> Skill video games are about being the most productive you can be, as a personal challenge, for fun.
00:34:30FromGitter<kayabaNerve> I play Halo not for my mad skills, but rather because I love the story.
00:34:31FromGitter<Quelklef> @kayabaNerve I don't quite understand what you're saying
00:34:43FromGitter<Quelklef> "Productivity focuses on speed, but really the concept is speed AND quality."
00:34:45FromGitter<rayman22201> guys. Seriously. off-topic...
00:34:48FromGitter<kayabaNerve> But CS: GO/StarCraft? Those are all about being the most productive
00:34:56FromGitter<Quelklef> Right, for the human
00:35:05FromGitter<Quelklef> Not on the level of interfacing the goal and the human
00:35:09FromGitter<Quelklef> That's deliberately imperfect
00:35:20FromGitter<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:33FromGitter<Quelklef> @rayman22201 I don't see anything on-topic happening that needs more precedence...
00:35:36FromGitter<Quelklef> @kayabaNerve Okay, ...
00:35:42FromGitter<rayman22201> @Quelklef lmao
00:35:48FromGitter<kayabaNerve> @Quelklef So productivity isn't speed, sorry, but time put in
00:35:50FromGitter<rayman22201> code review my stuff :-P
00:36:02FromGitter<kayabaNerve> Video games are Productivity + Quality of Work
00:36:41FromGitter<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:59FromGitter<Quelklef> A *competitive* video game, let's say
00:37:17CodeVanceThe on topic thingy is the code review peeps
00:37:26FromGitter<Quelklef> Who's code reviewing?
00:37:37FromGitter<kayabaNerve> And the fun, in skill based games, is the personal challenge
00:37:38CodeVance<rayman22201> https://github.com/nim-lang/Nim/pull/8260
00:37:56FromGitter<Quelklef> @CodeVance I mean there's no conversaton
00:38:02FromGitter<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:13FromGitter<kayabaNerve> Halo however, can be skill based, or can be story based, and is different
00:38:18FromGitter<kayabaNerve> CodeVance: Want to review my code?
00:38:29FromGitter<Quelklef> @kayabaNerve I think you've disconnected a bit from the original point
00:38:35CodeVanceYa cause you guys are philosophising user computer interfaces.
00:38:45FromGitter<Quelklef> Which is efficiency of the interface
00:39:13FromGitter<Quelklef> Araq pointed out that mouse/keyboard is used in video games, where you have to be really precise and quick
00:39:23FromGitter<kayabaNerve> I was just disagreeing with you disagreeing with Araq about if VGs focused on productivity
00:39:32FromGitter<kayabaNerve> Not about efficiency or different interfaces
00:39:41FromGitter<kayabaNerve> @Quelklef Logs are from IRC which doesn't handle message updates
00:39:54FromGitter<Quelklef> Ah, well
00:39:57CodeVanceI think its winding down
00:40:08FromGitter<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:13FromGitter<kayabaNerve> @rayman22201 I like the idea for a better search
00:40:22CodeVance@kayabanerve what code?
00:40:39FromGitter<kayabaNerve> CodeVance github.com/kayabaNerve/Pacman3D
00:40:50CodeVance@rayman I think it was a long day for everyone
00:40:58FromGitter<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:02FromGitter<kayabaNerve> Feel free to fix it for me
00:41:14stefanos82for some reason I feel like Araq compares golf carts with Ferrari and Lamborghini cars
00:41:19CodeVance@kayaba what dependencies I need?
00:41:19FromGitter<kayabaNerve> Great polymorphism and `[]` operator if I do say so myself
00:41:24FromGitter<Quelklef> woah stefanos
00:41:31FromGitter<Quelklef> let's not start insulting people please
00:41:38stefanos82it's not an insult
00:41:46stefanos82it's how *I* feel
00:41:51FromGitter<Quelklef> Uh, what
00:41:52FromGitter<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:53FromGitter<Quelklef> lol
00:42:16FromGitter<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:39CodeVancekayaba maybe make it a nimble project atleast so I can actually run the code without playing code-wackamole
00:42:50FromGitter<Varriount> @rayman22201 I'm going through your code right now - I may not have enough time to review it completely though.
00:42:59CodeVanceI'm talking about pacman3d
00:43:06FromGitter<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:18FromGitter<rayman22201> thanks @Varriount. no rush! I appreciate you looking
00:44:34CodeVancevscode settings `[nim]: { "editor.tabSize": 2 }`
00:45:57FromGitter<kayabaNerve> @Quelklef I will fight whoever says that
00:46:03FromGitter<kayabaNerve> CodeVance: secp256k1 is
00:46:10FromGitter<kayabaNerve> Lol. It's done by the Status team.
00:46:33FromGitter<kayabaNerve> My project isn't because it has three dependencies and I haven't bothered to.
00:46:56FromGitter<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:18FromGitter<Quelklef> I mean, go ahead and fight this link: https://nim-lang.org/docs/nep1.html
00:47:29FromGitter<Quelklef> I also prefer 4 but hey you gotta follow the standard :\
00:47:50CodeVanceno you don't
00:47:59CodeVanceIt's just easier with 2 spaces
00:48:04CodeVancelooks the best
00:48:11FromGitter<Quelklef> I think 4 looks nicer
00:48:24FromGitter<Varriount> @rayman22201 Doesn't fuzzysearch.nim, line 101 cause a fibonacci progression?
00:48:26FromGitter<Quelklef> But I'm sure it's just because I'm used to it (Python...)
00:48:38FromGitter<kayabaNerve> 2 hurts my eyes...
00:48:53FromGitter<kayabaNerve> So I'm fighting @Varriount and dom96, the authors?
00:49:02FromGitter<Quelklef> Looks like it.
00:49:20FromGitter<kayabaNerve> Or doesn't really hurt my eyes per say, but does make me strain to verify the line ups.
00:49:34FromGitter<Quelklef> Yeah, I agree. Everything looks smushed
00:49:35FromGitter<Varriount> @kayabaNerve If you want to see my personal style, look at my commandant repo
00:49:41FromGitter<Quelklef> It does help keep lines shorter though
00:49:43FromGitter<kayabaNerve> Saying that Nim is indentation based, I'm surprised they don't use the longer and clearer 4 spaces
00:49:44CodeVancejust use 4 tabs if you prefer. some day soon (hopefully it won't matter anymore)
00:49:56FromGitter<Quelklef> Well it makes it a lot easier to keep under 80chars
00:50:16FromGitter<kayabaNerve> CodeVance: Identation based editing? Get rid of tabs and spaces? Just one unit that compiles to spaces for compatibility?
00:50:22FromGitter<Quelklef> I remember getting frustrated that Python used 4 spaces because it made following pep8 frustrating
00:50:31FromGitter<Quelklef> Why do no languages use 3 spaces, huh??
00:50:49FromGitter<rayman22201> @kayabaNerve couldn't you use a nimble task/hook to init a git submodule for secp256k1 ?
00:50:55AraqI've seen one space indentation too.
00:51:02FromGitter<Quelklef> oh lord
00:51:02FromGitter<kayabaNerve> http://nickgravgaard.com/elastic-tabstops/
00:51:03FromGitter<kayabaNerve> This
00:51:12FromGitter<rayman22201> @Varriount Not quite fibonacci
00:51:18FromGitter<kayabaNerve> @Quelklef I wouldn't mind except it isn't even
00:51:20FromGitter<kayabaNerve> http://nickgravgaard.com/elastic-tabstops/
00:51:22Araqwas surprised how quickly it became a non-issue for reading
00:51:25FromGitter<kayabaNerve> Didn't mean to post again
00:51:31FromGitter<kayabaNerve> Sorry. Ctrl + V by accident
00:51:36*donlzx joined #nim
00:51:41*Araq shrugs
00:51:48FromGitter<Quelklef> Araq, the one-sized tabs?
00:51:49FromGitter<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:55FromGitter<kayabaNerve> I think he meant two
00:52:05Araqno, I meant 'one'
00:52:11FromGitter<kayabaNerve> @rayman22201 Maybe. Not my lib and I haven't investigated tbh
00:52:22FromGitter<Quelklef> Huh.
00:52:24Araqit was written by some mad genius
00:52:27FromGitter<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:34FromGitter<kayabaNerve> Oh. NVM. Sorry
00:52:43Araqbut the one space indentation stopped being weird after an hour.
00:52:56CodeVanceI'd like if tab size was considered a "preference" just like nim's casing
00:53:13FromGitter<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:38FromGitter<kayabaNerve> @Quelklef I think it's done internally
00:53:44FromGitter<Quelklef> Right, that's the issue
00:53:56FromGitter<Quelklef> It means everyone who wants the code to look nice has to use a compatible editor
00:53:59FromGitter<Quelklef> I really really like the idea, though
00:54:22*Lord_Nightmare quit (Ping timeout: 264 seconds)
00:54:26FromGitter<kayabaNerve> He lists a bunch of available plugins.
00:54:40FromGitter<kayabaNerve> I think it autodetects or stores it in the software; it doesn't edit the file
00:54:48FromGitter<kayabaNerve> That was my point
00:54:52FromGitter<kayabaNerve> Now I get you
00:54:53FromGitter<kayabaNerve> NVM
00:55:04FromGitter<kayabaNerve> He said that was an issue
00:55:06FromGitter<Quelklef> Lol
00:55:21FromGitter<kayabaNerve> Just tell them to either Ctrl F their local copy or get elastic tabs lol
00:55:43FromGitter<Quelklef> hmmmmm
00:56:35FromGitter<Quelklef> Wait, does it save the file with tabstops or spaces
00:56:40FromGitter<kayabaNerve> Right now it's just deal/with it/ctrl f
00:56:51FromGitter<kayabaNerve> Lol. No idea. Hopefully spaces for compatibility
00:57:03FromGitter<Quelklef> Yeah
00:57:06*Lord_Nightmare joined #nim
00:57:12FromGitter<Quelklef> If it was just an abstract layer on top of spaces that could be useful
00:57:19FromGitter<Quelklef> if it maps each tabstop to `\t` that's iffy
00:57:56*voice_ftp quit (Quit: Leaving)
00:58:30FromGitter<kayabaNerve> Well I have a thing that force replaces tabs to spaces when I open or save a doc
00:58:44FromGitter<kayabaNerve> So I'm guessing that would solve saving for me
00:58:46FromGitter<kayabaNerve> No idea on loading
00:58:53FromGitter<Quelklef> don't ever open a `.tsv`, then...
00:59:11FromGitter<kayabaNerve> Write your own impl
00:59:23FromGitter<kayabaNerve> ... i'm horrified
00:59:27FromGitter<kayabaNerve> Back to Nim?
00:59:44FromGitter<Quelklef> eh?
00:59:53FromGitter<kayabaNerve> We're offtopic again
00:59:59FromGitter<kayabaNerve> That was an issue last time
01:00:11FromGitter<Quelklef> Who else is active right now?
01:00:23FromGitter<kayabaNerve> No idea. Still. I don't like being disliked
01:01:47FromGitter<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:28FromGitter<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:00FromGitter<rayman22201> No, it's isAlphaAscii and isUpperAscii
01:05:25FromGitter<rayman22201> It should be either not a letter or if it is a letter, it better be uppercase
01:06:17FromGitter<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:24FromGitter<rayman22201> @kayabaNerve you are still liked. I was just trying to keep the channel from going bonkers. It's not personal!
01:07:54FromGitter<Varriount> @rayman22201 Couldn't that be simplified to just checking if it's a lowercase letter?
01:08:24FromGitter<Varriount> Or rather, checking that it's not a lowercase ascii letter
01:08:57FromGitter<rayman22201> yes. I think you are right. good catch
01:10:20FromGitter<rayman22201> state machines + late night coding = obtuse tortured logic statements :-P
01:12:07*endragor joined #nim
01:13:00FromGitter<Varriount> @rayman22201 Yeah, especially when that state machine concerns string matching.
01:13:15FromGitter<Varriount> @rayman22201 Why only ascii? Is unicode not a problem?
01:13:29FromGitter<Varriount> Or just too ambigiuous
01:14:00FromGitter<rayman22201> Just didn't want to put in the work for Unicode when Ascii seems to be fine atm.
01:14:47FromGitter<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:11FromGitter<Varriount> Plus, the Nim codebase is mostly ascii
01:17:30FromGitter<Varriount> Unless Araq starts using umlauts in his variables.
01:18:12FromGitter<rayman22201> He is German... lol
01:18:24Araqusing ü for u's derivative is common in German math.
01:18:36Araqnah, I'm kidding.
01:19:27FromGitter<rayman22201> X.X. lol You scared the crap out of me for a second there @Araq
01:20:43FromGitter<rayman22201> And I was always told Germans have no sense of humor :-P
01:23:33Araqlol, I'm only serious when talking about computer games
01:23:58FromGitter<rayman22201> lol!
01:26:17*donlzx quit (Quit: Leaving)
01:27:50FromGitter<rayman22201> @Varriount fix is pushed
01:28:26*NamPNQ joined #nim
01:28:50FromGitter<Varriount> @rayman22201 No worries, I'm actually going over your code and refactoring it somewhat.
01:28:59FromGitter<rayman22201> That's cool too
01:34:09*leorize quit (Remote host closed the connection)
01:34:28*leorize joined #nim
01:38:00FromGitter<Varriount> @rayman22201 Any particular reason for using a pure enum?
01:38:34FromGitter<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:09FromGitter<Varriount> You know, what I really want is elastic line spacing.
01:41:41FromGitter<Quelklef> oh my
01:46:25FromGitter<rayman22201> lmao. The troll level is set to max right now.
01:48:35FromGitter<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:02FromGitter<kayabaNerve> Troll level?
02:11:12FromGitter<kayabaNerve> @Varriount did you see the link I sent?
02:14:19FromGitter<Varriount> @kayabaNerve No, I didn't
02:16:21FromGitter<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:10FromDiscord<awr> does choosenim require a preexisting nim installation?
02:43:40*leorize joined #nim
02:53:08FromGitter<kaushalmodi> @rayman22201 isUpperAscii for a char X implies that X.isAlphaAscii is true.
02:53:47FromGitter<kayabaNerve> Oh. Got it. Never mind.
02:53:57FromGitter<kayabaNerve> awr: I don't believe so
02:54:05FromGitter<kaushalmodi> Also FYI isUpperAscii, isLowerAscii, isUpper, isLower for *strings* (not chars) is planned to be deprecated. @dom96 ?
02:54:38FromGitter<kayabaNerve> Why not convert the char to int and bounds check it?
02:57:37FromGitter<kaushalmodi> @kayabaNerve What's the bound check in reference to? I didn't follow.
02:58:11FromGitter<kayabaNerve> C chars are ints
02:58:37FromGitter<kayabaNerve> They can be casted in Nim and checked against an ASCII table
02:59:02FromGitter<kayabaNerve> 50 < mychar.int and mychar.int <60
02:59:03FromGitter<kaushalmodi> Ah OK. But we already have procs for upper/lower checking
02:59:10FromGitter<kayabaNerve> It's probably exactly what the procs do
02:59:16FromGitter<kayabaNerve> Yep
02:59:23FromGitter<kaushalmodi> Why would one need to remember the ASCII codes.
02:59:25FromGitter<kayabaNerve> Just throwing it out there in case it did help
02:59:32FromGitter<kayabaNerve> I just picked two random
02:59:52FromGitter<Quelklef> @kayabaNerve You can just do `ord(c)` instead of using hardcoded numbers
02:59:55FromGitter<kaushalmodi> Nim style would be `charVar in {'a' ..'z'}`
03:00:01FromGitter<kayabaNerve> 48-57 0,9
03:00:22FromGitter<kayabaNerve> 65-90 A-Z
03:00:33FromGitter<kayabaNerve> 97-122 a-z
03:00:42*mr_yogurt quit (Ping timeout: 256 seconds)
03:00:47FromGitter<kayabaNerve> @kaushalmodi seems slow and long as hell
03:00:59FromGitter<kaushalmodi> ?
03:01:04FromGitter<kayabaNerve> @Quelklef good thinking! I have to implement that.
03:01:35FromGitter<kayabaNerve> 2 < versus a for loop with 26 iterations that does an equality check each time
03:02:02FromGitter<kayabaNerve> And you have to make an object of every single char
03:02:45FromGitter<kaushalmodi> My background is mainly scripting. So I yet to build apps that that speed sensitive.
03:02:51FromGitter<kaushalmodi> But I get your point.
03:03:22FromGitter<kaushalmodi> My suggestion was using sets.. and I cannot comment on if that operation iterates 26 times or not..
03:03:38FromGitter<kaushalmodi> As I don't know the internal translation of Nim sets to C
03:04:10FromGitter<kaushalmodi> *yet have to
03:05:59FromGitter<Quelklef> @kaushalmodi Use @kaushalmodi's suggestion, not mine. Less arcane and closer to your intent.
03:06:21FromGitter<Varriount> What's the question about speed?
03:06:42FromGitter<Quelklef> oops i mean @kayabaNerve
03:06:59FromGitter<kaushalmodi> @Quelklef *k a TAB?
03:07:03FromGitter<Quelklef> I highly suspect the speed differences will be trivial
03:07:10FromGitter<Quelklef> @kaushalmodi yup, haha
03:07:20FromGitter<kayabaNerve> @Varriount how does a set perform
03:07:40FromGitter<kayabaNerve> If I test an object for being in a set, it iterates over each and tests equally
03:07:46FromGitter<kayabaNerve> *equality, right?
03:07:52FromGitter<Varriount> No. A set is not a sequence.
03:08:07FromGitter<kayabaNerve> So how would it behave
03:08:33FromGitter<Quelklef> Sets are really really fast
03:08:37FromGitter<Varriount> The item would be transformed into a set item and a boolean operation would be done.
03:08:47FromGitter<Varriount> If you want, you can look at the C code.
03:08:54FromGitter<Quelklef> wait `set` is not a hash set is it
03:09:47FromGitter<citycide> this seems like a pretty important bug, should it be tagged as one? https://github.com/nim-lang/Nim/issues/8066
03:09:48FromGitter<kayabaNerve> What's better. Set of A through Z and test if 'M' or '0' is in it OR
03:09:58FromGitter<citycide> kind of defeats the purpose of `{.pure.}`
03:10:36FromGitter<kayabaNerve> (ord('A') <= myChar) and (ord('Z') <= myChar)
03:10:48FromGitter<kayabaNerve> O have
03:10:55FromGitter<Quelklef> WHy not just do a benchmark?
03:11:04FromGitter<Varriount> Ok, say you are checking if a character `C` is in the set `{'a'..'z'}`.
03:11:07FromGitter<kayabaNerve> Fair enough. Give me ten minutes
03:11:12FromGitter<Quelklef> ill race you!
03:11:27FromGitter<kaushalmodi> Great, I'll wait for results :)
03:11:42FromGitter<kaushalmodi> Randomize the C
03:11:54FromGitter<kayabaNerve> Dude I'm eating dinner
03:11:59FromGitter<kaushalmodi> Lol
03:12:00FromGitter<Varriount> According to the generated C code, the compiler turns that into `if ord(C) >= ord('a') and ord(C) <= ord('b')`
03:12:13FromGitter<Quelklef> So they're the same
03:12:28FromGitter<kaushalmodi> Thanks, good to know
03:12:29FromGitter<Varriount> `if c in {'A'..'Z'}:` == `if (!(((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90))))`
03:12:54FromGitter<kayabaNerve> Interesting
03:12:57FromGitter<Quelklef> Good stuff!
03:13:10FromGitter<kayabaNerve> Do sets have to be linear? Yes, right?
03:13:17FromGitter<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:28FromGitter<Quelklef> @kayabaNerve come again?
03:13:30FromGitter<kayabaNerve> Because I test against a ton of values
03:14:02FromGitter<kaushalmodi> Sets don't have to be linear..
03:14:29FromGitter<Varriount> `if c in {'A', 'b'}:` == `if (!(((NU8)(c)) == ((NU8)(65)) || ((NU8)(c)) == ((NU8)(98))))`
03:14:34FromGitter<kayabaNerve> 1-9, A-Z without 2 characters, a-z without 1 character.
03:14:41FromGitter<kaushalmodi> If you meant to ask if sets can be something like `{1, 3, 100}`, then yes, they can be.
03:14:59FromGitter<kayabaNerve> Yeah so I'm either using multiple sets or using order(char)
03:15:03FromGitter<Varriount> You can't really do better than the above.
03:15:36FromGitter<kayabaNerve> I might use sets just for the notation...
03:15:47FromGitter<kayabaNerve> Thanks @Varriount
03:15:52FromGitter<Varriount> Readability usually trumps optimization.
03:15:57FromGitter<Quelklef> ^
03:16:19FromGitter<Quelklef> Using sets means your program is more closely matching your idea
03:16:26FromGitter<kaushalmodi> The speed concern you have with non-linear sets would apply to the `>`/`<` based checks too.
03:16:37FromGitter<Quelklef> Conceptually, you care about "is this in a-z" not "is the ascii representation of this ..."
03:16:57FromGitter<kaushalmodi> Sort of an aside, critbits is awesome
03:16:57FromGitter<Quelklef> And matching programs as closely as you can conceptually means the compiler can (theoretically) optimize it best
03:17:10FromGitter<kaushalmodi> It's a hybrid of tables and sets.
03:28:51*endragor joined #nim
03:48:43FromGitter<kayabaNerve> @Varriount One last set question if you're fine
03:49:20FromGitter<kayabaNerve> *able
03:49:30FromGitter<Quelklef> ask it to all
03:49:54FromGitter<kayabaNerve> How does {'A'..'Z', 'a'..'z'} compile into a check
03:50:11FromGitter<Quelklef> A check of `ord`?
03:51:18FromGitter<kayabaNerve> ('A' <= mychar && mychar <= 'Z') || ('a' <= mychar && mychar < = 'z') ⏎ ('A' == mychar) || ('B' == mychar) || ('C' == mychar) ...
03:51:22FromGitter<Quelklef> right
03:51:30FromGitter<kayabaNerve> The first or second lol
03:51:37FromGitter<kayabaNerve> We proved one range will be the first
03:51:39FromGitter<Quelklef> So, I didn't write the compiler, but I can guess with a pretty high confidence
03:51:47FromGitter<Quelklef> Wait, what?
03:52:02FromGitter<Quelklef> Oh you're saying with two ranges
03:52:06FromGitter<kayabaNerve> 'A'..'Z' is the first
03:52:14FromGitter<kayabaNerve> 'A', 'D' is the second
03:52:22FromGitter<Quelklef> right
03:52:55FromGitter<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:05FromGitter<Quelklef> 99% the former
03:53:10FromGitter<Quelklef> but I'll check for completeness
03:56:55FromGitter<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:59FromGitter<Quelklef> So, yeah, the former
03:57:22FromGitter<Quelklef> I imagine what's happening is that `set` just contains all the ranges and items you give it
03:57:38FromGitter<Quelklef> so `{'a'..'z'}` doesn't do any "transformations" on the range, it just stores it
03:58:05FromGitter<Quelklef> And then `in` goes through and checks `_ <= _ <= *` for ranges and `* == _` for single items
03:58:21FromGitter<Quelklef> Given that IIRC `set` may only contain ordinal types, I feel like this is about correct
03:59:53FromGitter<kayabaNerve> Great.
03:59:59FromGitter<kayabaNerve> Thank you!
04:00:05FromGitter<Quelklef> Yessir!
04:01:16FromGitter<kaushalmodi> Yes, sets can contain only ordinal types
04:02:42*dorelix quit (Remote host closed the connection)
04:12:16FromGitter<kayabaNerve> I think this will be my last Q for the night
04:12:21FromGitter<kayabaNerve> BESIDES USING ORD(char)
04:12:23FromGitter<kayabaNerve> https://gist.github.com/kayabaNerve/9ed042095cb41072dc4d6fa9504d5625
04:12:27FromGitter<kayabaNerve> How can I improve this?
04:13:56FromGitter<Quelklef> woah
04:14:06FromGitter<Quelklef> is `(int) x` a cast? I thought it was `castint (x)`?
04:14:13FromGitter<kayabaNerve> x.int
04:14:15FromGitter<kayabaNerve> int(x)
04:14:19FromGitter<kayabaNerve> castint (x)
04:14:28FromGitter<Quelklef> oh i see
04:14:34FromGitter<Quelklef> `(int)` is an expr evaluating to int
04:14:36FromGitter<Quelklef> then a command call
04:14:38FromGitter<Quelklef> ...strange
04:14:45FromGitter<kayabaNerve> `(int) x` works it's just buggy in larger expressions
04:14:47FromGitter<kayabaNerve> But I like it
04:15:00FromGitter<Quelklef> ehhhhh
04:15:02FromGitter<kayabaNerve> (I think I do ((int) x)
04:15:33FromGitter<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:35FromGitter<Quelklef> is there any pattern to these numbers
04:15:41FromGitter<Quelklef> or is it an arbitrary mapping
04:15:47FromGitter<Quelklef> Yeah but IMO it's arcane in nim
04:15:49FromGitter<kayabaNerve> But I think cast has extra powers unrelated at this level
04:15:53FromGitter<kayabaNerve> It's Base58
04:15:58FromGitter<Quelklef> Also it's technically not a cast
04:16:00FromGitter<kayabaNerve> So there's 9 through 9
04:16:09FromGitter<Quelklef> Wait
04:16:11FromGitter<kayabaNerve> There's 0 through 9 and A through F
04:16:14FromGitter<Quelklef> are you just, like, converting from b58?
04:16:43FromGitter<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:52FromGitter<kayabaNerve> Yes
04:16:54FromGitter<Quelklef> can you send me the file that has the context for this
04:17:00FromGitter<Quelklef> or is it in Ember
04:17:16FromGitter<kayabaNerve> https://github.com/kayabaNerve/Ember/blob/master/src/lib/Hex.nim
04:17:20FromGitter<kayabaNerve> https://github.com/kayabaNerve/Ember/blob/master/src/lib/Base58.nim
04:17:37FromGitter<Quelklef> I'll make a PR
04:17:49FromGitter<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:52FromGitter<kayabaNerve> Thanks lol
04:18:35FromGitter<Quelklef> is `Base16Characters` ever modified
04:18:56FromGitter<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:07FromGitter<Quelklef> to be able to iterate in order, probably?
04:19:07FromGitter<kayabaNerve> Nope. It's a const. I should prob switch it from var
04:19:14FromGitter<Quelklef> yeah
04:19:23FromGitter<Quelklef> to array or seq
04:19:37FromGitter<kayabaNerve> I have a set AND an array.
04:19:40FromGitter<Quelklef> Why?
04:19:46FromGitter<kayabaNerve> One is to test validity, one is to actually convert
04:19:54FromGitter<kayabaNerve> See my last commit
04:19:56FromGitter<Quelklef> sounds like unnecessary microoptimizations
04:20:10FromGitter<kayabaNerve> I was int casting and then checking it as you see there
04:21:09FromGitter<Quelklef> Don't use set, and don't use seq, and don't use array
04:21:12FromGitter<Quelklef> use `OrderedSet`
04:21:18FromGitter<kayabaNerve> I removed an 8 line if, and a separate line, for the letter values and cleaner code
04:21:34FromGitter<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:39FromGitter<kayabaNerve> K
04:21:44FromGitter<Quelklef> or I'll do it
04:21:56FromGitter<kayabaNerve> I'm here asking for suggestions lol. If you say to use OrderedSet, I'll look into it
04:22:01FromGitter<kayabaNerve> Up to you
04:22:06FromGitter<Quelklef> I'll just include it in a PR
04:22:21FromGitter<Quelklef> whenever I see other people's code I tend to have an urge to make intens emodifications lol
04:22:52FromGitter<kayabaNerve> LOL
04:22:56*lompik joined #nim
04:23:02FromGitter<Quelklef> /shrug
04:23:08FromGitter<kayabaNerve> I don't minf
04:24:42FromGitter<Quelklef> oh you would if I did everything
04:26:19FromGitter<Quelklef> ...what is DB/ ?
04:27:46FromGitter<data-man> @kayabaNerve and especially don't use bad advices :-D
04:29:15FromGitter<kayabaNerve> @Quelklef An empty folder
04:29:28FromGitter<Quelklef> but why
04:29:39FromGitter<kayabaNerve> I'm trying to remember why lol. I made it just two days ago...
04:29:40FromGitter<Quelklef> oh it's a BigNum, yeah?
04:29:48FromGitter<kayabaNerve> ... DB = Database
04:29:54FromGitter<kayabaNerve> You're talking about the folder, right?
04:30:02FromGitter<Quelklef> yeah sorry getting things mixed up
04:30:05FromGitter<Quelklef> BN is C BigNum?
04:30:31FromGitter<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:45FromGitter<kayabaNerve> I forget...
04:30:54FromGitter<Quelklef> 💭
04:31:01FromGitter<kayabaNerve> lib/BN.nim is the BN wrapper. lib/BN/ is the C lib.
04:31:12FromGitter<Quelklef> yeah, and the C BN lib is?
04:31:13FromGitter<Quelklef> I don't know C
04:31:16FromGitter<kayabaNerve> imath
04:31:56FromGitter<Quelklef> ?
04:31:58FromGitter<kayabaNerve> https://github.com/kayabaNerve/Ember/blob/master/src/lib/BN.nim <- This is all that should matter.
04:32:03FromGitter<kayabaNerve> The name of the C library is imath.
04:32:23FromGitter<Quelklef> right but what is a BN conceptually
04:32:31FromGitter<kayabaNerve> BigNumber
04:32:35FromGitter<kayabaNerve> 0 to infinity
04:32:43FromGitter<Quelklef> that's what I was saying...
04:32:51FromGitter<kayabaNerve> Java BigNumber? GNU GMP?
04:32:56FromGitter<kayabaNerve> Multiple precision integer
04:33:03FromGitter<Quelklef> right
04:33:14FromGitter<kayabaNerve> Yeah
04:33:15FromGitter<kayabaNerve> That
04:33:47FromGitter<kayabaNerve> I use BN mainly to handle numbers in the order of 16^128
04:33:56FromGitter<Quelklef> Hmmm... How expensive is BN creation
04:34:10FromGitter<kayabaNerve> Eh. And 20,000,000^10.
04:34:21FromGitter<Quelklef> I'm weighting the `num0 = newBN("0")` etc vars vs. having some terse `int -> BN` unary op
04:34:30FromGitter<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:43FromGitter<Quelklef> By the way, don't do `return` with strings. That returns `nil`.
04:34:45FromGitter<kayabaNerve> I think I only make BNs through Strings right now. Been meaning to add a new constructor for that
04:34:52FromGitter<Quelklef> Yeah
04:34:52FromGitter<kayabaNerve> I always use result IIRC
04:35:07FromGitter<kayabaNerve> Except in your new exponentiation generic
04:35:14FromGitter<Quelklef> thats... od
04:35:30FromGitter<kayabaNerve> That said, if someone edits my code to be SHA512^0 they're an idiot who deserves it...
04:35:36FromGitter<kayabaNerve> And it does default to the result
04:35:36FromGitter<Quelklef> but on Hex.nim line 25 you use return
04:35:39FromGitter<kayabaNerve> So that's not an issue
04:35:51FromGitter<Quelklef> I mean `f^0 == identity`
04:36:07FromGitter<kayabaNerve> Yeah. No. Forgot about that. Your generic is safe
04:36:12FromGitter<Quelklef> yup
04:36:40FromGitter<kayabaNerve> Hex:25 is the validity function
04:36:45FromGitter<kayabaNerve> No strings enbolbed
04:36:51FromGitter<Quelklef> `convert`?
04:37:18*donlzx joined #nim
04:37:18FromGitter<Quelklef> ah my edits may have shifted it, my bad
04:37:25FromGitter<kayabaNerve> Line 25 of src/lib/Hex.nim on master is if value[i] notin Base16Set:
04:37:39FromGitter<kayabaNerve> 1) Found it. Returns nil.
04:37:41FromGitter<Quelklef> `proc convert` contains `if valueArg < num0: return` and `convert` returns `string`
04:37:42FromGitter<Quelklef> yeah
04:37:48FromGitter<Quelklef> Is that intentional?
04:38:19FromGitter<kayabaNerve> That should be a valueError
04:38:28FromGitter<Quelklef> hmmmm
04:38:30*Lord_Nightmare joined #nim
04:38:56FromGitter<Quelklef> Okay, so the `Hex.nim` file does 3 things:
04:39:04FromGitter<Quelklef> 1) Ensure that a string dutifully represents some number
04:39:12FromGitter<Quelklef> 1) Convert BN -> string
04:39:16FromGitter<Quelklef> 1) Convert string -> BN
04:39:33FromGitter<Quelklef> 1) Formatted lists on gitter don't like being placed over multiple messages
04:40:45FromGitter<kayabaNerve> Validates a number. ⏎ Converts to a Hex string. ⏎ Reverts from a Hex string.
04:41:00FromGitter<Quelklef> Are you likely to ever need to dealt with non-base10 non-base16 numbers?
04:41:20FromGitter<kayabaNerve> Base10, Base16, Base58
04:41:28FromGitter<Quelklef> Ok
04:41:35FromGitter<kayabaNerve> I wouldn't mind a generic Base[T] though
04:41:39FromGitter<Quelklef> Yeah I was gonna do that
04:41:44FromGitter<kayabaNerve> Main issue is the sets aren't explicit
04:41:54FromGitter<kayabaNerve> Base 58 could be Base62 but they removed 4 characters for ease
04:42:07FromGitter<Quelklef> come again?
04:42:09FromGitter<kayabaNerve> Sets != nim set. Just character grouping.
04:42:17FromGitter<kayabaNerve> So you still have to supply the specific characters involved.
04:42:38FromGitter<Quelklef> 0-9 a-z A-Z is 62
04:42:40FromGitter<kayabaNerve> And this is performance critical. A for loop alone isn't good enough.
04:42:41FromGitter<Quelklef> yeah i see what you mean
04:42:50FromGitter<Quelklef> im a little lost im just gonna write Base[T]
04:43:07FromGitter<kayabaNerve> They remove number O, capital letter O, capital letter I, lower case letter l
04:43:13FromGitter<kayabaNerve> Zero, oh, eye, el
04:43:18FromGitter<Quelklef> Ah, for readibility
04:43:22FromGitter<Quelklef> seems reasonable
04:43:25FromGitter<kayabaNerve> Something something they look the fricking same, something something money can't not be reversed
04:43:55FromGitter<Quelklef> I mean...... Sounds like a good decision
04:44:04FromGitter<kayabaNerve> That's why I use iy
04:44:27FromGitter<kayabaNerve> I don't care about standards all too much
04:44:28FromGitter<Quelklef> Anyway, it seems that you don't call `convert` or `revert` anywhere
04:44:34FromGitter<kayabaNerve> They're public functions
04:44:37FromGitter<Quelklef> I know
04:44:40FromGitter<kayabaNerve> Check the miner and Merit functions
04:44:41FromGitter<Quelklef> I searched the project
04:44:45FromGitter<Quelklef> oh no i didnt
04:44:50FromGitter<Quelklef> i searched src/lib
04:45:05FromGitter<kayabaNerve> SHA512( ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b482e51641ecc065f9e38f9]
04:45:14FromGitter<kayabaNerve> Merit/Block.nim
04:45:35FromGitter<kayabaNerve> SHA512 takes in hex data; I have a Base58 address. I revert Base58 and convert to Hex.
04:46:13FromGitter<Quelklef> hmm
04:47:24FromGitter<Quelklef> can you write some tests so i dont fuck it all up
04:47:32FromGitter<Quelklef> for stuff besides Hex and Base58
04:47:46FromGitter<kayabaNerve> Address.nim has the others
04:47:49FromGitter<kayabaNerve> Yeah it's in the TODO
04:47:54FromGitter<Quelklef> but like
04:47:55FromGitter<kayabaNerve> There's a lot in the TODO
04:47:57FromGitter<Quelklef> make it not in the todo
04:48:02FromGitter<kayabaNerve> I should write a TODO for the TODO
04:48:05FromGitter<kayabaNerve> Maybe do some stuff
04:48:07FromGitter<Quelklef> noooo
04:48:44FromGitter<kayabaNerve> I'll write those two tests right now for you
04:48:53FromGitter<Quelklef> What
04:48:55FromGitter<Quelklef> which ones
04:49:36FromGitter<Quelklef> @kayabaNerve
04:51:54FromGitter<kayabaNerve> The TODO now has an item to make a new TODO list that says to write the Hex and Base58 tests
04:52:13FromGitter<Quelklef> no don't write those tests
04:52:18FromGitter<Quelklef> write tests for things that use them
04:52:28FromGitter<Quelklef> because I'm about to overhaul the Hex/Base58 API
04:53:01FromGitter<kayabaNerve> @kayabaNerve ⏎ I don't mind ⏎ @Quelklef ⏎ oh you would if I did everything [https://gitter.im/nim-lang/Nim?at=5b48302c26aa91065e8f40ad]
04:53:10FromGitter<Quelklef> what
04:53:15FromGitter<kayabaNerve> Remember that? :P
04:53:27FromGitter<Quelklef> yeah?
04:53:31FromGitter<Quelklef> hey now
04:53:34FromGitter<Quelklef> I'm combining them
04:53:38FromGitter<kayabaNerve> I need tests for Hex/base58 anyways. I can't test the higher parts properly if those are malfunctioning.
04:53:52FromGitter<Quelklef> Sure, but the type is gonna be joined
04:53:57FromGitter<kayabaNerve> I can't tell you if yours work without an unit test for them.
04:53:57FromGitter<Quelklef> whatever, I can port the tests
04:54:04FromGitter<kayabaNerve> Submit your PR and I'll write a test lol
04:57:07shashlickhttps://github.com/genotrance/nimclipboard
04:58:47FromGitter<Quelklef> @kayabaNerve don't do `x == false`, do `not x`
04:59:24FromGitter<Quelklef> Unless `==` is overridden with some special logic
04:59:34FromGitter<Quelklef> but that case was `bool == bool`
05:07:30FromGitter<kayabaNerve> shashlick: Cool library
05:10:53*rockcavera quit (Remote host closed the connection)
05:15:46FromGitter<rayman22201> @Varriount I'm back at my computer for a bit if you are still around.
05:16:10FromGitter<rayman22201> and hello to everybody else as well :-)
05:21:57FromGitter<Quelklef> howdy
05:22:47*nsf joined #nim
05:36:57FromDiscord<awr> how do you get the length of an enum?
05:40:47*miran joined #nim
05:47:45FromGitter<Varriount> @rayman22201 Here's my current revision: https://gist.github.com/Varriount/ba8d95461e23762d2683426b83cc90b6
05:48:07FromGitter<rayman22201> @Varriount taking a look
05:57:33FromGitter<rayman22201> Wow, so TIL: high() is cool, Nim has cool set comparision operators, and you can combine case statements with commas...
05:59:00FromGitter<rayman22201> @Varriount line 107 - 109, is prevStrChar and prevPatternChar used?
05:59:54FromGitter<Varriount> Oh yeah, I decided not to use those, as they could be confused with the strChar and patternChar variables.
06:00:17FromGitter<Varriount> The unused ones haven't been lowered, while `strChar` and `patternChar` have.
06:00:58FromGitter<rayman22201> I saw that, cool
06:01:24FromGitter<rayman22201> That's why I was confused. :-P
06:03:10FromGitter<Varriount> @rayman22201 I'm still trying to think of a way to better present lines 122-126
06:03:28FromGitter<rayman22201> That echoAssert template was just me being silly. That can go away
06:03:52FromGitter<rayman22201> hrmmm. Yeah. Let me think
06:05:24FromGitter<Varriount> @rayman22201 What's the difference between the ScoreCard.UnmatchedChar and ScoreCard.UnmatchedLeadingChar cases?
06:06:28FromGitter<rayman22201> line 145 is the difference
06:06:32FromGitter<rayman22201> There is a bigger penalty
06:07:16FromGitter<rayman22201> on a match they are the same. on a "not match" they different
06:08:15FromGitter<rayman22201> i.e. I think you can combine those case statements
06:10:03FromGitter<rayman22201> It's a good example of flavor. What is more idiomatic "Nim", lines 111 - 115, or lines 126 - 128?
06:12:28FromDiscord<awr> i prefer 111-115
06:12:30FromGitter<Varriount> Hm. I can't say that one is more idiomatic than the other, however I find the former more readable.
06:13:10FromGitter<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:13FromGitter<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:15FromGitter<rayman22201> In that template you mean?
06:15:45FromGitter<rayman22201> Yeah, that whole thing was silly
06:15:53FromGitter<rayman22201> good point though
06:16:54FromGitter<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:56FromDiscord<awr> `str[strIndex - 1] notin Letters`
06:16:59FromDiscord<awr> is this necessary?
06:17:33FromDiscord<awr> you're already checking to see if `str[strIndex - 1]` is lowercase
06:18:04FromGitter<rayman22201> It's an `or` condition
06:18:28FromGitter<rayman22201> either not a letter or a lowercase letter
06:18:35FromDiscord<awr> also you don't want `{'A', 'Z'}`, you want `{'A' .. 'Z'}`
06:19:09FromDiscord<awr> if lines 111-115 and 126-128 are meant to be functionally equivalent
06:19:24FromGitter<rayman22201> they are. That is correct
06:19:27*miran quit (Ping timeout: 240 seconds)
06:19:41FromDiscord<awr> ah ok i'm being dumb nvm
06:19:58FromGitter<rayman22201> np
06:21:05FromGitter<Varriount> awr: I ran that boolean expression through Wolfram Alpha in the hopes that it could be simplified. No such luck.
06:21:44FromGitter<rayman22201> disjoint sets :-/
06:22:08FromGitter<Varriount> @rayman22201 I've updated the gist with some small changes.
06:22:38FromGitter<Varriount> This has actually been quiet fun. I like refactoring/styling small pieces of code like this.
06:22:42FromGitter<Varriount> *quite
06:23:19FromGitter<rayman22201> @Varriount looks great! Thanks. I appreciate the help. It's a good learning experience.
06:24:19FromGitter<rayman22201> So now.... the real question is, what should I do get your changes into the PR to give you proper credit?
06:24:47FromGitter<rayman22201> Are you ok with me just replacing the file, and mentioning you in the git commit msg?
06:25:14FromGitter<Varriount> I believe I can edit the PR
06:25:23FromGitter<rayman22201> that's better
06:25:47FromGitter<Varriount> Could you tell me how the comments in the last part of the scorecard enum should be split up?
06:25:58FromGitter<Varriount> It seems like part of that comment should go to the last element there.
06:27:09FromGitter<rayman22201> lines 31 - 33 can probably be removed.
06:27:44FromGitter<rayman22201> That information is described in later comments, and just confuses things I think.
06:28:15FromGitter<Varriount> A WordBoundryMatch is an uppercase letter preceded by a lowercase letter?
06:28:53FromGitter<rayman22201> No. I don't think I wrote a comment for WordBoundryMatch
06:29:40FromGitter<rayman22201> You aligned the comments correctly, I just think I was trying to over-describe a LeadingCharMatch
06:30:23FromGitter<data-man> @Varriount @rayman22201 maybe move this very useful proc to strutils? Or to matchers.nim (and remove deprecated from this module)
06:30:37FromGitter<Varriount> @data-man It's not unicode-aware.
06:31:22FromGitter<Varriount> Also, I'm unsure about how the parameter ordering should be for a public function.
06:31:24FromGitter<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:57FromGitter<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:00FromGitter<Varriount> @rayman22201 https://github.com/rayman22201/Nim/tree/better-doc-search
06:34:20FromDiscord<awr> you use `inc(score, ord(scoreState))` and also `strIndex += 1`
06:34:23FromGitter<Varriount> I'm not sure how I feel about the fact that I can affect branches that are part of pull requests
06:34:32FromGitter<Varriount> awr: Nice catch
06:34:37FromDiscord<awr> i feel like you should stick to either `+=` or `inc()` and not mix the two
06:35:17FromGitter<Varriount> Yeah.
06:35:42FromGitter<Varriount> I prefer `inc`, but that's merely a stylistic preference. I'll stick with `+=`
06:35:48FromGitter<rayman22201> lol. @Varriount are you an admin on the Nim repo?
06:36:02FromGitter<Varriount> Yes.
06:36:18FromGitter<rayman22201> With great power comes great responsibility :-P
06:36:38FromGitter<Varriount> I didn't realize that Admins could do that. :/
06:36:52FromGitter<rayman22201> I don't have a preference on `inc` vs `+=`but I agree that it should be consistent. good call
06:37:21FromGitter<Varriount> The code is still quite complicated... but I don't really think it can be made any simpler.
06:37:58FromGitter<rayman22201> I agree. Fuzzy match has an inherent complexity. I think it will provide great value to end users though
06:39:42FromGitter<Varriount> @rayman22201 I also changed the return type to a tuple - that way it can be unpacked on assignment.
06:40:27FromGitter<rayman22201> good idea. I was going to do that originally. I don't remember what compelled me change my mind...
06:41:04FromDiscord<awr> you could also probably shove the enum inside the proc and get rid of the pure pragma
06:41:34FromGitter<Varriount> Can you even define a type inside a proc?
06:41:37FromDiscord<awr> yes
06:41:42FromGitter<Varriount> O_o
06:41:53FromGitter<rayman22201> I didn't realize you could put templates inside a proc, so this is all blowing my mind!
06:42:05FromDiscord<awr> the only thing of note i've noticed you can't do inside a proc is imports
06:42:51FromGitter<rayman22201> https://media.giphy.com/media/26ufdipQqU2lhNA4g/giphy.gif
06:43:19FromGitter<rayman22201> It made the gif so large! sorry!
06:44:26FromDiscord<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:58FromGitter<Varriount> awr: My question would be what backend code that generates.
06:47:05FromGitter<Varriount> @rayman22201 https://gist.github.com/Varriount/ba8d95461e23762d2683426b83cc90b6
06:47:11FromDiscord<awr> yeah it would be bad lol
06:47:17FromDiscord<awr> it would define multiple structs
06:47:24FromDiscord<awr> most likely
06:47:28FromGitter<Varriount> I changed the name of the states
06:47:41FromGitter<Varriount> awr: Lets take a look
06:48:42FromDiscord<awr> maybe gcc's/clang's optimizer will not make it so bad in machine code, idk
06:48:43FromGitter<rayman22201> @Varriount 👍
06:49:30FromGitter<Varriount> awr: Well, the generated code does what you said. Creates 2 C structs and puts values in them.
06:53:31FromGitter<Varriount> @rayman22201 By the way, great job on the PR. Not many people dare touch the documentation tooling.
06:54:37FromGitter<rayman22201> Thanks :-) It's not that bad. IDK why not
06:54:48FromGitter<Varriount> May I use it in my toy command shell?
06:54:54FromGitter<rayman22201> of course
06:55:06FromGitter<rayman22201> Open Source baby!
06:55:15FromGitter<Varriount> I might try implementing some sort of helpful misspelled-command functionality.
06:56:25FromGitter<rayman22201> The Nim compiler source code is very accessible actually! It's quite nice
06:57:29FromDiscord<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:00FromDiscord<awr> alternatively
06:58:02FromDiscord<awr> proc `+=`(a: var ScoreCard; b: ScoreCard) = a += ord(b)
06:58:18FromGitter<Varriount> awr: I thought about that, but dismissed it as possibly causing problems.
06:59:31FromGitter<Varriount> @rayman22201 Should `fuzzyMatch("abc", "ABetterCrystal")` match?
07:00:27FromGitter<Varriount> Neither that nor `fuzzyMatch("ABC", "ABetterCrystal")` match.
07:00:42FromGitter<rayman22201> the case shouldn't matter on the pattern
07:01:04FromGitter<rayman22201> and I believe that is correct because I bias against single char matches
07:01:24FromGitter<rayman22201> AB is made up of two LeadingChars
07:01:44FromGitter<rayman22201> i.e. gets treated as two words of length 1
07:02:37FromGitter<rayman22201> I did this based on testing against the Nim Docs and getting a lot of false positives from single character matches
07:02:41FromGitter<Varriount> Nope. Changing 'A' to "All" still doesn't match.
07:02:55FromGitter<Varriount> I think I broke it. :O
07:02:59FromGitter<rayman22201> lol
07:03:01FromGitter<rayman22201> possibly
07:04:00FromGitter<rayman22201> abcal would match... I think
07:04:09FromGitter<rayman22201> Allbc would not
07:05:09FromGitter<Varriount> Hm, the old code doesn't match either.
07:05:25FromGitter<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:57FromGitter<rayman22201> then by the end of the string, it is comparing "C" to "l", it never compares "l" to "l"
07:06:01FromGitter<rayman22201> does that make sense?
07:06:55FromGitter<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:26FromGitter<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:08FromGitter<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:05FromGitter<rayman22201> Yeah. I deviated from his algorithm
07:12:40FromGitter<rayman22201> It was giving a lot of false positives (in my subjective opinion) on the Nim Doc data-set.
07:14:02FromGitter<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:37FromGitter<Varriount> Ah, ok.
07:15:08FromGitter<Varriount> @rayman22201 What instructions did you follow to build the documentation?
07:15:18FromGitter<Varriount> I have to admit, I've never tinkered around with it.
07:16:02FromGitter<rayman22201> I used ./koch web
07:16:08FromGitter<Varriount> Thanks.
07:17:22FromGitter<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:41FromGitter<Varriount> Ah, thanks.
07:28:37FromGitter<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:39zacharycarterNow I'm playing with components and karax and they're just not rendering at all lmao
07:29:08FromGitter<rayman22201> if it doesn't render it can't have bugs :-P
07:29:36zacharycarterhttps://gist.github.com/zacharycarter/20c1c9bab1238334d9b1f7a0ddca3105
07:29:39zacharycarterright?
07:29:44FromGitter<Varriount> @rayman22201 Is there some sort of web server you have to activate?
07:30:14FromGitter<rayman22201> @Varriount you have to use your own. It just spits out html
07:30:23FromGitter<Varriount> :(
07:30:25zacharycarterhttps://github.com/pragmagic/karax/blob/master/examples/carousel/carousel.nim
07:30:34zacharycarternot sure what I'm doing different from this examle
07:30:46FromGitter<rayman22201> @Varriount I agree. very sad panda
07:31:24FromGitter<rayman22201> I just use the built in python simple web server `python -m SimpleHTTPServer 8000`
07:31:34FromGitter<rayman22201> it just serves a directory on a port
07:31:38FromGitter<rayman22201> good enough for testing
07:31:41zacharycarter+1 to that
07:35:15*yglukhov[i] joined #nim
07:35:16FromGitter<Varriount> Yep, I used that.
07:35:29FromGitter<Varriount> I broke the match. `high` doesn't match anything is system.nim
07:39:04FromGitter<rayman22201> hrmmmm
07:39:18FromGitter<alehander42> @zacharycarter i've used monaco with components
07:39:21FromGitter<alehander42> so it should be possible
07:39:31*yglukhov[i] quit (Remote host closed the connection)
07:40:00FromGitter<rayman22201> @Varriount it matches system.nim for me?
07:40:41FromGitter<rayman22201> https://screenshots.firefox.com/6C6mhaVDLGMQnBEX/192.168.11.14
07:40:53FromGitter<rayman22201> Not as high on the list as I would like but it does match
07:41:35FromGitter<Varriount> Is the current page not searched?
07:41:49FromGitter<alehander42> but I didn't know about component initialize :D
07:42:02FromGitter<alehander42> I think you're missing markDirty() maybe
07:42:12FromGitter<rayman22201> @Varriount It actually searches `theindex.html` no matter what page you are on
07:42:31FromGitter<rayman22201> it uses `theindex.html` as a database
07:42:42FromGitter<alehander42> I markDirty a component if I need to redraw it
07:45:57FromGitter<rayman22201> @Varriount maybe you are somehow still using the old version of `dochack.nim`?
07:51:35FromGitter<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:59FromGitter<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:04dom96Lots of discussion last night :)
10:03:17PMunchI really want to make a parser for the Nim IRC logs. Spit out some nice graphs of activity and count new users
10:03:34PMunchWould be nice to see after things like FOSDEM if we had more actual engagement
10:06:00dom96totally
10:06:02dom96Please do it
10:06:26dom96I'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:38dom96All the joins, parts and quits are in there so it should be possible.
10:06:56dom96It might not be 100% accurate all the time though as NimBot has reconnected sometimes.
10:07:28dom96It's all available in JSON so it should be a nice project
10:07:48*TheLemonMan joined #nim
10:08:52TheLemonManit seems nimble has some problems when you build a library that has arraymancer as dependency
10:09:37TheLemonMannimble init, add 'requires arraymancer', nimble test -> silent compiler error
10:12:26dom96Does `nimble build` work?
10:13:00TheLemonManyep, even though it does nothing for a lib
10:13:24TheLemonMan"Info ???(???, 0) Error: internal error: n is not nil"
10:13:32PMunchdom96, wait, is the IRC logs available as JSON as well?
10:15:28dom96PMunch: yep. Except that for some silly reason I decided to use the .logs extension and not the .json one
10:15:29dom96https://irclogs.nim-lang.org/13-07-2018.logs
10:15:51dom96oh, because its prefixed by a timestamp
10:15:54dom96so it's not really json
10:16:22dom96It's marshal it seems
10:16:25dom96That sucks a bit
10:17:13dom96I might have to change that
10:18:14dom96Such a waste of space with all these damn nulls
10:20:15krux02{"Field0": null, "Field1": null}
10:21:02PMunchOh wow, that is a messy format :P
10:21:28PMunchAlmost think it would be easier to parse the HTML
10:22:28FromGitter<tim-st> what was nims equivalent to pythons enumerate?
10:22:30*NamPNQ joined #nim
10:22:51FromGitter<tim-st> for idx, elem in enumerate(data)...
10:23:45PMunchfor key, value in myTable:
10:23:49PMunchOh wait
10:23:57PMunchFor tables you actually have to use pair
10:24:28PMunchBut for seqs this should work: for idx, val in @[4, 5 ,6]
10:24:50FromGitter<tim-st> oh, I see it works out of the box^^, thanks
10:24:56krux02dom96: 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:11PMunch!eval for idx, val in @[4, 5, 6]: echo "idx: ", idx, ", value: ", val
10:25:13NimBotidx: 0, value: 4↵idx: 1, value: 5↵idx: 2, value: 6
10:25:19FromGitter<tim-st> yes, thanks
10:25:45krux02it breaks a bit the json though
10:26:31krux02there is a better json sed tool though
10:26:39dom96PMunch: What might be easier is to hack NimBot to output proper JSON when .json is requested :)
10:27:05PMunchWould that work retroactively though?
10:27:28PMunchI mean if NimBot is able to read that so could my program
10:27:42dom96true, you could also steal NimBot's parsing code
10:27:59dom96I'll probably convert all of these logs to json eventually
10:29:36krux02I mean there is no point in serializing null fields.
10:29:42PMunchlog = log.multiReplace({"\n": "↵", "\r": "↵", "\l": "↵",
10:29:42PMunch "\1": "💩"})
10:29:48PMunchWhat's the poop doing there? :P
10:30:05krux02a field with value null is almost equivalent to no field with that name at all
10:32:00PMunchalmost
10:33:08PMunchdom96, 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:01dom96It's so that you can't trick Nimble to output a /me ACTION CTCP using !eval ;)
10:38:09dom96or any other CTCP for that matter
10:38:27dom96You could get NimBot to request every client's version if it wasn't for the poop
10:41:39PMunchAaah, makes sense
10:43:03dom96And I love to troll people, so poop it was
10:43:16Yardanico:D
10:50:52dom96yay https://github.com/nim-lang/nimforum/pull/179
10:51:00dom96Perfect way to contribute to NimForum ^^
10:51:09*jamesroseman joined #nim
10:52:20TheLemonManit 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:13YardanicoAs 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:30Yardanicooh, I think I can, but not if there's some argument after "Iter"
11:13:03TheLemonMansweet korean jesus, I think I've finally managed to pinpoint this madness
11:13:39krux02what is Iterable[A]
11:14:16Yardanicokrux02, it's a concept Iterable[T] = concept x \n for elem in x: \n elem is T
11:14:38krux02I really recommend to not use concepts yet.
11:14:56krux02They are about to be broken in the future, because they are poorly designed.
11:19:06krux02Yardanico, you can always to ``proc foo[T](iter: T)`` it is as powerful as if you would use the concept
11:19:45krux02it is just the error messages when you call foo with incompatible types that are affected.
11:21:35dom96TheLemonMan: What's the problem?
11:21:54TheLemonMandom96, you forgot to call cleanup() in some places in nimscriptsupport.nim
11:22:23TheLemonManeg. when you do an early return in execTask/execHook
11:22:34Araq:-)
11:22:42dom96I wasn't the only one that touched this code :P
11:22:47Araqdestructors would have solved this :P
11:22:59TheLemonMan...or a `defer: cleanup()`
11:23:02Araqit's the one feature C++ got right.
11:23:18Araq'defer: cleanup()' stinks :P
11:23:45Araqbut they are now getting exceptions right too... we need to steal it
11:24:28TheLemonManstealing is the ultimate form of appreciation, isn't it? :)
11:24:35Araqindeed.
11:25:11TheLemonMandom96, `git blame` is never wrong!
11:26:04TheLemonManI wonder why nobody stumbled across this bug before
11:26:09*NamPNQ quit (Remote host closed the connection)
11:26:22dom96TheLemonMan: link to blame? :)
11:28:12TheLemonMandom96, https://github.com/nim-lang/nimble/blame/master/src/nimblepkg/nimscriptsupport.nim#L597 :P
11:30:10dom96Oh well, my bad :)
11:34:29*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
11:35:26krux02Araq: what is c++ changing in exceptions?
11:36:14krux02All 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:23Araqkrux02: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r1.pdf
12:23:27FromGitter<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:33krux02Bennyelg: Well first of all, I don't recommend to overload the `<` operator for that
12:24:38FromGitter<Bennyelg> Oh I missed something in the definition of the Job object
12:24:42FromGitter<Bennyelg> why not?
12:24:51FromGitter<Bennyelg> and how you suggest to do ?
12:25:05krux02you should only use operator overloading where the meaning of the operator is clear.
12:25:27krux02Meaning `<` is the comparison operator when something is lass than something else.
12:25:56FromGitter<Bennyelg> but this is what I mean here
12:26:08FromGitter<Bennyelg> if my job at Time is < then other
12:26:19krux02exactly
12:26:25krux02**at Time**
12:26:29krux02very imortant information
12:26:33krux02don't discard that
12:27:17krux02if you discard that you actually compare by time, your code really becomes unreadable.
12:27:40FromGitter<Bennyelg> I dont understand you :| what do you mean by discard it ? Im not ignoring it
12:28:01FromGitter<survivorm> the point why c++ overloading operators often becomes a mess
12:28:02FromGitter<Bennyelg> it will be used later on like if Jobx < Joby : do this
12:28:07FromGitter<tim-st> what is the default cap of string?
12:28:10krux02well the `<` operator doesn't say the reader of the code that it compares by `atTime`
12:28:21FromGitter<Bennyelg> I see
12:28:27FromGitter<Bennyelg> so what do you suggesting ?
12:28:34FromGitter<survivorm> even if the reader later is you
12:28:43krux02I 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:58FromGitter<Bennyelg> ok, I agree
12:29:02FromGitter<Bennyelg> thanks, will change this.
12:29:10Araqkrux02: I agree to fwiw.
12:29:24Araqthere is no inherent ordering in "Jobs"
12:29:37FromGitter<Bennyelg> fwiw = ?
12:29:50krux02yea I also have to look it up
12:29:55Yardanicofwiw = for what it's worth
12:30:08FromGitter<Bennyelg> oh
12:30:10FromGitter<Bennyelg> its worth
12:30:14FromGitter<tim-st> anyone knows string default capacity?
12:30:20FromGitter<kaushalmodi> for what it's worth used as "my opinion, take it or leave it"
12:30:21FromGitter<Bennyelg> I need to change my beaver of programming
12:30:22FromGitter<tim-st> 8 byte?
12:30:24*MyMind joined #nim
12:30:32krux02no default is no capacity at all
12:30:45FromGitter<tim-st> oh, ok, thanks
12:31:15FromGitter<tim-st> and the growthfactor?
12:31:41FromGitter<tim-st> or if I add one byte how much is then created?
12:31:48zacharycarterAnyone 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:46krux02tim-st: normally a string grows by a factor of two, but that wouldn't help with zero does it?
12:32:46FromGitter<Bennyelg> so what do you say about? ⏎ ⏎ ```t1.hasPriorityOver(t2)``` [https://gitter.im/nim-lang/Nim?at=5b489beeba5f154b3b9b5cb4]
12:33:07FromGitter<tim-st> yes, because of this I wanted to know how start work
12:33:14FromGitter<tim-st> is it 0,1,2,4,...?
12:33:31FromGitter<tim-st> and if so isnt that bad?
12:33:34FromGitter<Bennyelg> or it is still hiding the idea
12:33:46krux02tim-st: I just looked it up
12:34:04krux02an empty string literal has a capacity of 7
12:34:32krux02so 8 if you include the 0 byte that you can't use for data.
12:34:36FromGitter<tim-st> ok, thanks, and if I create newStringOfCap(<7) does it work?
12:34:50krux02I think so
12:34:57FromGitter<tim-st> ok, thanks
12:35:16krux02I tested it
12:35:29krux02it doesn't crash, but you will still get a string of cap 7
12:35:31FromGitter<tim-st> works?
12:35:36FromGitter<tim-st> ok, hm
12:35:55FromGitter<tim-st> if I know I need only 4 byte thats not good
12:36:24krux02well if you really want to store a lot of tiny strings, use something else as data structure than string
12:36:58FromGitter<tim-st> yes, but often when it's about dynamic size only string and seq is possible
12:37:07FromGitter<tim-st> obviously seq would have the same problems
12:37:29FromGitter<tim-st> And I dont want to to plain c hacks or so
12:38:15krux02you 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:44FromGitter<tim-st> no, I know that ptr has sizeof(int)
12:38:56krux02well then divide everything by 2
12:39:33krux02let s = newStringOfCap(4)
12:39:33krux02echo cast[ptr tuple[a,b:int]](s)[]
12:39:41krux02try that
12:40:12FromGitter<tim-st> cannot see it you have to write `...`
12:40:13krux02still the 4 unused bytes will really be the smallest thing in the overhead costs
12:40:27krux02http://ix.io/1h1Z
12:40:29krux02better?
12:40:38FromGitter<tim-st> no, have 80/tcp blocked
12:40:46Yardanicolol
12:41:20krux02```let s = newStringOfCap(4); echo cast[ptr tuple[a,b:int]](s)[]```
12:41:26FromGitter<tim-st> thanks^^
12:42:17FromGitter<tim-st> that's interesting, thanks!
12:42:21FromGitter<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:20krux02tim-st: try this: ```let s = "Hi!"; echo cast[ptr tuple[len,cap:int; data:array[8,char]]](s)[]```
12:44:36krux02it should give you some insights of the internal representation of string
12:45:33FromGitter<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:53FromGitter<tim-st> krux02: thanks I already assumed it looks like this, if the memory is initialized
12:46:06FromGitter<tim-st> maybe unitalized would be better for string?
12:46:36FromGitter<tim-st> oh, maybe it is internally
12:47:16FromGitter<tim-st> *uninitialized
12:50:24krux02http://ix.io/1h25
12:50:33FromGitter<tim-st> tcp80
12:50:41krux02why is it blocked?
12:50:45krux02what is the point?
12:50:50krux02to make the internet use horrible?
12:50:57FromGitter<tim-st> because only shit pages use http nowadays
12:51:32FromGitter<tim-st> it's like a quality filter
12:51:46krux02ah, it is you who did that?
12:51:52FromGitter<tim-st> yes
12:52:00krux02then it is your fault
12:52:22FromGitter<kaushalmodi> krux02: I've read good things about https://transfer.sh/
12:52:52krux02ix.io isn't a shit pages, it's a minimal code hoster, and https for code snippents. what's the point?
12:54:06Yardanico@tim-st I don't think it's good to assume that "only shit pages use http"
12:54:26FromGitter<tim-st> it's not an assumption, it's what I've seen
12:54:41Yardanicobut ix.io is not a "shit page"
12:54:42krux02well it is a correlation
12:54:47FromGitter<kaushalmodi> I'm with @tim-st. Why wouldn't a non-negligent dev not upgrade to https?
12:54:48FromGitter<tim-st> yes
12:54:58Yardanicothere's a lot of "shit https pages" so should I block https ?
12:55:19zacharycarterwell
12:55:20FromGitter<tim-st> Yardanico: for this there is the next step qulity filter
12:55:30zacharycarterI did find it amusing when Jenkins launched JenkinsX and it was being served up over HTTP
12:55:35zacharycarterthe new site anyway
12:55:51zacharycarterlike - if you're launching a site these days, it's so easy to get it up on HTTPS
12:55:58zacharycarterwhy wouldn't you? and benefit from the protocol security?
12:56:08zacharycarterbut I think blocking port 80 is a bit extreme
12:56:28krux02I don't see the point of https for pure non-interactive html.
12:57:03FromGitter<tim-st> lol is that your own website?
12:57:09zacharycarterYeah there probably isn't one
12:57:26*Lord_Nightmare quit (Ping timeout: 244 seconds)
12:57:49FromGitter<tim-st> when I need a page with quality over http I use google cache
12:58:27zacharycarterhow do you dev locally?
12:58:29zacharycarteror do you just not block localhost traffic?
12:58:30krux02well you see where you approach fails
12:58:35zacharycarteror do you never dev on port 80?
12:58:44Yardanicozacharycarter, maybe he doesn't do web development
12:58:55FromGitter<tim-st> local isnt blocked only remote
12:59:00zacharycarterwhat if you want to look at a geocities page?
12:59:03zacharycarteror angelfire?
12:59:04zacharycarteryou're totally fucked
12:59:30krux02I don't do web development. And to be honest I am tired of all these hip web developers.
12:59:40FromGitter<tim-st> me too
12:59:50zacharycarterI'm offended!
13:00:04FromGitter<tim-st> I really dislike like you need a monster cpu machine to visit google nowadays
13:00:11FromGitter<tim-st> I turnt off js all over there
13:00:23Yardanicolol
13:00:41zacharycarterno one liked my geocities / angelfire joke :(
13:00:48*zacharycarter going to go sit in a corner now
13:00:54FromGitter<tim-st> well I have a local geo ip database
13:00:58krux02yea 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:14FromGitter<tim-st> yes
13:01:26zacharycarteraren't you using react / redux / yarn / every other fb js library in existance on your website?
13:01:56zacharycarterno?
13:01:56krux02I wish more websites would be plain html
13:02:05zacharycarterpsh!
13:02:27Yardanicokrux02, yeah, I totally agree with that
13:04:14zacharycarterthere was something out there the other day
13:04:17zacharycarterabout brutalist web design
13:04:48krux02being 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:10FromGitter<narimiran> @tim-st you're the guy who also doesn't use git, right? :)
13:05:10zacharycarterhttps://www.uxbrutalism.com/
13:05:27FromGitter<narimiran> you use .zip archive, IIRC?
13:05:34zacharycarterokay now tim-st is sounding lik the hipster
13:05:36FromGitter<tim-st> yes
13:05:36zacharycarterlol
13:05:49Yardanicolool
13:06:05Yardanicoi have no more questions to tim-st :)
13:06:06FromGitter<tim-st> well my code never has bugs, why should I use it
13:06:18zacharycarterlolololol
13:06:26zacharycarterthat should go on a wall
13:06:28zacharycarterabove your desk
13:06:31FromGitter<kaushalmodi> hehe, that rests the case I guess :P
13:06:39*FromGitter * narimiran drops mic
13:07:13krux02well zip files is what was used for the linux kernel for years until git was developed.
13:07:43zacharycarteryeah but now we have git
13:07:43FromGitter<tim-st> maybe I would use if there is a local software
13:07:49krux02git was developed to automate the process that was applied already manually with "tar ball and patches"
13:07:58krux02local software?
13:08:01FromGitter<kaushalmodi> @tim-st What do you mean "local"?
13:08:03FromGitter<tim-st> for git
13:08:08zacharycarterit's like using notepad instead of vim
13:08:08krux02git init
13:08:08FromGitter<kaushalmodi> `git` *is* local
13:08:21FromGitter<tim-st> with web like github in local
13:08:24FromGitter<tim-st> *gui
13:08:25krux02zacharycarter, but that is something I could understand
13:08:32FromGitter<kaushalmodi> ah. look at gitea
13:08:35Yardanico@tim-st gogs? gitlab?
13:08:36FromGitter<narimiran> you can have private repos on gitlab for free
13:08:42krux02notepad is better for some use cases, especially when you don't use it day to day.
13:08:57FromGitter<kaushalmodi> there's also barebones super awesome stagit
13:09:04krux02opening a readme.txt, I think notepad is better suitable than vim
13:09:09FromGitter<tim-st> @kaushalmodi thanks
13:09:11zacharycarterwell I mean with the intention of using it as a ide
13:09:13zacharycarteror writing code
13:09:25zacharycarterlike - why use an inferior tool for the job?
13:09:31zacharycartergit is pretty easy to get a handle on
13:09:44FromGitter<tim-st> I dont want to upload my code, it solves at least two unsolved problems
13:09:47FromGitter<kaushalmodi> @tim-st This is dogfooded using stagit: http://git.2f30.org/stagit/
13:09:56zacharycarteryou don't have to with git
13:09:57krux02well I think git is quite horrible to learn.
13:10:03krux02but I learned it on the command line.
13:10:06FromGitter<kaushalmodi> I like it for its minimalism to just show the git log and diffs (no issues, etc like gitea)
13:10:07krux02maybe things are better now
13:10:07Yardanico@tim-st you can self-host gogs or gitlab
13:10:13Yardanicoor some other solutions
13:10:22FromGitter<tim-st> Yardanico: thanks, will look into this
13:10:36FromGitter<narimiran> @tim-st you can use git locally, without uploading to anything (without remote repo)
13:10:50FromGitter<tim-st> I need a gui
13:10:51Yardanicogogs even supports sqlite as a DB
13:11:12krux02I am at university, it I can actually use git to clone projects from other user accounts in the file system
13:11:14FromGitter<narimiran> @tim-st vscode has nice git interface
13:11:20krux02that is quite funny
13:11:30krux02git really doesn't need the internet to work
13:11:52FromGitter<tim-st> ok, sounds good, maybe I will install it, though I dont feel the need
13:11:54Araq'git log' is broken when it comes to merged branches, or maybe rebased ones
13:11:55krux02you can really use git and send pull requests by snail mail.
13:11:57zacharycarteranyway - Araq: if I split up the carousel example into two source files -
13:11:57zacharycarterhttps://gist.github.com/zacharycarter/8fa2ff48bea8505d051a7049c5253bb1 - nothing renders :/
13:12:01FromGitter<kaushalmodi> krux02: Folks link git with internet because of Github popularity
13:12:20FromGitter<kaushalmodi> To their credit Github helps proliferate (one of my fav words) git
13:12:25FromGitter<kaushalmodi> *helped
13:12:56FromGitter<kaushalmodi> *that's all for off-topic chat from me for now :)*
13:13:23zacharycarterI still think I need to make the rotten gitatoes site
13:13:31zacharycarterwhich ranks github repos on freshness
13:13:47FromGitter<tim-st> did someone try nimsuggest on a late dev version? does it still go to 100% cpu?
13:13:54Yardanicoit depends on the code
13:14:03FromGitter<tim-st> ?
13:14:11Yardanicoif compiler hangs on your code - nimsuggest will hang too
13:14:18FromGitter<narimiran> for me - it happens sometimes, not always
13:14:28krux02I disabled nimsuggest, because for me it isn't reliable.
13:14:37FromGitter<tim-st> is it already known, what causes the staying at 100%
13:14:41FromGitter<tim-st> i mean which kind of code
13:14:47Yardanicothere's a lot of code which does this
13:14:57FromGitter<tim-st> but it was not in 0.18.0
13:15:00Yardanicoif I would care I think I can submit like 10-30 bug reports with different code samples
13:15:01Yardanicothere is
13:15:14FromGitter<tim-st> krux02: do you have something instead that suggest a bit?
13:15:16Yardanicoit was like this in 0.18.0 too
13:15:35FromGitter<tim-st> hm, didnt had that before
13:15:46krux02tim-st: just word based completion
13:15:51Yardanicoas I said, it depends on your code
13:15:57FromGitter<tim-st> ok
13:15:58Yardaniconim compiler still has a lot of crashes with invalid nim code
13:16:03Yardanicoand hangs too
13:16:08krux02my code seems to break nimsuggest regularly
13:16:18FromGitter<tim-st> but my code is valid and it goes to 100
13:16:47FromGitter<tim-st> after devel update
13:16:49Araqrecently it got worse because I listened to that banned fool and increased the VM instruction count limit
13:17:02FromGitter<tim-st> ah, that makes sense, ok
13:17:10FromGitter<tim-st> two 1 billion^^
13:17:12FromGitter<tim-st> *to
13:18:58krux02tim-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:06Araqlesson learned, don't listen to fools.
13:19:22krux02yes
13:19:37FromGitter<tim-st> yes, but which editor does it good?
13:19:40FromGitter<tim-st> sublime?
13:19:46FromGitter<tim-st> I have vscode currently
13:19:56FromGitter<tim-st> and I like go to definition
13:19:56Yardanicovscode does that too
13:20:02krux02I think any editor can enable it somehow
13:20:14FromGitter<tim-st> Yaradnico: but vscode has nimsuggest
13:20:19FromGitter<tim-st> which goes to 100
13:20:39krux02can't you disable nimsuggest in vscode?
13:20:49krux02I have emacs and I did disable nimsuggest.
13:20:56FromGitter<tim-st> I dont see an option
13:21:02Yardanicojust remove nimsuggest binary :)
13:21:12krux02that could work :P
13:21:27FromGitter<tim-st> maybe making `lint` off does it
13:21:42zacharycarterI don't know how you use emacs krux02 - did you write a lot of lisp or something before?
13:21:49zacharycarteror how you got into it rather I guess is better wording
13:24:06krux02zacharycarter, I had some scheme introduction like 10 years ago, that is all lisp I was ever in contact with
13:24:59FromGitter<kaushalmodi> zacharycarter: Unsolicited reply.. I got introduced to emacs during my grad school coop
13:25:01krux02but emacs lisp really isn't that bad.
13:25:24krux02a big criticism on emacs list is that all functions are in one global namespace
13:25:45krux02but that actually makes it very explorable, because all functions are uniquely identified by there name
13:25:53krux02and you can always jump to the definition
13:25:58krux02no matter where it is defined
13:26:25yglukhov_Araq: doesn't compilerRtl imply that a symbol might be dllexported/imported or smth?
13:26:43Araqyeah
13:27:00krux02and the syntax of lisp is easy, instead of f(a,b) it is (f a b)
13:27:12yglukhov_Araq: but we don't need it for nim*mem functions, do we?
13:27:41krux02zacharycarter, the only thing that makes me nervous from time to time is "dynamic scoping"
13:28:28Araqyglukhov_: the appveyor tests were red.
13:28:47AraqI think if you don't import/export it you get name clashes
13:29:19zacharycarterkrux02: gotcha
13:30:13krux02zacharycarter, one of the most amazing things about emacs lisp is its introspection.
13:30:16zacharycarteranyone have any insight into why splitting some Nim -> JS code into two modules, instead of one, would cause rendering issues with karax?
13:30:33Araqzacharycarter: it doesn't make sense :P
13:30:41zacharycarterI need to figure out a better way to debug Nim JS code
13:30:48krux02the key sequence C-h f asks you for a function name, and then you call all information about it
13:30:54zacharycarterAraq: I know right? but it seems to be a thing!
13:30:55*donlzx quit (Remote host closed the connection)
13:31:00yglukhov_Araq: are you sure about Appveyor? looks pretty green to me.
13:31:03Araqbut components need to be re-designed
13:31:11zacharycarterah okay
13:31:17krux02so you do not only get the documentation, but also on what keys sequence that function is bound.
13:31:36krux02so it is like an always up to date reference documentation built into the editor
13:32:14krux02but 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:15FromGitter<tim-st> I asked this yesterday too I think, does someone know, if cstring -> string is possible without copy?
13:32:27zacharycarterI'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:32zacharycarterkrux02: that does sound nice
13:32:38krux02Araq: can you the gdb pretty printer PR
13:32:53Araqyglukhov_: https://ci.appveyor.com/project/Araq/nim/build/5063/tests
13:33:42krux02here is the link again https://github.com/nim-lang/Nim/pull/8263
13:34:18krux02you recommended to change the nim-gdb start script from bash to nim.
13:34:20Araqtim-st the string owns its data, it's impossible
13:34:25yglukhov_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:30krux02I did not do it, because I don't really see the advantage
13:35:12Araqyglukhov_: now it's green but from my understanding only because the defaults are unchanged
13:35:12FromGitter<tim-st> Araq: ok, thanks, then I will probably overload it somehow for both
13:35:19krux02the start script is inspired by rust-gdb. They do it the same way, but they also proved a rust-lldb start script
13:35:30krux02I don't have lldb support.
13:35:40Araqso how do I start this on Windows then?
13:35:51Araqdo you *now* see the advantage?
13:36:05krux02Araq: well how do you use gdb from windows in the first place?
13:36:17Araqby typing 'gdb' into the command line
13:36:30krux02yes that still works
13:36:47Araqbut nim-gdb doesn't.
13:37:00krux02but you have to run "source path/to/nim-gdb.py" before the pretty printers are activated.
13:37:05yglukhov_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:19krux02I would port it to bat as well
13:37:27krux02then nim-gdb would work on windows as well
13:37:37krux02but I don't have windows so I can't test it.
13:37:44Araqjust let it be. I'll add the one line to koch.nim.
13:37:51krux02but the script is 3 lines, it should be trivial to port
13:38:09krux02ok
13:38:58Araqthat can then also fix the fact that fucking gdb needs the .exe extension explicitly
13:39:16krux02well it needs a file path
13:39:20krux02doesn't it?
13:39:33krux02on linux it doesn't need the .exe extension :P
13:39:49Araqyeah and we have already established that's dumb.
13:40:06Araqand makes tooling harder to develop. .gitignore and all that.
13:41:08krux02well to be honest I do like the extensionless binaries on linux
13:41:37krux02it doesn't allow multiple executables of the same name in the same folder
13:41:45krux02disabling ambiguities.
13:41:48Araqyes, you like them. they are objectively bad though.
13:41:56krux02why?
13:41:58FromGitter<narimiran> krux02: how do you (easily) gitignore them? (extensionless binaries)
13:42:18Araqamen.
13:42:30FromGitter<kaushalmodi> @narimiran Don't put binaries with source code
13:42:42FromGitter<kaushalmodi> ignore the binary containing folder
13:42:45FromGitter<kaushalmodi> nimble has `binDir`
13:42:56FromGitter<narimiran> @kaushalmodi tell that to nim's default settings
13:43:00Araqyes, workarounds exist. congrats.
13:43:09Araqstill makes it objectively bad.
13:43:09krux02narimiran[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:19FromGitter<kaushalmodi> @narimiran Difficult to tell that as Araq is pro-Windows :P
13:43:23yglukhov_gitignore *, unignore */, unignore *.*
13:43:48Araqand btw it's not "binaries" that are extension-less, it's "executables"
13:44:02Araqso shell scripts are also affected
13:44:08Araqand shouldn't be .gitignored.
13:44:18FromGitter<narimiran> yglukhov_: can you please use backticks, because this way gitter fucks up your message containing `*`
13:44:30krux02no also text files are extension less.
13:44:37Araqit's a clusterfuck. and now let me work on something important.
13:44:39yglukhov_narimiran: `gitignore *, unignore */, unignore *.*`
13:44:54FromGitter<narimiran> thanks, much clearer
13:45:05Araqyou're of course free to like bad technology.
13:45:44krux02files 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:44FromGitter<kaushalmodi> Araq: I see the trend.. whatever you don't use/prefer is bad technology
13:46:11krux02kaushalmodi: I mean he does't use it for a reason
13:46:18krux02or am I wrong?
13:46:39Araqthe real trend here is your resistance to listen to good arguments.
13:47:20krux02i 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:38AraqI learned all of them.
13:47:39FromGitter<kaushalmodi> krux02: exactly
13:47:45Araqand invested in all of them.
13:47:52AraqUnix stayed bad.
13:48:34*floppydh quit (Quit: WeeChat 2.1)
13:48:38krux02depends on the Unix flavor.
13:48:50krux02MaxOS I don't like at all.
13:49:00krux02Manjaro Linux. Really nice to use.
13:49:07PMunch+1 for Manjaro
13:49:38krux02I also like the unix pipe
13:49:46Yardanicoalso Antergos if you want pure Arch repositories
13:49:49Araqso which flavor of Unix fixes fucking file extensions? or that lib*.so atrocity?
13:50:01Yardanico(because some people use Manjaro and say "it's the same as arch")
13:50:22krux02Araq: none will ever do it, because that is really a minor issue after you got used to it.
13:50:36Araqno, it continues to cause problems to this day.
13:50:45krux02and fixing isn't really possible. At best you would create another incompatible convention.
13:50:56krux02and that doesn't help anybody.
13:51:11Araqit would help me, I believe in progress.
13:51:18FromGitter<narimiran> +2 for manjaro
13:52:34YardanicoUse antergos :)
13:52:48krux02the libXXX.so thing is really weird thing. But yea it isn't that bad.
13:53:09Araqit makes the contents of /usr/lib unreadable.
13:53:30krux02why?
13:54:29Araqlibread libthis libsentence libplease. liband libsee libit libwith libyour libown libeyes.
13:55:02YardanicoAraq, it's easy to read that sentence
13:55:07Yardanicobrain can just ignore "lib" prefix :P
13:55:14*adeohluwa quit (Quit: Connection closed for inactivity)
13:55:18Araqdoesn't work for my brain :D
13:55:34PMunchHaha, yeah the lib thing is a bit strange. Wonder how they settled on that..
13:56:04FromGitter<kaushalmodi> Also, no one uses `ls *foo*.bar`?
13:56:05krux02Araq: ls | sed -e 's/^lib//' -e 's/\.so.*$//'
13:56:42FromGitter<kaushalmodi> I'm really surprised these things are even an issue
13:57:04AraqI'm surprised these things STILL are an issue. after 40 years.
13:57:31*vivus joined #nim
13:57:39FromGitter<kaushalmodi> But who visually parses file names?
13:57:45FromGitter<kaushalmodi> `ls` was built for future
13:58:07krux02ls /usr/lib | sed -e 's/^lib\(.*\)\.so.*$/\1/'
13:58:59FromGitter<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:05krux02Araq: this should solve your libXXX.so problems once and for all: ls /usr/lib | sed -e 's/^lib\(.*\)\.so.*$/\1.dll/'
13:59:25FromGitter<kaushalmodi> @narimiran I agree
13:59:40krux02that are some readable regular expressions :P
13:59:41*TheLemonMan joined #nim
13:59:42Araq1. that only works if I don't use an UI based file browser (heresy, I know)
14:00:00Araq2. a workaround is not a fix.
14:00:18krux02well /usr/lib should really not be opened by a UI based file browser
14:00:24krux02they are useless in that folder
14:00:27TheLemonManfor 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:47TheLemonManworking with nimble is proving to be a damn pita
14:01:02FromGitter<kaushalmodi> TheLemonMan: How do you build it?
14:01:45TheLemonMannim c src/nimble.nim ? that's what the readme says
14:01:55FromGitter<kaushalmodi> I use `koch tools`
14:02:06krux02yes I use koch tools as well
14:02:14krux02you can look into koch
14:02:21FromGitter<kaushalmodi> here's my build script (https://gist.github.com/c9d7a469a3c478d3bd88689be9b012f1)
14:02:41TheLemonManI know, but I need to build a patched version of nimble
14:03:01FromGitter<kaushalmodi> Shouldn't editing nimble.nim and running koch tools work?
14:03:39TheLemonManto further complicate the matter I wanted this to work with my stable choosenim toolchain
14:04:10FromGitter<kaushalmodi> hmm, that's out of my scope now :)
14:04:59AraqTheLemonMan: I use 'nim c --noNimblePath --path:../nim/compiler src/nimble' in a cloned nimble
14:18:16TheLemonManno luck, even though I've set --path to point to the choosenim directory
14:21:08TheLemonManyay, another bug in nimble
14:21:44*jamesroseman joined #nim
14:21:59Araqthere is also a NIMLIB environment variable you can set
14:22:22Araqthough it might be named differently, I don't use environment vars, creates fragile builds
14:22:58FromGitter<tim-st> is there a "rule" when the use of `likely` is useful? already at 51% ?
14:23:36vivusis the IRC client lib included in nim-core or is it a nimble package ?
14:23:49krux02what do you mean with likely?
14:24:01FromGitter<tim-st> if likely(a > b)...
14:24:03TheLemonMantim-st, no
14:24:07Yardanico@tim-st not really
14:24:18krux02no likely is for almost 100% useful
14:24:22Yardanicolikely() just maps to C compiler's intrinsics
14:24:24FromGitter<tim-st> I think I read it's a bit costly going in the wrong direction
14:24:35TheLemonManyou should really use it after (extensive) profiling
14:25:13FromGitter<tim-st> ok, but if someone knows internal details I think it can be calculated before profiling easily
14:25:24FromGitter<tim-st> of course if has to imeplemented somehow
14:25:34FromGitter<tim-st> so there is a real percentage number
14:25:51krux02it is costly, but it is just one of many components that might go wrong, and "pretty costly" is also relative.
14:26:00krux02cache miss is more costly
14:26:15FromGitter<tim-st> ok, thanks, so 60% likely is already ok?
14:27:51TheLemonManit depends, numbers without context are meaningless, that's why you profile
14:27:53krux02I would use it for this ``` if unlikely(not isInitialized): initialize ``` but that is just a guess
14:28:07FromGitter<tim-st> ok, I think it's this topic: https://en.wikipedia.org/wiki/Branch_predictor
14:28:32krux02my 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:50krux02but I don't know, I never actually measured it.
14:29:05FromGitter<tim-st> ok
14:29:38krux02the cpu also does it's own branch prediction, you don't actually have to tell it what braches are likely.
14:29:39Yardanico@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:12FromGitter<tim-st> Yardanico: thanks, so I think it should be > 80%
14:30:25krux02so
14:30:26krux02no
14:30:32Araqand 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:49krux02I would say use it only for 99% and above
14:31:03YardanicoAraq, I have Haswell CPU :P
14:31:18FromGitter<tim-st> 99% is quite high I think
14:31:18Yardanicoi5-4460
14:31:35FromGitter<tim-st> if it goes wrong it takes "some cpu cycles" extra
14:31:48FromGitter<tim-st> between 10 and 20 clock cycles.
14:31:57krux02I actually prefer branch-less code when it's possible and performance matters
14:32:09FromGitter<tim-st> sure, but often you need them
14:32:24FromGitter<tim-st> from "between 10 and 20 clock cycles." I think it can be calculated qquite good
14:32:48TheLemonMancalculate what?
14:32:49krux02so insead of ``if xyz: a += b`` I do ``a += int(xyz) * b``
14:33:15FromGitter<tim-st> the probability number at which it makes sense to use likely at minimum
14:33:39Yardanicokrux02, hmm
14:34:15krux02but I don't know how well compilers actually do this themself.
14:34:28TheLemonManthat depends on the cpu (a black-box) and on your actual algorithm/implementation
14:34:39TheLemonManyou can't pull universally true values out of thin air
14:34:54krux02the ``*`` operator can be replaced by a bitmask, but I don't know the right operation for that now
14:35:13FromGitter<tim-st> I think in fact it can be done, if we assume the upper number to be "20 cycles"
14:35:19FromGitter<tim-st> because of this I asked
14:36:56TheLemonManfor a given cpu with a given architecture and a given sequence of instructions you *might* be able to do so
14:37:10krux02TheLemonMan, the CPU I have is not a black box. it is: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
14:37:54krux02but then I would only optimize on my cpu. But it is better than optimization to no CPU at all.
14:38:18TheLemonMankrux02, 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:33FromGitter<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:46FromGitter<tim-st> and maybe someone did that already
14:42:48Araq„The branch predictor appears to have been redesigned in the Haswell, but very little is known about its construction.
14:42:49AraqThe 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:49AraqPredicted not taken branches have an even higher throughput of up to two branches per clock cycle.
14:42:51AraqThe 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:53Araqbranch 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:54Araqspaced by at least 16 bytes, then apparently the first 128 branches have the high throughput and the remaining have the low throughput.
14:42:56AraqThese 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:58Araqbranch target buffer.“
14:43:00Araqfrom http://www.agner.org/optimize/microarchitecture.pdf
14:43:40FromGitter<tim-st> ok thanks Araq
14:45:53*miran joined #nim
14:46:57*Lord_Nightmare joined #nim
14:48:56krux02Araq: can you merge the get-sym-id branch that I made a while ago?
14:49:05Araqno.
14:49:10krux02:/
14:49:22Araqcode shouldn't use sym-ids, it should use hashes
14:49:30krux02but I don't have an alternative that is feasible to resolve identifier name collisions.
14:49:50Araqany count table will do, no?
14:49:51krux02I don't want to reimplement the compiler logic that does symbol name collsion resolution
14:50:10Araqyes, instead you exposed the bad, outdated compiler logic.
14:50:58Araqthat we have to ignore in the C++ codegen in order to reduce build times.
14:51:02krux02Araq: then can you expose the "modern" compiler logic that lets me generate non colliding identifier names?
14:51:17AraqI tried to make you do it :P
14:52:40krux02I really would, but my time for my master thesis is really becoming a narrow window
14:52:59Araqok, so tell me what you need
14:53:22Araqnon colliding identifier names can mean ident_file_line_col
14:53:46Araqand then if these are the same due to generic instantiations we need a _count suffix
14:55:38krux02maybe the file_line_col could work
14:56:01krux02I want ``for i in 1 .. 10:`` to abe able to compile to glsl.
14:56:26krux02the problem is that the iterator already introduces the symbol ``i``
14:57:15krux02so the generated glsl has two local variables ``i``.
14:57:53krux02I 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:52krux02I hope that all the symbols have lineinfo
15:03:04*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
15:07:56Araqthey do.
15:09:58*natrys joined #nim
15:13:43krux02even genSym symbols?
15:14:24krux02why, why does getImpl on a type have OpenSymChoice?
15:25:07krux02I don't want OpenSymChoice ever in my macro ast
15:28:44krux02really the ast's need to be more stable
15:29:17krux02I got a PR on glm that created all the different types with a template. I thought yea this makes glm more maintainable.
15:29:45krux02I accepted it, and now all the types ast representations are completely incompatible
15:40:00krux02Araq: when I work for Nm , I would really like to work on the ast that is exposed by the macro module.
15:40:25krux02I think in many many cases the AST is just weird and bonkers.
15:41:10krux02especially on getImpl
15:41:21Araqagreed
15:43:51Araqkrux02: but before you patch the implementation, patch the spec.
15:44:01Araqthe "after sem" AST is not in the spec at all
15:44:20Araqand ideally it's as close to the before sem AST as possible.
15:45:38Araqan OpenSymChoice is well designed though.
15:53:31krux02araq: yes an OpenSymChoice is well designed. But a fully typechecked ast should not have it.
16:07:19krux02Araq: 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:42krux02Araq: 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:11Araqlol deprecation warnings are fixed *now* after we removed the deprecated symbols.
16:54:21Araqthat might mean something...
17:02:11*jamesroseman joined #nim
17:02:30*krux02 joined #nim
17:04:20mirani have some string (e.g. "1, 15, 22") which i want to convert to seq[uint16]
17:04:49miranto convert to seq[uint], i have used `split(", ").map(parseUInt)`
17:05:40miranbut how to convert it now to seq[uint16]? or is there some direct way string -> seq[uint16]?
17:06:10Araqhttps://www.zdnet.com/article/the-return-of-spectre/
17:06:55Araqmiran: mapIt(uint16(parseUInt(it)) maybe
17:09:08miranAraq: 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:00miranok, this is something i haven't experienced before.... i have `let foo = createFoo()` and this works fine
17:43:20miranbut if i change it to `const foo = createFoo()`, the compilation hangs
17:44:24miranto 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:49miranthe same thing happens both in stable and in devel
17:57:17AraqcreateFoo is not statically evaluable
17:57:29Araqand the compiler fails to tell you this :P
17:58:12miranAraq: and compiler doesn't have that problem without `-d:release`?
17:59:14Araqit probably miscompiles it either way
18:00:46miranwell, without release flage it takes unreasonably long time to compile, but in the end it runs fine
18:01:17mirani guess i won't use `const` and that's it :)
18:03:44Araqcan you report it properly please?
18:04:09Yardaniconew 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:24miranAraq: ok, i'll see if i can make some basic example
18:04:54Yardanicoand yeah, I'll be a mentor for Nim track on exercism
18:05:23AraqYardanico: nice. what does that mean?
18:05:27skrylareeh, well time to add bicubic and then this module is prolly done-ish
18:05:32Araqcan you mentor me too? :-)
18:05:37Yardanicono :P
18:05:44YardanicoAraq, I'll review people's solutions on exercises in nim track
18:05:48miranAraq: it is this code: https://github.com/narimiran/AdventOfCode2017/blob/master/nim/day12.nim
18:06:04skrylari don't think anyone actually uses tricubic o.O
18:06:04miranthe problem is on the line 13, if you change it to `const`
18:06:32Yardanicoso 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:59Yardanicobut of course someone can do their solutions in "independent" mode if they don't want to be mentored
18:07:09miranYardanico: only 27 exercises? how to make that 100?
18:07:17Araqmiran: that code looks evaluable at compile-time
18:07:19Yardanicomiran, just port them from other languages
18:07:47Araqalso wow 'func' is getting popular :-)
18:07:52Yardanicomiran, some instructions (I asked nim track maintainer https://github.com/exercism/nim/pull/85#issuecomment-396347753)
18:08:09FromGitter<kaushalmodi> Yardanico: I had started off on exercism.. first 6 problems went fine
18:08:18miranAraq: yeah, func is great, and the reason i want to use `const` is to have `func dfs` also :)
18:08:36FromGitter<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:54miranif you check my commits in that repo, you can see that recently i have decided to use `func` wherever i could
18:09:25FromGitter<Yardanico> @kaushalmodi yeah, there's a lot of exercises with different difficulty
18:10:01FromGitter<kaushalmodi> coding might not be difficult.. but it looks like I might need a CS course to understand that problem statement :)
18:10:14FromGitter<Yardanico> there's a test suite
18:10:33FromGitter<Yardanico> you can implement the code by looking at tests :)
18:10:58*nsf joined #nim
18:11:05FromGitter<kaushalmodi> yeah.. but that react test suite is a different beast
18:11:08miranYardanico: how much time does it take to port the exercises from other languages?
18:12:03FromGitter<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:49Araqhmm it's the weekend already
18:14:02Araqcould add a component system to Karax that actually works
18:26:58Yardanicomiran, well, usually it's easy, but also it would take some time to add all required information to configuration files, etc
18:27:08Yardanicoyou can just port exercises from Python :P
18:34:32miranYardanico: 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:56Araq"rather than" ? programming in Nim is pure joy.
18:42:15YardanicoAraq, of course it is :)
18:42:58FromGitter<tim-st> nearly pure joy, `assert(not true)` -> `assert not true`
18:42:59miranAraq: 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:17Araqpy2nim
18:53:00YardanicoAraq, but we want idiomatic Nim :)
18:58:01FromGitter<tim-st> Araq: do you think it can be recognized in nim for these types to have same size?
18:58:02FromGitter<tim-st> echo sizeof((0i8, 0i16, 0i8)) ⏎ echo sizeof((0i8, 0i8, 0i16))
18:58:30FromGitter<tim-st> I saw pragma pack can have downsides, but I think not on this specific type
19:02:27Araqthese types don't have the same size
19:02:42FromGitter<tim-st> I know, but why?
19:02:58FromGitter<tim-st> I mean they could have
19:03:30FromGitter<tim-st> with #pragma pack(1) they have same size
19:08:39Araqalignment.
19:09:54FromGitter<tim-st> so the developer should take care himself that the tuple is sorted by size to get best performance?
19:12:45FromGitter<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:18FromGitter<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:38Araqhttps://en.wikipedia.org/wiki/Data_structure_alignment
19:17:07FromGitter<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:13FromGitter<tim-st> (by default)
19:33:10CodeVanceI wish there was a way to make an unordered enum? For porting c code
19:33:45Yardanicowhat do you mean "unordered"?
19:34:43CodeVancetype MyEnum = enum[a=3,b=2,c=4]
19:37:37FromGitter<kaushalmodi> CodeVance: I don't think that's legal.. does that compile?
19:38:29CodeVancenope
19:38:33CodeVanceI don't know how to do one line enum def
19:38:55CodeVancebut they basically aren't ordered 1,2,3
19:39:44FromGitter<kaushalmodi> got it
19:39:52FromGitter<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:03FromGitter<kaushalmodi> but that wouldn't compile too
19:40:08FromGitter<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:08FromGitter... `filterIt` I'm trying to run.
19:40:11FromGitter<kaushalmodi> > Error: invalid order in enum 'b'
19:41:50*krux02 quit (Read error: Connection reset by peer)
19:42:59FromGitter<kaushalmodi> CodeVance: would stringified enums work for your use case?
19:43:04FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4900c8641ecc065fa0c6b5]
19:43:23FromGitter<kaushalmodi> outputs: ⏎ ⏎ ```3 0 ⏎ 2 1 ⏎ 4 2 ⏎ cool 3``` [https://gitter.im/nim-lang/Nim?at=5b4900db95e03e3d7b483ffd]
19:43:33CodeVanceamscott just surround with ()
19:43:44CodeVancekaushalmodi I need the vals to be uint32 what does a stringify do ?
19:44:43CodeVance@amscotti_twitter surround the expressions with ()
19:45:20FromGitter<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:35FromGitter<Varriount> Huh, I didn't know you could use strings as an enum value
19:45:41AraqCodeVance: c2nim reorders the enum
19:45:45Araquse c2nim.
19:46:11FromGitter<amscotti_twitter> @CodeVance, Cool I'll give that a try. Thanks!
19:46:40CodeVance@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:28CodeVance@amscotti_twitter looking at it now it works on latest devel nim without () as well
19:47:31skrylari concur that forced ordering of enums is :E
19:47:55*stefanos82 joined #nim
19:49:10FromGitter<kaushalmodi> skrylar: Now what does ":E" mean?
19:50:46FromGitter<kaushalmodi> May be https://en.wikipedia.org/wiki/List_of_emoticons needs an update :P
19:52:12CodeVanceits not there
19:52:22CodeVanceits a monster with teeth
19:52:43FromGitter<kaushalmodi> lol found this: https://www.urbandictionary.com/define.php?term=%3AE
19:52:51CodeVanceBut I don't know what that's supposed to mean?
19:52:54FromGitter<kaushalmodi> what a difference an open parenthesis can make
19:53:20CodeVance:E
19:53:21CodeVanceemoticon
19:53:22CodeVanceAn 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:53Araqmeh ok, add some sort() proc to the compiler
20:04:01FromDiscord<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:31FromGitter<kaushalmodi> seems like both work (based on what I see on grepping though Nim repo)
20:08:58CodeVancewindows no caps
20:09:12CodeVancethe first letter cap is the only one that matters
20:09:23CodeVanceWhat really ? kaus
20:09:29FromGitter<kaushalmodi> .. though the capital Windows cases show up only in the deprecated libs
20:09:33Araqactually for 'defined' no cap matters
20:09:47FromGitter<kaushalmodi> no I take that back
20:09:53FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b490710c02eb83d7c716b54]
20:11:57*jamesroseman quit (Ping timeout: 240 seconds)
20:12:48CodeVanceHow 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:48AraqCodeVance: I don't think you can write a {.mymacro.} on an enum
20:34:03Araqbut mymacro: type Foo = enum ... will work
20:34:21CodeVanceokay thanks
20:36:45CodeVanceno that syntax does not work
20:37:27CodeVanceoh
20:37:30CodeVanceI misread your post
20:45:09CodeVanceare destructors fast?
20:46:07Araqsure
20:46:21Araqbut use the C++ backend for them, they introduce hidden try-finallys
20:46:46dom96are destructors stable?
20:48:12Araqhardly, but I might have a "hello world" working with the new destructor based strings
20:57:58stefanos82Araq: will the new destructor going to get introduced with 0.19 or with 1.0?
20:58:50Araq0.19
20:58:55stefanos82very nice
20:59:17stefanos82in other words, with the release of 0.19 the default backend will be C++?
20:59:27skrylareww
20:59:33CodeVancearaq is there any advice you'd have for game dev with nim?
21:00:09Araq0.19 will ship with --gc:destructors but I doubt we can make that mode the default
21:00:48stefanos82I got a bit confused now.
21:00:54AraqCodeVance: yeah, let me prepare a gist
21:00:58FromGitter<kaushalmodi> Delving in HSlice.. are tuples and HSlice related? (based on `$` of HSlice looks like {a,b) tuple)
21:01:08stefanos82will you introduce try / finally for C as well in the form of macros?
21:01:37FromGitter<kaushalmodi> *(a,b) tuple
21:01:44Araqtry-finally already works for the C target, I don't understand this question
21:01:55CodeVance@kaushalmodi hslices are ordinals
21:01:56*endragor joined #nim
21:02:21stefanos82well, you said "but use the C++ backend for them, they introduce hidden try-finallys", unless you meant Nim's try finally operators
21:02:43AraqI meant Nim's.
21:03:01Araqthe destructor injections are implemented as an AST to AST transformation.
21:03:02stefanos82ah OK, that makes it clearer now; thank you.
21:03:13Araqso all backends are affected automatically.
21:03:14FromGitter<kaushalmodi> CodeVance: Really?
21:03:22CodeVanceno
21:03:27CodeVanceI'm mistaken
21:03:34FromGitter<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:45CodeVanceI was thinking of range
21:03:45FromGitter<kaushalmodi> yeah.. because it seems to handle any type thrown into it
21:04:07FromGitter<kaushalmodi> That `(a: 0.1, b: 'a')` reminds me of tuples
21:04:24FromGitter<kaushalmodi> so I was wondering if tuples can be assigned using HSlices or if they are at all related
21:04:38FromGitter<kaushalmodi> *Spoiler: I was unable to assign hslices to tuples
21:04:39Araqthat's just $ for objects, I think
21:04:58FromGitter<kaushalmodi> Araq: thanks
21:04:59Araqdon't draw too many conclusions from system.$
21:05:06FromGitter<kaushalmodi> ok
21:05:16Araq(I want to remove it for objects, but nobody agrees with me)
21:05:17CodeVanceuse repr instead?
21:05:17FromGitter<kaushalmodi> While you are here.. are HSlices and sets related?
21:05:23Araqno.
21:05:28FromGitter<kaushalmodi> ok ..
21:05:38FromGitter<kaushalmodi> so HSlices and interators are related right?
21:05:51Araqhttps://nim-lang.org/docs/system.html#HSlice
21:05:53FromGitter<kaushalmodi> I am just trying to piece things together
21:05:56Araqno magic.
21:06:06Araqjust what system.nim says it is.
21:06:10FromGitter<kaushalmodi> Yes, I read that
21:06:16FromGitter<kaushalmodi> but was looking for more info
21:06:26*endragor quit (Ping timeout: 268 seconds)
21:06:35FromGitter<kaushalmodi> it says lower and upper bounds.. but a and b can be different types
21:06:40FromGitter<kaushalmodi> so how do bounds apply there?
21:07:02Araqhttps://nim-lang.org/docs/system.html#items.i,HSlice[T,T]
21:07:37Araqsimple, it needs to be the same T for iteration.
21:07:39FromGitter<kaushalmodi> ah! makes sense
21:07:57FromGitter<kaushalmodi> but then the "bounds" shouldn't be part of hslice doc, right?
21:08:31FromGitter<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:43FromGitter<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:33FromGitter<kaushalmodi> wow.. this works (understanding signatures feels awesome!): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b491a34641ecc065fa10877]
21:31:47FromGitter<kaushalmodi> *prints `def`*
21:33:12FromGitter<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:13FromGitter<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:24FromGitter<Yardanico> with that setting there's no Nim on v2 website
21:50:43FromGitter<Yardanico> @amscotti_twitter
21:53:31dom96https://github.com/exercism/nim/pull/99
21:53:38*rockcavera quit (Remote host closed the connection)
21:53:44Yardanicooh
21:53:49*Trustable quit (Remote host closed the connection)
21:56:38dom96Why so impatient?
21:57:21Yardanicodom96, idk :P
22:00:37AraqCodeVance: https://gist.github.com/Araq/b0ccaf122406a561fec71e5051d8028b
22:01:01Araqnever tried to really develop a game with this idea, but it looks nice on paper
22:01:23Araqand I'm not this short document gets my point across.
22:04:22*brainpro1 quit (Ping timeout: 256 seconds)
22:04:49CodeVancehmm its supposed to generate what type of code though?
22:04:57CodeVanceAraq:
22:07:31CodeVancehmm it would be interesting, but also a lot of work
22:08:01Araqit would produce "real" types and more importantly
22:08:22Araqaccessors that ensure these invariants
22:09:24*brainpro1 joined #nim
22:12:26*gb00s joined #nim
22:15:12CodeVanceYou could run a "defragment" process just like the "gc" Then leave reshuffeling for later
22:15:40CodeVanceor not run reshuffeling at all
22:15:50CodeVancejust overwrite with 'new' object
22:16:54CodeVancewhich is basically what the paper link says
22:18:30CodeVancearaq how fast is this `for i in 0..<1: sleep(1)` does it have any overhead?
22:18:57Araqsleep(1)?
22:19:23Araqfor 2 iterations?
22:19:34Araqor one
22:19:41CodeVancefor zero
22:19:47CodeVance:facepalm:
22:20:39CodeVancebasically is an empty for loop zero cost
22:20:47Araqsure
22:20:53FromGitter<tim-st> I compiled nim devel some minutes ago and the code with `regex` just wont compile nothing happens
22:22:22FromGitter<tim-st> also suddenly the regex cannot evaluated at compile time
22:24:08FromGitter<tim-st> it just chills: `[Done] exited with code=1 in 167.589 seconds`
22:24:59CodeVancenre?
22:24:59CodeVancepcre?
22:25:06CodeVancere?
22:25:18FromGitter<tim-st> `regex` as written above...
22:25:34CodeVancethe package?
22:25:44FromGitter<tim-st> yes
22:25:58FromGitter<tim-st> `const reContents = re"(?s)<h2>\s*?<span(?:(?:\s.*?>)|>).*?</span>\s*?</h2>"`
22:26:30FromGitter<tim-st> worked at 0.18.0
22:29:43FromGitter<tim-st> ok, I updated the version, it seems the devel required a new version
22:30:59CodeVanceI'm running the tests now
22:31:01FromGitter<tim-st> compilation doesnt work though :(
22:31:40FromGitter<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:35CodeVancehttps://travis-ci.org/nim-lang/Nim/builds
22:33:37FromGitter<tim-st> I can compiled some code, it has to do with regex
22:33:55CodeVanceMaybe you used a broken devel
22:34:33FromGitter<tim-st> how do I know?
22:35:44CodeVanceuse the travis-ci link look if you are on a green commit
22:36:55FromGitter<tim-st> shit I think I got a red version
22:37:44FromGitter<tim-st> dd47013017d75a2b1a8c80e12f273e18e86f7d72
22:38:32CodeVanceNo that's right.
22:38:53FromGitter<tim-st> ok, then it's maybe a bug in regex
22:39:07CodeVancethen clone the nim-regex repo
22:39:14CodeVancego into that then nimble install
22:39:18CodeVanceWhich was what I did
22:39:24CodeVancethen nimble test
22:39:43CodeVanceI literally cloned the repo a few seconds ago
22:40:19FromGitter<tim-st> nimble test?
22:41:55FromGitter<tim-st> doesnt work, thanks for the help though, will try tomorrow
22:42:22Araqprobably a regression in Nim's VM
22:42:29Araqwe'll have a look.
22:42:53FromGitter<tim-st> seems more like todo with compiler
22:43:05AraqNim's development is speeding up, but sadly it means more regressions too
22:43:17CodeVanceIf that fails. In the console type nim -v
22:43:34FromGitter<tim-st> I mean with gcc
22:43:38CodeVanceWell I can tell you my commit
22:44:41CodeVanceis your path setup? did you reinstall your computer
22:44:54CodeVanceyour on windos right?
22:45:27FromGitter<tim-st> maybe I didnt clean some old files, but deleted nimcache folders
22:45:36FromGitter<tim-st> nim and gcc in path, yes
22:45:56CodeVance#54a85b4ff56393e7279f244fe8557ebb36f864ee
22:47:04FromGitter<tim-st> not sure what it is, I look tomorrow, a smaller example with same proc compiles
22:47:09CodeVancerestart not reinstall :X
23:01:05FromGitter<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:52shashlickJust use nitely/regex - pure Nim regex
23:10:01*byte512 joined #nim
23:10:52CodeVanceAnA <- a
23:11:51CodeVancea <- "a"
23:11:52CodeVanceacollection <- a a a
23:11:52CodeVanceis what I think
23:12:47CodeVancePEG isn't a regex replacement. its for a parser
23:14:17FromGitter<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:29FromGitter<rayman22201> unless the manual is wrong
23:15:44FromGitter<rayman22201> https://nim-lang.org/docs/pegs.html
23:16:04FromGitter<rayman22201> That being said, is there a pure regex engine in Nim devel?
23:16:14FromGitter<rayman22201> pure Nim regex engine
23:18:26FromGitter<data-man> @rayman22201 https://github.com/nitely/nim-regex
23:20:20skrylarhttps://nim-lang.org/docs/basic2d.html y dis 404
23:21:43FromGitter<rayman22201> @data-man thanks 👍
23:25:07FromGitter<rayman22201> another random question. How can I send terminal escape sequences though echo?
23:25:14FromGitter<rayman22201> through echo?
23:25:27*donlzx joined #nim
23:25:32*donzx joined #nim
23:25:46Araqterminal.nim
23:25:55*donlzx left #nim (#nim)
23:27:51FromGitter<kaushalmodi> @rayman22201 Check out a "sugar" package for colorful echoes in nimble.. `fab`
23:28:02FromGitter<rayman22201> thanks again :-)
23:28:03FromGitter<kaushalmodi> It uses terminal
23:29:57FromDiscord<exelotl> if I have the following: `proc setFlag(val:cint) {.importc.}` where val is 0 or 1
23:30:23FromDiscord<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:14skrylaradd a template that accepts a boolean and then in turn calls setFlag(val.cint)?
23:49:34AraqError: system module needs: newSeq
23:50:04Araqbah, picky compiler. yeah, I haven't yet implemented newSeq...
23:57:08*natrys quit (Quit: natrys)
23:58:40*rockcavera joined #nim