<< 17-03-2023 >>

00:00:08FromDiscord<sOkam!> ic
00:00:32FromDiscord<Elegantbeef> You also could've made a proc that returns a string without
00:00:36FromDiscord<Elegantbeef> `\n` btw ๐Ÿ˜„
00:01:21FromDiscord<sOkam!> how?
00:02:04FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r1R
00:02:25FromDiscord<Elegantbeef> I think that should work
00:02:32FromDiscord<sOkam!> strutils has cstring stuff? didn't know that
00:02:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r1S
00:02:51FromDiscord<Elegantbeef> It doesnt have cstring stuff
00:02:57FromDiscord<Elegantbeef> It has string stuff, but you're doing it at compile time
00:03:11FromDiscord<Elegantbeef> So it does not need to be cstring since a compile time string can be converted to cstring without any issue
00:03:11FromDiscord<sOkam!> ah i see
00:10:11*ltriant_ joined #nim
00:10:26arkanoidI'm comparing nim vs rust helloworld binary size. Wow, Nim is so much smaller by default. Basically by default rust statically links its stdlib as binary blob, while nim basically skips that step completely relying only on libc
00:10:49FromDiscord<Elegantbeef> Even smaller with static musl!
00:11:29arkanoidI don't understand, why using static musl would be even smaller that default dynamic link to libc?
00:11:45FromDiscord<Elegantbeef> Dynamic linking is a lot of code
00:12:05FromDiscord<Elegantbeef> You can remove a lot of the linked code you do not actually need
00:12:19*ltriant quit (Ping timeout: 265 seconds)
00:12:31arkanoidreally? Didn't know that. Is musl so small that it can compare to the overhead introduced by dynamic linking?
00:12:50FromDiscord<Elegantbeef> Well static linking only includes used symbols
00:13:02FromDiscord<Elegantbeef> Whereas dynamic linking has the mechanisms for loading in those symbols
00:13:15*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
00:14:01arkanoidok, so it depends on the amount of symbols (and their size) I'm actually using from musl
00:14:36FromDiscord<Elegantbeef> Also whether your dependencies depend on libc
00:16:01*Lord_Nightmare joined #nim
00:16:50NimEventerNew thread by tmsa04: /usr/lib/nim/lib/system.nim, see https://forum.nim-lang.org/t/10012
00:17:38arkanoidbtw, if statically linking actually imports only the used symbols and not the whole blob, I can't understand why rust is creating such large binaries. With this cargo.toml https://termbin.com/zhzx the resulting rust hello world binary is ~277KB, the helloword in Nim with hopefully equivalent options (https://termbin.com/jk2c) is ~15KB
00:17:48FromDiscord<Elegantbeef> To be clear though rust also has musl support
00:18:14FromDiscord<Elegantbeef> Rust has it's own 'runtime' it brings around Nim uses C's
00:20:44arkanoidsurprisingly, statically linking musl creates a larger binary than dynamic linking
00:21:03FromDiscord<Elegantbeef> I might have been misremembering ๐Ÿ˜„
00:21:04arkanoidusing https://termbin.com/q2kk
00:21:24arkanoid26KB vs 15KB
00:21:32FromDiscord<Elegantbeef> Not using a config.nims that's a paddlin ๐Ÿ˜›
00:22:13arkanoidyeah it started as a command line, then echoed into a sh, just being lazy
00:24:34FromDiscord<Elegantbeef> https://hookrace.net/blog/nim-binary-size/ yea following this gets a very small hello world ๐Ÿ˜„
00:24:37FromDiscord<Elegantbeef> But it's all inane
00:25:20arkanoidElegantbeef, yeah I'm reading that, but I'm interested in how to make it small without hacking too much
00:26:02arkanoidit's a subjective test
00:27:28arkanoidbut the subjective result is that rust helloword is 10 to 15 times bigger than nim
00:28:47FromDiscord<Elegantbeef> Though how big is nim if you include libc ๐Ÿ˜›
00:29:32arkanoidElegantbeef, no, rust helloword binary loads libc dynamically (according to ldd)
00:29:44arkanoidas nim does
00:30:28arkanoid(when not statically linking musl)
00:31:18FromDiscord<Elegantbeef> Anywho i'll take Twains advice and stop making myself look like a fool
00:31:34arkanoid?
00:32:38FromDiscord<Elegantbeef> Shit that's not twain
00:33:06FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r1V
00:33:21*derpydoo joined #nim
00:33:34FromDiscord<Elegantbeef> It's the "Better to be though a fool, than open your mouth and prove it" quote i was referencing
00:33:34FromDiscord<Elegantbeef> `static int`
00:33:51FromDiscord<sOkam!> but im passing a uint
00:34:01FromDiscord<Elegantbeef> Cool, now use an int
00:34:20FromDiscord<sOkam!> `types.nim(16, 16) Error: cannot generate code for: N`
00:34:25arkanoidElegantbeef, ah! That Twains!
00:34:37FromDiscord<Elegantbeef> Why doth though hurt me
00:34:46FromDiscord<Elegantbeef> thou...
00:35:04FromDiscord<sOkam!> are you sure that is the issue? because i have tried 5 different combinations so far and i got some int/uint errors, but they don't show up anymore. and this new one does
00:35:13FromDiscord<Elegantbeef> Yes i'm sure
00:35:18FromDiscord<Elegantbeef> How are you instantiating this type?
00:35:28FromDiscord<sOkam!> wdym instantiating?
00:35:35FromDiscord<Elegantbeef> It's a generic
00:35:43FromDiscord<Elegantbeef> How are you using it
00:35:58FromDiscord<mprakhov> As I understood, NIM has something like shared_ptr for objects. Is it possible to understand if someone pointing to my object? (or get counter info)
00:36:19FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r1W
00:36:54FromDiscord<sOkam!> i was trying without the instancing, because all I need is the size to be calculated when its initialized, but i couldn't manage to work it out, so im passing this instead
00:37:01FromDiscord<Elegantbeef> Stop using it as a static typeclass
00:37:12FromDiscord<sOkam!> W and H are uints, so having to pass int is gonna be a big pain
00:37:20FromDiscord<sOkam!> wdym static typeclass?
00:37:28FromDiscord<Elegantbeef> `var scr = Screen[W H](255'u32)`
00:37:28FromDiscord<Elegantbeef> I mean you can use a uint
00:37:41FromDiscord<sOkam!> I just want a fixed-sized array inside an object, that's all
00:37:45FromDiscord<Elegantbeef> A generic without a parameter is a generic typeclass
00:37:53FromDiscord<sOkam!> W and H need to be stored inside
00:37:56FromDiscord<Elegantbeef> `Screen` is a generic typeclass
00:38:42*deadmarshal_ joined #nim
00:38:50FromDiscord<sOkam!> how do you initialize it then, and how do you declare the size of the array?
00:40:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r1X
00:40:52FromDiscord<Elegantbeef> Or if you want to be even cooler
00:41:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r1Y
00:41:18arkanoidElegantbeef, statically linking musl makes helloworld larger that dynamically linking libc on rust, too
00:41:31FromDiscord<sOkam!> i was trying the WH at first, but it was crashing, so i stopped
00:41:51FromDiscord<Elegantbeef> Then you could do `proc init[W, H](_: typedesc[Screen[W, H]], val: uint32): Screen[W, H] = ...`
00:42:18FromDiscord<sOkam!> how do you store the w and h inside if you dont pass them?
00:42:29FromDiscord<sOkam!> they are meant to be passed for other contents
00:42:34FromDiscord<Elegantbeef> They're generic parameters that are bound ot the type
00:42:38FromDiscord<Elegantbeef> So you store them on the type
00:42:48FromDiscord<sOkam!> there is a subtype that needs them
00:42:58FromDiscord<sOkam!> how do i pass them from the generic bounds?
00:43:04FromDiscord<Elegantbeef> `.W`
00:43:11FromDiscord<sOkam!> oh, its a field?
00:43:17FromDiscord<sOkam!> didn't know that
00:43:22FromDiscord<Elegantbeef> Generic parameters can be accessed as a field
00:43:28FromDiscord<sOkam!> i had no clue
00:44:19FromDiscord<Elegantbeef> Works just fine
00:44:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r1Z
00:46:13FromDiscord<Elegantbeef> It's also much nicer cause it shows the type you're instantiating without `: MyType` and a sane init name
00:46:24FromDiscord<Elegantbeef> Fuck do i hate the `newSeq` and friends
00:47:12FromDiscord<Elegantbeef> `seq[int].new(len)` or `seq[int].newOfCap(len)` is just better minus the minor issue that they're generic procedures, but that could be changed easily
00:52:09FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r21
00:52:54FromDiscord<Elegantbeef> You really do not listen do you
00:52:54FromDiscord<Elegantbeef> The parameter of an array needs to be an integer or a small ordinal
00:53:21FromDiscord<Elegantbeef> Wait nevermind i'm dumb
00:53:26FromDiscord<Elegantbeef> I'm thinking of when it's a type
00:53:38FromDiscord<sOkam!> i had them before with uint working
00:53:42FromDiscord<Elegantbeef> Stop doing `: Screen` on top of it
00:53:51FromDiscord<sOkam!> oh
00:53:52FromDiscord<sOkam!> tru
00:54:08FromDiscord<Elegantbeef> `Screen` is a generic typeclass and it does not work properly without a fix(hopefully coming soon to devel near you)
00:54:08FromDiscord<sOkam!> nvm, same err
00:54:35FromDiscord<Elegantbeef> You do not need `result = ....`
00:55:05FromDiscord<Elegantbeef> What other error does the compiler say
00:55:11FromDiscord<sOkam!> ok. but it crashes in the same spot
00:55:19FromDiscord<sOkam!> that only. its stuck in that
00:55:28FromDiscord<Elegantbeef> `4 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them`
00:56:15FromDiscord<Elegantbeef> Also i swear you use `new` like this just to drive a metaphorical spike into my brain
00:56:51FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r25
00:57:07FromDiscord<Elegantbeef> `512u64, 512u64`
00:57:41FromDiscord<sOkam!> In reply to @Elegantbeef "*Also i swear you": oh sry, i just use "init" to mean other things, and initializing types doesn't make sense compared to those
00:58:25*rmnmjw quit (Read error: Connection reset by peer)
01:00:21FromDiscord<Elegantbeef> Sorry `uint 512, uint 512`
01:00:24FromDiscord<Elegantbeef> That'll solve that
01:00:29FromDiscord<sOkam!> i think that was it
01:00:30FromDiscord<Elegantbeef> But this is why we do not use `uint` there
01:00:55FromDiscord<Elegantbeef> Think ringabout has a PR to resolve this somewhere
01:02:07FromDiscord<sOkam!> yey, that was it. it passed the errors ๐Ÿฅณ
01:09:51arkanoidcompiling helloword with statically linked musl with both nim and rust+build-std (that makes rust compile std) results in Rust 51.3KB vs Nim 26K, not bad
01:11:58arkanoidI'm quite surprised by this result. Nim approach seems so much better for generating small binaries than rust
01:15:07FromDiscord<etra> are both in release mode? otherwise the comparison is kinda useless bc iirc rust includes a lot of debug info
01:18:18arkanoidetra, sure, check the build conf for both. Rust: https://termbin.com/v5cla + https://termbin.com/w7kf . Nim: https://termbin.com/pgvw
01:24:46arkanoidnim devel produces binaries 72 bytes larger than stable
01:27:09FromDiscord<Elegantbeef> Marty we have to go back!
01:40:54arkanoidhaha
01:41:20arkanoidbtw, I've summarized my experiment bringing back a 3 years old thread on the forum https://forum.nim-lang.org/t/5914#65993
01:43:26FromDiscord<etra> In reply to @arkanoid "<@329819426000076801>, sure, check the": oh nice!
01:43:53FromDiscord<etra> yesterday I did some experimentation with rust + zig cc for cross compilation using musl, it went pretty nice.
01:44:11FromDiscord<etra> I compiled from Aarch64 to armv6
01:44:18FromDiscord<etra> I'm yet to try that in Nim (and Crystal)
01:48:19FromDiscord<Elegantbeef> Now now just compiling to windows is hard enough on crystal
01:52:44arkanoidwhat is crystal?
01:53:08FromDiscord<Elegantbeef> A system language not too dissimilar to Ruby
01:53:28FromDiscord<Elegantbeef> It's to Ruby what Nim is to Python afaik
01:54:07arkanoidnever heard of. Most impressive feature?
01:54:32arkanoidag: Rust=no gc, Nim=metaprogramming, ...
01:54:34FromDiscord<Elegantbeef> It doesnt run on windows even though has had a 1.0 release iirc
01:54:39arkanoidahahaha
01:55:08FromDiscord<Elegantbeef> It's got a lot of language design flaws imo
01:55:24FromDiscord<Elegantbeef> Uses `new` for initialising structs and objects
01:56:42arkanoidI'm reading some crystal code right now ... pretty ugly
01:56:54FromDiscord<Elegantbeef> Just like ruby
01:57:28arkanoidexactly, exacly
01:57:43FromDiscord<Elegantbeef> It also pushes for OOP
01:57:54FromDiscord<Elegantbeef> Not nearly as bad as julia with it's multiple dispatch but nothing is that bad
01:58:34arkanoidevery time I heard the world "ruby", this old classic pops into my mind. Always fun https://www.destroyallsoftware.com/talks/wat
02:08:58arkanoidnever tried julia, but I do lots of python for science, and julia seemed like the natural evolution. Then I've found nimpy and Nim, and I've skipped julia completely
02:13:53arkanoidI recently did python > nim > gpgpu (webgl compute shader) > nim > python and it worked nice
02:16:16FromDiscord<etra> In reply to @Elegantbeef "It also pushes for": the only thing I cannot be totally convinced about nim is that I don't like how the style of 'encapsulation', I don't know the proper terms (language barriers are fun!) but ugh, there's something about how library works that I'm just not that happy
02:16:31FromDiscord<etra> (edit) removed "how"
02:17:13FromDiscord<etra> I believe Rust's traits are better than oop, but I'm yet to be comfortable with nim in that when it comes to design. It may be just because of my inexperience too
02:17:18arkanoidetra, you mean information hiding? how import/export work?
02:17:30FromDiscord<Elegantbeef> Generics + concepts + modules = eternal bliss
02:17:50FromDiscord<Elegantbeef> Rust traits and Nim generics are practically the same if you use concepts
02:18:04FromDiscord<etra> yeah I honestly liked what I saw with concepts when you mentioned it
02:18:09FromDiscord<etra> In reply to @arkanoid "<@329819426000076801>, you mean information": yes
02:19:12arkanoidetra, I kinda feel what you mean, but I blame nim tooling for that
02:19:16FromDiscord<Elegantbeef> I use concepts whenever I can, cause i'm weird like that ๐Ÿ˜„
02:20:02arkanoidmodules are nice, but the current state of nim tooling is not helping making them as comfortable as they should
02:20:54FromDiscord<etra> In reply to @Elegantbeef "I use concepts whenever": I mean, if you're mostly designing the stuff, Nim is nice, you can do pretty looking code, but the few times I had to use some third party, it's when I felt nim's library design doesn't fit with my head
02:21:04FromDiscord<etra> (edit) "do" => "write"
02:22:12arkanoidthings I don't like in nim: tooling, lack of circular dependencies support, lack of c++ wrapping tools
02:25:54arkanoidwhat stress me the most about tooling, is that is extra difficult to find out why it is not working as intended, and I always fail to isolate the problem. I go from computer freezing from excessive ram use from nimsuggest, to nim check hanging, to ide services hanging from time to time or randomly not working.
02:37:09onetwo3how do i convert an int64 to an int and vice versa
02:54:06NimEventerNew thread by xioren: I asked chat-gpt to write a fft function in Nim, see https://forum.nim-lang.org/t/10013
03:09:57FromDiscord<Iliketwertles> the (tri?)ality of mankind https://media.discordapp.net/attachments/371759389889003532/1086124234071355442/screenshot_2023-03-16-230522.png
04:42:42NimEventerNew thread by Naterlarsen: How to Save Directory Listing into Variable., see https://forum.nim-lang.org/t/10014
04:49:21FromDiscord<Yardanico> @onetwo3 if you still need help - you just "call" types to do type conversions, e.g. `int64(a)` if a is `int` will give you a 64-bit int version of a
04:49:28onetwo3oh
04:49:29onetwo3thanks
04:49:42FromDiscord<Yardanico> but be careful when converting to smaller types, it can lead to errors, so you should check the range if you're converting to a smaller type
04:50:00FromDiscord<Yardanico> !eval let a = 1235912912'i64; echo int16(a)
04:50:07NimBot/usercode/in.nim(1) inโ†ต/playground/nim/lib/system/fatal.nim(54) sysFatalโ†ตError: unhandled exception: value out of range: 1235912912 notin -32768 .. 32767 [RangeDefect]
04:50:39FromDiscord<Yardanico> and yeah, 'i64 is just shorthand suffix syntax to specify the type for number types
04:51:01FromDiscord<Yardanico> it's in https://nim-lang.org/docs/manual.html#lexical-analysis-numeric-literals (scroll it a bit or search for "The pre-defined type suffixes are")
04:59:43*xet7 quit (Remote host closed the connection)
05:00:43*xet7 joined #nim
05:15:22*rockcavera quit (Remote host closed the connection)
05:21:04FromDiscord<Gumbercules> In reply to @etra "I mean, if you're": is the objective really to write pretty looking code?
05:21:52FromDiscord<Gumbercules> and I'm curious what library design you're referring to, like nimble packages?
05:23:45*ltriant joined #nim
05:24:06FromDiscord<Gumbercules> ah I see the conversation above - nevermind
05:25:06FromDiscord<Gumbercules> I still don't understand the pretty looking code comment - that in my experience is never the goal of the code I write - to make it look pretty
05:26:31*ltriant_ quit (Ping timeout: 276 seconds)
05:37:32*arkurious quit (Quit: Leaving)
06:00:18FromDiscord<etra> In reply to @Gumbercules "I still don't understand": To me the fun factor is also relevant, otherwise I'd just stick with the classics since they kinda already do the job. And that includes pretty looking code
06:01:47FromDiscord<Gumbercules> Well of course, but that fun doesn't have much to do with pretty looking code. People have fun writing brainfuck
06:06:11FromDiscord<Gumbercules> I'm also not trying to convince you to use Nim ๐Ÿ™‚ I was just curious. It sounds like you like Rust and are enjoying it, so it sounds like you've found a decent fit.
06:11:19NimEventerNew thread by Naterlarsen: Sending Directory Listing over Sockets Help., see https://forum.nim-lang.org/t/10015
06:13:21*jerm joined #nim
06:13:53*jerm left #nim (#nim)
06:26:28FromDiscord<Yardanico> is that person writing a remote shell :P
06:28:41FromDiscord<ShalokShalom> In reply to @arkanoid "I recently did python": Python has Codon, that also works performant and on GPUs
06:55:26FromDiscord<qb> https://media.discordapp.net/attachments/371759389889003532/1086180978801782834/image.png
06:55:29FromDiscord<qb> chatgpt. Is that true? ๐Ÿ˜„
06:55:45FromDiscord<Elegantbeef> Of course not
06:56:02FromDiscord<qb> Damnit KI!
06:56:15FromDiscord<Elegantbeef> `uint` is a `uintptr`
06:56:16FromDiscord<qb> (edit) "KI!" => "AI!"
06:56:34FromDiscord<Elegantbeef> Or atleast equivlent to it
06:56:49FromDiscord<Yardanico> In reply to @qb "Damnit AI!": https://forum.nim-lang.org/t/10013#65998 about nim in gpt
06:57:10FromDiscord<Yardanico> tldr: don't really try to use it for anything more complex than a hello world with nim, only bing chat might somewhat work because it has access to the web search results
06:57:34FromDiscord<Yardanico> or you can use it with chatgpt api if you make code that would fetch search results and feed it into the context
06:59:02FromDiscord<Elegantbeef> Maybe one day i'll actually use a AI service
07:00:58FromDiscord<Elegantbeef> I toyed with the supposed AI of neeva, but all it does it seems is copy and paste text from news articles then inaccurately attribute them
07:01:15FromDiscord<qb> Im a slave of technology. Even if the provided code is not usable. The direction it gives are very helpful
07:03:29FromDiscord<Elegantbeef> I'm obviously biased, but it does seem many people are using it as a tool to not have to walk through problems
07:03:50FromDiscord<Elegantbeef> Using it as a learning aid is an awful idea imo, ymmv
07:17:53*junaid_ joined #nim
07:19:28*Nick62 joined #nim
07:23:51*junaid_ quit (Quit: leaving)
07:29:54*PMunch joined #nim
07:37:48*Nick62 quit (Quit: Client closed)
07:38:14*nanxiao32 joined #nim
07:41:22*nanxiao32 quit (Client Quit)
07:41:52*nanxiao96 joined #nim
07:43:41*nanxiao96 quit (Client Quit)
07:57:03FromDiscord<Gumbercules> In reply to @ShalokShalom "Python has Codon, that": it also doesn't support all of Python's mdules
07:57:06FromDiscord<Gumbercules> (edit) "mdules" => "modules"
07:57:54*junaid_ joined #nim
07:59:28*rmt joined #nim
08:03:05FromDiscord<planetis> how do you fix cross compiling for windows on linux and all paths are replaced with back slashes, like: \home\ which errors?
08:07:03*junaid_ quit (Remote host closed the connection)
08:09:11FromDiscord<ShalokShalom> In reply to @Gumbercules "it also doesn't support": You cant have everything ๐Ÿคท๐Ÿผโ€โ™‚๏ธ ๐Ÿ˜„
08:09:18FromDiscord<ShalokShalom> It supports a wide subset
08:09:41FromDiscord<ShalokShalom> You can at least refer to it from regular Python code
08:12:32FromDiscord<sOkam!> lets say I have `start = 0.0, incr = 0.1, limit = 1.0`โ†ตhow is a float for loop made with them? Do I need to use a `while` instead?
08:13:38FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "Maybe one day i'll": Llama is interesting if you want to check it out and can get its datasets
08:13:48FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "Using it as a": Yeah agreed there
08:14:53FromDiscord<ieltan> It seems like using anonymous procs inside async procs result in hard-to-debug "yield only allowed inside iterators" compile error
08:15:05FromDiscord<ieltan> Or maybe it's the library I'm using?
08:15:31FromDiscord<sOkam!> In reply to @Elegantbeef "Using it as a": early ai tech, early level of teaching (aka introductory and beginner stuff)โ†ตfor beginner level is stupid good, because you cannot spam a person with that many questions to fill your knowledge gaps
08:16:04FromDiscord<sOkam!> i say wait until the models are better, they will be able to teach more advanced stuff more accurately
08:16:26FromDiscord<ieltan> I have a ton of them, I may need to annotate with the async pragma, yield the result and test for failure?
08:16:29FromDiscord<ieltan> Sheesh
08:19:49FromDiscord<Gumbercules> It's interesting how everyone is conflating AI for LLMs
08:20:01FromDiscord<Gumbercules> remember several years ago when deepmind came out an CNNs were AI?
08:20:03FromDiscord<Yardanico> In reply to @sOkam! "lets say I have": to be safe you probably should check with some epsilon
08:20:16FromDiscord<Yardanico> In reply to @Gumbercules "remember several years ago": I mean, most people refer to what you refer as AI as AGI
08:20:22FromDiscord<Gumbercules> and before that when some other advent in deep / machine learning was referred to as AI
08:20:26FromDiscord<Yardanico> I agree that it's a buzzwordy way of defining it, but it's accepted by most
08:20:36FromDiscord<ieltan> In reply to @Elegantbeef "I'm obviously biased, but": Atm using AI to automatise problem solving isn't the best, you still need a human because ai isn't as thorough as you would be
08:20:42FromDiscord<Gumbercules> Yeah but it can mean literally anything related to ML / DL
08:20:45FromDiscord<Yardanico> yes
08:20:51FromDiscord<Yardanico> ML = AI nowdays basically
08:20:56FromDiscord<Yardanico> (edit) "nowdays" => "nowadays"
08:21:07FromDiscord<Yardanico> even the professionals call it that to keep up with the trends :P
08:21:17FromDiscord<Gumbercules> it's slightly annoying because when I think of AI I don't think of a large language model or a markov chain
08:21:23FromDiscord<Yardanico> although that's more for #offtopic
08:21:23FromDiscord<Gumbercules> or some other generative algorithm
08:21:25FromDiscord<sOkam!> In reply to @Yardanico "to be safe you": sure, lets add the 4th value. now.. how do you do that?
08:21:26FromDiscord<ieltan> In reply to @Elegantbeef "Using it as a": It's kind of exciting. Have you read about SCP-5094?
08:22:33FromDiscord<Gumbercules> Not excited to have my kid taught by AI
08:22:35FromDiscord<Gumbercules> thanks though
08:23:12FromDiscord<Elegantbeef> Who cares if their kid is taught by AI, it's not going to be interested in learning from AI
08:23:16FromDiscord<ieltan> It's probably never gonna be a reality that AI will manage to make kids love learning but y
08:23:26FromDiscord<Elegantbeef> Maybe i'm just too much of a humanist
08:23:41FromDiscord<Yardanico> In reply to @sOkam! "sure, lets add the": mm, actually I'm not sure
08:23:53FromDiscord<Gumbercules> I would care if someone tried to have AI teach my kid
08:23:55FromDiscord<ieltan> I try to see the good and the useful in everything
08:23:55FromDiscord<Yardanico> with floating point inaccuracy start < limit might not give you the desired amount of iterations
08:24:03FromDiscord<Yardanico> maybe beef knows
08:24:06FromDiscord<Yardanico> he's smart
08:24:08FromDiscord<Gumbercules> just like I would have issue with just any teacher teaching my kid
08:24:35FromDiscord<ieltan> In reply to @Gumbercules "just like I would": :p
08:24:49*Notxor joined #nim
08:25:37FromDiscord<ieltan> A few years ago I would hear things like "I would be very concerned if my computer was running AI generated code, just a disaster waiting to happen"
08:25:47FromDiscord<ieltan> Look where we are now
08:26:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r3A
08:26:03FromDiscord<Elegantbeef> That's the most sane variation imo
08:26:04FromDiscord<Gumbercules> My computer still isn't running AI generated code - but that's not the issue
08:26:20FromDiscord<Yardanico> beef, would that always ensure that the iteration count is the same? i fear the rounding issues
08:26:29FromDiscord<Yardanico> actually, maybe just use decimal for this
08:26:40FromDiscord<Elegantbeef> I mean if you want 10 iterations use an it
08:26:45FromDiscord<Gumbercules> anywho - as yard said, #offtopic would be a better place for this convo
08:27:02FromDiscord<Elegantbeef> an int\
08:27:07FromDiscord<Yardanico> :)
08:27:13FromDiscord<ieltan> Yeah my point was that perspective is bound to change after a while, AI will probably be as disruptive as the Internet was so I try to be a little optimistic about it
08:27:22FromDiscord<ieltan> But it's not all roses and flowers for sure
08:27:37FromDiscord<Elegantbeef> Also speaking of floats, yardanico you have defects in aciigraph! ๐Ÿ˜›
08:27:55FromDiscord<Yardanico> i know but how come everyone talks about it but no one fixes it
08:28:05FromDiscord<Yardanico> ~open-source~
08:28:17FromDiscord<Yardanico> anyway lets see if I can fix it, should be easy
08:28:30FromDiscord<Elegantbeef> Well i'd fix it if I didnt feel like someone that spent quite some time on a forum post should
08:28:35FromDiscord<Yardanico> lol
08:29:04FromDiscord<planetis> to fix other's libs is not an option of course ๐Ÿ™‚ ""
08:29:13FromDiscord<planetis> (edit) removed """"
08:29:44FromDiscord<planetis> can't make a quote in discord it seems
08:29:45FromDiscord<Elegantbeef> Yea that got me
08:29:59FromDiscord<Yardanico> you can
08:29:59FromDiscord<Elegantbeef> Excuse me whilst i remove any contribution to any project I dont own
08:30:01FromDiscord<Yardanico> > hello
08:30:02FromDiscord<Elegantbeef> It's a `> your message here`
08:30:06FromDiscord<Elegantbeef> > Planetis is a dork
08:30:47FromDiscord<Yardanico> ah its `inc precision, int(abs(logMaximum) - 1.0)`
08:31:20FromDiscord<Yardanico> should i just special-case and return early ๐Ÿค”
08:32:04FromDiscord<Elegantbeef> Is this the collection of 0s or something else?
08:32:21FromDiscord<planetis> In reply to @Elegantbeef "It's a `> your": oh I confused it with rst
08:32:24FromDiscord<planetis> thanks
08:32:25FromDiscord<Yardanico> yeah I think it only happens if all values are 0s
08:32:29FromDiscord<Yardanico> niche usecase
08:32:45FromDiscord<Elegantbeef> Pointless use case
08:33:03FromDiscord<Elegantbeef> What's the point if all values are the same anyway "Oh nice it's a straight line" ๐Ÿ˜›
08:33:24FromDiscord<Yardanico> yeah inv just said it's either all 0s or if you pass an empty seq
08:33:49FromDiscord<Elegantbeef> I wonder if there are other defects they didnt report
08:34:02FromDiscord<Yardanico> I just asked him in the telegram chat
08:34:07FromDiscord<Yardanico> only those two
08:34:26FromDiscord<Elegantbeef> Oh they're one of them
08:34:50FromDiscord<Yardanico> ๐Ÿ˜ฑ who?!
08:35:26FromDiscord<Elegantbeef> Those telegram users
08:35:55FromDiscord<Elegantbeef> Somewhat related, but i'm glad i'm not the only one that didnt have tags for my repos
08:36:16FromDiscord<Yardanico> i do have tags for some of my repos
08:36:38FromDiscord<Elegantbeef> Yea i had none for any cause i thought that was the point of the version file in Nimble
08:36:44FromDiscord<Yardanico> ahh you mean nimble
08:36:44FromDiscord<Elegantbeef> Lo and behold i was mistaken
08:36:48FromDiscord<Yardanico> i thought you meant github tags
08:36:57FromDiscord<Elegantbeef> I mean git tags yea
08:38:20FromDiscord<Hourglass [She/Her]> In reply to @ieltan "It's probably never gonna": Honestly the issue is more that education isn't fun and that makes kids not want to learn it
08:39:00arkanoidShalokShalom: sure I know python has everything you can think of. The point here is moving tasks to Nim
08:39:38FromDiscord<Elegantbeef> Don't worry yardanico, elcritch also doesnt have tagged releases of his libraries
08:40:05FromDiscord<Yardanico> tagged releases are for the weak
08:40:48FromDiscord<Elegantbeef> I mean it's usable semver with nimble so I really wanted them when I learned they were needed ๐Ÿ˜›
08:41:06FromDiscord<Elegantbeef> So now I have a have look at some libraries to see who's missing them
08:41:55*junaid_ joined #nim
08:43:08FromDiscord<ShalokShalom> In reply to @arkanoid "<@208199869301522432>: sure I know": Ah, I see.
08:51:33FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4r3F
08:51:40FromDiscord<ieltan> i'd like it if it could also be async
08:52:35FromDiscord<ieltan> since `someRole` is inside an async proc i suspect it is what prevents me from compiling because it's not async
08:52:43*PMunch hides under a rock so ElegantBeef won't see my repos missing tags
08:52:56FromDiscord<Elegantbeef> Lol
08:52:59PMunchWait, do you see those on Discord?
08:53:03PMunchAh I guess you do :P
08:53:14FromDiscord<Elegantbeef> `graffiti ./myRepo.nimble` it's only a command away!
08:53:49PMunchAww, they just come through as normal messages
08:53:50PMunchBoring
08:54:02PMunchThey should at least append your name..
08:54:06FromDiscord<Elegantbeef> Though i made that specifically for my own religious ticking of the nimble file after every change
08:54:15FromDiscord<Elegantbeef> Matrix supports those, but i do not recall the syntax
08:54:39FromDiscord<Yardanico> In reply to @ieltan "Is there syntax sugar": you don't need a proc here though, do you
08:54:51FromDiscord<Yardanico> you can just use toSeq + filterIt
08:55:16FromDiscord<Yardanico> let someRole = toSeq(s.cache.guilds[guildId].roles).filterIt(it.name == someRoleName)[0]
08:55:19FromDiscord<Yardanico> something like this should work
08:55:26FromDiscord<Yardanico> `import std/sequtils` of course
08:56:32FromDiscord<ieltan> In reply to @Yardanico "you don't need a": Really ?
08:56:34FromDiscord<Yardanico> yes?
08:56:39FromDiscord<ieltan> In reply to @Yardanico "let someRole = toSeq(s.cache.guilds[guildId].roles)": oh lol
08:56:49FromDiscord<ieltan> I always forget i can just do this
08:56:49FromDiscord<Yardanico> actually what type is .roles
08:56:53FromDiscord<Yardanico> if it's a seq you don't even need toSeq
08:56:54FromDiscord<Elegantbeef> The only case you'd need a proc is if you wanted to thunk it
08:57:00FromDiscord<Yardanico> let someRole = s.cache.guilds[guildId].roles.filterIt(it.name == someRoleName)[0]
08:57:26FromDiscord<ieltan> `roles` is of type `Table[string, Role]`
08:57:39FromDiscord<Yardanico> oh
08:57:50FromDiscord<Yardanico> wait but you don't need the key anyway
08:57:52FromDiscord<ieltan> yeah i forgot for a sec
08:57:59FromDiscord<Yardanico> let someRole = toSeq(s.cache.guilds[guildId].roles.keys).filterIt(it.name == someRoleName)[0]
08:58:01FromDiscord<ieltan> In reply to @Yardanico "wait but you don't": nope
08:58:05FromDiscord<Yardanico> sorry values
08:58:08FromDiscord<ieltan> just the role object
08:58:20FromDiscord<Yardanico> let someRole = toSeq(s.cache.guilds[guildId].roles.values).filterIt(it.name == someRoleName)[0]
08:58:22FromDiscord<ieltan> In reply to @Yardanico "sorry values": the value is the role object that i need to use somewhere
08:58:25FromDiscord<Yardanico> should be final and work
08:58:42FromDiscord<ieltan> In reply to @Yardanico "let someRole = toSeq(s.cache.guilds[guildId].roles.": alright lemme try this
08:58:43FromDiscord<ieltan> thanks
08:58:59FromDiscord<Elegantbeef> Yardanico is trying to kill me with the most amount of allocations on a single line ๐Ÿ˜›
08:59:16FromDiscord<Yardanico> shhh
08:59:34FromDiscord<Yardanico> you think collect is better here?
08:59:38FromDiscord<Yardanico> i mean from allocations it will be
09:00:39FromDiscord<Elegantbeef> Yea it'd remove the one sequence
09:01:39*junaid_ quit (Remote host closed the connection)
09:01:45FromDiscord<ieltan> seems like that does the trick
09:02:02FromDiscord<ieltan> but i'll need to do that across my messe pile of steaming code
09:02:02FromDiscord<Elegantbeef> need a `findIt`
09:02:05FromDiscord<Yardanico> yeah
09:02:06FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4r3L
09:02:07FromDiscord<ieltan> (edit) "messe" => "messy"
09:02:26FromDiscord<Yardanico> In reply to @ieltan "but i'll need to": abstract it away into a proc/template?
09:02:37FromDiscord<ieltan> In reply to @Elegantbeef "Yardanico is trying to": is the anonymous proc better in this aspect ?
09:02:38FromDiscord<Yardanico> also maybe the discord api has a better way of doing what you need it to do
09:02:47FromDiscord<Elegantbeef> No the anonymous proc is just a thunk
09:02:53FromDiscord<Yardanico> the code I sent should be good beef?
09:02:54FromDiscord<Elegantbeef> It only delays the allocations
09:03:01FromDiscord<ieltan> alright then
09:03:09FromDiscord<Yardanico> well of course the best would be
09:03:14FromDiscord<Elegantbeef> Since when was i the arbiter of good code
09:04:20FromDiscord<Yardanico> only tables
09:04:26FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4r3M
09:04:31FromDiscord<Yardanico> can you replace x.B with something that doesn't depend on the impl?
09:05:13FromDiscord<Elegantbeef> `x.items`
09:05:18FromDiscord<Yardanico> ahh right
09:05:22FromDiscord<Yardanico> iterators have the type of a single value
09:05:29FromDiscord<Yardanico> that nim language is interesting i must say
09:05:45FromDiscord<Yardanico> sent a code paste, see https://paste.rs/lWg
09:05:56FromDiscord<Elegantbeef> That's still tables specific ๐Ÿ˜„
09:06:08FromDiscord<ieltan> In reply to @Yardanico "also maybe the discord": Not to my knowledge, since i want to get a specific Role without having its ID ahead of time, i need to get a list of Role and find the one i want, no way around that. dimscord has a `getGuildRoles` the "find the relevant" role part is still up to the programmer
09:06:51FromDiscord<ieltan> (edit) "In reply to @Yardanico "also maybe the discord": Not to my knowledge, since i want to get a specific Role without having its ID ahead of time, i need to get a list of Role and find the one i want, no way around that. dimscord has a `getGuildRoles` ... the" added "but"
09:07:48FromDiscord<ieltan> In reply to @Yardanico "abstract it away into": I can do that later when my code works :p
09:08:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r3N
09:08:32FromDiscord<ieltan> I have already done a tonne of dedup/code reuse, it's about time the damn thing compiles already
09:08:47FromDiscord<Yardanico> damn beef with 1 space indent
09:08:56FromDiscord<Elegantbeef> Whoopsie
09:09:13FromDiscord<Elegantbeef> It's 3am i couldnt tell i was 1 spaced in on the playground
09:09:25FromDiscord<Yardanico> does that code work for tables though
09:09:36FromDiscord<ieltan> I have 4 space indent, it was configured like that when i started nim and i regret not setting it to 2
09:09:39FromDiscord<Elegantbeef> No it doesnt have items so write an items iterator aswell
09:09:44FromDiscord<Yardanico> lol
09:09:50FromDiscord<Elegantbeef> Actually it does work for tables
09:09:53FromDiscord<Yardanico> In reply to @ieltan "I have 4 space": yeah ever since I started using Nim i've been using 2 space indent everywher
09:09:56FromDiscord<Yardanico> (edit) "everywher" => "everywhere"
09:10:09FromDiscord<Elegantbeef> you do `table.values.findIt(it.name == "jinglestuff")`
09:10:35FromDiscord<Elegantbeef> We could do `iter: iterable[T]` but that means you have to do `[10, 20, 30].items`
09:10:47FromDiscord<Yardanico> Error: invalid type: 'typedesc[int]' for var hmm
09:10:51FromDiscord<Elegantbeef> Not that any one would use findit on a literal, but i just mean on array/seq but i didnt type it cause why not
09:11:24FromDiscord<Elegantbeef> Some numpty wrote ` = type`
09:11:39FromDiscord<Yardanico> yeah it works
09:11:46FromDiscord<Yardanico> now PR it to sequtils lol
09:13:31FromDiscord<Elegantbeef> Feel free to it's public domain code!
09:15:34FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4r3Q
09:15:54FromDiscord<Yardanico> uh, collect isn't exactly a cod block, so I don't think the let one will compile, but I might be wrong
09:18:03*jmdaemon quit (Ping timeout: 255 seconds)
09:19:05FromDiscord<ieltan> In reply to @Yardanico "uh, collect isn't exactly": https://nim-lang.org/docs/sugar.html#collect.m%2Cuntyped
09:19:15FromDiscord<Yardanico> not what i meant, lemme check
09:19:45FromDiscord<Yardanico> yeah you're right it works
09:21:31FromDiscord<ieltan> It does works but it yields a sequence
09:22:01FromDiscord<Yardanico> In reply to @ieltan "It does works but": yes I showed you to use [0]
09:22:21FromDiscord<ieltan> I know and i did
09:22:27FromDiscord<ieltan> thansk though
09:22:31FromDiscord<ieltan> (edit) "thansk" => "thanks"
09:28:25PMunchHmm, I'd like to convert a list like the first one here to the tree structure seen below. Any clever ideas? http://ix.io/4r3T/
09:33:57PMunchIs it just me or has Google search for Github stuff gotten worse?
09:34:10PMunchI Googled "Nim fungus elegantbeef" and nothing turns up..
09:34:14FromDiscord<Yardanico> it wasn't perfect to begin with, and now github search itself is getting worse :(
09:39:03PMunch@Elegantbeef, why isn't fungus is Nimble?
09:39:41PMunchAnd by the way, why do I have to specify `tuple` for each branch? Can I do anything else?
09:39:52FromDiscord<Yardanico> well uh @PMunch bing chat did your task
09:39:59FromDiscord<Yardanico> with output like this https://media.discordapp.net/attachments/371759389889003532/1086222390922588251/image.png
09:40:16FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4r3Z
09:41:05PMunchWell that is exactly what I don't want..
09:41:06FromDiscord<Yardanico> doesn't look to be too efficient of course, but it does make an actual hierarchical tree
09:41:24FromDiscord<Yardanico> you mean you want to make it without refs?
09:41:27PMunchI only want the longest common paths
09:41:48PMunchI'm just going to write my own
09:42:17PMunchMy usecase is consuming a JSON file with a certain format and generating a GtkTreeModel anyways, so good luck with that Bing..
09:42:46FromDiscord<Yardanico> haha
09:44:38PMunchOh and @Elegantbeef why does it require Nim >= 1.9.1?
09:45:08FromDiscord<Yardanico> maybe he just nimble init'd and it filled his nim version
09:45:16PMunchThat's what I'm suspecting
09:46:43FromDiscord<Yardanico> haha https://media.discordapp.net/attachments/371759389889003532/1086224082674131034/image.png
09:46:51FromDiscord<Yardanico> certainly nimble init'd :)
09:47:34PMunchHaha :P
09:52:42FromDiscord<planetis> a bit weird beef didn't just go with `Rectangle(x, y, w, h: int)` syntax but maybe there was a good reason?
09:53:47PMunchYeah that's what I'm curious about
09:54:08PMunchMaybe he was just being lazy and didn't care to parse the Nim syntax tree
09:56:32FromDiscord<planetis> sent a code paste, see https://play.nim-lang.org/#ix=4r43
09:56:54PMunchOoh, that would indeed be nice
09:58:52PMunchIt general it would be nice to have more flexibility with macros in type sections
10:26:42*Notxor quit (Quit: Leaving)
11:06:59FromDiscord<jmgomez> In reply to @planetis "it would have been": That and proper working PM is all I would ask for Nim 2.5 lol
11:50:11PMunchPM?
11:54:29PMunch@Yardanico, ended up with something like this: http://ix.io/4r4u/nim
11:54:40FromDiscord<Yardanico> nice
11:55:14FromDiscord<jmgomez> pattern matching
12:04:46FromDiscord<planetis> Absolutely, that `of Value(let x, var y)` synatx would look sweet imo.
12:11:01FromDiscord<planetis> sent a code paste, see https://play.nim-lang.org/#ix=4r4w
12:12:04FromDiscord<planetis> beef please
12:14:58FromDiscord<planetis> but I can't get a macro in an enum typedef...
12:31:04PMunchProblem is you can't return two typedefs..
12:32:46PMunchWould be great if we could return a seq[NimNode] to have them injected into the parent container
13:27:06PMunchHmm, I'm unable to write a dollar procedure for an adtEnum..
13:30:40*azimut quit (Remote host closed the connection)
13:31:04*azimut joined #nim
13:49:57FromDiscord<MartinSkou> does pythons "class variables" exist in Nim?
13:51:44PMunchNice algorithm is working well: http://ix.io/4r4O/
13:51:47PMunch@MartinSkou, yes
13:52:05PMunchAt least I believe that is what we concluded with last time someone asked
13:52:13*jmdaemon joined #nim
13:53:48FromDiscord<MartinSkou> hint to how?
13:55:22PMunchWell, don't remember of the top of my head
13:55:28PMunchWhy do you think you need them?
13:56:11PMunchie what are you trying to achieve? Many people try to bend Nim into the shape of a language they're familiar with and don't end up very happy with the result
13:58:16*jmdaemon quit (Ping timeout: 250 seconds)
13:59:43FromDiscord<MartinSkou> i have a type, fx page, and need some meta dato on the type like requiredfields, title, description. in python/django i used class variables to something like this, so you are right, took it from what i knew.
14:01:39PMunchHmm, not sure if I understand what you're trying to do. fxPage is a type, and you need it to have metadata? And somehow constants don't suffice?
14:01:39*rockcavera joined #nim
14:04:04FromDiscord<MartinSkou> fx you have different type: page, domain, language, etc. and you want to pass one of these type to a function which buildes an editor for the type, based on the field in the type and some extra metadata (like description and required fields).
14:04:15*junaid_ joined #nim
14:07:32PMunchOkay, so you have some types, Page, Domain, and Language. And each of these have a buildEditor procedure defined for them. So why isn't buildEditor just using different values for each of them? Or do you have a buildEditor which takes either of these three?
14:10:42FromDiscord<MartinSkou> yes, somehow buildEditor should be able to handle any of the types.
14:12:09PMunchWell there are a couple ways of doing that, variance objects or methods and inheritance
14:12:22PMunchNot quite sure which problem a class variable solves though
14:12:51PMunchIs it just a syntactic thing? Performance thing?
14:13:29FromDiscord<MartinSkou> it probertly just syntactic, will find another way. thanks.
14:20:54*junaid_ quit (Remote host closed the connection)
14:20:58FromDiscord<firasuke> is there a better way to write this?โ†ต`(stringOne & stringTwo & stringThree).strip()`?
14:21:03FromDiscord<firasuke> (edit) "stringThree).strip()`?" => "stringThree).strip()`"
14:21:30FromDiscord<firasuke> (edit) "this?โ†ต`(stringOne" => "this? (concatenate a bunch of strings and trim whitespace from the resulting string)โ†ต`(stringOne"
14:21:53FromDiscord<firasuke> (edit) "is there a better way to write this? (concatenate a bunch of strings and trim whitespace ... from" added "in the end"
14:22:50FromDiscord<enthus1ast> sent a long message, see http://ix.io/4r4X
14:23:22PMunchYou could also use an array with join and strip
14:24:38FromDiscord<firasuke> oh ok thanks, but are these alternative solutions better as in faster / require less resource usage?
14:25:37FromDiscord<enthus1ast> you could benchmark (for example with benchy) what is faster for you'r usecase
14:26:34FromDiscord<enthus1ast> if i have more complex string interpolation, i also use nimja
14:26:51FromDiscord<firasuke> I see
14:27:09FromDiscord<firasuke> also for downloading multiple files using async/threads, what is the standard way to do it in nim?
14:27:09FromDiscord<enthus1ast> or if you need to specify the format string on runtime, i build formatja (which is based on the nimja lexer)
14:28:19FromDiscord<enthus1ast> idk what to consider standard, but i would use the usual suspects\: httpclient or puppy
14:28:22FromDiscord<firasuke> and is there such a thing as default values for proc parameters?
14:28:26FromDiscord<firasuke> In reply to @enthus1ast "idk what to consider": ok thanks
14:29:03FromDiscord<enthus1ast> the benefit of puppy is that it can do ssl without the need to ship it with your application, since it used the os for this
14:29:39FromDiscord<firasuke> In reply to @enthus1ast "the benefit of puppy": oh cool
14:29:59FromDiscord<enthus1ast> but its sync not asnc
14:30:00FromDiscord<enthus1ast> async
14:30:36FromDiscord<enthus1ast> ship it should be link it i guess
14:43:46*PMunch quit (Quit: Leaving)
14:49:46*jmdaemon joined #nim
15:06:19*jmdaemon quit (Ping timeout: 248 seconds)
15:29:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4r5k
15:29:18FromDiscord<firasuke> cool thanks
15:48:29*jmdaemon joined #nim
16:02:26FromDiscord<Ayy Lmao> How do I go about debugging a dll that is hosted in another program? I am making an audio plugin and currently when something goes wrong it just silently crashes the program.
16:05:17*arkurious joined #nim
16:05:57FromDiscord<Gumbercules> Make sure it's compiled with debug symbols and use a debugger.
16:06:41FromDiscord<Gumbercules> It should be as simple as that.
16:08:29FromDiscord<Ayy Lmao> Unfortunately I am a pleb who has no experience with using a debugger. Do you have any advice on that?
16:08:51FromDiscord<Ayy Lmao> Is there a specific one I should look into for nim?
16:11:03FromDiscord<Gumbercules> It depends what compiler you're using. For mingw or gcc you'd use GDB. For clang you'd use LLDB and for msvc you'd use windbg or one of the other plethora of windows debuggers out there.
16:13:04FromDiscord<Gumbercules> GDB and LLDB don't have a graphical frontend so you'd need to install one. You can also configure them to integrate with certain editors, like VS Code for instance.
16:13:28FromDiscord<Gumbercules> I believe there is some blog post about debugging Nim with gdb
16:13:48FromDiscord<Gumbercules> https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#debugging-nim-code
16:14:19FromDiscord<Ayy Lmao> I am using gcc at the moment so I guess I'll look into GDB. Ideally I would be able to run a build script that builds the .dll, moves it to the proper location, and then debugs it inside VS Code.
16:14:33FromDiscord<Ayy Lmao> I'll check out that link, thanks
16:32:36NimEventerNew thread by sramsay: Negative number as program argument, see https://forum.nim-lang.org/t/10017
16:34:16FromDiscord<caravaggio> If a template doesn't have an untyped argument or return
16:34:24FromDiscord<caravaggio> It just acts like a Proc right?
16:34:38FromDiscord<Gumbercules> No
16:34:48FromDiscord<Gumbercules> It is code substitution
16:35:52FromDiscord<Gumbercules> Similar to a macro in C
16:36:39FromDiscord<caravaggio> In reply to @Gumbercules "Similar to a macro": Hmmm I thought the code substitution only works when there's an untyped argument
16:36:42FromDiscord<caravaggio> No?
16:37:26FromDiscord<Gumbercules> No... It would be similar to a C macro with no arguments.
16:37:47FromDiscord<Gumbercules> If you want to find out you could write a program and inspect the generated C code
16:38:09FromDiscord<Gumbercules> But I guess the better question is why do you want to use a template?
16:39:22*sagax joined #nim
16:39:40FromDiscord<caravaggio> In reply to @Gumbercules "But I guess the": I don't, just reading some code bases and am confused why template was being used without untyped
16:39:52FromDiscord<caravaggio> Trying to get better at nin
16:40:36FromDiscord<Gumbercules> https://nim-lang.org/docs/tut2.html#templates
16:40:49FromDiscord<Gumbercules> Probably the best place to start
16:41:01FromDiscord<caravaggio> Read that section, doesn't give an example without untyped
16:41:32FromDiscord<Gumbercules> Yes it does, look at the lifting proca example
16:41:38FromDiscord<Gumbercules> (edit) "proca" => "procs"
16:42:17FromDiscord<caravaggio> Oh wow ur right, thanks
16:43:55*jmdaemon quit (Ping timeout: 248 seconds)
16:46:01FromDiscord<Gumbercules> Untyped simply means the temple is not going to know or care about the type of the argument passed to it - so at compile time, which is when the template executes, this information will not be available in the scope of the template
16:46:19*jmdaemon joined #nim
16:46:19FromDiscord<Gumbercules> The omission of typed / untyped automatically infera untyped
16:46:27FromDiscord<Gumbercules> (edit) "infera" => "infers"
16:47:35FromDiscord<Gumbercules> But the reason it's not like a proc is because templates are simply code substitution, not an invocation of a procedure, not to mention they are executed at compile time and not runtime
16:48:44FromDiscord<Gumbercules> If you want a procedure to be executed at compile time you can use the compiletime pragma or invoke it from within a static block
16:49:33FromDiscord<Gumbercules> (edit) "If you want a procedure to be executed at compile time you can use the compiletime pragma ... or" added "when declaring its signature"
16:52:59*jmdaemon quit (Ping timeout: 248 seconds)
16:56:01FromDiscord<BobBBob> sent a code paste, see https://play.nim-lang.org/#ix=4r5J
16:56:02FromDiscord<BobBBob> chatgpt is useless for nim haha
17:01:14FromDiscord<mk-fg> Something like `const v = ObjectName(name: astToStr(v), val: 0.01)` maybe
17:02:06FromDiscord<mk-fg> (edit) "v" => "v1" | "astToStr(v)," => "astToStr(v1)," | "0.01)`" => "v2)`"
17:05:57FromDiscord<Phil> I don't quite understand why that isn't simply a proc
17:06:09FromDiscord<Rika> because it creates a const?
17:06:15FromDiscord<firasuke> how do you download multiple files? using async httpclient and downloadFile?
17:06:19FromDiscord<BobBBob> In reply to @mk-fg "Something like `const v1": that works thanks, but is that the way you're "supposed" to do it? it's not mentioned in the tutorial
17:06:27FromDiscord<firasuke> I also found `downit` should I use it?
17:06:28FromDiscord<Rika> In reply to @BobBBob "that works thanks, but": kinda?
17:06:42FromDiscord<Phil> In reply to @Rika "because it creates a": Ohhhh it's not just building the value it's also doing the assignment
17:06:47FromDiscord<Rika> what do you mean by "supposed"?
17:07:28FromDiscord<BobBBob> idk is that the recommended way?
17:08:54NimEventerNew post on r/nim by momoPFL01: List of languages that can be used from inside Nim, see https://reddit.com/r/nim/comments/11tx477/list_of_languages_that_can_be_used_from_inside_nim/
17:13:12FromDiscord<Rika> In reply to @BobBBob "idk is that the": i cant think of any possible issues with it other than unintended inputs like maybe passing `createConst(lol(thisworks), 0.01)`, just check what kind of names you allo
17:13:13FromDiscord<Rika> (edit) "allo" => "allow"
17:13:30FromDiscord<Rika> oh
17:13:40FromDiscord<Rika> didnt notice the const name is also part
17:14:19FromDiscord<Hourglass [She/Her]> Does Polymorph not have any publicly hosted docs?
17:14:33FromDiscord<Hourglass [She/Her]> I can't find a link to them, if they do exist
17:19:22FromDiscord<0ffh> sent a code paste, see https://play.nim-lang.org/#ix=4r5O
17:22:31FromDiscord<Phil> In reply to @0ffh "I have this snipped": Is there a specific reason why you have a void field?
17:23:20FromDiscord<Phil> Like, what information or ability does it provide you that makes it useful here?
17:23:25FromDiscord<0ffh> In reply to @Isofruit "Is there a specific": Well, IIRC I had to put something to please the syntax gods. Maybe could have used discard, don't know.
17:23:31FromDiscord<Phil> Ahhhhh check
17:23:35FromDiscord<Phil> Yeah discard is the way to go here
17:24:14FromDiscord<Phil> I don't know exactly why this code breaks, however I'd imagine void is something that was removed or changed to not work there anymore as it was likely an unintended side-effect for it to ever work
17:24:38FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4r5P
17:24:46FromDiscord<0ffh> In reply to @Isofruit "Yeah discard is the": Okay, yeah that works in devel/1.9.1!
17:25:10FromDiscord<Phil> Generally, if there is a line where you have to provide something but actually want to do nothing: Use discard
17:25:25FromDiscord<Phil> It's for disregarding proc results as well as skipping lines explicitly essentially
17:25:34FromDiscord<Phil> It's the explicit "I don't care" statement
17:28:31FromDiscord<0ffh> Well, thanks!โ†ตIn general I know of discard, just didn't occur to me when I wrote that code - also that was a while ago when I was a real greenhorn with Nim. Didn't see any reason to change it yet, as it used to be fine.
17:29:40FromDiscord<0ffh> In reply to @Isofruit "It's the explicit "I": BTW I used triple backticks for the code, what did you use to get the syntax coloring?
17:30:05FromDiscord<Phil> In reply to @0ffh "BTW I used triple": \`\`\`nimโ†ต\`\`\`
17:30:17FromDiscord<Phil> works identical for js, html, C or whatever else you might want to use
17:30:23FromDiscord<0ffh> In reply to @Isofruit "\`\`\`nim \`\`\`": Ah, thanks!
17:30:50FromDiscord<Phil> Happy to help!
17:38:29*PMunch joined #nim
17:48:30*jmdaemon joined #nim
18:05:31FromDiscord<Livid> I'm trying to compile my tests with Testament and Chronicles, but I get an error `/.choosenim/toolchains/nim-1.6.10/lib/pure/terminal.nim(80, 5) Error: cannot evaluate at compile time: gTerm`. Is this a common problem?
18:25:20FromDiscord<Livid> Ok I've found a part of the problem. it was because I had `switch("import", "chronicles")` in the top level `config.nims` file. But I would like `chronicles` imported automatically to all of my source files. Is that possible?
18:40:08PMunchYou can use the `--import` to import a module everywhere
18:40:38PMunchFor a package I think you'd need to point it to the main file in the package i.e. chronicles.nim
18:40:55PMunchThis is what I do in my echooveride test: https://github.com/PMunch/echooverride
18:44:56FromDiscord<Dale> Apologies if this isn't the right channel, but I have some feedback for the docs site. When I ctrl+click a link to open something in a new tab, the tab is created as a window and is subsequently blocked as a pop-up. This doesn't happen on any other websites.
18:46:26FromDiscord<Dale> R-click > open in new tab works. Not sure what's happening, is there some JS shenanigans?
18:48:46FromDiscord<caravaggio> In reply to @Gumbercules "But the reason it's": Hey man, thanks for the explanation I think this part makes me understand then better
18:49:01FromDiscord<Gumbercules> Anytime
18:49:03FromDiscord<caravaggio> Since their doing no execution only substitution like u stated
18:49:22FromDiscord<Elegantbeef> Noโ†ต(@planetis)
18:49:23FromDiscord<caravaggio> Last question in the template example
18:49:34FromDiscord<caravaggio> It's calling fname without the curly braces
18:49:36PMunch@Dale, not the wrong channel at all
18:49:48FromDiscord<caravaggio> That just means it automatically passes any argument, right?
18:49:52FromDiscord<Elegantbeef> Pmunch i do think it actually requires 1.9.1
18:49:59PMunchBut I'm not able to reproduce this behaviour in Firefox, seems to work like you would expect here
18:50:09PMunch@Elegantbeef, oh really?
18:50:17PMunchNot even 1.6.12?
18:50:55FromDiscord<Elegantbeef> I use cache table `contains`
18:50:56FromDiscord<Dale> I'm using chromium (ungoogled) on Linux if that's any help. I know it's a small issue but it's quite annoying since ctrl+click is hugely convenient
18:51:13FromDiscord<Gumbercules> In reply to @caravaggio "It's calling fname without": I'm holding a baby arm but will reply in a bit if no one answers your question first
18:51:38FromDiscord<Gumbercules> Atm
18:51:45FromDiscord<Gumbercules> Even
18:51:59FromDiscord<Livid> In reply to @PMunch "For a package I": hrmm... that is what I did, but it causes terminal.nim, in the standard library, to fail to compile with there error I mentioned earlier
18:52:08FromDiscord<Elegantbeef> Pmunch can you also give me a min repro for your other issue?
18:52:34PMunch@Dale, strange I just tried with Chromium here on my Linux machine and it works just fine as well
18:53:02PMunchWhat was that issue again?
18:53:21FromDiscord<Dale> Could be a bug with my install then. I haven't done an -Syu for a long time
18:53:32FromDiscord<Elegantbeef> The tree algorithm
18:53:35PMunchGood point, I should probably do one of those
18:54:04PMunch@Elegantbeef, oh right
18:54:07PMunchJust a sec
18:54:11FromDiscord<Elegantbeef> You gave a nice wordy description, but it's quite opaque on how i should replicate your problem ๐Ÿ˜„
18:54:42FromDiscord<Dale> Man, I haven't done any nim for a few months, time to get back into this. Have there been any major updates recently? I remember reading that the standard library was going to be scaled back
18:54:59PMunch@Elegantbeef, words are cheap, code is what I get paid to write :P
18:54:59FromDiscord<Elegantbeef> 2.0 is still soon
18:55:23PMunch@Dale, well some database stuff got taken out, that was probably the biggest stdlib change
18:55:45PMunchApart from that ARC/ORC is better than ever, and 2.0 looms ever closer
18:56:40FromDiscord<Dale> Ah, now I remember, one of the reasons I shelved it was waiting for 2.0. Got the itch though so here I am. Been looking at a lot of the modern new wave languages, and Nim still feels best to me
18:58:28FromDiscord<Dale> Well that's good to hear! The ref counting is one of my biggest concerns (still not sure whether to go manual really), so any improvements to that are welcome
18:58:52FromDiscord<Elegantbeef> I do not get paid to write either pmunch so show some respect! ๐Ÿ˜›
18:59:29FromDiscord<Dale> Has there been any work on threading as well? I recall learning how to use some feature but found out it was deprecated
19:00:15FromDiscord<Elegantbeef> https://github.com/nim-lang/threading
19:01:37FromDiscord<Dale> \o/
19:01:38FromDiscord<Dale> Thanks
19:05:07PMunch@Dale, you definitely don't want to go manual unless you absolutely have to. The memory management algorithms in Nim are really solid
19:07:06FromDiscord<Dale> Alright. May as well give it a shot and not make any premature decisions :)
19:07:22PMunch@Elegantbeef, there, a minimal repro pro bono :P
19:07:41PMunch@Dale, always a good idea ;)
19:08:03PMunch@Elegantbeef, did you see my question about why it has to use tuple by the way?
19:15:11*azimut quit (Ping timeout: 255 seconds)
19:17:19FromDiscord<jmgomez> Can you somehow override the `echo` on `dumpTree` or whatever it uses so it uses your func?
19:17:51PMunchWell you can write your own with treeRepr
19:20:04FromDiscord<jmgomez> right, but just wanted to check something real quick and it will be handy while inside the vm to have `echo` overwritten (just checked it does uses it)
19:20:40PMunchI mean you could use my echooverride thing I guess..
19:21:17PMunchBut it would probably be quicker to just implement your own dumpTree, it's literally like two lines of code :P
19:22:28FromDiscord<jmgomez> for this one sure, but I will check it out. Does it work fine in the vm?
19:24:41FromDiscord<caravaggio> In reply to @Gumbercules "I'm holding a baby": Np man, anytime ur ready
19:29:26*derpydoo quit (Read error: Connection reset by peer)
19:32:17PMunch@jmgomez, no idea
19:32:29FromDiscord<firasuke> I need some help in writing an async files downloader in nim, with a progress bar.
19:33:01FromDiscord<firasuke> I've looked into `httpclient` and `terminal` but I am a bit lost on how I should start implementing such a thing.
19:49:07FromDiscord<Gumbercules> In reply to @caravaggio "It's calling fname without": Why would you expect curly braces?
19:50:36FromDiscord<firasuke> I found `downit`: https://github.com/Patitotective/downit
19:51:41FromDiscord<Elegantbeef> Pmunch what's wrong with https://play.nim-lang.org/#ix=4r6t
19:52:12FromDiscord<Elegantbeef> I guess that should be a var capture
19:53:00FromDiscord<Elegantbeef> Though oddly the non var capture actually worked ๐Ÿ˜„
19:53:11FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4r6u but yea this seems fine to me
19:57:29PMunchHmm true, those if statements looks weird though :P
19:57:41PMunchLike init immediately followed by an if
19:58:06FromDiscord<Elegantbeef> I mean you want to alias the result variable to another type
19:58:20FromDiscord<Elegantbeef> That requires emitting a new variable and a check
19:59:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r6w
19:59:35FromDiscord<Elegantbeef> That's all my macro really does anywho for var captures
19:59:58FromDiscord<Elegantbeef> you do not technically need the if
20:00:11FromDiscord<Elegantbeef> you can do `discard (var result: Leaf) from result`
20:00:43FromDiscord<Elegantbeef> Ponders if a macro is capable of being discardable
20:03:10FromDiscord<firasuke> how do you clone a git repo from within nim? is there such a library?
20:07:35FromDiscord<Elegantbeef> Macros are not discardable, so yea you need the `discard` ๐Ÿ˜„
20:13:56PMunchMan, Gtk tree views are maddeningly complex..
20:14:55FromDiscord<firasuke> In reply to @firasuke "how do you clone": is there a better alternative to gittyup?โ†ตhttps://github.com/disruptek/gittyup
20:15:13FromDiscord<huantian> You can try looking up โ€œNim libgitโ€
20:15:26FromDiscord<firasuke> In reply to @huantian "You can try looking": oh ok
20:15:44FromDiscord<huantian> In reply to @firasuke "is there a better": Seems like a good option tho
20:16:18FromDiscord<firasuke> In reply to @huantian "Seems like a good": yeah I checked other packages and this seemed good
20:16:22FromDiscord<firasuke> dunno if there's a better option tho
20:16:59FromDiscord<Elegantbeef> Hopefully my reasoning was sufficient on ways to work that problem pmunch
20:17:29FromDiscord<Elegantbeef> I cannot think of any macro i could add that would make that problem disappear ๐Ÿ˜„
20:17:48PMunchHmm, not sure really
20:18:08PMunchIt's just a bit annoying having to spend two lines to set result
20:18:16PMunchSuper minor gripe though :P
20:18:47FromDiscord<Elegantbeef> Maybe a `x.aliasAs (result: Leaf)`
20:18:48FromDiscord<Elegantbeef> But that's just sugar for by addr
20:18:52PMunchOh by the way, how do you export stuff?
20:19:00FromDiscord<Elegantbeef> Hey your gripe did make me realise i missed a massive bug
20:19:08PMunchOh really?
20:19:11FromDiscord<huantian> In reply to @firasuke "I need some help": You might also wanna check out my downloader, rd-downloader for another example
20:19:20FromDiscord<Elegantbeef> Manually export presently
20:19:30PMunchI mean `result as Leaf` would be awesome
20:19:31FromDiscord<firasuke> In reply to @huantian "You might also wanna": alright
20:19:40PMunchSo just `export Tree`?
20:19:45PMunchWould that make the fields accessible?
20:19:46FromDiscord<Elegantbeef> I can implement that pmunch
20:19:56FromDiscord<Elegantbeef> Nope, hence the problem
20:20:40PMunchWait, so how do you currently export?
20:20:44FromDiscord<Elegantbeef> There is no easy way presently to export specific fields
20:20:58PMunchI just want to export my tree structure..
20:21:03FromDiscord<Elegantbeef> `export Circle, Shape, init, r, x, y`
20:21:11PMunchRight..
20:21:20FromDiscord<Elegantbeef> It's 100% manual export, since I need to find a way to handle it
20:21:35FromDiscord<Elegantbeef> I could go full bore and export everything, but that seems wrong
20:22:37FromDiscord<Elegantbeef> I guess i might aswell
20:22:54FromDiscord<Elegantbeef> If you want to have private fields you make a second module that imports this one and exports only selective fields
20:23:35PMunchYeah, I think that's a more rare usecase
20:23:36PMunchOh, did you look at the dollar bug by the way?
20:23:51FromDiscord<Elegantbeef> What dollar bug?
20:24:10PMunchI couldn't define a `$` procedure for the types
20:24:39FromDiscord<Elegantbeef> I do define one by default
20:24:49FromDiscord<Elegantbeef> Since it's a distinct
20:24:51FromDiscord<caravaggio> In reply to @Gumbercules "Why would you expect": Sorry I meant ()
20:24:59FromDiscord<caravaggio> Not curly braces
20:25:05FromDiscord<caravaggio> Can't think of the name for this ()
20:25:09FromDiscord<caravaggio> In the template example
20:25:13PMunch@caravaggio, parenthesis?
20:25:15FromDiscord<Elegantbeef> Parenthesis
20:25:20FromDiscord<caravaggio> Yes
20:25:25FromDiscord<caravaggio> Thanks my bad
20:25:53FromDiscord<Elegantbeef> Are you after a custom `$` for the base type or the subtypes pmunch?
20:26:13PMunch@Elegantbeef, well I wanted one for an alias originally
20:26:14PMunchhttp://ix.io/4r6G
20:26:30PMunchTried to have `toStr` be a dollar proc for only FileTree, but it didn't work
20:26:52PMunchOh, that was before I added the arguments
20:26:58FromDiscord<caravaggio> sent a code paste, see https://play.nim-lang.org/#ix=4r6I
20:27:01FromDiscord<Elegantbeef> Right, that's cause I emit one already
20:27:15PMunchHmm
20:27:30FromDiscord<caravaggio> On the template liftscalarproc has fname without the parenthesis, what is that trying to signify?
20:27:31PMunchI see
20:27:35FromDiscord<Elegantbeef> I suppose i shouldnt emit one of those
20:27:45PMunchWell it was handy during debugging..
20:27:57FromDiscord<caravaggio> I am trying to recreate that with a simple hello world and the compile keeps telling me I need to call arguments
20:27:57PMunchBut very annoying that I couldn't define one of my own
20:28:17FromDiscord<Elegantbeef> I have an idea
20:32:01FromDiscord<huantian> In reply to @caravaggio "On the template liftscalarproc": Where is that?
20:32:07FromDiscord<huantian> I may be blind
20:35:04FromDiscord<Gumbercules> I'm not seeing it either
20:35:39FromDiscord<Gumbercules> when this template is invoked, it simply replaces the invocation of it with the code under the template's scope
20:36:05FromDiscord<Gumbercules> so it is essentially declaring a new procedure named `fname` that accepts a single argument which is an `openArray` of type `T`
20:36:22FromDiscord<Gumbercules> and then it invokes itself recursively
20:37:00FromDiscord<Gumbercules> however I don't see `fname` being invoked anywhere without parens
20:37:03FromDiscord<Gumbercules> although you can do that in Nim
20:37:11FromDiscord<Gumbercules> this is why you can do `echo "foo"` instead of `echo("foo")`
20:37:35FromDiscord<caravaggio> sent a code paste, see https://play.nim-lang.org/#ix=4r6L
20:37:37FromDiscord<caravaggio> Is what I was referring to
20:37:40FromDiscord<caravaggio> But I see
20:38:00FromDiscord<caravaggio> I still can't get my mini example to work, am not understanding the fname as an argument with no type
20:38:38FromDiscord<huantian> iirc writing a template argument without a type is the same thing as (fname: untyped)
20:39:02FromDiscord<huantian> Which is saying that you can put anything in place of fname, even blocks of code, and Nim wonโ€™t care
20:39:09FromDiscord<huantian> Itโ€™ll copy paste it into the template anyway
20:39:34FromDiscord<caravaggio> Oh I see, it's just semantics
20:39:36FromDiscord<caravaggio> Thanks
20:39:54FromDiscord<Gumbercules> Yeah, that's what I was trying to point out earlier when I mentioned
20:40:31FromDiscord<Gumbercules> In reply to @Gumbercules "The omission of typed": this
20:40:54FromDiscord<caravaggio> Oh makes sense
20:41:07FromDiscord<caravaggio> I thought it was passing sqrt directly to the proc
20:43:46PMunchBy the way @Elegantbeef any specific reason why I need tuple in the definition?
20:43:53PMunchIsn't that the only option?
20:44:38FromDiscord<Elegantbeef> It's the only option i like
20:45:12*rmt quit (Ping timeout: 264 seconds)
20:50:58PMunchDamn it..
20:51:14PMunchparsetoml doesn't work on devel, and fungus requires devel..
20:52:41PMunchAh, never mind, I just had an ancient version of parsetoml installed :P
20:52:57PMunchThis pkg/pkg2 stuff is really annoying
20:53:21PMunchNow I just ran nimble install parsetoml, it installed 0.7.0, but nim c still tried to use 0.5.0
20:56:33FromDiscord<Elegantbeef> https://github.com/beef331/fungus#implementing-custom--1
20:56:50FromDiscord<Elegantbeef> There you go now pmunch the default `$` is the same as it was, but now you can overload it
20:57:22FromDiscord<Elegantbeef> And I implemented a macro to generate the `==` for a ADT so you do not have to manually do it
20:59:11FromDiscord<Elegantbeef> Well you still need to manually implement the `==` proc for the root type, but I mean you do not need to manually match and check everything
20:59:37PMunchNeat
21:00:11FromDiscord<Elegantbeef> Also procedures are now exported
21:02:18FromDiscord<Elegantbeef> `0.1.4` also exports init procedures, i forgot to do that prior ๐Ÿ˜„
21:02:36FromDiscord<Elegantbeef> Anyway hopefully that's enough house cleaning of this
21:02:44FromDiscord<Elegantbeef> It should be sufficient now
21:39:07PMunchGotta love that hitting Ctrl+Z too quickly in Vim will send the `nim check` command to the background so that it never completes and just hangs Vim indefinitely (or at least until you manually kill the nim check command)
21:39:27*rockcavera quit (Remote host closed the connection)
21:45:18PMunch@Elegantbeef, I also have to add `else: discard` to my match block, is that normal?
21:47:28PMunchHmm, I also get undeclared field: 'kind' for type filetree.Path
21:47:37PMunchfiletree is the module I imported where Path is defined
21:47:47PMunchI already have `export kind` in there..
21:50:17FromDiscord<etra> In reply to @PMunch "Gotta love that hitting": lol, that also happens to me when I use vim + rust-analyzer, the old habit of ctrl+z to build stuff
21:50:54FromDiscord<etra> in Windows doesn't happen because nvim completely freezes when ctrl+z so that's even more painful :crypalm:
21:51:57PMunchWait, you use Ctrl+z to build?
21:52:12PMunchI just use it to background Vim, and then I can run commands in the same terminal
21:52:20FromDiscord<etra> yeah I meant that
21:52:25PMunchAh right
21:52:27FromDiscord<etra> ctrl + z > cargo build > fg
21:52:38FromDiscord<etra> but cargo build is locked because of rust analyzer
21:52:40PMunchYup
21:52:43PMunchAah :P
21:52:47FromDiscord<etra> I'm trying to get the habit of spawning a terminal inside vim instead
21:52:49PMunchHaha, that's silly
21:52:53FromDiscord<etra> doing `:tabe +term`
21:53:14FromDiscord<etra> ~~because having a proper multiplexer in windows is hell~~
21:53:26PMunchI could probably just disable nim check and just use nimlsp
21:53:36PMunchBut then I'd have to dig into how to disable that :P
21:56:20FromDiscord<Elegantbeef> upgrade to 0.1.5 for me
21:56:21FromDiscord<Elegantbeef> Yes it should be exhaustive by design
21:56:32FromDiscord<Elegantbeef> Remove all the `export` statements
21:56:33FromDiscord<Elegantbeef> Oh actually i see the issue
21:56:34FromDiscord<Elegantbeef> `kind` isnt exported ๐Ÿ˜„
21:57:33FromDiscord<Elegantbeef> Ok pmunch 0.1.6 should make you happy
21:58:05FromDiscord<firasuke> how do you install a custom library using nimble? such as `gittyup` as it is not shown when doing `nimble list`?
21:58:46FromDiscord<ElegantBeef> Matrix be slow right now nice
21:58:52FromDiscord<Elegantbeef> \`nimble install git.domain/path/here
21:59:09FromDiscord<firasuke> In reply to @Elegantbeef "\`nimble install git.domain/path/here": ok
22:00:29PMunchAnything in particular I need to do in order to get it to export=
22:00:44FromDiscord<Elegantbeef> Export what?
22:00:52PMunchAnything
22:00:59FromDiscord<Elegantbeef> Not anymore
22:01:28PMunchI have this module: http://ix.io/4r72
22:01:32PMunchImported into my main project
22:01:46PMunchAnd it says Error: undeclared identifier: 'Path'
22:01:59FromDiscord<ElegantBeef> Jesus I forgot the types
22:02:15PMunchHaha :P
22:02:55FromDiscord<Elegantbeef> There 0.1.7 ๐Ÿ˜›
22:03:04FromDiscord<Elegantbeef> Really putting graffiti through it's paces!
22:03:22FromDiscord<Elegantbeef> I know no one has used any versions inbetween these, but good practices and all!
22:04:15PMunchHmm, still undefined identifier
22:05:05FromDiscord<Elegantbeef> Still the type?
22:05:13PMunchYup
22:05:59PMunchUsed --expandMacro:adtEnum
22:06:07PMunchAnd it doesn't show a single export marker..
22:06:48FromDiscord<Elegantbeef> Ok so now i know that it works on `0.1.8`
22:07:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r75
22:07:12FromDiscord<firasuke> since I can't find libraries, should I stick to using system calls to executables?
22:07:39FromDiscord<Elegantbeef> Using libgit is generally best, but you can always just use the shell
22:07:47FromDiscord<Elegantbeef> I personally do since it's quicker to setup for my graffiti program
22:07:53FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4r76
22:08:11FromDiscord<firasuke> In reply to @Elegantbeef "Using libgit is generally": I couldn't find neat implementations for async downloads and for git clone
22:08:33FromDiscord<firasuke> at this point I'm questioning my design decision, do I really need async
22:09:01PMunchUndeclared identifier FolderKind
22:09:13FromDiscord<firasuke> I probably only need to download multiple files concurrently, other than that I am good
22:09:21FromDiscord<firasuke> but still, I can't do that properly
22:10:06FromDiscord<Elegantbeef> I didnt export the enum
22:10:06FromDiscord<Elegantbeef> One day i'll think this through
22:10:07FromDiscord<Elegantbeef> Sorry for putting you through this though
22:15:43FromDiscord<Elegantbeef> So fingers crossed pmunch this is the last back and forward exchange
22:16:28PMunchHaha, no worries
22:16:35PMunchIn between versions I just include the file
22:16:45PMunchWhat version are we up to now?
22:16:53FromDiscord<Elegantbeef> 0.1.9
22:17:47PMunchNice, it seems to work
22:18:01PMunchAlthough I've got an ambiguous identifier
22:18:01FromDiscord<Elegantbeef> I also did submit a PR to the package repository
22:18:15FromDiscord<Elegantbeef> Ruh roh
22:18:29PMunchHmm, another name for File..
22:18:38FromDiscord<Elegantbeef> That's right
22:18:43FromDiscord<Elegantbeef> FIle is a builtin Nim Type
22:18:48FromDiscord<Elegantbeef> Well "built in"
22:18:50PMunchI know
22:18:50FromDiscord<Elegantbeef> It's imported in io
22:19:09FromDiscord<Elegantbeef> Well why did you mention it!
22:19:23PMunchI was trying to get suggestions for another name
22:19:33FromDiscord<Elegantbeef> Oh that makes more sense
22:20:27FromDiscord<Elegantbeef> Entry?
22:20:37PMunchEntry is good
22:20:51PMunchCan confirm, everything works now
22:21:33FromDiscord<Nilts> In reply to @not logged in "I get this error:": Any ideas?
22:21:37FromDiscord<Elegantbeef> `Path or Folder or File or FileTree` A concept does this better
22:21:47FromDiscord<Elegantbeef> templates do no have `results`
22:21:54PMunchYeah that was just me desperately trying to get dollar to work :P
22:22:27FromDiscord<Elegantbeef> Here's hoping this is better than using object variants
22:26:02arkanoidhow to cite/quote in forum post?
22:26:39FromDiscord<Elegantbeef> `> bleh` iirc
22:26:54FromDiscord<Elegantbeef> Or it might be ` message here`
22:27:31FromDiscord<Elegantbeef> https://forum.nim-lang.org/about/rst
22:27:36PMuncharkanoid, hit the RST is supported link and it should tell you
22:28:16FromDiscord<Nilts> Are my messages even getting trough or am i doing something wrong
22:28:31PMunchAnyways, I'm off for the night. Tomorrows project is a runtime templating engine I guess..
22:28:50arkanoidPMunch: I've tried many options, but all the one requiring "indented" block can't be used in linux+firefox, as "tab" is not adding tab char, but moving cursor on screen outside text area
22:28:55PMunch@Nilts, yes, beef already answered you..
22:29:44FromDiscord<Nilts> Well, since things are not linked through the link, it is kind of hard to find.
22:29:55PMuncharkanoid, but you don't need an indented block..
22:30:22PMunchYou just need a `> something like this`, and you need an empty line after that and then whatever you wanted to type
22:30:31arkanoidPMunch: if you mean the "Quoting other users can be done by prefixing their message with >:" it's not working to me, at least in preview
22:30:37FromDiscord<Elegantbeef> And pmunch when you're done with that adt code, do share it with me, want to stare at it intently to see if anything needs fixed
22:30:38PMunch@Nilts, linked through the link?
22:30:58PMuncharkanoid, you need an empty line and some more text for it to do the quote thing
22:31:14FromDiscord<Nilts> In reply to @Elegantbeef "templates do no have": Sorry for not seeing your message, but it was conjoined with a response to another person from my side. Ik templates do not have results, it is referencing the result var of a proc that you call the template from.
22:31:20arkanoidwait, I got it, the example is wrong. ">Foo" works, but "> Foo" doesn't
22:31:51PMunch@Elegantbeef, haven't really started using all the features yet, but this is what it looks like so far: http://ix.io/4r7c
22:32:02PMunchAnd usage through a simple match block in my main module
22:32:29PMunch"> Foo" works for me..
22:32:44PMunchAnyways, I'm off
22:32:45*PMunch quit (Quit: leaving)
22:34:16FromDiscord<ElegantBeef> Well matrix is clearly being a pain
22:34:27FromDiscord<ElegantBeef> The bridge needs to be updated ๐Ÿ˜„
22:34:44FromDiscord<ElegantBeef> Anyway are you sure you're calling that inside a proc that has a result
22:34:52FromDiscord<ElegantBeef> also does adding `{.dirty.}` to the template change anything
22:34:55FromDiscord<ElegantBeef> Why is it even a template
22:37:36*rockcavera joined #nim
22:40:01FromDiscord<Nilts> In reply to @ElegantBeef "Why is it even": jester being designed around templates
22:40:05FromDiscord<Nilts> i will try dirty
22:40:10FromDiscord<Nilts> pragma
22:41:39FromDiscord<Nilts> It seems to be type checking the untyped template. (Dirty did not work)
22:41:52FromDiscord<ElegantBeef> Of course it's typechecking it
22:42:01FromDiscord<ElegantBeef> templates are checked after expansion
22:43:48FromDiscord<Nilts> it is checking before expansion, or else is should be fine
22:44:02FromDiscord<ElegantBeef> Templates are unchecked until subsitution
22:44:35FromDiscord<Nilts> anyways, here is the tree of my problem:โ†ตFunction -> My Template -> Jester template -> Errorโ†ตSo i think it is an issue with nested templates
22:44:53FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4r7f
22:45:54FromDiscord<ElegantBeef> `import std/macros` and put `expandMacros:` around your macro call
22:46:23FromDiscord<inv> @treeform https://github.com/treeform/jsony/pull/67
22:46:53FromDiscord<ElegantBeef> I thought you couldnt fix other's libraries ๐Ÿ˜›
22:47:25FromDiscord<inv> I do not want to fix the libs I do not want to fix ๐Ÿ™‚
22:47:30FromDiscord<inv> (edit) "๐Ÿ™‚" => "๐Ÿ˜‰"
22:47:52*rockcavera quit (Remote host closed the connection)
22:49:31FromDiscord<inv> @ElegantBeef about expect: your templates is good, but I think it is more workaround to check flags you want. The problem at the moment is nothing more than message
22:49:38FromDiscord<inv> (edit) "@ElegantBeef about expect: your templates is good, but I think it is more workaround to check flags you want. The problem at the moment is nothing more than ... message" added "just warning"
22:49:47FromDiscord<inv> (edit) "is" => "are"
22:49:51FromDiscord<ElegantBeef> My template?
22:50:24FromDiscord<ElegantBeef> Oh do not get me wrong i think the present state of defects is abysmal
22:50:28FromDiscord<inv> oh, I am sorry, it wasn't message from you
22:50:38FromDiscord<inv> the one: https://forum.nim-lang.org/t/9994#66013
22:50:49FromDiscord<ElegantBeef> There is no defect tracking, so there is no way of preventing a program from crashing
22:50:53FromDiscord<Nilts> In reply to @ElegantBeef "`import std/macros` and put": Where? I never even added it yet. I just imported it
22:51:50*rockcavera joined #nim
22:51:57FromDiscord<ElegantBeef> Nilts you have to be invoking the template somewhere
22:52:00FromDiscord<ElegantBeef> You just have to be
22:52:33FromDiscord<inv> @ElegantBeef I do not want to mix the problems from the topic. defects can be uncatchable - it is ok, but what is the reason to write except CE, Defect if panics:off ?
22:52:39FromDiscord<inv> (edit) "except" => "`except" | "Defect" => "Defect`"
22:52:52FromDiscord<inv> (edit) "@ElegantBeef I do not want to mix the problems from the topic. defects can be uncatchable - it is ok, but what is the reason to write `except CE, Defect` if panics:off ? ... " added "- what does it show to me ?"
22:53:09FromDiscord<ElegantBeef> No clue I do not catch defects
22:53:44FromDiscord<inv> But why bare except is bad ?
22:53:54FromDiscord<inv> (edit) "?" => "in the case"
22:53:59FromDiscord<ElegantBeef> Bare except is bad cause it silently catches defects in --panics:off
22:54:05FromDiscord<ElegantBeef> Code is not meant to be shipped with --panics:off
22:54:12FromDiscord<ElegantBeef> It's only meant for testing
22:54:16FromDiscord<inv> bare except == except CE, Defect, isn't it ?
22:54:29FromDiscord<ElegantBeef> bare exceept is all types that derive from `Exception`
22:54:39FromDiscord<ElegantBeef> And i believe even FFI exceptions
22:55:03FromDiscord<ElegantBeef> Bare except is just bad practise imo anyway
22:56:19FromDiscord<inv> "Code is not meant to be shipped with --panics:off" it is not very clear, because someone said that code meant to be shipped with --d:danger
22:56:32FromDiscord<ElegantBeef> Nope
22:56:40FromDiscord<ElegantBeef> Code is meant to be shipped with release and defects are meant to be panics
22:56:53FromDiscord<inv> panics are off in the release
22:56:55FromDiscord<Nilts> In reply to @ElegantBeef "Nilts you have to": I am not XD
22:57:12FromDiscord<ElegantBeef> In reply to @inv "panics are off in": Panics are off by default cause that was the behaviour of Nim
22:57:29FromDiscord<ElegantBeef> The modern age is always an opt in with Nim until a major change
22:57:31FromDiscord<Gumbercules> I think it entirely depends on the scenario
22:57:48FromDiscord<Gumbercules> in certain circumstances, `-d:danger` is probably preferable to `-d:release` for shipping a binary
22:58:17FromDiscord<Gumbercules> if your more concerned with performance than runtime safety
22:58:22FromDiscord<ElegantBeef> I mean `-d:danger` is explicitly danger and only meant to be shipped if you know what it's doing and program defensively
22:58:23FromDiscord<inv> I still did not get why to show the warn before someone tries to compile with p:on. Because, I think that 80% is not going to do it
22:58:53FromDiscord<ElegantBeef> The reason it's bad practise is if you make a library and never use panics off and you rely on catching a defect, i cannot use your code cause i use panics:on
22:58:57FromDiscord<inv> (edit) "is" => "are"
22:59:06FromDiscord<Gumbercules> yeah but that's assuming you're shipping libraries
22:59:21FromDiscord<ElegantBeef> If you're not put `--warning[BareExcept]: off`
23:00:42FromDiscord<inv> @ElegantBeef the warning does not mean that library is broken, it is just mean that, like me: someone put except SE, Defect in code
23:00:53FromDiscord<inv> and it is expected behavior for me
23:00:57FromDiscord<ElegantBeef> What do you mean it does not mean it's broken?
23:01:11FromDiscord<ElegantBeef> If you use a bare exception you are possibly hiding a defect error
23:01:16FromDiscord<ElegantBeef> That's broken code
23:01:43FromDiscord<ElegantBeef> The point of a defect is to tell the programmer "Woah there buddy you're doing something wrong"
23:02:22FromDiscord<ElegantBeef> If you have panics on and see a `defect` in exception handler it should error on top of this change
23:03:05FromDiscord<inv> if I replace except with except CatchableError in all my libs - for me no changes except more verbose line
23:03:08FromDiscord<inv> (edit) "line" => "code"
23:03:19FromDiscord<ElegantBeef> Except now you also no longer accidently catch defects
23:03:25FromDiscord<Gumbercules> At this point Nim's error handling has become so convoluted that I feel like we should just go back to booleans / error codes
23:03:30FromDiscord<ElegantBeef> So now your code is more reliable
23:03:35FromDiscord<ElegantBeef> Fuck no, exceptions are grand
23:03:37FromDiscord<inv> ok, lets apply - never catch Defects like you want for now - not a problem
23:03:49FromDiscord<Gumbercules> To each their own
23:03:59FromDiscord<ElegantBeef> The thing is panics off is only really existent for testing
23:04:15FromDiscord<Gumbercules> it's not just about panics off though - what if I don't want bounds checking?
23:04:17FromDiscord<ElegantBeef> If you want to ensure `[0][2]` raises a defect you need to have a mechnism to allow this
23:04:26FromDiscord<ElegantBeef> You disable checks?
23:05:05FromDiscord<Gumbercules> Sure but then we have to have the cognative overhead of whether this happens with `-d:danger` or -`d:release` or -d:whateverthefuckisnext`
23:05:07FromDiscord<inv> let it is just for testing, in the case I still do not want to write except CatchableError if I can just write except which will do the same with p:on
23:05:17FromDiscord<ElegantBeef> I do not know how checks come into play when talking about bare excepts though
23:05:19FromDiscord<Gumbercules> (edit) "-d:whateverthefuckisnext`" => "`-d:whateverthefuckisnext`"
23:05:27FromDiscord<Gumbercules> I don't even know what a bare except is
23:05:34FromDiscord<ElegantBeef> `try: ... except: ...`
23:05:35FromDiscord<Gumbercules> and I don't know why I should know just based on the name `bare except`
23:05:48FromDiscord<ElegantBeef> An exception with no specific type associated with it
23:05:56FromDiscord<ElegantBeef> well an except
23:06:02FromDiscord<inv> @Gumbercules it is except Exception:
23:06:17FromDiscord<inv> (edit) "except Exception:" => "`except Exception:`"
23:06:30FromDiscord<ElegantBeef> In reply to @inv "let it is just": Again there is so much code before, so the warning > massive breaking changes
23:06:30FromDiscord<Gumbercules> I get it now, I'm just pointing out none of this is obvious
23:07:13FromDiscord<ElegantBeef> In reply to @Gumbercules "Sure but then we": All checks are on with release
23:07:18FromDiscord<ElegantBeef> That's the point of danger
23:07:23FromDiscord<ElegantBeef> You can also disable checks explicitly
23:07:32FromDiscord<ElegantBeef> Either globally or for a specific procedure
23:08:19FromDiscord<Gumbercules> yeah the latter two features are nice
23:08:30FromDiscord<Nilts> In reply to @not logged in "I am not XD": I think i missed smth again.
23:08:35FromDiscord<ElegantBeef> Yea rust comically disables overflow checks for performance
23:08:48FromDiscord<inv> @ElegantBeef I think it is very long way: 10 years to spam everyone with the bare-except message, then 10 years to spam everyone about next change that except is `except CA`
23:08:48FromDiscord<ElegantBeef> So you can have overflows on release and it just works silently
23:09:01FromDiscord<ElegantBeef> Do not look at me i'm not a core developer
23:09:04FromDiscord<firasuke> can you use `harpoon` to download files async?
23:09:05FromDiscord<ElegantBeef> I'm barely a developer ๐Ÿ˜„
23:09:19FromDiscord<Gumbercules> what is `harpoon`?
23:09:26FromDiscord<Gumbercules> is your file a whale?
23:09:26FromDiscord<inv> Because from the user's point of view, to write `except:` is ok without any overhear
23:09:33FromDiscord<firasuke> In reply to @Gumbercules "what is `harpoon`?": https://juancarlospaco.github.io/harpoon/
23:10:08FromDiscord<Gumbercules> given the example code I'd ventureyes
23:10:10FromDiscord<Gumbercules> (edit) "ventureyes" => "venture yes"
23:10:30FromDiscord<ElegantBeef> Anyway inv i'm just annoyed by people that write code that except defects to be catchable
23:10:43FromDiscord<ElegantBeef> the `elvis` package relies on this in multiple places for instance
23:10:58FromDiscord<firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4r7q
23:11:13FromDiscord<firasuke> In reply to @Gumbercules "given the example code": oh please do, I've wasted hours trying to get an async downloader working
23:11:18FromDiscord<ElegantBeef> (edit) "except" => "expect"
23:11:33FromDiscord<inv> I suppose that if languages needs that someone writes `except CatchableError` everywhere - it means that the language puts some internal problems on it's user
23:11:36FromDiscord<Gumbercules> I was just saying, given the example on that page my guess would be yes
23:11:46FromDiscord<Gumbercules> I wasn't suggesting I knew for sure / had tried it out
23:11:57FromDiscord<Gumbercules> I didn't even know what harpoon was several moments ago
23:12:04FromDiscord<firasuke> oh ok
23:12:07FromDiscord<ElegantBeef> It's an issue of time i'd say inv, it's legacy. Not as bad as other languages legacy
23:12:09FromDiscord<Gumbercules> sorry for the confusion
23:12:13FromDiscord<firasuke> np
23:12:16FromDiscord<Nilts> In reply to @ElegantBeef "You just have to": And if i am not? What do i do, i am quite lost. I am using jester #head
23:12:27FromDiscord<ElegantBeef> No clue i do not have a reproducable example
23:12:35FromDiscord<ElegantBeef> If you want help you always provide a reproducable example
23:12:43FromDiscord<ElegantBeef> No one wants to pull teeth, unless they're being paid for it
23:12:48FromDiscord<Gumbercules> minimal reproduceable example
23:13:01FromDiscord<Nilts> In reply to @Gumbercules "minimal reproduceable example*": Yeah, i am terrible at making thoe
23:13:06FromDiscord<Nilts> (edit) "thoe" => "those"
23:13:20*azimut joined #nim
23:13:22FromDiscord<inv> @ElegantBeef until there is a strict decision for default panics:on - I think it is too early to spam with the message
23:13:29FromDiscord<Gumbercules> everyone is, but generally when you ask someone to do that they figure out what they're doing wrong in the processing of trying
23:13:44FromDiscord<Gumbercules> no one wants to have to install all the dependencies of your project and try to figure out your build complexities to help
23:13:48FromDiscord<Gumbercules> then it becomes a job
23:13:58FromDiscord<ElegantBeef> I personally do not use bare excepts so I couldnt care less ๐Ÿ˜„
23:14:21FromDiscord<Gumbercules> (edit) "processing" => "process"
23:14:30FromDiscord<inv> Why don't you use them ?
23:14:32FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=4r7r
23:14:43FromDiscord<Gumbercules> I don't even use exceptions in my code
23:14:51FromDiscord<Gumbercules> because, what is the point
23:14:53FromDiscord<inv> except if you have very precise exceptions
23:14:59FromDiscord<inv> (edit) "except if you have very precise exceptions ... " added "everywhere"
23:15:01FromDiscord<firasuke> In reply to @amadan "Does this give an": it downloads sequentially
23:15:25FromDiscord<Gumbercules> most of the time errors aren't even recoverable - as I always opine, exceptions should be reserved for exceptional circumstances
23:15:27FromDiscord<Gumbercules> not errors
23:15:38FromDiscord<Gumbercules> most errors are predictable
23:15:44FromDiscord<ElegantBeef> Cause if i write code that doesnt care about exceptions i do not care about them. If i do care about them i handle them
23:15:51FromDiscord<ElegantBeef> Meh any other error mechanism is more of a pain imo
23:15:51FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=4r7t
23:15:59FromDiscord<Gumbercules> I disagree - exceptions are a giant pain in the ass
23:16:03FromDiscord<ElegantBeef> Lol
23:16:18FromDiscord<Gumbercules> it's so much easier to know that this unit of code may return a value or may not
23:16:20FromDiscord<amadan> (edit) "https://play.nim-lang.org/#ix=4r7t" => "https://play.nim-lang.org/#ix=4r7u"
23:16:24FromDiscord<Gumbercules> and if it doesn't it will return some sort of error
23:16:25FromDiscord<inv> I think it is another discussion if someone prefers rust's way of error handling
23:16:43FromDiscord<Gumbercules> I'm not talking about Rust - this applies to programming in general
23:16:58FromDiscord<Gumbercules> having to wrap sections of code in `try / except` blocks is a giant PITA
23:17:10*derpydoo joined #nim
23:17:20FromDiscord<Gumbercules> and then having the cognitive overhead of having to think about what might be thrown and handling those cases individually when often times I just want to say - this thing failed, let's move on and log something
23:17:34FromDiscord<Gumbercules> or - this thing failed and we need to log and clean up some resources and exit
23:17:47FromDiscord<inv> @Gumbercules yep, it is very funny to define 100500 `From` in rust code
23:17:53FromDiscord<inv> (edit) "@Gumbercules yep, it is very funny to define 100500 `From` ... in" added "for errors"
23:17:53FromDiscord<firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4r7w
23:18:01FromDiscord<Gumbercules> now, if I'm making a HTTP request and I don't control the other and and I have no idea wtf might happen, then an exception makes a lot of sense
23:18:12FromDiscord<ElegantBeef> My issue is the exact opposite, every other error method leaks into user code
23:18:12FromDiscord<Gumbercules> because I can't predict what will occur, so I need to be able to explicitly handle scenarios I care about
23:18:26FromDiscord<amadan> In reply to @firasuke "hmmm not working, await": hm weirdโ†ตwhat do you mean by isn't picking up?
23:18:31FromDiscord<ElegantBeef> You now do not have a `: string` you have a proc that returns a bool and you need to check it to validate
23:18:38FromDiscord<ElegantBeef> Or you have a proc that returns a tuple, or ...
23:19:02FromDiscord<ElegantBeef> It pollutes user code imo
23:19:03FromDiscord<Gumbercules> having to check a sum type or option type or whatever you want to package an error in, is just as much work as handling an exception, if not more
23:19:03FromDiscord<firasuke> In reply to @amadan "hm weird what do": ` template/generic instantiation of async from here`
23:19:14FromDiscord<inv> @Gumbercules I always has the question about it: do you use / or wrap everything into try_div ?
23:19:15FromDiscord<Gumbercules> sorry I meant that the handling of various exceptions is generally more work
23:19:47FromDiscord<Gumbercules> In reply to @inv "<@204328759715692544> I always has": no, I don't use exceptions unless I cannot predict what the outcome of a certain invocation might be, like if I'm making a call to a database or web server etc
23:19:50FromDiscord<ElegantBeef> I find handling sentinels, results, or options the worst as it obfuscate the actual value
23:19:57FromDiscord<Gumbercules> generally if I'm making a system call like opening a file or something, I know exactly what is ggoing to happen
23:20:12FromDiscord<Gumbercules> either it's going to work, or it's not - and I can check several reasons why it might not work ahead of time
23:20:21FromDiscord<firasuke> In reply to @amadan "hm weird what do": I' am also receiving that expression `downloadFile` has no type or is ambiguous
23:20:32FromDiscord<ElegantBeef> Opening a file is one of the many operations you cannot check ahead of time
23:20:39FromDiscord<Gumbercules> I can check if the file exists
23:20:44FromDiscord<amadan> In reply to @firasuke "` template/generic instantiation of": Try and compile and see what the error isโ†ตI'm running it locally and looks like it might be a problem with harpoon
23:20:47FromDiscord<Gumbercules> I can check if its size is > 0
23:20:49FromDiscord<ElegantBeef> No you cannot
23:20:54FromDiscord<Gumbercules> all I need is the filepath....
23:21:00FromDiscord<ElegantBeef> Except that's a race condition ๐Ÿ˜›
23:21:04FromDiscord<firasuke> In reply to @amadan "Try and compile and": is it working for you?
23:21:14FromDiscord<Gumbercules> well, exceptions aren't going to help you sort that one out either
23:21:16FromDiscord<ElegantBeef> TOCTOU!
23:21:20FromDiscord<ElegantBeef> Yea it is
23:21:33FromDiscord<ElegantBeef> The entire point is the file exists so the error bubbles up
23:21:42FromDiscord<amadan> no, it doesn't compile `harpoon.nim(116, 166) Error: undeclared identifier: 'SslError'`โ†ตWhich is causing me to get the same things you are getting
23:22:04FromDiscord<Gumbercules> why do I want an error to bubble up through my program when I can just handle the damn thing there?
23:22:08FromDiscord<ElegantBeef> In your way if the file exists then you attempt to open it and it was deleted your do not error you make a new file
23:22:10FromDiscord<Gumbercules> file doesn't exist? okay - do something else
23:22:27FromDiscord<Gumbercules> I mean, I'm not trying to solve dumb user behavior here
23:22:37FromDiscord<inv> I still think that everyone like Result just does not handle enough error
23:22:40FromDiscord<Gumbercules> I'm trying to make a game - if someone is deleting files they plan on opening while using my software, that's on them
23:22:40FromDiscord<firasuke> In reply to @amadan "no, it doesn't compile": try `-d:ssl`
23:22:53FromDiscord<ElegantBeef> In reply to @inv "I still think that": What do you mean?
23:23:01FromDiscord<amadan> oh god can't believe I forgot to do that ๐Ÿ˜…
23:23:02FromDiscord<inv> Becase it will make _every_ function with try_ prefix
23:23:15FromDiscord<Gumbercules> I wouldn't go down that path
23:23:23FromDiscord<ElegantBeef> A lot of rust functions that return results do not prefix with try
23:23:29FromDiscord<Gumbercules> ^
23:23:37FromDiscord<Gumbercules> All you need is a tuple
23:23:48FromDiscord<ElegantBeef> Gumber is on the Go train
23:23:48FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=1lw6
23:23:49FromDiscord<Gumbercules> or sum type or anonymous union or optional type or whatever
23:23:52FromDiscord<Gumbercules> man fuck go
23:23:54FromDiscord<Gumbercules> I'm on the C train
23:23:57FromDiscord<inv> @ElegantBeef in most of the languages where is compromise between what results Result what is not. If you want to catch everything very accurate - you should not use + - / at all
23:24:05FromDiscord<Gumbercules> all aboard!
23:24:08FromDiscord<ElegantBeef> Go's error handling is literally just "Return whatever you need"
23:24:25FromDiscord<firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4dFL
23:24:25FromDiscord<Gumbercules> The only thing Go gets even close to correct is its concurrency model
23:24:27FromDiscord<firasuke> the non async version takes a uri
23:24:32FromDiscord<firasuke> thanks for explaining that
23:24:46FromDiscord<ElegantBeef> I'm still lost at what you mean inv
23:24:48FromDiscord<firasuke> just reached the same conclusion as well
23:25:33FromDiscord<inv> @ElegantBeef I mean that it is elways balance what to wrap in Result and what is not to wrap
23:25:42FromDiscord<ElegantBeef> Ah right
23:26:10FromDiscord<ElegantBeef> That's the issue with Results though it requires explictly stating the resultant values
23:26:21FromDiscord<firasuke> what's a good way to draw progress bars in nim?
23:26:25FromDiscord<Gumbercules> most of the time you don't even care about them though
23:26:32FromDiscord<Gumbercules> you care whether it succeeded or didn't
23:27:07FromDiscord<ElegantBeef> Exception messages beg to differ
23:27:15FromDiscord<Gumbercules> it's very rare that you're going to handle application logic differently if you failed to open a file because it didn't exist or because you opened it and it was the wrong format
23:27:22FromDiscord<inv> and if someone says "I like to wrap everything", I still that he just ignores a lot of error, because if you want 100% sure - you have to wrap about everything and the Result wrapping becomes hell => that if why I still prefer exceptions after few years of prod rust dev
23:27:23FromDiscord<Gumbercules> I mean, you as a developer might care, but your end user won't
23:27:30FromDiscord<inv> (edit) "dev" => "development"
23:27:30FromDiscord<Gumbercules> and your application won't most of the time
23:27:44FromDiscord<Gumbercules> there's two errors - recoverable errors and errors that are not recoverable
23:27:50FromDiscord<Gumbercules> it should be framed in this way
23:28:01FromDiscord<ElegantBeef> I really like exceptions cause it never enters user code unless they care
23:28:11FromDiscord<Gumbercules> and then you distinguish those by ones you consider exceptional and ones you don't
23:28:17FromDiscord<ElegantBeef> I do not care if a procedure can fail, just let me right code
23:28:25FromDiscord<ElegantBeef> (edit) "right" => "write"
23:28:29FromDiscord<Gumbercules> except once you know something raises you need to care
23:28:45FromDiscord<ElegantBeef> Except you're wrong
23:28:52FromDiscord<Gumbercules> I mean you don't need to explicitly handle the failure
23:29:01FromDiscord<Gumbercules> but you're going to know it could fail in this way which you might not really care about
23:29:04FromDiscord<inv> / 0 is pretty recoverable, but it panics if I remember correct
23:29:04FromDiscord<Gumbercules> you probably just care if it will fail or not
23:29:13FromDiscord<ElegantBeef> If you do not care it does not matter
23:29:26FromDiscord<Gumbercules> well it might matter, just not in the way it fials
23:29:26FromDiscord<ElegantBeef> <https://github.com/beef331/graffiti/blob/master/src/graffiti.nim> Is peak IDGAF Nim
23:29:29FromDiscord<Gumbercules> (edit) "fials" => "fails"
23:29:47FromDiscord<Gumbercules> generally if I need to parse a file I'm going to check if it exists
23:29:49FromDiscord<Gumbercules> I'm going to open it
23:29:53FromDiscord<Gumbercules> I'm going to try and parse it
23:29:55FromDiscord<ElegantBeef> I never check if a file exists
23:29:58FromDiscord<ElegantBeef> I just open it ๐Ÿ˜„
23:30:11FromDiscord<Gumbercules> and then you have to handle the exception and wrap the attempt in a try / catch
23:30:18FromDiscord<Gumbercules> and know that it needs to be wrapped in a try / catch
23:30:30FromDiscord<inv> In reply to @ElegantBeef "I really like exceptions": Apply the same for `exeption:` string - to not litter in the string with exception-types if not necessary ๐Ÿ˜‰
23:30:32FromDiscord<ElegantBeef> If i care i annotate `{.raises: [].}`
23:30:33FromDiscord<Gumbercules> vs just examining some result and telling your user, shit, I couldn't open this
23:30:40FromDiscord<Gumbercules> yeah I mean for librarry authors I get it
23:30:50FromDiscord<Gumbercules> for application developers, exceptions seem very silly most of the time
23:31:13FromDiscord<ElegantBeef> In reply to @inv "Apply the same for": Except it is necessary due to the choice of `except` catching defects
23:31:25FromDiscord<ElegantBeef> As long as `except` catches defect that's needed
23:31:30FromDiscord<Gumbercules> (edit) "librarry" => "library"
23:32:14FromDiscord<ElegantBeef> And changing the behaviour of a bare except would have been a massive silent breaking change
23:33:36FromDiscord<inv> @ElegantBeef loot at the PR: https://github.com/treeform/jsony/pull/58/files
23:33:42FromDiscord<inv> (edit) "loot" => "lool"
23:33:47FromDiscord<inv> (edit) "lool" => "look"
23:33:53FromDiscord<ElegantBeef> What about it?
23:34:06FromDiscord<inv> jsony: Fix BareExcept warnings on Nim
23:34:23FromDiscord<ElegantBeef> What am i supposed to be looking at i mean
23:34:48FromDiscord<inv> that the PR just looks stupid how the code looks
23:34:56FromDiscord<ElegantBeef> It doesnt look stupid
23:35:04FromDiscord<ElegantBeef> Like i said i do not do bare excepts
23:35:15FromDiscord<Gumbercules> Some good grammatical fixes in that PR
23:35:18FromDiscord<Gumbercules> I approve
23:35:38FromDiscord<inv> it is very stupid: you just write "default" meaning of `except` with more words
23:35:48FromDiscord<ElegantBeef> You're not going to win me over here
23:35:59FromDiscord<ElegantBeef> I already said i'd prefer bare except not accepting defects
23:36:09FromDiscord<ElegantBeef> It did and still does, so this is the best thing
23:37:32FromDiscord<ElegantBeef> If you really want to type less you can do `type Error = CatchableError` ๐Ÿ˜„
23:38:39FromDiscord<inv> why not: `except CatchableError:` => `except:`โ†ตand `except Defect` => `except Defect` , but there is long discussion behind it is it necessary or smth else is necessary
23:38:54FromDiscord<ElegantBeef> I said why
23:38:59FromDiscord<ElegantBeef> It'd be a silent breaking change
23:39:09FromDiscord<inv> In reply to @ElegantBeef "If you really want": Yep, I spent 10+ years programming APL-like language
23:39:37FromDiscord<inv> I do not want to type even "type Error = CatchableError"
23:39:42FromDiscord<inv> (edit) ""type" => "`type" | "CatchableError"" => "CatchableError`"
23:40:21FromDiscord<inv> (edit) "CatchableError`" => "CatchableError`, what is the reason is shold be default `except:`"
23:40:27*rockcavera quit (Read error: Connection reset by peer)
23:41:26FromDiscord<inv> and the next problem:โ†ตI still except that a lot of people will write `except CA, Defect` and, you will find it only in your prod after fail
23:41:36FromDiscord<inv> (edit) "fail" => "it fails"
23:41:46*rockcavera joined #nim
23:41:54FromDiscord<inv> (edit) "except" => "expect"
23:43:33FromDiscord<ElegantBeef> Look at this bold claim that i make prod code
23:44:03FromDiscord<ElegantBeef> What i write is barely counted as "code"
23:46:56FromDiscord<ElegantBeef> @Yepoleb damn a 1 hour turn around ๐Ÿ˜„
23:47:27NimEventerNew Nimble package! fungus - Rust-like tuple enums, see https://github.com/beef331/fungus
23:47:58FromDiscord<ElegantBeef> Hey inv you said you write Rust, know of any good simple ADT samples i can copy from ๐Ÿ˜„
23:51:12FromDiscord<Yepoleb> Wth why is beef on discord
23:51:20FromDiscord<Elegantbeef> Matrix bridge was being sloooow
23:51:28FromDiscord<Elegantbeef> Seems fine now
23:52:14FromDiscord<Yepoleb> Are you impressed by my speed at pressing a button?
23:52:20FromDiscord<Elegantbeef> Indeed, some of my packages took days iirc
23:55:18FromDiscord<Yepoleb> I actually even gave it a quick review
23:56:17FromDiscord<Elegantbeef> Damn you must make .2c/hr
23:57:21FromDiscord<Yepoleb> We greatly improved package acceptance time through the magic of finding someone who feels responsible
23:58:38FromDiscord<Elegantbeef> Do not lie there's a big man with a bat standing behind you
23:58:38FromDiscord<Yepoleb> Well, the first step was realizing everyone assumed someone else was doing the job