<< 03-01-2022 >>

00:00:13*tk quit (Quit: Well, this is unexpected.)
00:00:37*tk joined #nim
00:03:37FromDiscord<Elegantbeef> I'd say so
00:03:48FromDiscord<Elegantbeef> error doesnt break compilation, so you can bubble more errors
00:03:57FromDiscord<Elegantbeef> So you need to handle what happens if it errors
00:06:39FromDiscord<TryAngle> where was the compile cache directory again?
00:06:56FromDiscord<Elegantbeef> `~/.cache/nim` on \nix
00:07:49FromDiscord<TryAngle> thanks
00:11:02arkanoidhow do you handle errors with nim?
00:11:23FromDiscord<Elegantbeef> try except
00:11:37arkanoidI mean, do you use return codes, or just exceptions, or other patterns?
00:12:00FromDiscord<Elegantbeef> You can use any, Nim has exceptions though so it's more idiomatic
00:12:11FromDiscord<Elegantbeef> There are libraries which give you Rust style result
00:12:25FromDiscord<Elegantbeef> https://github.com/arnetheduck/nim-result
00:12:36arkanoidI've never used Result object pattern before, but I was thinking about it
00:12:40FromDiscord<Elegantbeef> I'd say whatever works for you
00:13:04FromDiscord<Elegantbeef> You can do the Go pattern of a tuple, the C pattern of a global error value, Rust's or exception handling
00:13:22FromDiscord<Elegantbeef> Though the first 2 suuuuuck
00:14:09arkanoidit seems to me that the best option would be using exceptions for exceptional (unrecoverable or unknown errors) and result object for all the others
00:14:46arkanoidbut actually unsure, I come from try/except world for everything (java like)
00:15:00arkanoidof just mess around (python like)
00:15:39arkanoidthe point agains result object in Nim is that you're not forced to handle both happy and bad result paths
00:16:11arkanoidwhile Rust with pattern matching makes this seamless
00:18:08FromDiscord<Elegantbeef> something something Hax's pattern matching 😀
00:18:48arkanoidyes but still you're not forced. I want nim compiler to raise error if path is not handled properly
00:19:45FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3KJQ
00:19:47FromDiscord<kaddkaka> sent a code paste, see https://paste.rs/uMn
00:20:12FromDiscord<Elegantbeef> https://github.com/beef331/aoc2021/blob/master/day5/day5.nim 😀
00:20:27FromDiscord<kaddkaka> (edit) "https://play.nim-lang.org/#ix=3KJS" => "https://play.nim-lang.org/#ix=3KJR"
00:21:38FromDiscord<kaddkaka> 1. oh, `scantuple`!
00:21:57FromDiscord<Elegantbeef> 2. you can make a constructor
00:22:03FromDiscord<Elegantbeef> 3 no
00:22:29FromDiscord<Elegantbeef> 4 in nim user types start with capitals
00:23:38FromDiscord<kaddkaka> 4. not mine, yet 😛
00:24:18FromDiscord<Elegantbeef> My solution was relatively performant if you like racing time
00:24:19FromDiscord<kaddkaka> Also, how come my `var line` doesn't shadow the `lines` used in `for line in lines "day05.input": `
00:24:21FromDiscord<kaddkaka> (edit) "`" => "`>"
00:24:35FromDiscord<kaddkaka> (edit) ""day05.input": `>" => ""day05.input":`?"
00:25:13FromDiscord<kaddkaka> @ElegantBeef That's also interesting, was not really going for that here/yet
00:25:35FromDiscord<Elegantbeef> Are you talking about `var lines` and `for x in lines "path"`?
00:25:47FromDiscord<kaddkaka> @ElegantBeef how did you emasure? just time?
00:25:49FromDiscord<kaddkaka> In reply to @Elegantbeef "Are you talking about": yes
00:25:50FromDiscord<Elegantbeef> if so the reason is `iterator`s are preferred inside for loops
00:25:59FromDiscord<kaddkaka> ah ok
00:26:09FromDiscord<Elegantbeef> I used flywind's timeit package
00:26:16FromDiscord<kaddkaka> feels a bit scary to overload the name though
00:26:22FromDiscord<Elegantbeef> Eh
00:26:27FromDiscord<Elegantbeef> Overloading makes sense for iterators
00:26:28FromDiscord<kaddkaka> at least iffy
00:26:32FromDiscord<Elegantbeef> take `[]` for slices
00:26:44FromDiscord<Elegantbeef> `for x in a[1..^1]` without overloading is a copy
00:26:52FromDiscord<Elegantbeef> With overloading it's a 0cost iteration
00:27:28FromDiscord<Elegantbeef> You arent overloading in this case imo
00:27:31FromDiscord<kaddkaka> ok, good reason 👍
00:27:52FromDiscord<kaddkaka> well the name/identifier is overloaded, no?
00:28:05FromDiscord<Elegantbeef> Not ambiguous
00:28:07FromDiscord<Elegantbeef> So i'd say no
00:28:33FromDiscord<kaddkaka> overloads are usually not ambiguous, right? If they were, they would not eb usable?
00:28:37FromDiscord<kaddkaka> (edit) "eb" => "be"
00:28:37FromDiscord<Elegantbeef> I guess technically it's an overloaded symbol, but it's not ambiguous so there is no issue
00:28:42FromDiscord<kaddkaka> sure
00:28:48FromDiscord<kaddkaka> Agreed
00:28:55FromDiscord<Elegantbeef> `lines x` is a command call, so it's not that iffy
00:29:07FromDiscord<Elegantbeef> Atleast to me
00:30:44FromDiscord<kaddkaka> sNo I guess not. It's just uncommon (to me) wiht things other than functions that are overloaded. So it's unfamiliar I guess 🙂
00:30:51FromDiscord<kaddkaka> (edit) "sNo" => "No"
00:30:57FromDiscord<kaddkaka> (edit) "wiht" => "with"
00:31:22FromDiscord<Elegantbeef> Now shadowing variables is an iffy territory
00:31:53FromDiscord<kaddkaka> I was thinking if I was going to add the last point after the `while` loop, like you did, or mixture with the end condition (as I ended up doing).
00:43:35FromDiscord<kaddkaka> Is it ok to use `_` to discard a value in a tuple assignment?↵`let (_, x1, y1, x2, y2) = line.scanTuple("$i,$i$s->$s$i,$i")`
00:43:56FromDiscord<kaddkaka> The code passes, but I couldn't find anything in the manual.
00:44:29FromDiscord<geekrelief> That's valid.
00:47:16FromDiscord<kaddkaka> Yes I noticed. first I tried `let (discard, x1, y1, x2, y2) = line.scanTuple("$i,$i$s->$s$i,$i")` which was not valid. Is `_` mentioned in the manual somwhere?
00:47:29FromDiscord<geekrelief> It's under tuple unpacking in the manual
00:47:47FromDiscord<kaddkaka> I must be blind, thanks
00:48:05FromDiscord<geekrelief> no worries, I was searching for it for a few minutes
00:48:13FromDiscord<geekrelief> I swore I read it in the manual
00:48:22FromDiscord<geekrelief> https://nim-lang.github.io/Nim/manual.html#statements-and-expressions-tuple-unpacking
00:49:09FromDiscord<Elegantbeef> `_` is just a unaccessible identifier in Nim
00:50:17FromDiscord<Elegantbeef> You can also use it in a proc def for instance `proc init(_: typedesc[Point])`
00:51:40FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3KK8
00:56:02FromDiscord<kaddkaka> Getting similar redefinition error if I user `iterator`, so I was probably to hasty in my previous conclusion.
01:38:18*drewr quit (Quit: ERC (IRC client for Emacs 27.2))
01:51:00FromDiscord<Elegantbeef> They come from the same module so in this case it's ambiguous
01:51:10FromDiscord<Elegantbeef> You cannot do `myModule.line` to diferentiate
02:05:14*arkurious quit (Quit: Leaving)
02:34:33*neurocyte6 joined #nim
02:36:46*neurocyte quit (Ping timeout: 260 seconds)
02:36:46*neurocyte6 is now known as neurocyte
02:50:38*noeontheend joined #nim
02:59:02FromDiscord<evoalg> I would argue that even though `var line` and `for line in` works, it's not as clear as using a different variable name, and even if the coder is comfortable with it, others may not be, so it's good practice to be as clear as possible (just my opinion)
02:59:35FromDiscord<Elegantbeef> Yea shadowing should only be used where it makes sense
03:00:15FromDiscord<Elegantbeef> For example
03:00:24FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/2Gl
03:00:47FromDiscord<evoalg> what is Option?
03:01:17FromDiscord<Elegantbeef> `std/options` it adds a boolean flag to whether the value is "set"
03:01:19FromDiscord<Rika> Simulates None in Python (kinda)
03:01:35FromDiscord<evoalg> ohhhh ok
03:03:35FromDiscord<sOkam!> what's the consensus of when to use func instead of proc? (aka having side-effects or not by default)↵Is there a general rule of what's expected from Nim by standard?
03:03:37FromDiscord<huantian> more like the `Optional[T]` type hint which is `T | None`
03:05:30FromDiscord<Rika> In reply to @sOkam! "what's the consensus of": No
03:05:38FromDiscord<Rika> Use it as much as you want
03:06:11FromDiscord<evoalg> I thought it was generally nim's best practice to use the most restrictive way if you can?
03:06:17FromDiscord<Elegantbeef> Indeed
03:06:20FromDiscord<Rika> …. If you want
03:06:23FromDiscord<Elegantbeef> func -\> proc
03:08:14FromDiscord<Elegantbeef> Though i'm generally daft and go for proc
03:09:51FromDiscord<Rika> I personally literally don’t care
03:10:34FromDiscord<evoalg> so if I use a func and then if the compiler complains then I might say "oh that shouldn't have had a side-effect, let me see, oh it's because I was unintentionally accessing a global var which I didn't mean to do - nice one nim, you spotted a bug for me" ... same with `let` vs `var` right?
03:10:38FromDiscord<Rika> I’d rather a system that warns me of side effects (off by default)
03:11:16FromDiscord<Rika> In reply to @evoalg "so if I use": Much rarer than the “dammit Nim I’m debugging stfu”
03:11:34FromDiscord<evoalg> true
03:11:51FromDiscord<Elegantbeef> Yea my biggest nuisance with `func` is i write "echo" and get told to fuck off
03:12:01FromDiscord<Rika> In reply to @Rika "I’d rather a system": That’s why I say this
03:12:27FromDiscord<evoalg> but you both think `let` is better over `var`?
03:12:39FromDiscord<evoalg> I mean you both use let where you can?
03:13:31FromDiscord<evoalg> ...come on, fess up 😉
03:13:34FromDiscord<Elegantbeef> Indeed
03:13:46FromDiscord<Elegantbeef> I default to `const` then move to `let` then finally use `var`
03:14:15FromDiscord<sOkam!> In reply to @Elegantbeef "I default to `const`": this is what I understood to be preferred in the language
03:14:31FromDiscord<Rika> I default to let
03:14:49FromDiscord<Rika> I don’t go to const unless it is global
03:14:58FromDiscord<Rika> And that I explicitly want it to be const
03:16:26FromDiscord<evoalg> both `const`'s and `let`'s have to be known at compile time right? ... what's the difference then?
03:16:31FromDiscord<Rika> Nope
03:16:35FromDiscord<Rika> Let is runtime
03:16:43FromDiscord<evoalg> ohhhh ok!
03:16:51FromDiscord<sOkam!> im learning cpp, after practicing nim for a few weeks, and im already missing nim man. so many nice things 😦
03:17:14FromDiscord<Rika> What are you missing? From my usage of C++ I didn’t really miss much from Nim
03:17:27FromDiscord<sOkam!> uhh, cleaness?
03:17:35FromDiscord<Elegantbeef> Shun rilka!
03:17:36FromDiscord<huantian> In reply to @Elegantbeef "Yea my biggest nuisance": I usually write echo, scroll somewhere when running my program and have to scroll back to change it to debugEcho
03:17:37FromDiscord<Rika> Ah that
03:17:40FromDiscord<Rika> Eh
03:18:10FromDiscord<Rika> In reply to @huantian "I usually write echo,": “Debug echo” is awful I would say
03:18:22FromDiscord<sOkam!> In reply to @huantian "I usually write echo,": debugEcho works inside func?
03:18:26FromDiscord<Rika> Yes
03:18:34FromDiscord<Elegantbeef> just give me `-d:nimPureEcho` and call it a day 😛
03:18:36FromDiscord<sOkam!> whats diff about them?
03:18:52FromDiscord<huantian> it's echo but you lie to the compiler and say it's pure
03:18:54FromDiscord<Rika> One is “lying about being pure”
03:18:57FromDiscord<Elegantbeef> debug echo is an explicitly pure procedure
03:19:00FromDiscord<Elegantbeef> Meant only for debugging
03:19:22FromDiscord<sOkam!> how is echo not pure? 🤔
03:19:34FromDiscord<Rika> You write to a global called stdout
03:19:37FromDiscord<Elegantbeef> It writes to stdout
03:19:40FromDiscord<Elegantbeef> Changing global state
03:19:40FromDiscord<sOkam!> ohh
03:20:11FromDiscord<huantian> really doing anything should be an effect↵since you increase the temperature of the room of the user
03:20:21FromDiscord<Elegantbeef> lol
03:20:24FromDiscord<sOkam!> :Kappa:
03:20:53FromDiscord<Elegantbeef> I mean you can have a pure function that relies on the cpu temperature assuming it's a parameter
03:20:55FromDiscord<Rika> Why don’t you write APL if you need absolute cleanliness in code xd
03:21:33FromDiscord<sOkam!> In reply to @Rika "“Debug echo” is awful": why? 🤔
03:21:40FromDiscord<Rika> It is a joke
03:22:03FromDiscord<sOkam!> ah k, me dummy. nvm me :_)
03:22:03FromDiscord<Rika> Oh
03:22:08FromDiscord<Rika> You replied to the other message
03:22:12FromDiscord<Rika> I didn’t see
03:22:13FromDiscord<sOkam!> ye
03:22:26FromDiscord<Rika> I just think it looks like a jack
03:22:33FromDiscord<Rika> Hack
03:22:37FromDiscord<sOkam!> like the word?
03:22:38FromDiscord<Rika> I hit j instead
03:23:09FromDiscord<Elegantbeef> jackerman
03:23:35FromDiscord<Rika> Whatever, I just think it’s a hack
03:24:00FromDiscord<Rika> Why introduce a keyword to check for side effects when it could have just been a warning or so I don’t know
03:24:57FromDiscord<dizzyliam> what's the best way to include resources (e.g. text files) in a nimble package so that they can be read by the library?
04:29:15NimEventerNew Nimble package! windy - Windowing library for Nim using OS native APIs., see https://github.com/treeform/windy
04:53:35*nac5 joined #nim
04:55:50*nac quit (Ping timeout: 260 seconds)
04:55:50*nac5 is now known as nac
04:55:57*noeontheend quit (Ping timeout: 240 seconds)
05:43:46FromDiscord<creikey> In reply to @NimEventer "New Nimble package! windy": awesome
06:28:54*Gustavo6046 joined #nim
06:31:07*Gustavo6046 quit (Read error: Connection reset by peer)
06:51:57FromDiscord<Zonifer> can I dm someone about using the asynchttpserver and how to post form data?
06:53:15FromDiscord<Elegantbeef> You can ask your questions and someone will probably help
06:56:33FromDiscord<Zonifer> sent a code paste, see https://play.nim-lang.org/#ix=3KNc
06:58:13FromDiscord<Yardanico> @Zonifer no need to delete messages as they're bridged to IRC anyway
06:58:31FromDiscord<Zonifer> @Yardanico Ok cool good to know
07:00:54FromDiscord<Yardanico> basically you just find the file in the `body` of the request and parse it
07:01:18FromDiscord<Yardanico> asynchttpserver is quite limited, maybe you should consider prologue or jester as they offer more abstractions
07:01:27FromDiscord<Yardanico> for example in prologue - https://planety.github.io/prologue/uploadfile/
07:02:03FromDiscord<Yardanico> be aware that currently all of those http servers will read the whole file into memory, so it's not good to use it for big files
07:02:14FromDiscord<Yardanico> https://github.com/planety/prologue/blob/devel/tests/local/uploadFile/local_uploadFile_test.nim
07:02:33*Vladar joined #nim
07:02:35FromDiscord<Yardanico> (this is a prologue test, so you need to change the imports to just be prologue, and modify to your liking)
07:02:50FromDiscord<Shiba> Where did nim get echo? Bash?
07:03:03FromDiscord<Shiba> (edit) "echo?" => "echo?from"
07:03:09FromDiscord<Elegantbeef> Perhaps
07:03:28FromDiscord<Shiba> (edit) "echo?from" => "echo? from"
07:03:53FromDiscord<Zonifer> sent a code paste, see https://play.nim-lang.org/#ix=3KNj
07:04:05FromDiscord<Yardanico> req.body is the body
07:04:17FromDiscord<Yardanico> also why are you doing http manually?
07:04:30FromDiscord<Yardanico> i mean if you want, sure, but there's https://nim-lang.org/docs/httpclient.html in stdlib
07:06:34FromDiscord<Zonifer> Well my project started small but ended up getting bigger hahaha I wanted to add more features to this app and learn more under the hood
07:27:09*Gustavo6046 joined #nim
07:59:27*PMunch joined #nim
08:04:37*Gustavo6046 quit (Ping timeout: 240 seconds)
08:51:13NimEventerNew post on r/nim by TheDarkMode: Current Goals for Nim?, see https://reddit.com/r/nim/comments/rux893/current_goals_for_nim/
09:07:22*Vladar quit (Remote host closed the connection)
09:12:21FromDiscord<smartlyweird> hi guys
09:12:52FromDiscord<evoalg> hiya
09:13:50FromDiscord<smartlyweird> how are you?
09:14:28FromDiscord<evoalg> as I normally am, how are you?
09:16:56FromDiscord<smartlyweird> ahh it was normal until i struck with a problem lol
09:18:01FromDiscord<evoalg> what problem?
09:18:33FromDiscord<smartlyweird> i've been trying to make a utility with nim to read evtx files and there's this API EvtNext
09:18:52FromDiscord<smartlyweird> there's its 3rd param PEVT_HANDLE
09:19:11FromDiscord<smartlyweird> according to documentation `A pointer to an array of handles that will be set to the handles to the events from the result set.`
09:19:27FromDiscord<smartlyweird> but idk how to implement it in nim
09:20:31FromDiscord<smartlyweird> sorry im new to nim. i've done this in cpp before but in nim its becoming a bit tricky for me
09:22:03FromDiscord<evoalg> wow ok, then hopefully one of the guru's will answer, as I'm also new to nim. There are some people who used to (or still do) program ing cpp etc, and from what I've seen here they think nim is easier (unless I've misunderstood)
09:22:33FromDiscord<Elegantbeef> What's the proc?
09:26:07FromDiscord<smartlyweird> sent a code paste, see https://play.nim-lang.org/#ix=3KNV
09:26:37FromDiscord<smartlyweird> i've ported almost all required enums from winevt.h
09:26:56FromDiscord<smartlyweird> its just that this PEVT_HANDLE im dealing with
09:29:03FromDiscord<smartlyweird> sent a code paste, see https://paste.rs/tXx
09:29:11FromDiscord<Elegantbeef> It's just a pointer to event handle so does it expect a nil terminated array?
09:29:34FromDiscord<Rika> Or a pointer to memory then a length integer?
09:29:52FromDiscord<Elegantbeef> There is no length integer as a parameter that i can tell
09:30:30FromDiscord<Rika> Do you have the definition in C(++)
09:30:35FromDiscord<smartlyweird> i've no clue tbh
09:30:47FromDiscord<smartlyweird> In reply to @Rika "Do you have the": yes msdn provided a example
09:30:49FromDiscord<Elegantbeef> I mean do you have the C++ code you're attempting to rewrite?
09:30:51FromDiscord<smartlyweird> wait lemme share
09:31:34FromDiscord<smartlyweird> In reply to @Elegantbeef "I mean do you": yes. i cannot share that since guy im working for as a freelancer doesn't allow me to do that
09:31:41FromDiscord<smartlyweird> but i can share msdn link
09:31:54FromDiscord<Elegantbeef> What do you pass in C++ land?
09:32:31FromDiscord<smartlyweird> https://gist.github.com/Mandar-Shinde/6468275f9cbaecf61807a8ca3ad78c10
09:32:45FromDiscord<smartlyweird> its not msdn but i too this reference to make the cpp build
09:33:35FromDiscord<smartlyweird> (edit) "too" => "used"
09:35:02FromDiscord<krisppurg> Found an issue related to my problem, guess I'll have to just wait until treeform merges the pr https://github.com/treeform/jsony/pull/40↵https://discord.com/channels/371759389889003530/371759389889003532/927325295642546246
09:41:23FromDiscord<smartlyweird> In reply to @Elegantbeef "What do you pass": trying to dm you
09:41:39FromDiscord<smartlyweird> i can share my cpp code in dm
09:42:01FromDiscord<Rika> He is not on discord
09:42:05FromDiscord<smartlyweird> oh
09:42:06FromDiscord<Rika> Technically he is
09:42:10FromDiscord<Rika> But not right now
09:42:16FromDiscord<smartlyweird> okay
09:42:23FromDiscord<smartlyweird> can i dm you?
09:42:39FromDiscord<Rika> DM is generally not accepted as well, it would be difficult for everyone to help if only one of us have info
09:43:38FromDiscord<smartlyweird> okay
09:43:53FromDiscord<smartlyweird> sent a code paste, see https://play.nim-lang.org/#ix=3KNY
09:43:54FromDiscord<Rika> I think it would be better if you could tell us the type definition (in C++?) of handle
09:43:56FromDiscord<smartlyweird> this was my cpp implementation
09:44:20FromDiscord<Elegantbeef> It's a pointer handle
09:44:20FromDiscord<smartlyweird> (edit) "cpp" => "c"
09:44:23FromDiscord<Elegantbeef> So seems you just use a nill
09:44:24FromDiscord<smartlyweird> yes
09:44:33FromDiscord<smartlyweird> i did that
09:44:34FromDiscord<smartlyweird> wait
09:44:37FromDiscord<Rika> The PEVT_HANDLE definition, do you know exactly what it is
09:44:43FromDiscord<Elegantbeef> Well i mean↵`var a: PevtHandle = nil`
09:44:58FromDiscord<smartlyweird> ohh
09:45:29FromDiscord<smartlyweird> In reply to @Rika "The PEVT_HANDLE definition, do": yes, according to msdn `A pointer to an array of handles that will be set to the handles to the events from the result set.`
09:45:39FromDiscord<smartlyweird> In reply to @Elegantbeef "Well i mean `var": lemme try that
09:46:00FromDiscord<Rika> As you described it seems like it is a ptr UncheckedArray[whatever should be in here, the array value type]
09:46:00FromDiscord<Rika> Nice timing for the train I’m on to go into a tunnel
09:46:23FromDiscord<Rika> Okay so I’m having trouble understanding where you’re having trouble lol
09:51:50NimEventerNew thread by Severak: Good real life apps, see https://forum.nim-lang.org/t/8764
10:04:59FromDiscord<smartlyweird> In reply to @Rika "Okay so I’m having": i just want to know how to make array of handles
10:05:06FromDiscord<smartlyweird> because im following msdn
10:06:04FromDiscord<smartlyweird> In reply to @Elegantbeef "Well i mean `var": i dont suppose it could be implemented since i cannot see any nim support for winevt.h yet
10:06:12FromDiscord<smartlyweird> but ill check that too
10:06:14FromDiscord<Rika> https://nim-lang.org/docs/system.html#create%2Ctypedesc
10:06:27FromDiscord<Rika> Close to “calloc”
10:07:03FromDiscord<Rika> Then you have to convert to “ptr UncheckedArray[T]”
10:07:08FromDiscord<Elegantbeef> I mean i dont see how it knows where the last element is so i really dont know how
10:07:10FromDiscord<Rika> Where T is the type of the value
10:07:22FromDiscord<Rika> In reply to @Elegantbeef "I mean i dont": I don’t either really
10:07:58FromDiscord<Rika> I guess it might be null terminating, so your size should be 1 more than the amount of items you want to place into the array
10:09:53FromDiscord<Elegantbeef> You'd think the docs would mention that
10:10:05FromDiscord<Elegantbeef> But no we're supposed to intuit the way the array is
10:10:21FromDiscord<Rika> Lol
10:16:11FromDiscord<smartlyweird> Ikr msdn sometimes misguide lol
10:19:53NimEventerNew thread by Axben: Status - how would I program a GUI-based Nim-application on Windows?, see https://forum.nim-lang.org/t/8765
10:33:56*flynn quit (Read error: Connection reset by peer)
10:35:17*flynn joined #nim
10:46:32FromDiscord<kaddkaka> In reply to @Rika "Much rarer than the": There is `debugEcho` if that's the kind of side-effect you want in a `func`
10:47:02FromDiscord<kaddkaka> In reply to @Elegantbeef "Yea my biggest nuisance": I guess you know about it, ^
10:48:37FromDiscord<kaddkaka> Ok I shouldn't answer 8h old posts -.-
10:49:25FromDiscord<smartlyweird> In reply to @Rika "https://nim-lang.org/docs/system.html#create%2Ctype": so this one should behave as typedef right?
10:52:16FromDiscord<smartlyweird> In reply to @Rika "https://nim-lang.org/docs/system.html#create%2Ctype": any example you have? would be easier for me to understand the implementation
11:00:25*jjido joined #nim
11:00:46FromDiscord<Rika> Sorry, not now
11:18:22*oddish joined #nim
11:36:05FromDiscord<Clonkk> Is there a way to construct a `seq[string]` at compile (through `{.compileTime.}` proc) and use the result at run-time without using macros ?
11:37:01PMunchShould be
11:38:01FromDiscord<Hamid_Bluri> yes
11:38:13FromDiscord<Hamid_Bluri> hey pmuch
11:38:45PMunch@Clonkk: https://play.nim-lang.org/#ix=3KOy
11:38:48PMunch@Hamid_Bluri, hello
11:39:28Amun-RaClonkk: https://play.nim-lang.org/#ix=3KOz
11:39:36Amun-Raah, you beat me up to it
11:41:27FromDiscord<Clonkk> Will take a look at it when my internet connection decides to stop suckling thanks
11:48:28FromDiscord<Yardanico> if nim playground is a bit too heavy for you, you can just go to the ix.io direct link
11:48:46FromDiscord<Yardanico> since playground uses it for hosting code - http://ix.io/3KOy and http://ix.io/3KOz
11:49:19FromDiscord<Yardanico> there's also some syntax highlighting support on ix.io - http://ix.io/3KOz/nim
11:50:05FromDiscord<Clonkk> Ah yeah okay I should have specified.What I'm trying to do is static Read a list of file that the user provide through "static string" at compile Time and use the result at run time.↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
11:52:50FromDiscord<Yardanico> yes that's easily possible
11:53:16FromDiscord<Yardanico> if you just want lines in a seq, you can quite literally just do `const myseq = staticRead("file.txt").splitLines()` assuming you imported std/sequtils
11:53:37FromDiscord<Yardanico> how does the user provide the file name to you code though?
11:55:35FromDiscord<evoalg> Yards you know that collection scope issue you fixed, would it already be in dev release or something?
11:55:50FromDiscord<evoalg> (I just don't know the process)
11:56:46FromDiscord<Yardanico> it's not merged as it might be intended behaviour
11:56:49FromDiscord<Yardanico> there was some discussion in the PR
11:57:00FromDiscord<Yardanico> https://github.com/nim-lang/Nim/pull/19288
11:57:42FromDiscord<evoalg> oh ok thx you!
12:23:54FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3KOT
12:29:27FromDiscord<Yardanico> newSeq can also create a new seq as you have in your first example
12:36:18FromDiscord<kaddkaka> right, so `newseq` has (at least) 2 variants, and 1 of them is analogue to the `newSeqWith`. Thanks
12:42:23NimEventerNew thread by Clavismax: nimsuggest Issue processing ``runnableExamples``, see https://forum.nim-lang.org/t/8766
13:01:39FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3KP4
13:03:04FromDiscord<kaddkaka> I guess https://nim-lang.org/docs/sequtils.html#countIt.t%2Cuntyped%2Cuntyped would be nice
13:04:13FromDiscord<Solitude> ||for loops are more readable than fold||
13:04:15FromDiscord<kaddkaka> (I'm starting to like the ability to write an expression directly as an argument to a template!) 🙂
13:05:00FromDiscord<kaddkaka> @Solitude In this case `let total = countIt(grid, it>1)` is very readable if I could flatten the `grid` in a simple way.
13:05:54FromDiscord<kaddkaka> In reply to @Solitude "||for loops are more": I'm not sure haskeller would agree 😛
13:05:57*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
13:06:06FromDiscord<Solitude> im not sure i would listen to a haskeller
13:06:19FromDiscord<Rika> im not sure if you should argue about somehting thats highly subjective
13:06:42FromDiscord<Solitude> cope
13:06:49FromDiscord<Rika> good to know
13:07:34FromDiscord<kaddkaka> ?_?
13:07:39FromDiscord<Rika> nothing
13:08:07FromDiscord<Rika> sorry, i mean nothing of importance
13:09:26FromDiscord<kaddkaka> Anyway, my current question is how to transform a "2d sequence" to supply it to [countIt](https://nim-lang.org/docs/sequtils.html#countIt.t%2Cuntyped%2Cuntyped). Should I be looking for iterators?
13:10:58FromDiscord<Solitude> that means you would be back to for-loops
13:11:54FromDiscord<Solitude> either write your countIt for seqs of seqs, or write the procedure that does what you need here. not everything should be solved by means of stdlib or fancy oneliner.
13:12:00PMunch@kaddkaka, you can pass a 2D sequence to countIt just fine
13:12:47FromDiscord<Solitude> that would do completely different thing
13:13:37FromDiscord<kaddkaka> In reply to @Solitude "either write your countIt": Of course not, I'm not looking for fancy, I'm looking for readable.
13:13:51PMunchI guess something like foldl(countIt(my2Dseq, it > 100)) should do what you need
13:14:39PMunchWell, not quite, but you get the point
13:14:57FromDiscord<kaddkaka> yeah, not sure I want to mix `foldl` and `countIt` though
13:15:01FromDiscord<kaddkaka> thanks
13:15:06PMunchWhy not?
13:15:23FromDiscord<kaddkaka> it's 2 concepts to think about
13:16:30PMunchWell they're both functional in nature
13:18:42PMunchFirst the countIt counts every element that fulfils the predicate by x or y, and then add them all together
13:19:05FromDiscord<Rika> doesnt foldl take two argd
13:19:07FromDiscord<Rika> argsd
13:19:08FromDiscord<Rika> (edit) "argsd" => "args"
13:19:20PMunchYeah I messed it up a bit
13:19:49PMunchI guess it should be mapIt(my2Dseq, it.countIt(it > 42)).foldl(a + b) or something like that
13:21:02FromDiscord<kaddkaka> `grid.foldl(a + b.countIt(it>1), 0)` works fine too
13:23:15PMunchOh yeah, that should also work fine
13:25:06FromDiscord<kaddkaka> `grid.countIt(it>1)` would of course be even more to the point (count all elements in this container that are `>1`), like @Solitude said. I have to read about iterators.
13:26:15FromDiscord<kaddkaka> although, that form would be ambiguous I guess
13:27:14FromDiscord<kaddkaka> I think `let s = grid.flatten.countIt(it>1)` shows intent in a better way.
13:27:16PMunchI meant you could do `template countIt[T](s: seq[seq[T], x: untyped): int = foldl(s, let it = b; a + x, 0)` or something like that
13:27:25FromDiscord<kaddkaka> (edit) "`let s = grid.flatten.countIt(it>1)`" => "`grid.flatten.countIt(it>1)`"
13:27:40PMunchFlatten is probably more expensive than foldl though
13:27:54PMunchBecause you then need to allocate a 1D seq that contains your 2D seq
13:28:16FromDiscord<kaddkaka> Really? can't flatten be implemented as an iterator that doesn't allocate anything?
13:29:09FromDiscord<Solitude> it can, but then you need a for loop or another countIt that works on iterators
13:29:28FromDiscord<kaddkaka> In reply to @PMunch "I meant you could": The problem is that this hides the original meaning of `countIt` in this case.
13:30:40FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3KPh
13:31:11FromDiscord<Solitude> s: iterable[T] or something
13:31:49FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3KPi
13:32:18FromDiscord<kaddkaka> (edit) "https://play.nim-lang.org/#ix=3KPi" => "https://play.nim-lang.org/#ix=3KPj"
13:35:00FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3KPk
13:35:06FromDiscord<kaddkaka> 😄
13:36:07FromDiscord<Solitude> zamn
13:37:18FromDiscord<kaddkaka> So `countIt` just works 👍
13:53:18FromDiscord<valerga> gotta like the It functions
13:55:48FromDiscord<kaddkaka> Are there other languages that allows the expression syntax like Nim does for? (`foreach` in systemverilog is similar, with the exception that it's more of a super ugly hack, https://www.chipverify.com/systemverilog/systemverilog-foreach-loop)
13:56:35FromDiscord<Rika> Which syntax are we talking about
13:56:54FromDiscord<Rika> Parentheses omission?
13:57:30FromDiscord<kaddkaka> The `it>1` part in `s.countIt(it>1)`
13:58:09FromDiscord<Rika> Lisp
13:58:17FromDiscord<Rika> Probably rust
13:58:24FromDiscord<Rika> Anything with macros (probably)
13:58:28FromDiscord<Rika> Yes that includes C
13:59:46FromDiscord<kaddkaka> Is it called anything specific? Or is it just too ordinary to merit it's own name
14:02:04FromDiscord<kaddkaka> (seen as just a (trivial) cosequence of macros)
14:03:20*sagax joined #nim
14:05:21*rockcavera joined #nim
14:05:21*rockcavera quit (Changing host)
14:05:21*rockcavera joined #nim
14:07:02FromDiscord<Rika> untyped macros?
14:07:03FromDiscord<Rika> idk
14:07:09FromDiscord<Rika> theres prolly no single name for it
14:10:09*arkurious joined #nim
14:10:20*jjido joined #nim
14:20:35*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:30:06*lumo_e joined #nim
14:59:11*noeontheend joined #nim
15:09:37*neurocyte quit (Ping timeout: 240 seconds)
15:11:33*neurocyte joined #nim
15:26:08*Vladar joined #nim
15:26:16*Vladar quit (Client Quit)
15:37:38FromDiscord<Clonkk> is there a compile time equivalenty of `walkPattern` or do I have to call bash through `staticExec` ?
15:38:15FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3KRF
15:39:18FromDiscord<Rika> w-what
15:39:19FromDiscord<Rika> no
15:39:25FromDiscord<Rika> you want goto?
15:39:49*noeontheend quit (Ping timeout: 240 seconds)
15:39:49FromDiscord<Rika> split the proc into two and run only the first half
15:39:59FromDiscord<el__maco> in the intercal language you could specify a probability for each instruction to execute. You could sometimes print "b" depending on luck
15:40:06FromDiscord<Rika> thats terrifying
15:40:14FromDiscord<hmmm> lol
15:41:52FromDiscord<el__maco> they also had a way better mechanism since gotos are bad, they had "come from" instead. You could split a block by specifying a come from instruction somewhere else
15:42:43FromDiscord<Rika> thats incrementally less terrifying
15:42:58FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3KRL
15:43:23FromDiscord<hmmm> like some sort of switch lol
15:43:44FromDiscord<Solitude> how do you affect the switch
15:44:01FromDiscord<hmmm> I have no idea lol
15:44:05FromDiscord<Solitude> ?????
15:44:08FromDiscord<Solitude> what are you doing?
15:44:12FromDiscord<el__maco> its not clear to me in which situation the second statement should run and not run
15:45:08FromDiscord<hmmm> nah what I wanted to do is already solved now changing the proc and using an if, but still I had the curiousity it could be done without changing the proc if I set the machinery beforehand
15:45:21FromDiscord<Rika> no
15:45:28FromDiscord<el__maco> maybe a "when" statement?
15:45:41FromDiscord<Rika> he said "without changing the proc"
15:45:49FromDiscord<Rika> so no code can be added to the proc
15:45:55FromDiscord<Rika> is what i assume
15:45:59FromDiscord<Rika> so goto
15:46:10FromDiscord<Rika> (?)
15:46:31FromDiscord<Rika> i cant see too well how a goto would help
15:46:42FromDiscord<Rika> el maco is right, the come from thing would work best
15:46:44FromDiscord<hmmm> yea, I wanted some way that detected that the statement was in some way special and used {magic} machinery to decide to run or not lol
15:46:46FromDiscord<Rika> 👀
15:46:50FromDiscord<el__maco> but adding a goto also would change the proc. I see Intercal has the superiority here, because "come from" would solve this
15:46:56FromDiscord<Rika> In reply to @hmmm "yea, I wanted some": that is legitimately scary
15:47:17FromDiscord<Rika> In reply to @el__maco "but adding a goto": its not a good problem-solution pair
15:47:29FromDiscord<Rika> need to reframe the issue in a better problem
15:48:00FromDiscord<el__maco> I feel like its perfect problem-solution pair, but maybe I don't understand the motivation deeply enough
15:48:32FromDiscord<Rika> ah
15:48:43FromDiscord<Rika> you could probably abuse term rewriting macros in a way
15:48:59FromDiscord<hmmm> well the motivation was kind of A E S T H E T I C since I felt the proc was perfect and special casing the if was ugly lol
15:49:01FromDiscord<Rika> good luck figuring that out
15:49:28FromDiscord<Rika> In reply to @hmmm "well the motivation was": if you think its ugly, find another way that isnt the if and isnt the "do some fuckery without changing the code"
15:49:34FromDiscord<hmmm> especially introducing a parameter just to check the if felt very ugly
15:49:35FromDiscord<Rika> like maybe refactor the function
15:49:39FromDiscord<Rika> it might be doing too much
15:50:02FromDiscord<Rika> if you have too many parameters then you might want to reconsider what they do
15:50:13FromDiscord<Rika> and again your function might be doing too much if so
15:51:17FromDiscord<Solitude> write another function
15:51:17*lumo_e quit (Ping timeout: 240 seconds)
15:51:29FromDiscord<Rika> sent a long message, see http://ix.io/3KRO
15:51:43FromDiscord<hmmm> like the if checking was done just to check an edge case and I wanted my pretty pure proc to stay pretty
15:51:44FromDiscord<Clonkk> So basically you want to use a very complex solution to a very simple problem because "it looks good" ?↵(@hmmm)
15:51:56FromDiscord<Rika> i generally think around six is too many parameters
15:52:12FromDiscord<hmmm> In reply to @Clonkk "So basically you want": exactly! the question is dumb lol, but I thought maybe nim had machinery I didn't know of
15:52:32FromDiscord<el__maco> you can join the anti if movement if you haven't already <https://francescocirillo.com/pages/anti-if-campaign>
15:52:42FromDiscord<Solitude> In reply to @hmmm "exactly! the question is": write a macro that gets procedure implementation and modifies its body
15:53:51FromDiscord<Clonkk> It's called "if statement" lol↵(@hmmm)
15:55:28FromDiscord<hmmm> In reply to @Clonkk "It's called "if statement"": haha ok ok, I got the message lol, it was just curiosity. Now I'll just lurk in the shadows waiting for ElegantBeef to produce a 20 lines monstrosity to elegantly solve my problem with macros or other weird constructs just for kicks 😃
15:55:32FromDiscord<Clonkk> Design your own iinterpreted language so you can change code executed at run-time and re-implement your application with the interpreted language.↵(@Solitude)
15:55:46FromDiscord<0000> In reply to @hmmm "like the if checking": use haskell
15:56:59FromDiscord<0000> sent a code paste, see https://play.nim-lang.org/#ix=3KRS
15:57:23FromDiscord<0000> is there some magic macro on nimble that enables pattern matching over procedure parameters?
15:57:25FromDiscord<0000> that could be fun
15:57:47FromDiscord<Solitude> there was one for object variants
15:58:01*neurocyte quit (Quit: The Lounge - https://thelounge.chat)
15:58:11FromDiscord<0000> neat
16:01:48FromDiscord<Rika> In reply to @hmmm "haha ok ok, I": it wont be elegant i can tell
16:02:31FromDiscord<Rika> In reply to @Clonkk "Design your own iinterpreted": i feel like such a thing exists already
16:08:12*neurocyte joined #nim
16:16:00FromDiscord<zetashift> @treeform\: heyho, treeform, I'm working on my Pixie backend for ginger again, and I'm getting an error, using `context.strokeCircle` \: https://nimdocs.com/treeform/pixie/pixie/context.html#strokeCircle%2CContext%2CVec2%2Cfloat32 I also can't find it in the source anymore? Am I doing something wrong?
16:17:04FromDiscord<zetashift> it seems the only proc it can find is the one where a `Circle` is given but not a `center: Vec2, radius: Float`
16:19:06FromDiscord<Forest> Nim is mentioned quite often in the Python Discord 👀
16:21:32FromDiscord<Recruit_main707> nice
16:22:10FromDiscord<hmmm> the question is what took them so long 😃
16:43:34PMunchHmm, maybe I should join the Python Discord and set up keyword notifications on the word Nim
16:43:45PMunchWould be interesting to see what they say about us :)
17:10:00*lumo_e joined #nim
17:17:12*Gustavo6046 joined #nim
17:17:25FromDiscord<Rika> keyword notifications do not exist on discord unless you use client modifications or a 3rd party client
17:17:54FromDiscord<kevin> Is there a recommended way to list out processes from Nim? C# has `Process.GetProcesses()` but i couldn't find something like that in Nim.
17:19:08FromDiscord<TryAngle> In reply to @Rika "keyword notifications do not": I mean self bots are a thing and using them like this surely won't be against the TOS no?
17:19:14FromDiscord<kevin> closest I could find is `GetCurrentProcessId()` : https://nim-lang.org/docs/os.html#getCurrentProcessId which only shows the current process, not all
17:19:24FromDiscord<Rika> In reply to @TryAngle "I mean self bots": guess
17:21:44FromDiscord<treeform> In reply to @zetashift "<@107140179025735680>\: heyho, treeform, I'm": We changed the API a bit. Just create a circle and pass that in?
17:22:44FromDiscord<zetashift> Ah I see, I will, thank you! \:D
17:23:26FromDiscord<IsaacPaul> In reply to @kevin "closest I could find": Searching `[Process]` in the nim repo doesn't reveal much. I'm assuming you might have to implement that functionality yourself.
17:24:01FromDiscord<kevin> darn i was hoping that wasn;t gonna be the answer 😦
17:26:24*rockcavera quit (Remote host closed the connection)
17:27:08*oprypin quit (Ping timeout: 252 seconds)
17:28:46*oprypin joined #nim
17:35:58FromDiscord<eyecon> In reply to @kevin "Is there a recommended": Should be this: https://github.com/khchen/winim/search?q=EnumProcessModulesEx
17:36:58FromDiscord<eyecon> https://docs.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-enumprocessmodulesex
17:38:54*jjido joined #nim
17:40:01FromDiscord<treeform> In reply to @zetashift "Ah I see, I": strokeCirlce is not part of the Canvas context spec so we are free to do what we want. We initially had the strokeCirlce(vec2, float) and strokeCirlce(cirlce) but decided it was redundant. Its so easy to create a circle obj)
17:48:17*lumo_e quit (Ping timeout: 240 seconds)
17:48:42*lumo_e joined #nim
17:58:33*Gustavo6046 quit (Quit: Leaving)
18:04:02*kayabaNerve_ quit (Ping timeout: 260 seconds)
18:16:28*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
18:21:21*rockcavera joined #nim
18:21:21*rockcavera quit (Changing host)
18:21:21*rockcavera joined #nim
18:24:07*jjido joined #nim
18:26:43*Gustavo6046 joined #nim
18:31:06PMunch@kevin, this is really not something that's easy to do from a program. C# is only able to do it because it does a lot of stuff behind the scenes, including keeping track of the processes it starts
18:33:57*lumo_e quit (Ping timeout: 240 seconds)
18:39:08FromDiscord<kevin> Every OS has it's own version of ps/tasklist so it should be doable. From a little reading it looks like every OS enumerates currently running processes differently.
18:39:35PMunchOh it's definitely possible, but it's an OS dependent thing
18:39:42PMunchProbably easier to just keep track yourself
18:39:47FromDiscord<kevin> It's definitely over my head to write that kind of code, but would be cool in the future to have a library function in `os` to get all processes
18:40:11PMunchNot sure what you'd use it for
18:40:26FromDiscord<kevin> listing processes of course! 😄
18:40:44FromDiscord<kevin> same reason windows has tasklist and linux has ps
18:41:22FromDiscord<IsaacPaul> https://github.com/warmchang/procps/blob/master/proc/readproc.c↵seems like a pain, but this code fetches everything it seems.
18:41:39FromDiscord<IsaacPaul> It's probably a good reference
18:47:06FromDiscord<zetashift> I get it, I was just confused because I still saw it in the docs haha, I've changed it to making a circle first!↵(@treeform)
18:51:17FromDiscord<ache of head> In reply to @el__maco "you can join the": wait, is this fr or a joke?
18:51:19FromDiscord<ache of head> i can't tell
18:56:06FromDiscord<IsaacPaul> Seems like a joke since they only provide a bad example instead of both a good and bad. Though the example code is _bad_. Horizontal complexity (early exit) costs less mentally than vertical (depth; nested).
18:58:05FromDiscord<IsaacPaul> Most of the time you're always just rearranging things rather than removing ifs unless you have duplicate code/behavior.
19:00:39*lumo_e joined #nim
19:06:34FromDiscord<creikey> In reply to @IsaacPaul "Seems like a joke": ever indentation I see while reading a program raises my blood pressure a little bi
19:06:37FromDiscord<creikey> (edit) "ever" => "every"
19:06:40FromDiscord<creikey> (edit) "bi" => "bit"
19:08:24FromDiscord<zetashift> @treeform\: context.font is a string now, what is the way to change the size of fonts being drawn onto the context now?
19:10:01FromDiscord<treeform> In reply to @zetashift "<@107140179025735680>\: context.font is a": yes `ctx.fontSize`
19:10:32FromDiscord<treeform> https://github.com/treeform/pixie/blob/master/src/pixie/contexts.nim#L19
19:10:37*Gustavo6046 quit (Ping timeout: 240 seconds)
19:11:43FromDiscord<zetashift> ah I missed that, thank you!
19:12:15*Gustavo6046 joined #nim
19:21:31*Guest8731 joined #nim
19:38:57*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:41:23*jjido joined #nim
19:50:50FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3KTy
19:54:13FromDiscord<Solitude> `type t = typeof(0)`
19:54:20FromDiscord<geekrelief> Also, I'm trying to pass a type to a macro and call `getTypeImpl` on it, but it doesn't return anything like `getImpl` which is what I want after it's been transformed.
19:54:40FromDiscord<geekrelief> In reply to @Solitude "`type t = typeof(0)`": thanx! I was trying `var t:type ...`
19:54:44FromDiscord<geekrelief> (edit) "thanx!" => "thanks!"
19:56:08FromDiscord<geekrelief> In reply to @Solitude "`type t = typeof(0)`": if I `echo t.repr` that doens't compile
19:56:14FromDiscord<geekrelief> (edit) "doens't" => "doesn't"
19:57:08FromDiscord<Solitude> !eval type t = typeof 0; echo t
19:57:11NimBott
19:57:22FromDiscord<geekrelief> yeah it gives t
19:57:50FromDiscord<geekrelief> it should be int right?
19:58:02FromDiscord<Solitude> no?
19:58:27FromDiscord<geekrelief> ok that's not what I want.. I don't want to define a new type t of int
19:58:51FromDiscord<geekrelief> I want to store the typedesc
19:59:18FromDiscord<Solitude> thats how you "store" typedesc
19:59:46FromDiscord<Solitude> in macro you can extract whatever info you need
20:00:27FromDiscord<geekrelief> yeah that's ultimately what I'm working with. Inside a macro I'm trying to call `getTypeImpl`, but it's not returning the transformed type.
20:04:47FromDiscord<Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3KTH
20:04:49FromDiscord<Solitude> kinda cringe
20:04:54FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3KTI
20:05:58FromDiscord<geekrelief> Is there a way for me to pass in the type `Vec4f` and get transformed into `object...`?
20:06:45FromDiscord<Solitude> yes
20:06:49FromDiscord<Solitude> snippet i posted
20:06:57FromDiscord<Solitude> gets you resolved type
20:07:06FromDiscord<Solitude> you call getImpl on that and do whatever
20:07:40FromDiscord<geekrelief> In your sample `t` has to be `typedesc` and not typed?
20:07:56FromDiscord<Solitude> it doesnt matter
20:09:37*noeontheend joined #nim
20:09:39FromDiscord<geekrelief> In reply to @Solitude "it doesnt matter": hmm doesn't work for me
20:10:09FromDiscord<geekrelief> https://play.nim-lang.org/#ix=3KTL
20:10:36FromDiscord<Solitude> man, i just posted the code
20:10:55FromDiscord<Solitude> https://play.nim-lang.org/#ix=3KTM
20:11:00FromDiscord<geekrelief> yeah I just put it in playground, it's not giving me what I need
20:12:36FromDiscord<geekrelief> In reply to @Solitude "https://play.nim-lang.org/#ix=3KTM": Thanks for the clarification. Sorry to bother.
20:12:56FromDiscord<michaelb> nim does some auto-magic where if e.g. you have an array of `cchar` and you print it, then a member with value equiv to `27.cchar` is printed as `'\e'` (and similar for tab char etc.)↵↵is there a way to do that manually, e.g. a proc I can call with a `string` and it would replace control characters with the `\` equiv?
20:12:58FromDiscord<yallxe> hi, is there something like args or kwargs from python in nim?
20:13:41FromDiscord<Solitude> In reply to @yallxe "hi, is there something": varargs. no substitute for kwargs.
20:14:28FromDiscord<yallxe> In reply to @Solitude "varargs. no substitute for": thanks
20:14:56FromDiscord<Solitude> In reply to @brainproxy "nim does some auto-magic": https://nim-lang.org/docs/strutils.html#escape%2Cstring%2Cstring%2Cstring but it does more than that, so you might need to steal part of it
20:31:48FromDiscord<Casey.McMahon> sent a code paste, see https://paste.rs/Coe
20:32:39FromDiscord<geekrelief> In reply to @Casey.McMahon "hello, I would like": use `ptr PwmConfig` as the type for the argument
20:34:37FromDiscord<Casey.McMahon> In reply to @geekrelief "use `ptr PwmConfig` as": thanks! I'll give that a go.
20:35:37FromDiscord<geekrelief> This is so weird. I don't understand why I need to call `getTypeImpl` twice here: https://play.nim-lang.org/#ix=3KTU
20:37:48*Guest8731 left #nim (#nim)
20:40:32FromDiscord<Casey.McMahon> sent a code paste, see https://play.nim-lang.org/#ix=3KTY
20:40:52FromDiscord<geekrelief> `config.addr`
20:41:13FromDiscord<geekrelief> https://nim-lang.github.io/Nim/system.html#addr%2CT
20:41:47FromDiscord<geekrelief> There's also `unsafeAddr` which you may need to use depending on how config is defined.
20:43:00FromDiscord<Casey.McMahon> In reply to @geekrelief "There's also `unsafeAddr` which": you had to use `unsafeAddr`.
20:43:06FromDiscord<Casey.McMahon> (edit) "you" => "yeah,"
20:50:24NimEventerNew thread by Geekrelief: `getTypeImpl` bug?, see https://forum.nim-lang.org/t/8767
21:05:21FromDiscord<yallxe> how do I write `byte` to string buffer (from `std/streams`)? so the string will be like `"\x00"` if byte is 0
21:18:45FromDiscord<geekrelief> In reply to @yallxe "how do I write": not sure what you're asking for.
21:19:49FromDiscord<Elegantbeef> They want to escape non printable charas
21:19:52FromDiscord<geekrelief> you want to `strm.write('\x00')` and have it return what?
21:21:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3KU6
21:21:58FromDiscord<treeform> In reply to @yallxe "how do I write": You can see how I do that in my print library: https://github.com/treeform/print/blob/master/src/print.nim#L70-L85
21:22:57*noeontheend quit (Ping timeout: 240 seconds)
21:38:25FromDiscord<Hamid_Bluri> Hey treeform
21:38:42FromDiscord<Hamid_Bluri> any news about fidget?
21:41:44FromDiscord<yallxe> In reply to @geekrelief "you want to `strm.write('\x00')`": yes but i have a byte type
21:42:17FromDiscord<yallxe> i converted byte to int and made stream.write($chr(n))
21:42:27FromDiscord<yallxe> seems to work pretty good
21:43:00*drewr joined #nim
21:43:17FromDiscord<hmmm> also will fidget2 follow the venerable pokemon naming standards and be called fidgeotto?
21:43:28FromDiscord<hmmm> naming matters in nim-land 🧐
21:43:33FromDiscord<yallxe> In reply to @yallxe "i converted byte to": https://media.discordapp.net/attachments/371759389889003532/927678596632444958/IMG_20220103_224258_395.jpg
21:43:37FromDiscord<yallxe> like this
21:43:59FromDiscord<yallxe> and no stream actually
21:45:12FromDiscord<Solitude> you dont need to `$` chars to add them to string
21:51:45*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:52:12FromDiscord<yallxe> In reply to @Solitude "you dont need to": strange cuz my vscode plugin was telling me that this is incorrect
21:52:35FromDiscord<Solitude> never trust vscode plugin
22:01:02FromDiscord<krisppurg> @treeform thought id ping you this because this is a bit more important↵https://discord.com/channels/371759389889003530/371759389889003532/927495259062140928
22:01:45FromDiscord<evoalg> In reply to @kevin "Is there a recommended": Does https://github.com/juancarlospaco/psutil-nim help?
22:06:34FromDiscord<yallxe> In reply to @kevin "Is there a recommended": you may use EnumProcesses from c++
22:06:39FromDiscord<yallxe> import it or use winim
22:07:02FromDiscord<yallxe> or use the easier option if you do not care about dependencies
22:07:06FromDiscord<yallxe> above one
22:07:38FromDiscord<treeform> In reply to @krisppurg "<@!107140179025735680> thought id ping": It's strange my tests did not catch that.
22:12:32FromDiscord<krisppurg> jsony to me is acting weird sometimes for me
22:13:41FromDiscord<kevin> In reply to @evoalg "Does https://github.com/juancarlospaco/psutil-nim h": Yeah, this looks promising. I will try to make this work. Thank you for the suggestion! 😄
22:27:32FromDiscord<hmmm> [Finished in 425.5s] 🤔
22:41:37*drewr quit (Ping timeout: 240 seconds)
22:41:50FromDiscord<treeform> In reply to @krisppurg "jsony to me is": I pushes some bug fixes
22:42:14FromDiscord<Smarc> If anyone has some spare time and is willing to help an amateur, I would really appreciate someone reviewing my code and give me some advice on how to optimize it :)↵https://github.com/Smarcy/connect_the_dotfiles
23:00:37FromDiscord<Solitude> Please, for the love of god, dont commit binaries to git...
23:06:51nrds<Prestige99> Why not
23:10:02FromDiscord<hmmm> u r not my supevisor
23:10:04FromDiscord<hmmm> I have the photo of my lover on git
23:14:14FromDiscord<IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3KUL
23:15:46FromDiscord<IsaacPaul> If this was production code. I'd say it needs more error handling. `open` and `readFile` probably can crash...
23:18:12FromDiscord<IsaacPaul> Also don't have sections of commented code if they're already in your git history
23:20:31FromDiscord<congusbongus> binary dependencies are ok if the language doesn't have a good package manager↵otherwise use the build system for distributing binaries, they don't belong in source control
23:43:32*noeontheend joined #nim
23:51:49*krux02 joined #nim