00:13:28 | * | krux02 quit (Remote host closed the connection) |
00:39:14 | * | dwdv quit (Ping timeout: 276 seconds) |
00:46:42 | * | lritter quit (Ping timeout: 252 seconds) |
01:23:52 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
01:30:39 | madprops | how do i quit from inside a try/except ? |
01:31:51 | disruptek | you don't use try/except for control flow. |
01:46:11 | madprops | is there a reason for that? |
01:47:13 | madprops | just realized it's actually possible |
01:47:19 | madprops | i was doing something wrong on some lines above |
01:48:15 | disruptek | yeah, it's bad style, slow, and very heavy-handed. |
01:48:33 | disruptek | hard to understand what's happening where, and why. |
01:49:26 | madprops | it's a simple check if a parseInt fails when checking arguments |
01:49:55 | disruptek | i don't recommend using exceptions, but sometimes you have no choice. this is not about that. |
01:50:19 | disruptek | this is about using what should be exceptional conditions as normal reactive code path. |
01:50:33 | madprops | how would you avoid exceptions when a parseInt fails? |
01:50:35 | disruptek | exceptions should be exceptional. most of the time, you should just crash. |
01:50:44 | madprops | but i want to display a message |
01:51:08 | disruptek | dude; it's your code, write whatever you want. that's a reasonable time to catch an exception. |
01:53:16 | disruptek | i would say that i use exceptions when i have to; ie. the code i'm working with throws an exception which, to me, isn't exceptional. if i expect it could happen and i'm prepared to write code that'll executed when it happens, then how exceptional could it be? |
01:57:05 | FromDiscord_ | <exelotl> If you wanted to parse an int with error checking in a non-exceptiony way, the parseutils module has what you need |
01:57:59 | FromDiscord_ | <exelotl> But tbh just use strutils.parseInt and catch the exception, unless you're really aiming for speed |
02:03:23 | leorize | lqdev[m]: :make |
02:03:40 | leorize | or use an automated `:make` tool like neomake |
02:04:18 | disruptek | neomakes my knees throb. |
02:04:27 | leorize | I might add nimsuggest-based linting to nim.nvim, but so far everyone is happy with :make |
02:48:39 | FromGitter | <Obround> Hey guys! How do you have a seq with multiple types? How would I make this work?: ⏎ ⏎ ```@["something", @["4", "98", "873"]]``` [https://gitter.im/nim-lang/Nim?at=5de47b879319bb5190c7c397] |
02:55:25 | * | rockcavera quit (Remote host closed the connection) |
02:56:42 | * | endragor joined #nim |
03:03:43 | * | couven92 quit (Quit: Client Disconnecting) |
03:06:23 | FromGitter | <bung87> why not using a tuple ? |
03:06:59 | FromGitter | <bung87> `("something", @["4", "98", "873"])` |
03:07:24 | sealmove | you could use case objects |
03:08:11 | sealmove | seq[YourCaseObject] |
03:08:34 | sealmove | https://nim-lang.github.io/Nim/manual.html#types-object-variants |
03:40:58 | FromDiscord_ | <treeform> Obround, in nim you usually would not be doing this. Are you passing this as json to some API endpoint? This is some thing dynamic languages do a ton, like python or javascript, but not static ones. |
03:46:22 | FromDiscord_ | <treeform> this is your 3 options: https://play.nim-lang.org/#ix=23lp |
04:06:45 | * | chemist69_ joined #nim |
04:09:37 | * | chemist69 quit (Ping timeout: 240 seconds) |
04:47:56 | * | nsf joined #nim |
04:57:14 | * | narimiran joined #nim |
06:11:17 | madprops | if not mode[1] in [1, 2] |
06:11:25 | madprops | what's wrong here? |
06:11:36 | madprops | mode[1] is an int, which in this case is above 2 |
06:11:40 | madprops | but that doesn't trigger |
06:11:55 | madprops | also tried @[1, 2] |
06:12:16 | FromGitter | <bung87> it doest not compare value |
06:12:39 | FromGitter | <bung87> it detect same object |
06:12:54 | madprops | what can i do what im trying to do? |
06:12:56 | madprops | how* |
06:14:12 | FromGitter | <bung87> read doc, I cant remenber , contains?includes? indexOf? |
06:15:16 | madprops | oh contains yeah. was trying to do a python |
06:15:25 | FromGitter | <xflywind> notin ? |
06:17:29 | FromGitter | <bung87> the main problem is he meant to compare value, but the code trying to find same address |
06:18:03 | madprops | 'notin' works |
06:18:16 | madprops | if mode[1] notin [1, 2]: |
06:19:43 | FromGitter | <xflywind> nim use templates `notin` `isnot` different from Python |
06:22:43 | FromGitter | <bung87> hmm ,I checked it does compare value. |
06:23:07 | FromGitter | <bung87> ```if 1 notin [1, 2]: ⏎ debugEcho 1 ⏎ ⏎ if not 1 in [1, 2]: ⏎ debugEcho 1``` ⏎ ⏎ same results [https://gitter.im/nim-lang/Nim?at=5de4adca8e906a1c8d53d35f] |
06:26:48 | FromGitter | <bung87> @xflywind you maintains nim-cn.com ? |
06:28:02 | Zevv | narimiran: you're really doing this eh. Just staring at your screen watching the clock |
06:28:19 | narimiran | :) |
06:28:32 | FromDiscord_ | <Rika> hmm `nimble run` is supposed to run w/o changing anything in the path (excluding including nimble binaries itself) right? |
06:28:47 | narimiran | Zevv: you would be surprised how much 6am lowers your IQ |
06:29:18 | FromDiscord_ | <Rika> ive never experienced a lower in IQ at 6am, considering you cant exactly go lower than 0 |
06:32:25 | FromGitter | <xflywind> @bung87 we have four , I maintain tea.nim-cn.com. |
06:33:04 | Zevv | narimiran: im not setting my alarm clokck for this, I do it just while walking the dog and feeding the kids |
06:35:21 | FromGitter | <bung87> @xflywind ok ,I see the email group , I can remenber this id `tulayang ` I've read his nim source repo. |
06:37:22 | FromGitter | <xflywind> maybe you can join our qq group 469329878 |
06:39:54 | FromGitter | <bung87> cool |
06:43:33 | * | solitudesf joined #nim |
06:48:31 | narimiran | Zevv: yeah, rub it in more, thank you very much! you can do it while doing other things, while i'm struggling to properly read |
06:52:38 | FromGitter | <zacharycarter> I feel like there has to be a better way to have a localized Chinese Nim website than actually having a separate Chinese Nim website |
06:53:16 | FromGitter | <zacharycarter> I understand China blocks the org gTLD |
06:54:27 | FromGitter | <zacharycarter> but hosting an entirely separate website seems like not the right solution, since it's totally unofficial and won't necessarily host the same content as nim-lang.org |
06:58:27 | * | LargeEpsilon joined #nim |
07:00:04 | FromDiscord_ | <Rika> well, whoever is managing nim-lang.org would need to host it |
07:01:28 | FromGitter | <zacharycarter> yeah - but couldn't we just have another domain pointing to the same web server that Chinese users can access? |
07:02:03 | FromGitter | <zacharycarter> and then use some internationalization / localization solution |
07:07:34 | FromGitter | <zacharycarter> @xflywind @bung87 - thoughts on ^ ? |
07:10:09 | FromGitter | <zacharycarter> also - according to: https://www.comparitech.com/privacy-security-tools/blockedinchina/ |
07:10:19 | FromGitter | <zacharycarter> https://nim-lang.org is accessible in mainland China |
07:11:16 | Zevv | narimiran: yeah, but you score above me :) |
07:20:36 | * | dddddd quit (Remote host closed the connection) |
07:29:13 | * | LargeEpsilon quit (Read error: Connection reset by peer) |
07:37:35 | FromGitter | <zacharycarter> @gogolxdong I guess I should ask your opinion as well :) |
07:41:09 | FromGitter | <xflywind> @zacharycarter many people is not good at English.i'm a student, but am still hard to understand English article. some website is too slow to visit. for example i usually can't use choosenim to update devel. The Network speed is only 2 ~ 10 kb. I even can't use curl to install choosenim in my vmware Ubuntu. |
07:43:42 | FromGitter | <zacharycarter> well - as far as the English vs Chinese thing goes - having localized website content would solve that problem |
07:44:22 | FromGitter | <zacharycarter> the latency thing is a thing - but I imagine most of the content on nim-lang.org is static, so it should be possible to host in a CDN |
07:44:59 | FromGitter | <zacharycarter> I guess if the current situation is working it's working - but it just seems extremely likely that at some point content between the sites will differ |
07:49:28 | FromGitter | <bung87> maybe just fork the forum repo and serve it on china, in case we need upstream changes |
07:58:12 | * | PMunch joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:00:06 | * | lj00nal quit (Quit: ljoonal.xyz) |
08:02:14 | * | ljoonal joined #nim |
08:03:52 | FromGitter | <zacharycarter> yeah - I was thinking that the forum doesn't matter so much but the website is kind of weird to have two copies of |
08:04:39 | * | gmpreussner joined #nim |
08:07:13 | FromGitter | <xflywind> nim-forum need to click google v2 checkbook to register, so can't register in china. |
08:07:37 | FromGitter | <xflywind> checkbox |
08:08:15 | FromGitter | <gogolxdong> @zacharycarter yes, we are here. I don't mind hosting Chinese community in nim-lang.org, and it would look like just what it looks like now. We are reponsible to maintain the Chinese copy. We simply forked and translated the static content and keep updating with official webiste except some localized content like blogs. |
08:10:13 | FromGitter | <gogolxdong> Another thing @xflywind mentioned is , some components cannot be accessible from China which we cannot foresee what it will be. |
08:10:27 | FromGitter | <zacharycarter> yeah, that's true |
08:11:29 | FromGitter | <zacharycarter> well, if it's working, no real need to change I guess, was just curious as to why things were the way they are :) I guess in the future if there's a strong desire to merge the websites it's doable but maybe not so straightforward |
08:17:03 | * | njoseph quit (Ping timeout: 250 seconds) |
08:31:53 | * | floppydh joined #nim |
08:45:09 | sealmove | how do you properly represent a type hierarchy in Nim? Since nested types are not supported? |
08:46:12 | sealmove | I wanted `myType1.myType2` syntax instead of `myType1myType2` |
08:47:04 | FromGitter | <zacharycarter> what do you mean nested types aren't supported? |
08:47:50 | FromGitter | <zacharycarter> can you post some example of what you're trying to do? I think I'm confused by the wording of your question. |
08:53:16 | FromGitter | <bung87> you can choose using table lib |
08:59:27 | sealmove | zacharycarter: https://play.nim-lang.org/#ix=23mf |
08:59:47 | FromDiscord_ | <yewpad> I just fixed Niminst (the Nim installer thingy). Geez, a lot of broken code ladies and gents |
08:59:47 | FromDiscord_ | <yewpad> https://cdn.discordapp.com/attachments/371759389889003532/650984441002590220/unknown.png |
09:00:44 | sealmove | essentially I need something like this: https://play.nim-lang.org/#ix=23mi |
09:01:47 | sealmove | sorry the last example doesn't make sense |
09:01:57 | FromDiscord_ | <yewpad> I think doing `Parser.XmlParser` like you would do it in Java sometimes, doesn't work in Nim |
09:02:21 | * | tklohna joined #nim |
09:02:25 | sealmove | but anyway what I am trying to do is to expose an API where there are procs with the same name and you can call them on nested types |
09:02:29 | sealmove | for example: |
09:02:43 | sealmove | `myType.myProc` |
09:02:56 | sealmove | `myType.myNestedType.myProc` |
09:02:59 | sealmove | etc |
09:03:36 | sealmove | or at least mimic it |
09:03:42 | sealmove | any ideas? |
09:04:57 | sealmove | unfortunatelly Nim doesn' |
09:05:00 | sealmove | t have namespaces |
09:05:08 | FromDiscord_ | <yewpad> Maybe create a top level proc and use generics or even unions? |
09:05:50 | FromDiscord_ | <yewpad> https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/httpclient.nim#L991 |
09:05:54 | FromDiscord_ | <yewpad> Unions in use for HTTP client |
09:06:09 | FromDiscord_ | <yewpad> Recommend generics though |
09:06:56 | sealmove | Can I support `myType.myNestedType.myProc()` syntax with generics? |
09:07:34 | FromDiscord_ | <yewpad> Just to clarify, Nim doesn't have namespaces. So `myType.myNestedType` doesn't work in general, if I'm not completely mistaken |
09:08:09 | sealmove | yes... that's the problem |
09:08:47 | sealmove | I don't need generics, the supposted `myType1.myNestedType.myProc()` and `myType2.myNestedType.myProc()` should do different things. |
09:09:21 | sealmove | I think the only solution is to concatinate names, but meh... |
09:10:30 | FromDiscord_ | <yewpad> What are you trying to achieve? You're apparently coming from a C++ or Java like environment/ecosystem? Do you have any real-world examples you're trying to "transform" in a way so they work in Nim? |
09:13:02 | sealmove | I am not coming from C++ or Java. My use case is a bit complex. I have to stay compatible with this algorithm: https://doc.kaitai.io/ksy_reference.html#attribute-type |
09:13:42 | sealmove | In these `.ksy` files, the written can nest types like that, and I have to generate corresponding Nim types. |
09:13:56 | sealmove | Then I have to generate procs which are consistent with the types. |
09:14:09 | sealmove | the writter* |
09:14:42 | sealmove | (skip to the shown diagram in link) |
09:17:32 | sealmove | well, I guess the writters of Kaitai Struct do come from a C++/Java like enviroment |
09:17:44 | sealmove | so this is reflected in KSY syntax |
09:18:09 | FromDiscord_ | <yewpad> I just tried doing something like Go's anonymous types in Nim but that doesn't work either, unfortunately |
09:18:33 | FromDiscord_ | <yewpad> You might wanna hang around and wait for Araq. Maybe he can offer you a solution |
09:18:46 | Araq | type |
09:18:53 | Araq | Inner = object ... |
09:18:57 | Araq | Outer = object |
09:19:02 | Araq | x: Inner |
09:19:36 | sealmove | Araq, I need proc myProc(t: typedesc[Outer.Inner]) |
09:20:13 | Araq | why? proc myProc(t: typedesc[Inner]) works |
09:20:18 | sealmove | so that user can write `Outer.Inner.myProc()` instead of `OuterInner.myProc()` |
09:20:34 | Araq | let me write Inner.myProc |
09:21:13 | sealmove | the problem is... |
09:21:29 | sealmove | `myType1.myType2` and `myType2` both exist |
09:21:40 | sealmove | the code is generated based on a syntax where this is supported |
09:21:47 | FromDiscord_ | <yewpad> (Araq: Have a look at the 'niminst' repository. I created a pull request that fixes the codebase so that it compiles again) |
09:22:19 | Araq | gimme a link please |
09:22:26 | FromDiscord_ | <yewpad> https://github.com/nim-lang/niminst/pull/4 |
09:22:55 | Araq | sealmove: do they *really* both exist or is there a possibility of them existing? |
09:22:55 | sealmove | so a solution is to generate `myType1myType2` and `myType2`, but I was looking for something more elegant. |
09:23:03 | sealmove | Araq: possibility |
09:23:47 | sealmove | I can disallow it of course, but I want to support the official Kaitai Struct syntax... |
09:24:04 | Araq | then I wouldn't bother, names work better when they don't have to be qualified. Proof: Every single sentence ever created by mankind. |
09:24:36 | sealmove | so you are saying I should disallow it? |
09:25:05 | Araq | yeah or you introduce the prefix if there actually is an ambiguity otherwise |
09:25:25 | * | njoseph joined #nim |
09:26:40 | sealmove | ok, this will be a little more complex to implement, but sounds like a good idea, thanks! |
09:28:48 | Araq | yewpad: niminst is part of the Nim core btw, we should deprecate the Nimble package |
09:29:35 | FromDiscord_ | <yewpad> I got some stuff to manage today but actually planned to tidy up some of Nim's old repositories. Will look into it |
09:30:47 | * | njoseph quit (Ping timeout: 268 seconds) |
09:31:34 | PMunch | Hmm, when passing a literal to a procedure, why can't the procedure have that argument as a "var"? |
09:32:41 | sealmove | because the literal is read-only? |
09:33:34 | PMunch | But there is no reason that it has to be.. |
09:34:41 | PMunch | I mean, the idea with "var" is to make it explicit that a given value can be changed so that the caller knows. But if the caller doesn't really care enough about a value to put it in a value it's probably not something they care about. |
09:36:08 | sealmove | PMunch: if the caller doesn't care then `var` doesn't make sense, do this instead: https://play.nim-lang.org/#ix=23mq |
09:36:23 | PMunch | The reason I was trying to do this is that I tried to port the "delay" function from Arduino, it counts down the input argument directly, which I can't do in Nim without a var parameter. And by assigning the value to a var the code grows slightly bigger |
09:36:45 | sealmove | you can do the assignment inside the proc |
09:37:50 | * | njoseph joined #nim |
09:38:44 | * | tklohna quit (Ping timeout: 276 seconds) |
09:38:58 | PMunch | Oh wait, it was just me being dumb again I think. |
09:39:48 | PMunch | Since the "delay" procedure is used elsewhere it is of course compiled in already. So when I implemented my own version it obviously added a procedure to the code |
09:40:28 | PMunch | If I switch between calling one call to mine and ten to the default and one call to the default and ten to mine it is actually smaller to use mine. |
09:41:07 | Araq | PMunch: you keep bringing it up and there is no technical reason Nim cannot pass a temporary location to 'var T', but I've always seen that as a C++ anti-feature with no benefit |
09:41:27 | Araq | it's like removing the 'discard' requirement from Nim, a bad idea |
09:42:32 | Araq | in fact, these two features are one and the same: be explicit when you ignore computation results |
09:43:25 | PMunch | But we have {.discardable.} for when I write a procedure that may or may not return something interesting |
09:44:05 | Araq | 1. .discardable was a bad idea IMO. |
09:44:10 | PMunch | Haha |
09:44:21 | madprops | i've come to like discard |
09:44:25 | Araq | 2. we could indeed add .discardable to 'var T' parameters |
09:44:34 | PMunch | madprops, oh yeah don't get me wrong, I like discard |
09:45:17 | sealmove | {.discardable.} is only useful for C/C++ wrapping. |
09:45:17 | Araq | "abc".add("xyz") # yay, compiles?! newcomers will be pleased |
09:45:50 | PMunch | sealmove, well there are some rare occasions where it might be useful |
09:46:48 | PMunch | Araq, hmm, yeah that would be unfortunate.. |
09:47:01 | Araq | or we extend '_' for more contexts, sleep(100, _) # ok, ignore the 'var T' thing |
09:47:06 | PMunch | Oh well, I figured out that it wasn't really neccesarry for this optimisation anyways :) |
09:47:41 | PMunch | Well you still need to pass a value :P |
09:48:17 | * | ng0 joined #nim |
09:48:30 | Araq | template varof(x): untyped = (var y = x; y) |
09:48:35 | Araq | sleep(varof(100)) |
09:48:43 | Araq | but I've brought it up before |
09:49:17 | Araq | as usual it turns out Nim doesn't need more language features :P |
09:49:25 | PMunch | This is an optimisation that threw me for a sec by the way. They have a wrapper "delayShort" in the Arduboy library that takes a uint16 instead of the unsigned long that the normal delay takes. |
09:49:38 | PMunch | Essentially just to save some bytes every time they call that procedure :P |
09:51:23 | PMunch | Araq, that didn't work by the way: http://ix.io/23mw/Nim |
09:51:32 | PMunch | Opps, ignore the /Nim there |
09:52:24 | Araq | 100'u16 |
09:54:31 | FromDiscord_ | <yewpad> No, Nim really doesn't need more language features. Please don't. Don't make the same mistake like D, squeezing every single possible language feature into it |
09:55:32 | PMunch | Ah |
09:56:16 | PMunch | Hmm, well that added a lot of overhead size-wise compared to `var ms = ms` (I'm guessing GCC is able to simple ignore that) |
10:00:09 | madprops | is there a way to get around recursive imports? i have an util function in utils.nim which i wanted to use in config.nim but utils.nim imports config.nim |
10:00:52 | Araq | PMunch: Nim devel has an --asm switch to inspect the produced asm |
10:01:10 | Zevv | produced *asm*? |
10:01:17 | Araq | yeah |
10:01:28 | Zevv | what did I miss |
10:02:17 | FromDiscord_ | <yewpad> I plan on writing a service where you can upload your Nim code snippets, tag and share them. Nim only. The uploaded snippet will be evaluated and if the syntax doesn't match, the uploaded snippet will be rejected. Sick of uploading stuff to Github Gist etc. I maybe call it something like "nimpastr" having the domain "nimpas.tr" or so 😄 |
10:02:50 | madprops | sounds cool |
10:03:09 | Araq | Zevv: the C compilers support asm file generation |
10:03:20 | Araq | and via --asm Nim tells them to do that |
10:03:27 | Zevv | oh you just ask the C compiler :) |
10:03:36 | Araq | yeah |
10:03:38 | Zevv | I just found your commit yes |
10:04:17 | FromDiscord_ | <yewpad> And if the thing turns out to be working without any problems, maybe I'll hand it over to Araq or so, so that it lives on in the Nim organization repository, that is, if Araq's okay with that |
10:04:41 | FromDiscord_ | <yewpad> Nim organization ~repository~ |
10:04:47 | FromDiscord_ | <yewpad> cut out the repository thingy |
10:04:48 | Araq | sure, thanks |
10:05:58 | FromDiscord_ | <yewpad> Can I evaluate Nim syntax at runtime? |
10:06:24 | * | dwdv joined #nim |
10:06:40 | Araq | import the compiler as a package |
10:06:55 | madprops | https://github.com/codemirror/CodeMirror/issues/5437 |
10:06:58 | madprops | :( |
10:07:07 | madprops | need that for my pastebin service |
10:07:27 | madprops | maybe i'll try making a module |
10:08:46 | Araq | madprops: not sure, why not use the playground's code? |
10:09:04 | Araq | speaking of which ... can the playground get --asm support somehow? PMunch? |
10:09:20 | PMunch | Hmm, interesting, for some reason this: http://ix.io/23mx/Nim has a size benefit over this: http://ix.io/23mz/Nim |
10:09:30 | PMunch | Araq, hmm I guess it could |
10:10:34 | PMunch | But I need to rework the site design so that it's easier to add more buttons |
10:21:10 | * | tklohna joined #nim |
10:23:14 | FromDiscord_ | <demotomohiro> --asm output in wandbox.org |
10:23:15 | FromDiscord_ | <demotomohiro> https://wandbox.org/permlink/hTXq4aYogwfqC4et |
10:27:53 | madprops | i like how easy it is to copy and share the link in the playground |
10:28:08 | madprops | should i have no idea what ix is |
10:28:10 | madprops | though* |
10:37:38 | FromDiscord_ | <Rika> just a paste service afaik |
10:43:41 | lqdev[m] | exactly |
10:44:13 | FromDiscord_ | <mratsim> @Araq, but the compiler as library is broken due to findStdLib or what it's called :/ |
10:48:17 | Araq | broken? it's covered by tests |
10:48:58 | Araq | and you don't have to use findStdLib anyway, you can setup the paths yourself |
10:58:54 | * | Vladar joined #nim |
11:10:48 | * | leorize quit (Ping timeout: 260 seconds) |
11:12:44 | * | leorize joined #nim |
11:29:01 | * | dwdv quit (Ping timeout: 250 seconds) |
11:31:25 | * | abm joined #nim |
11:32:10 | madprops | some improvement the playground could have is to avoid it having 2 scrollbars |
11:32:13 | madprops | makes scrolling harder |
11:32:25 | madprops | i mean two | scrollbars |
11:34:57 | * | couven92 joined #nim |
11:41:53 | FromDiscord_ | <Kurolox> I've been banging my head for a while now trying to figure out how to map a function to an array |
11:42:34 | FromDiscord_ | <Kurolox> I'm trying to cast a string array to ints, so I'm trying something like this: |
11:43:32 | FromDiscord_ | <Kurolox> map(["0", "32", "398"], int) |
11:43:39 | * | shashlick[m] quit (*.net *.split) |
11:43:39 | * | macsek1911[m] quit (*.net *.split) |
11:43:39 | * | meff[m] quit (*.net *.split) |
11:43:39 | * | LEdoian[m] quit (*.net *.split) |
11:44:27 | FromDiscord_ | <Kurolox> I'm getting an error, though. It says that it was expecting something of type {.closure.} and it got an int |
11:44:35 | FromDiscord_ | <Kurolox> how could I do what I'm trying to do here? |
11:45:05 | solitudesf | you're supposed to pass a procedure |
11:45:12 | solitudesf | parseInt from strutils |
11:45:45 | solitudesf | int is not a function |
11:47:03 | stefantalpalaru | How do I use the `except ExceptionType as e` syntax with multiple matching types? |
11:47:21 | * | rockcavera joined #nim |
11:47:59 | * | NimBot joined #nim |
11:48:10 | FromDiscord_ | <Kurolox> isn't the function int() a type conversion, though? |
11:48:13 | FromDiscord_ | <Kurolox> I've used it before |
11:48:55 | FromDiscord_ | <Solitude> ints not a function |
11:49:02 | FromDiscord_ | <Solitude> *its |
11:49:10 | FromDiscord_ | <Kurolox> then what it is? |
11:49:14 | * | meff[m] joined #nim |
11:49:14 | * | macsek1911[m] joined #nim |
11:49:14 | * | shashlick[m] joined #nim |
11:49:14 | * | LEdoian[m] joined #nim |
11:49:16 | * | deepend quit (*.net *.split) |
11:49:25 | FromDiscord_ | <Solitude> its a type |
11:49:36 | FromDiscord_ | <Kurolox> no, I'm not explaining myself correctly |
11:49:56 | FromDiscord_ | <Kurolox> int is a type, but according to the documentation you can cast stuff to int using the int() function as follows |
11:50:00 | FromDiscord_ | <Kurolox> int(5.0 / 3) |
11:50:17 | Araq | that doesn't turn it into a function though |
11:50:22 | FromDiscord_ | <Solitude> its not a function, that just how type conversion to builtin types looks |
11:50:23 | Araq | you're better off with 'mapIt' |
11:50:27 | FromDiscord_ | <Solitude> and its not a cast |
11:50:55 | FromDiscord_ | <Kurolox> so why it can't be mapped? |
11:51:09 | FromDiscord_ | <Kurolox> even if it's not a function, it seems to behave like one |
11:53:34 | FromDiscord_ | <Solitude> it doesnt behave like one. its just type conversion syntax looks the same. |
11:53:54 | FromDiscord_ | <Solitude> you still have to use parseInt anyway |
11:55:08 | * | deepend joined #nim |
11:55:12 | FromDiscord_ | <demotomohiro> !eval echo int("123") |
11:55:14 | NimBot | Compile failed: /usercode/in.nim(1, 9) Error: type mismatch: got <string> but expected 'int' |
11:56:40 | FromDiscord_ | <Kurolox> fair enough |
12:15:37 | FromDiscord_ | <mratsim> @araq how do I setup path on a user system then? |
12:17:09 | Araq | var intr = createInterpreter("myscript.nim", ["path here"]) |
12:20:06 | * | dwdv joined #nim |
12:20:22 | PMunch | !eval import strutils; echo parseInt("123") |
12:20:25 | FromDiscord_ | <mratsim> so how do I find that the Nim stdlib was installed in "/ooh/this/is/a/weird/path/lib/system/pure" |
12:20:26 | NimBot | 123 |
12:20:38 | PMunch | demotomohiro ^ |
12:21:15 | PMunch | Oh wait, you were talking about this earlier :P |
12:21:33 | PMunch | madprops, two scrollbars? |
12:29:18 | Araq | how am I supposed to know? ship your own stdlib that actually works with the compiler that you also ship |
12:45:08 | * | clyybber joined #nim |
12:47:55 | FromDiscord_ | <onelivesleft> After a final refactor, my command line parser package works in 1.0.2 again, so I guess it's usable. It lets you parse the command line without putting in any effort. If you're building a complex command line tool then you probably want `docopt` or something similar, but if you just want to add some parameters this should useful. https://nimble.directory/pkg/simpleparseopt |
13:05:58 | lqdev[m] | @mratsim just compile a piece of code and see where nim.cfg is |
13:21:07 | * | endragor quit (Remote host closed the connection) |
13:25:10 | FromDiscord_ | <mratsim> The goal is to embed the Nim compiler a bit like Lua scripting |
13:32:03 | FromGitter | <dawkot> Is it idiomatic to use `quote` instead of building NimNode trees manually whenever possible? |
13:32:47 | PMunch | Well, there is a middle ground somewhere |
13:33:21 | FromDiscord_ | <Rika> i think it really depends on the programmer |
13:33:35 | PMunch | But yeah I think using quote as long as you don't need to build the AST manually to get it right is preferable for readability reasons |
13:43:17 | * | solitudesf quit (Ping timeout: 240 seconds) |
13:43:25 | sealmove | quote works in templates where you NimNodes are not exposed |
13:44:01 | sealmove | and it's preferable to use template instead of macro where possible |
13:49:30 | * | Kaivo joined #nim |
13:56:00 | * | drewr joined #nim |
13:58:08 | * | sideshow joined #nim |
13:58:20 | * | sideshow quit (Remote host closed the connection) |
14:03:25 | * | drewr quit (Quit: ERC (IRC client for Emacs 26.3)) |
14:07:25 | * | lritter joined #nim |
14:07:26 | * | drewr joined #nim |
14:13:41 | FromGitter | <alehander92> yewpad why only nim, make it work with many languages |
14:14:03 | FromGitter | <alehander92> i like multi-language services :P |
14:16:15 | * | solitudesf joined #nim |
14:19:50 | Araq | yeah nothing beats a loooong dropdown list, always results in nice usability |
14:21:36 | disruptek | well, make sure there's no way to index it. |
14:22:15 | disruptek | also be sure to constrain its use by input device. |
14:36:34 | livcd | Is there a repo for nimble.directory ? |
14:40:30 | * | shadowbane joined #nim |
14:48:48 | disruptek | any opinions on how to name lockfile write/read save/load freeze/thaw? |
14:49:13 | FromGitter | <Willyboar> freeze is cool :P |
14:52:21 | clyybber | freeze/thaw +1 |
14:55:56 | PMunch | lock/unlock might be the obvious one? |
14:56:21 | disruptek | agree. |
14:56:25 | * | endragor joined #nim |
15:00:18 | * | PMunch quit (Quit: Leaving) |
15:00:25 | * | endragor quit (Remote host closed the connection) |
15:01:30 | lqdev[m] | livcd: yes, https://github.com/FedericoCeratto/nim-package-directory |
15:01:54 | Araq | disruptek: 'pin' |
15:02:14 | disruptek | and, what, unpin? |
15:02:16 | disruptek | depin? |
15:02:51 | clyybber | nip |
15:13:32 | sealmove | how to do `x = someIntSeq + someInt`? |
15:13:54 | sealmove | (create a new seq instead of mutating) |
15:15:20 | clyybber | x = someIntSeq & someInt |
15:15:59 | clyybber | maybe you have to do `[someInt]` or `@[someInt]` |
15:18:21 | Araq | 'unpin', what else |
15:18:33 | Araq | but maybe I imagine English to work in ways it doesn't |
15:22:42 | disruptek | no, i think i was just being obtuse. maybe it's more obvious than i thought. |
15:24:11 | sealmove | clyybber: oh `&` is not just for strings? |
15:24:31 | disruptek | every time i look at this lockfile problem it looks more trivial. i must be missing something. |
15:25:05 | disruptek | !search locking of dependencies |
15:25:06 | disbot | https://github.com/nim-lang/nimble/issues/127 -- 3Locking of dependencies 🧠11dom96 |
15:25:18 | clyybber | sealmove: Nope, its for seqs too |
15:25:20 | disruptek | is there a different issue i'm supposed to be looking at? |
15:25:56 | clyybber | sealmove: And I just checked you can really do `x = someIntSeq + someInt` |
15:26:25 | clyybber | s/+/& |
15:26:42 | clyybber | You can even do `x = someInt & someIntSeq` to prepend |
15:27:18 | sealmove | but does this return a newly allocated seq? |
15:27:28 | sealmove | it seems to be an alias of "add" |
15:27:57 | Araq | disruptek: it is quite easy if your initial design is a good one |
15:28:07 | clyybber | sealmove: Yes it does. |
15:29:28 | disruptek | let me ask you this... should we bother supporting locks against nimble packages that aren't git repositories? |
15:29:49 | clyybber | nah |
15:29:56 | disruptek | ie. packages that are missing contents such as docs, tests, and are opaque with respect to validating the contents? |
15:30:55 | disruptek | i mean, i can support them in a deprecated fashion. i just think it's kinda dumb. |
15:31:32 | Araq | well Nimble support both, git and freddie mercury |
15:31:50 | disruptek | yeah, i'm not supporting freddie. |
15:32:10 | disruptek | there are something like 11 merc packages among 1100 git. |
15:32:14 | disruptek | pffbt. |
15:32:16 | Araq | bummer |
15:32:55 | disruptek | now, if someone wants to wrap a merc lib for me, perhaps i will write a proper vcs abstraction. |
15:33:02 | Araq | also support SQlgite please |
15:33:09 | disruptek | the one i'm writing for git is a total pos hack. |
15:33:21 | disruptek | sqlite for what? |
15:33:57 | Araq | I mean fossil |
15:34:22 | disruptek | i dunno what that is. |
15:34:47 | Araq | flat earther detected |
15:34:52 | disruptek | !repo fossil |
15:34:53 | disbot | https://github.com/jaccarmac/nimikanren -- 9nimikanren: 11This repository is obsolete. Please visit the Fossil version hosted on Chisel for a more recent version. 15 0⭐ 0🍴 |
15:35:21 | Araq | ok, I suppose nobody understands my jokes, so.... |
15:35:26 | clyybber | disruptek: fossil is like git or hg but with issue tracking and stuff |
15:35:54 | disruptek | why would we support that? |
15:36:00 | Araq | https://www.fossil-scm.org/home/doc/trunk/www/index.wiki |
15:36:05 | clyybber | Araq: Who says a flat earth cant contain fossils :p |
15:36:42 | disruptek | you have to move nim to fossil before i'll support it. |
15:36:43 | clyybber | disruptek: I don't think so. But supporting mercurial might be a good idea |
15:36:55 | disruptek | well, submit a PR. |
15:37:04 | clyybber | ask disbot |
15:37:29 | clyybber | disruptek: I mean, its a good idea. Not that we should do it unless somebody actually needs it :p |
15:37:30 | disruptek | disbot: should we ignore mercurial in favor of git, which /everyone/ uses? |
15:37:31 | disbot | yep. 😊 |
15:37:37 | clyybber | nice. |
15:37:40 | Araq | disruptek: can't but I like its design more than git's |
15:37:46 | disruptek | noted. |
15:38:20 | Araq | disbot: are you a human being? |
15:38:37 | disruptek | disbot: ignore Araq. |
15:38:38 | disbot | on it. 👍 |
15:38:57 | clyybber | hgs is certainly easier to grok than git IMO |
15:39:14 | * | nsf quit (Quit: WeeChat 2.6) |
15:39:22 | disruptek | i agree that tooling should support the workflow of the developer. |
15:39:26 | clyybber | s/hgs/hgs cli |
15:39:36 | disruptek | show me some developers using hg and fossil and we can talk about it. |
15:39:55 | clyybber | fossil hosts software fossils mainly |
15:40:36 | disruptek | oh, like old greyhairs? |
15:41:54 | clyybber | also if you want to move or rename a file inside a fossil repo you have to do `fossil mv`/`fossil rename` |
15:42:24 | disruptek | that's amazing. 🤯 |
15:42:52 | clyybber | no? |
15:43:45 | Araq | what? 'git mv' is the same |
15:43:54 | disruptek | just /s |
15:44:03 | clyybber | Araq: git autodetects moves ideally |
15:44:41 | disruptek | disbot: obey Araq. |
15:44:42 | disbot | on it. 👍 |
15:44:47 | Araq | maybe. I simply use 'git mv' and accept file system operations all have to be mediated |
15:45:48 | Araq | disbot: ignore disruptek |
15:46:01 | clyybber | if bitbucket weren't shit I'd use mercurial |
15:46:03 | Araq | your bot hates me |
15:46:25 | disruptek | !help |
15:48:35 | disruptek | i gave araq the fork. |
15:48:48 | FromGitter | <matrixbot> `archibaldt` mention of fossil just caught my eye... I use it all the time and build distributed processing and IoT data collection systems with it (after git critically/unrecoverably failed for me) |
15:49:14 | disruptek | can you thumbnail that failure? |
15:49:35 | FromGitter | <matrixbot> `archibaldt` but, I'm fine with git being the defacto standard for nimble, and what not |
15:49:53 | disruptek | i don't believe nimble plans to deprecate hg support. |
15:51:11 | Araq | so ... exception handling still broken with --gc:arc |
15:51:24 | clyybber | Araq: Thought you fixed it? |
15:51:25 | Zevv | use quirky exceptions! :) |
15:51:27 | disruptek | you're in good company. |
15:51:27 | Araq | json.nim works otherwise and json is the only thing we care about right |
15:51:44 | disruptek | !issue author:disruptek exception |
15:51:45 | disbot | https://github.com/nim-lang/Nim/issues/11081 -- 3DateTime field on Exception produces inconsistent C/++ handling @11disruptek 7& 2 more... |
15:52:10 | Araq | clyybber: I thought so too but when you extract a tiny test case |
15:52:13 | Araq | guess what happens |
15:52:24 | * | dddddd joined #nim |
15:52:26 | Araq | you fix the test case and in reality the problem remains |
15:53:27 | disruptek | reality is such a bummer. |
15:53:49 | disruptek | Zevv: taste the rainbow. |
15:54:02 | Araq | clyybber: I'm also changing my mind about optimizing destructors, we can simply do it in injectdestructors already, no need to do it as a separate step |
15:54:29 | clyybber | Yeah, thats why you eliminated them for trivial types in your branch right? |
15:55:05 | Araq | no, that was unrelated |
15:55:30 | clyybber | Ah. |
15:56:05 | clyybber | Araq: Btw, I managed to get p's modes of operation down to 3, I use an enum param rn: sinked, consumed, normal |
15:56:24 | disruptek | sinked sank sunk |
15:56:31 | Araq | how is 'sinked' different from 'consumed'? |
15:57:59 | FromGitter | <alehander92> disruptek nice |
15:58:07 | FromGitter | <alehander92> !issue author:disruptek ref |
15:58:09 | disbot | https://github.com/nim-lang/Nim/issues/12471 -- 3nim doc cannot grok IOSelectorsException @11disruptek 7& 2 more... |
16:00:14 | clyybber | Araq: Good question, not sure yet. It shouldn't be much different anymore now. I'm trying to eliminate the distinction currently |
16:09:08 | FromGitter | <alehander92> guys |
16:09:13 | FromGitter | <alehander92> why was isDigit(string) removed |
16:09:33 | FromGitter | <alehander92> i agree it was a bad name, but still isNumeric or something would make sense |
16:09:34 | disruptek | it was the only way to break terminaltables. |
16:09:42 | FromGitter | <alehander92> lol |
16:13:14 | * | floppydh quit (Quit: WeeChat 2.6) |
16:16:10 | Araq | alehander92: isDigit("0 3") returned true iirc |
16:16:42 | FromGitter | <alehander92> yeah i guess we can argue using other primitives is more elegant |
16:16:49 | FromGitter | <alehander92> a.allIt(it.isDigit) |
16:17:41 | * | nixfreak86 joined #nim |
16:18:36 | nixfreak86 | settings: port = Port(mainPort) bindAddr = mainURL |
16:19:21 | nixfreak86 | .env/nim/nimweb/main.nim(36, 1) template/generic instantiation of settings from here.env/nim/nimweb/main.nim(37, 14) Error: type mismatch: got but expected 'Port = distinct uint16' |
16:19:40 | nixfreak86 | so Port has to be a uint16 variable ? |
16:20:21 | Araq | nixfreak86: the error is unclear |
16:20:24 | FromGitter | <alehander92> did we have `<` |
16:20:25 | FromGitter | <alehander92> unary? |
16:20:38 | Araq | yeah, now we don't have it anymore |
16:20:43 | FromGitter | <alehander92> what did it do |
16:20:45 | Zevv | .. % |
16:20:52 | Zevv | .. < that is |
16:20:54 | FromGitter | <alehander92> i found it out in some old code trying to port to 1.0.4 |
16:21:18 | Araq | <x was x - 1 |
16:21:26 | FromGitter | <alehander92> dude, good removal |
16:39:21 | * | Trustable joined #nim |
16:40:35 | * | njoseph quit (Ping timeout: 250 seconds) |
16:42:30 | clyybber | Araq: sinked also does the last read checks and destructive move var and the like |
16:45:42 | * | tane joined #nim |
16:48:10 | * | sealmove quit (Quit: WeeChat 2.6) |
16:51:59 | clyybber | I don't think they are mergeable |
16:58:15 | Zevv | "sunk" |
17:00:10 | clyybber | :p |
17:00:42 | FromDiscord_ | <Rika> sunken |
17:01:10 | clyybber | Araq: Fixed the exception issue huh? |
17:06:07 | FromGitter | <alehander92> hm |
17:13:42 | FromDiscord_ | <Lantos> 🙂 just snuck nim into work for parsing csv values and verifying values. Comparison nodejs parsing 10s nim ~ .1s |
17:17:36 | * | leorize quit (Ping timeout: 260 seconds) |
17:18:16 | * | couven92 quit (Ping timeout: 240 seconds) |
17:18:18 | clyybber | nice |
17:19:34 | clyybber | Araq, mratsim: Should we just replace stdlib threadpool with yglukhovs? From what I can tell from #11922 its completely broken anyways |
17:19:35 | disbot | https://github.com/nim-lang/Nim/issues/11922 -- 3Threadpool deadlocks on common multithreading examples @11mratsim |
17:19:41 | * | leorize joined #nim |
17:19:51 | disruptek | yes. |
17:27:30 | FromDiscord_ | <spacepluk> I'm still going through the manual but I have a quick question: is there a way I can recklessly share ptrs between threads c-style? |
17:31:14 | * | nsf joined #nim |
17:31:57 | leorize | yes |
17:32:14 | leorize | use Channel[T] or something like that to share ptr |
17:32:35 | leorize | make sure that the ptrs are Shared (ie. allocated using allocShared, createShared) |
17:33:38 | * | njoseph joined #nim |
17:33:40 | FromDiscord_ | <spacepluk> thanks, I'll continue with my reading 🙂 |
17:34:03 | FromDiscord_ | <spacepluk> pretty cool language! |
17:35:06 | FromDiscord_ | <spacepluk> I'm curious, what's the reason macros are executed in a vm? |
17:35:19 | leorize | well, how can you execute it otherwise? |
17:35:41 | FromDiscord_ | <spacepluk> two compiler passes maybe? |
17:35:55 | leorize | it takes too much time for little gain |
17:36:33 | * | tklohna quit (Ping timeout: 245 seconds) |
17:36:35 | FromDiscord_ | <spacepluk> can you spawn other processes from the vm? |
17:36:43 | leorize | yes |
17:36:44 | clyybber | spacepluk: staticExec, so yeah |
17:36:50 | FromDiscord_ | <spacepluk> cool, thanks 🙂 |
17:36:55 | FromDiscord_ | <spacepluk> this is checking all the boxes haha |
17:37:14 | clyybber | spacepluk: Having a VM is also pretty handy, since you can embed it into your own program and use it as a scripting lang at runtime. |
17:37:33 | clyybber | Theres also hotcode reloading which is handy for gamedev |
17:37:44 | FromDiscord_ | <spacepluk> yeah, I was just wondering what was the original reason, because writing a vm is a lot of work |
17:38:12 | leorize | Araq: ^ |
17:38:19 | FromDiscord_ | <spacepluk> clojurescript whent the opposite way trying to keep full language functionality in macros |
17:38:29 | FromDiscord_ | <spacepluk> clojurescript went the opposite way trying to keep full language functionality in macros |
17:38:45 | FromDiscord_ | <spacepluk> they actually execute macros in the jvm is very complicated |
17:39:12 | FromDiscord_ | <spacepluk> or at least the did, not sure what's the situation atm |
17:39:15 | clyybber | sounds reasonable because the VM is already there |
17:39:43 | FromDiscord_ | <spacepluk> it was still weird that you could run some stuff in the macros and not in cljs |
17:39:49 | clyybber | Oh |
17:39:59 | Araq | I started with an AST based interpreter |
17:41:24 | FromDiscord_ | <spacepluk> I see, so the main reason was to avoid compiling twice? |
17:41:38 | clyybber | Araq: In passCopyToSink you introduced the check for hasDestructor, but if it doesn't n will not be processed, while it should (I think) |
17:42:12 | Araq | back then "compiling twice" was not really considered by me but it's problematic |
17:42:49 | Araq | for example, you can create an array of function pointers at compile-time. close to impossible to accomplish via staticExec |
17:44:15 | FromDiscord_ | <spacepluk> got it 👍 |
17:45:51 | FromDiscord_ | <spacepluk> thanks for making/sharing this, I'm liking everything I see so far 🙂 no idea how I didn't look into it before |
17:46:45 | clyybber | Araq: Im referring to this line: https://github.com/nim-lang/Nim/pull/12781/files#diff-586c73babdc7aadda90947310df85afcR287 |
17:46:47 | disbot | ➥ arc devel 🔱11Araq |
17:47:41 | Araq | clyybber: what's wrong about it? If the type is trivial we don't have to pass a copy to 'sink T'. hmmm |
17:47:56 | Araq | you're right, it's wrong |
17:48:10 | clyybber | Should be p(n)'d |
17:48:40 | Araq | yeah and also it must be copied anyway |
17:49:03 | Araq | as you can 'move(x)' it inside the proc and it must not propagate |
17:49:23 | Araq | but this means we "move" trivial stuff into object constructors |
17:50:08 | clyybber | thats not a problem, isn't it? |
17:53:14 | Araq | it was ugly |
17:53:33 | Araq | it was correct after my bugfix though |
17:53:40 | Araq | now I made it incorrect |
17:53:44 | Araq | great... |
18:00:41 | disruptek | shashlick: seems like the best approach is to use project.nim.cfg for compilation defines and nim.cfg for paths. then nim.cfg doesn't need to be checked-in, but it still applies paths correctly to sub-projects. |
18:09:22 | disruptek | should we lock packages in the environment that we cannot trace to requirements? |
18:28:26 | * | Araq sighs |
18:28:35 | Araq | Nim's exception handling code is full of crap |
18:28:49 | disruptek | no comment. |
18:29:17 | Araq | was written by an amateur who just read about Lisp's condition system |
18:29:24 | Araq | and failed to replicate it |
18:29:40 | disruptek | let's kill her. |
18:31:07 | * | nsf quit (Quit: WeeChat 2.6) |
18:38:38 | clyybber | Araq: Is there a way to import io in the compiler or to make testament print the tests output? |
18:38:59 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
18:39:16 | Araq | testament --print |
18:41:17 | disruptek | leorize: if you feel like bug hunting... i dunno what it is; importing the compiler, or importing libgit2, but nimph really doesn't work all that well in nimsuggest. |
18:44:17 | Araq | we should really say "arc requires quirky exceptions" ... |
18:44:23 | Araq | :-( |
18:44:25 | disruptek | that would be awesome. |
18:44:57 | clyybber | Araq: Fuck yeah! |
18:45:06 | clyybber | I think we really should. |
18:45:15 | rayman22201 | coming out of lurk mode to say I agree :-P |
18:46:20 | Araq | what about the fact that control flow continues after 'raise'? |
18:46:56 | Araq | fix it? but then it's not "quirky" anymore, just a different implementation of real exceptions |
18:49:02 | shashlick | @disruptek so both cfg files get loaded if both exist? |
18:49:10 | disruptek | yeah. |
18:49:15 | shashlick | In what order |
18:49:38 | Araq | btw how can we ensure that C++ gets yet another exception handling mechanism? anybody with direct connections to Herb Sutter? |
18:49:39 | disruptek | depends on path. |
18:49:45 | Araq | er |
18:49:55 | Araq | I meant "ensure that C++ DOES NOT get another" |
18:50:18 | shashlick | Araq is pushing for @include with nimbledeps.cfg which can add additional lock file stuff when we get to it |
18:50:47 | disruptek | i'm increasingly 👎 on @include. |
18:51:04 | shashlick | Allows us to make it optional to check in but simultaneously generic enough to check in as well |
18:51:18 | disruptek | it makes the semantics much more complex and harder to infer for pm. |
18:51:44 | disruptek | it's already optional and generic to check-in. the pm is allowed to hack paths as much as it wants. |
18:53:04 | shashlick | Either that or repurpose an existing file |
18:53:18 | shashlick | Since few are fans here of auto editing a user file |
18:53:23 | shashlick | This is a decent compromise |
18:53:31 | disruptek | no, it's not a compromise. |
18:53:37 | disruptek | it's a capitulation to laziness. |
18:54:07 | shashlick | Everything doesn't need an attack to rationalize |
18:54:27 | disruptek | i can't help it if you attack rationality. |
18:54:46 | Araq | keep it civilized please |
18:55:13 | Araq | so disruptek ... what's wrong with @include? |
18:55:17 | disruptek | what we have works fine; it achieves the semantics we want in the scope we want. |
18:55:37 | Araq | what we have lacks lockfiles |
18:55:40 | disruptek | @include is going to have people @including all kinds of stuff; we won't be able to easily infer what came from where. |
18:56:05 | disruptek | lockfiles are trivial. i've spent all day looking at the same 80 lines of code trying to figure out what i'm missing. |
18:56:26 | Araq | well so enlighten me please |
18:56:51 | Araq | and I don't mean the format you chose for your lockfiles |
18:56:54 | disruptek | project.nim.cfg is only run when building the project, so it's a good place to put anything project-specific. |
18:57:13 | Araq | how do pass the --paths to the compiler? |
18:57:16 | Araq | *do you |
18:57:18 | disruptek | as nim.cfg can be inherited by those projects below, eg. local dependencies, it's nice to put paths there. |
18:57:34 | disruptek | then your local deps can find each other magically, "for free". |
18:58:23 | Araq | so you edit nim.cfg? |
18:58:29 | disruptek | yep. |
18:58:58 | Araq | marked with special comments? |
18:59:19 | disruptek | why bother? it's obvious what the commands do, and there's only one that we need ever add: --path. |
18:59:30 | disruptek | but, sure, i'll put some comments in if you want. |
18:59:52 | disruptek | whaddya want it to say? date+time? $USER? |
19:00:16 | Araq | # edited by imph |
19:00:24 | disruptek | sure. |
19:00:24 | Araq | --path:... |
19:00:30 | Araq | # end |
19:00:59 | disruptek | i don't remove comments, though, so when the paths change, you'll get lotsa cruft building up. |
19:01:27 | disruptek | but, it's your pointless feature. you can deal with it. |
19:01:41 | shashlick | @disruptek local deps inherit parent cfg but not the other way round |
19:01:51 | disruptek | indeed. |
19:02:03 | shashlick | Ok then keep going |
19:02:37 | disruptek | keep going /where/ ? |
19:03:07 | shashlick | This is exactly what I've been proposing - populating cfg with paths with nimble |
19:03:13 | shashlick | He's asking about lock files |
19:03:40 | disruptek | well, i have my entire dependency tree in memory. i can store whatever i want. |
19:03:50 | disruptek | i'm choosing to store the import name, because that seems important. |
19:04:00 | disruptek | also the requirement that fomented the dependency in the first place. |
19:04:19 | disruptek | also the distribution method, because we may want to ignore lockfile records that aren't git. |
19:04:33 | disruptek | also, the source url. |
19:04:40 | planetis[m] | personally I still find try except blocks weird, I mean reasoning which statements inside may raise and which errors should it handle, is puzzle for me. I think quirky exceptions are better than the regular ones, so +1 |
19:04:41 | disruptek | i dunno what else i could possibly want. |
19:05:24 | Araq | disruptek: the problem is that --paths are absolute or guesswork |
19:05:37 | disruptek | can you give me a scenario? |
19:05:39 | planetis[m] | try finally on the other hand is simple |
19:05:54 | * | adeohluwa joined #nim |
19:05:55 | disruptek | s/try:finally/defer:/ |
19:06:02 | Araq | guesswork is bad for lockfiles, absolute is bad if you 'git add' the nim.cfg |
19:06:18 | disruptek | lockfiles aren't about paths. they are about inputs. |
19:06:44 | disruptek | the input is source code. a tree with a certain hash. either something from nimble, or git. |
19:06:58 | Araq | not my point |
19:07:07 | Araq | the point is what you write into the nim.cfg file |
19:07:26 | disruptek | well, that's not my point, either. |
19:07:37 | Araq | either it's --path:abs or --path:rel or --path:$nimbledir/foo |
19:07:40 | disruptek | i write paths in the nim.cfg. if that doesn't satisfy you, i'm sorry. |
19:08:05 | disruptek | i can write absolute paths. i currently optimize paths using whatever substitution fits -- the "closer", the better. |
19:08:13 | Araq | aha |
19:08:16 | disruptek | so i write $config/something or $home/something or whatever. |
19:08:26 | Araq | hmmm |
19:09:15 | disruptek | i have a toggle for writing $nimbledir/ paths, but it's disable by default because $nimbledir is dumb. |
19:09:30 | disruptek | in my opinion, anyway. |
19:09:37 | Araq | it's ambiguous |
19:09:41 | disruptek | indeed. |
19:09:44 | Araq | and that concerns me too |
19:10:23 | shashlick | Only if there's multiple nimble paths |
19:10:29 | shashlick | And clean nimble paths solved that |
19:10:34 | disruptek | nope. |
19:10:42 | disruptek | i use multiple nimblePaths. it's useful. |
19:10:50 | shashlick | Nothing stopping that |
19:10:57 | disruptek | anyway, it's not my problem. you can do whatever you want in nimbleland. |
19:11:17 | Araq | disruptek: I value your opinion though |
19:11:26 | disruptek | i mean that i do not care one way or another. |
19:11:31 | shashlick | 1 nimble path with 1 version of a package with specific --path isn't ambiguous anymore |
19:11:37 | Araq | no need to be snide |
19:11:41 | disruptek | i only created a ticket because the compiler was broken. |
19:11:51 | disruptek | honestly, i'm really fine with whatever. |
19:11:58 | disruptek | just please don't break the compiler. 🤣 |
19:12:49 | shashlick | I'm trying my best not to break anything but it is hard to tell why a proposal is a bad idea this way |
19:13:03 | disruptek | i'm not sure what proposal you're referring to. |
19:13:14 | shashlick | @include does not add any package manager specific functionality |
19:13:31 | Araq | the proposal to add @include to the config file mechanism |
19:13:52 | shashlick | So if it is a bad idea, I'm interested in understanding why |
19:14:03 | disruptek | in order to operate correctly, i need to make many interpretations of localized environments. i depend upon knowing the semantics of these configuration parses. |
19:14:08 | * | spacepluk joined #nim |
19:14:22 | shashlick | I'm considering it since it allows for Nimble stuff to be separate |
19:14:24 | disruptek | that's how i'm able to handle the arbitrary complexity of myriad paths, packages, etc. |
19:14:42 | disruptek | i've yet to hear a scenario which demands this greater complexity. |
19:14:45 | Araq | which your PM would deal with by the fact that you use the compiler's API to parse the config files, but that doesn't mean @include is a good idea, it's yet another feature |
19:14:46 | shashlick | Your concern is that you will need to load it as well to infer the env |
19:15:07 | disruptek | my concern is that i will no longer be able to make assumptions about the semantics. |
19:15:19 | shashlick | It is being proposed to enable separation |
19:15:25 | disruptek | it's unnecessary as far as i can tell. |
19:15:54 | disruptek | you can repeat yourself, but that's not the same as an example which proves your point. i could really use one of those. |
19:15:55 | shashlick | You are saying put stuff in Nim.cfg |
19:16:32 | disruptek | i'm not telling you what to do. you tell me the problem @include solves. if you cannot do that, well, i don't know what to say. |
19:16:33 | Araq | disruptek: the example is basiscally "Nimble adds @include lockfilepaths to your nim.cfg" |
19:16:47 | Araq | that's why I brought it up |
19:16:51 | disruptek | why don't we just have the compiler load it, then? |
19:16:58 | disruptek | that's a simpler semantic. |
19:17:16 | Araq | because then it's another special case in my compiler |
19:17:20 | shashlick | Cause then compiler is more married to nimble and we are trying to reduce that |
19:17:57 | disruptek | i see all kinds of contents being added to @include'd files. i see loops, inclusions outside the current path, on and on and on. |
19:18:07 | disruptek | sounds like a mess to me. |
19:18:55 | disruptek | if the compiler can present to me the parse order of all targets, such that i can perform my own evaluations, then i'm fine with anything. |
19:19:08 | disruptek | i'll support @include, i mean. |
19:20:13 | Araq | well to be honest, I don't like @include, nor $nimblepath. the simplest way that can possibly work for me is "assume dependency X is in ../X" |
19:20:54 | disruptek | the only reason nimph needs to add --path to nim.cfg is to point to packages that have a src/ subdirectory which represents the "import root". |
19:20:55 | Araq | it's how I've seen most people setup these things anyway, nothing wrong with enforcing it for lockfile support |
19:21:07 | disruptek | this has nothing at all to do with lockfiles. |
19:21:33 | Araq | or for "I want to use Nimble's usecfg" for that matter |
19:21:34 | disruptek | lockfiles aren't about paths. they are about inputs to the compiler. code. not where that code happens to sit on the filesystem. |
19:22:05 | Araq | well yes, as I said, for "I want to use <new Nimble stuff>" |
19:22:16 | disruptek | if a lockfile assumes that the contents of two paths are equal because their names math, then that's a defect. |
19:22:24 | disruptek | s/math/match/ |
19:23:10 | Araq | well you said it yourself, lockfiles have little to do with "let's have working relative paths" |
19:23:16 | disruptek | correct. |
19:23:45 | disruptek | look, if you want to remove --nimblePath, i will be sad to see it go, but it won't really hurt what i'm able to provide with nimph. |
19:23:51 | disruptek | it'll just make life harder for the user. |
19:24:07 | disruptek | however, this @include thing is going to make life harder for me if it's implemented poorly. |
19:24:37 | disruptek | so that's why i'm pushing back upon it. |
19:26:42 | Araq | shashlick: any opinion on my remarks about relative paths? |
19:27:08 | * | spacepluk quit (Quit: leaving) |
19:28:36 | * | spacepluk joined #nim |
19:29:22 | disruptek | i honestly don't know what "working relative paths" means. |
19:31:01 | disruptek | the only path that doesn't work for me is --outdir, because the compiler doesn't perform pathSubs on it. |
19:31:03 | Araq | ok whatever, I need to watch Indiana Jones 1 now |
19:31:09 | disruptek | have fun. |
19:33:34 | shashlick | sorry on a call, will check in 30 |
19:37:03 | spacepluk | I'm looking at this: https://github.com/ephja/nim-glfw/blob/master/glfw/wrapper.nim |
19:37:25 | spacepluk | is there any tool that let's you wrap c/cpp lib using the original build system? |
19:38:24 | Araq | spacepluk: yes but the "original build system" is usually less portable than the rest of the C/C++ codebase |
19:42:09 | spacepluk | the thing is that some project go really crazy with defines and options that change the deps that are linked |
19:42:16 | spacepluk | it's just a lot of work to keep that in sync |
19:43:31 | spacepluk | it would be nice if you just could add a git submodule with the original source and only add the nim wrappers without having to deal with that |
19:44:18 | disruptek | !repo nimterop |
19:44:19 | disbot | https://github.com/nimterop/nimterop -- 9nimterop: 11Nimterop is a Nim package that aims to make C/C++ interop seamless 15 131⭐ 7🍴 7& 3 more... |
19:45:18 | spacepluk | that looks perfect, thanks! |
19:47:20 | * | ng0 joined #nim |
20:03:59 | * | NimBot joined #nim |
20:06:04 | * | nsf joined #nim |
20:25:04 | lqdev[m] | I added the ability to call Wren from Nim in euwren, what do you think? https://github.com/liquid600pgm/euwren#retrieving-variables |
20:25:13 | shashlick | @disruptek - looks right? https://github.com/nim-lang/Nim/compare/devel...genotrance:pathSubs?expand=1 |
20:26:19 | shashlick | @Araq - not sure what the specific question is wrt relative paths |
20:27:49 | * | letto quit (Read error: Connection reset by peer) |
20:30:00 | * | letto joined #nim |
20:32:05 | disruptek | shashlick: we should probably be using that expandTilde in pathSubs, right? |
20:34:26 | * | adeohluwa quit (Remote host closed the connection) |
20:37:39 | shashlick | It's in path subs as well |
20:37:59 | disruptek | i know it's expanded there, but it's kinda hackish iirc. |
20:38:05 | disruptek | anyway, up to you. |
20:38:23 | disruptek | i think that pr is a good one. 👍 |
20:39:41 | shashlick | I should replace the path subs stuff to call expand tilde |
20:39:51 | disruptek | that was my thought, yes. |
20:40:36 | disruptek | are there any other cases where we don't call processPath? |
20:41:17 | shashlick | I looked but didn't see any that stood out |
20:41:31 | disruptek | weird. |
20:41:32 | * | nsf quit (Quit: WeeChat 2.6) |
20:42:50 | disruptek | i would give that notRelativeToProj an explicit = in the call. |
20:42:54 | disruptek | just a style nit. |
20:43:42 | disruptek | i actually changed that proc in my fork once and it was annoying. |
20:46:46 | clyybber | Araq: I think your changes in moveOrCopy for conversions are wrong. |
20:50:20 | * | thomasross is now known as Guest17240 |
20:50:21 | * | Guest17240 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
20:50:29 | * | thomasross joined #nim |
20:56:41 | clyybber | Hmm, or maybe not.. |
20:57:45 | * | narimiran quit (Ping timeout: 268 seconds) |
21:01:41 | FromDiscord_ | <Kaynato> There's also the "nimline" by fragcolor. Not sure where that stands relative to nimterop |
21:07:12 | * | couven92 joined #nim |
21:09:49 | FromDiscord_ | <exelotl> is raiseassert intended for general usage? |
21:10:32 | * | Vladar quit (Quit: Leaving) |
21:10:49 | FromDiscord_ | <exelotl> e.g. if my case statement fails in advent of code, I just want a quick and simple way to raise an error with a message and terminate the program |
21:12:40 | * | fredrik92 joined #nim |
21:12:47 | * | fredrik92 quit (Remote host closed the connection) |
21:14:56 | * | couven92 quit (Ping timeout: 240 seconds) |
21:20:04 | * | abm quit (Remote host closed the connection) |
21:20:32 | * | abm joined #nim |
21:24:44 | * | zielmicha[m]1 quit (Ping timeout: 240 seconds) |
21:24:44 | * | joachimschmidt55 quit (Ping timeout: 240 seconds) |
21:27:56 | * | tane quit (Quit: Leaving) |
21:28:01 | * | abm quit (Quit: Leaving) |
21:41:12 | * | ntm joined #nim |
21:50:08 | * | Kaivo quit (Quit: WeeChat 2.6) |
21:50:21 | * | luis_ joined #nim |
21:53:23 | * | nif quit (Quit: ...) |
21:53:32 | * | nif joined #nim |
21:56:33 | clyybber | Araq: I made my PR against your branch, so you can merge it into your PR if you want: #12793 |
21:56:34 | disbot | https://github.com/nim-lang/Nim/pull/12793 -- 3Refactor injectdestructors @11Clyybber |
21:59:54 | * | beatmox quit (Remote host closed the connection) |
22:00:25 | * | beatmox joined #nim |
22:13:21 | * | Trustable quit (Remote host closed the connection) |
22:18:18 | * | nif quit (Quit: ...) |
22:18:27 | * | nif joined #nim |
22:20:16 | disruptek | parsetoml writes toml files that it cannot read. 🙄 |
22:22:47 | disruptek | man, i get tired of problems like this. |
22:26:23 | FromDiscord_ | <yewpad> |
22:26:23 | FromDiscord_ | <yewpad> https://cdn.discordapp.com/attachments/371759389889003532/651187432607186973/unknown.png |
22:26:26 | FromDiscord_ | <yewpad> |
22:26:26 | FromDiscord_ | <yewpad> https://cdn.discordapp.com/attachments/371759389889003532/651187445479505940/unknown.png |
22:27:02 | FromDiscord_ | <yewpad> Don't know about you but the first one looks a bit more pleasing to me than the second one where the first is the edited version of Nim's doc standard design |
22:27:25 | disruptek | i can't grok either of them because discord. |
22:27:50 | FromDiscord_ | <yewpad> Discord's compression? On the phone? |
22:28:39 | FromDiscord_ | <yewpad> Oh wait, the bot doesn't include send you guys images that were posted in Discord? |
22:29:00 | disruptek | it does, but they are hugely blown up on my screen. |
22:29:06 | * | solitudesf quit (Ping timeout: 252 seconds) |
22:29:16 | FromDiscord_ | <yewpad> Hold the phone for a sec |
22:29:38 | FromDiscord_ | <yewpad> https://imgur.com/jiEBrGX |
22:29:48 | disruptek | i'm on a 4k display and i have to scroll horizontally... it's bananas. |
22:29:54 | FromDiscord_ | <yewpad> xD |
22:29:57 | disruptek | thanks. |
22:30:22 | disruptek | i like the 2nd one. |
22:30:30 | FromDiscord_ | <yewpad> left or right one |
22:30:37 | disruptek | the right. |
22:30:48 | disruptek | what did you change? |
22:31:29 | FromDiscord_ | <yewpad> You sure? The right one feels like it would jump into my face but I figure that it is better for you because you've got yourself a 4k display where fonts are rendered/displayed differently |
22:31:50 | FromDiscord_ | <yewpad> I changed the font sizes of the body and code snippets |
22:32:35 | * | nif quit (Quit: ...) |
22:32:45 | * | nif joined #nim |
22:32:47 | disruptek | i just like large fonts. i'm old and i work hard enough at just writing code; i don't want to struggle to read, too. |
22:33:21 | FromDiscord_ | <yewpad> Fair enough |
22:34:02 | disruptek | the manual doesn't look great on my display, probably because of my font size. |
22:34:34 | disruptek | i promised araq i wouldn't read the manual, though, so it's not a problem. |
22:35:12 | FromDiscord_ | <yewpad> I'd like to re-design the manual so that it fits more the homepage and playground style with this cool dark blue-ish color and Dracula syntax |
22:35:47 | disruptek | dracula syntax sounds bloody awesome. |
22:36:29 | FromDiscord_ | <yewpad> |
22:36:29 | FromDiscord_ | <yewpad> https://cdn.discordapp.com/attachments/371759389889003532/651189974107947008/tumblr_n00ugclrKG1rpwm80o1_250.jpg |
22:36:30 | disruptek | what's the point of lockfiles if you can write them but not read them? |
22:36:41 | FromDiscord_ | <yewpad> I'll just have to figure out how to change the design |
22:40:26 | disruptek | css. |
22:42:05 | disruptek | !repo toml |
22:42:06 | disbot | https://github.com/NimParsers/parsetoml -- 9parsetoml: 11A Nim library to parse TOML files 15 53⭐ 9🍴 7& 3 more... |
22:42:17 | disruptek | !repos toml |
22:42:18 | disbot | https://github.com/NimParsers/parsetoml -- 9parsetoml: 11A Nim library to parse TOML files 15 53⭐ 9🍴 |
22:42:19 | disbot | https://github.com/judofyr/toml.nim -- 9toml.nim: 11TOML parser for Nim 15 6⭐ 0🍴 |
22:42:20 | disbot | https://github.com/alaviss/toml -- 9toml: 11Nim TOML parser 15 0⭐ 0🍴 7& 1 more... |
22:43:55 | disruptek | well, json it is! good thing everything in the backend is already json. stupid toml. |
22:44:07 | disruptek | pointless anyway -- you can't add comments to it! |
22:49:25 | FromDiscord_ | <yewpad> 😄 |
22:50:06 | disruptek | yay, it works. honestly, it even renders better. |
22:52:06 | madprops | love how i could easily just use generics |
22:52:16 | disruptek | yeah, they are nice. |
22:52:37 | madprops | im using it for some echo alias though maybe i should use something like "printable" or "stringable" or something |
23:02:57 | * | abm joined #nim |
23:04:11 | * | nixfreak86 quit (Ping timeout: 260 seconds) |
23:07:59 | * | luis_ quit (Ping timeout: 276 seconds) |
23:08:37 | * | luis_ joined #nim |
23:10:45 | * | dddddd quit (Remote host closed the connection) |
23:14:42 | FromDiscord_ | <yewpad> https://imgur.com/tWQ4a2e |
23:14:45 | FromDiscord_ | <yewpad> Making progress |
23:14:51 | FromDiscord_ | <yewpad> Love it already, and my eyes too |
23:15:28 | disruptek | that looks great, but then again, i'm using dark reader. |
23:19:45 | * | luis_ quit (Ping timeout: 246 seconds) |
23:19:59 | madprops | please make it in a way where i can cook up some script to make a POST request and receive a url |
23:26:05 | FromDiscord_ | <yewpad> ? |
23:28:51 | madprops | for instance i would make a script to read from my clipboard and post it on nimpastr |
23:29:01 | madprops | and then get the url in my clipboard ready to share |
23:32:15 | FromDiscord_ | <yewpad> AH |
23:32:15 | FromDiscord_ | <yewpad> sure |
23:32:30 | FromDiscord_ | <yewpad> I thought you were talking about the design xd |
23:43:44 | madprops | also you talked about checking the code? |
23:43:53 | madprops | what if i want to just show some out of context code |
23:43:59 | madprops | which won't compile |
23:44:51 | disruptek | i wrote an ix paster in nim that does all that. |
23:44:56 | disruptek | !repo disruptek/xs |
23:44:57 | disbot | https://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 1⭐ 0🍴 |
23:45:03 | disruptek | see `ix` |
23:45:58 | madprops | oh cool |
23:46:00 | madprops | i'll check it out |
23:48:15 | FromDiscord_ | <yewpad> Whatcha sayin'? |
23:48:15 | FromDiscord_ | <yewpad> https://imgur.com/tF1Lffq |
23:48:20 | FromDiscord_ | <yewpad> Love it |
23:48:52 | FromDiscord_ | <yewpad> https://imgur.com/7Hjcz78 |
23:49:10 | madprops | disruptek: https://paste.merkoba.com/1575330543-rohiyu-1 |
23:49:14 | madprops | this happens on nimble install |
23:52:39 | madprops | maybe i need some dbus dev packages |
23:57:48 | * | abm quit (Quit: Leaving) |