<< 10-12-2022 >>

00:00:02*neceve quit (Quit: ZNC - https://znc.in)
00:00:12*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
00:00:38*wallabra joined #nim
00:00:52*ltriant quit (Ping timeout: 268 seconds)
00:04:43*neceve joined #nim
00:05:02*neceve quit (Remote host closed the connection)
00:07:38*neceve joined #nim
00:08:01*neceve quit (Remote host closed the connection)
00:12:31FromDiscord<Rika> In reply to @Event Horizon "Or does `some("")` default": No, the point of options is to distinguish empty from none
00:22:39*neceve joined #nim
00:23:02*neceve quit (Remote host closed the connection)
00:27:00*ltriant joined #nim
00:33:11*ltriant quit (Ping timeout: 264 seconds)
00:37:40*neceve joined #nim
00:38:01*neceve quit (Remote host closed the connection)
00:41:42*neceve joined #nim
00:42:01*neceve quit (Remote host closed the connection)
00:50:43*neceve joined #nim
00:51:01*neceve quit (Remote host closed the connection)
00:59:46NimEventerNew Nimble package! snorlogue - A Prologue extension. Provides an admin environment for your prologue server making use of norm., see https://github.com/PhilippMDoerner/Snorlogue
01:00:16FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4ibm
01:01:11*neceve joined #nim
01:03:58*ltriant joined #nim
01:04:32FromDiscord<Elegantbeef> You need an object variant for that
01:09:52*ltriant quit (Ping timeout: 260 seconds)
01:15:47FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1050943876640297032/Peek_2022-12-09_20-13.mp4
01:17:01FromDiscord<albassort> 13% of all lines of code have spelling errors
01:17:47FromDiscord<Elegantbeef> Oh noes
01:23:49FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4ibr
01:24:36FromDiscord<! Nilts> I am turning the number into the nest level
01:25:31FromDiscord<Elegantbeef> make a constructor for your variant that takes in varargs and one that takes in an int
01:26:51FromDiscord<! Nilts> In reply to @Elegantbeef "make a constructor for": i don't understand, say i had a function, the first one would be the input and the last one would be the output
01:27:22FromDiscord<Elegantbeef> Well no clue what you want
01:28:34FromDiscord<! Nilts> In reply to @Elegantbeef "Well no clue what": turn a flat list into a nodetree based on the number.
01:29:00FromDiscord<Elegantbeef> Well you know what you need to do so attempt to do it
01:37:39FromDiscord<! Nilts> how do i walk through a nodetree?
01:38:47FromDiscord<Rika> Damn beef you really cranky today are ya
01:40:37FromDiscord<Rika> In reply to @not logged in "how do i walk": From a branch, you check each of the children if they’re a leaf or a branch, and you get the value and do whatever with it if it’s a leaf or enter that branch if it’s a branch, after that you exit that branch
01:40:54FromDiscord<Rika> Usually a recursive function is used for these
01:41:08FromDiscord<Elegantbeef> Not really cranky, just dont have the desire to pull a question from the ground
01:42:14*ltriant joined #nim
01:42:41FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4ibs
01:43:23FromDiscord<Rika> You make a function that takes a node in and acts on it like a branch; since your root node is a branch, to use the function you pass the root node
01:43:43FromDiscord<Rika> I can’t code for you
01:43:52FromDiscord<Rika> I literally can’t I’m on a phone lol
01:45:18NimEventerNew thread by RodSteward: How should system library support be structured?, see https://forum.nim-lang.org/t/9711
01:50:19FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4ibt
01:51:05FromDiscord<Rika> Almost, just wait I’ll say what to change
01:51:52FromDiscord<Rika> Actually yeah
01:51:55FromDiscord<Rika> That looks correct
01:52:06FromDiscord<! Nilts> (edit) "https://play.nim-lang.org/#ix=4ibt" => "https://play.nim-lang.org/#ix=4ibu"
01:52:28FromDiscord<Rika> maybe "iss: IndentStackSeq[T]"
01:52:45FromDiscord<Rika> And the f needs to have something to consume the value
01:52:48FromDiscord<Rika> Since you’re returning
01:54:00FromDiscord<! Nilts> In reply to @Rika "maybe "iss: IndentStackSeq[T]"": i removed the output of f
01:54:40FromDiscord<Rika> Should be fine then
01:54:53FromDiscord<Rika> In reply to @Rika "maybe "iss: IndentStackSeq[T]"": This still needed though
01:55:07FromDiscord<Horizon [She/Her]> In reply to @not logged in "Is there any structure": That looks horrid lmao
01:55:43FromDiscord<Horizon [She/Her]> In reply to @albassort "": Sounds like a skill issue :gigachad:
01:56:00*ltriant quit (Ping timeout: 246 seconds)
01:58:22FromDiscord<albassort> In reply to @Event Horizon "Sounds like a skill": dont make me go over there
01:58:43FromDiscord<Rika> In reply to @albassort "dont make me go": Can you even
01:58:47FromDiscord<Horizon [She/Her]> You don't know where I live ha
01:58:53FromDiscord<Horizon [She/Her]> In reply to @Rika "Can you even": Nope
02:02:54FromDiscord<! Nilts> UGGGh, i can't figure out this reverse flatten
02:05:32FromDiscord<albassort> In reply to @Event Horizon "You don't know where": i know a 200 km area
02:06:33FromDiscord<albassort> In reply to @Rika "Can you even": Financially? Yes but I wouldn't eat next month. Technically? No I lack a passport
02:06:50FromDiscord<Horizon [She/Her]> Lmao
02:33:04*ltriant joined #nim
02:45:17FromDiscord<Raynei486> is there a way to combine 4 `uint8` into one `uint32`?
02:48:25arkanoiddo you know if doing "if foo in 0..10" is slower than "if foo >= 0 and foo <= 10" ?
02:51:03FromDiscord<Horizon [She/Her]> In reply to @Raynei486 "is there a way": Probably messing with pointers?
02:51:52FromDiscord<jtv> sent a code paste, see https://play.nim-lang.org/#ix=4ibB
02:52:27FromDiscord<Horizon [She/Her]> In reply to @jtv "<@733059160924749855> Of course, there": Is that because of how endianness works?
02:52:39FromDiscord<jtv> If they're already laid out in memory together, a cast and potentially a byte swap will do the trick
02:52:46FromDiscord<jtv> Yeah, that's one of the gotchas
02:52:58FromDiscord<jtv> The other is alignment issues, depending on archetecture
02:53:04FromDiscord<Horizon [She/Her]> Ah fair
02:53:07FromDiscord<jtv> Tho these days that's not as big a deal
02:53:12FromDiscord<Raynei486> In reply to @jtv "If they're already laid": I guess they are?↵It's a `seq` of `uint8`
02:54:00FromDiscord<jtv> You're probably better off just doing the shifts, it's faster than the multiply 😉
02:55:21FromDiscord<Horizon [She/Her]> There's likely a solution out there for doing this that takes endianness into account
02:55:49FromDiscord<Horizon [She/Her]> I guess one solution is to convert all of them into one endian, and then convert it back into the endian of the system you're currently on?
02:56:13FromDiscord<jtv> sent a code paste, see https://play.nim-lang.org/#ix=4ibD
02:56:19FromDiscord<jtv> With proper casting thrown in
02:56:19FromDiscord<Horizon [She/Her]> Ah
02:56:29FromDiscord<jtv> You have to cast each int8 to an int32
02:56:41FromDiscord<jtv> But that makes it a little less clear 🙂
02:56:48FromDiscord<Horizon [She/Her]> Yeah haha fair
02:57:02*ltriant quit (Ping timeout: 256 seconds)
02:57:44FromDiscord<Raynei486> I'll try to see if there's another approach that doesn't involve converting `uint8` and `uint32`↵But still thanks guys
02:57:54FromDiscord<jtv> Why is that an issue??
02:57:57FromDiscord<jtv> That is free
02:58:10FromDiscord<jtv> It's just telling the compiler you know what you're doing, you're not making a type error
02:58:30FromDiscord<jtv> I know every way you could reasonably do it, and that is the best general purpose way 🙂
02:58:30FromDiscord<Raynei486> No I'm not worrying about that
02:58:58FromDiscord<Raynei486> I feel like it's just better if I can avoid casting at all 😄
02:59:13FromDiscord<Raynei486> parsing files be like...
02:59:34FromDiscord<jtv> Casting isn't a runtime thing here. The language makes you cast for size conversions to prevent unexpected errors
02:59:45FromDiscord<jtv> More so than many other languages that would automatically promote
02:59:53*ltriant joined #nim
03:00:02*neceve quit (Quit: ZNC - https://znc.in)
03:00:03FromDiscord<jtv> But again, it's all going to happen in the compiler, not when your code is running
03:01:00FromDiscord<jtv> In fact, llvm is smart enough that it knows whether those four bytes are next to each other in the array, and will just do a single LOAD instruction if that's the cheapest thing on the archtecture
03:02:02FromDiscord<jtv> You would even end up w/ the same code w/ the multiply approach, very obvious strength reduction compilers have done well for 30 years
03:03:40*neceve joined #nim
03:04:03*neceve quit (Remote host closed the connection)
03:04:24FromDiscord<jtv> Seriously, would love to understand why you think it's not a good approach
03:06:59*ltriant quit (Ping timeout: 260 seconds)
03:21:21FromDiscord<albassort> q:
03:21:33FromDiscord<albassort> if i have a module which runs code, when its imported, that code runs
03:21:47FromDiscord<albassort> but what happens if that module is imported multiple times
03:22:06FromDiscord<albassort> does that code run every time its imported or just the once
03:22:45FromDiscord<adsspottipsusa> I'll help the community how earn $30k within 3 days and hours but you will reimburse me 10% of your dividend when you collect it. Note\: only interested people should involve. Whatsapp +1 (209) 876-7868 immediately.
03:23:19FromDiscord<jtv> It only ever runs once
03:23:24FromDiscord<albassort> @Yardanico
03:23:49FromDiscord<albassort> <@&371760044473319454>
03:24:59FromDiscord<albassort> In reply to @jtv "It only ever runs": https://tenor.com/view/the-simpsons-mr-burns-evil-laugh-evil-laugh-gif-4076853
03:28:46*wallabra quit (Ping timeout: 256 seconds)
03:36:42*neceve joined #nim
03:37:01*neceve quit (Remote host closed the connection)
03:44:38*neceve joined #nim
03:45:02*neceve quit (Remote host closed the connection)
03:46:32*ltriant joined #nim
03:52:16*wallabra joined #nim
03:52:34*ltriant quit (Ping timeout: 256 seconds)
03:56:43*neceve joined #nim
03:56:59FromDiscord<albassort> this is a dumb idea i had
03:57:01*neceve quit (Remote host closed the connection)
03:57:38FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4ibJ
03:57:53FromDiscord<Rika> ?
03:57:59FromDiscord<Rika> Just don’t have the clause at the end
03:58:06FromDiscord<Rika> Or huh
03:58:10FromDiscord<Rika> Okay why though
03:58:28FromDiscord<albassort> because the alternative is
03:58:42FromDiscord<Rika> That doesn’t make sense because that’s not what finally means
03:58:55FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4ibK
04:00:12FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4ibL
04:00:16FromDiscord<Rika> In reply to @Rika "That doesn’t make sense": See
04:00:24FromDiscord<albassort> ok pick a different word
04:00:33FromDiscord<Rika> It’s not my idea
04:00:34FromDiscord<albassort> finally is like the closest i could think of
04:00:38*neceve joined #nim
04:01:20FromDiscord<Elegantbeef> Aremt you just describing a case statement?
04:01:40FromDiscord<Rika> No, he wants the new clause to trigger when any of the if statements do
04:01:48FromDiscord<Rika> So technically but no
04:01:58FromDiscord<Elegantbeef> Set a flag and trigger
04:02:13FromDiscord<Rika> Prolly doesn’t want to do that
04:02:18FromDiscord<albassort> thats the worst of all worlds
04:02:54FromDiscord<Rika> Really just use another if clause
04:03:24FromDiscord<albassort> that extra variable annoys me
04:03:38FromDiscord<Elegantbeef> So then use a proc and call it at the end of all your branches
04:04:07FromDiscord<Rika> Make a macro that does it
04:05:06FromDiscord<albassort> macros scary and needless
04:05:23FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4ibN
04:15:56*ltriant joined #nim
04:24:20*ltriant quit (Ping timeout: 246 seconds)
04:42:03*rockcavera quit (Remote host closed the connection)
04:43:37FromDiscord<Cheeseinator> Is it possible to get Nim syntax highlighting for LaTeX?
04:55:15FromDiscord<Rika> Perhaps create one manually in listings?
04:55:26FromDiscord<Rika> Or use those other packages I’m not familiar with
05:02:00*arkurious quit (Quit: Leaving)
05:02:23*ltriant joined #nim
05:07:24*ltriant quit (Ping timeout: 264 seconds)
05:51:13*ltriant joined #nim
05:55:56*ltriant quit (Ping timeout: 260 seconds)
06:00:02*neceve quit (Quit: ZNC - https://znc.in)
06:08:39*neceve joined #nim
06:09:01*neceve quit (Remote host closed the connection)
06:17:59*wallabra_ joined #nim
06:19:30*wallabra quit (Ping timeout: 268 seconds)
06:19:31*wallabra_ is now known as wallabra
06:19:33*wallabra is now known as wallabra_
06:19:42*wallabra_ is now known as wallabra
06:20:27*xet7 quit (Ping timeout: 248 seconds)
06:24:24FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4ic2
06:25:20FromDiscord<albassort> that is an interesting way to do that
06:25:56FromDiscord<albassort> i think that is pretty unreadable for most people though
06:25:59FromDiscord<albassort> it took me a bit
06:26:04FromDiscord<emanresu3> I like that Nim's expressions work like that
06:26:21FromDiscord<emanresu3> yeah kind of↵(@albassort)
06:27:27FromDiscord<albassort> doesn't work here though
06:28:00FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4ic3
06:29:07FromDiscord<albassort> completely disconnected conditions
06:33:12*xet7 joined #nim
06:38:40*neceve joined #nim
06:39:01*neceve quit (Remote host closed the connection)
06:39:04FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4ic4
06:39:30FromDiscord<emanresu3> but that continue tells me you're looping and that wouldn't exactly work
06:40:42*vicecea quit (Remote host closed the connection)
06:42:12*vicecea joined #nim
06:44:13FromDiscord<emanresu3> But maybe just write it as a template, but then again you would instead need to save the boolean in a flag variable
06:50:42*neceve joined #nim
06:51:02*neceve quit (Remote host closed the connection)
06:54:56FromDiscord<emanresu3> wait, but do you want the `continue` to be run only for the first condition but only after the "`finally`-like" clause?↵(@albassort)
07:00:02FromDiscord<ShalokShalom> Emanresu3: Did you see the nice forums post they did about nim-pipexp?↵↵People are loving it 😊
07:00:23*neceve joined #nim
07:00:36FromDiscord<ShalokShalom> Do you want to push the composition arrows also to nimble?↵↵I could do that then also?
07:02:14FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4icc
07:02:41FromDiscord<emanresu3> Hi @ShalokShalom I saw this one https://forum.nim-lang.org/t/9708↵(@ShalokShalom)
07:03:26FromDiscord<ShalokShalom> Yep
07:03:58FromDiscord<emanresu3> I'm glad people like it, as a shell scripter, it's the main feature I missed in python
07:04:44FromDiscord<ShalokShalom> Oh, I see 🙂
07:05:14FromDiscord<ShalokShalom> Python has a quite nice library, that makes many of those features possible too
07:05:37FromDiscord<emanresu3> Maybe, but I don't think it's very ready yet, I don't use composition very often so maybe one would inmediately find problems with it? Like not working with overloaded procs↵(@ShalokShalom)
07:05:42FromDiscord<ShalokShalom> Will update the library on Github and Nimble, once I am at a computer.
07:06:01FromDiscord<ShalokShalom> In reply to @emanresu3 "Maybe, but I don't": Ok, then let us wait 🙂
07:06:21FromDiscord<emanresu3> That would awesome thanks
07:07:45FromDiscord<emanresu3> I'm working on unpacking the placeholder in the pipexp repo, and maybe do expressions and lambdas like R's magrittr which is better syntax I think
07:10:18FromDiscord<ShalokShalom> I personally always thought => should be an anonymous func
07:10:23FromDiscord<ShalokShalom> Not a proc
07:11:21FromDiscord<ShalokShalom> That one is the library I meant:↵https://github.com/cognitedata/Expression
07:11:51FromDiscord<ShalokShalom> As you can see, they added it the same way, as you added the macro, syntax wise 🙂
07:12:45FromDiscord<ShalokShalom> This library is used by Fable, to convert F# code into Python, or a copied subset of it at least. 🙂
07:14:32FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4icd
07:15:01FromDiscord<Elegantbeef> `static seq[T]`
07:15:08FromDiscord<Elegantbeef> or in devel `static openarray[T]`
07:18:17FromDiscord<emanresu3> But I'd need to know the seq's contents at compile time right?
07:19:13FromDiscord<Elegantbeef> Correct
07:19:19FromDiscord<Elegantbeef> Otherwise you could just use a proc or template
07:19:29FromDiscord<emanresu3> That wouldn't work because the macro would call a proc at runtime from the left-hand side
07:20:52FromDiscord<Elegantbeef> You need to know how many parameters to supply at CT
07:20:56FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4ice
07:21:31FromDiscord<emanresu3> I got it to work for array literals of course, but I see that it wouldn't work for seq's I don't think
07:22:15FromDiscord<emanresu3> This looks cool! I'll definitely take a look↵(@ShalokShalom)
07:36:13*ltriant joined #nim
07:53:25*ltriant quit (Ping timeout: 260 seconds)
08:25:56*ltriant joined #nim
08:30:37*ltriant quit (Ping timeout: 256 seconds)
08:40:59FromDiscord<ShalokShalom> In order to update a package, that I already published to nimble, just run nimble publish again?
08:41:18FromDiscord<Rika> I don’t think so
08:41:35FromDiscord<ShalokShalom> Uhh
08:41:51FromDiscord<ShalokShalom> I refreshed my token and now is Nimble complaining
08:42:15FromDiscord<ShalokShalom> Ah, found the documentation: https://github.com/nim-lang/packages#releasing-a-new-package-version
08:42:36FromDiscord<ShalokShalom> Looked for the command, like `update`
08:44:20FromDiscord<ShalokShalom> Uff, I do not think, I have that .nimble file still laying around
08:50:27FromDiscord<ShalokShalom> Do they mean a .nimble file thats created, when I initially `nimble publish`?
09:00:02*neceve quit (Quit: ZNC - https://znc.in)
09:02:40NimEventerNew thread by brendo-m: Cargo like subcommands in Nimble, see https://forum.nim-lang.org/t/9712
09:09:02FromDiscord<emanresu3> Btw my tags weren't prefixed with 'v', I'll fix that right now, the version in the .nimble did change↵(@ShalokShalom)
09:11:17FromDiscord<ShalokShalom> Ah, I am blind 😅
09:12:41*neceve joined #nim
09:13:01*neceve quit (Remote host closed the connection)
09:13:25FromDiscord<ShalokShalom> Considering that its your Codeberg URL, that is in the /packages directory, am I right that you can push updates on your own?
09:14:11*pro joined #nim
09:15:37FromDiscord<emanresu3> Uhm, I don't know, exactly? So you're saying that nimble packaging information updates itself? I thought I would have been another PR on github, or no?
09:15:41*neceve joined #nim
09:16:01*neceve quit (Remote host closed the connection)
09:16:06FromDiscord<Elegantbeef> The nim package registry doesnt track versions
09:16:15FromDiscord<Elegantbeef> It's just a list of git urls that one can use `nimble install packageName` with
09:17:41*pro left #nim (#nim)
09:18:23FromDiscord<ShalokShalom> I think you can edit both the nimble file and the tag on Codeberg
09:18:38FromDiscord<emanresu3> Oh, I see, then if I do `nimble install pipexp` I already get the latest version on my repo right?, there's no nimble update or PR on github necessary?
09:18:38FromDiscord<Elegantbeef> Correct
09:18:43FromDiscord<Elegantbeef> Nimble is a decentralised package manager
09:18:49FromDiscord<Elegantbeef> It just has a hard coded default package registry
09:19:27FromDiscord<emanresu3> That's great, and versions are tracked with git tags correct?
09:19:39FromDiscord<Elegantbeef> Or semver in your nimble file
09:19:44*neceve joined #nim
09:20:01*neceve quit (Remote host closed the connection)
09:20:15FromDiscord<Elegantbeef> When you \`requires "myNimblePkg \> 0.1.0" it gets the first commit that matches that afaik
09:20:55FromDiscord<ShalokShalom> I am so stupid
09:21:06FromDiscord<ShalokShalom> I named it pipexp and not nim-pipexp
09:21:15FromDiscord<ShalokShalom> Searches for nim-pipexp now fail
09:21:56FromDiscord<Elegantbeef> Putting Nim i nthe name is silly anyway
09:22:06FromDiscord<ShalokShalom> I could rename that later. Personally, I like pipexp also more
09:22:23FromDiscord<ShalokShalom> Then, I suggest to rename it to pipexp everywhere 🙂
09:22:31FromDiscord<Elegantbeef> It's like going to a screw isle of a hardware store and asking for a "screw"
09:22:38FromDiscord<ShalokShalom> Yeah, sure
09:22:40FromDiscord<Elegantbeef> Well you're in the right place what do you expect
09:22:44FromDiscord<emanresu3> Awesome, then it's done I think. One final question could nimble get the information of `packages.json` from my packages repo?
09:22:46FromDiscord<ShalokShalom> I personally think so as well
09:23:12FromDiscord<Elegantbeef> Do you mean you can author a custom package registry?
09:23:22FromDiscord<emanresu3> I agree, I just put that prefix for my own codeberg account, but the nimble name is just pipexp
09:23:47FromDiscord<Elegantbeef> you cannot ship a package.json with your package but you can make your own registry
09:24:06FromDiscord<ShalokShalom> If I understood you right, nimble search pipexp shows you the details of your packages.json
09:24:16FromDiscord<ShalokShalom> So I guess yes.
09:25:06FromDiscord<ShalokShalom> The forum does not recognize my username anymore.
09:25:24FromDiscord<ShalokShalom> I am actually looking at a post, that I made that is showing the correct one.
09:25:30FromDiscord<emanresu3> Not sure if that's called authoring, just if later I'd like change the description a bit, just take it from the .nimble in the URL
09:25:32FromDiscord<ShalokShalom> It is not even possible, to restore password.
09:28:41FromDiscord<emanresu3> Well no, I see as tags "functional, pipeline, composition", but in my repo, there are other tags↵(@ShalokShalom)
09:35:11FromDiscord<ShalokShalom> In reply to @emanresu3 "Well no, I see": Oh, I see. Yeah, they are living in packages
09:35:18FromDiscord<ShalokShalom> Kinda weird, how this is split
09:35:44FromDiscord<ShalokShalom> I will sync this at home
09:36:02FromDiscord<ShalokShalom> Just on my way
09:52:27*ltriant joined #nim
09:56:40*neceve joined #nim
09:57:01*neceve quit (Remote host closed the connection)
09:58:09*ltriant quit (Ping timeout: 260 seconds)
10:01:11*neceve joined #nim
10:11:59*kenran joined #nim
10:13:45*kenran quit (Remote host closed the connection)
10:21:42NimEventerNew post on r/nim by aphkyle: How should one start a GUI library, see https://reddit.com/r/nim/comments/zhp0o0/how_should_one_start_a_gui_library/
10:29:12*ltriant joined #nim
10:33:46*ltriant quit (Ping timeout: 256 seconds)
10:51:58*ltriant joined #nim
10:59:44FromDiscord<a weird programmer> Hello, are pointers optional in nim? as in if i keep the GC i wont have to use pointers correct?
11:02:58FromDiscord<Bung> yes
11:04:22FromDiscord<Bung> in common you will use it when your project depends on c wrapper
11:05:41FromDiscord<a weird programmer> hm so the GC doesnt work well with C wrappers or it doesnt work at all?
11:10:42FromDiscord<Phil> So I have a proc with this signature:↵`func toFormField[T: range](value: Option[T], fieldName: string): FormField =`↵It apparently gets picked when T is a string.↵Which... I don't get, how is string a range?
11:11:24FromDiscord<Phil> What flabbergasts me more, the some context has this overload also around:↵`func toFormField(value: Option[string], fieldName: string): FormField = `↵And the range version gets picked over the string version
11:11:46FromDiscord<Phil> (edit) "What flabbergasts me more, the some context has this overload also around:↵`func toFormField(value: Option[string], fieldName: string): FormField = `↵And the ... range" added "generic"
11:11:52FromDiscord<Phil> (edit) "What flabbergasts me more, the some context has this overload also around:↵`func toFormField(value: Option[string], fieldName: string): FormField = `↵And the generic range version gets picked over the ... string" added "explicit"
11:18:24FromDiscord<j-james> wondering - how can i declare a function that takes an array of mutable objects?
11:19:49FromDiscord<j-james> whenever i iterate through it the compiler seems to treat the objects as immutable
11:20:56FromDiscord<j-james> er, what? weird
11:21:33FromDiscord<j-james> shadowing the object worked
11:22:52FromDiscord<j-james> cool that was just me forgetting how ref types work 🤦
11:24:12*ltriant quit (Ping timeout: 256 seconds)
11:43:51FromDiscord<ravinder387> what's the purpose of ismainModule() function
11:45:09FromDiscord<.tochka> In reply to @ravinder387 "what's the purpose of": its a definition, to know when module is compiled as entry or imported
11:46:34FromDiscord<ravinder387> # file.nim
11:46:43FromDiscord<ravinder387> sent a long message, see http://ix.io/4id0
11:47:11FromDiscord<ravinder387> so entry will begin with addTwoInteger() proc
11:47:35FromDiscord<ravinder387> when file.nim compiled to binary
11:48:33FromDiscord<.tochka> if you do `nim c file.nim` then code under when will be executed, but if you do `nim c otherFile.nim` that imports `file.nim`, then when will be ignored
11:51:15FromDiscord<ravinder387> In reply to @.tochka "if you do `nim": thanks dude
11:51:24FromDiscord<MetuMortis> In reply to @ravinder387 "what's the purpose of": It is like name == "main" in Python
11:51:35FromDiscord<MetuMortis> (edit) "name" => "`name" | ""main"" => ""main"`"
12:00:02*neceve quit (Quit: ZNC - https://znc.in)
12:01:13*junaid_ joined #nim
12:06:24*ltriant joined #nim
12:10:16FromDiscord<Horizon [She/Her]> How would i parse a ISO8601 date in Nim? Does the `times` module have a way to do it?
12:10:57FromDiscord<MetuMortis> In reply to @Patitotective "is there a nim": @Horizon [She/Her]
12:11:14*ltriant quit (Ping timeout: 256 seconds)
12:11:32FromDiscord<Horizon [She/Her]> ah alright, thanks aha
12:12:06FromDiscord<MetuMortis> 😄
12:13:49*neceve joined #nim
12:14:02*neceve quit (Remote host closed the connection)
12:17:51*neceve joined #nim
12:18:02*neceve quit (Remote host closed the connection)
12:21:40*neceve joined #nim
12:22:02*neceve quit (Remote host closed the connection)
12:26:48FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4id9
12:26:58FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4id9" => "https://play.nim-lang.org/#ix=4ida"
12:28:06FromDiscord<Phil> It's not even consistent on where it breaks, just 90% chance it breaks during this step
12:28:56FromDiscord<Phil> I just rebooted the machine as well, so at least it's no holdover from having installed updates on arch but not yet having rebooted
12:31:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4idd
12:32:35FromDiscord<Phil> Nimibook also is sometimes randomly working for specific pages and sometimes not, the hell is going on
12:33:19*jmdaemon quit (Ping timeout: 260 seconds)
12:33:51*junaid_ quit (Remote host closed the connection)
12:39:07FromDiscord<hotdog> Looks like you have a flaky connection to GitHub @Phil
12:39:14FromDiscord<hotdog> Could be your end or theirs
12:39:46FromDiscord<hotdog> https://www.githubstatus.com
12:40:44FromDiscord<Horizon [She/Her]> How would i use an enum to convert string values to it's appropriate value?
12:41:30FromDiscord<Horizon [She/Her]> I have a `Privacy` enum with `Public="public", Private="private"` as the values, was wondering if there's a built-in conversion method
12:41:33FromDiscord<hotdog> In reply to @Event Horizon "How would i use": https://nim-lang.org/docs/strutils.html#parseEnum%2Cstring
12:43:00FromDiscord<Horizon [She/Her]> Ah thanks!
12:43:41FromDiscord<Phil> In reply to @hotdog "Looks like you have": That problem appears to have reduced.
12:44:01FromDiscord<Phil> Though now somehow toml_serialization is completely blocking my usage of nimibooks↵> Error: unhandled exception: cannot open: /home/philipp/.nimble/pkgs/toml_serialization-0.2.0/toml_serialization.nim [IOError]
12:44:51*crem joined #nim
12:45:42*ltriant joined #nim
12:45:47FromDiscord<Phil> Which is a 1.6.10 specific issue
12:46:51FromDiscord<ringabout> In reply to @Isofruit "Though now somehow toml_serialization": Use refc?
12:48:01FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4idi
12:48:25FromDiscord<Phil> Pretty much. The issue is that it's for some reason that I do not understand looking specifically for 0.2.0
12:48:29FromDiscord<Phil> I only have 0.2.3 though
12:48:32FromDiscord<Phil> And I can not install 0.2.0
12:52:40FromDiscord<ringabout> In reply to @Isofruit "I only have 0.2.3": What's inside your `toml_serialization-0.2.3` directory?
12:53:17FromDiscord<ringabout> Is there a `0.2.0` directory in the `/home/philipp/.nimble/pkgs/`?
12:54:23FromDiscord<Phil> There is no 0.2.0 dir in my packages.↵Inside the 0.2.3 is this: https://media.discordapp.net/attachments/371759389889003532/1051119687955652708/image.png
12:55:14FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4idk
12:55:18*Guest92 joined #nim
12:55:41Guest92is anyone online here?
12:57:08FromDiscord<Phil> Quite a fair amount of folks are
12:57:24Guest92are you from discord?
12:57:30FromDiscord<Phil> Aye
12:57:42Guest92how do you see my messages? does a bot send them?
12:57:58FromDiscord<Phil> IRC, Matrix and discord are bridged to one another
12:58:00FromDiscord<Phil> No idea who set that up
12:58:07Guest92oh interesting
12:58:45*Guest92 quit (Client Quit)
12:59:11*Guest92 joined #nim
12:59:43*Guest92 quit (Client Quit)
13:01:20FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4ido
13:03:52FromDiscord<Phil> What exactly does one need to do a proper package update?↵So far I was under the impression its:↵1) Add a git tag ala "git tag v1.0.1"↵2) Update the nimble file
13:03:56FromDiscord<Phil> Is there anything else?
13:04:17Zevvhey ringabout; have we met?
13:11:16FromDiscord<ringabout> In reply to @Zevv "hey ringabout; have we": Hey, I have been around three years in the Nim community. So yes
13:11:48FromDiscord<ringabout> I changed my account name from "flywind" to "ringabout"
13:12:28FromDiscord<ringabout> In reply to @Isofruit "What exactly does one": I do it in the reverse order.
13:12:53FromDiscord<ringabout> Firstly update the nimble version, then tag the commit.
13:15:38FromDiscord<ringabout> In reply to @ringabout "I changed my account": If that can ring a bell.
13:15:39Zevvah flywind, cool \o/
13:15:50Zevvaka xflywind
13:16:26FromDiscord<ringabout> haha, yeah
13:20:20FromDiscord<Phil> Given he is ringabout now he is rather ex-xflywind
13:20:48FromDiscord<Phil> 👉 👉
13:25:39NimEventerNew thread by Isofruit: Snorlogue - A prologue extension, see https://forum.nim-lang.org/t/9713
13:26:16FromDiscord<Phil> Alrighty, and with this I have been productive for the weekend
13:26:31FromDiscord<ringabout> @Phil Congrats! Btw, the Nim forum supports picture.
13:26:38FromDiscord<ringabout> (edit) "@Phil ... Congrats!" added ""
13:28:22FromDiscord<ringabout> There shall be a link to `Snorlogue` I think.
13:28:56FromDiscord<Phil> Just added it in, as for pictures I guess I could link the ones I already uploaded to imgur
13:29:55FromDiscord<ringabout> https://forum.nim-lang.org/t/9457
13:30:12FromDiscord<ringabout> I don't know how they do this though, I didn't used this feature before.
13:31:31FromDiscord<Phil> The syntax is fairly easy, I'm just not sure about the format because it doesn't appear to resize the image
14:06:50*ltriant quit (Ping timeout: 256 seconds)
14:24:44FromDiscord<Horizon [She/Her]> Trying to switch over to `vim` instead of `nano`
14:25:57FromDiscord<rakgew> micro might be another alternative
14:27:18FromDiscord<Horizon [She/Her]> May look at that after tbh... Just hope there's Nim support
14:33:41FromDiscord<MetuMortis> In reply to @Event Horizon "Trying to switch over": I'd have a look to Neovim
14:33:49FromDiscord<MetuMortis> Specifically astro nvim
14:36:03FromDiscord<Horizon [She/Her]> In reply to @MetuMortis "I'd have a look": That's what i was looking at haha
14:36:08FromDiscord<Horizon [She/Her]> In reply to @MetuMortis "Specifically astro nvim": May try it later
14:45:30FromDiscord<rakgew> nim with micro is actually nice. no setup needed.
14:46:05FromDiscord<rakgew> does syntax coloring and on-save check out of the box.
14:46:55FromDiscord<rakgew> advanced things can be done with lua extensions.
15:18:45arkanoidfastest way to round a float32 to int?
15:19:03arkanoidmath.round(mtFloat).int, is it?
15:24:00Amun-Raor a good old way: int xf + 0.5
15:34:39FromDiscord<MetuMortis> In reply to @Isofruit "There is no 0.2.0": How do you compile a project like that (multi module project) does it include all nim files in executable?
15:36:00FromDiscord<Horizon [She/Her]> In reply to @rakgew "advanced things can be": Nice!
15:37:06FromDiscord<Phil> In reply to @MetuMortis "How do you compile": In what sense do you mean?↵You typically just run the compile command against your projects main nim file (in my case `snorlogue.nim`), that'll lead to the compilation of all imported modules from there as well, which leads to the compilation of all modules from those modules etc. until everything is compiled and then gets statically linked against one another
15:37:31FromDiscord<Phil> It's not really different from compiling a single-module-project in practice
15:38:14FromDiscord<Horizon [She/Her]> Also, does anyone know of a library i could use for printing markdown in Nim?
15:39:47arkanoidAmun-Ra: k
15:54:46*ltriant joined #nim
15:59:40FromDiscord<MetuMortis> In reply to @Isofruit "It's not really different": Thanks a lot for the explanation
16:00:43*ltriant quit (Ping timeout: 248 seconds)
16:06:50*anddam left #nim (WeeChat 3.7.1)
16:13:27FromDiscord<ShalokShalom> In reply to @Isofruit "Alrighty, and with this": Quite my spirit 😄
16:13:49FromDiscord<ShalokShalom> In reply to @Event Horizon "Also, does anyone know": Printing markdown?
16:24:33NimEventerNew Nimble package! strides - Strided indexing and slicing with a step, see https://github.com/fsh/strides
16:28:30FromDiscord<Horizon [She/Her]> In reply to @ShalokShalom "Printing markdown?": Into the terminal yeah
16:31:13*ltriant joined #nim
16:36:12*ltriant quit (Ping timeout: 264 seconds)
16:56:05*pro joined #nim
16:56:27*pro left #nim (#nim)
17:13:29FromDiscord<Hamid_Bluri> I encountered to a stupid error where the async proc cannot continue after `except` block
17:14:22FromDiscord<Hamid_Bluri> I don't know why, it just says `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`
17:15:02FromDiscord<Hamid_Bluri> even the `finally` block is not executed
17:39:26FromDiscord<Gumbercules> That's a segmentation fault
17:39:43FromDiscord<Gumbercules> You tried to read invalid memory somewhere
18:20:14*arkanoid quit (Remote host closed the connection)
18:20:31*arkanoid joined #nim
18:28:24*arkanoid quit (Ping timeout: 268 seconds)
18:30:20FromDiscord<Hamid_Bluri> no, seems like `asyncCheck` have some problems in `except` branch, no problem with `discard await ...`
18:32:41FromDiscord<Hamid_Bluri> I'm still investigating
19:15:22FromDiscord<Phil> sent a long message, see http://ix.io/4ifE
19:15:40FromDiscord<Phil> If you can be certain that your seq[string] consists of strings that are individual characters, you can do by just going `str[0]`
19:20:48FromDiscord<lobsang2> In reply to @Isofruit "If you can be": Thanks! Solves the first problem. Can you help me understand why ord("A") won't work, but ord('A') does?
19:20:53FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4ifH
19:21:28FromDiscord<Phil> In reply to @lobsang2 "Thanks! Solves the first": 'A' is a single character. ↵"A" is a string, basically an array of characters containing 1 character
19:22:08FromDiscord<Phil> It's kind of the difference between `5` and `@[5]` , one is just an int, the other is a sequence of integers that just happens to be 1 entry long
19:22:31FromDiscord<lobsang2> Gotcha!
19:23:29FromDiscord<Horizon [She/Her]> Is it better for a `property=` method to return a new object, or to update the existing object? (It's bound to an API, so)
19:23:49FromDiscord<Phil> What does property= do?
19:23:54FromDiscord<Phil> Does it set a value?
19:24:40FromDiscord<Horizon [She/Her]> Yup, but thinking about it now, it's probably better to make the object itself mutable, and then allow the user to update the object themselves via `pk.system("id") = systemObjectWithChanges`
19:25:15FromDiscord<Phil> My next question would've basically been whether it's a ref type or not, because for ref type I'd expect mutation of the existing object
19:25:21FromDiscord<Phil> for value types I'd expect the copy
19:25:34FromDiscord<Horizon [She/Her]> It's not a ref type no
19:25:48FromDiscord<Phil> You might want to ask others what their expectation would be for the given type, but I'd generally write the code around what the expectation would be if the reader knows the given type
19:25:53FromDiscord<Horizon [She/Her]> Hm fair, there's many properties though so getting a new object for every change sounds a bit redundant haha
19:26:01FromDiscord<Horizon [She/Her]> Yeah that's fair, thanks!
19:26:28FromDiscord<Phil> In reply to @Event Horizon "Hm fair, there's many": If you want to mutate the same thing a bunch that sounds like a case for a ref-type to me ^^
19:27:22FromDiscord<Horizon [She/Her]> What's the point of a ref type? The only thing I've used them for is for storing them in a list so i can get the original type with it's values still there
19:27:58ehmryref types are necessary if a type is recursive
19:28:43FromDiscord<Horizon [She/Her]> It's not recursive so i see no issue in this situation really
19:31:03FromDiscord<Phil> sent a long message, see http://ix.io/4ifK
19:31:29FromDiscord<Phil> (edit) "http://ix.io/4ifK" => "http://ix.io/4ifL"
19:31:44FromDiscord<Phil> (edit) "http://ix.io/4ifL" => "http://ix.io/4ifM"
19:31:45FromDiscord<Horizon [She/Her]> Chrono's `parseIsoTs` can't parse `2020-01-12T02:00:33.387824Z` but https://dencode.com/en/date/iso8601 can h,
19:32:34FromDiscord<Horizon [She/Her]> In reply to @Isofruit "To me generally I": Hm fair, thanks!
19:32:38FromDiscord<Horizon [She/Her]> (edit) "h," => "hm"
19:35:05*arkanoid joined #nim
19:44:02FromDiscord<Horizon [She/Her]> In reply to @Event Horizon "Chrono's `parseIsoTs` can't parse": Created an issue for it on the repo: https://github.com/treeform/chrono/issues/7
19:47:49FromDiscord<Horizon [She/Her]> @treeform sorry for the ping aha, just wondering why this wasn't acknowledged before?
19:47:59FromDiscord<Horizon [She/Her]> (the format, that is)
19:48:26FromDiscord<Horizon [She/Her]> And is there a workaround i can use? Not sure how to preserve the milliseconds with `parseTs`
20:02:41FromDiscord<treeform> that looks like it should work
20:04:33FromDiscord<treeform> I can confirm is get that as well
20:06:51FromDiscord<treeform> It looks like I don't have the code to parse the seconds
20:08:15FromDiscord<Horizon [She/Her]> Using inim with this code also gives me this error: `var myTs = parseTs("{year/4}-{month/2}-{day/2}T{hour/2}:{minute/2}:{second/2}.{secondFraction/3}Z", "2020-01-12T02:00:33.387824Z")`↵`var myTs = parseTs("{year/4}-{month/2}-{day/2}T{hour/2}:{minute/2}:{second/2}.{secondFraction/3}Z", "2020-01-12T02:00:33.387824Z")`
20:09:25FromDiscord<Horizon [She/Her]> (edit) ""2020-01-12T02:00:33.387824Z")`↵`var myTs = parseTs("{year/4}-{month/2}-{day/2}T{hour/2}:{minute/2}:{second/2}.{secondFraction/3}Z", "2020-01-12T02:00:33.387824Z")`" => ""2020-01-12T02:00:33.387824Z")`↵`/home/horizon/.nimble/pkgs/chrono-0.3.0/chrono/calendars.nim(667) parseCalendar`"
20:09:37FromDiscord<Horizon [She/Her]> Edited the error in, didn't copy it before
20:13:00FromDiscord<Horizon [She/Her]> Ah, my bad
20:13:02FromDiscord<treeform> In reply to @Event Horizon "Using inim with this": I found not 1 but two issues, here is the work around:
20:13:10FromDiscord<Horizon [She/Her]> `secondFraction` only, not `/6`
20:13:29FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=4ifY
20:13:52FromDiscord<treeform> Bug 1 `parseIsoTs` should also do optional second fraction
20:14:15FromDiscord<treeform> Bug 2 converting ts to a calendar (how all formatting works)... forgets to copy over the secondFraction
20:14:56FromDiscord<treeform> maybe bug 3 or a nice to have is support for `{secondFraction/6}`
20:15:05FromDiscord<Horizon [She/Her]> `var myTs = parseTs("{year/4}-{month/2}-{day/2}T{hour/2}:{minute/2}:{second/2}.{secondFraction/3}Z", "2020-01-12T02:00:33.387824Z")` seems to work alright though? Doing `$myTs` gives `var myTs = parseTs("{year/4}-{month/2}-{day/2}T{hour/2}:{minute/2}:{second/2}.{secondFraction/3}Z", "2020-01-12T02:00:33.387824Z")`
20:15:30FromDiscord<Horizon [She/Her]> (edit) "`var myTs = parseTs("{year/4}-{month/2}-{day/2}T{hour/2}:{minute/2}:{second/2}.{secondFraction/3}Z", "2020-01-12T02:00:33.387824Z")`" => "`1578794433.387824`"
20:16:09FromDiscord<Horizon [She/Her]> Seems to be correct just reading it? I am using `chrono` `0.3.0`, installed by Nimble so
20:16:26FromDiscord<treeform> I get `Invalid format token: secondFraction/3` ?
20:17:04FromDiscord<Horizon [She/Her]> Ah i removed `/3`, i didn't update my clipboard aha
20:17:23FromDiscord<treeform> i'll have a fix for your issue soon
20:17:33FromDiscord<Horizon [She/Her]> Thank you! ^^
20:19:38*jjido joined #nim
20:36:35*ltriant joined #nim
20:41:36*ltriant quit (Ping timeout: 268 seconds)
20:45:27FromDiscord<ambient> is there any sugar to create view into a seq or an array outside just typing 'openArray'?
20:46:22FromDiscord<Phil> That's.... beyond my scope of knowledge as I'm not familiar with the "view" terminology.
20:47:04FromDiscord<ambient> you have some array of continuous memory and you have start and end location at its simplest
20:47:13FromDiscord<ambient> striding is the more general concept
20:48:35FromDiscord<Phil> General question into the round:↵If I have an HTML string and want to (for testing purposes) do queries ala "Give me the HTML tag with this css class and give me its innerText/innerHTML attribute"... how do I do that in nim?
20:48:46FromDiscord<ambient> i guess it would be useful to just read through arraymancer sources
20:49:11FromDiscord<Phil> (edit) "nim?" => "nim?↵htmlparser doesn't seem that useful here"
20:49:14FromDiscord<auxym> not that I know of, but I think you could do it by defining a `[]` macro, like arraymancer does. which takes a special operator or something. like `arr[0 - 4]` or something
20:50:34FromDiscord<auxym> where `-` (I'm sure someone can think of something better) would generate a distinct slice type
20:53:04FromDiscord<ambient> i would probably just use a function like array.view[3:5, 5:-3::-2] or something like that
20:54:53FromDiscord<auxym> ah, didn't realize you wanted the fancy colon syntax, thought you just wanted a shortcut for `toOpenArray`
20:55:22FromDiscord<ambient> well a shortcut would be a start, and that's what my question was yes
20:56:00FromDiscord<ambient> although I think there's already arraymancer where I'm going, but that's a completely different style of programming instead of just some handy shortcuts to create array views
21:03:29*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
21:06:40FromDiscord<ambient> .view(3..5, -3..5|-2) or something like that would probably be more Nim-like
21:07:17FromDiscord<jtv> sent a long message, see http://ix.io/4ig1
21:08:10FromDiscord<jos> RootRef?
21:09:57FromDiscord<jtv> Ah, so stick the value in a separate object type?
21:17:22FromDiscord<jtv> Okay, thanks, jos. That should work, was more expecting to directly box sequences as pointers directly, but I'll shove them in nested objects.
21:17:27FromDiscord<jtv> Good idea
21:21:39FromDiscord<a weird programmer> are there vectors in nim?
21:21:50FromDiscord<a weird programmer> i cant seem to find any documentation on it
21:25:06FromDiscord<MetuMortis> What will you do with Vectors? Like you can create one
21:25:15FromDiscord<ezquerra> You have built-in arrays and sequences
21:25:54FromDiscord<ezquerra> If you want something that behaves as mathematical vectors I suggest you check Arraymancer
21:26:10FromDiscord<ezquerra> You should ask in the #science channel
21:26:27FromDiscord<a weird programmer> i'll just make my own vector macro
21:26:44FromDiscord<a weird programmer> i just wanted to be sure it isnt in the std lib
21:26:59FromDiscord<Phil> What's the difference between vector and seq to you?
21:27:05FromDiscord<Phil> fixed size?
21:29:44FromDiscord<a weird programmer> yeah
21:30:04FromDiscord<a weird programmer> i need something that can scale until my ram is full
21:34:26FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4igb
21:34:56FromDiscord<Phil> That way you can have access to all goodies that are already implemented for arrays and can define your own procs with your Vector type
21:35:24FromDiscord<a weird programmer> ah i see
21:35:30FromDiscord<a weird programmer> alright thanks!
21:36:58FromDiscord<a weird programmer> dont think this would work though
21:37:10FromDiscord<Phil> In reply to @a weird programmer "alright thanks!": Happy to help!↵That's a type alias, basically it's still array[3, int], you just can also call it Vector.↵If you want to make it a distinct type (which means `Vector` will not be able to be used with any other procs defined for array, and other arrays won't be able to use your Vector procs), you can use `distinct` types
21:37:11FromDiscord<a weird programmer> im computing squared numbers from 1 to 1 billion
21:37:46FromDiscord<Phil> So you want a vector that is 1 billion entries long?
21:37:55FromDiscord<Phil> And then create a second vector from that?
21:37:56FromDiscord<a weird programmer> yes
21:38:04FromDiscord<a weird programmer> but this stores integers no?
21:38:34FromDiscord<Phil> That one in particular, yes
21:38:45FromDiscord<Phil> Can of course also do an array of arrays
21:39:03FromDiscord<a weird programmer> like a 2d array?
21:39:17FromDiscord<Phil> Exactly like that
21:39:18*kenran joined #nim
21:39:22FromDiscord<a weird programmer> fair enough
21:39:41*kenran quit (Remote host closed the connection)
21:40:01FromDiscord<EyeCon> I have a feeling that you'd be happier with sequences though if you are looking into expandable containers
21:40:14*jjido joined #nim
21:40:30FromDiscord<Phil> I'd agree that it feels like you don't necessarily need to keep a billion numbers at ram at once
21:40:48FromDiscord<a weird programmer> hahaha yeah
21:41:05FromDiscord<a weird programmer> im gonna try both since why not
21:45:52FromDiscord<MetuMortis> When I use a template it is basically copy pasting the body of the template to the line I specified as I understand right?
21:47:16FromDiscord<Phil> In reply to @MetuMortis "When I use a": Correct
21:47:32FromDiscord<Phil> It's pretty useful when you want to replicate stuff like context-handlers in python
21:47:40FromDiscord<Phil> (edit) "context-handlers" => "context-managers"
21:49:39FromDiscord<Phil> ... I'm kinda surprised that this is turning out as difficult as it is
21:52:36FromDiscord<a weird programmer> sent a code paste, see https://play.nim-lang.org/#ix=4igd
21:53:40FromDiscord<Phil> Just wanted to write procs that, given an HTML file, confirm that a given piece of HTML is contained using basically JS stuff like `querySelector` and attributes like `innerHTML` and `innerText`. But the packages for `querySelector` and the like aren't behaving nicely with the terribly formatted HTML strings I have (with a lot of whacky whitespaces and newlines)
21:54:11FromDiscord<Phil> In reply to @a weird programmer "any idea why im": You know how your proc is returning a sequence of values?
21:54:25FromDiscord<a weird programmer> not quite sure
21:54:27FromDiscord<Phil> Nim doesn't like that you're doing nothing with it and is asking you whether it should assign that to a variable or just throw it away
21:54:50FromDiscord<a weird programmer> what do you mean nothing?
21:54:59FromDiscord<a weird programmer> i appended to it and then returned it
21:55:02FromDiscord<Phil> `proc compute(num: int): seq[int] =`↵the `: seq[int]` means "I return a sequence of integers"
21:55:12FromDiscord<a weird programmer> yes
21:55:20FromDiscord<a weird programmer> i think thats what its doing
21:55:24FromDiscord<Phil> Yeh but this line here `compute(10000)` doesn't do anything with the value it's getting
21:55:51FromDiscord<a weird programmer> it's counting upwards to that value
21:56:14FromDiscord<Phil> So now nim is confused and hurting itself in its confusion!↵Why are you returning a value there when you neither want to keep it (by assigning it) nor explicitly discard it
21:56:43FromDiscord<a weird programmer> i really dont understand
21:57:22FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4igg
21:58:29FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4igh
21:59:03FromDiscord<a weird programmer> huh
21:59:05FromDiscord<Phil> If you don't explicitly do anything with a value, nim will complain instead of implicitly throwing that value away
21:59:26FromDiscord<a weird programmer> so basically if i am returning something from a function i have to do something with it?
21:59:32FromDiscord<Phil> Pretty much
21:59:39FromDiscord<a weird programmer> i cant just call it and throw it away without saying discard?
21:59:53FromDiscord<Phil> discard is explicitly throwing away, aye
22:00:16FromDiscord<a weird programmer> this concept is really new to me
22:00:35FromDiscord<a weird programmer> so thats what all the langs were doing with functions that i do nothing with? just throwing it away
22:01:20FromDiscord<Phil> In reply to @a weird programmer "so thats what all": Throwing the reference away and waiting for the garbage collector to delete it eventually
22:01:53FromDiscord<EyeCon> sent a code paste, see https://paste.rs/tWh
22:01:59FromDiscord<Phil> sent a code paste, see https://paste.rs/EiP
22:02:12FromDiscord<a weird programmer> In reply to @EyeCon "Well, you can write": because this shall be compiled into a shared object for python
22:02:23FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4igl" => "https://play.nim-lang.org/#ix=4igk"
22:02:27FromDiscord<a weird programmer> i was testing it before i compile it into a SO
22:02:37FromDiscord<Phil> Ah, you using nimpy?
22:02:40FromDiscord<a weird programmer> yes
22:03:03FromDiscord<a weird programmer> im surprised its this easy to just make shared objects with nimpy
22:03:53FromDiscord<Phil> Yeh, it's fairly nifty. Just as a heads up, do remember to compile with the -d:release flag when you have your code where you want it, it's often forgotten ^^
22:04:07FromDiscord<a weird programmer> alright
22:04:21FromDiscord<a weird programmer> tbh i havent had this much fun in a programming language in ages
22:04:37FromDiscord<a weird programmer> if im betting on a language like this is wallstreetbets i'd bet on nim
22:04:53FromDiscord<Phil> Imo nim is a really nice language to lead you towards a lot of deeper concepts
22:05:04FromDiscord<Phil> Such as compile-time evaluation, compilers in general, interop
22:05:19FromDiscord<a weird programmer> yeah the one we discussed above i never even knew it existed
22:05:20FromDiscord<Phil> Even ref types vs. value types and so on
22:07:36FromDiscord<Phil> sent a long message, see http://ix.io/4igo
22:07:49FromDiscord<Phil> Are you a pythonista?
22:08:19FromDiscord<a weird programmer> yessir born and raised
22:08:37FromDiscord<Phil> Because in the case that you prefer snake case and are feeling forced to use camelcase because the docs are all written in camelcase, despair not
22:08:38FromDiscord<a weird programmer> the level of abstraction python provides is crazy
22:08:53FromDiscord<Phil> For nim allows you to use type insensitivity
22:09:06FromDiscord<a weird programmer> In reply to @Isofruit "Because in the case": heh i tend to just ignore any conventions any lang uses in personal projects
22:09:13FromDiscord<a weird programmer> i do what i like since its not production
22:09:17FromDiscord<Phil> meaning `isPotato` and `is_potato` are identical
22:09:33FromDiscord<a weird programmer> camelcase should be a crime
22:10:07FromDiscord<a weird programmer> In reply to @Isofruit "It allows you to": hm so is it better to leave the return type empty or to put in void?
22:10:10FromDiscord<Phil> In reply to @a weird programmer "heh i tend to": While true, when using procs from other libs and the like you may feel forced to use their names.↵Thanks to type insensitivity though you can basically write in whatever style you want
22:10:13FromDiscord<a weird programmer> what i've been doing is putting in void
22:10:43FromDiscord<Phil> In reply to @a weird programmer "hm so is it": I don't think there's really a convention, both are fine
22:10:48FromDiscord<Phil> (edit) "In reply to @a weird programmer "hm so is it": I don't think there's really a convention, both are fine ... " added "and express the same thing"
22:10:55FromDiscord<a weird programmer> fair enough
22:11:20FromDiscord<a weird programmer> i wonder if nim is viable for embedded programming
22:11:30FromDiscord<Phil> One sec, we had this earlier
22:12:07FromDiscord<a weird programmer> holy shit why is -d:release making my program so much faster
22:12:34FromDiscord<Phil> PMunch, Girvo and Generic are all relatively active embedded folks↵https://discord.com/channels/371759389889003530/756920870525730947/1050352367838699592↵For example him talking about USB
22:12:46FromDiscord<Phil> In reply to @a weird programmer "holy shit why is": Because -d:release enables a lot of optimization checks
22:12:51FromDiscord<Phil> Should speed up your program around 10x
22:13:09FromDiscord<Phil> there's also -d:danger but I haven't seen that much of a performance uplift because of it in my own project
22:13:18FromDiscord<a weird programmer> what does -d:danger do?
22:13:29NimEventerNew thread by snej: How do I ‘subclass’ StringStream?, see https://forum.nim-lang.org/t/9714
22:13:34FromDiscord<Phil> -d:danger disables a lot of runtime checks which normally slow you down slightly
22:13:35FromDiscord<demotomohiro> C lang allows you to call a function and ignore the return value. That can make programmers forget to check return value and can cause a bug.↵Just ignoring return value result in compile error is for safety.
22:14:01FromDiscord<Phil> runtime checks being "is that actually the type I thought it was" at runtime
22:14:19FromDiscord<a weird programmer> so its not worth using -d:danger?
22:14:21FromDiscord<Phil> As well as "Is my index at runtime out of bounds" etc.
22:14:40FromDiscord<Phil> It can be, but that's when you're really squeezing out performance in my eyes
22:14:53FromDiscord<a weird programmer> plus does -d:release do something like -O2 in GCC?
22:15:17FromDiscord<Phil> I'm not familiar with that flag, though demo might be
22:15:33FromDiscord<Phil> He has, in fact, written several pretty good articles about C interop and compiling
22:15:44FromDiscord<a weird programmer> im not sure but its something like that
22:15:45FromDiscord<Phil> https://internet-of-tomohiro.netlify.app/index.en.html
22:16:06FromDiscord<a weird programmer> "gcc -O sets the compiler's optimization level."
22:16:12FromDiscord<Phil> Anyway, there are compiler flags to optimize the size of your binary, optimize the speed of your binary, etc.
22:16:19FromDiscord<a weird programmer> https://media.discordapp.net/attachments/371759389889003532/1051261100940857444/image.png
22:16:27FromDiscord<demotomohiro> Use `-d:danger` when you really want fastest code even if it could return wrong result.↵Or when you want cleaner assembly output.
22:16:52FromDiscord<a weird programmer> In reply to @demotomohiro "Use `-d:danger` when you": nim is fast enough no need to dive into the danger zone
22:18:11FromDiscord<Phil> sent a long message, see http://ix.io/4igs
22:18:19FromDiscord<demotomohiro> `-d:release` Nim option adds `-O2` or `-O3` option to gcc compiler option. You can see gcc compiler options with `--listcmd` Nim option.
22:18:40FromDiscord<Phil> Every time I see the Nintendo Switch compiler section I snicker a bit
22:19:05FromDiscord<Phil> It's just so unexpected to be there
22:19:05FromDiscord<a weird programmer> In reply to @Isofruit "Here the docs over": neaat
22:19:13FromDiscord<a weird programmer> In reply to @Isofruit "Every time I see": xD
22:19:27FromDiscord<a weird programmer> next homebrew edition will be written in nim
22:19:34FromDiscord<a weird programmer> you heard it here first
22:23:17FromDiscord<auxym> sent a code paste, see https://paste.rs/jtU
22:24:57FromDiscord<auxym> In reply to @a weird programmer "plus does -d:release do": d:release turns on optimization in GCC, but also does other stuff like remove stack traces and debug symbols / line mappings in the source, and disables asserts
22:26:06FromDiscord<a weird programmer> i computed too many numbers and my pc crashed
22:26:12FromDiscord<a weird programmer> we back
22:26:41FromDiscord<a weird programmer> nim is nice
22:26:51FromDiscord<a weird programmer> nice community nice language
22:26:57FromDiscord<a weird programmer> am i in heaven or what
22:27:46*sagax quit (Remote host closed the connection)
22:28:42FromDiscord<auxym> nim is nice yes. which it had a larger community (that would contribute to better tooling). v2 will bring many nice improvements, coming real soon
22:29:04FromDiscord<auxym> (edit) "which" => "I wish"
22:29:20FromDiscord<Phil> I do kinda wish that after this the focus for like the next year or two is just... refactoring, bugfixing and stabilizing
22:29:49FromDiscord<a weird programmer> it needs some corpo backing or some bollocks like that
22:30:10FromDiscord<a weird programmer> In reply to @auxym "nim is nice yes.": what nim v2 is coming?
22:30:44FromDiscord<Phil> In reply to @a weird programmer "what nim v2 is": You can use it right now in fact.↵If you have choosenim installed you can get it via `choosenim devel`
22:30:57FromDiscord<auxym> was supposed to be before EOY. At this point I'm guessing the release is slipping a bit? perhaps in january if so
22:31:09FromDiscord<a weird programmer> i hope it doesnt bring in any breaking changes
22:31:17FromDiscord<Phil> Not really, just more features
22:31:19FromDiscord<auxym> a few, nothing super major
22:31:24FromDiscord<a weird programmer> alright
22:31:31FromDiscord<MetuMortis> sent a code paste, see https://play.nim-lang.org/#ix=4igy
22:31:50FromDiscord<auxym> decent summary of v2: https://www.youtube.com/watch?v=aDi50K_Id_k&t=16s
22:32:01FromDiscord<a weird programmer> i just hope that the nim devs learnt from what happened with C++ and its backwards compatibility
22:32:03FromDiscord<Phil> In reply to @a weird programmer "alright": For reference, I swapped from 1.6 to devel (current nim) in a ~10.000 lines of code project without any real issues
22:32:17FromDiscord<a weird programmer> In reply to @Isofruit "For reference, I swapped": sounds stable enough
22:32:18FromDiscord<Phil> webdev mind you, not native code
22:32:23FromDiscord<a weird programmer> oh
22:32:40FromDiscord<Phil> So basically that was all just an HTTP server backend
22:33:03FromDiscord<Phil> But still, fairly stable overall
22:33:08FromDiscord<a weird programmer> ya think making a restapi in nim and making bindings for it to python would be viable?
22:33:43FromDiscord<Phil> In reply to @a weird programmer "ya think making a": I mean, what for? Like what exact task would be written in nim and where would python benefit?
22:33:58FromDiscord<Phil> I rewrote the backend of my sideproject from Python to nim as a learning exercise
22:34:16FromDiscord<Phil> And found that there's just not that much that python offers to me anymore other than pre-existing libraries when necessary
22:34:17FromDiscord<demotomohiro> @MetuMortis https://nim-lang.org/docs/os.html#setCurrentDir%2Cstring
22:34:18FromDiscord<a weird programmer> something like fastapi
22:34:20FromDiscord<a weird programmer> but in nim
22:34:34FromDiscord<MetuMortis> In reply to @demotomohiro "<@314774529207566337> https://nim-lang.org/docs/os.": tried that but it didn't work :/
22:35:23FromDiscord<auxym> well it only affects the nim process, not the parent process (user's shell)
22:35:59FromDiscord<Phil> In reply to @a weird programmer "something like fastapi": I guess you could?↵I mean, wouldn't be that hard, you could basically take prologue as it is right now and throw nimpy over it I think
22:36:07FromDiscord<demotomohiro> @MetuMortis Or `import ospro; discard execCmd("cd dirname")`
22:36:08FromDiscord<Phil> Can't think of anything that would block you
22:36:44FromDiscord<Phil> But at that point you could as well use fast-api since you're not benefitting from nim that much anymore.↵The benefits from nim over python are, that you compile a binary once and then you can throw it up wherever
22:36:50FromDiscord<demotomohiro> `import osproc`
22:36:53FromDiscord<Phil> With python you need to install a bunch of libraries everywhere
22:37:14FromDiscord<a weird programmer> yeah
22:37:45FromDiscord<a weird programmer> the thing is, do i really want to write an api in nim for production?
22:37:50FromDiscord<a weird programmer> how am i gonna find nim devs
22:38:02FromDiscord<MetuMortis> what is ospro
22:38:06FromDiscord<Phil> In terms of performance you're slowing down the second you have to cross over into python-land and its not like python is unbearably slow in webdev in general.↵I speed up from ~150-500ms to 20-100ms, but that was going full nim
22:38:13FromDiscord<auxym> In reply to @MetuMortis "what is ospro": std/osproc
22:38:39FromDiscord<a weird programmer> In reply to @Isofruit "In terms of performance": yeah probably fastapi + numba would be more viable
22:38:54FromDiscord<a weird programmer> but eh more servers are cheaper than more devs
22:39:33FromDiscord<Phil> Aye. I'd still use nim over python any day personally because I get highly annoyed by duck-typing nowadays
22:39:33FromDiscord<MetuMortis> In reply to @demotomohiro "<@314774529207566337> Or `import ospro;": It doesn't work either :/ I believe it runs the command but not on the user's terminal & shell in use
22:39:57FromDiscord<a weird programmer> In reply to @Isofruit "Aye. I'd still use": whats duck-typing
22:41:06FromDiscord<a weird programmer> In reply to @Isofruit "Aye. I'd still use": and i'm just learning nim as a replacement for C, or if my python code slows down i make a shared object in nim
22:41:07FromDiscord<auxym> In reply to @MetuMortis "It doesn't work either": that's what I said: well it only affects the nim process, not the parent process (user's shell)
22:41:13FromDiscord<Phil> In reply to @a weird programmer "whats duck-typing": Python doesn't really type anything. Functions take in just variables you named, you don't really tell the compiler "whatever comes in here must be of type x".↵That's because you assume whatever enters your function will have whatever behaviour you need for it
22:41:25FromDiscord<Phil> "If it quacks like a duck, use it like a duck"
22:41:44FromDiscord<a weird programmer> yeah types mean jack shit in python
22:41:57FromDiscord<a weird programmer> plus nobody follow them
22:42:17FromDiscord<Phil> They do mean something, I mean you can't just do `5 + "lala"`
22:42:19FromDiscord<a weird programmer> have you seen 1k lines of no type code its a nightmare to figure out what returns what
22:42:26FromDiscord<a weird programmer> In reply to @Isofruit "They do mean something,": as in type hinting
22:42:27FromDiscord<Phil> Unlike some other languages I could mention
22:42:37FromDiscord<Phil> In reply to @a weird programmer "have you seen 1k": I have seen so much worse
22:42:42FromDiscord<a weird programmer> In reply to @Isofruit "Unlike **some other languages**": cough javascript cough
22:43:04FromDiscord<Phil> I started out in science, "scientific programming" is infamous for a reason
22:43:53FromDiscord<a weird programmer> xD
22:46:04FromDiscord<a weird programmer> anyways what are nim programmers called?
22:46:23FromDiscord<a weird programmer> nimsters? nimistas? nimpers? nymphos?
22:46:33FromDiscord<a weird programmer> hamsters?
22:46:40FromDiscord<Phil> beef-disciples↵(Not necessarily, but keep that one in mind whenever elegantbeef comes around)
22:47:39FromDiscord<Phil> I've seen nimmer in use I guess
22:48:04FromDiscord<a weird programmer> nimmers sounds nice
22:48:52FromDiscord<a weird programmer> anyways nymphos im going to bed, thanks for all the help especially you @Phil !
22:51:03FromDiscord<Horizon [She/Her]> In reply to @a weird programmer "whats duck-typing": "if it quacks like a duck, it must be a duck"
22:51:11FromDiscord<Horizon [She/Her]> In reply to @Isofruit ""If it quacks like": Oh you already said it xD
22:51:49FromDiscord<Horizon [She/Her]> In reply to @Isofruit "Unlike **some other languages**": `("ba" + + "a" + "a").toLowerCase()`
22:52:14FromDiscord<Horizon [She/Her]> In reply to @Isofruit "I've seen nimmer in": Nimian is what i use haha
22:53:23*jjido quit (Quit: Textual IRC Client: www.textualapp.com)
22:54:24FromDiscord<MetuMortis> banana!
22:55:39FromDiscord<Phil> In reply to @MetuMortis "banana!": nimnana
23:04:50FromDiscord<Elegantbeef> @Phil\: sorry it's "Nim Programmers"
23:05:07FromDiscord<Phil> Its too late beef
23:05:08FromDiscord<Phil> it is now
23:05:10FromDiscord<Phil> beefciples
23:07:03FromDiscord<Elegantbeef> well i'm going to jump in front of a bus now, so dont worship me too long
23:07:40FromDiscord<Phil> bus didn't compile, macro error
23:07:48FromDiscord<etra> hello, are var arrays 0 init?
23:08:24FromDiscord<Elegantbeef> All data types are o init'd
23:08:27FromDiscord<Elegantbeef> 0 even
23:10:04*FromDiscord quit (Remote host closed the connection)
23:10:17*FromDiscord joined #nim
23:22:57FromDiscord<ajusa> Is there an easy way to get the name of a proc from a typedesc? I'm currently using `name` from typetraits and splitting on the string, not sure if there's a better way
23:23:22FromDiscord<Elegantbeef> "name of a proc from a typedesc".... what?
23:24:10FromDiscord<Phil> In reply to @Elegantbeef ""name of a proc": I'm pretty sure he wants `"x"` from `proc x() = echo "lala"`
23:24:27FromDiscord<Phil> Which I don't think works because x in this scenario behaves like a variable symbol itself
23:24:53FromDiscord<Elegantbeef> ajusa we need more details
23:28:06FromDiscord<ajusa> Yes, I want the name of the proc - eg "x" as Phil described
23:29:31FromDiscord<Elegantbeef> i'm a bit confused, how do you have the procedure definition?
23:29:56FromDiscord<Elegantbeef> Is this a macro you apply on a procedure, a macro that you pass a procedure to...
23:30:34FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=4igI
23:30:40FromDiscord<Elegantbeef> `astToStr`
23:30:55FromDiscord<ajusa> (I know I'm usually more coherent, sleep deprived right now)
23:30:57FromDiscord<Elegantbeef> Though that doesnt work with anonymous procedures
23:31:15FromDiscord<ajusa> perfect, thank you!
23:33:46NimEventerNew thread by RodSteward: C++ delete wrapping, see https://forum.nim-lang.org/t/9715
23:46:33FromDiscord<πτ (pi man)> are there any tryParse methods in the stdlib?
23:54:04FromDiscord<treeform> In reply to @Event Horizon "Created an issue for": Issue https://github.com/treeform/chrono/issues/7 fixed.
23:56:32FromDiscord<Elegantbeef> parseutils has something akin to tryparse↵(@πτ (pi man))
23:56:48FromDiscord<Elegantbeef> But you can also just make your own using strutils' parse
23:57:23FromDiscord<πτ (pi man)> strutils parse throws on bad parse, that sounds not good for implementing tryParse
23:57:49FromDiscord<Horizon [She/Her]> In reply to @treeform "Issue https://github.com/treeform/chrono/issues/7 f": Good to know, thanks!
23:58:08FromDiscord<πτ (pi man)> I'll look at parseutils