00:00:11 | disruptek | i want to write some tiny comparisons to other languages for each of the categories. |
00:01:00 | disruptek | http://ix.io/2Exi/md |
00:02:07 | disruptek | i think each category can have ~3 little demos that will capture the flavor trivially. |
00:02:40 | FromDiscord | <Rebel> well that's not feasible |
00:02:48 | FromDiscord | <exelotl> ah I like this |
00:02:55 | FromDiscord | <dom96> That's what https://nim-lang.org/features.html tries to do |
00:03:03 | hmmm | crappy concurrency is what made me choose nim |
00:03:13 | hmmm | I have no intention of using concurrency :o |
00:03:31 | disruptek | the problem is that none of what's written on features is important/discriminating. |
00:03:33 | mipri | Rebel, probably what you want to do is feasible but you just haven't been shown how because nobody knows knows waht you're looking for yet |
00:03:38 | FromDiscord | <Rebel> The user is passing an arbitrary number of headers I need to dynamically create the array but if it's too big the request will fail (depending on the server as you have invalid headers). You can not use a seq |
00:03:51 | FromDiscord | <Rebel> This is for creating httpheaders for asynchronous http communications |
00:04:04 | FromDiscord | <dom96> disruptek: your list and the features page's list overlap |
00:04:29 | FromDiscord | <Rebel> one sec |
00:04:30 | FromDiscord | <Rebel> I can show you |
00:04:38 | disruptek | i'm talking about the first block. |
00:05:02 | disruptek | i mean, fuck. no one codes in Ada or Modula. |
00:05:17 | disruptek | i don't want to see "inspired by Python" everywhere. |
00:05:18 | FromDiscord | <dom96> I bet you more people code in Ada than Nim |
00:05:45 | disruptek | you're right, dom. the features page is perfect. |
00:05:49 | mipri | more appropriate material for a page like https://doc.rust-lang.org/reference/influences.html |
00:06:00 | FromDiscord | <nikki> for me personally the things that drew me to it were:β΅- metaprogramming and type introspection at compile time, esp. with compile time vars so i can register stuff from many modulesβ΅- compiles to C(++) and interops with them so i can see what it does + use libs in 'emβ΅- syntax with very low overhead |
00:06:01 | FromDiscord | <Rebel> Something like this mipri (https://play.nim-lang.org/#ix=2Exn) if you change it from a 3 to a 1 the request will work |
00:06:07 | FromDiscord | <nikki> - seems to compile somewhat fast(-ish?) |
00:06:21 | FromDiscord | <dom96> the thing with Nim is that there isn't a single shiny thing that no other language offers |
00:06:47 | disruptek | yes, but saying "inspired by Python" is kinda useless. |
00:06:56 | disruptek | it's really not very similar to python. |
00:07:09 | disruptek | the only part that's similar is syntax. |
00:07:31 | FromDiscord | <dom96> "Multiple constructs inspired by Python" |
00:07:36 | FromDiscord | <dom96> Nothing false about this statement |
00:07:41 | disruptek | jesus christ. |
00:07:47 | FromDiscord | <notchris> died for our sins |
00:07:53 | FromDiscord | <dom96> lol |
00:08:00 | FromDiscord | <notchris> _bows_ |
00:08:04 | disruptek | gonna go jerk off instead; peace out. |
00:08:09 | FromDiscord | <notchris> fair |
00:08:22 | mipri | the complaint isn't that it's false, but that it's not useful. People who really like Python won't be jazzed about Nim the way Ruby people might be jazzed by Crystal |
00:08:47 | FromDiscord | <dom96> disruptek: good, you need to chill, you getting way too worked up about this features page man |
00:08:51 | mipri | the code examples show enough Python influence |
00:09:03 | * | opal quit (Ping timeout: 240 seconds) |
00:09:11 | disruptek | hey dom96, kiss my ass. |
00:09:32 | * | opal joined #nim |
00:10:52 | mipri | Rebel: you can use a seq there |
00:11:28 | FromDiscord | <Rebel> but I can't |
00:11:35 | mipri | example with the same paramater: https://play.nim-lang.org/#ix=2Exq |
00:11:42 | federico3 | sometimes stdlib is surprising. It's lacking a lot of stuff but has things like sameFileContent |
00:12:53 | FromDiscord | <Rebel> ok |
00:12:54 | FromDiscord | <Rebel> yes you can |
00:13:05 | FromDiscord | <Rebel> Not sure why but when I was trying to use it earlier it was complaining |
00:13:06 | FromDiscord | <Rebel> that was on me |
00:13:07 | FromDiscord | <Rebel> ok thanks |
00:13:08 | FromDiscord | <notchris> i come from javascript to nim, quite a weird jump, and i found the documentation and general site easy to follow as noob |
00:13:08 | FromDiscord | <Rebel> excellent |
00:13:11 | FromDiscord | <dom96> mipri: sure, it might not be useful. There certainly are plenty of Python programmers out there who want a faster Python though, and Nim definitely fits the bill. It's a worthwhile marketing tactic |
00:13:24 | federico3 | +1 |
00:13:39 | FromDiscord | <nikki> i don't think it's about whether that's a good tactic. it's about how to phrase / show things to use that tactic well |
00:13:53 | FromDiscord | <exelotl> it was only a few months ago that I heard the mantra "readability of python, speed of C, metaprogramming power of Lisp" or however it goes - I explained it to someone that way and it seemed to go down pretty well |
00:14:01 | FromDiscord | <nikki> and also use it effectively while keaving space for all of the other tactics involved |
00:14:03 | * | mbomba joined #nim |
00:14:09 | mipri | yeah in comparison with those other pages I don't think nim-lang.org has any particular faults. |
00:14:13 | FromDiscord | <nikki> @exelotl i kinda like that one |
00:14:31 | FromDiscord | <nikki> altho does lisp actually have compile time vars that you can write to from all over |
00:14:36 | mipri | just, the source tarball should have an INSTALL that repeats the online instructions, because people don't read them after they download the source. very strange. |
00:14:37 | FromDiscord | <nikki> that one seems kinda specific to nim |
00:15:25 | FromDiscord | <dom96> Ideally we should iterate on the existing features page, sadly it was instead made less prominent |
00:15:41 | FromDiscord | <dom96> and now we've just got a big wall of text on the front page |
00:15:53 | FromDiscord | <notchris> lets re-design the site and record tutorial videos |
00:16:01 | FromDiscord | <notchris> and pictures |
00:16:14 | mipri | Crystal had a great slogan: "fast as C, slick as ruby", and then they switched to, gag, "A language for humans and computers". Gotta be careful about letting too many people provide helpful input on website design, too. |
00:16:46 | hmmm | jesus a language for humans and computers is pretty bad :| |
00:17:31 | hmmm | well I g2slp cu nimians |
00:17:36 | * | hmmm quit () |
00:17:43 | mipri | nim-lang.org has a lot of text but the important text is large. the code blocks are large. the important links are on the top - Download, Learn, Documentation. it works |
00:17:48 | FromDiscord | <nikki> i like racket's website |
00:18:06 | FromDiscord | <notchris> nikki and i will remake the site |
00:18:14 | FromDiscord | <nikki> or i did at one point, it kinda seems π€ now (racket one) |
00:18:23 | FromDiscord | <nikki> @notchris haha π |
00:18:29 | FromDiscord | <notchris> first order of business |
00:18:31 | mipri | Efficient <- it's not a scripting language. expressive <- it's not go. elegant <- it's not... go? |
00:18:32 | FromDiscord | <notchris> lets fix the nim logo |
00:18:36 | FromDiscord | <notchris> so its not asymetrical |
00:18:39 | FromDiscord | <nikki> can we just make a game in nim and make it the homepage |
00:18:56 | FromDiscord | <notchris> we cant make a game in nim |
00:18:59 | FromDiscord | <notchris> theres no UI library |
00:19:01 | FromDiscord | <notchris> that works 100% |
00:19:02 | FromDiscord | <notchris> BUT |
00:19:07 | FromDiscord | <notchris> we can make cool command line apps |
00:19:08 | FromDiscord | <dom96> Hmmm, maybe I should just redirect nim-lang.org to stardust.dev π |
00:19:26 | FromDiscord | <notchris> π |
00:19:33 | FromDiscord | <nikki> not having a ui library but still having gfx makes it more gamey than websitey/appey even |
00:19:33 | FromDiscord | <dom96> On a scale of 1-10 how mad you think Araq would be? |
00:19:42 | FromDiscord | <nikki> would he notice |
00:19:47 | FromDiscord | <dom96> hah |
00:19:48 | FromDiscord | <ElegantBeef> I dont really like the expressive part of the front page, but eh |
00:20:09 | FromDiscord | <ElegantBeef> It's just, doesnt really explain anything |
00:20:20 | FromDiscord | <notchris> And the footer text isn't centered |
00:20:24 | FromDiscord | <nikki> how about -- make the homepage vscode's editor (monaco) and when you land you're editing a new webapp and previewing it |
00:20:29 | FromDiscord | <notchris> if you dont center your footer |
00:20:31 | FromDiscord | <ElegantBeef> Most languages are self hosted grats |
00:20:33 | FromDiscord | <ElegantBeef> Lol nikki |
00:20:36 | FromDiscord | <notchris> are you going to center your code |
00:21:32 | FromDiscord | <ElegantBeef> I very much think "Extensible" fits more for what that category is trying to suggest |
00:22:58 | FromDiscord | <nikki> extensible is cool, but also can be like worrying to a lot of folks in a language space (not saying the train of thought has merit in nim's case) |
00:23:31 | FromDiscord | <nikki> wonder how to basically say extensible but also that it's used judiciously / also isn't super hard |
00:23:43 | FromDiscord | <nikki> zed shaw's series of tweets being positive about nim was pretty good |
00:23:48 | FromDiscord | <nikki> maybe could get ideas from that |
00:24:28 | FromDiscord | <notchris> @nikki done |
00:24:29 | FromDiscord | <notchris> https://jsfiddle.net/notchris/ap4g5mjh/11/ |
00:24:41 | jonjitsu[m] | why are some constructors initXxxx and some newXxxx? |
00:25:40 | FromDiscord | <nikki> we need a nimfiddle that's as good / better |
00:25:58 | FromDiscord | <dom96> really surprised by Zed's sudden uptake of Nim |
00:28:31 | FromDiscord | <ElegantBeef> new is for reference types, init is for non references |
00:28:58 | FromDiscord | <ElegantBeef> It's purely to indicate that it's a `ref object` or just `object` |
00:30:17 | jonjitsu[m] | would the new objects be created on the heap and the init ones on the stack? |
00:30:25 | FromDiscord | <ElegantBeef> that's the indication |
00:31:47 | * | rockcavera quit (Remote host closed the connection) |
00:32:14 | * | rockcavera joined #nim |
00:36:56 | federico3 | dom96: Zed? |
00:37:20 | mipri | https://twitter.com/zedshaw |
00:55:10 | * | krux02 quit (Remote host closed the connection) |
01:05:25 | * | Tanger joined #nim |
01:06:15 | FromDiscord | <Rika> good morning yall |
01:06:20 | * | xet7 quit (Remote host closed the connection) |
01:06:48 | FromDiscord | <Rika> :ThonkDumb: no one has said anything for the past 30 minutes |
01:08:43 | * | xet7 joined #nim |
01:09:54 | FromDiscord | <ElegantBeef> Lies you just did |
01:11:12 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
01:12:09 | FromDiscord | <Rebel> oh oh oh I am a bit late about the conversation about making the welcoming Nim page easier to read one of the suggestions would be for better wording or an explanation? On the homepage one point in the Efficient section is `Support for various backends: it compiles to C, C++ or JavaScript so that Nim can be used for all backend and frontend needs.` Saying it compiles to a language is a bit weird imo, you compile a language into a binary/li |
01:12:16 | FromDiscord | <Rika> other than me, damn it |
01:12:43 | FromDiscord | <Rika> sent a long message, see http://ix.io/2ExC |
01:13:15 | FromDiscord | <Rika> oops, i forgot to not use quote in discord |
01:13:24 | FromDiscord | <Rika> what i said was "binaries are just files with a different language" |
01:13:42 | FromDiscord | <Rebel> I don't know about that one chief |
01:14:24 | FromDiscord | <Rika> the big difference is that nim compiles to a language that we can read a bit easier than normal |
01:14:44 | FromDiscord | <Rika> ~~then it compiles again to a binary~~ |
01:15:47 | mipri | it's important information, with both positive and negative implications, and it might be good to get it out of the way for anyone who's spooked by it. |
01:16:24 | FromDiscord | <Rika> most people put off the language just because of this though without trying it |
01:16:52 | FromDiscord | <Rika> just because of "weird" features like the style insensitivity, the compilation to c, and whatever |
01:17:14 | mipri | I'd put money on many more people being spooked by style insensitivity than by transpilation. |
01:17:21 | FromDiscord | <Rebel> generation of C code that is then linked π |
01:17:40 | FromDiscord | <Rebel> well the object files are linked |
01:17:55 | FromDiscord | <Rika> i dont acknowledge the word "transpilation" existing xd |
01:18:24 | federico3 | someone said the t- word |
01:18:46 | FromDiscord | <Rika> reset the "days without transpilation mention" count |
01:19:49 | mipri | yeah, people who are spooked by it aren't going to be persuaded by your rejection of the term. |
01:20:00 | FromDiscord | <nikki> i think transpilation if it had any merit would stand for compilation across languages with mostly similar concepts / low-levelness |
01:21:06 | FromDiscord | <Rika> mipri i'm just joking around man ya too serious |
01:25:27 | * | Quibono joined #nim |
01:25:33 | mipri | meanwhile: https://web.archive.org/web/19990203181248/http://www.python.org/ |
01:26:01 | Quibono | How do you do an echo where it updates on the same line? i'm trying to do a status bar type thing in the command prompt. |
01:26:23 | FromDiscord | <ElegantBeef> You can use stdout.write instead of echo if you so wanted |
01:28:15 | mipri | for status bars printing with \r is usually enough, but take a look at man console_codes on Linux |
01:30:01 | Quibono | mipri what would that look like in terms of an echo command? |
01:30:33 | mipri | you wouldn't use echo because it includes a newline, wihch you don't want |
01:30:56 | Quibono | Okay, but when I do stdout.write it just waits and then dumps a whole ton of them. |
01:31:06 | mipri | but the string is just "\ryour new status", provided the new status is at least as long as the last one |
01:31:27 | mipri | right, gotta flush it as well |
01:31:33 | FromDiscord | <Rika> you need to have a carriage return (\r or \c) |
01:32:26 | mipri | stdout.write "hi\rthere"; stdout.flushFile |
01:32:41 | mipri | run that, you'll see just 'there' without a trailing newline |
01:33:03 | FromDiscord | <nikki> flush? |
01:33:14 | FromDiscord | <nikki> dang i scrolled up and didn't see the later msgs |
01:33:22 | Quibono | Cool, thank you. |
01:45:00 | * | Quibono quit (Remote host closed the connection) |
01:46:28 | FromDiscord | <Clownstick Von FuckFace> for parsing json with optional keys, what is the idiomatic way to do soemthing like `a = js{"key"} if key else pass`? i.e., only set the variable if the keys there? |
01:47:22 | FromDiscord | <ElegantBeef> you could make a template for it, but really it's just `if jsonNode.contains(key)` |
01:49:29 | FromGitter | <ynfle> What is pass? don't set a or it's null? |
01:51:01 | FromDiscord | <ElegantBeef> Whipped the template up to show if interested https://play.nim-lang.org/#ix=2ExK |
01:51:07 | FromDiscord | <nikki> you can use `.getStr("foo", "bar")` |
01:52:19 | FromDiscord | <nikki> it seems like they wanted to set a variable, not mutate a json node in an existing json structure? |
01:52:34 | FromDiscord | <ElegantBeef> I'm uncertain |
01:53:25 | FromDiscord | <ElegantBeef> @Clownstick Von FuckFace Did i misunderstand? |
01:54:47 | FromDiscord | <Rika> pass is python's discard |
01:56:58 | FromGitter | <ynfle> Right So I'm askind if a has that value of none after or it's a noop |
02:01:18 | FromDiscord | <Rika> a is not set |
02:02:07 | FromDiscord | <Rika> idk why you'd do this over `if key: a = js{"key"}` though but whatever |
02:03:39 | FromDiscord | <ElegantBeef> Yea i totally misread π |
02:07:31 | * | kotrcka joined #nim |
02:08:36 | FromDiscord | <iWonderAboutTuatara> Man, I haven't had time to write anything interesting in a good while |
02:08:47 | FromDiscord | <iWonderAboutTuatara> I'll start a rubik's cube solver, hopefully I finish |
02:25:23 | * | abm quit (Quit: Leaving) |
02:29:51 | * | astronavt quit (Quit: ...) |
02:30:58 | * | astronavt joined #nim |
02:33:11 | FromDiscord | <ElegantBeef> I havent wrote anything interesting ever, so good luck π |
02:34:53 | * | apahl quit (Ping timeout: 272 seconds) |
02:36:28 | * | apahl joined #nim |
02:41:43 | FromDiscord | <Rebel> How about a skyscraper puzzle solver π @iWonderAboutTuatara |
02:52:12 | * | mfiano quit (Ping timeout: 260 seconds) |
02:53:17 | * | mfiano joined #nim |
03:19:16 | FromGitter | <iffy> @leorize are you also alaviss? |
03:19:21 | disruptek | yep. |
03:22:58 | leorize[m]1 | @iffy yes |
03:24:14 | FromGitter | <iffy> @leorize: I'm interested in getting a community setup-nim working (hopefully one day to live in github.com/nim-lang). A version that meets some of the needs of nimble, at least. I see you're working on ng of yours. What's your plan? |
03:24:41 | FromGitter | <iffy> context: GitHub actions alaviss/setup-nim is what I mean :) |
03:27:29 | leorize[m]1 | I plan to make setup-nim download prebuilts from nightlies based on a given semantic version range, similar to actions/setup-node and friends |
03:29:17 | FromGitter | <iffy> So we'll specify the version as 1.4.x or 1.2.x, etc? Are installing specific commits in your plan? And how do you feel about dogfooding with choosenim? |
03:31:11 | leorize[m]1 | I don't plan for specific commit support. The current form of nightlies versioning is based on date and traversing the release history to pick a commit will run you against the API limit really fast |
03:32:39 | * | mbomba quit (Quit: WeeChat 3.0) |
03:33:45 | leorize[m]1 | re: choosenim, I will have to reevaluate it. One of the main reasons I didn't use choosenim was that we were unsure of choosenim reliability. |
03:34:36 | disruptek | i'm sure. |
03:35:06 | FromGitter | <iffy> It has become more reliable (on GitHub actions at least) since the latest release. I avoided it before then, too. (It used to fail for macOS) |
03:35:19 | * | Quibono joined #nim |
03:35:30 | Quibono | Is there a performance bonus to using an array over a seq? |
03:36:14 | leorize[m]1 | yes, arrays are stored on the stack, which avoids the mess that's heap allocation |
03:37:07 | leorize[m]1 | @iffy one of my main problem with choosenim is that it has too much code and aim for a very general use case |
03:37:17 | leorize[m]1 | CIs are simpler and can make do with less |
03:37:36 | FromGitter | <iffy> That's fair |
03:37:55 | leorize[m]1 | well at least that's my opinion until I wrote setup-nim :p |
03:38:01 | FromGitter | <iffy> hehehe |
03:38:18 | leorize[m]1 | nightlies are a pain to dig through and I might offload more logic to nightlies |
03:38:35 | leorize[m]1 | I want downloading from nightlies to be as simple as possible |
03:38:45 | disruptek | just put it into gitnim and then put gitnim into choosenim. |
03:38:58 | FromGitter | <iffy> I started with what you have in setup-nim and have arrived at this abomination: https://github.com/nim-lang/nimble/pull/871/files It supports all the ways you can install Nim. And honestly it's not *that* bad. |
03:38:58 | disbot | β₯ Simpler GitHub Actions CI |
03:39:13 | FromGitter | <iffy> okay, it doesn't support gitnim yet |
03:39:16 | FromGitter | <sealmove> @PMunch now I am thinking of writing a binaryparse backend for Kaitai Struct :D (they got one for construct already). β We can have extra logic external of binaryparse as plugin macros. I've already written one for conditions: https://github.com/sealmove/n4n6/blob/main/parsers/utils.nim |
03:39:23 | * | a_chou joined #nim |
03:40:43 | FromGitter | <iffy> Here are the possible install targets: https://github.com/nim-lang/nimble/blob/0375ebef2f48fa3def4df71d077ee432570b8b34/.github/workflows/ci.yml#L15 |
03:40:55 | * | Quibono quit (Remote host closed the connection) |
03:42:22 | * | muffindrake quit (Ping timeout: 260 seconds) |
03:44:17 | * | muffindrake joined #nim |
03:44:18 | FromGitter | <iffy> I don't actually think it's worth supporting all those install methods, but I do think being able to install a specific commit is valuable for some projects. |
03:45:24 | leorize[m]1 | so one of my main goals is to rely completely on nightlies prebuilts |
03:45:37 | leorize[m]1 | those compilers are guaranteed to be "built the right way" |
03:47:18 | FromGitter | <iffy> Does building from source sometimes build it the wrong way? |
03:47:23 | leorize[m]1 | this also means that specific commits are out of the question |
03:47:42 | leorize[m]1 | and tbh I think pinning the commit for the compiler is dumb for CI |
03:48:00 | leorize[m]1 | you don't really develop your software on a commit, you develop them on a release |
03:49:01 | FromGitter | <iffy> I agree on that point -- I wouldn't use the specific-commit build for any of my things. It's a request for nimble, though. They want to test against devel, but not the bleeding edge. They're content to increment the commit manually as needed. |
03:49:41 | leorize[m]1 | nah, but why duplicate the work when nightlies did it already? |
03:51:14 | leorize[m]1 | for the best reproducibility I'd recommend pinning a nightly build |
03:51:40 | leorize[m]1 | those builds are reproducible and when CI fails you know you can get the exact compiler used |
03:51:51 | FromGitter | <iffy> I think that would be an okay compromise for nimble (I'm guessing -- I don't know) |
03:52:43 | leorize[m]1 | setup-nim was built to replace the build-from-source pipeline I made for fusion |
03:52:51 | FromGitter | <iffy> There was also a request to use the official release of a particular version rather than the latest nightly. For instance the official 1.4.0 rather than the latest-1-4 |
03:53:16 | leorize[m]1 | I got official release working on my local copy |
03:54:05 | FromGitter | <iffy> even for macOS? |
03:54:20 | FromGitter | <iffy> I got official releases to work except for macOS (had to build from source there) |
03:54:46 | leorize[m]1 | sorta :p |
03:55:08 | leorize[m]1 | I cross reference with nightlies if a the official binary is not available |
03:56:58 | FromGitter | <iffy> :) Okay, so from a user's perspective (regardless of implementation) you'd change this https://gist.github.com/iffy/329256a067f090c678f2c1902420c83c to exclude the commit-style build. What about stable and devel? |
03:57:46 | leorize[m]1 | '^1.0.0' per semantic version range |
03:58:11 | FromGitter | <iffy> ah dang... I can never remember what all those symbols in package.json mean... |
03:58:41 | leorize[m]1 | and I will add a flag to consider prereleases as well :p |
03:58:42 | FromGitter | <iffy> oh, does `^1.0.0` mean stable? |
04:00:20 | leorize[m]1 | you can look here: https://semver.npmjs.com/ |
04:01:02 | leorize[m]1 | I'm exploring the direction of mimicking the official actions/setup-* |
04:01:43 | disruptek | how does it differ from nimph/cargo? |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:35 | * | supakeen joined #nim |
04:08:50 | * | kotrcka quit (Quit: Konversation terminated!) |
04:09:12 | FromGitter | <iffy> disruptek: I've almost tried nimph a few times, but I get scared away thinking I'll have to learn too many new things (and I just want to write code, not learn more package managing). Convince me that it's easy |
04:31:53 | * | rockcavera quit (Remote host closed the connection) |
04:42:33 | * | a_chou quit (Quit: a_chou) |
04:46:55 | * | a_chou joined #nim |
04:54:42 | * | lritter quit (Ping timeout: 260 seconds) |
04:55:15 | * | lritter joined #nim |
05:46:25 | * | thomasross quit (Ping timeout: 240 seconds) |
06:00:07 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:06:16 | * | a_chou quit (Quit: a_chou) |
06:26:37 | * | habamax joined #nim |
07:08:53 | * | narimiran joined #nim |
07:27:59 | * | lum quit (Ping timeout: 246 seconds) |
07:33:49 | * | lum joined #nim |
07:36:11 | ForumUpdaterBot | New thread by Lepot311: Win10 terminal game, see https://forum.nim-lang.org/t/7111 |
07:53:59 | FromGitter | <sealmove> @planetis hey, I just saw your PR for testify. Honestly I didn't expect anyone to have eyes on this little project (it's obvious from how sloppy it is). I'll take a look at the PR in the evening. Sorry for the delay. |
07:55:56 | * | PMunch joined #nim |
08:00:54 | * | jjido joined #nim |
08:02:06 | FromGitter | <sealmove> And thank you very much for the PR :> |
08:22:04 | lbart | we don't have a isClose (aproxEqual) in nim as dlang or python, isn't it? |
08:22:20 | lbart | I mean, in std library |
08:27:40 | FromDiscord | <flywind> It is introduced recently. |
08:28:05 | FromDiscord | <flywind> http://nim-lang.github.io/Nim/math.html#almostEqual%2CT%2CT%2CNatural |
08:29:15 | lbart | ah thanks! |
08:29:26 | FromDiscord | <flywind> no problem |
08:46:23 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
08:51:44 | * | Tanger quit (Remote host closed the connection) |
09:05:30 | planetis[m] | sealmove: thank you |
09:08:44 | FromDiscord | <Rebel> Any chance people some people already set up sweet github actions or travis builds for CI preferably with a linter or codeql or both π? |
09:18:02 | FromDiscord | <juan_carlos> https://github.com/juancarlospaco/nimpretty-action |
09:20:18 | * | jjido joined #nim |
09:22:01 | * | jjido quit (Client Quit) |
09:25:01 | disruptek | rebel: see leorize's dnsstamp project for ci reference. i use his stuff on most of my recent public work. |
09:28:30 | disruptek | iffy: if you like nimble, stick with it -- you won't like nimph. |
09:31:40 | disruptek | iffy: plus, i think dom truly likes your contributions, which is really saying something. |
09:32:54 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:34:31 | planetis[m] | sealmove: it's not bad at all, I mean, if you need something more future complete there is testament but for a simpler tool it's perfect |
09:38:07 | FromDiscord | <sealmove> Glad someone likes it |
10:01:17 | * | Tanger joined #nim |
10:18:58 | * | oculux quit (Read error: Connection reset by peer) |
10:20:31 | * | oculux joined #nim |
10:21:05 | * | krux02 joined #nim |
10:49:22 | * | vicfred quit (Quit: Leaving) |
10:56:48 | * | hmmmmm joined #nim |
10:57:02 | hmmmmm | hallo! |
11:00:12 | PMunch | Hi there |
11:02:40 | hmmmmm | munchie! |
11:07:00 | * | hmmmm joined #nim |
11:08:01 | * | hmmmmm quit (Ping timeout: 264 seconds) |
11:13:47 | FromDiscord | <iWonderAboutTuatara> @Rebel I've never heard of that puzzle, can you explain a bit? |
11:13:50 | FromDiscord | <iWonderAboutTuatara> Sounds interesting |
11:19:58 | FromDiscord | <Rebel> https://www.brainbashers.com/skyscrapershelp.asp |
11:24:49 | narimiran | if anybody is interested in testing 1.4.1 (soon to become 1.4.2), grab it from https://github.com/nim-lang/Nim/tree/version-1-4 |
11:31:05 | * | narimiran quit (Ping timeout: 240 seconds) |
11:38:17 | * | rockcavera joined #nim |
11:47:42 | hmmmm | heeey |
11:48:04 | FromDiscord | <lqdev> hi |
11:48:07 | hmmmm | I'd like to slap a very simple gui on my precious example of func |
11:48:11 | hmmmm | what can I use |
11:49:02 | FromDiscord | <lqdev> there's https://github.com/trustable-code/NiGui |
11:49:34 | hmmmm | looks good enough |
11:52:16 | hmmmm | it works! :o |
11:58:12 | * | Zevv quit (Quit: Lost terminal) |
11:59:54 | PMunch | Best feeling, when stuff just works |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:31 | * | supakeen joined #nim |
12:25:31 | bung | `[]` when compiler see this what's its kind called in , tyXX? |
12:26:05 | Zoom[m] | NiGui is really easy and I recommend it. Manual layout is a pain, though. I'd like it to have something like wnim's autolayout https://khchen.github.io/wNim/autolayout.html |
12:26:57 | PMunch | TyBracketExpr I think |
12:27:01 | PMunch | Or something like that |
12:27:28 | PMunch | Zoom[m], I was thinking of ripping the layout thing out of notifishower and create a package out of it |
12:27:59 | PMunch | But not sure how generaliseable it is.. |
12:28:16 | Zoom[m] | Any demo of what yours is capable? |
12:28:42 | PMunch | Sure: https://github.com/PMunch/notifishower |
12:28:42 | Zoom[m] | I saw only a bubble with 4 black lines for a moment |
12:28:48 | Zoom[m] | It was cool though |
12:28:50 | PMunch | Ah, that is the ninepatch stuff |
12:28:57 | PMunch | Not strictly related |
12:29:26 | bung | dont know , it may get into tyTypeDesc and final get tyRange ? |
12:29:36 | PMunch | Ah right.. |
12:30:02 | bung | Traceback dont show sigmatch file |
12:30:14 | Zoom[m] | Is anyone in the mood fo some code review? |
12:31:08 | * | waleee-cl joined #nim |
12:31:47 | PMunch | Zoom[m], here you can see me playing around with it a bit: https://www.youtube.com/watch?v=0Uzori2oZ3c |
12:31:53 | PMunch | The formatting language |
12:32:21 | PMunch | Oops, meant to share with a timestamp: https://youtu.be/0Uzori2oZ3c?t=9089 |
12:33:03 | Zoom[m] | If anyone feels like it, please, take a look at my Gale Shapley algo and say how I can make it better/more idiomatic: https://github.com/ZoomRmc/rosettacode_nim/blob/main/src/stable_marriage_gale_shapley.nim |
12:36:44 | * | luis_ joined #nim |
12:40:02 | PMunch | Just from a quick peek it doesn't have any glaring omissions |
12:48:08 | Zoom[m] | Good to hear. I'm sure someone will find something |
12:48:43 | Zoom[m] | By the way, Nim doesn't have dedicated seq init proc? Just use repeat? |
12:50:31 | FromGitter | <ynfle> newSeq, newSeqWith |
12:50:46 | FromGitter | <ynfle> check the sequtils module |
12:52:37 | Zoom[m] | I meant initializing with a value |
12:55:22 | PMunch | Like `let a = @[1, 2, 3]` ? |
12:58:00 | FromGitter | <ynfle> I found `newSeqWith` very useful |
13:00:27 | Zoom[m] | Like `repeat(X)` :) Right, newSeqWith is cool |
13:00:30 | Zoom[m] | Nice to see we have `mgetOrPut` for tables, weird name, though |
13:00:41 | * | hmmmm quit (Remote host closed the connection) |
13:01:01 | FromDiscord | <lqdev> mutable get or put |
13:03:13 | Zoom[m] | Of course, just not as clear as getMutOrInsert |
13:05:52 | * | luis_ quit (Ping timeout: 260 seconds) |
13:06:16 | PMunch | Hmm, that is actually a really good name |
13:07:11 | * | luis_ joined #nim |
13:17:33 | * | jjido joined #nim |
13:17:37 | Zoom[m] | It's also would be cool to have a distinct type for entry so you could chain methods and propagate empty entries through |
13:18:00 | * | hmmm joined #nim |
13:18:28 | PMunch | For entry? |
13:19:19 | Zoom[m] | Enum container for tables/maps |
13:39:10 | * | Zevv joined #nim |
13:39:18 | Zevv | Anyone here who knows how to tame .gcsafe. stuff? |
13:42:46 | Araq | {.cast(gcsafe).}: ... |
13:42:54 | Araq | it's pretty simple to tame |
13:46:53 | FromDiscord | <exelotl> is there a way to test 1.4.1 via choosenim? |
13:47:00 | PMunch | choosenim devel |
13:47:27 | FromDiscord | <exelotl> it said "Extracting nim-1.5.1-linux_x64.tar.xz" |
13:47:37 | PMunch | Ah wait |
13:47:48 | PMunch | choosenim version-1-4 might work |
13:47:54 | PMunch | Not entirely sure though |
13:48:18 | PMunch | You might have to clone the Nim repo, checkout that branch and then do `choosenim <path>` to where you have it |
13:50:24 | FromDiscord | <exelotl> ah I'll give that a try |
13:54:03 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
13:57:52 | FromDiscord | <haxscramper> What is the simplest nim GUI library? I want to write a small application to test my fuzzy string sorting - so it should only contain text input and list of strings. By simplest I mean "will take the least amount of time to get a crude prototype working - preferably has similar example" |
13:58:22 | PMunch | Platform? |
13:59:16 | FromDiscord | <haxscramper> linux |
13:59:41 | PMunch | Well Gtk with the genui macro is pretty simple |
14:04:51 | * | luis_ left #nim (#nim) |
14:05:39 | FromDiscord | <shad0w> is there a goto web framework for nim ? |
14:05:45 | Zevv | Araq: yeah, I know how it's used, but I have a bit of a corner case. NPeg can call back into used code, which can or can not properly handle gcsafe. If I .gcsafe. tag my way into NPeg, users will get warnings all the time, even wihtout --threads |
14:05:49 | FromDiscord | <shad0w> i found prologue |
14:06:14 | Zevv | because it is perfectly fine to access globals from parser code in a non-threaded setup |
14:06:24 | Zevv | so I'd like to make these pragmas conditional I think |
14:08:12 | FromDiscord | <lqdev> @shad0w karax? |
14:08:38 | FromDiscord | <shad0w> that's a frontend thing isnt it @lqdev ? |
14:08:44 | FromDiscord | <lqdev> ah yeah |
14:08:47 | FromDiscord | <lqdev> i meant jester |
14:08:55 | FromDiscord | <lqdev> gosh i always mix those two up |
14:08:56 | FromDiscord | <shad0w> what do you guys build apis with ? |
14:09:08 | FromDiscord | <lqdev> APIs as in web APIs, or� |
14:09:17 | FromDiscord | <shad0w> yea, webservers |
14:09:28 | FromDiscord | <lqdev> ~~sockets~~ |
14:09:37 | FromDiscord | <shad0w> never sockets |
14:09:41 | FromDiscord | <shad0w> i meant. |
14:09:45 | FromDiscord | <shad0w> open socket |
14:09:50 | FromDiscord | <shad0w> never sockets |
14:09:52 | FromDiscord | <shad0w> close socket |
14:09:54 | FromDiscord | <shad0w> ugh |
14:10:17 | FromDiscord | <lqdev> i haven't messed around too much with nim webdev yet but i'd just use jester tbh |
14:10:24 | FromDiscord | <lqdev> seems pretty simple to use |
14:10:49 | FromDiscord | <shad0w> prologue interests me cause we can use karax as an extension to it |
14:10:55 | FromDiscord | <shad0w> backend rendered html |
14:11:02 | FromDiscord | <shad0w> with eventhandlers |
14:11:03 | FromDiscord | <shad0w> win |
14:11:13 | FromDiscord | <lqdev> interesting |
14:11:34 | FromDiscord | <lqdev> honestly the most web i ever do is static pages so i can't give you many good backend ideas |
14:11:45 | FromDiscord | <shad0w> but wasn't sure if its what everyone uses |
14:12:11 | FromDiscord | <shad0w> that's alright. i just got an insight |
14:12:36 | * | hmmm quit (Ping timeout: 240 seconds) |
14:12:37 | FromDiscord | <shad0w> i should just look at nimble package downloads if i need to know about popular packages : P |
14:12:42 | FromDiscord | <shad0w> wooosh |
14:14:22 | PMunch | shad0w, I've been using Jester, but Prologue seems great and I'll try it out for my next web project |
14:15:28 | FromDiscord | <shad0w> PMunch: i just got done watching your nim everywhere talk video on youtube |
14:15:53 | PMunch | Oh cool, what did you think? |
14:16:02 | FromDiscord | <shad0w> it was pretty nice |
14:16:09 | FromDiscord | <shad0w> : ) |
14:16:35 | * | hmmm joined #nim |
14:16:40 | FromDiscord | <shad0w> make me look around if i could really use nim everywhere |
14:16:53 | FromDiscord | <shad0w> frontend, backend, small IOT devices |
14:17:05 | FromDiscord | <shad0w> maybe im reaching, but android / IOS apps ? |
14:17:40 | PMunch | I've made an Android game with it |
14:17:59 | FromDiscord | <shad0w> fo real ? |
14:18:00 | notchris | good morning friends |
14:18:06 | PMunch | Yup, pretty simple |
14:18:16 | FromDiscord | <shad0w> how does that even work ? |
14:18:23 | PMunch | What do you mean? |
14:18:38 | FromDiscord | <shad0w> nim -> java / kotlin ? |
14:18:40 | PMunch | In theory you should be able to wrap the native UI libraries as well, but I haven't tried it |
14:19:03 | PMunch | Ah, they use the NDK |
14:19:13 | notchris | There are a bunch of intermediate mode UIs, none of them are perfect but enough to get something built out |
14:19:18 | PMunch | https://developer.android.com/ndk |
14:19:28 | notchris | I feel like most people will manually build out some basic ui though |
14:20:04 | PMunch | Yeah those would be simple |
14:20:44 | notchris | PMunch: i saw a wrapper for dawrin the other day but im still pretty sure there is no way to access like AVFoundation or some core osx libs correctly |
14:20:51 | notchris | Oh sorry, didnt mean to ping you for that one |
14:20:56 | FromDiscord | <shad0w> do you write game logic in nim, compile to c, add it as a dependency in the native android app and build it with android studio ? |
14:21:18 | PMunch | No worries |
14:21:32 | PMunch | Well I built it from the command line |
14:21:53 | FromDiscord | <shad0w> and the UI ? |
14:21:58 | PMunch | SDL |
14:22:28 | PMunch | Basically SDL runs under the NDK and everything is handled in Nim |
14:22:38 | PMunch | There is just a thin Java wrapper to start the Nim stuff |
14:22:39 | notchris | the UI libs will generally have some kind of render they attach to, be it SDL or Opengl, it will generally either look for a surface or create their own window as a bass |
14:22:42 | notchris | basis* |
14:22:54 | FromDiscord | <shad0w> i'd really have to try this |
14:23:25 | FromDiscord | <shad0w> mind sharing a link to yours if it's on github or somewhere i can read the code ? |
14:24:14 | hmmm | munchie I think I have a small vscode problem |
14:24:32 | FromDiscord | <shad0w> notChris: that's alright i guess ? |
14:24:41 | PMunch | @shad0w, it was only as a test to check if it worked so it's not on GitHub |
14:25:25 | FromDiscord | <shad0w> i see |
14:25:29 | FromDiscord | <shad0w> i'll try hacking some |
14:25:32 | PMunch | It was built on this though: https://github.com/PMunch/nim-sdl-template |
14:36:04 | Zoom[m] | So what's happening in the Dali land? Any progress? |
14:38:11 | Zoom[m] | That announcement on forums I saw a long time ago was very promising |
14:42:27 | * | Vladar joined #nim |
14:45:32 | PMunch | Wasn't that just a PoC? |
14:53:35 | ForumUpdaterBot | New thread by AlectronikHQ: Question to tables & objects, see https://forum.nim-lang.org/t/7112 |
14:55:27 | FromDiscord | <exelotl> my game builds and runs just fine under 1.4.1β΅first class openarray support seems to be improved too! But still possible to get invalid codegen |
14:58:49 | hmmm | can I try something and leave except empty? |
14:59:07 | PMunch | It can't be empty |
14:59:13 | PMunch | But you can put a `discard` in it |
14:59:23 | hmmm | that's convenient |
14:59:25 | hmmm | ty |
14:59:57 | * | rockcavera quit (Remote host closed the connection) |
15:00:49 | PMunch | Hmm, my old SDL code gives me an out of memory error when I try to render some text.. |
15:01:53 | FromDiscord | <exelotl> ohh i didn't know `try: ... except IOError as e: ...` was valid |
15:02:17 | FromDiscord | <exelotl> that's nice, no need to call getCurrentException() |
15:03:28 | hmmm | I want to use a proc I found in an example but it has a red asterisk after the proc name, should I be worried? |
15:04:04 | FromDiscord | <exelotl> the asterisk is an export marker, it just means "public" |
15:04:11 | hmmm | oh |
15:04:13 | hmmm | thanks |
15:04:37 | FromDiscord | <exelotl> np |
15:05:21 | * | rockcavera joined #nim |
15:11:30 | FromDiscord | <notchris> im hoping to find a solution soon for accessing AVFoundation on osx via nim |
15:12:21 | * | hmmm quit () |
15:15:11 | FromDiscord | <dom96> Can we get this, but for Nim https://cxx.rs ? π |
15:19:39 | ForumUpdaterBot | New thread by JPLRouge: Trouble , name etc..., see https://forum.nim-lang.org/t/7113 |
15:20:31 | bung | https://github.com/nim-lang/Nim/issues/11684 |
15:20:32 | disbot | β₯ For loops over a hardcoded empty array crash the compiler. ; snippet at 12https://play.nim-lang.org/#ix=2mEp |
15:20:35 | * | PMunch quit (Quit: leaving) |
15:21:55 | bung | I try to fix this, the node reach there become HSlice[] |
15:23:02 | bung | am not sure raise constant message like cant infferd the type of array is fine |
15:23:28 | FromDiscord | <haxscramper> @dom96 I skimmed over documentation (will read it more thoroughly later on), but it seems quite close to hcparse. And in addition - because we can just generate C++ it should be even simpler. In theory. E.g. main problem in wrapping C++ is that nobody in the world knows what is considered 'API' part, and what should not be wrapped. After that it is mostly like writing macros - you get (quite ugly) AST and can do whatewher you want. |
15:23:40 | FromDiscord | <haxscramper> Or list of declarations in the C++ project |
15:25:12 | FromDiscord | <haxscramper> Though figuring it out "API" for C++ library is extremely annoying |
15:26:58 | Oddmonger | do you think it's wise to use web libs like threejs or babylonjs with nim ? |
15:27:41 | FromDiscord | <dom96> @haxscramper cool, now you just need a nice domain π |
15:30:23 | * | aaronm joined #nim |
15:31:43 | aaronm | Hey guys , how can I add assembly to a nim program? Learning about low level coding and C, so wondering if I can do the samething with nim |
15:32:52 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#statements-and-expressions-assembler-statement |
15:33:00 | FromDiscord | <exelotl> ^ |
15:33:33 | aaronm | Thank you |
15:37:20 | FromDiscord | <exelotl> you can also use the {.compile.} pragma to add an external asm file to the build, and then use the {.importc.} and {.extern.} pragmas to bring the symbols from that file into nim |
15:37:27 | FromDiscord | <exelotl> e.g. https://github.com/exelotl/natu/blob/master/examples/anim_sprite/main.nim#L25 |
15:44:53 | aaronm | ok cool thanks |
15:55:11 | FromGitter | <sealmove> what's the benefit of wrapping a whole module into a main() proc? |
15:56:10 | FromGitter | <sealmove> if it's a simple program for example (not library) |
15:57:50 | * | tiorock joined #nim |
15:57:50 | * | tiorock quit (Changing host) |
15:57:50 | * | tiorock joined #nim |
15:57:50 | * | rockcavera is now known as Guest81539 |
15:57:50 | * | Guest81539 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
15:57:50 | * | tiorock is now known as rockcavera |
16:08:33 | aaronm | nim main function is interesting in assembly |
16:14:20 | FromGitter | <sealmove> Is that all? |
16:21:10 | Zevv | disruptek: awake? |
16:21:15 | disruptek | sure. |
16:21:39 | disruptek | how are they hangin', zevv? |
16:22:01 | Zevv | just down below, as usual |
16:22:12 | disruptek | could be worse. |
16:22:16 | Zevv | true. |
16:22:24 | Zevv | how's life |
16:22:28 | Zevv | you down at the lake yet |
16:22:45 | disruptek | nope, there's still no electric, no well, no septic. |
16:22:51 | disruptek | fucking typical. |
16:22:59 | Zevv | start diggin' then |
16:23:22 | Zevv | what's that blocked on |
16:23:25 | disruptek | needs to start soon because the ground is gonna freeze. |
16:23:39 | Zevv | yeah that as well, damn |
16:23:51 | disruptek | the electric company put in a demarc and they managed to place it on the neighbor's property. |
16:23:59 | Zevv | happy neighbour |
16:24:02 | * | habamax quit (Ping timeout: 256 seconds) |
16:24:13 | disruptek | such a shit show. |
16:24:53 | disruptek | speaking of, if i don't get some glycol into my blackwater tank, it's gonna freeze and explode. |
16:25:07 | Zevv | you should find another country |
16:25:27 | disruptek | passport is useless right now. |
16:25:37 | disruptek | gonna hit 200k new cases in a single day soon. |
16:25:55 | Zevv | yeah pretty unreal how that all is going |
16:26:05 | disruptek | how does it smell where you are? |
16:26:19 | Zevv | fine, life is pretty normal for me actually |
16:26:27 | Zevv | kids just go to school, shops are open |
16:26:39 | disruptek | weird. |
16:26:45 | Zevv | i work from home, but I always do that |
16:26:45 | disruptek | masks? |
16:26:57 | Zevv | yeah sure |
16:27:26 | Zevv | https://aatishb.com/covidtrends/?location=Netherlands&location=US log-log-phase-space plot |
16:27:38 | * | natrys joined #nim |
16:27:45 | Zevv | cases vs new cases |
16:28:05 | disruptek | musk can't email me soon enough. |
16:28:39 | disruptek | i'm literally still waiting for dns. |
16:29:00 | disruptek | okay. |
16:29:04 | Zevv | dude. good thing there is irc |
16:29:10 | disruptek | over a minute. |
16:30:09 | disruptek | this graph does not look very good for you. |
16:30:18 | Zevv | wait until its done and look at the USA |
16:30:38 | disruptek | well, yeah, i'm intimately acquainted with the states. |
16:31:01 | Zevv | and how does that work for you |
16:31:08 | Zevv | lets talk Nim instead |
16:31:41 | supakeen | De Nimste. |
16:31:56 | Zevv | npeg code blocks can not be called from threads because the inner generated match fn is not marked gcsafe. If I do that, it works fine, but then everyone not doing threads gets warnings all the time when accessing stuff outside the code blocks. |
16:32:08 | Zevv | Can I make .gcsafe. conditional somehow |
16:32:21 | disruptek | conditional on threads? |
16:32:25 | disruptek | sure. |
16:32:57 | disruptek | there's a proc called, like, compileOptions. |
16:33:12 | disruptek | you run it like if compileOption("threads") or something. |
16:33:12 | Zevv | yeah but a pragma is there or it is not there |
16:33:20 | Zevv | I can't put a pragma inside an if or when, right |
16:33:34 | disruptek | when you generate your fn, you elect to include it or not. |
16:34:12 | Zevv | I can't see what that looks like |
16:34:39 | disruptek | no? |
16:35:19 | disruptek | when compileOption("threads"): addPragma ident"gcsafe" |
16:35:23 | disruptek | or whatever. |
16:35:41 | disruptek | it /is/ `compileOption("threads")` at least. |
16:35:49 | Zevv | https://github.com/zevv/npeg/blob/master/src/npeg/codegen.nim#L347 |
16:35:51 | Zevv | That one |
16:36:08 | Zevv | My problem is that I quote that shit of course |
16:36:20 | disruptek | you did a result = though. |
16:36:26 | disruptek | so just modify the result after that. |
16:37:07 | Zevv | hm fair point. But then there is still https://github.com/zevv/npeg/blob/master/src/npeg/codegen.nim#L37 so it's some more mess, but that'll be fine |
16:37:33 | disruptek | you know what's weird? |
16:37:39 | Zevv | life |
16:37:41 | disruptek | i couldn't make a when inside a type block work recently. |
16:38:03 | Zevv | hmm |
16:38:38 | disruptek | https://github.com/disruptek/frosty/blob/master/frosty.nim#L13 |
16:38:56 | disruptek | and by recent i mean a few months ago. |
16:39:26 | disruptek | like, i literally do it for the Serializer type but i couldn't do it for the ice type. |
16:39:33 | disruptek | bananas. |
16:40:31 | disruptek | or something. i actually forget the specifics. but it's nucking futs in any event. |
16:41:15 | disruptek | i think it was something like, the const wasn't "compile-time enough" and maybe because i made it a .booldefine. |
16:43:02 | * | jjido joined #nim |
16:46:26 | Zevv | but does it or does it not work in the end/ |
16:47:18 | disruptek | the code works as you see it but i wasn't able to simplify it. |
16:47:29 | Zevv | clyybber: why do you have a bird house as your git logo |
16:47:40 | Zevv | disruptek: that's nasty |
16:47:48 | FromDiscord | <Clyybber> lol @zevv |
16:47:57 | Zevv | it's a bird house for bees, actually |
16:47:58 | FromDiscord | <Clyybber> disruptek: booldefine used to be buggy |
16:48:09 | disruptek | until when? |
16:48:18 | FromDiscord | <Clyybber> it was supposed to be a turret :D |
16:48:59 | FromDiscord | <Clyybber> disruptek: https://github.com/nim-lang/Nim/issues/12880 |
16:49:01 | disbot | β₯ {.booldefine.} are not considered constants in type sections ; snippet at 12https://play.nim-lang.org/#ix=2EB4 |
16:49:11 | disruptek | wow, exactly this. |
16:49:16 | FromDiscord | <Clyybber> yep |
16:49:49 | disruptek | so it's not in 1.0 i guess. |
16:50:05 | disruptek | that must be my problem. |
16:51:44 | disruptek | thanks clyybber. |
16:51:54 | * | oculux quit (Ping timeout: 272 seconds) |
16:51:54 | disruptek | i guess you're not completely useless. |
16:52:31 | FromDiscord | <Recruit_main707> :disruptek: |
16:53:02 | Zevv | Recruit_main707: that's a solid 8 on a compliment scale of 1..10 |
16:53:53 | FromDiscord | <Recruit_main707> true |
16:54:16 | * | narimiran joined #nim |
16:57:28 | * | hnOsmium0001 joined #nim |
16:58:50 | disruptek | some day i need to find out what :disruptek: means. |
16:59:41 | disruptek | clyybber: i thought your avatar was a keyhole. |
16:59:54 | narimiran | it isn't? |
17:01:06 | FromDiscord | <Clyybber> its supposed to be something like https://media.discordapp.net/attachments/371759389889003532/778666097314365471/373.png |
17:01:22 | * | bung quit (Quit: Lost terminal) |
17:03:11 | FromDiscord | <Clyybber> but I kinda like the keyhole/birdhouse interpretation too :D |
17:03:13 | FromDiscord | <Recruit_main707> im gonna be honest i dont think you really got the essence of it |
17:03:30 | FromDiscord | <Clyybber> lol |
17:03:56 | * | PMunch joined #nim |
17:04:09 | supakeen | https://www.youtube.com/watch?v=J0NXY89WsxY why not one of these Clybber |
17:05:11 | FromDiscord | <Clyybber> I mean it looks a bit like that |
17:05:59 | FromDiscord | <Clyybber> both of these have inspired my 15 yo me |
17:07:01 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
17:07:07 | * | oculux joined #nim |
17:08:11 | FromDiscord | <Clyybber> if my phone wasn't broken I would take a picture of what its supposed to resemble |
17:10:26 | PMunch | Hmm, I'm considering a stream. But I'm not entirely sure what I'd do.. |
17:10:34 | * | Lord_Nightmare joined #nim |
17:10:51 | * | oculuxe joined #nim |
17:11:00 | PMunch | I mean notifishower is pretty much done.. |
17:11:27 | FromDiscord | <Clyybber> now work on notifihider |
17:11:49 | PMunch | `killall notifishower` |
17:11:54 | PMunch | Done! |
17:12:47 | FromDiscord | <Clyybber> ok what about notifipretender |
17:12:59 | FromDiscord | <Clyybber> sends you fake notifications to keep you distracted |
17:13:16 | * | oculux quit (Ping timeout: 240 seconds) |
17:13:17 | PMunch | That could easily be done with notifishower |
17:16:21 | FromDiscord | <Clyybber> does notifishower support filtering? |
17:20:02 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
17:20:34 | PMunch | What do you mean? |
17:31:36 | * | cgfuh joined #nim |
17:36:32 | * | hmmmmm joined #nim |
17:36:41 | FromDiscord | <Clyybber> only showing some notifications |
17:36:41 | hmmmmm | hoy! |
17:36:46 | FromDiscord | <Clyybber> and hiding others |
17:36:58 | FromDiscord | <Clyybber> hmmmm:sup |
17:37:13 | * | cgfuh quit (Quit: WeeChat 2.9) |
17:37:26 | * | cgfuh joined #nim |
17:37:35 | hmmmmm | I'm slowly upgrading from nimwit to nimblet |
17:37:38 | PMunch | @Clyybber, ah notifishower doesn't actually handle notifications, it only shows them |
17:37:49 | FromDiscord | <Clyybber> ah right, sorry |
17:38:04 | PMunch | For that you want notificatcher, which catches freedesktop notifications and can write them to a file or run a program |
17:38:27 | PMunch | So you would do any kind of filtering with a script in between notificatcher and notifishower |
18:02:47 | * | vicfred joined #nim |
18:03:19 | * | Vladar quit (Quit: Leaving) |
18:04:18 | * | jjido joined #nim |
18:13:38 | disruptek | leorize[m]1: setup-nim working great for me. couple ideas for improvements that would make it better: |
18:14:06 | disruptek | take the matrix from an env. parse the package name from the env. |
18:14:22 | disruptek | then i can use the same yaml in all my projects. |
18:15:08 | disruptek | more of a ci.yml patch than a setup-nim patch. |
18:15:25 | leorize[m]1 | that'd be an extension instead. I can call that `test-nim` maybe |
18:15:38 | leorize[m]1 | will look into that once I got the new test-nim sorted out |
18:15:43 | leorize[m]1 | setup-nim* |
18:17:58 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
18:19:14 | * | apahl quit (Ping timeout: 264 seconds) |
18:20:04 | * | apahl joined #nim |
18:21:33 | * | habamax joined #nim |
18:23:43 | FromDiscord | <Avatarfighter> what is setup-nim? |
18:26:11 | * | jjido joined #nim |
18:27:39 | leorize[m]1 | !repo alaviss/setup-nim |
18:27:39 | disbot | https://github.com/alaviss/setup-nim -- 9setup-nim: 11CI helpers to setup Nim using prebuilt nightlies 15 5β 0π΄ |
18:27:40 | * | Vladar joined #nim |
18:29:07 | * | opal quit (Remote host closed the connection) |
18:29:50 | * | opal joined #nim |
18:32:02 | * | NimBot joined #nim |
18:32:08 | disruptek | unbelievable. |
18:34:02 | disruptek | gram fails on devel because it cannot use the items iterator from the new packedsets. |
18:34:15 | PMunch | @brainpoxy, you can try to output `self.kind` and see what it is |
18:35:44 | PMunch | Not sure why Nim doesn't do this by default TBH |
18:36:13 | PMunch | It shows you the name of the type, and the name of the field, but not the value of it, which is the problem.. |
18:36:20 | FromDiscord | <Clyybber> theres a PR for that |
18:37:34 | disruptek | gah this is so weird. |
18:37:48 | PMunch | @Clyybber, ah there is? |
18:39:45 | FromDiscord | <Clyybber> https://github.com/nim-lang/Nim/pull/11955 |
18:39:48 | disbot | β₯ properly fix #10053 (more informative FieldError msg): report discriminant value + lineinfo; also improve for VM case ; snippet at 12https://play.nim-lang.org/#ix=2EBx |
18:40:11 | ForumUpdaterBot | New thread by AlectronikHQ: C library bindings generator, see https://forum.nim-lang.org/t/7115 |
18:42:45 | PMunch | @Clyybber, any idea why that hasn't been merged? |
18:46:09 | FromDiscord | <Clyybber> it doesn't seem finished/cleaned up |
18:46:12 | ForumUpdaterBot | New thread by AlectronikHQ: Sample compiler/interpreter (like kaleidoscope/llvm, monkey/go etc), see https://forum.nim-lang.org/t/7116 |
18:46:26 | disruptek | clyybber: |
18:46:29 | disruptek | !repo carnac |
18:46:30 | disbot | https://github.com/disruptek/carnac -- 9carnac: 11magical function memoization across runtimes 15 3β 0π΄ |
18:46:45 | FromDiscord | <Clyybber> oh is that the repro I should have looked at? |
18:46:51 | disruptek | yeah. |
18:47:16 | FromDiscord | <UNIcodeX> sent a code paste, see https://play.nim-lang.org/#ix=2EBz |
18:47:27 | FromDiscord | <Clyybber> disrutptek: sorry I'm still on/off on that untyped thing |
18:47:39 | disruptek | kk |
18:47:57 | FromDiscord | <Clyybber> currently not even doing something in code, just thinking about how it should work |
18:48:41 | disruptek | my big project is this tierra remake. i'm not writing any logic, just data structures. |
18:49:33 | FromDiscord | <Clyybber> whats tierra? |
18:49:43 | FromDiscord | <Clyybber> http://life.ou.edu/tierra/ this? |
18:49:57 | disruptek | yeah. |
18:50:30 | disruptek | i was really into it back in the day. |
18:54:29 | federico3 | Did anyone ever wrote a firefox extension in Nim? |
18:56:08 | * | tane joined #nim |
18:58:05 | disruptek | i saw an extension but i think it was for chrome. |
18:59:14 | * | thomasross joined #nim |
19:02:58 | * | hmmmmm quit (Remote host closed the connection) |
19:04:10 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
19:12:36 | * | PMunch quit (Quit: leaving) |
19:18:17 | * | MyMind quit (Read error: Connection reset by peer) |
19:18:54 | FromDiscord | <Clyybber> damn it looks really interesting |
19:19:04 | FromDiscord | <Clyybber> disruptek: Heh changed your avatar to transparent background? |
19:19:14 | FromDiscord | <Clyybber> confused me for a bit here too :D |
19:19:15 | disruptek | yeah, i had to shrink the dog. |
19:30:50 | * | hmmm joined #nim |
19:31:01 | hmmm | hallou |
19:37:03 | hmmm | can I call a proc before I define it? |
19:37:10 | disruptek | of course. |
19:37:27 | hmmm | Error: undeclared identifier: 'updateResult' |
19:37:30 | hmmm | hmm |
19:38:10 | hmmm | if I remember correctly the tutorial said I could |
19:41:25 | hmmm | hmm now I called it after the define and the program works |
19:41:30 | disruptek | weird. |
19:41:34 | hmmm | VERY! |
19:41:38 | Amun_Ra | I don't think you can |
19:42:26 | hmmm | maybe it was some weird lang I tried before nim |
19:43:23 | Amun_Ra | wasn't it in experimental? hmm |
19:44:57 | FromDiscord | <alehander42> ΡΠΈΡ, |
19:44:59 | FromDiscord | <alehander42> Araq |
19:45:09 | FromDiscord | <alehander42> i .. rebased and fixed the id stuff i think |
19:45:12 | FromDiscord | <alehander42> several days ago |
19:45:22 | FromDiscord | <alehander42> but i plan on just reverting to a working state for now |
19:45:32 | FromDiscord | <alehander42> sorry for delaying until now |
19:45:40 | FromDiscord | <alehander42> i also got .. some kind of cold |
19:45:52 | FromDiscord | <alehander42> so i am sick these days, but I'll see what I can do |
19:46:16 | FromDiscord | <alehander42> disruptek it's strange to think of code with ferver |
19:46:30 | disruptek | try being stoned all the time. |
19:46:37 | FromDiscord | <nikki> https://twitter.com/lzsthw/status/1329057683316629513?s=21 |
19:46:48 | FromDiscord | <nikki> zed continuing on the nim dive |
19:47:04 | FromDiscord | <alehander42> i am like |
19:47:08 | FromDiscord | <alehander42> dude |
19:48:09 | Amun_Ra | and I have no smell and taste since yesterday evening :) |
19:48:22 | ForumUpdaterBot | New thread by Stefan_Salewski: Optional var out proc parameters, see https://forum.nim-lang.org/t/7117 |
19:50:12 | disruptek | you're fucked. |
19:51:00 | FromDiscord | <alehander42> dude |
19:51:04 | FromDiscord | <alehander42> hospital today |
19:51:07 | FromDiscord | <alehander42> it's .. i mean |
19:51:17 | FromDiscord | <alehander42> super hard situation |
19:51:23 | FromDiscord | <alehander42> there is like one-two main doctors |
19:51:31 | hmmm | it's 0..10 |
19:51:32 | FromDiscord | <Zachary Carter> you don't have covid do you? |
19:51:33 | FromDiscord | <alehander42> running like 4-5 store hospital and emergency |
19:51:39 | * | habamax quit (Ping timeout: 260 seconds) |
19:51:41 | FromDiscord | <alehander42> well .. my gp said it's probably covid |
19:51:46 | FromDiscord | <Zachary Carter> damnnnnnn |
19:51:47 | FromDiscord | <alehander42> the doctor said "whatever dude dont worry" |
19:51:53 | FromDiscord | <alehander42> they are like war zone |
19:52:00 | FromDiscord | <alehander42> if you can breathe well, you're ok there |
19:52:06 | FromDiscord | <Zachary Carter> I think I already had covid but I'm not sure |
19:52:17 | FromDiscord | <alehander42> it might be just a cold |
19:52:22 | FromDiscord | <alehander42> i have fever and tiredness |
19:52:34 | FromDiscord | <Zachary Carter> yeah could also be influenza |
19:52:43 | FromDiscord | <alehander42> yeah, so i'll wait several days |
19:52:51 | FromDiscord | <alehander42> it's not good to test early ? iirc |
19:53:02 | FromDiscord | <alehander42> but i mean |
19:53:05 | FromDiscord | <alehander42> waiting there |
19:53:18 | Amun_Ra | nah, if I call a doctor I'd be officially sent home, exactly where I am |
19:54:21 | FromDiscord | <alehander42> there were old people young people despair happiness a guy that wanted to vendetta the main doctor and got his name and city (from the main doctor himself who was like meh) |
19:54:30 | FromDiscord | <alehander42> and a guy that had bigger beard than me |
19:54:36 | FromDiscord | <alehander42> and wants to become a monk |
19:55:52 | FromDiscord | <Zachary Carter> sounds like quite the party |
19:56:27 | FromDiscord | <Zachary Carter> that Zed guy basically just hates all statically typed language and loves dynamic languages |
19:57:26 | Amun_Ra | Zed Shaw? |
20:04:29 | FromDiscord | <nikki> i've put off getting a flu shot -- should probs do that soon π |
20:04:57 | FromDiscord | <nikki> @Zachary Carter yeah. sounds like he's kinda getting into nim tho. he wrote some popular python books i believe (never actually read 'em myself) |
20:05:37 | FromDiscord | <Zachary Carter> yeah - I just remember reading his rant about Nim suggest's error messages |
20:05:55 | FromDiscord | <Zachary Carter> but it'd be cool to have more books written about Nim |
20:07:02 | FromDiscord | <nikki> @Zachary Carter i think the rant was about the error messages being unhelpful, not about the fact that there were errors, the way i interpreted it π€ |
20:07:18 | FromDiscord | <nikki> but yeah in this case he seems to say-- the type system is helping with async stuff |
20:08:57 | FromDiscord | <alehander42> show him metaprogramming and JsObject imho |
20:09:03 | FromDiscord | <alehander42> you can kinda get gradual |
20:12:32 | * | xet7 quit (Quit: Leaving) |
20:14:11 | * | xet7 joined #nim |
20:25:35 | FromDiscord | <Zachary Carter> yeah I believe that's their name |
20:25:50 | FromDiscord | <Zachary Carter> @nikki - yeah sorry that's what I meant |
20:26:00 | FromDiscord | <Zachary Carter> but I'm glad he's now finding the static typing beneficial (because it always is) |
20:26:32 | FromDiscord | <Zachary Carter> So many deploys at my company have needed hotfixes recently because we have no static type checking |
20:26:45 | FromDiscord | <Zachary Carter> and people do bad things and don't catch them until they're deployed |
20:28:48 | disruptek | i basically do bad things all day long. |
20:28:57 | disruptek | that's kinda "my thing." |
20:29:59 | disruptek | sasha i would pray for you but with my faith, it would probably hurt more than it helps. |
20:30:05 | Araq | disruptek, I'm ready for your wild things |
20:30:08 | disruptek | clyybber: you wanna work on my tierra clone with me? |
20:30:13 | disruptek | my what? |
20:30:59 | FromDiscord | <Zachary Carter> what's a tierra clone? |
20:31:03 | disruptek | oh lemme go get my mic from home. gimme a few mins. |
20:31:17 | FromDiscord | <Zachary Carter> do you mean terraria? |
20:33:12 | disruptek | yeah because what the world needs is another crafting game. |
20:34:50 | disruptek | google tom ray tierra. |
20:37:12 | disruptek | my wild things make araq's heart sing. |
20:37:12 | FromDiscord | <shadow.> is there an operator to concat an object to a seq |
20:37:19 | disruptek | they make everything... groovy. |
20:37:19 | FromDiscord | <shadow.> similar to & with two seq's |
20:37:45 | disruptek | that doesn't make any sense. |
20:38:18 | FromDiscord | <shadow.> wdym lmao |
20:38:34 | FromDiscord | <shadow.> ah wait |
20:38:36 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2ECb |
20:38:43 | FromDiscord | <shadow.> brilliant |
20:38:44 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2ECc |
20:40:10 | Araq | disruptek, well? |
20:40:17 | Araq | mumble or not? |
20:40:40 | disruptek | yeah. |
20:40:58 | * | FromDiscord quit (Remote host closed the connection) |
20:41:13 | * | FromDiscord joined #nim |
20:45:51 | FromDiscord | <Rebel> @shadow. yourseq.add(yourobject) ? |
20:46:32 | FromDiscord | <shadow.> oo |
20:46:33 | FromDiscord | <shadow.> ty |
20:46:39 | FromDiscord | <shadow.> wait no |
20:46:42 | FromDiscord | <shadow.> doesnt that modify in place? |
20:46:47 | FromDiscord | <shadow.> yeah |
20:47:05 | FromDiscord | <shadow.> i think i can just concat with a temporary seq of 1 lol |
20:52:23 | FromDiscord | <nikki> why not modify in place |
20:57:49 | FromDiscord | <tinygiant> A quick search of the nimble directory didn't reveal much, anyone know if there's a webhook listener in nim (specifically, for github)? |
21:02:01 | Zoom[m] | @shadow. that's wasteful, you probably want to grow the first one with add, if your bigger one is immutable, copy it and grow the copy |
21:02:26 | FromDiscord | <lqdev> the heck https://media.discordapp.net/attachments/371759389889003532/778726833255874681/unknown.png |
21:02:34 | FromDiscord | <lqdev> nim just quits |
21:03:52 | Zoom[m] | But the question I had in the similar situation: if the seq A is used the last time in `var seqB = seqA; seqB.add() ...` does Nim move the seqA under the hood? |
21:08:16 | * | narimiran quit (Ping timeout: 240 seconds) |
21:09:57 | * | hmmm quit () |
21:10:06 | Zoom[m] | I mean, does it track where to shallow copy seqs? |
21:17:07 | Zoom[m] | I understand that's two different questions, though |
21:18:13 | planetis[m] | @Zoom that video answers your question https://www.youtube.com/watch?v=aUJcYTnPWCg |
21:18:22 | planetis[m] | better than i can |
21:19:13 | Zoom[m] | The fact that I've watched it already and still have those questions says a lot about me |
21:20:05 | planetis[m] | ok so it depends wether you use seqA afterwards or not |
21:20:44 | Zoom[m] | That's why I mentioned "last time" |
21:20:57 | FromDiscord | <nikki> it's supposed to move it under the hood |
21:21:05 | FromDiscord | <nikki> if you don't use it after |
21:21:28 | Zoom[m] | I was hoping that :) |
21:23:07 | FromDiscord | <nikki> Zoom: put your example in a proc, then run with --expandArc:nameOfThatProc |
21:23:18 | FromDiscord | <nikki> it'll show you what arc does |
21:23:34 | Zoom[m] | Oh, that's useful, thanks |
21:25:13 | Zoom[m] | @nikki, could you glance over my Gale Shapley implementation and say what you think? |
21:25:22 | FromDiscord | <nikki> https://play.nim-lang.org/#ix=2ECl |
21:25:33 | FromDiscord | <nikki> Zoom: ^ the example you asked about, with expandArc output below |
21:25:45 | FromDiscord | <nikki> personally i just look at the C output |
21:26:23 | Zoom[m] | Is it better to -d:release to look at it? |
21:26:52 | FromDiscord | <nikki> idk, try it both ways and see? π |
21:27:02 | FromDiscord | <nikki> i always use -d:danger bc. yolo |
21:27:35 | FromDiscord | <nikki> oh sorry i thought you meant expandArc |
21:27:54 | FromDiscord | <nikki> for C output yeah -- i've found that -d:danger is the nicest, but also if you wanna know what nim is adding in release or debug then you can check under those |
21:28:35 | FromDiscord | <nikki> --exceptions:goto also helps (tho it leads to some codegen errors in c++ mode looks like). and --panics:on |
21:28:44 | FromDiscord | <nikki> also yeah i can look at your algo code (may not look right away tho) |
21:29:29 | Zoom[m] | https://github.com/ZoomRmc/rosettacode_nim/blob/main/src/stable_marriage_gale_shapley.nim |
21:30:31 | Zoom[m] | Please, don't check the algo itself, that would be too much |
21:30:35 | FromDiscord | <nikki> haha i see you used my suggested randPairs |
21:31:15 | FromDiscord | <nikki> should i be looking at anything in particular here? |
21:31:37 | Zoom[m] | General style and cq, I suppose |
21:31:44 | FromGitter | <ynfle> Don't use python_case use nimCase |
21:32:15 | Zoom[m] | That's probably the biggest chunk of pure Nim from me |
21:32:33 | FromDiscord | <nikki> so just style feedback? |
21:32:36 | FromGitter | <ynfle> https://nim-lang.org/docs/nep1.html |
21:32:51 | FromDiscord | <nikki> i think nim one tends to not do `I_AM_LOUD` for constants |
21:32:56 | FromDiscord | <nikki> and just do `iAmNormal |
21:32:57 | FromDiscord | <nikki> (edit) "`iAmNormal" => "`iAmNormal`" |
21:33:09 | FromGitter | <ynfle> π |
21:33:27 | FromGitter | <ynfle> @Zoom, checkout the style guide in nep1 |
21:33:41 | FromDiscord | <nikki> lines 1-29 could be formatted better, probably |
21:33:58 | FromDiscord | <nikki> like 3 doesn't have a line break and 4 does, for the same column |
21:34:02 | Zoom[m] | Eh, not exactly style, I know this is not what official style guide suggest, I'm more interested in idiomatic usage of the lang |
21:34:31 | Zoom[m] | It's been run through nimpretty |
21:34:36 | FromDiscord | <nikki> seems fine, nothing stands out |
21:34:47 | FromDiscord | <nikki> well, it still doesn't look as pretty as it could π |
21:34:58 | planetis[m] | i would use flat seq[int] because that's wasteful π |
21:34:58 | FromDiscord | <nikki> nimpretty often needs your help |
21:35:41 | Zoom[m] | Ok, that's good. Peter said so too. Style is easy to fix. |
21:36:24 | Zoom[m] | planetis: where? |
21:36:32 | planetis[m] | but you already know the length so why not use array instead of seq? |
21:37:04 | planetis[m] | newSeq[int](PAIRS) |
21:37:26 | planetis[m] | line 41 |
21:37:34 | planetis[m] | and in general |
21:38:27 | FromDiscord | <Zachary Carter> for constants I do - `IAmNormal` similar to types |
21:38:40 | FromDiscord | <Zachary Carter> but I'm not sure what the actual convention is |
21:38:49 | planetis[m] | no you don't now the size im wrong |
21:39:02 | FromGitter | <ynfle> @Zachary Carter, check out https://nim-lang.org/docs/nep1.html |
21:39:10 | Zoom[m] | Ah, right, thanks planetis |
21:40:19 | planetis[m] | style nitpick dont USE ALL UPPERCASE |
21:40:45 | planetis[m] | WHY DOES YOUR CODE SCREAMS AT ME |
21:41:16 | FromDiscord | <For Your Health> Is it idiomatic to always use an initFoo or newFoo function instead of directly instantiating an object? |
21:41:56 | planetis[m] | u mean object contructor syntax `Foo(x: 2)` |
21:42:16 | FromDiscord | <For Your Health> Yeah, is it frowned upon to do that? |
21:42:31 | planetis[m] | not at all |
21:42:47 | planetis[m] | maybe even prefered |
21:43:15 | FromDiscord | <haxscramper> It is preferable to have constructor proc like `init` and `new` for maintenance reasons, but nothing wropng with `Foo(x: 2)`. If you use object only handlful of times |
21:43:30 | FromDiscord | <haxscramper> Why bother creating separate proc |
21:44:15 | FromDiscord | <haxscramper> And you can throw in `{.requiresinit.}` for debugging, so it is even less of an issue. For uninitialized fields |
21:45:33 | FromDiscord | <For Your Health> The thing that is tripping me up is when you want default values that are different from the default values of the type. The way to do that seems to be to make an init function, which can lead to a lot of boilerplate |
21:46:29 | FromDiscord | <For Your Health> sent a code paste, see https://play.nim-lang.org/#ix=2ECt |
21:46:35 | FromDiscord | <For Your Health> member is being written 4 times |
21:47:26 | FromDiscord | <Rika> There are rfcs for that I think |
21:48:09 | FromDiscord | <For Your Health> rfcs? |
21:48:29 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ECu |
21:48:42 | FromDiscord | <haxscramper> Where `makeNode` is a constructor with all important things set up |
21:48:46 | FromDiscord | <Rika> Request for comment, basically proposals |
21:49:00 | * | luis_ joined #nim |
21:49:05 | FromDiscord | <haxscramper> @For Your Health https://github.com/nim-lang/RFCs/issues/252 |
21:49:06 | disbot | β₯ User-defined implicit initialization hooks ; snippet at 12https://play.nim-lang.org/#ix=2xc2 |
21:50:02 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ECv |
21:50:13 | FromDiscord | <haxscramper> Easily initialized upon construction |
21:50:37 | * | mbomba joined #nim |
21:50:58 | * | mbomba quit (Client Quit) |
21:51:45 | FromDiscord | <For Your Health> Oh, yeah I've seen that this seems to be a contested issue on the github. |
21:52:07 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ECx |
21:52:17 | * | mbomba joined #nim |
21:52:47 | FromDiscord | <haxscramper> @For Your Health It was accepted in limited form |
21:52:48 | FromDiscord | <For Your Health> @haxscramper I figured there would be some way to alleviate the issue with a template or something, but then all of your code becomes dependent on that template right? |
21:53:15 | FromDiscord | <haxscramper> Well, yeah, but considering how much does it simplify a lot of things |
21:54:04 | FromDiscord | <haxscramper> I wouldn't be an exaggeration to say this is one of the best pieces of code I've ever written in terms of time spent/usability. I just use it absolutely everywhere now |
21:54:28 | FromDiscord | <haxscramper> It also doubles are rust field update syntax |
21:54:42 | FromDiscord | <haxscramper> And for DSL-like things with shell (see above) |
21:55:11 | FromDiscord | <haxscramper> Maybe I should PR it in `std/sugar` actually, it's literally 5 line implementation |
21:55:27 | FromDiscord | <For Your Health> sent a code paste, see https://play.nim-lang.org/#ix=2ECy |
21:55:33 | FromDiscord | <For Your Health> So how does that replace initThing |
21:55:46 | FromDiscord | <For Your Health> I have trouble with templates because I'm new |
21:55:57 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ECz |
21:56:40 | FromDiscord | <haxscramper> But this is good for fields that you might want to initializ manually, but they have adequate default values otherwise |
21:57:41 | FromDiscord | <haxscramper> E.g. it is not a replacement for default initialization. It is just a intermediate solution - you have `initT` proc that sets up all fragile values, and then you tweak created object however you like for all other fields. |
21:58:35 | FromDiscord | <haxscramper> So if you have a lot of fields that require some non-standard default values (e.g. zero-filled memory doesn't cut it) then you still have to implement everything. |
21:58:39 | planetis[m] | i prefer this one https://github.com/nim-lang/Nim/pull/12378 |
21:58:40 | disbot | β₯ Default fields for objects |
21:59:42 | FromDiscord | <haxscramper> planetis: it is almost the same as RFC/252 no? |
21:59:55 | * | natrys quit (Ping timeout: 246 seconds) |
22:00:40 | planetis[m] | ...no? |
22:01:10 | planetis[m] | its https://github.com/nim-lang/RFCs/issues/126 |
22:01:12 | disbot | β₯ Support default values for object properties ; snippet at 12https://play.nim-lang.org/#ix=2ECC |
22:01:15 | FromDiscord | <For Your Health> @haxscramper I see. That is pretty cool. What is `it` supposed to mean? Is that abbreviating something? |
22:03:08 | FromGitter | <ynfle> It's commonly used as a filler for a variable |
22:03:15 | FromDiscord | <haxscramper> `it` is an injected variable inside of template body. It is not magical (like result), you can see it in the `var it {.inject.} = val` part of template, but almost all templates in sequtils use this naming convention. |
22:03:30 | FromDiscord | <haxscramper> Like `mapIt`, `filterIt`, `sortedByIt` and so on |
22:03:48 | FromDiscord | <Rebel> `requirements.txt` in python == `X` in Nim? |
22:04:12 | FromDiscord | <haxscramper> `requires "nim >= 1.4.0", "sorta", "cligen"` in `.nimble` file |
22:04:35 | FromDiscord | <For Your Health> Ok I see. |
22:04:45 | FromDiscord | <For Your Health> sent a code paste, see https://play.nim-lang.org/#ix=2ECD |
22:05:01 | FromDiscord | <For Your Health> Is there some reason why something like this is a bad idea? |
22:05:01 | FromDiscord | <haxscramper> @Rebel https://github.com/nim-lang/nimble#creating-packages |
22:05:56 | FromDiscord | <haxscramper> @For Your Health Aside from style nitpicking - no. This is not implemented though, but `RFC/252` actually has the same syntax |
22:06:02 | FromDiscord | <Rebel> well it also accept a github url if the nimble package is not in the main package list? |
22:06:44 | FromDiscord | <haxscramper> Yes, see example I linked - `requires "https://github.com/user/pkg#5a54b5e"` should work |
22:08:05 | FromDiscord | <For Your Health> sent a code paste, see https://play.nim-lang.org/#ix=2ECF |
22:09:08 | FromDiscord | <For Your Health> So that way all of the code that interfaces with the type is idiomatic and not dependent on the macro |
22:09:18 | FromDiscord | <For Your Health> And only the definition is |
22:09:31 | FromDiscord | <haxscramper> Yes, but I ultimately decided it is easier to just write `init` here and there instead of maintaining macro like this |
22:10:17 | FromDiscord | <haxscramper> But parsing nim object AST is not a fun thing to do, due to lots of edge cases etc. |
22:10:34 | disruptek | rude. |
22:10:47 | FromDiscord | <For Your Health> Is a macro like I am describing really complicated? I know very little about macros |
22:11:45 | FromDiscord | <ElegantBeef> !repo constructor |
22:11:46 | disbot | https://github.com/beef331/constructor -- 9constructor: 11Nim macros to aid in object construction including event programming, and constructors. 15 3β 0π΄ 7& 2 more... |
22:11:47 | FromDiscord | <ElegantBeef> @For Your Health |
22:12:30 | FromDiscord | <For Your Health> Thanks for the link. I'll take a look |
22:12:45 | FromDiscord | <ElegantBeef> It's not exactly like your idea, but the current macro system doesnt really allow what you have |
22:12:47 | * | natrys joined #nim |
22:13:17 | FromDiscord | <For Your Health> Really? I assumed it would have been capable of something like I am describing. |
22:13:44 | FromDiscord | <haxscramper> It is capable |
22:14:24 | FromDiscord | <haxscramper> And I've written this, but it is not really fun to use/maintain - https://github.com/haxscramper/nimtraits |
22:14:48 | * | natrys quit (Client Quit) |
22:14:56 | FromDiscord | <ElegantBeef> It is, it'd just be a bit difficult to make |
22:15:06 | FromDiscord | <haxscramper> Well, not init, but if I have full structure of an object (which I do) it is just a matter of implementing things |
22:15:07 | FromDiscord | <For Your Health> That looks like full blown rust traits though |
22:15:12 | FromDiscord | <haxscramper> it is |
22:15:19 | FromDiscord | <ElegantBeef> Mine is just constructors |
22:16:08 | FromDiscord | <For Your Health> Does my idea require a rust trait like system? Perhaps I'm missing something |
22:16:13 | FromDiscord | <haxscramper> It was proof-of-concept for how much things you can compress into object annotation pragmas. I can automatically declare hashing, field validation, equality (for case objects too) and provide API for implementing custom traits. |
22:16:21 | planetis[m] | that's pretty impressive @haxscramper |
22:16:26 | FromDiscord | <haxscramper> But I've never actually used it, because it was not necessary |
22:16:45 | FromDiscord | <haxscramper> E.g. there is too much magic going on with the code |
22:17:04 | FromDiscord | <haxscramper> And in the end I decided that `type` section is off-limit for macros, just for sanity reasons |
22:18:02 | FromDiscord | <For Your Health> I'll study the macro implementations you guys linked and see if I can understand it. Then maybe I'll have a go at it if I can wrap my head around it |
22:18:13 | planetis[m] | what you mean? |
22:18:46 | planetis[m] | it's hard to deal with typed macros? |
22:20:16 | planetis[m] | @For Your Health I have written a blog post once https://nim-lang.org/blog/2018/06/07/create-a-simple-macro.html |
22:20:35 | planetis[m] | /sameless self promotion |
22:20:49 | planetis[m] | now that i look at it, its pretty dumb |
22:21:36 | FromDiscord | <For Your Health> I'll take a look |
22:22:14 | * | jjido joined #nim |
22:22:43 | planetis[m] | also try out this macro: https://nim-lang.github.io/fusion/src/fusion/astdsl.html it's vey convenient |
22:22:55 | * | luis__ joined #nim |
22:24:22 | * | luis_ quit (Ping timeout: 260 seconds) |
22:24:34 | * | Vladar quit (Quit: Leaving) |
22:24:47 | planetis[m] | ignore the min macro i blew it |
22:25:16 | planetis[m] | looking for a replacement if anyone has any ideas... |
22:27:35 | FromGitter | <ynfle> @planetis, I don't get what the matrix is trying to do |
22:27:43 | FromGitter | <ynfle> *macro |
22:27:55 | planetis[m] | which one? |
22:28:13 | * | BitPuffin quit (Ping timeout: 260 seconds) |
22:28:14 | * | Prestige quit (Ping timeout: 260 seconds) |
22:29:08 | * | Prestige joined #nim |
22:29:14 | FromGitter | <ynfle> `buildAst`. What probelm does it try to solve |
22:29:46 | planetis[m] | buildAst, constructs an nim tree as described in https://nim-lang.org/docs/macros.html#the-ast-in-nim |
22:29:47 | FromDiscord | <haxscramper> Okay, I can do it like this |
22:29:52 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ECJ |
22:30:14 | FromDiscord | <haxscramper> only because I have 1600+ lines of parser for nim type implementation itself |
22:30:45 | FromDiscord | <haxscramper> I't is overly generic, and I'm actually really impressed that it works at all honestly |
22:31:28 | FromGitter | <ynfle> I don't get how it differs from a regular macro. How is it more convenient? |
22:32:02 | FromDiscord | <haxscramper> ynifle: it is better form of `newTree`, with syntax closer to `dumpTree` |
22:32:13 | * | BitPuffin joined #nim |
22:32:15 | FromDiscord | <haxscramper> And it does not suffer from all quirks of `quote do` |
22:32:47 | FromDiscord | <For Your Health> @haxscramper Is that a macro of what I was talking about earlier? |
22:32:57 | FromDiscord | <Rebel> When are you going to write those yummy blog posts about the wonders of metaprogramming in Nim π |
22:33:50 | FromDiscord | <haxscramper> @For Your Health yes, technically. To be more precise this a callback for macro framework that `nimtraits` is. But it does exactly what you described. But it will probably fail on case objects and more convoluted cases like `void` generic parameters for fields and so on |
22:34:38 | FromGitter | <ynfle> So in the example, tmp is the resulting ast, or each line of the expression is the AST? |
22:35:05 | planetis[m] | @ynfle you can define the tree declaratively |
22:35:36 | planetis[m] | its a common pattern with templates/macros returning a value |
22:35:56 | FromGitter | <ynfle> so just `tmp` is part of the matrix? |
22:36:00 | FromDiscord | <For Your Health> @haxscramper That is beyond my comprehension at the moment that's for sure. |
22:36:02 | FromGitter | <ynfle> *macro |
22:36:20 | planetis[m] | its like `(var tmp = call(), tmp)` |
22:36:25 | FromDiscord | <haxscramper> @Rebel me? Well I'm already working on pattern matching article, so ... |
22:37:10 | * | FromDiscord quit (Remote host closed the connection) |
22:37:27 | * | FromDiscord joined #nim |
22:37:34 | FromDiscord | <Rebel> https://media.discordapp.net/attachments/371759389889003532/778750768668475392/67efe01c62447cdeb57f61d3c3172aec.png |
22:37:45 | planetis[m] | template foo: untyped = (var tmp: sometype, dosomething(), tmp) |
22:37:48 | FromDiscord | <Rebel> You were also right btw |
22:38:02 | FromDiscord | <haxscramper> @For Your Health mine too to be honest. I'm literally feeling how my brain cools down after I wrote this abomination in like ~10 minutes |
22:38:05 | FromDiscord | <Rebel> (edit) "You were also right btw ... " added "the thing you said 2 months ago on 9/11 about exposing nim procs to nimscript and invoking it that way" |
22:38:50 | FromGitter | <ynfle> Right so it's basically a syntactic sugar for β β ```result = nnkstmtlist.newtree β result.add block: β ... β tmp``` [https://gitter.im/nim-lang/Nim?at=5fb5a27abf955735eb8a3ce5] |
22:39:06 | * | luis__ quit (Quit: luis__) |
22:39:32 | FromDiscord | <haxscramper> @Rebel - actually - https://gist.github.com/haxscramper/ad781ebd5a343b53197bf538a1252f83 - (note that it describes not-yet-merged-or-reviewed addition to fusion, so things might change). |
22:39:42 | planetis[m] | yes |
22:40:41 | planetis[m] | but not the code you wrote |
22:41:14 | FromDiscord | <haxscramper> But I want to put it together when ` fusion/matching` will be finally merged, so if you have any feedback (article, ideas, implementation or whatnot) it might be very useful. |
22:41:17 | FromGitter | <ynfle> I mean conceptually equivalent |
22:45:46 | * | FromDiscord quit (Remote host closed the connection) |
22:46:01 | * | FromDiscord joined #nim |
22:46:26 | * | FromDiscord quit (Remote host closed the connection) |
22:46:41 | * | FromDiscord joined #nim |
22:49:45 | ForumUpdaterBot | New post on r/nim by shujidev: $ procedure not exported with float parameters, see https://www.reddit.com/r/nim/comments/jwqdeb/procedure_not_exported_with_float_parameters/ |
22:52:01 | planetis[m] | @ynfle do you get why it's convenient? |
22:52:12 | FromGitter | <ynfle> Not really |
22:52:34 | planetis[m] | π€¦ |
22:52:48 | FromGitter | <ynfle> Sorry man |
22:53:01 | * | FromDiscord quit (Remote host closed the connection) |
22:53:02 | planetis[m] | then you can try writting a few macros without helpers and you'll get it :) |
22:53:14 | FromGitter | <ynfle> I have |
22:53:16 | * | FromDiscord joined #nim |
22:53:28 | planetis[m] | anything to share? |
22:54:47 | planetis[m] | goodnight all |
22:54:57 | FromDiscord | <Avatarfighter> gn! |
22:55:10 | FromGitter | <ynfle> GN |
22:55:13 | FromGitter | <ynfle> About what? |
23:11:44 | * | mwbrown quit (Ping timeout: 240 seconds) |
23:11:47 | * | lritter quit (Quit: Leaving) |
23:12:04 | * | idxu quit (Ping timeout: 240 seconds) |
23:12:04 | * | ldlework quit (Remote host closed the connection) |
23:12:09 | * | vicfred quit (Quit: Leaving) |
23:12:13 | * | idxu_ joined #nim |
23:12:44 | * | MTRNord[m] quit (Ping timeout: 240 seconds) |
23:12:57 | * | ldlework joined #nim |
23:12:57 | * | MTRNord[m] joined #nim |
23:13:13 | * | idxu_ is now known as idxu |
23:13:16 | * | vicfred joined #nim |
23:14:20 | * | vicfred quit (Max SendQ exceeded) |
23:14:50 | * | vicfred joined #nim |
23:15:41 | * | tane quit (Quit: Leaving) |
23:18:19 | * | mwbrown joined #nim |
23:57:03 | FromDiscord | <Varriount> Hm. In general, why do programming languages use "continue" instead of "skip" for the directive to skip an iteration of a loop? |
23:57:19 | FromDiscord | <Varriount> On the face of it, "continue" doesn't make much sense. |
23:59:48 | FromGitter | <ynfle> I think because it would mean continue looping not continue the iteration |