00:02:08 | FromDiscord | <voidwalker> Anyone got some better docs for understanding spawn/threads ? I read it 3 times and I can't figure out how it works |
00:02:33 | FromDiscord | <voidwalker> And the example in "nim in action" is super convoluted and bloaty |
00:04:09 | FromDiscord | <!Patitotective> In reply to @voidwalker "Anyone got some better": this looks good enough for me 🤷♂️ https://nim-lang.org/docs/threads.html |
00:04:32 | FromDiscord | <voidwalker> seriously now ? |
00:04:49 | FromDiscord | <voidwalker> echo i ? who spawns a new thread to do an echo ? |
00:05:05 | FromDiscord | <!Patitotective> its an example |
00:05:41 | FromDiscord | <voidwalker> https://nim-lang.org/docs/manual_experimental.html#parallel-amp-spawn |
00:05:43 | FromDiscord | <voidwalker> I read this |
00:08:56 | * | CyberTailor quit (Read error: Connection reset by peer) |
00:09:49 | * | CyberTailor joined #nim |
00:10:26 | FromDiscord | <Elegantbeef> I think it's mostly suggested to either use createThread manually, Weave or Taskpools |
00:14:08 | FromDiscord | <voidwalker> hah this is a funny pattern now |
00:14:18 | FromDiscord | <voidwalker> how come for every module in std there is a better/fancier alternative |
00:17:37 | FromDiscord | <Elegantbeef> In this case it's cause it was an experimental API |
00:28:02 | FromDiscord | <voidwalker> I want to have n instance of a proc that downloads a webpage and returns a string which gets updated/inserted in a database. Can this be maybe done with async/await ? |
00:28:43 | FromDiscord | <Elegantbeef> Yes most likely |
00:29:56 | FromDiscord | <Elegantbeef> @gibson\: templates and procedures dont use `mixin` the same |
00:30:09 | FromDiscord | <Elegantbeef> Templates always 'mixin' scope due to how they work |
00:30:55 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46Hg |
00:31:07 | FromDiscord | <Elegantbeef> Cause templates are code substitution |
00:31:29 | FromDiscord | <Elegantbeef> `mixin` and `bind ` generally are just used when you have a bug binding a symbol from the template scope |
00:32:20 | FromDiscord | <gibson> Depending how they're called, as you pointed out. They don't always mixin the scope the same way when there's another match available. Not sure if that's actually what's going on, but that's what I'm observing. |
00:33:01 | FromDiscord | <gibson> In my case I have to specify `mixin` otherwise the template won't have the symbol binding in its body bind the way I want. |
00:33:19 | FromDiscord | <Elegantbeef> Do you have a `getToken` in the scope of your template? |
00:33:33 | FromDiscord | <gibson> Yes, it's imported. |
00:34:08 | * | def- quit (Quit: -) |
00:34:09 | FromDiscord | <b1rdf00d> In reply to @Elegantbeef "I think it's mostly": the docs say `parallel` is the preferred (stdlib) way to add threads to Nim, is this the case or outdated / contended? |
00:34:09 | FromDiscord | <!&luke> Does nim have any good mongodb librarys |
00:34:15 | FromDiscord | <!&luke> (edit) "librarys" => "libraries" |
00:34:51 | * | def- joined #nim |
00:37:10 | FromDiscord | <Elegantbeef> Nim 2.0's rfc↵@b1rdf00d) |
00:39:32 | FromDiscord | <!&luke> In reply to @ripluke "Does nim have any": Hmm guess not |
00:39:46 | FromDiscord | <!&luke> I’ll just use norm with postgres |
00:39:58 | FromDiscord | <Elegantbeef> https://nimble.directory/search?query=mongodb |
00:40:02 | FromDiscord | <Elegantbeef> We're not a search engine 😄 |
00:40:19 | FromDiscord | <!Patitotective> you won me beef https://media.discordapp.net/attachments/371759389889003532/1004911694469922867/unknown.png |
00:40:32 | FromDiscord | <Elegantbeef> I dont want you |
00:40:38 | FromDiscord | <Elegantbeef> I default on this win |
00:40:57 | FromDiscord | <!Patitotective> not when you're sleeping |
00:41:12 | FromDiscord | <b1rdf00d> In reply to @Elegantbeef "Nim 2.0's rfc >": thanks! |
00:41:14 | FromDiscord | <!&luke> In reply to @Elegantbeef "We're not a search": 💀 yea I didn’t like how any of them worked |
00:41:24 | FromDiscord | <!&luke> Norm just uses types so it’s easy |
00:44:05 | FromDiscord | <!Patitotective> make your own lmao |
00:44:11 | FromDiscord | <!Patitotective> (edit) "lmao" => "lol" |
00:48:53 | FromDiscord | <Prestige> I'm inches away from starting my own text editor for Nim |
00:49:08 | FromDiscord | <Prestige> I'm so tired of dumb neovim bugs, lua, etc |
00:49:32 | FromDiscord | <Elegantbeef> Lapce 😄 |
00:49:41 | FromDiscord | <Elegantbeef> Though it's written in rust |
00:50:53 | FromDiscord | <Prestige> Eh I don't trust their code to not suck |
00:51:04 | FromDiscord | <Elegantbeef> The compiler literally does that 😛 |
00:51:05 | FromDiscord | <Prestige> Also we shouldn't need LSP |
00:51:26 | FromDiscord | <Prestige> Nah you can still write crap code in rust |
00:51:34 | FromDiscord | <Elegantbeef> I know i was joking |
00:51:40 | FromDiscord | <Prestige> Okay good lol |
00:51:57 | FromDiscord | <Elegantbeef> I already abide by poes law but i need to extend it further |
00:52:16 | FromDiscord | <Elegantbeef> The compiler literally does that 😛 😄 🙃 😛 |
00:52:30 | FromDiscord | <Prestige> Beautiful |
00:52:52 | FromDiscord | <Prestige> If I write my own editor I'm definitely not supporting LSP |
00:53:14 | FromDiscord | <Elegantbeef> Already want your editor to be dead |
00:53:16 | FromDiscord | <Elegantbeef> Interesting |
00:53:51 | FromDiscord | <Prestige> There's no real reason an editor needs to communicate with an external process to understand things about the code, it could be faster just doing that work internally as a plugin |
00:54:31 | FromDiscord | <Prestige> Or built-in |
00:54:39 | FromDiscord | <Elegantbeef> Yea just hardcode every languages semantic analysis into the editor |
00:55:02 | FromDiscord | <Prestige> I just need it for Nim. And I could provide a plugin api for other languages |
00:55:49 | FromDiscord | <!&luke> In reply to @Avahe "I'm so tired of": What bugs |
00:55:54 | FromDiscord | <Elegantbeef> The fun part is if your analysis part of the code crashes your entire editor crashes |
00:56:29 | FromDiscord | <Prestige> One big issue I'm running into, is running nim code with a key binding. It bogs down my whole computer, don't know why |
00:56:48 | FromDiscord | <Prestige> In reply to @Elegantbeef "The fun part is": Nah you don't have to close the editor |
00:56:55 | FromDiscord | <Elegantbeef> What? |
00:56:56 | FromDiscord | <!&luke> In reply to @Avahe "One big issue I'm": Vs or lua? |
00:57:29 | FromDiscord | <gibson> In reply to @Avahe "I'm so tired of": Have you tried moe? https://github.com/fox0430/moe |
00:57:52 | FromDiscord | <Prestige> In reply to @ripluke "Vs or lua?": Keybinding is in vimscript, just doing :term nim r %s basically |
00:57:58 | FromDiscord | <Elegantbeef> I dont think moe has semantic analysis |
00:58:08 | FromDiscord | <Prestige> Which runs fine if I manually do that, not using a key binding |
00:58:27 | FromDiscord | <Prestige> In reply to @gibson "Have you tried moe?": Yeah I contributed to it actually, but it's missing too much |
00:58:28 | FromDiscord | <gibson> It does not, but it would reduce the effort of writing a text editor & plugin system manually, to more quickly get to the conclusion that it's a bad idea :p |
00:58:48 | FromDiscord | <Prestige> In reply to @gibson "It does not, but": It's a good idea |
00:58:51 | FromDiscord | <Elegantbeef> Oh cool they want to rewrite moe |
00:59:08 | FromDiscord | <Prestige> Nah I'd take a different approach than moe |
00:59:18 | FromDiscord | <Elegantbeef> Not you |
00:59:21 | FromDiscord | <Elegantbeef> The author of moe |
00:59:28 | FromDiscord | <Elegantbeef> https://github.com/fox0430/moe/issues/1483 |
00:59:34 | FromDiscord | <Prestige> Interesting |
00:59:35 | FromDiscord | <!&luke> In reply to @Avahe "Keybinding is in vimscript,": compiling is resource intensive |
01:00:16 | FromDiscord | <Prestige> In reply to @ripluke "compiling is resource intensive": It only does that if I run it I with a keybinding |
01:00:22 | FromDiscord | <Prestige> Otherwise it's fine |
01:00:55 | FromDiscord | <!&luke> For me cc takes all available cpu |
01:09:24 | FromDiscord | <Rika> In reply to @Avahe "I just need it": Yeah because it’s definitely more desirable for someone to write a plugin than to already have the support via LSP? |
01:11:44 | FromDiscord | <Prestige> I think it's more desirable to have a program just do some work, rather that have to do the work and communicate data over a socket to another program. I think LSP just wasn't a great idea in the first place |
01:12:48 | FromDiscord | <Prestige> If more things like LSP become mainstream, our editors are going to be talking to multiple other processes on our computers communicating over sockets. Just going to be a mess and ultimate add to the list of things computers do slowly for no good reason |
01:13:36 | FromDiscord | <!&luke> Lsp is pretty much universal |
01:13:52 | FromDiscord | <Elegantbeef> I dont see how it makes it slower but ok |
01:14:33 | FromDiscord | <Prestige> I don't see how communicating over a socket couldn't be slower than just not doing it |
01:14:39 | FromDiscord | <Elegantbeef> Pipes exist and they're fast |
01:14:48 | FromDiscord | <Prestige> sure, but it's work that doesn't need to be done at all |
01:15:14 | FromDiscord | <Elegantbeef> Is the IO even really the slowdown of a text editor |
01:15:32 | FromDiscord | <!&luke> In reply to @Avahe "I don't see how": The alternative is to write a plugin for every text editor |
01:15:43 | FromDiscord | <Elegantbeef> The presumption is it's a significant slowdown |
01:16:03 | FromDiscord | <Prestige> doesn't even have to be significant - also it just increases complexity |
01:16:15 | FromDiscord | <Prestige> Like I can just write an editor that does what I want it to, right there in the program |
01:16:19 | FromDiscord | <!&luke> In reply to @ripluke "The alternative is to": It’s just not very feasible |
01:16:40 | FromDiscord | <Elegantbeef> You can do what you want in the program, the downside is you now have a very very rigid text editor |
01:16:42 | FromDiscord | <Prestige> Well I'm not concerned with every text editor or every language |
01:17:00 | FromDiscord | <Elegantbeef> The reason LSP exists is to remove the rigidity of editors |
01:17:03 | FromDiscord | <Prestige> Not rigid if it has a plugin system |
01:17:09 | FromDiscord | <Elegantbeef> It is rigid |
01:17:16 | FromDiscord | <Prestige> That's basically all LSP is |
01:17:55 | FromDiscord | <Elegantbeef> Cause i now have to re-implement the LSP capabilities for your plugin system |
01:18:00 | FromDiscord | <Prestige> LSP doesn't remove rigidity |
01:18:06 | FromDiscord | <Elegantbeef> It very much does |
01:18:21 | FromDiscord | <Elegantbeef> You remove having to rewrite code that is pretty much universal |
01:18:32 | FromDiscord | <Prestige> The editor has to support the protocol, it's as rigid as the protocol is |
01:18:53 | FromDiscord | <Elegantbeef> With LSP supported you can just use any language server you want and it just works |
01:19:27 | FromDiscord | <Prestige> With a plugin system you can use any language that has a plugin and it just works |
01:19:29 | FromDiscord | <Prestige> I don't get your point |
01:19:39 | FromDiscord | <Elegantbeef> You have to write the plugin specifically for your editor |
01:19:43 | FromDiscord | <Elegantbeef> It's a bunch of repeated work |
01:20:11 | FromDiscord | <!&luke> In reply to @Elegantbeef "You have to write": Yea |
01:20:18 | FromDiscord | <Elegantbeef> The LSP works anywhere your plugin works at a single spot |
01:20:35 | FromDiscord | <Prestige> That still has no effect on the rigidity of the editor |
01:20:43 | FromDiscord | <Elegantbeef> What? |
01:20:54 | FromDiscord | <Prestige> They would both have the same capabilities |
01:21:26 | FromDiscord | <Elegantbeef> The rigidity of editors i'm talking about is when they use their own plugin system you're locked there |
01:21:27 | FromDiscord | <Elegantbeef> You cannot easily move to another editor |
01:21:53 | FromDiscord | <!Patitotective> In reply to @Avahe "They would both have": well, yes↵if you implement all LSP features in your plugin they'll have the same features |
01:22:02 | FromDiscord | <Prestige> Yeah exactly |
01:23:03 | FromDiscord | <Elegantbeef> I do wonder In what way is a plugin system less complex than supporting LSP |
01:23:10 | * | krux02 quit (Remote host closed the connection) |
01:23:22 | FromDiscord | <!Patitotective> what about making your own efficient LSP lmao |
01:23:44 | FromDiscord | <Prestige> The most efficient lsp is basically just a plugin |
01:23:51 | FromDiscord | <!Patitotective> and then make a text editor that supports both |
01:24:04 | FromDiscord | <Elegantbeef> The most efficient LSP no LSP |
01:24:33 | FromDiscord | <Prestige> imo editors shouldn't be like interfacing with servers that do some work, that's just bonkers to me |
01:24:45 | FromDiscord | <Elegantbeef> Code resuse is a wonderful thing |
01:24:49 | FromDiscord | <Elegantbeef> reuse\ |
01:25:05 | FromDiscord | <Prestige> Slow computers in the 2020s makes me sad |
01:25:14 | FromDiscord | <Elegantbeef> Sure is the LSP the actual slowdown though |
01:25:16 | FromDiscord | <Prestige> hardware has advanced so far and shit is slower than ever |
01:25:37 | FromDiscord | <Elegantbeef> Yea wirth had a good point in 1995, but I'm very dubious of the claim that LSPs are the reason for slow software |
01:25:54 | FromDiscord | <Prestige> I think LSP is the wrong approach and systems/designs like LSP will drive us further from fast computers |
01:26:13 | FromDiscord | <Elegantbeef> Do you have empirical evidence to the claim that LSPs are actually slowing down operations? |
01:26:21 | FromDiscord | <Prestige> Yes |
01:26:34 | FromDiscord | <Prestige> The laws of physics |
01:26:39 | FromDiscord | <Elegantbeef> Ok so no |
01:26:58 | FromDiscord | <Prestige> Sending data back and forth over a socket cannot be faster than not doing it at all |
01:27:10 | FromDiscord | <Elegantbeef> That's under the assumption that's the bottle neck of a program |
01:27:30 | FromDiscord | <Prestige> I'm not talking about bottlenecks of a program, I'm talking about LSP |
01:27:31 | FromDiscord | <Elegantbeef> You lack evidence for the claim that LSP is actually causing programs to be slow |
01:27:44 | FromDiscord | <Elegantbeef> You are saying programs are slow, due to the socket approach of LSP |
01:27:47 | FromDiscord | <Prestige> I think you're missing my point |
01:27:57 | FromDiscord | <Elegantbeef> "IO is slow" |
01:28:08 | FromDiscord | <Prestige> My whole point is that doing IO is slower than _not_ doing IO |
01:28:22 | FromDiscord | <Elegantbeef> Ok so... LSPs are bad cause IO exists |
01:28:29 | FromDiscord | <Elegantbeef> Not cause they empirically cause issues |
01:28:34 | FromDiscord | <Elegantbeef> Got you |
01:28:36 | FromDiscord | <Prestige> Doing IO work when you don't need to do IO is bad, yes |
01:28:57 | FromDiscord | <Rika> You only think you don’t need it because you don’t see the point of LSP |
01:29:11 | FromDiscord | <Elegantbeef> Is IO work better than VM work? |
01:29:16 | FromDiscord | <Elegantbeef> Which is better work |
01:29:21 | FromDiscord | <Prestige> I see the point of LSP, but I also see why it's not a good design we should be following |
01:29:35 | FromDiscord | <Rika> I don’t see how you could do better without IO |
01:29:36 | FromDiscord | <Elegantbeef> Would a JIT'd VM's work always be faster than a native program using IO? |
01:29:51 | FromDiscord | <Elegantbeef> Web Assembly! 😛↵(@Rika) |
01:29:59 | FromDiscord | <Rika> No I don’t think another plugin system in another language with another standard library for the editor is any better |
01:30:16 | FromDiscord | <Elegantbeef> Use a system library so when that crashes your entire editor crashes |
01:30:29 | FromDiscord | <Rika> In reply to @Elegantbeef "Would a JIT'd VM's": Possibly |
01:30:39 | FromDiscord | <Rika> In reply to @Elegantbeef "Web Assembly! 😛 (<@259277943275126785>)": Not what I mean xd |
01:31:09 | FromDiscord | <Prestige> Like I can have a program do the work for `1 + 1` and just have it there in my program. Or, I could send it off to some other CSP (calculator server protocol) server over a socket to do the math, then send it back to my program, then translate that to the actual result |
01:31:17 | FromDiscord | <Prestige> doing it locally in my program would be much better |
01:31:20 | FromDiscord | <Prestige> and less complex |
01:31:21 | FromDiscord | <gibson> In the context of text editing, below some time threshold all computational work is equivalent, and thus LSP work is probably qualitatively equivalent to an editor that doesn't use LSP at all. |
01:31:41 | FromDiscord | <Rika> In reply to @Avahe "Like I can have": Well you can go have fun having your community write plugins for every programming language in the world |
01:31:51 | FromDiscord | <Prestige> In reply to @Rika "Well you can go": Why would I do that? |
01:31:56 | FromDiscord | <Rika> There’s a difference between math and languages |
01:32:03 | FromDiscord | <Prestige> I already said I'm not concerned with supporting every language |
01:32:17 | * | rockcavera joined #nim |
01:32:17 | * | rockcavera quit (Changing host) |
01:32:17 | * | rockcavera joined #nim |
01:32:24 | FromDiscord | <Rika> In reply to @Avahe "I already said I'm": If that’s so then why are you so tempted to write a new editor |
01:32:33 | FromDiscord | <Prestige> For Nim |
01:32:39 | FromDiscord | <Rika> Okay |
01:32:49 | FromDiscord | <Rika> You do you I guess |
01:32:55 | FromDiscord | <Prestige> Always do |
01:35:00 | FromDiscord | <gibson> @Prestige this would make sense as a plugin for Aporia. Everything written in one place, for 1 language, if that's what you're after. https://github.com/dom96/Aporia |
01:36:18 | FromDiscord | <Prestige> Well, sorta. Mine will be tui based, but yeah. It'll all be one thing in one code base, not a distributed system like lsp |
01:37:25 | FromDiscord | <Elegantbeef> context for that 'wirth was right in 1995' if anyone was curious https://cr.yp.to/bib/1995/wirth.pdf |
01:38:48 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "*context for that 'wirth": beef thinking in the young people |
01:39:12 | FromDiscord | <Elegantbeef> I'm a young people patito |
01:43:20 | FromDiscord | <!Patitotective> depends on how old you consider young |
01:43:26 | FromDiscord | <gibson> sent a long message, see http://ix.io/46Ho |
01:44:15 | FromDiscord | <Prestige> Yeah, I've found over the years it's usually worth the effort of writing your own thing for your own use case. It hasn't failed me yet |
01:44:43 | FromDiscord | <Prestige> Usually re-using someone else's thing causes more headache than it's worth |
01:45:34 | FromDiscord | <gibson> I'm surprised you can't do work with neovim. It seems to work for most folks who are interested in editing code. |
01:45:48 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46Hp |
01:46:21 | FromDiscord | <Prestige> Neovim mostly works, but if I wanted to fix some bug deep in there code base it wouldn't be fun |
01:46:33 | FromDiscord | <Prestige> and I'm really not a fan of lua |
01:47:37 | FromDiscord | <!Patitotective> neovim PR #2839 rewritten in nim |
01:47:43 | FromDiscord | <Prestige> Lol |
01:48:07 | FromDiscord | <Elegantbeef> PR #2840 no more vimscript it's now nimscript |
01:48:18 | FromDiscord | <gibson> But you are saying it is by default causing more headache for you than if you were to write an editor yourself, which is a bold claim about the state of neovim, and about the proportion of that headache to the time you think it would take to write a new editor. I'm just surprised anyone has such a large headache with neovim. |
01:48:34 | FromDiscord | <Rika> In reply to @Avahe "Neovim mostly works, but": What bug |
01:48:51 | FromDiscord | <Elegantbeef> Hey neovim is annoying give i dont type properly with my right hand↵(@gibson) |
01:48:56 | FromDiscord | <Elegantbeef> given i dont\ |
01:49:27 | FromDiscord | <Rika> Lol |
01:49:36 | FromDiscord | <gibson> That doesn't sound like a bug 😉 also, sorry 😦 |
01:49:55 | FromDiscord | <Elegantbeef> Saying sorry cause i'm a fuckwit seems like a low bar |
01:50:31 | FromDiscord | <Prestige> In reply to @Rika "What bug": That was a hypothetical, but I am running into a weird bug - If I run a `nim r` command with a keybinding from within neovim, my whole computer basically freezes for 30+ seconds. I can run the same command in a terminal and it works fine. I can even type the command inside neovim with `:!nim r ...` syntax and it's fine. But with a keybinding, it all grinds to a halt |
01:50:53 | FromDiscord | <gibson> I've been there-adjacent, having cut the tip of my finger off. |
01:51:10 | FromDiscord | <!Patitotective> ~~i dont complain and sublime sometimes freezes when switching projects~~ |
01:51:35 | FromDiscord | <Elegantbeef> Fucking LSPs amirite 😛↵(@!Patitotective) |
01:51:38 | FromDiscord | <Prestige> In reply to @gibson "But you are saying": Yep I am saying that |
01:51:40 | FromDiscord | <Elegantbeef> Sorry prestige i couldnt help myself |
01:51:49 | FromDiscord | <Prestige> In reply to @Elegantbeef "Fucking LSPs amirite 😛": Heh |
01:52:49 | FromDiscord | <Prestige> I've had problems with game engines so I wrote my own, had problems with DEs and WMs so I wrote my own, don't think a text editor is going to be the thing that stops me from being anal about software |
01:52:56 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Fucking LSPs amirite 😛": i dont even use an lsp because it slows down my pc lmao |
01:56:54 | FromDiscord | <!Patitotective> In reply to @Avahe "I've had problems with": name the text editor prestige |
01:57:37 | FromDiscord | <Prestige> The one I'll make? Hmm I'll have to think of a name |
01:57:38 | FromDiscord | <Elegantbeef> Fuck no |
01:57:54 | FromDiscord | <!Patitotective> like sublime, prestige, elegant lmao |
01:58:08 | FromDiscord | <Elegantbeef> Call it "rightly" as it's done right in his opinion |
01:58:22 | FromDiscord | <Elegantbeef> and rightly is a homophone for the made up word writely |
01:58:50 | FromDiscord | <Elegantbeef> Or call it writely, 😄 |
01:58:51 | FromDiscord | <Prestige> Nice |
01:58:56 | FromDiscord | <Prestige> I like Writely |
01:59:32 | FromDiscord | <Elegantbeef> That'll be $70.99 |
01:59:39 | FromDiscord | <!Patitotective> ~~more like Writely (only-nim)~~ |
02:00:18 | FromDiscord | <Elegantbeef> Patito i really hope your parents didnt have the same naming skills as you. If so you're probably named "Son of Mother and \father" |
02:00:43 | FromDiscord | <Elegantbeef> What i'm saying is dont name anything |
02:01:43 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Patito i really hope": hahah |
02:01:57 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "What i'm saying is": im going to consult you from now on |
02:04:27 | FromDiscord | <voidwalker> Haha, first succesful use of weave, got my IP restricted on imdb.com |
02:04:30 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=46Hr |
02:04:39 | FromDiscord | <Bubblie> (edit) "https://play.nim-lang.org/#ix=46Hr" => "https://play.nim-lang.org/#ix=46Hs" |
02:04:52 | FromDiscord | <Bubblie> thank you! |
02:04:53 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46Ht |
02:04:57 | FromDiscord | <Bubblie> I forgot nim uses keywords for that |
02:05:28 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46Hu |
02:05:55 | FromDiscord | <voidwalker> Ok so it seems I cannot add the results of the proc to a global variable, tells me it is not GC safe |
02:06:07 | FromDiscord | <!Patitotective> In reply to @Bubblie "I forgot nim uses": yep, nim doesnt like cryptic stuff (ignore %) |
02:06:18 | FromDiscord | <huantian> data race pog |
02:06:20 | FromDiscord | <!Patitotective> (edit) "(ignore %)" => "~~(ignore %)~~" |
02:07:16 | FromDiscord | <voidwalker> I wonder if writing directly to the database would work.. sqlite seems to have a way to do concurrent writes. |
02:07:27 | NimEventer | New Nimble package! records - Operations on tuples as heterogeneous record types a la Relational Algebra, see https://github.com/rotu/nim-records |
02:08:21 | FromDiscord | <voidwalker> What is the way to do things here, where I need i, and proc(i):string ? |
02:08:39 | FromDiscord | <huantian> if you're doing web requests you might wanna do async↵but using threads you need to use a lock on your seq or an atomic sequency thingy↵idk I don't use threads |
02:09:15 | FromDiscord | <voidwalker> atomic sequence.. never heard of that. I read about locks, I thought this was simple enough to get away without using any |
02:09:44 | FromDiscord | <voidwalker> the examples in the weave git passes pointers.. maybe I should just pass the pointer to list[i] and write there? |
02:09:49 | FromDiscord | <huantian> I have no idea if atomic sequences exist lmao |
02:10:07 | FromDiscord | <Elegantbeef> probably not |
02:10:22 | FromDiscord | <Elegantbeef> Growing/accessing a sequence very much seems like something not capable of being done in a single cycle |
02:10:37 | FromDiscord | <!Patitotective> well, i'm not sure you can do that since you're doing multi-threading, why not async or threading? |
02:10:46 | FromDiscord | <huantian> multithreading == threading |
02:11:03 | FromDiscord | <!Patitotective> eeeh, really? |
02:11:07 | FromDiscord | <huantian> I think? |
02:11:16 | FromDiscord | <Elegantbeef> yes |
02:11:54 | FromDiscord | <!Patitotective> may i mean single threading? |
02:12:01 | FromDiscord | <voidwalker> Well I thought, it could be possible to write it with async, but then I'd have to basically write a threadpool manager for it, if I want n instances of the thing running ? |
02:12:03 | FromDiscord | <Elegantbeef> No |
02:12:10 | FromDiscord | <Bubblie> In reply to @Patitotective "yep, nim doesnt like": it makes it easier to read tbh |
02:12:13 | FromDiscord | <Bubblie> I quite like it |
02:12:24 | FromDiscord | <Bubblie> its not overly verbose either :) |
02:12:29 | FromDiscord | <Elegantbeef> No one ever will really say "threaded" to mean "single threaded" |
02:12:33 | FromDiscord | <!Patitotective> In reply to @voidwalker "Well I thought, it": https://nim-lang.org/docs/asyncdispatch.html |
02:12:49 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "No one ever will": may i be dumb |
02:13:02 | FromDiscord | <voidwalker> yeah I read that like 5 times, still don't quite get it 😦 |
02:13:19 | FromDiscord | <!Patitotective> maybe https://peterme.net/asynchronous-programming-in-nim.html |
02:13:19 | FromDiscord | <Elegantbeef> Likely |
02:13:38 | FromDiscord | <huantian> you probably want <https://nim-lang.org/docs/asyncfutures.html#all%2Cvarargs%5BFuture%5BT%5D%5D> at some time |
02:57:41 | FromDiscord | <!Patitotective> 🌃 |
03:05:48 | * | arkurious quit (Quit: Leaving) |
03:27:23 | FromDiscord | <Rainbow Asteroids> why is that an emoji |
03:27:33 | FromDiscord | <Rika> Ask the Japanese |
03:27:38 | FromDiscord | <Rika> 🗾 |
03:28:00 | FromDiscord | <pepperoni> Why nim have standard library when c has standard library and nim comlile to c |
03:28:17 | FromDiscord | <Rainbow Asteroids> because our stdlib is cooler |
03:28:20 | FromDiscord | <Rika> Because the c standard library isn’t fitting for Nim |
03:28:39 | FromDiscord | <Rika> There’s a lot missing for a modern language |
03:28:52 | FromDiscord | <Rika> Many people expect stuff like a web client and whatnot |
03:29:02 | FromDiscord | <Rainbow Asteroids> or length to be embedded in the array type |
03:29:13 | FromDiscord | <pepperoni> Their expectations are too high |
03:29:46 | FromDiscord | <huantian> I don't know I don't wanna be using printf instead of echo 😛 |
03:29:58 | FromDiscord | <pepperoni> I feel like web stuff in stdlib bad and make executable too big |
03:30:13 | FromDiscord | <Rainbow Asteroids> then just dont import the web client |
03:30:20 | FromDiscord | <huantian> ^ it doesn't compile the parts in the stdlib that you don't use |
03:30:26 | FromDiscord | <Rainbow Asteroids> dead code isn't compiled |
03:30:42 | FromDiscord | <pepperoni> O |
03:31:00 | FromDiscord | <pepperoni> Ok I take back what I said |
03:36:37 | FromDiscord | <Elegantbeef> Lol what a deeply held belief |
03:40:41 | FromDiscord | <Rika> Lol |
03:49:57 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=46HF |
03:50:00 | FromDiscord | <Bubblie> basically checking for debug or not |
03:50:01 | FromDiscord | <Bubblie> (edit) "https://play.nim-lang.org/#ix=46HF" => "https://paste.rs/NBN" |
03:50:03 | FromDiscord | <Elegantbeef> `when defined(debug)` |
03:50:08 | FromDiscord | <Bubblie> thanks :) |
03:51:29 | * | xet7 quit (Remote host closed the connection) |
03:56:54 | FromDiscord | <Bubblie> sorry to keep pestering but is there a way to throw exceptions like a runtime exception in C++? |
03:57:04 | FromDiscord | <Elegantbeef> Yes |
03:57:16 | FromDiscord | <Bubblie> how would one do that? |
03:57:26 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/tut2.html#exceptions |
03:58:01 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix= |
03:58:16 | FromDiscord | <Bubblie> In reply to @Elegantbeef "https://nim-lang.org/docs/tut2.html#exceptions": thanks :) |
03:58:26 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=46HG |
03:58:45 | FromDiscord | <voidwalker> so I can use weave with atomics, the nim locks from threadpool, and the messages thingies? |
03:58:52 | FromDiscord | <voidwalker> message channels |
03:59:20 | FromDiscord | <Rika> I think weave has its own implementation, they mean that you can use it on any operating system with those facilities |
04:00:46 | FromDiscord | <voidwalker> didn't find anything about that in the main page |
04:01:22 | FromDiscord | <voidwalker> I could do a hack and write the results to files on disk : ( |
04:02:02 | FromDiscord | <Bubblie> wait so which error would I use for a runtime error in nim |
04:02:27 | FromDiscord | <Elegantbeef> Depends on which you have↵(@Bubblie) |
04:02:37 | FromDiscord | <Elegantbeef> Nim has a few built in but you can define your own if they're not specific enough |
04:02:45 | FromDiscord | <Bubblie> oh thats neat! |
04:02:53 | FromDiscord | <Elegantbeef> IOError, ValueError, OSError are the common ones in the stdlib |
04:03:15 | FromDiscord | <Prestige> I'm lazy and just use `Exception` and write an error message |
04:03:46 | FromDiscord | <Elegantbeef> Ah yes the most unhelpful exception 😄 |
04:03:49 | FromDiscord | <Prestige> Heh |
04:04:02 | FromDiscord | <Elegantbeef> `raises: [Exception]` .... wait that means it could raise anything! |
04:04:17 | FromDiscord | <Bubblie> thats really cool |
04:04:23 | FromDiscord | <!&luke> Hello |
04:04:25 | FromDiscord | <Bubblie> I just used ValueError actually since it fit my purpose |
04:04:28 | FromDiscord | <Bubblie> thanks beef :D |
04:04:30 | FromDiscord | <Elegantbeef> Yea good |
04:04:36 | FromDiscord | <!&luke> I have a question about imports |
04:04:46 | FromDiscord | <Elegantbeef> Using `Exception` is not great for anyone that uses your code |
04:05:12 | FromDiscord | <!&luke> In reply to @ripluke "I have a question": How can I get the code inside of the imported file to be run instead of just putting it in a function |
04:05:26 | FromDiscord | <Elegantbeef> You want the most specific exception so if someone annotates with the `raise` annotation they can say "I dont care about X exception from Y proc call" |
04:05:35 | FromDiscord | <Elegantbeef> Top level code still runs |
04:05:35 | FromDiscord | <!&luke> In reply to @ripluke "How can I get": Like in lua and js the require function runs the code |
04:05:40 | FromDiscord | <Elegantbeef> But it's generally to be avoided |
04:05:52 | FromDiscord | <!&luke> In reply to @Elegantbeef "Top level code still": It does? |
04:05:54 | FromDiscord | <Prestige> Yep |
04:06:27 | * | euantorano quit (Ping timeout: 244 seconds) |
04:07:27 | FromDiscord | <Rika> It runs on import |
04:07:50 | FromDiscord | <Rika> So the code after the import statement is “run before the imported code’s top level” |
04:11:28 | FromDiscord | <voidwalker> @ElegantBeef wanna say some words about a seq[string] result data storage to be resutled from running procs in parallel ? |
04:11:46 | FromDiscord | <voidwalker> I need a better way than write a million files then read the results from them and combine |
04:12:15 | FromDiscord | <Elegantbeef> Spool up threads send result to a channel then write the output to a file on main thread |
04:12:27 | FromDiscord | <Elegantbeef> Or a specific t hread |
04:12:35 | FromDiscord | <Elegantbeef> Depends on what the program is doing |
04:13:14 | FromDiscord | <voidwalker> well I don't want to write to files.. that was just a hack to avoid the inability to accumulte them in a global seq |
04:13:25 | FromDiscord | <voidwalker> the end destination is an sqlite database |
04:13:34 | NimEventer | New Nimble package! geomancer - A library and program for getting geomancy charts and figures., see https://github.com/VitorGoatman/geomancer |
04:13:35 | FromDiscord | <Elegantbeef> Well then the channel approach works fine |
04:13:46 | * | euantorano joined #nim |
04:13:48 | FromDiscord | <Elegantbeef> Your main thread can add them to a sequence then send them at a certain limit |
04:17:48 | FromDiscord | <voidwalker> Weave has not been tested with GC-ed types. Pass a pointer around or use Nim channels which are GC-aware. |
04:17:57 | FromDiscord | <voidwalker> Only I can't see any example on using channels |
04:18:02 | FromDiscord | <voidwalker> are those from nim or weave channels? |
04:18:10 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/channels_builtin.html#example |
04:36:41 | FromDiscord | <Prestige> What's this weave business |
04:37:58 | FromDiscord | <Elegantbeef> mratsims multithreaded library |
04:50:51 | FromDiscord | <Prestige> Interesting |
05:02:08 | * | wallabra_ joined #nim |
05:04:03 | * | wallabra quit (Ping timeout: 252 seconds) |
05:04:03 | * | wallabra_ is now known as wallabra |
05:24:03 | * | wallabra_ joined #nim |
05:24:59 | * | CyberTailor quit (Excess Flood) |
05:25:02 | * | wallabra quit (Ping timeout: 240 seconds) |
05:25:42 | * | wallabra_ is now known as wallabra |
05:26:14 | * | CyberTailor joined #nim |
05:30:37 | * | CyberTailor quit (Remote host closed the connection) |
05:31:36 | * | CyberTailor joined #nim |
05:46:28 | FromDiscord | <!&luke> How can I have nim try running a peice of code, but if it errors just continue running the rest of the code |
05:46:51 | FromDiscord | <Elegantbeef> You cannot really |
05:46:57 | FromDiscord | <!&luke> I don’t want to use try except as then I would have to duplicate my code for the try and except statements |
05:46:58 | FromDiscord | <Elegantbeef> You can do `when compiles(codeHere): codeHere` |
05:47:09 | FromDiscord | <Elegantbeef> What's the case here |
05:47:13 | FromDiscord | <!&luke> In reply to @Elegantbeef "You can do": Not compiler error |
05:47:16 | FromDiscord | <!&luke> Runtime error |
05:47:17 | FromDiscord | <Elegantbeef> You want a try finally |
05:47:25 | FromDiscord | <!&luke> What |
05:47:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46HR |
05:48:08 | FromDiscord | <!&luke> What does the finally do tho |
05:48:18 | FromDiscord | <!&luke> Is it the rest of the code |
05:48:24 | FromDiscord | <Elegantbeef> It runs after the try |
05:48:27 | FromDiscord | <Elegantbeef> or any exceptions inbetween them |
05:48:27 | FromDiscord | <!&luke> oh |
05:49:20 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/tut2.html#exceptions-try-statement |
06:37:36 | madprops | what should rumself be |
06:37:42 | madprops | i've been staring at an empty main function |
06:37:47 | madprops | thinking what rumsfeld.nim should be |
06:37:50 | madprops | but im blank |
06:38:02 | madprops | it's in honor of donald rumsfeld |
06:38:06 | madprops | a person i know nothing about |
06:39:05 | FromDiscord | <Elegantbeef> Cant tell if political satire or actually crazy |
06:39:50 | madprops | i just think it's a name |
06:40:06 | madprops | what i want to do is a vscode extension |
06:40:10 | madprops | but doing them is a pita |
06:40:23 | madprops | i've made several |
06:41:16 | madprops | the extension would simply save in /tmp/ the current path you're editing |
06:41:21 | madprops | so you can use it with scripts |
06:41:26 | madprops | the path |
06:41:52 | madprops | since right now there's no way to know what document you're editing/focused on vscode |
06:42:22 | madprops | i would use it with my file system explorer |
06:42:37 | madprops | to start exploring in the that dir |
06:44:28 | madprops | i made an issue about it on vscode. they said that's the job for an extension |
06:45:28 | madprops | which is probably right |
06:57:15 | * | CyberTailor quit (Read error: Connection reset by peer) |
06:57:59 | * | CyberTailor joined #nim |
07:09:03 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=46Ib |
07:09:35 | FromDiscord | <Elegantbeef> An error that is posting to a very rude terminal is my money |
07:14:48 | madprops | the playground is not responding |
07:17:17 | FromDiscord | <Prestige> It goes down all the time |
07:17:24 | FromDiscord | <Prestige> Need PMunch to restart it |
07:34:09 | * | rockcavera quit (Remote host closed the connection) |
07:55:38 | toothlessgear | \close |
07:56:18 | * | toothlessgear left #nim (#nim) |
10:02:05 | * | CyberTailor quit (Remote host closed the connection) |
10:03:17 | * | CyberTailor joined #nim |
10:55:43 | * | CyberTailor quit (Remote host closed the connection) |
10:56:55 | * | CyberTailor joined #nim |
11:04:45 | FromDiscord | <creikey> Why does nim have exceptions, they seem not good because at any point in your program you need to consider that an exception could happen reducing the reliability of all nim programs |
11:05:00 | FromDiscord | <creikey> (edit) "Why does nim have exceptions, they seem not good because at any point in your program you need to consider that an exception could happen reducing the reliability of all nim programs ... " added "as this is usually not done completely" |
11:10:05 | FromDiscord | <Rika> You can enforce exception catching with the raises pragma |
11:10:28 | FromDiscord | <Rika> This allows for checked exceptions without enforcing it for those who do not want to catch exceptions |
11:11:28 | FromDiscord | <creikey> That's cool |
11:39:26 | FromDiscord | <Phil> In reply to @Rika "You can enforce exception": is there a flag that acts as if every proc had that pragma annotated?↵I'm asking mostly because e.g. annotating with raises, specifically when the raised exceptions may originate from code not my own, means reading a lot of docs |
11:39:40 | FromDiscord | <Phil> (edit) "annotated?↵I'm" => "annotated with the specific exceptions it may throw?↵I'm" |
11:42:34 | FromDiscord | <Rika> Push pragma not working? |
11:42:39 | qwr | in many cases you don't really care about what failed or how - and then exceptions simplify code considerably |
11:43:44 | qwr | even rust invited ? operator to emulate such exception handling |
11:46:06 | * | qwr has only one nitpick about nim exceptions - newException around exception constuctors seems a bit reduntant and unusually verbose among other nim code |
11:46:41 | FromDiscord | <planetis> I think .raises is better inferred by the compiler and you don't need it. But sometimes it's wrong and you have to override it. |
12:17:18 | * | ggsx joined #nim |
12:18:01 | FromDiscord | <exelotl> but the compiler infers anyways, raises:[] is asking the compiler to let you know if your assumptions were wrong |
12:25:51 | ggsx | playground is down |
12:26:16 | ggsx | https://pastebin.com/TsanrmRD |
12:26:20 | ggsx | Error: internal error: /build/nim/src/Nim-1.6.6/compiler/ccgstmts.nim(1604, 18) |
12:27:20 | ggsx | anyone can understand that error message? |
12:41:50 | FromDiscord | <konsumlamm> internal error means it's a bug in the compiler |
12:41:53 | FromDiscord | <konsumlamm> always |
12:42:12 | FromDiscord | <konsumlamm> best to open an issue on github |
12:47:39 | * | ggsx quit (Quit: Client closed) |
12:49:56 | * | ggsx joined #nim |
12:50:49 | FromDiscord | <Phil> In reply to @Rika "Push pragma not working?": Does the push pragma automatically apply to all code in my project if I just put it at the start of my project file? |
13:08:07 | NimEventer | New Nimble package! nbcnews - NBC News scraper, see https://github.com/thisago/nbcnews |
13:09:14 | FromDiscord | <PyryTheBurger> what does export do in nim |
13:11:57 | FromDiscord | <hotdog> Ping @4zv4l a fix for nim's jsondoc output just got merged, so `mddoc` works again - https://github.com/nim-lang/Nim/pull/20135 . You can use it now by updating to latest devel, or wait until the next stable release. Or use a different method for docs if you want to 🙂 |
13:12:14 | FromDiscord | <deeuu> @Phil curious, do you prefer rust style explicit error handling (results)? I think I spotted you talking about them in the past. Keen to hear from your experience |
13:13:34 | FromDiscord | <hotdog> In reply to @PyryTheBurger "what does export do": https://nim-lang.org/docs/manual.html#modules-export-statement |
13:13:52 | FromDiscord | <hotdog> Useful for exporting modules at the top level of a package and stuff like that |
13:16:51 | * | lumo_e joined #nim |
13:17:26 | FromDiscord | <4zv4l> In reply to @hotdog "Ping <@329196212282458112> a fix": thaaanks !!! |
13:22:23 | FromDiscord | <Phil> In reply to @deeuu "<@180601887916163073> curious, do you": Yes. As much as I dislike a lot of the other things in the language, I like being forced to deal with the errors I am potentially causing and thus being forced to be aware and handle all code-paths |
13:22:39 | * | jmd_ quit (Ping timeout: 268 seconds) |
13:22:48 | FromDiscord | <Phil> It's why I use optionals everywhere that could be "empty" |
13:29:19 | FromDiscord | <Phil> I don't explicitly need the "Result" type, I just want the compiler to yell at me for exceptions I don't catch in my code |
13:29:40 | FromDiscord | <Phil> (edit) "code" => "code. And ideally I'd want that mechanism with as little effort put in on my own as possible" |
13:33:38 | FromDiscord | <enthus1ast> @Phil\:↵{.push raises\: [].}maybe? |
13:33:49 | FromDiscord | <enthus1ast> this way you say\: my stuff do not raise |
13:34:05 | FromDiscord | <enthus1ast> and when it raise and it is not catched then it is an error |
13:34:52 | FromDiscord | <enthus1ast> this is what status has in their style guide\: https://status-im.github.io/nim-style-guide/errors.exceptions.html |
13:37:17 | FromDiscord | <enthus1ast> ah rika mentioned this already |
13:38:02 | FromDiscord | <deeuu> @Phil That's fair. For one of my apps, I tried slapping the raises pragma on every proc and man my code started to look dirty since basically everything can raise. I ended up compromising by moving them further up the call chain. ↵↵@enthus1ast what are your thoughts? |
13:39:14 | FromDiscord | <enthus1ast> i think its a valid point that unhandled exceptions are a source of leaks etc. |
13:39:27 | FromDiscord | <Phil> In reply to @deeuu "<@180601887916163073> That's fair. For": If rika mentioned this already I may just not have gotten it, let me read the styleguide |
13:40:25 | FromDiscord | <enthus1ast> imho java (or c#?) requires the same annotations right? |
13:41:17 | FromDiscord | <Phil> not requires, they have `throws <ExceptionClass>` |
13:41:39 | FromDiscord | <enthus1ast> yeah this |
13:41:44 | FromDiscord | <Phil> for multiple exceptions, `throws <ExceptionType1>, <ExceptionType2>, ...` |
13:42:18 | FromDiscord | <Phil> In that sense the raises pragma acts very similarly to the raises pragma |
13:42:24 | FromDiscord | <enthus1ast> it would actually be nice if the nim compiler could generate such hints in for the docs |
13:42:29 | FromDiscord | <Phil> But as a sidenote: I rarely use throws exactly because of this |
13:43:21 | FromDiscord | <Phil> In reply to @enthus1ast "this way you say\:": I don't think I can properly parse that sentence, could you rephrase? |
13:43:30 | FromDiscord | <Phil> Does that mean "if you see an exception, do not raise it"? |
13:44:13 | FromDiscord | <enthus1ast> you say\: "i tell you compiler that my code do not raise exceptions (or should not), but if it does, it is an compile time error" |
13:44:42 | FromDiscord | <enthus1ast> my brain does not function well, its simply too hot |
13:45:14 | FromDiscord | <Phil> Ohhh so that way the compiler tells me to handle all exceptions within my procs |
13:45:30 | FromDiscord | <enthus1ast> yes |
13:47:16 | FromDiscord | <Phil> And assuming I say "Well, this one proc shall raise my own "NotFoundException", that's okay" I can just annotate that proc specifically? |
13:47:46 | FromDiscord | <Phil> In reply to @enthus1ast "my brain does not": I relate to this way too much |
13:51:35 | * | ggsx quit (Quit: Client closed) |
14:08:36 | FromDiscord | <deeuu> In reply to @Isofruit "And assuming I say": Yeah that's right. Is this different to Java? |
14:09:23 | * | rockcavera joined #nim |
14:09:23 | * | rockcavera quit (Changing host) |
14:09:23 | * | rockcavera joined #nim |
14:09:37 | FromDiscord | <Phil> In reply to @deeuu "Yeah that's right. Is": I at least haven't seen so far the ability in java to say "Enforce that every function deals with every exception it might throw" |
14:09:52 | FromDiscord | <Phil> You can only add throws and tell functions that will call you to deal with the Exceptions you inform them of |
14:11:08 | FromDiscord | <Phil> So right now I'm contemplating how to add the {.raises: [].} to all files in my project via cli |
14:11:24 | FromDiscord | <Phil> ~~Because I'll be damned if I add that manually over 100 times~~ |
14:11:52 | * | xet7 joined #nim |
14:15:08 | * | xet7 quit (Remote host closed the connection) |
14:16:15 | FromDiscord | <deeuu> In reply to @Isofruit "You can only add": oh okay I see. |
14:18:51 | * | wallabra_ joined #nim |
14:19:02 | * | wallabra quit (Ping timeout: 240 seconds) |
14:19:02 | * | xet7 joined #nim |
14:19:29 | FromDiscord | <Phil> In reply to @deeuu "oh okay I see.": It's one of many ways in which java is just very inconvenient |
14:20:25 | * | wallabra_ is now known as wallabra |
14:23:34 | FromDiscord | <deeuu> In reply to @Isofruit "~~Because I'll be damned": Let me know how you find it, especially if you try nim-result (https://github.com/arnetheduck/nim-result/) |
14:23:58 | FromDiscord | <deeuu> In reply to @Isofruit "So right now I'm": Let me know how you find it, especially if you try nim-result (https://github.com/arnetheduck/nim-result/) |
14:27:32 | FromDiscord | <Phil> In reply to @deeuu "Let me know how": I assume you're also of the type that you like the compiler telling you to fix minor stuff (e.g. like naming inconsistencies) ? |
14:29:42 | FromDiscord | <deeuu> I suppose so, yes. At work, we are doing typescript and have eslint configured to yell at us all the time. |
14:31:53 | FromDiscord | <Phil> In that case you may be glad to hear that chances are the next nim version will fix the thing that makes it currently impossible to turn hints/warnings into errors |
14:32:03 | FromDiscord | <Phil> some |
14:32:08 | FromDiscord | <Phil> (edit) "some ... " added "hints/warnings into errors" |
14:34:45 | FromDiscord | <deeuu> Any examples (I don't Nim enough, though I'm trying to change my ways) |
14:35:40 | FromDiscord | <Phil> Something that I'm currently really looking forward to using:↵ --hintAsError[XDeclaredButNotUsed]:on #Can't be used because systems.nim itself has screwy stuff↵ --warningAsError[UnusedImport]:on #Can't be used because systems.nim itself has screwy stuff |
14:36:00 | FromDiscord | <Phil> That means you can no longer have variables in your code that you do not use↵You can also no longer have imports that you do not use |
14:36:24 | FromDiscord | <Phil> (edit) "#Can't be used because systems.nim itself has screwy stuff↵" => "↵" | removed "#Can't be used because systems.nim itself has screwy stuff" |
14:36:36 | FromDiscord | <deeuu> ahh yeah I recall those. |
14:37:02 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
14:37:06 | FromDiscord | <Phil> I would also use --styleCheck:error but I'm forced to have some snake-case in my models due to my database coming from python |
14:37:10 | FromDiscord | <Phil> And I don't want to rename all my tables |
14:37:29 | FromDiscord | <Phil> (edit) "coming from" => "having been created via" |
14:37:38 | FromDiscord | <Phil> (edit) "I would also use --styleCheck:error but I'm forced to have some snake-case in my models due to my database having been created via python ... " added "back in the day" |
14:38:57 | * | ehmry joined #nim |
14:46:20 | NimEventer | New thread by Deech: Error using `bindSym` at compile time, see https://forum.nim-lang.org/t/9351 |
14:50:14 | NimEventer | New Nimble package! editlyconf - Editly config generation tools and types, see https://github.com/thisago/editlyconf |
15:05:41 | * | Guest8615 is now known as om3ga |
15:23:28 | FromDiscord | <Phil> Fascinating, so some of my code throws `IOSelectorsException` and I have no idea from where it stems, hmm |
15:24:57 | FromDiscord | <Phil> Likely the http server that prologue uses and that prologue uncaught hands over |
15:25:27 | FromDiscord | <flywind> In reply to @Isofruit "Fascinating, so some of": It is from std/selectors. |
15:26:29 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/blob/714eb658666de5b28ee3116a150bc0e59634dfc9/lib/pure/selectors.nim#L282 |
15:29:21 | FromDiscord | <Phil> In reply to @deeuu "Let me know how": the way of just having `raises[]` in each file is extremely verbose, I'll contemplate arne's result type... at some point, I'm feeling like I'm cooking again |
15:31:02 | FromDiscord | <deeuu> In reply to @Isofruit "the way of just": As in, the resulting Nim code (having to try/except everything) is verbose? Or simply that the annotation is verbose |
15:35:17 | FromDiscord | <Phil> The sheer volume of try catch, specifically when you want to covert one exception to another, is near unreadable |
15:36:16 | FromDiscord | <deeuu> Yeah that's where I ended up, even using the `std/logger` was a pain (had to wrap it) |
15:36:17 | FromDiscord | <Phil> Gut feeling says that's an avenue that won't lead to code I like |
15:36:39 | FromDiscord | <deeuu> (edit) "the `std/logger`" => " `std/logging`" |
15:37:04 | FromDiscord | <deeuu> I think it's cleaner if you move the pragma further up, near your CLI entrypoint |
15:44:19 | * | LuxuryMode joined #nim |
15:46:10 | FromDiscord | <deeuu> In reply to @Isofruit "The sheer volume of": How would a result type help with your conversion problem? You're in the same boat, no? |
16:06:43 | * | arkurious joined #nim |
16:06:58 | FromDiscord | <Phil> sent a long message, see http://ix.io/46K1 |
16:07:53 | FromDiscord | <Phil> Just the fact it gets broken down into a single codeblock with a lot of one-liners gives a lot, or at least were my experience with the short time I spent in Rust |
16:08:01 | FromDiscord | <Phil> I'd need to see how that translates with arne's Result lib |
16:09:05 | FromDiscord | <Rainbow Asteroids> is https://play.nim-lang.org/ down for anyone else? |
16:09:30 | FromDiscord | <Phil> In reply to @Rainbow Asteroids "is https://play.nim-lang.org/ down for": can confirm |
16:09:31 | FromDiscord | <flywind> Yeah |
16:09:34 | FromDiscord | <deeuu> In reply to @Rainbow Asteroids "is https://play.nim-lang.org/ down for": down for me |
16:09:36 | FromDiscord | <Rainbow Asteroids> :( |
16:09:58 | FromDiscord | <flywind> You can use some alternatives like wandbox |
16:10:13 | FromDiscord | <Rainbow Asteroids> i have the compiler on this computer so im good |
16:15:34 | FromDiscord | <Bung> hi, I want create windows app with button and particle effect , any resource ? |
16:16:13 | FromDiscord | <Bung> I found some gui libs that have basic components , and https://github.com/oprypin/nim-csfml |
16:21:08 | FromDiscord | <deeuu> In reply to @Isofruit "If a proc I": I mean, you could re-raise on the same line as each except... |
16:23:12 | FromDiscord | <Phil> squint↵Am I that java broken? Let me check |
16:54:40 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46Kj |
17:12:47 | * | CyberTailor quit (Remote host closed the connection) |
17:13:51 | * | CyberTailor joined #nim |
18:42:08 | * | kenran joined #nim |
18:42:58 | * | krux02 joined #nim |
18:45:29 | * | kenran quit (Client Quit) |
18:56:02 | FromDiscord | <!&luke> Would Nim be faster than dart (exe/js) |
19:00:31 | FromDiscord | <Rika> Speed is mainly up to the programmer |
19:00:57 | FromDiscord | <Rika> If you want a good comparison, make a program in both and see their performance |
19:01:10 | FromDiscord | <Rika> Even then it’s not that good because you’re experienced in Nim but not Darr |
19:01:12 | FromDiscord | <Rika> Dart |
19:02:15 | * | lumo_e quit (Ping timeout: 252 seconds) |
19:02:19 | FromDiscord | <Mike> For web, both compile to js, so it's just down to whoever's compiler is smarter. Probably it doesn't matter |
19:02:49 | FromDiscord | <Rika> It can matter but still depends on the programmer |
19:03:16 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46KW |
19:03:28 | FromDiscord | <voidwalker> `Error: 'weaveParallelForSection' is not GC-safe as it accesses 'ids' which is a global using GC'ed memory` |
19:05:38 | FromDiscord | <voidwalker> any idea how to get around this ? I need to work on ids[i] instead of just i. I could use a 0.. max(ids[i]) interval and check if the id exists, as there's not that many blanks.. but that's not very smart |
19:06:25 | FromDiscord | <voidwalker> I thought that it's enough to pass the ids sequence to the proc running in parallel |
19:06:34 | FromDiscord | <domosokrat> did you try putting the code into a function |
19:06:52 | FromDiscord | <domosokrat> since it complains about `ids`being global |
19:09:27 | FromDiscord | <voidwalker> I put it all in a main() proc, now I have |
19:09:44 | FromDiscord | <voidwalker> ` Error: illegal capture 'db' because 'weaveParallelForSection' has the calling convention: <inline>` |
19:19:16 | * | lumo_e joined #nim |
19:22:21 | FromDiscord | <domosokrat> is db a global or defined inside the function? |
19:23:56 | FromDiscord | <reversem3> Has anyone played with event loops for a gui or game engine ? |
19:26:05 | * | rockcavera quit (Read error: Connection reset by peer) |
19:27:48 | FromDiscord | <Prestige> What do you mean exactly? |
19:28:01 | FromDiscord | <Prestige> I have a game engine that polls for input events |
19:33:29 | FromDiscord | <reversem3> Would that be event driven then ? |
19:37:27 | * | rockcavera joined #nim |
19:37:28 | * | rockcavera quit (Changing host) |
19:37:28 | * | rockcavera joined #nim |
19:41:20 | FromDiscord | <voidwalker> domoskrat it's global, the db connection. it worked fine with it passed to the proc executed in parallel |
19:46:48 | FromDiscord | <domosokrat> So you got it working? Great. |
19:51:29 | FromDiscord | <voidwalker> No. It doesn't work. If I have the parallel for not in a proc (main), it complains about not gc safe sequence of int. If I pass it to the parallel executing proc or not. If I have the code body in main, i get the error above |
20:08:18 | FromDiscord | <voidwalker> so what exactly is the limitation for using threadpool/weave, when passing data to procs executing in parallel ? |
20:11:52 | FromDiscord | <Phil> Sorry, I can't simulate how that code would look like, could you post?↵Generally my first thought is that lang's like nim tend to forbid shared mutable state as it is the root of all evil, so my first though would be that maybe one of your 2 code versions gets around that and doesn't actually have shared state |
20:12:21 | FromDiscord | <Phil> (edit) "Sorry, I can't simulate ... how" added "in my head" |
20:16:57 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46L4 |
20:17:28 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=46L4" => "https://play.nim-lang.org/#ix=46L5" |
20:17:40 | FromDiscord | <voidwalker> this results in : ` Error: 'weaveParallelForSection' is not GC-safe as it accesses 'ids' which is a global using GC'ed memory` |
20:18:26 | FromDiscord | <voidwalker> ahh, I think I must pass the pointer to it |
20:19:02 | FromDiscord | <voidwalker> I tried to reassign the sequence with `let`, thinking that if it's immutable it would allow me to use it |
20:19:04 | FromDiscord | <voidwalker> but nope, same thing |
20:22:31 | FromDiscord | <voidwalker> so the problem is not the mutability, but the GC |
20:26:15 | FromDiscord | <Phil> Can you just build the IDS using sequtils on odb.fastRows so you don't have to do the for-loop? |
20:27:51 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46L8 |
20:28:21 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=46L8" => "https://play.nim-lang.org/#ix=46La" |
20:29:49 | FromDiscord | <Phil> no, wait, that doesn't change anything, seq[uint32] is still a ref-type and thus allocated on the heap, which means that the memory will eventually get garbage collected once all references to it die.↵HOWEVER, you know stuff there that the GC doesn't, which is that the reference to that memory will not go out of scope until the end of your code! |
20:29:58 | FromDiscord | <Phil> Which means you can just cast ids as gcsafe |
20:30:37 | FromDiscord | <Phil> As you don't need nim to protect you from a potential read of memory you do not own, you know that memory is yours until you're done |
20:46:19 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=46Ld |
20:48:15 | FromDiscord | <vindaar> sent a long message, see http://ix.io/46Lg |
20:50:33 | FromDiscord | <Phil> In reply to @vindaar "yeah, as <@180601887916163073> says": Wouldn't just telling the compiler to ignore the perceived gc-unsafeness suffice here? |
20:50:56 | FromDiscord | <Phil> Via ` {.cast(gcsafe).}:` |
20:52:38 | * | mahlon quit (Ping timeout: 240 seconds) |
20:53:08 | FromDiscord | <vindaar> I'd be wary. In the past I've seen fun things happening to the GC when handing over seqs directly (random segfaults in the GC code at some points later) |
20:53:28 | FromDiscord | <vindaar> possibly fine, but better to be explicit |
20:54:17 | FromDiscord | <Rika> I doubt it will be fine for weave |
20:55:33 | FromDiscord | <vindaar> in any case, for simple "dumb" parallel work I now often just use `procpool` from cligen (https://github.com/c-blake/cligen/blob/master/cligen/procpool.nim). multiprocessing made simple and less worries about these sort of problems. Doesn't solve the problems weave mainly aims to solve, but most use users of weave probably aren't dealing with those either |
21:05:09 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46Ln |
21:05:27 | FromDiscord | <voidwalker> It has somehow not occured to me that I can do this, since fastRows is an iterator and not a sequence |
21:05:44 | FromDiscord | <voidwalker> however this code results in : ` Error: undeclared identifier: 'it'` |
21:06:32 | FromDiscord | <Rika> If fast rows is an iterator then you cant, no? |
21:07:17 | FromDiscord | <huantian> if mapIt is a template, maybe it does work? |
21:09:04 | FromDiscord | <huantian> you can try adding a toSeq to see if it's a problem with the iterator |
21:09:39 | FromDiscord | <Rika> mapIt is a template from sequtils |
21:09:41 | FromDiscord | <voidwalker> Yeah toSeq worked |
21:10:29 | FromDiscord | <huantian> then you probably just wanna use getAllRows directly |
21:10:33 | * | wallabra quit (Ping timeout: 268 seconds) |
21:11:44 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46Lq |
21:11:49 | FromDiscord | <voidwalker> still does not fix ` 'weaveParallelForSection' is not GC-safe as it accesses 'ids' which is a global using GC'ed memory` |
21:12:47 | FromDiscord | <Phil> cast the paraööelfor |
21:12:52 | FromDiscord | <voidwalker> I tried the variable declaration and the whole parralelFor code, (not sure which I was supposed to) |
21:13:00 | FromDiscord | <Phil> hm |
21:13:40 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46Lt |
21:15:08 | * | jmdaemon joined #nim |
21:20:57 | * | wallabra joined #nim |
21:20:59 | * | wallabra quit (Client Quit) |
21:21:18 | * | jmd_ joined #nim |
21:21:35 | * | jmdaemon quit (Ping timeout: 252 seconds) |
21:22:39 | * | wallabra joined #nim |
21:29:14 | FromDiscord | <domosokrat> Can't you make 'db' local to the function containing this code (or pass it as a parameter)? Then the 'illegal capture' error should disappear, or am I wrong? |
21:29:23 | * | mahlon joined #nim |
21:31:12 | FromDiscord | <voidwalker> it's already passed as parameter, the first one. The db never posed an issue, as it's a pointer to a dbConn |
21:33:31 | * | wallabra quit (Ping timeout: 268 seconds) |
21:34:36 | FromDiscord | <domosokrat> earlier you said it was a global |
21:36:36 | FromDiscord | <voidwalker> yeah it's global, but apparently it's not a GC-ed type, so not a problem in this context. The db issue appeared only when following your suggestion to pu the whole code in a proc |
21:36:55 | FromDiscord | <voidwalker> (edit) "pu" => "put" |
21:37:52 | FromDiscord | <domosokrat> yes, and what if you pass db as a parameter to this proc, since weave comlains that capturing it is illegal? |
21:39:45 | FromDiscord | <domosokrat> and local variable should not need to be captured |
22:07:13 | FromDiscord | <Sun「無用」> sent a code paste, see https://play.nim-lang.org/#ix=46LG |
22:07:20 | FromDiscord | <Elegantbeef> Object variants |
22:07:27 | FromDiscord | <Elegantbeef> or https://github.com/alaviss/union |
22:07:55 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants |
22:09:57 | FromDiscord | <Sun「無用」> I didn't understand the object variant thingy, but the union is kinda readable.... kinda. |
22:10:50 | FromDiscord | <huantian> well generally in nim you don't need unions too much |
22:11:42 | FromDiscord | <!Patitotective> unless you do |
22:12:11 | FromDiscord | <Sun「無用」> Can you do union on type definition as well? |
22:13:09 | FromDiscord | <Sun「無用」> sent a code paste, see https://play.nim-lang.org/#ix=46LJ |
22:13:13 | FromDiscord | <Elegantbeef> Yes |
22:14:06 | FromDiscord | <voidwalker> In reply to @domosokrat "yes, and what if": To be honest I have no idea what this capturing is. db was always passed as parameter to the proc |
22:27:52 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46LO |
22:28:16 | FromDiscord | <voidwalker> Results in `Error: expression has no address; maybe use 'unsafeAddr'` |
22:35:38 | FromDiscord | <domosokrat> sent a code paste, see https://play.nim-lang.org/#ix=46LP |
22:50:16 | FromDiscord | <voidwalker> why can't they be both ? |
22:51:06 | FromDiscord | <vindaar> that's because you probably changed the `ids` variable from a `var` (as in my full snippet) to a `let`..↵(@voidwalker) |
22:54:05 | * | lumo_e quit (Quit: Quit) |
22:54:58 | * | CyberTailor quit (Write error: Connection reset by peer) |
22:56:05 | * | CyberTailor joined #nim |
22:57:07 | * | krux02 quit (Remote host closed the connection) |
23:09:22 | FromDiscord | <voidwalker> @Vindaar indee I have. Now how do I pass that to the proc ? the code example you gave results in ` required type for ids: seq[uint32]↵ but expression 'idsBuf' is of type: ptr UncheckedArray[uint32]` |
23:09:55 | FromDiscord | <vindaar> well, you need to change the signature to match the type you now hand |
23:10:10 | FromDiscord | <vindaar> so instead of `seq[uint32]` it's now going to be `ptr UncheckedArray[uint32]` |
23:10:44 | FromDiscord | <Sun「無用」> sent a code paste, see https://play.nim-lang.org/#ix=46M0 |
23:12:43 | FromDiscord | <vindaar> sequtils has `cycle` for that\: https://nim-lang.github.io/Nim/sequtils.html#cycle%2CopenArray%5BT%5D%2CNatural (or `repeat` if it's only a single element)↵(@Sun「無用」) |
23:13:04 | FromDiscord | <Rika> Not for arrays as far as I know |
23:13:18 | FromDiscord | <Sun「無用」> In reply to @Rika "Not for arrays as": ah, I'm using arrays. |
23:13:30 | FromDiscord | <vindaar> ah, if you want an array output type Rika is right, sorry |
23:13:59 | FromDiscord | <voidwalker> @Vindaar isn't there any alterantive, to keep the signature as it is ? I've no idea what an uncheckedArray is, gotta read |
23:14:05 | FromDiscord | <voidwalker> anyway, with that change I now get : SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
23:14:17 | FromDiscord | <Sun「無用」> In reply to @vindaar "ah, if you want": so I have to literally implement it. |
23:14:18 | FromDiscord | <Sun「無用」> okay |
23:14:39 | FromDiscord | <vindaar> it's just a fancy name for a raw memory buffer (i.e. a pointer) that has no bounds checking or knowledge about it's length.↵(@voidwalker) |
23:14:56 | FromDiscord | <vindaar> that might be for many, many reasons↵(@voidwalker) |
23:16:13 | FromDiscord | <voidwalker> wait, if it's a pointer, it needs different syntax to access the values, no ? |
23:17:09 | FromDiscord | <Rika> In reply to @Sun「無用」 "so I have to": You can but not without some heavy restrictions |
23:17:36 | FromDiscord | <vindaar> yeah, the tricky part for arrays will be that, as they are CT sized, you need a static argument to compute the resulting array type↵(@Sun「無用」) |
23:19:02 | FromDiscord | <vindaar> no, it automatically dereferences it for you when using `[]`↵(@voidwalker) |
23:19:08 | FromDiscord | <Sun「無用」> In reply to @vindaar "yeah, the tricky part": what? |
23:19:20 | FromDiscord | <Sun「無用」> I don't know how to implement it anyways, I'll just do manual |
23:21:25 | * | wallabra joined #nim |
23:23:31 | FromDiscord | <Rika> In reply to @Sun「無用」 "what?": Arrays are sized at compile time |
23:23:39 | FromDiscord | <Rika> You can’t pass in a variable to size then |
23:23:41 | FromDiscord | <Rika> Them |
23:23:50 | FromDiscord | <Rika> oversimplification |
23:24:05 | FromDiscord | <!Patitotective> ~~use seqs~~ |
23:24:14 | FromDiscord | <voidwalker> I put some echos in the proc and before the proc call/parallelFor. It crashses before the proc begine executing the lines, and after it is called |
23:24:50 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46M2 |
23:25:32 | FromDiscord | <vindaar> ah, you're trying to return a `string`? that almost certainly will cause problems as `strings` are GC'd types |
23:26:13 | FromDiscord | <voidwalker> @Vindaar it Had no problem echo-ing the returned string in parallel, before I tried to give the seq[int] list to process (it just went from 0..300) |
23:27:12 | FromDiscord | <voidwalker> so the syntax to access the seq[int] inside the proc would be ids[][i], right ? |
23:27:22 | FromDiscord | <voidwalker> (edit) "seq[int]" => "seq[uint32]" |
23:27:42 | FromDiscord | <vindaar> the syntax to access element `i` of `ids` inside the proc is just `ids[i]` |
23:27:50 | FromDiscord | <vindaar> no dereferencing necessary |
23:31:35 | FromDiscord | <Sun「無用」> how to make a function mutable? cause like, copying is making everything too slow. |
23:34:12 | FromDiscord | <vindaar> what do you mean making a function mutable?↵(@Sun「無用」) |
23:34:44 | * | qwr . o O ( play don't load for me... ) |
23:35:13 | FromDiscord | <Sun「無用」> sent a code paste, see https://play.nim-lang.org/#ix=46M6 |
23:35:19 | FromDiscord | <Sun「無用」> How to make that not an error |
23:36:41 | FromDiscord | <Sun「無用」> In reply to @vindaar "what do you mean": ^ |
23:36:45 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=46M7 |
23:36:58 | FromDiscord | <Sun「無用」> sent a code paste, see https://play.nim-lang.org/#ix=46M8 |
23:37:09 | FromDiscord | <vindaar> what you asked for. making the argument mutable |
23:37:10 | FromDiscord | <Rika> Makes the parameter mutable |
23:42:15 | FromDiscord | <Sun「無用」> ``let playerMove: (Natural, Natural) = (1, 2)`` Why does this gives me an error? It's a natural tuple... |
23:43:02 | FromDiscord | <vindaar> because `Natural` is not an explicit type. It's just a "type class". Those are meant to restrict generic procedure types, not serve as types of variables |
23:43:18 | FromDiscord | <Sun「無用」> what... |
23:43:23 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46M9 |
23:43:28 | FromDiscord | <Sun「無用」> can you translate that to english... |
23:44:39 | FromDiscord | <voidwalker> I simplified the code a bit. Can anyone check the results ? I am using `nimble install weave@#master` |
23:45:50 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=46Ma |
23:47:08 | FromDiscord | <voidwalker> Very nice english translation |
23:47:35 | FromDiscord | <Sun「無用」> sent a code paste, see https://play.nim-lang.org/#ix=46Mb |
23:49:03 | FromDiscord | <Sun「無用」> also `let num: Natural = 2` works |
23:49:51 | FromDiscord | <Rika> It’s a bit difficult to explain why it doesn’t work, but I think it can basically be boiled down to “it’s a limitation of the type inferenc” |
23:49:55 | FromDiscord | <Rika> (edit) "inferenc”" => "inference”" |
23:50:39 | FromDiscord | <Sun「無用」> So how would I create a Natural tuple? |
23:51:10 | FromDiscord | <Sun「無用」> Cause doing `if v < 0: return` is kinda boring and dumb |
23:52:25 | FromDiscord | <Rika> I think you can convert each field |
23:52:38 | FromDiscord | <Sun「無用」> wdym? |
23:52:42 | FromDiscord | <Rika> (1.Natural, 2.Natural) |
23:53:39 | FromDiscord | <Hi02Hi> isnt Natural a range, not a typeclass? |
23:53:40 | FromDiscord | <Sun「無用」> can't I do something like rust and just convert the first one? |
23:53:47 | FromDiscord | <Elegantbeef> Natural is a range |
23:53:48 | FromDiscord | <Rika> In reply to @Sun「無用」 "can't I do something": Not on tuples |
23:54:00 | FromDiscord | <Sun「無用」> ... |
23:54:13 | FromDiscord | <Rika> Tuples can hold different types so not there |
23:54:15 | FromDiscord | <vindaar> ah, I'm paying attention very well 🙈 thanks for the correction |
23:54:16 | FromDiscord | <Rika> You can for arrays |
23:54:33 | FromDiscord | <Elegantbeef> Though to be fair it also behaves like a typeclass 😄 |
23:54:49 | FromDiscord | <vindaar> yeah, I was just making assumption without thinking 🤣↵(@Hi02Hi) |
23:57:10 | FromDiscord | <Sun「無用」> In reply to @vindaar "yeah, I was just": I don't know neither of those, and I didn't understand it, so it doesn't matter anyways |