00:02:43 | FromDiscord | <theangryepicbanana> it seems to be caused by `=sink` |
00:02:48 | FromDiscord | <theangryepicbanana> or just sink semantics in general |
00:02:53 | FromDiscord | <Elegantbeef> Yes |
00:03:11 | FromDiscord | <theangryepicbanana> however, it's actually due to the `Value` type rather than `Dec64` |
00:03:29 | FromDiscord | <Elegantbeef> If you `move someParam` it forces it to be moved and 0's the source of the move |
00:04:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=45DH |
00:04:22 | FromDiscord | <Elegantbeef> `a == default(SomeObject)`\ |
00:05:10 | FromDiscord | <theangryepicbanana> so then why is it happening with this |
00:11:11 | FromDiscord | <salt rock lamp> what happens if you call a nim function from c, but the nim function raises a nim exception? |
00:12:27 | FromDiscord | <Elegantbeef> Unhandled exceptions are unhandled |
00:12:43 | FromDiscord | <Elegantbeef> If you want to ensure your Nim procedure doesnt crash annotate it with `{.raises: [].}` |
00:13:00 | FromDiscord | <Elegantbeef> Banana if you want manually `move`ing it should copy when it sinks |
00:15:11 | FromDiscord | <Elegantbeef> if you arent manually\ |
00:16:49 | FromDiscord | <theangryepicbanana> ok |
00:18:07 | FromDiscord | <theangryepicbanana> hmm so doing `mySeq[^1] = move value` copies, but `mySeq.add move value` sinks |
00:18:12 | FromDiscord | <theangryepicbanana> annoying |
00:18:29 | FromDiscord | <Elegantbeef> No both should sink |
00:18:40 | FromDiscord | <Elegantbeef> the usage of `move` enforces a sink |
00:18:42 | FromDiscord | <theangryepicbanana> well one works and one doesn't |
00:19:51 | FromDiscord | <theangryepicbanana> wack |
00:20:24 | FromDiscord | <theangryepicbanana> oh, assigning works without move |
00:20:25 | FromDiscord | <theangryepicbanana> ??? |
00:21:22 | FromDiscord | <theangryepicbanana> sent a code paste, see https://play.nim-lang.org/#ix=45DK |
00:21:22 | FromDiscord | <Arathanis> nimble removes quotation marks from passthrough commands, rip |
00:22:16 | FromDiscord | <Elegantbeef> Both are sink'd parameters so both should worrk |
00:23:01 | FromDiscord | <theangryepicbanana> that's so weird |
00:23:14 | FromDiscord | <Elegantbeef> It might be a bug with sink analysis |
00:23:14 | FromDiscord | <Arathanis> well whats happening is if I do this:↵`nimble build --passL:"-L. -lasdf"` |
00:23:25 | FromDiscord | <Elegantbeef> But if you can min repro it i'd take a more assertive message |
00:23:29 | FromDiscord | <Arathanis> its removing the quotes and doing `nim c --passL:-L. -lasdf` |
00:24:02 | FromDiscord | <Arathanis> and then the compiler complains that `-l` needs an argument cause its see it as `nim c -l` |
00:24:06 | FromDiscord | <Arathanis> cause the quotes are gone |
00:24:16 | FromDiscord | <Elegantbeef> Use a `config.nims` |
00:24:42 | FromDiscord | <Arathanis> aww but then I have to watch the incorrect import errors :P |
00:25:11 | FromDiscord | <Arathanis> I have gotten it working with a nimble task that does it correctly |
00:26:27 | FromDiscord | <theangryepicbanana> sent a code paste, see https://play.nim-lang.org/#ix=45DL |
00:27:46 | FromDiscord | <Yardanico> wait, are you using refc? |
00:27:58 | FromDiscord | <theangryepicbanana> I'm pretty sure it's orc |
00:28:07 | FromDiscord | <theangryepicbanana> oh, yeah |
00:28:20 | FromDiscord | <Yardanico> because `genericAssign` is not emitted with ARC/ORC |
00:28:24 | FromDiscord | <theangryepicbanana> hmm |
00:28:30 | FromDiscord | <theangryepicbanana> should I try switching to it? |
00:28:56 | FromDiscord | <Yardanico> do you see any `eqcopy` or `eqsink` in the generated C? |
00:29:11 | FromDiscord | <Yardanico> if no, then you're not using arc/orc so there's no sink/move analysis, proper destructors, etc |
00:29:42 | FromDiscord | <theangryepicbanana> yeah I see a bit of both |
00:29:58 | FromDiscord | <Yardanico> oh then it's orc I guess, sorry |
00:30:49 | FromDiscord | <theangryepicbanana> no it seemed to be refc |
00:31:00 | FromDiscord | <theangryepicbanana> switching to orc makes it crash elsewhere |
00:31:40 | FromDiscord | <theangryepicbanana> oh there we go |
00:31:44 | FromDiscord | <theangryepicbanana> that works, thanks |
00:58:01 | * | pch joined #nim |
01:48:52 | * | genpaku quit (Read error: Connection reset by peer) |
01:52:42 | * | genpaku joined #nim |
02:04:31 | * | byanka quit (Read error: Connection reset by peer) |
02:12:37 | FromDiscord | <Professor Actual Factual> sent a code paste, see https://play.nim-lang.org/#ix=45DZ |
02:15:45 | FromDiscord | <Elegantbeef> It's probably that it's a generic procedure |
02:16:08 | FromDiscord | <Elegantbeef> It does not know which `concat` it's using until instantiation |
02:17:51 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=45E0 |
02:18:36 | FromDiscord | <Professor Actual Factual> In reply to @Elegantbeef "It does not know": Oddly enough, by looking at references. It is able to find a single `concat` from the lib, but not `ones`↵Regardless of reasons why this happens, is there any way to work aronud this, its a huge productivity killer |
02:19:11 | FromDiscord | <Professor Actual Factual> Modifying the library is not an option here :L |
02:19:28 | FromDiscord | <Elegantbeef> This is just a thing with generics and overloads |
02:20:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=45E1 |
02:21:05 | FromDiscord | <huantian> yeah generics and jump to def are always kind of a pain |
02:21:26 | FromDiscord | <Elegantbeef> There isnt much of a solution either |
02:21:55 | FromDiscord | <Professor Actual Factual> 😦↵Back to googling documentation i guess, thanks for the help :/ |
02:22:02 | FromDiscord | <Elegantbeef> Why googling? |
02:22:13 | FromDiscord | <Elegantbeef> Open up the source code in your text editor and use search there |
02:22:22 | FromDiscord | <Professor Actual Factual> Google is faster |
02:22:27 | FromDiscord | <Elegantbeef> It's really not |
02:22:29 | FromDiscord | <Professor Actual Factual> esp on split screen |
02:23:31 | FromDiscord | <Professor Actual Factual> Ah I see you are correct for the most part, however the arraymancer documentation has its own HTML page via docgen |
02:25:47 | FromDiscord | <!Patitotective> i still live in 2002, i dont use any extension to tell me definitions or that stuff↵i open the docs in firefox |
02:25:59 | FromDiscord | <Elegantbeef> Well bless your slow heart |
02:26:26 | FromDiscord | <!Patitotective> its because nimlsp totally breaks in sublime |
02:26:42 | FromDiscord | <Elegantbeef> Works fine with kate ime |
02:26:43 | FromDiscord | <!Patitotective> so it blocks sublime built-in recommendations and its worse |
02:26:45 | FromDiscord | <ghoom> can one define a template that works like a method? |
02:26:51 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Works fine with kate": :[ |
02:26:58 | FromDiscord | <!Patitotective> In reply to @ghoom "can one define a": no?... |
02:26:58 | FromDiscord | <Elegantbeef> All callables work with method syntax |
02:27:05 | FromDiscord | <ghoom> shweet |
02:27:10 | FromDiscord | <huantian> In reply to @Elegantbeef "There isnt much of": we have two generic systems, one with no mixin-ing and one with mixin-ing |
02:27:17 | FromDiscord | <huantian> ez |
02:27:23 | FromDiscord | <Elegantbeef> Lol |
02:27:32 | FromDiscord | <Elegantbeef> The issue is Nim implicitly mixins 😄 |
02:27:44 | FromDiscord | <Elegantbeef> But it also implicitly binds |
02:27:51 | * | rockcavera joined #nim |
02:29:13 | FromDiscord | <ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45E5 |
02:29:19 | FromDiscord | <Elegantbeef> No |
02:29:23 | FromDiscord | <ghoom> (edit) "https://play.nim-lang.org/#ix=45E5" => "https://play.nim-lang.org/#ix=45E6" |
02:29:31 | FromDiscord | <ghoom> that would be neat |
02:29:58 | FromDiscord | <Elegantbeef> I mean you can always cheat if you really wanted to |
02:30:21 | FromDiscord | <ghoom> cheat how |
02:31:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=45E7 |
02:32:01 | FromDiscord | <Elegantbeef> that should be `args {.inject.}: typeof(arguments)` |
02:32:25 | FromDiscord | <ghoom> ok |
02:32:38 | FromDiscord | <KepKep> I know it's not a nim question but I wanted to try out nvim and I'm so confused rn is it supposed to just run in your command prompt like this? https://media.discordapp.net/attachments/371759389889003532/1001316080448458854/unknown.png |
02:32:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=45E8 |
02:32:41 | FromDiscord | <Elegantbeef> God damn indented wrong |
02:32:53 | FromDiscord | <ghoom> take it ez |
02:32:53 | FromDiscord | <Elegantbeef> Yes nvim is a tui |
02:33:11 | FromDiscord | <huantian> also please don't use like |
02:33:16 | FromDiscord | <huantian> command prompt |
02:33:20 | FromDiscord | <huantian> at least use windows terminal |
02:33:28 | FromDiscord | <KepKep> I'm intrigued but confused |
02:33:29 | FromDiscord | <ghoom> XD |
02:33:48 | FromDiscord | <ghoom> naw dis guy's a real hacker 😎 |
02:33:57 | FromDiscord | <ghoom> he don't need to fancy windows terminal |
02:34:04 | FromDiscord | <ghoom> (edit) "to" => "no" |
02:34:16 | FromDiscord | <KepKep> I'm completely new to this I've been usually just using vsc |
02:34:17 | FromDiscord | <ghoom> amirite kepkep |
02:34:53 | FromDiscord | <huantian> you might wanna checkout programs like <https://github.com/LunarVim/LunarVim> |
02:34:57 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Yes nvim is a": nvim is a concept |
02:35:03 | FromDiscord | <huantian> which help with a lot of configuring |
02:36:45 | FromDiscord | <KepKep> I think I might wanna stick to just being a mouse pleb :PikaDerp: |
02:37:02 | FromDiscord | <!Patitotective> just use the minimap 😎 |
02:37:05 | NimEventer | New thread by Morturo: Downloading big files, see https://forum.nim-lang.org/t/9327 |
02:37:11 | FromDiscord | <huantian> how does minimap help you code |
02:37:55 | FromDiscord | <ghoom> exactly |
02:37:56 | FromDiscord | <huantian> but I would definitely recommend a proeconfigured vim thingy |
02:38:05 | FromDiscord | <huantian> so you don't have to spend time making it look good |
02:38:06 | FromDiscord | <!Patitotective> In reply to @huantian "how does minimap help": it makes you think of your code as a whole and not only the section you're watching 🧐 |
02:38:22 | FromDiscord | <Elegantbeef> I've seen your code you don think about it atall↵(@!Patitotective) |
02:38:27 | FromDiscord | <ghoom> i only use it as an easy-to-click scrollbar |
02:38:35 | FromDiscord | <ghoom> :p |
02:38:42 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "I've seen your code": :[ |
02:39:24 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "I've seen your code": gave up on writing lmao |
02:44:56 | FromDiscord | <ghoom> hey what does `out` do? |
02:45:04 | FromDiscord | <ghoom> i noticed it gets highlighted |
02:45:05 | FromDiscord | <Elegantbeef> Nothing it's reserved |
02:45:11 | FromDiscord | <ghoom> for what |
02:45:26 | FromDiscord | <Elegantbeef> Definite assignment variables |
02:45:35 | FromDiscord | <ghoom> what |
02:45:52 | FromDiscord | <Elegantbeef> Definite assignment parameters |
02:46:03 | FromDiscord | <ghoom> what are thoose |
02:46:11 | FromDiscord | <ghoom> 👀 |
02:46:12 | FromDiscord | <Elegantbeef> Parameters that are checked and ensured to be assigned |
02:46:30 | FromDiscord | <ghoom> but why is it reserved lol |
02:46:34 | FromDiscord | <ghoom> 😭 |
02:46:43 | FromDiscord | <Elegantbeef> Cause it might become used eventually |
02:46:48 | FromDiscord | <ghoom> mk |
02:46:54 | FromDiscord | <ghoom> hopefully |
02:46:58 | FromDiscord | <Elegantbeef> Not really |
02:48:13 | FromDiscord | <ghoom> damn it |
02:48:48 | FromDiscord | <KepKep> head hurty nvim hard , give back mouse :SadCat: |
02:49:45 | FromDiscord | <ghoom> learning to use the keyboard for everything really pays off mate |
02:50:03 | FromDiscord | <ghoom> kepkep, train hard my man |
02:50:19 | FromDiscord | <!Patitotective> In reply to @KepKep "head hurty nvim hard": R no |
02:50:45 | FromDiscord | <KepKep> I'm just like highly confused, is there any real difference between vim and nvim or can I look at vim tutorials too to try to figure out what the hell is going in |
02:50:48 | FromDiscord | <KepKep> (edit) "in" => "on" |
02:51:09 | FromDiscord | <ghoom> yeah nvim has all stuff vim has |
02:51:13 | FromDiscord | <ghoom> plus more |
02:51:25 | FromDiscord | <ghoom> so you're fine looking at vim tuts |
02:51:34 | FromDiscord | <Elegantbeef> You dont look at tutorials you look up shortcuts! 😄 |
02:51:43 | FromDiscord | <ghoom> yes |
02:52:03 | FromDiscord | <!Patitotective> In reply to @KepKep "I'm just like highly": nvim is a fork of vim focused on community contributing and fix major vim issues |
02:52:14 | FromDiscord | <!Patitotective> its meant to be fully compatible |
02:52:19 | FromDiscord | <KepKep> brother I spent like 3 min looking at my console window confused untill it hit me that THAT is nvim |
02:53:13 | FromDiscord | <KepKep> well thanks I'll go look at some beginner tutorials to figure out how to start using this |
02:53:51 | FromDiscord | <!Patitotective> :Tutor |
02:53:56 | FromDiscord | <!Patitotective> 30 minutes tutorial |
02:54:04 | FromDiscord | <KepKep> learning nim and vim together just so I can tell people I code nim in vim cause it sounds funny :RatirlBusiness: |
02:54:13 | FromDiscord | <ghoom> indeed |
02:54:19 | FromDiscord | <ghoom> nim'ndeed |
02:54:37 | FromDiscord | <ghoom> nimdeed |
02:55:30 | FromDiscord | <Rika> In reply to @Patitotective "its meant to be": It isn’t though |
02:56:01 | FromDiscord | <Rika> Some Vim 8/9 duplicate features aren’t mirrored in Neovim of course |
02:57:13 | FromDiscord | <KepKep> been enjoying reading through the nim stuff tho , didn't read much cause of time but seems cool, even a pepega pyton enjoyer like me can understand most of it |
02:57:37 | FromDiscord | <KepKep> brain struggles to mash C like performance with Indent syntax tho |
03:04:16 | FromDiscord | <ghoom> lol |
03:04:41 | FromDiscord | <ghoom> yo can one specify parameter types in template definitions? |
03:04:59 | FromDiscord | <Elegantbeef> Yes... |
03:06:02 | FromDiscord | <ghoom> phew |
03:06:19 | FromDiscord | <ghoom> i thought it was strictly like c macros |
03:12:34 | FromDiscord | <ghoom> sent a code paste, see https://paste.rs/2QL |
03:12:44 | FromDiscord | <ghoom> (edit) "https://play.nim-lang.org/#ix=45Eg" => "https://paste.rs/6LE" |
03:12:45 | FromDiscord | <huantian> no not like that |
03:14:39 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=45Eh |
03:14:53 | FromDiscord | <huantian> (edit) "https://play.nim-lang.org/#ix=45Eh" => "https://play.nim-lang.org/#ix=45Ei" |
03:15:36 | FromDiscord | <huantian> the return variable of `makeIncrementer` is a closure proc implicitly↵this closure captured the variable `n` and is able to access and modify `n`'s value even after `makeIncrementer` has finished |
03:16:07 | FromDiscord | <ghoom> ooh ok |
03:16:10 | FromDiscord | <Arathanis> i think the problem is 2-fold:↵↵1. X needs to be defined before the closure using it↵2. blocks create scope so even if you reordered the blocks it wont work since they are different scopes |
03:16:11 | FromDiscord | <Arathanis> https://media.discordapp.net/attachments/371759389889003532/1001327042450702366/unknown.png |
03:17:11 | FromDiscord | <Arathanis> in this case you could just use a global |
03:17:24 | FromDiscord | <Arathanis> and what @huantian sent is a more realistic use of a closure |
03:17:51 | FromDiscord | <ghoom> 🐸👍 |
03:44:10 | * | arkurious quit (Quit: Leaving) |
03:55:09 | FromDiscord | <halc> is there a cleaner way to get a `NimNode`'s children as a `seq` or any kind of `OpenArray`-compatible other than `node.children.toSeq`? |
03:55:27 | FromDiscord | <halc> (edit) "other" => "type" |
03:55:45 | FromDiscord | <halc> (edit) "is there a cleaner way ... totype?" added "than `node.children.toSeq`" | "type than `node.children.toSeq`?" => "type?" |
03:55:57 | FromDiscord | <Elegantbeef> Not that i know of |
04:08:33 | FromDiscord | <# Luke> how can i split an image diagnally and only keep 1 half of it |
04:09:11 | FromDiscord | <!Patitotective> pixie? and some search for an algorithm lol |
04:09:23 | * | FromDiscord quit (Remote host closed the connection) |
04:09:37 | * | FromDiscord joined #nim |
04:26:40 | FromDiscord | <ghoom> halp `'args' is of type <varargs[string]> which cannot be captured as it would violate memory safety` |
04:26:58 | FromDiscord | <Elegantbeef> `seq[T]` instead |
04:27:04 | FromDiscord | <ghoom> 😭 |
04:27:12 | FromDiscord | <ghoom> looks less sexy |
04:27:27 | FromDiscord | <Elegantbeef> i mean you can take in varargs but then do `let myargs = args.toSeq` |
04:27:31 | FromDiscord | <Elegantbeef> Or rather `@args` |
04:30:30 | FromDiscord | <ghoom> the problem is that the args are varargs |
04:30:39 | FromDiscord | <Elegantbeef> The above solves that |
04:30:47 | FromDiscord | <ghoom> nah |
04:31:16 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=45Eo |
04:31:20 | FromDiscord | <Elegantbeef> `varargs[auto]` |
05:36:42 | FromDiscord | <ghoom> how do i install a local package globally? |
05:45:38 | FromDiscord | <Rika> nimble develop↵Inside the package directory |
05:49:12 | FromDiscord | <wiga> is there inline variables in nim? |
05:49:25 | FromDiscord | <wiga> like ${} in node or {} in python |
05:49:54 | FromDiscord | <wiga> i looked on google and found nothing so idk if i miss smth or its just not existant |
05:51:06 | FromDiscord | <Rika> strformat module |
05:51:20 | FromDiscord | <Rika> similar format as python |
05:52:05 | FromDiscord | <wiga> ty |
05:52:25 | FromDiscord | <Rika> 👌 |
05:52:38 | FromDiscord | <ghoom> In reply to @Rika "nimble develop Inside the": didnt work |
05:52:46 | FromDiscord | <Rika> What happened |
06:02:56 | * | estiquelapice quit () |
06:20:23 | FromDiscord | <Arathanis> how the heck does nimsuggest work |
06:29:09 | FromDiscord | <creikey> In reply to @Arathanis "how the heck does": https://www.mturk.com/ |
06:29:34 | FromDiscord | <wiga> is it possible to get the length of a table? |
06:29:52 | FromDiscord | <huantian> https://nim-lang.org/docs/tables.html#len%2CTable%5BA%2CB%5D |
06:30:00 | FromDiscord | <huantian> `table.len` |
06:30:07 | FromDiscord | <wiga> i tried |
06:30:16 | FromDiscord | <wiga> didnt worked |
06:30:30 | FromDiscord | <huantian> how did it not work |
06:30:35 | FromDiscord | <huantian> is there an error |
06:30:51 | FromDiscord | <wiga> https://media.discordapp.net/attachments/371759389889003532/1001376031158063104/unknown.png |
06:30:59 | FromDiscord | <wiga> https://media.discordapp.net/attachments/371759389889003532/1001376065538768896/unknown.png |
06:31:11 | FromDiscord | <huantian> did you `import std/tables`? |
06:31:36 | FromDiscord | <wiga> 😅 no |
06:31:40 | FromDiscord | <wiga> ty tho |
06:31:52 | FromDiscord | <huantian> all good easy problem to make |
06:31:53 | FromDiscord | <wiga> i should really sleep more lol |
06:32:07 | FromDiscord | <huantian> also curious, what does intToStr do? |
06:32:18 | FromDiscord | <wiga> takes an int |
06:32:26 | FromDiscord | <wiga> and transform it to a string |
06:32:37 | FromDiscord | <huantian> is it the same as `$` on ints? |
06:32:50 | FromDiscord | <wiga> dunno |
06:33:00 | FromDiscord | <wiga> i just saw it in my intellisense |
06:33:04 | FromDiscord | <wiga> and used it lol |
06:33:10 | FromDiscord | <huantian> cus if there's no fancy logic you could just do `$g.members.len` |
06:33:35 | FromDiscord | <wiga> it does the same thing ig |
06:34:09 | FromDiscord | <wiga> it does in fact the same thing |
06:34:31 | FromDiscord | <huantian> oh I see, `intToStr` has an optional argument that lets you pad out the int with leading zeros |
06:35:11 | FromDiscord | <wiga> i didnt dug too deep, i just saw "intToStr" and i was like "it does what i want" so i used it |
06:35:22 | FromDiscord | <huantian> so if you don't need the padding I think you can just use `$` |
06:35:22 | FromDiscord | <wiga> never knew $ was doing that tho |
06:35:51 | FromDiscord | <huantian> yeah `$` is the general nim string-ifier, the same as C#'s `ToString()` and python's `str()` |
06:36:07 | FromDiscord | <wiga> toString() is not only on cs lol |
06:36:15 | FromDiscord | <wiga> its literally everywhere |
06:36:37 | FromDiscord | <huantian> Yeah but I can’t just list all of em 😛 |
06:36:46 | FromDiscord | <wiga> java,javascript,powershell for the most popular one |
06:37:35 | FromDiscord | <wiga> can u help me test smth? |
06:37:46 | FromDiscord | <Rika> Tell us what it is first lol |
06:38:02 | FromDiscord | <wiga> im making a discord bot and i wanna see if my welcome message works |
06:39:17 | FromDiscord | <wiga> and like all my friends are sleeping |
06:39:25 | FromDiscord | <wiga> and i dont have alt acc anymore they all got termed |
06:39:46 | FromDiscord | <wiga> and i dont have any mail to make new acc anymore lol |
06:40:43 | FromDiscord | <Rika> Eh |
06:41:29 | FromDiscord | <wiga> yeah |
06:41:32 | FromDiscord | <wiga> that sucks |
06:41:52 | FromDiscord | <wiga> even this account is an alt cuz my main got disabled |
06:42:04 | FromDiscord | <wiga> its the only one i have lmao |
06:44:28 | FromDiscord | <wiga> nvm i got helped |
06:44:32 | FromDiscord | <wiga> works perfectly |
06:45:12 | FromDiscord | <Rika> Congrats |
06:46:17 | FromDiscord | <wiga> im suprised on how nim can be easy sometime |
08:07:00 | * | tiorock joined #nim |
08:07:00 | * | tiorock quit (Changing host) |
08:07:00 | * | tiorock joined #nim |
08:07:00 | * | rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services))) |
08:07:00 | * | tiorock is now known as rockcavera |
08:17:29 | FromDiscord | <Prestige> How do I obtain the value of a defined symbol? e.g. `nim r -d:seed=123 foo.nim` I want to get the value of `seed` |
08:23:54 | FromDiscord | <creikey> In reply to @Avahe "How do I obtain": from what I understand you just use seed? |
08:24:00 | FromDiscord | <creikey> or make it a constant in your code |
08:24:07 | FromDiscord | <creikey> then it's set on compile time |
08:24:12 | FromDiscord | <creikey> like `const seed: int = 0` |
08:25:23 | FromDiscord | <Prestige> by default it just says it isn't defined, inside a `when defined(seed):` block, lol |
08:25:46 | FromDiscord | <Rika> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas |
08:33:33 | FromDiscord | <Prestige> Thanks |
08:33:33 | FromDiscord | <jmgomez> Is it possible to parallelise macro code? |
08:33:33 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=45Gl |
08:33:34 | FromDiscord | <Rika> In reply to @jmgomez "Is it possible to": No |
08:33:34 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=45Gn |
08:49:35 | FromDiscord | <lantos> trying to work out how to make httpclient body stream an itter |
08:49:54 | FromDiscord | <lantos> (edit) "itter" => "iter so you can do stuff to the chunks" |
09:27:07 | * | tafa left #nim (Leaving) |
09:54:12 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=45Hc |
09:55:24 | FromDiscord | <Rika> You don’t |
09:55:42 | FromDiscord | <Rika> The concept doesn’t exist in Nim so I don’t think you do |
09:56:49 | FromDiscord | <jmgomez> Im getting around it by doing reinterpret_cast maybe we should have a way to specify it in the importcpp syntax or something |
10:05:06 | * | CyberTailor joined #nim |
10:28:17 | * | CyberTailor quit (Ping timeout: 268 seconds) |
11:03:28 | FromDiscord | <Phil> In reply to @jmgomez "Is it possible to": Out of curiosity, what is the concept behind that question?↵Is this about speeding up compile times? |
11:13:04 | * | CyberTailor joined #nim |
11:14:40 | FromDiscord | <jmgomez> In reply to @Isofruit "Out of curiosity, what": Yup. I have a macro that does a bunch of stuff into a proc and I generally apply it to a bunch of them at the time one by one |
11:56:29 | FromDiscord | <Bloss> what is up with the playground? |
12:00:26 | FromDiscord | <flywind> In reply to @blans "what is up with": It has been down for few days. |
12:29:29 | FromDiscord | <Phil> In reply to @jmgomez "Yup. I have a": IIRC most of the time is spent either way for the compilation to binary step |
12:40:14 | FromDiscord | <vindaar> that really depends. for macro heavy code evaluating all the macro logic can be very time consuming (compile the `unchained` or `datamancer` tests to get an idea of that) |
13:03:39 | FromDiscord | <jmgomez> I see. Im trying to measure it with cpuTime() but not sure if its really working because it's giving me 0. What do I have to import in order to get exec to work in macro time so I can call shell with sleep (just to make sure cpuTime is actually doing the right thing)? |
13:31:16 | FromDiscord | <flywind> In reply to @jmgomez "I see. Im trying": Enable benchmarkVM |
13:31:25 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=45Iv |
13:31:29 | FromDiscord | <flywind> (edit) |
13:31:38 | FromDiscord | <flywind> Otherwise it won't work. |
13:35:43 | * | CyberTailor quit (Remote host closed the connection) |
13:38:56 | * | CyberTailor joined #nim |
13:45:42 | FromDiscord | <jmgomez> In reply to @flywind "Enable benchmarkVM": Thanks! |
13:45:47 | * | arkurious joined #nim |
13:46:44 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I used to use Nim a lot in 2021 - but I got converted to Rust. |
13:46:59 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Should I come back to Nim? |
13:48:15 | FromDiscord | <jmgomez> In reply to @Isofruit "IIRC most of the": it only takes 0.033ms for an increase of time of ~1.5 so I guess you are right. Is there something else than can be done? |
13:49:55 | FromDiscord | <Phil> In reply to @jmgomez "it only takes 0.033ms": To speed up compile times?↵none that I'm aware of |
13:50:47 | FromDiscord | <Phil> In reply to @@bracketmaster-5a708063d73408ce4 "Should I come back": Write nim if it's fun for you. Don't if you don't want to. |
13:50:52 | FromDiscord | <Rika> In reply to @@bracketmaster-5a708063d73408ce4 "I used to use": Well why did you switch in the first place |
13:52:35 | FromDiscord | <jmgomez> In reply to @Isofruit "To speed up compile": Ok, not sure if can do something else on my end. But for now, I will let it as it is, and split it into more files if necessary |
13:53:53 | FromDiscord | <Phil> In reply to @jmgomez "Ok, not sure if": Don't take my words as gospel, almost anyone here has more knowledge about the compiler than I do. The peak of my compiler knowledge is knowing flags that let me swap out gcc |
13:54:31 | FromDiscord | <Rika> If you really want, TCC is fast as a C compiler |
13:54:37 | FromDiscord | <flywind> I dont know any good and stable solution to reduce compilation time. Probably profile the Nim compiler when compiling your projects and report hot spots to the Nim issue track. |
13:56:16 | FromDiscord | <jmgomez> In reply to @Rika "If you really want,": I need to use clang/vcc because of UE/Cpp. ↵The macro is massive anyways, it generates a bunch of stuff behind the scenes. I would love to get it run faster but it is what it is |
13:56:18 | FromDiscord | <jmgomez> Thanks |
13:56:30 | FromDiscord | <jmgomez> (edit) "In reply to @Rika "If you really want,": I need to use clang/vcc because of UE/Cpp. ↵The macro is massive anyways, it generates a bunch of stuff behind the scenes. I would love to get it ... run" added "to" |
13:57:45 | * | wallabra_ joined #nim |
13:58:30 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Rust macros seemed to have less dark corners than Nim's↵(@Rika) |
13:58:39 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Also this - https://www.egui.rs |
13:58:53 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Rust has really cool GUI options for native and WASM |
14:00:11 | FromDiscord | <Rika> Rust macros feel like they have more dark corners, to me |
14:00:20 | * | wallabra quit (Ping timeout: 268 seconds) |
14:00:21 | * | wallabra_ is now known as wallabra |
14:02:37 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I was trying to create a DSL in rust - and Rust lets me get the variable names as well as line numbers more easily |
14:02:48 | FromDiscord | <@bracketmaster-5a708063d73408ce4> But I think Nim is probably more fun than Rust |
14:03:27 | FromDiscord | <@bracketmaster-5a708063d73408ce4> But Rusts's Algebraic Data Types and haskell like functional programming makes writing larger compiler in Rust far more practical |
14:04:17 | FromDiscord | <@bracketmaster-5a708063d73408ce4> And it turned out that I didn't need the garbage collector as much as I thought I did |
14:55:38 | * | mdbauman joined #nim |
15:08:38 | FromDiscord | <treeform> In reply to @ripluke "I’m using zig to": You can define `--d:pixieNoSimd` to skip the simd. |
15:09:13 | FromDiscord | <Professor Actual Factual> In reply to @@bracketmaster-5a708063d73408ce4 "And it turned out": Picking the right tool for the job is often more important imo.↵There are areas where rust excels and other where nim does.↵For example i much prefer doing cli tools and script like work in nim |
15:09:43 | FromDiscord | <treeform> you can also do `--d:pixieNoAvx` if you want sse2 but not avx |
15:14:10 | FromDiscord | <Rika> treeform how usable is pixie in embedded lol |
15:18:11 | * | wallabra_ joined #nim |
15:19:59 | * | wallabra quit (Ping timeout: 255 seconds) |
15:19:59 | * | wallabra_ is now known as wallabra |
15:21:29 | FromDiscord | <Arathanis> Is there a list of built-in compiler symbols to be queried with `when`? Specifically which backend (c, cpp, js) is being used? |
15:22:58 | FromDiscord | <flywind> In reply to @Arathanis "Is there a list": See `std/compilersettings` => https://nim-lang.github.io/Nim/compilesettings.html |
15:23:05 | FromDiscord | <flywind> (edit) "`std/compilersettings`" => "`std/compilesettings`" |
15:23:40 | FromDiscord | <Arathanis> In reply to @flywind "See `std/compilesettings` => https://nim-lang.githu": appreciate it |
15:28:08 | FromDiscord | <Arathanis> This works! How do you use it for conditional compilation? Like defining a function in different ways depending on backend. |
15:39:41 | FromDiscord | <ghoom> any c++ namespace equivalent in nim? |
15:40:28 | FromDiscord | <demotomohiro> In reply to @ghoom "any c++ namespace equivalent": Nim's module is closest to c++ namespace but not equivalent. |
15:40:39 | FromDiscord | <ghoom> how about c's `##` operator! |
15:40:40 | FromDiscord | <ghoom> (edit) "operator!" => "operator?" |
15:40:47 | FromDiscord | <ghoom> for macros |
15:43:46 | FromDiscord | <demotomohiro> You can get variable names as string in macro with `strVal` and concatenate them with `&`. |
15:44:07 | FromDiscord | <demotomohiro> In template:↵https://nim-lang.org/docs/manual.html#templates-identifier-construction |
15:45:54 | FromDiscord | <ghoom> sent a code paste, see https://paste.rs/sFX |
15:47:04 | FromDiscord | <ghoom> (edit) "https://play.nim-lang.org/#ix=45Jz" => "https://play.nim-lang.org/#ix=45Jy" |
15:49:46 | FromDiscord | <demotomohiro> For example: https://wandbox.org/permlink/vhDmyeNgechQ5HKJ |
15:51:13 | FromDiscord | <ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45JA |
15:51:18 | FromDiscord | <ghoom> it worked |
15:51:29 | FromDiscord | <ghoom> 🐸👍 |
15:58:24 | NimEventer | New thread by Planetis: How to copy a random field into another of the same type at runtime?, see https://forum.nim-lang.org/t/9328 |
16:01:35 | FromDiscord | <ghoom> how do i declare a global variable from inside a scope |
16:02:41 | FromDiscord | <ghoom> nvm i just use `{.global.}` |
16:10:31 | FromDiscord | <Idän Koodari> sent a code paste, see https://play.nim-lang.org/#ix=45JG |
16:11:41 | FromDiscord | <Idän Koodari> (edit) "https://play.nim-lang.org/#ix=45JG" => "https://play.nim-lang.org/#ix=45JH" |
16:12:40 | FromDiscord | <Phil> Wasn't hcr still experimental ? |
16:14:06 | FromDiscord | <Idän Koodari> Could be, I just read an article about it and became interested in the language and decided to try it out. |
16:14:25 | FromDiscord | <ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45JI |
16:14:46 | FromDiscord | <ghoom> (edit) "https://play.nim-lang.org/#ix=45JI" => "https://play.nim-lang.org/#ix=45JJ" |
16:15:49 | FromDiscord | <Phil> I've written a fairly large webpage with it and ignored hcr so far mostly because I believed it to be experimental. Not that it was necessary, compile times were okay either way |
16:16:10 | * | pch quit (Remote host closed the connection) |
16:17:49 | FromDiscord | <Phil> I can play around a bit with it later and see what I can gather on whether it works for me idan |
16:18:02 | FromDiscord | <Phil> I'll be working on my project in a bit anyway |
16:19:11 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=45JK |
16:19:57 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=45JL |
16:20:27 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=45JM |
16:20:56 | FromDiscord | <Idän Koodari> In reply to @Isofruit "I've written a fairly": Yup and it is a pretty nice lang overall, I just wish I didn't have to reload the window lose my gamestate when I wanted to change the size of a box :P I got used to how nice the hot reloading is in V, but the language was still very much unfinished in other areas and became a pain in the ass to use for game dev in the long run. |
16:21:11 | FromDiscord | <Idän Koodari> In reply to @Isofruit "I can play around": Thanks, let me know if you get it working 👍 |
16:26:40 | FromDiscord | <ghoom> In reply to @demotomohiro "https://nim-lang.org/docs/manual.html#templates-lim": can i at least make the template a symbol and use it as a binary operator? |
16:26:47 | FromDiscord | <ghoom> (edit) "In reply to @demotomohiro "https://nim-lang.org/docs/manual.html#templates-lim": can i at least make the template ... a" added "name" |
16:28:06 | FromDiscord | <ghoom> sent a code paste, see https://paste.rs/LMP |
16:28:20 | FromDiscord | <Rika> In reply to @ghoom "no commas seems to": i dont think it will be fine |
16:28:36 | FromDiscord | <demotomohiro> In reply to @ghoom "can i at least": https://nim-lang.org/docs/manual.html#lexical-analysis-operators |
16:28:37 | FromDiscord | <Rika> In reply to @ghoom "can i at least": only if your name is within a specific list of names |
16:28:48 | FromDiscord | <Rika> as in the list tomohiro sent |
16:29:24 | FromDiscord | <demotomohiro> You cannot use arbitrary name as binary operator. |
16:29:38 | FromDiscord | <ghoom> ofc |
16:31:32 | FromDiscord | <ghoom> In reply to @Rika "no need for the": the "_" is necessary to differentiate something like `ab_c` and `a_bc` |
16:32:40 | FromDiscord | <Rika> that does not exist in nim 🙂 style insensitivity |
16:35:31 | qwr | foobar and fooBar are not same in nim |
16:35:31 | FromDiscord | <flywind> In reply to @Idän Koodari "I wanted to try": The alternative solution is to use nimscript to do embed script programming language. See https://github.com/beef331/nimscripter and https://github.com/jmgomez/NimForUE#hot-reloading-and-debugging-poc-video |
16:36:52 | qwr | hm, or are? |
16:37:31 | * | qwr stupid |
16:37:34 | FromDiscord | <Phil> I think they are |
16:37:38 | FromDiscord | <Phil> Case insensitivity |
16:38:14 | FromDiscord | <Phil> Iirc they also work with underscores |
16:38:22 | FromDiscord | <wiga> is there some kind of deamon for nim programs? |
16:38:36 | FromDiscord | <wiga> so when i save the script it restarts automatically |
16:38:41 | FromDiscord | <wiga> like nodemon |
16:39:35 | FromDiscord | <wiga> cuz yeah uh https://media.discordapp.net/attachments/371759389889003532/1001529224789753886/unknown.png |
16:39:42 | qwr | yes, i somehow thought that it distinguised between words in identifier, but it doesn't do it :) |
16:40:31 | FromDiscord | <Rika> In reply to @wiga "is there some kind": not that i know of |
16:40:47 | FromDiscord | <Rika> In reply to @qwr "yes, i somehow thought": only the first letter is distinguished |
16:46:41 | FromDiscord | <flywind> In reply to @Isofruit "I can play around": hcr lacks development and no one knows how broken it is. Imo nimscript should serve as a better better solution for the web reloading development. It would better to experiment on beef's nimscripter 😜 |
16:47:18 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality |
16:48:06 | FromDiscord | <flywind> (edit) "In reply to @Isofruit "I can play around": hcr lacks development and no one knows how broken it is. Imo nimscript should serve as a better better solution for the web reloading development. It would ... better" added "be" |
16:48:13 | FromDiscord | <Phil> In reply to @flywind "hcr lacks development and": How does that actually work?↵Does script trigger compile of individual files and those can magically be used at runtime? |
16:49:23 | FromDiscord | <demotomohiro> In reply to @flywind "hcr lacks development and": It seems not many people use HCR. I dont see much questions about HCR in here or Nim forum. |
16:52:48 | FromDiscord | <reversem3> @can.l\: I guess, I'm not understanding how proc changed is working , can you look at my code please ? The more I understand this Library the better. https://hatebin.com/kqpbahqyqb |
16:53:58 | FromDiscord | <flywind> In reply to @Isofruit "How does that actually": Yeah. The Nim program will start an interpreter to execute the Nimscript. So the Nim program can accesa the data from nimscript. Vice versa. |
16:55:04 | FromDiscord | <flywind> See also https://peterme.net/how-to-embed-nimscript-into-a-nim-program-embedding-nimscript-pt-2.html |
16:55:22 | FromDiscord | <Rika> In reply to @demotomohiro "It seems not many": its not very common outside of game/(frontend)web development i believe |
16:56:46 | FromDiscord | <flywind> In reply to @flywind "See also https://peterme.net/how-to-embed-nimscript": nimscripter is the easier way to interoperate between Nim and Nimscript. |
16:59:10 | FromDiscord | <Phil> Though that would mean I would first need to play around with nimscript |
16:59:33 | FromDiscord | <demotomohiro> In reply to @Rika "its not very common": I see |
17:02:26 | * | wallabra_ joined #nim |
17:04:10 | FromDiscord | <can.l> In reply to @reversem3 "<@893965307171979326>\: I guess, I'm": This should not compile since temperature is not a field of Entry. |
17:04:32 | * | wallabra quit (Ping timeout: 244 seconds) |
17:04:32 | * | wallabra_ is now known as wallabra |
17:04:41 | FromDiscord | <flywind> In reply to @Isofruit "Though that would mean": You can think of nimscript as Nim with interpreter backend. Though there is no gc support and c ffi. |
17:07:10 | FromDiscord | <dom96> In reply to @wiga "cuz yeah uh": that's not how you spell daemon |
17:09:11 | FromDiscord | <Phil> At a first glance, just to at least try hcr out, I think it might be completely broken due to the system lib not complying with that flags needs |
17:10:18 | FromDiscord | <Phil> > /home/philipp/.choosenim/toolchains/nim-1.6.6/lib/system/seqs_v2.nim(78, 11) Error: setLen(x, newLen) can have an unlisted effect: RootEffect↵↵That's not my own code that's causing the error, that's procs for initializing a seq causing issues |
17:10:34 | FromDiscord | <Phil> (edit) "> /home/philipp/.choosenim/toolchains/nim-1.6.6/lib/system/seqs_v2.nim(78, 11) Error: setLen(x, newLen) can have an unlisted effect: RootEffect↵↵That's not my own code that's causing the error, that's ... procs" added "system" |
17:10:55 | FromDiscord | <Phil> Given that nimscript appears to be better supported with nimscripter that might not just be the better, but only route |
17:11:12 | FromDiscord | <flywind> The error looks quite familiar to Nim. How about the devel compiler. |
17:11:23 | FromDiscord | <flywind> (edit) "Nim." => "mr." |
17:11:27 | FromDiscord | <Phil> errrr which command was it again to swap to devel? |
17:11:31 | FromDiscord | <Phil> nimble devel? |
17:11:50 | FromDiscord | <flywind> choosenim devel for me |
17:11:57 | FromDiscord | <Phil> check, works |
17:12:01 | FromDiscord | <Phil> now to compile |
17:12:32 | FromDiscord | <flywind> (edit) "mr." => "me." |
17:13:34 | FromDiscord | <Phil> In reply to @flywind "The error looks quite": devel causes systems module to no longer be the issue!↵There appear to still be some with the os module though with `walkDirRec` which... I never directly call in my code... huh.↵> /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/os.nim(2371, 74) template/generic instantiation from here↵> /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/os.nim(2416, 14) Error: add(stack, rel |
17:14:11 | FromDiscord | <Phil> > stack.add rel↵Appears to be the problem child there |
17:15:34 | FromDiscord | <Phil> overall I'd guess that you really should go the nimscripter route as hcr is likely to lynch you due to std lib usage |
17:15:57 | FromDiscord | <Prestige> In reply to @wiga "cuz yeah uh": do you mean daemon? |
17:19:12 | FromDiscord | <flywind> In reply to @Isofruit "devel causes systems module": It is probably fixed by my pr https://github.com/nim-lang/Nim/pull/19512/files |
17:19:50 | FromDiscord | <Phil> In reply to @flywind "It is probably fixed": Nice! |
17:20:14 | FromDiscord | <Phil> Thanks for your contribution there! |
17:20:32 | FromDiscord | <flywind> I mean the former one, the latter one in the os module still needs some patches. |
17:21:09 | FromDiscord | <Phil> In reply to @flywind "I mean the former": Yeh, I gathered it as such ^^ |
17:21:12 | FromDiscord | <flywind> {.cast(tags: []).}: add(stack, rel) |
17:21:25 | FromDiscord | <flywind> probably. |
17:22:45 | FromDiscord | <Phil> As someone who never interoped with C++ and has a high chance of never doing so, is this statement true?↵> Nim is easy to read, fast, with a good type system a fantastic macro system and it also has the best C++ interop in the industry.↵Like, I like nim but that raised my eyebrow a bit |
17:24:40 | FromDiscord | <flywind> Where is the statement, I am not sure it has the best cpp interop in the industry. |
17:25:45 | FromDiscord | <Phil> Reading through the two links on hot code reloading with nimscript. First line on the "Why Nim" section of the nim for ue repo |
17:26:38 | FromDiscord | <Phil> I can't evaluate that statement, was mostly curious on how far the interop convenience goes there |
17:26:56 | FromDiscord | <Phil> I'd imagine it classifies as "good" so far |
17:27:37 | FromDiscord | <flywind> Yeah, I agree. |
17:28:10 | FromDiscord | <ghoom> how can i mark a callable as a binary operator? |
17:28:50 | FromDiscord | <Rika> wdym? whats the name of the proc |
17:29:00 | FromDiscord | <ghoom> "on" |
17:29:13 | FromDiscord | <Rika> you cannot |
17:30:10 | FromDiscord | <Rika> it must be in this list `and or not xor shl shr div mod in notin is isnot of as from` |
17:30:38 | FromDiscord | <Phil> In reply to @flywind "Yeah, I agree.": On an unrelated note, looking at nimscripter, isn't it mostly concerned with using nimscript within normal nim and their interop, rather than enabling hot code reloading. Was the idea to write most of the backend using nimscript and thus enabling hot code reloading? |
17:30:52 | FromDiscord | <Phil> (edit) "code reloading." => "code?reloading." |
17:30:58 | FromDiscord | <Phil> (edit) "code?reloading." => "code reloading?" |
17:32:57 | FromDiscord | <flywind> nimscripter is intetpreted. If you changed the nimscript, you dont need to recompiler the Nim program, just run the executable. |
17:33:37 | FromDiscord | <flywind> (edit) "recompiler" => "recompile" |
17:33:46 | FromDiscord | <flywind> (edit) "nimscripter" => "nimscript" |
17:33:53 | FromDiscord | <reversem3> You're right it doesn't compile↵(@can.l) |
17:34:44 | FromDiscord | <can.l> In reply to @reversem3 "You're right it doesn't": Change the line where you assign temperature = app.temperature to text = app.temperature |
17:34:48 | FromDiscord | <flywind> In reply to @Isofruit "On an unrelated note,": Write some logics and data in the nimscript I think. |
17:34:58 | FromDiscord | <Phil> In reply to @flywind "nimscript is intetpreted. If": Ahhh, but that means it only reduces compile time if I were to write my entire application in nimscript (maybe beyond a certain core that needs all of nim), no? |
17:35:09 | FromDiscord | <Phil> (edit) "beyond" => "except for" |
17:35:55 | FromDiscord | <Elegantbeef> Dont use niimscript cause you want HCR 😄 |
17:36:52 | FromDiscord | <Phil> Yeh, so far I had imagined the usecase for nimscript mostly for code around building a nim-project, less for actual code |
17:37:53 | FromDiscord | <flywind> In reply to @Isofruit "Ahhh, but that means": You cannot because nimscript doesnt support c ffi. Unless you use a custom Nim compiler and register everything as a vm callback. nimscript is much slower than c backend. |
17:38:37 | FromDiscord | <flywind> When everything is settled, rewrite them in actual Nim code. |
17:40:14 | FromDiscord | <flywind> Nim c backend always need to semcheck and compile every modules it imports even a small change in this module. |
17:45:20 | FromDiscord | <ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45K6 |
17:45:46 | FromDiscord | <ghoom> why are "()" necessary here? |
17:45:51 | FromDiscord | <ghoom> (edit) ""()"" => "`()`" |
17:50:22 | FromDiscord | <Shiba> is there an option for the nim compiler that showes how much lines are compiled for each .nim file ? |
17:50:49 | FromDiscord | <Shiba> (edit) "showes" => "shows" |
17:53:54 | FromDiscord | <Phil> In reply to @flywind "When everything is settled,": I think unless compiling the code without release takes more than 5 minutes I wouldn't use nimscript for prototyping |
17:54:27 | FromDiscord | <Phil> That seems like it'd be too much effort |
17:56:55 | FromDiscord | <flywind> True, though I need incremwntal compilation because I like to make small changes frequently. |
17:57:05 | FromDiscord | <flywind> (edit) "incremwntal" => "incremental" |
17:58:28 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=45K9 |
18:01:27 | FromDiscord | <ghoom> In reply to @demotomohiro "It seems your template": ah, so when i add `()` it becomes `proc() echo "!"`? |
18:01:41 | FromDiscord | <ghoom> makes sense |
18:01:47 | FromDiscord | <ghoom> :p |
18:01:56 | FromDiscord | <ghoom> frogs ain't da smartest you know? |
18:02:53 | FromDiscord | <Shiba> In reply to @flywind "True, though I need": we all need it |
18:03:26 | FromDiscord | <Phil> In reply to @ghoom "frogs ain't da smartest": I'll undercut you in the smartness department, people keep accusing me of writing java in nim |
18:03:43 | FromDiscord | <ghoom> bro what |
18:04:08 | FromDiscord | <Phil> You'll need to ask Rika and Beef on that one, I'll keep dementing it any day of the week |
18:04:26 | FromDiscord | <Phil> All I'm doing is using the Repository pattern which is basically the bog standard for webdev using relational db's without graphql |
18:04:46 | FromDiscord | <Elegantbeef> Well phil if you quit writing java in Nim we'd shush 😛 |
18:05:07 | FromDiscord | <Phil> I am not writing java in nim though! I shall keep dementing these baseless accusations! |
18:05:34 | FromDiscord | <ghoom> 🫂👍 |
18:05:56 | FromDiscord | <Phil> ~~All I'm writing is a completely needlessly fast webpage~~ |
18:11:57 | * | CyberTailor quit (Read error: Connection reset by peer) |
18:13:04 | * | CyberTailor joined #nim |
18:16:34 | FromDiscord | <Phil> In reply to @Idän Koodari "Thanks, let me know": For short, if you have really long compiletimes, it might be worth contemplating to prototype new code in nimscript and rewriting that to full nim if it works. Other than that your biggest hope is waiting for incremental compilation to arrive one day |
18:22:08 | FromDiscord | <ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45Kd |
18:22:45 | FromDiscord | <ghoom> i don't wanna do `proc() {.async.}` |
18:23:05 | FromDiscord | <Rika> In reply to @Isofruit "I am not writing": "dementing"? |
18:23:13 | FromDiscord | <Rika> you're gonna give the accusations alzheimers? |
18:23:49 | FromDiscord | <Rika> In reply to @ghoom "i don't wanna do": you cannot |
18:23:55 | FromDiscord | <Rika> cannot avoid it i mean |
18:23:58 | FromDiscord | <ghoom> ok |
18:30:53 | FromDiscord | <exelotl> In reply to @Isofruit "For short, if you": Every day I wake up and pray IC will land before I finish my game 😅 |
18:30:58 | FromDiscord | <reversem3> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: can I bug you to look at some code ? |
18:36:06 | FromDiscord | <reversem3> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: https://hatebin.com/knrzyulnjl -- So I have my proc and the proc changed does work , if you input something in one entry it will be the same in the other entry , but I can figure out how to incorporate the proc Fahrenheit into the app.temperature in the Celsius entry. |
18:38:05 | FromDiscord | <Phil> In reply to @Rika ""dementing"?": Turns out the german "Dementieren" does not translate to english as I had thought |
18:38:29 | FromDiscord | <Rika> HAHAHAHAHA |
18:38:32 | FromDiscord | <Rika> what did you think |
18:38:34 | FromDiscord | <Phil> It's denying/disclaiming instead over here and there is no actual verb around dementieren |
18:38:53 | FromDiscord | <Rika> honestly that was pretty fucking funny |
18:39:09 | FromDiscord | <Phil> Language traps you in the little things |
18:39:42 | FromDiscord | <Rika> had a similar discussion earlier |
18:39:47 | FromDiscord | <Rika> about natrium and kalium |
18:40:08 | FromDiscord | <Rika> In reply to @Rika "had a similar discussion": somewhere else |
18:41:27 | FromDiscord | <ghoom> how do i make parentheses not be part of a template's argument? |
18:43:09 | FromDiscord | <Rika> what do you mean |
18:43:10 | FromDiscord | <Shiba> In reply to @Shiba "is there an option": ? |
18:43:22 | FromDiscord | <Rika> In reply to @Shiba "?": im not aware of any |
18:45:25 | FromDiscord | <ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45Kj |
18:46:05 | FromDiscord | <jmgomez> In reply to @flywind "The alternative solution is": just so you know, even though we are planning to use NimScript down the road, that's dll swapping |
18:46:25 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=45Kk |
18:53:00 | * | NimEventer quit (*.net *.split) |
18:53:12 | * | NimEventer joined #nim |
18:53:14 | FromDiscord | <ghoom> In reply to @Rika "you cannot": any workarounds? |
18:53:24 | FromDiscord | <ghoom> aside from `(a/b)()` |
18:53:26 | FromDiscord | <Rika> no |
18:53:36 | FromDiscord | <ghoom> 🥲 |
18:53:51 | FromDiscord | <Rika> at least none that i can think of and arent incredibly cursed |
18:54:02 | FromDiscord | <ghoom> lol |
18:54:10 | FromDiscord | <ghoom> how cursed can it be anyway |
18:54:29 | FromDiscord | <ghoom> (edit) "be" => "get" |
18:54:34 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=45Kn |
18:54:57 | FromDiscord | <Rika> In reply to @ghoom "how cursed can it": idk some term rewriting macro maybe |
18:55:22 | FromDiscord | <ghoom> sheesh |
18:56:00 | FromDiscord | <Rika> beef is more acquainted with cursed macros |
18:56:09 | FromDiscord | <Rika> i dont tend to make things that are cursed |
18:56:14 | FromDiscord | <ghoom> btw, if a symbol-named template has more than two arguments, what would the shorthand call look like? |
18:56:34 | FromDiscord | <Rika> as in? |
18:56:47 | FromDiscord | <Rika> `templ a, b, c`? |
18:56:59 | FromDiscord | <ghoom> like binary operators |
18:57:20 | FromDiscord | <Rika> if your template has three+ arguments then its not really binary now is it |
18:57:32 | FromDiscord | <ghoom> told ya frogs ain't da smartest |
18:57:41 | FromDiscord | <ghoom> i wish there was ternary operators |
18:57:44 | FromDiscord | <Rika> well |
18:57:49 | FromDiscord | <Rika> those are harder to reason about parsing |
18:57:57 | FromDiscord | <ghoom> ye i read about it |
18:58:06 | FromDiscord | <ghoom> ambiguity and whatnot |
18:58:19 | FromDiscord | <ghoom> ¯\_(ツ)_/¯ |
19:06:27 | FromDiscord | <Phil> In reply to @Rika "about natrium and kalium": "Surely this translates the same, it sounds so easily... SODIUM AND POTASSIUM? Does that molecula like a hippopotamus or something?!" |
19:06:37 | FromDiscord | <Rika> LMFAO |
19:06:41 | FromDiscord | <Phil> (edit) "molecula" => "molecul look" |
19:18:24 | FromDiscord | <ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45Kv |
19:18:36 | FromDiscord | <Rika> `maybe misplaced space between f and '('` |
19:18:53 | FromDiscord | <Rika> `t(f, (1, 2))` -> `f (1, 2)` != `f(1, 2)` |
19:19:04 | FromDiscord | <ghoom> 🤯 |
19:19:26 | FromDiscord | <ghoom> nim will never cease to surprise |
19:19:30 | FromDiscord | <ghoom> (edit) "nim will never cease to surprise ... " added "me" |
19:19:43 | FromDiscord | <ghoom> why |
19:19:48 | FromDiscord | <ghoom> (edit) "why ... " added "is this a thing?" |
19:21:08 | FromDiscord | <ghoom> i tried `(f)x` instead of `f x` and it still didn't work |
19:22:29 | * | CyberTailor quit (Remote host closed the connection) |
19:23:26 | FromDiscord | <Rika> In reply to @ghoom "why is this a": Because both command call syntax and tuples exist |
19:24:00 | * | CyberTailor joined #nim |
19:24:29 | FromDiscord | <Shiba> In reply to @Rika "im not aware of": sad |
19:25:37 | FromDiscord | <ghoom> `(f)x` seems to work fine as a normal call |
19:25:41 | FromDiscord | <Shiba> (edit) "In reply to @Rika "im not aware of": sad ... " added ", they should implement that , cause i think it's useful" |
19:25:43 | FromDiscord | <ghoom> (edit) "`(f)x`" => "`(f)(1, 2)`" |
19:26:15 | FromDiscord | <ghoom> does that mean `(f)x` doesn't expand to `(f)(1, 2)`? 🤔 |
19:33:40 | FromDiscord | <domosokrat> It seems to expand to `(f)((1,2))`, atleast the error message is the same |
19:38:07 | FromDiscord | <ghoom> ok |
19:38:15 | FromDiscord | <ghoom> that's weird |
19:40:39 | FromDiscord | <ghoom> In reply to @domosokrat "It seems to expand": yes it does, i checked by making the parameters a tuple |
19:40:47 | FromDiscord | <ghoom> 😭 |
19:41:53 | * | fallback quit (Ping timeout: 272 seconds) |
19:45:17 | FromDiscord | <mr_noia> sent a code paste, see https://play.nim-lang.org/#ix=45KA |
19:46:01 | FromDiscord | <ghoom> but what about more than two args? |
19:46:48 | FromDiscord | <ghoom> that would be wicked D |
19:46:50 | FromDiscord | <ghoom> (edit) "D" => "XD" |
19:47:14 | FromDiscord | <Vindaar> as long as you're willing to have some kind of scope opening for your ternary operators, you can implement them with macros |
19:47:30 | FromDiscord | <demotomohiro> You can use `dumpTree` macro to see how Nim parse your code:↵https://nim-lang.org/docs/macros.html#dumpTree.m%2Cuntyped |
19:49:50 | * | krux02 joined #nim |
19:50:16 | FromDiscord | <mr_noia> yeah, that's the hack. I didn't define the `||` operator, it's just so the parser bundles the subexpression into a `nnkInfix` node, then I extract the subexpressions and glue them together into an if, giving me sort of a ternary operator↵(@ghoom) |
19:51:39 | FromDiscord | <ghoom> very neat |
19:52:04 | FromDiscord | <ghoom> i'd have to learn more about macros |
19:52:23 | FromDiscord | <ghoom> thanks |
19:59:20 | * | fallback joined #nim |
20:03:31 | FromDiscord | <ghoom> any std alternatives to js's `with`? |
20:03:51 | FromDiscord | <ghoom> hopefully ones that work with tuples |
20:04:54 | FromDiscord | <jan0809> is js s with like pythons with? |
20:05:26 | FromDiscord | <ghoom> i think python's `with` is for closeable objects |
20:05:33 | FromDiscord | <ghoom> like files |
20:05:36 | FromDiscord | <mr_noia> Js |
20:05:44 | FromDiscord | <ghoom> so it automatically closes em |
20:06:02 | FromDiscord | <jan0809> In reply to @ghoom "so it automatically closes": context manager is the name |
20:06:19 | FromDiscord | <ghoom> ah ok |
20:06:30 | FromDiscord | <jan0809> is js s with similar or not? |
20:06:56 | FromDiscord | <ghoom> js's `with` exposes an objects keys into a scope |
20:07:10 | FromDiscord | <jan0809> oh |
20:07:30 | FromDiscord | <ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45KC |
20:07:50 | FromDiscord | <ghoom> (edit) "objects" => "object's" |
20:08:10 | FromDiscord | <mr_noia> nim has a similar with, but it only seems to work for function calls\: https://nim-lang.org/docs/with.html |
20:08:28 | * | rwb quit (Ping timeout: 244 seconds) |
20:08:37 | FromDiscord | <ghoom> oh that's still very useful |
20:10:00 | * | fallback quit (Ping timeout: 244 seconds) |
20:11:00 | FromDiscord | <ghoom> also i still yet to understand the difference between macros and templates |
20:11:40 | FromDiscord | <ghoom> pls enlighten my slimy brain |
20:13:16 | FromDiscord | <jan0809> sent a code paste, see https://play.nim-lang.org/#ix=45KD |
20:13:34 | FromDiscord | <ghoom> In reply to @jan0809 "i dont get the": imagine a table name that's too long |
20:13:38 | FromDiscord | <ghoom> (edit) "table" => "object" |
20:13:49 | FromDiscord | <ghoom> you don't wanna type it again and again |
20:13:58 | FromDiscord | <ghoom> (edit) "you don't wanna type it again and again ... " added "everytime you try to index it" |
20:14:02 | FromDiscord | <ghoom> (edit) "everytime" => "every time" |
20:14:18 | FromDiscord | <jan0809> u wouldnt load it into a var name thats longer than... t |
20:14:28 | FromDiscord | <ghoom> lol |
20:14:37 | FromDiscord | <ghoom> true programmer |
20:15:02 | FromDiscord | <jan0809> also theres `as` |
20:15:33 | FromDiscord | <jan0809> atleast in python |
20:16:24 | FromDiscord | <jan0809> sent a code paste, see https://play.nim-lang.org/#ix=45KE |
20:16:42 | FromDiscord | <ghoom> sheesh |
20:17:08 | FromDiscord | <ghoom> laziness is the most affecting trait of a programmer |
20:18:06 | FromDiscord | <ghoom> (edit) "affecting" => "defining" |
20:20:28 | FromDiscord | <jan0809> sent a code paste, see https://play.nim-lang.org/#ix=45KF |
20:21:08 | FromDiscord | <Prestige> Use a different name |
20:21:27 | FromDiscord | <Vindaar> In reply to @ghoom "also i still yet": macros are direct manipulation of nim's abstract syntax tree (how the nim compiler sees nim code). templates are fancy text replacement / insertion. everything you can do with templates, you can also do with macros, but not the inverse |
20:21:50 | FromDiscord | <ghoom> 🐸👍 |
20:22:09 | FromDiscord | <jan0809> In reply to @Avahe "Use a different name": or not js |
20:22:39 | FromDiscord | <Prestige> What about js? |
20:23:02 | FromDiscord | <jan0809> nothing |
20:23:56 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=45KH |
20:24:06 | FromDiscord | <lantos> (edit) "https://play.nim-lang.org/#ix=45KH" => "https://paste.rs/DCx" |
20:24:31 | FromDiscord | <jan0809> the client itself has a body? |
20:25:19 | FromDiscord | <jan0809> to store body params across multiple requests? |
20:29:20 | FromDiscord | <jan0809> i mean for real |
20:29:54 | FromDiscord | <jan0809> headers, ofc but isnt the body more a request or responses business? |
20:34:33 | * | rwb joined #nim |
20:42:53 | FromDiscord | <ghoom> how to call a callable aside from doing `callable args`? |
20:45:09 | FromDiscord | <huantian> how do you want to call it |
20:45:22 | FromDiscord | <huantian> you can do callable(args) lol |
20:47:18 | FromDiscord | <ghoom> In reply to @huantian "how do you want": i want to bypass templates automatically enclosing arguments in `()` |
20:47:33 | FromDiscord | <ghoom> and adding space between identifiers |
20:47:39 | FromDiscord | <ghoom> (edit) "identifiers" => "stuff" |
20:49:05 | FromDiscord | <Vindaar> I think if you give more explicit examples of what you want to accomplish, it's easier to help you |
20:49:16 | * | jmdaemon joined #nim |
20:49:39 | FromDiscord | <ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45KN |
20:49:43 | FromDiscord | <lantos> In reply to @jan0809 "the client itself has": nah it doesn't do non blocking sync streams |
20:50:14 | FromDiscord | <Elegantbeef> You cannot do that ghoom |
20:50:19 | FromDiscord | <Elegantbeef> You need a macro to do this |
20:50:34 | FromDiscord | <Vindaar> In reply to @ghoom "^": yes, but this does not explain what you want to _accomplish_.↵yeah, beef was faster than me |
20:50:36 | FromDiscord | <ghoom> could you give me a macro alternative? |
20:51:34 | FromDiscord | <Elegantbeef> `import std/macros` change it to a `macro` then make the body `result = newCall(f); result.add x[0..^1]` |
20:51:43 | FromDiscord | <Elegantbeef> This doesnt solve any issue though |
20:51:55 | FromDiscord | <ghoom> then why did you suggest it XD |
20:52:04 | FromDiscord | <Elegantbeef> I'm taking about your code |
20:52:39 | FromDiscord | <jan0809> In reply to @lantos "nah it doesn't do": still dont understand |
20:53:17 | FromDiscord | <ghoom> In reply to @Elegantbeef "I'm taking about your": i have my own issues 😉 |
20:54:46 | FromDiscord | <jan0809> or is httpClient a misslabeled single httpRequest |
20:57:24 | FromDiscord | <lantos> std/httpClient ↵you can get body() easy but getting a non terminating get request. Like a large file or polling data↵you can use http.bodyStream but it only returns for async. As synchronous bodyStream locks. |
20:57:40 | FromDiscord | <lantos> (edit) "request." => "request isn't possible." |
21:07:02 | FromDiscord | <ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45KR |
21:11:10 | * | fallback joined #nim |
21:11:38 | * | ehmry joined #nim |
21:13:26 | FromDiscord | <jan0809> hmm yeah non async http barely make sense in alot of application cases |
21:13:54 | FromDiscord | <jan0809> and not at all for polling data(?) |
21:15:53 | * | kenran joined #nim |
21:32:06 | FromDiscord | <ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45KV |
21:32:54 | * | kenran quit (Quit: WeeChat info:version) |
21:53:09 | * | lumo_e joined #nim |
22:01:11 | FromDiscord | <jan0809> lol |
22:02:50 | FromDiscord | <ghoom> what |
22:35:29 | FromDiscord | <ghoom> guys pls halp |
22:36:41 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=45L2 |
22:37:05 | FromDiscord | <amadan> (Since the variable `a` kinda becomes the name) |
22:37:58 | FromDiscord | <ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45L3 |
22:38:09 | FromDiscord | <ghoom> that's supposed to be the args |
22:38:16 | FromDiscord | <ghoom> (edit) "args" => "parameters" |
22:39:16 | FromDiscord | <amadan> Wait so x is providing the parameters to the proc not the name? |
22:39:20 | FromDiscord | <ghoom> yes |
22:42:05 | FromDiscord | <ghoom> and if i do `proc(x)` it will expand to `proc((1, 2))` if i pass `(1, 2)` |
22:42:15 | FromDiscord | <ghoom> :/ |
22:46:46 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=45L4 |
22:47:49 | FromDiscord | <ghoom> thanks for the hustle first of all |
22:48:01 | FromDiscord | <amadan> (edit) "https://play.nim-lang.org/#ix=45L4" => "https://play.nim-lang.org/#ix=45L5" |
22:48:15 | FromDiscord | <ghoom> i dont like how the template is used tho |
22:48:23 | FromDiscord | <ghoom> i mean in terms of passing arguments |
22:49:02 | FromDiscord | <ghoom> ideally, i'd want them to be normal arguments |
22:49:25 | FromDiscord | <ghoom> but ngl this is a nice hack |
22:49:28 | FromDiscord | <ghoom> 😎 |
22:49:41 | FromDiscord | <amadan> hmm, gimme like 2 mins think I can make that work |
22:53:10 | FromDiscord | <ghoom> > (or I'm not big brain enough to know how to do it with templates)↵bruh macros are big brain |
22:53:12 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=45L6 |
22:53:27 | FromDiscord | <ghoom> what's macro master? |
22:54:47 | FromDiscord | <amadan> Someone who has studied the ways of the macro for a while lol |
22:55:18 | FromDiscord | <ghoom> The Ways of the Macro |
22:55:35 | FromDiscord | <ghoom> bets book ever |
22:55:38 | FromDiscord | <ghoom> (edit) "bets" => "best" |
23:09:42 | FromDiscord | <ghoom> @amadan how would i add pragmas do that newProc? |
23:10:19 | FromDiscord | <ghoom> syntactic pragmas |
23:10:32 | FromDiscord | <ghoom> (edit) "syntactic pragmas ... " added "(inside the tree)" |
23:13:00 | FromDiscord | <amadan> https://nim-lang.org/docs/macros.html#newProc%2CopenArray%5BNimNode%5D%2CNimNode%2CNimNode pass pragmas to `newProc` |
23:23:51 | * | lumo_e quit (Quit: Quit) |
23:26:18 | FromDiscord | <Arathanis> sent a long message, see http://ix.io/45Ld |
23:30:14 | FromDiscord | <Arathanis> Actually seem to have solved it. For anyone encountering this problem:↵↵go to your `.choosenim` directory which by default is located at `C:\Users\<user>\.choosenim`. You should see a `toolchains` folder. You need to add `toolschains |
23:30:21 | FromDiscord | <Arathanis> (edit) "`toolschains" => "`toolschains\mingw64\bin` to your path." |
23:30:57 | FromDiscord | <Arathanis> (edit) "Actually seem to have solved it. For anyone encountering this problem:↵↵go to your `.choosenim` directory which by default is located at `C:\Users\<user>\.choosenim`. You should see" => "sent" | "`toolchains` folder. You need to add `toolschains\mingw64\bin` to your path." => "long message, see http://ix.io/45Lh" |
23:31:00 | FromDiscord | <Arathanis> (edit) "http://ix.io/45Lh" => "https://paste.rs/VZK" |
23:31:19 | FromDiscord | <Arathanis> (edit) "https://paste.rs/hTO" => "http://ix.io/45Lj" |
23:31:27 | FromDiscord | <Arathanis> (edit) "http://ix.io/45Lj" => "https://paste.rs/s89" |
23:31:31 | FromDiscord | <Arathanis> (edit) "https://paste.rs/7lY" => "http://ix.io/45Li" |
23:44:20 | FromDiscord | <demotomohiro> Can you run `ar` command? |
23:45:48 | FromDiscord | <demotomohiro> `ar` is a program used to create staticlib on both windows and linux: https://internet-of-tomohiro.netlify.app/nim/clibrary.en.html#create-static-library-from-nim-code-and-use-from-c-code |