<< 11-08-2022 >>

00:09:15FromDiscord<Bubblie> Honestly if there was more documentation on making backends id appreciate that 💀
00:10:37FromDiscord<Bubblie> Definitely want to make a java backend so I dont have to use java anymore LMFAOOO but I dont know where to start with it honestly
00:12:47FromDiscord<leorize> while a jvm backend is probably not on the table anytime soon, jnim exists to let you interface with java from Nim \:p
00:19:25FromDiscord<Forest> Bub means to implement one ourselves
00:19:41FromDiscord<Forest> Just need better documentation (I'm gonna try making my backend for Cyo and Nim, see the differences-)
00:20:34FromDiscord<Prestige> It would be awesome to have, if it were to work properly
00:20:38FromDiscord<Bubblie> yes
00:20:46FromDiscord<Bubblie> Nim on the jvm would be a dream come true honestly
00:20:57FromDiscord<Forest> Oh absolutely
00:21:56FromDiscord<Forest> In reply to @Avahe "It would be awesome": I have ideas on multiple ways of implementation, what matters is how would we take advantage of the fact Java has classes and interfaces
00:40:13FromDiscord<Elegantbeef> Cause a ref count overhead is actually something significat?↵(@Tuatarian)
00:40:28*krux02 quit (Remote host closed the connection)
00:41:58FromDiscord<Bubblie> https://hastebin.com/ixenuledit.less im unsure as to what is happening in this error, it seems to be the only error im getting?
00:45:57FromDiscord<Tuatarian> In reply to @Elegantbeef "Cause a ref count": I mean, it could be, especially on old weak hardware
00:46:13FromDiscord<SaAnd> note\: it is not an atomic refcount
00:52:27FromDiscord<Tuatarian> Oh
00:53:31FromDiscord<Tuatarian> So that's the main difference vs swift then?
00:58:24FromDiscord<foobar-85> Howdy all. I am reading the nim book, well done btw, and I would like to ask, from the expressiveness point of view, why decorating the code with .async. pragmas and async, await, keywords are helpful? I understand why languages do that from the technical PoV, but to me it feels like a big blow to expressiveness.
00:58:55FromDiscord<Elegantbeef> Well all code isnt async so you need to explicitly state what is async
00:59:07FromDiscord<Elegantbeef> Otherwise you dont know where to give your cpu up
01:00:33FromDiscord<Elegantbeef> I dont know how you do it otherwise
01:03:07FromDiscord<Tuatarian> Async is rarely the default way to write a piece of code, so it makes sense that it's not the default for the language, if that's what you're asking
01:10:50FromDiscord<treeform> In reply to @xcodz-dot "I was looking through": Just `import pixie/fileformats/png` and use the `decodePng` function that gives you a `Png` object that has `.data` as non straight-alpha data.
01:11:04FromDiscord<treeform> (edit) removed "non"
01:11:40FromDiscord<treeform> You can access extra information about images by using their pixie/fileformats png, jpeg, gif files.
01:11:55FromDiscord<treeform> Like straight alpha, number of channels, animate gifs etc...
01:13:07FromDiscord<treeform> See more here about the png stuff: https://nimdocs.com/treeform/pixie/pixie/fileformats/png.html
01:13:43FromDiscord<foobar-85> Well, async is implicit when a Future is returned, I guess that the the pragma could be deduced at compile time, and async keyword injected at compile time as well.
01:14:15FromDiscord<Prestige> Interesting idea
01:14:41FromDiscord<foobar-85> Unless async decorations add to expressiveness for some reason…
01:14:42FromDiscord<!Patitotective> i think using the async pragma is clearer
01:15:50FromDiscord<Prestige> It doesn't really make a difference but having something like `async foo() = ...` would be nice. I suppose that could be done
01:16:40FromDiscord<Elegantbeef> well foobar that requires having async support in the compiler
01:16:49FromDiscord<Elegantbeef> Which is a bit ehhh
01:16:55FromDiscord<Elegantbeef> Nim is supposed to be a small language extended in user space
01:17:15FromDiscord<!Patitotective> i agree, that just adds another keyword that can just be a pragma
01:17:19FromDiscord<Elegantbeef> No clue if it's true that all Futures are asyncable procedures either
01:17:53FromDiscord<!Patitotective> yea, you can return an async proc future through a sync proc
01:18:28FromDiscord<Elegantbeef> The async pragma is a macro that transforms the AST of the procedure, it's not just a marker
01:18:41FromDiscord<foobar-85> Can’t await be deduced from the call chain?
01:19:05FromDiscord<Prestige> What if you don't want to await the procedure though?
01:19:29FromDiscord<foobar-85> You can’t call it without await, can you?
01:20:03FromDiscord<foobar-85> (Thinking of Python here, haven’t tried Nim’s yet)
01:20:20FromDiscord<Elegantbeef> you can do `waitfor` which turns an async into a blocking op
01:20:27FromDiscord<Elegantbeef> And how you call async code from non async
01:20:34FromDiscord<Elegantbeef> Or one way
01:21:53FromDiscord<Prestige> I think you could call it without await, and would just get a Future
01:22:51FromDiscord<Elegantbeef> Indeed
01:22:52FromDiscord<Elegantbeef> Nim calling semantics dont change
01:23:00FromDiscord<Elegantbeef> It's completely to call a future and hold onto it to finish it later
01:23:10FromDiscord<Elegantbeef> call to get a future
01:23:25FromDiscord<SaAnd> Swift\: ARC = Atomic Reference Counting↵Nim\: ARC = Automatic Reference Counting↵(@Tuatarian)
01:24:31FromDiscord<SaAnd> see\: https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html
01:25:17FromDiscord<huantian> In reply to @foobar-85 "(Thinking of Python here,": python also allows you to not await things right?
01:25:52FromDiscord<foobar-85> IIRC nop. But I could be wrong.
01:26:42FromDiscord<Prestige> python be weird
01:27:10FromDiscord<huantian> https://media.discordapp.net/attachments/371759389889003532/1007097815610167356/unknown.png
01:27:19FromDiscord<Prestige> Nice
01:28:33FromDiscord<foobar-85> I see, thanks for all the answers. I have this personal taste against the async syntax, but it could be me alone.
01:30:13FromDiscord<Prestige> what would you prefer, `async proc foo()` ?
01:30:14FromDiscord<Elegantbeef> I think it's a needed syntax
01:32:31FromDiscord<foobar-85> In my ideal world it would be deduced and defaulted to no keyword for the most common usage. Omitting `await` on calls would default to an await, unless otherwise requested to not await and get the future. ↵I’d attempt to deduce the pragma async too.
01:32:41FromDiscord<huantian> In reply to @Elegantbeef "No clue if it's": yeah for example, the all function <https://nim-lang.org/docs/asyncfutures.html#all%2Cvarargs%5BFuture%5BT%5D%5D>
01:33:17FromDiscord<Prestige> I mean the compiler can't deduce if you want to await the code or not
01:33:32FromDiscord<huantian> though you probably could do it with async?
01:34:42FromDiscord<Bubblie> can I post my issue again it seemed to have been burried in chat, its okay if im not allowed
01:35:05FromDiscord<Prestige> Go for it
01:35:41FromDiscord<Bubblie> https://hastebin.com/ixenuledit.less im not even sure if I can call this much of an error since nim isn't giving me much information except this?
01:36:02FromDiscord<Bubblie> ive been having a hard time trying to decipher what is wrong
01:37:37FromDiscord<foobar-85> In reply to @Elegantbeef "I think it's a": Due to expressiveness or implementation details?
01:37:47FromDiscord<Elegantbeef> Due to a requirement of logic
01:38:20FromDiscord<foobar-85> Humm, mind expanding?
01:39:11FromDiscord<Elegantbeef> I think it's unwise to infer async and whether to await as it hides whether the code runs blocking or not
01:40:00FromDiscord<Prestige> And also, how is the program supposed to know if the programmer intended to block or not?
01:40:26FromDiscord<Elegantbeef> defaults to `await` on procs that return `Future`
01:41:17FromDiscord<Prestige> But then you can't _not_ block, can you?
01:41:27FromDiscord<foobar-85> In reply to @Bubblie "https://hastebin.com/ixenuledit.less im not even": Do you have `-` in your filename?
01:41:47FromDiscord<Elegantbeef> You'd do `waitfor myAsync()`
01:41:56FromDiscord<Bubblie> In reply to @foobar-85 "Do you have `-`": sorry?
01:41:59FromDiscord<Bubblie> I mean
01:42:01FromDiscord<Bubblie> in the folder
01:42:03FromDiscord<Elegantbeef> The default would be to await, the major issue is you cannot hold onto a future to finish later
01:42:06FromDiscord<Bubblie> where the nim file is located
01:42:11FromDiscord<Bubblie> its ngpu-example
01:42:18FromDiscord<Bubblie> would that cause issues?
01:42:23FromDiscord<Bubblie> the nim file itself is
01:42:25FromDiscord<Bubblie> triangle.nim
01:42:49FromDiscord<Prestige> In reply to @Elegantbeef "The default would be": Yeah that's my point
01:42:59FromDiscord<foobar-85> Not sure if it is allowed in folder name. Dash is not allowed in filename.
01:43:38FromDiscord<foobar-85> In reply to @Elegantbeef "The default would be": You can have a `skipAwait` keyword for the less common usage
01:43:41FromDiscord<Bubblie> I understand that for file names, just folder names hmmm
01:43:47FromDiscord<Bubblie> let me try changing it
01:44:18FromDiscord<Bubblie> yeah same issue
01:45:16FromDiscord<Bubblie> these are wgpu bindings so im unsure if I need to specify a backend since wgpu is a graphics api that runs on top of existing ones
01:45:20FromDiscord<Elegantbeef> The way i see it all this async stuff requires compiler support, and i really dont think the compiler needs to be concerned with async
01:45:21FromDiscord<Bubblie> like vulkan, opengl, etc.
01:45:48FromDiscord<Bubblie> thats probably it
01:45:57FromDiscord<Bubblie> ill keep continuing and see if I can set this up properly...
01:46:18FromDiscord<Bubblie> I chose a very annoying project to do 💀
01:46:29FromDiscord<foobar-85> Plus, holding to futures feel anti-expressive to me. I’d make this usage more verbose and facilitate the awaiting style. ↵I see the point about the compiler, I’d agree.
01:47:17FromDiscord<Elegantbeef> holding onto futures is a totally valid thing though, and actually used for some things
01:47:33FromDiscord<foobar-85> True. It is valid.
01:47:33FromDiscord<Elegantbeef> It's not the typical usage but sometimes you just make a bunch of futures then want to do things with them
01:49:56FromDiscord<foobar-85> In current implementation holding to futures is the easy style, wrt expressiveness. It is just types and functions. No special macro or keywords. The async/await is the verbose style. But which is the most common one from the expected usage?
01:51:12FromDiscord<foobar-85> Anyways, I just wanted to bring this into thinking. I don’t have a decently elaborated proposal. Sorry for the questioning and thanks for the responses.
01:51:30FromDiscord<huantian> I mean it's a pretty logical question to ask tbh
01:58:10FromDiscord<SaAnd> beef, is it possible for a macro to work on the callsite, since this is the sort of thing foobar brings up?
01:58:35FromDiscord<Elegantbeef> you mean like `await` and `waitfor`? 😄
01:58:46FromDiscord<Elegantbeef> There are term rewriting macros
01:59:03FromDiscord<Elegantbeef> But they're not meant for this
02:12:56FromDiscord<Forest> In reply to @Bubblie "these are wgpu bindings": Probably do tbh
02:13:18FromDiscord<Forest> Let me see if it's actually defined in the header file
02:17:24FromDiscord<Forest> Uh @Bubblie, the actual implementation doesn't have a way to define it I don't think-
02:17:26FromDiscord<Forest> The backend-
02:18:02FromDiscord<Forest> Uhhhhhhhhhhhhh how do you define stuff for Futhark then-
02:36:32FromDiscord<Forest> Ah nvm
02:38:22*arkurious quit (Quit: Leaving)
02:39:48FromDiscord<Forest> How do i compile C code without defining a new file, is that possible?-
02:41:15FromDiscord<!Patitotective> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma ?
02:41:47FromDiscord<Forest> Yup that's it! Thanks!
02:53:22FromDiscord<Forest> Checking real quick
02:53:39FromDiscord<Forest> Is `#define WGPU_IMPLEMENTATION WGPUBackendType.WGPUBackendType_OpenGL` valid C?
02:55:34FromDiscord<Forest> It is-
03:44:12*xcodz-dot joined #nim
04:01:05*xcodz-dot Rolls a 6 sided dice and gets 5
04:04:10FromDiscord<Elegantbeef> Congrats you win $100 dollars!
04:18:26FromDiscord<Tuatarian> Roll d6?
04:18:41FromDiscord<Elegantbeef> Use ARC you ingrate.
04:19:47xcodz-dotwhat?
04:19:58xcodz-dotI was just messing up with IRC
04:20:06xcodz-dotand there seems to be this command to roll a dive
04:20:08xcodz-dotdice*
04:20:48FromDiscord<huantian> I always forget about my lmgty command
04:20:50FromDiscord<huantian> I need to use that more
04:21:03xcodz-dotlol, what is lmgty btw?
04:21:45FromDiscord<huantian> forgot an f, lmgtfy
04:21:54FromDiscord<huantian> <https://lmgtfy.com/?q=&s=l>
04:21:59FromDiscord<huantian> wow it broke
04:22:59xcodz-dotK, now I really understand what it is
04:23:15xcodz-dota few seconds of googling and now I am updated with all that info
04:27:20*xcodz-dot quit (Quit: Connection closed)
04:40:03*rockcavera quit (Remote host closed the connection)
04:59:55FromDiscord<Girvo> Hi all!
05:00:44FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=47fE
05:17:23FromDiscord<Girvo> Also, `intptr_t` is just `int` right? At least thats how `kqueue.nim` uses it
05:19:56FromDiscord<Elegantbeef> `multi_heap_info = ptr object` is also valid i think
05:20:07FromDiscord<Girvo> Okay I think thats clearer
05:20:08FromDiscord<Girvo> Cheers
05:20:15FromDiscord<Elegantbeef> And yea `intptr_t` is just an int the size of a pointer
05:20:22FromDiscord<Girvo> Sweet 🙂
06:15:27FromDiscord<Girvo> Anyone used transfer-encoding: chunked responses on the Nim side? I have the fun job of trying to tie it to some specific memory allocated in a weird way, to basically grab a megabyte of data 1KB at a time, and not sure the best way to go about it, short of parsing the headers and handling the `recv` myself, basically
06:18:03FromDiscord<Elegantbeef> This sounds like a job of a closure iterator or stream
06:29:09FromDiscord<noiryuh> how do i change linker exe
06:29:48FromDiscord<noiryuh> sent a code paste, see https://play.nim-lang.org/#ix=47g2
06:30:02FromDiscord<Elegantbeef> think it's `clang.linker.exe`
06:31:16FromDiscord<noiryuh> i added `--clang.linker.exe:zig-cc`↵Nim still passed `clang -shared -o ...`
06:31:35FromDiscord<Elegantbeef> might be `linkerExe`
06:32:01FromDiscord<noiryuh> 👍
06:32:06FromDiscord<noiryuh> it's `linkerExe`
06:32:12FromDiscord<noiryuh> thanks you
06:32:56FromDiscord<noiryuh> (edit) "thanks" => "thank"
07:02:24FromDiscord<noiryuh> humn
07:02:40FromDiscord<noiryuh> seems like Nim doesn't generate `.lib` file
07:02:58FromDiscord<Elegantbeef> `--app:staticlib`?
07:03:42FromDiscord<noiryuh> why doesn't `--app:lib` generate `.lib` file too↵isn't it required for linking dynamic library?
07:03:48FromDiscord<Elegantbeef> No
07:04:15FromDiscord<Elegantbeef> `.lib` is a static library
07:04:20FromDiscord<Elegantbeef> `.dll` is a dynamic library
07:05:04FromDiscord<noiryuh> yeah, but for linking with dynamic library↵during building, i need a `.lib` file, then build it, then shipping the exe with `.dll` file
07:05:05FromDiscord<noiryuh> no?
07:05:27FromDiscord<Elegantbeef> Dont think so
07:05:50FromDiscord<enthus1ast> @noiryuh\: under the hood nim loads the dll then call getProcAddr
07:06:37FromDiscord<Elegantbeef> I dont use windows but i know for linux atleast you dont need a `.a` and `.so` one or the other suffices
07:06:42FromDiscord<enthus1ast> its the same on linux
07:06:56FromDiscord<Elegantbeef> What?
07:07:04FromDiscord<Elegantbeef> Is it coffee time for you? 😄
07:07:11FromDiscord<enthus1ast> yeah \:)
07:08:29FromDiscord<enthus1ast> i think c often needs a static lib file for using dlls(so) because they do exactly that (loading dll then getting the proc's address)
07:08:46FromDiscord<enthus1ast> but nim can do this withouth a static lib
07:09:49FromDiscord<Elegantbeef> Yea i dont know enough here i assumed if the library is on your system and you dont dynamically link it using `dlopen` the C compiler can open it up and find the symbols it needs
07:10:52FromDiscord<noiryuh> In reply to @Elegantbeef "Yea i dont know": oh, it does
07:11:07FromDiscord<noiryuh> i have to specify `-target x86_64-windows-gnu`
07:11:13FromDiscord<noiryuh> at least on `zig-cc`
07:11:35FromDiscord<noiryuh> (edit) "at least on `zig-cc` ... " added "(which is `clang` underhood)"
07:15:29FromDiscord<!&luke> In reply to @Elegantbeef "`.dll` is a dynamic": Yea it literally stands for dynamically linked library
07:15:50FromDiscord<Elegantbeef> Unless it's a C# dll 😛
07:16:33FromDiscord<Prestige> 🤔
07:17:07FromDiscord<Elegantbeef> MS in their infinite wisdom allow shipping C# libraries as `.dll`s but they're not system libraries they're C# code that can only be used if you know it's C# code
07:17:35FromDiscord<Prestige> Is it even CIL or whatever it's called, or straight up c# source code?
07:17:47FromDiscord<Elegantbeef> It's compiled C# code
07:18:04FromDiscord<Prestige> Nice
07:18:15FromDiscord<Prestige> Remind me again to stay away from windows
07:18:54FromDiscord<Elegantbeef> Instead of doing something like `csdll` or similar they just went for `dll` to confuse many developers
07:20:44FromDiscord<Elegantbeef> The even more fun part is that the Mono compiler can produce cross platform executable if you have the runtime, and on linux the files still are generated with `.exe` extensions
07:21:05FromDiscord<Elegantbeef> So there are cross platform executables that have 0 indication that they're cross platform 😄
07:21:34FromDiscord<Elegantbeef> It's not a big deal but these also can load said dlls of course
07:23:20FromDiscord<enthus1ast> Technically they still are dlls
07:23:27FromDiscord<Tuatarian> Can we do custom allocators in ARC/orc?
07:23:46FromDiscord<enthus1ast> https://stackoverflow.com/questions/2259375/what-are-the-exact-differences-between-net-dll-and-a-normal-dll
07:24:15FromDiscord<Prestige> @tandy is https://matrix.to/#/#matrix-nim-sdk:newcircuit.io still valid?
07:24:29FromDiscord<Prestige> Maybe I just can't figure out how to join rooms
07:24:32FromDiscord<Elegantbeef> That's dylan's matrix space, so probably not
07:24:40FromDiscord<Prestige> rip
07:24:44FromDiscord<Tuatarian> Araq on the forum says compile with `-d:useMalloc` and override malloc normally, but what if we want some, not all, allocations to use our allocator?
07:24:53FromDiscord<Elegantbeef> Go to #embedded
07:24:58FromDiscord<Elegantbeef> Look at the last thing i posted
07:24:58FromDiscord<Prestige> Was trying to find out if there were any docs on how to use https://github.com/tandy-1000/matrix-nim-sdk or if I should just read all the source code
07:25:16FromDiscord<Elegantbeef> I have a toy client and tandy has a client
07:25:23FromDiscord<Elegantbeef> https://github.com/tandy-1000/simple-matrix-client/ for tandy's
07:26:55FromDiscord<Prestige> Thanks
07:28:30FromDiscord<Elegantbeef> @Tuatarian\: hopefully you found you way and that allocation API make sense to you
07:31:39*gsalazar joined #nim
07:39:17*gsalazar quit (Ping timeout: 268 seconds)
07:40:48*gsalazar joined #nim
07:41:16*rockcavera joined #nim
07:41:16*rockcavera quit (Changing host)
07:41:16*rockcavera joined #nim
07:41:27FromDiscord<Prestige> Looks like his client is outdated
07:41:34FromDiscord<Prestige> eh I'll try again some other day
07:41:43FromDiscord<Elegantbeef> The api is lacking a lot of endpoints
07:42:25NimEventerNew thread by Jasonfi: Best websocket library?, see https://forum.nim-lang.org/t/9360
07:46:12FromDiscord<enthus1ast> @Prestige\: the basic matrix is quite simple
07:46:23FromDiscord<enthus1ast> Matrix protocol I mean
07:46:41FromDiscord<Elegantbeef> Yea plus our the API has a nice macro for writing endpoints now
07:47:12FromDiscord<enthus1ast> Elegantbeef\: started a matrix client?
07:47:16FromDiscord<Prestige> I'll mess around with it later I guess
07:47:31FromDiscord<Prestige> I just want to send and read messages from my terminal, basically
07:48:39FromDiscord<Elegantbeef> I was toying with the idea, but mostly just playing with the API
07:48:39FromDiscord<Elegantbeef> As such we now have https://github.com/tandy-1000/matrix-nim-sdk/blob/main/src/matrix/clientserver/clientauth/login.nim
07:48:39FromDiscord<Elegantbeef> Get making endpoints people!
07:49:11FromDiscord<enthus1ast> Please focus your hacking on encryption \:p
07:49:35FromDiscord<Elegantbeef> Lol i'm not writing any of the code yet 😄
07:50:48FromDiscord<Elegantbeef> I also dont think i use any of the encrypted rooms, so not very high priority
07:50:50FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=47gd
07:50:54FromDiscord<Girvo> So I know `func parseHeader` says its used internally, and I shouldn't use it... but can I? lol
07:51:20FromDiscord<Elegantbeef> It might disappear so if it does it's on you
07:51:26*rockcavera quit (Remote host closed the connection)
07:52:14FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=47ge
07:52:53FromDiscord<flywind> (edit) "https://play.nim-lang.org/#ix=47ge" => "https://play.nim-lang.org/#ix=47gf"
07:54:07FromDiscord<Bung> so I better avoid use unsafeNew I guess
07:58:39FromDiscord<Bung> with different internal representation how to cast it to pointer , I get `expression cannot be cast to pointer`
07:59:31*xet7 quit (Ping timeout: 268 seconds)
08:03:21FromDiscord<Bung> nvm
08:13:27FromDiscord<enthus1ast> @Girvo\: I also use parseHeader in my code, I vote for it to stay
08:52:42FromDiscord<Freakwill (William Song)> how do I define a function/type for vectors with arbitrary dim?\`\`\`nim
08:53:15FromDiscord<Elegantbeef> you just did
08:53:49FromDiscord<Freakwill (William Song)> sent a long message, see http://ix.io/47gw
08:54:29FromDiscord<Freakwill (William Song)> sent a code paste, see https://play.nim-lang.org/#ix=47gx
08:54:50FromDiscord<Elegantbeef> Basis is a generic and `@[]` doesnt give it a type
08:55:05FromDiscord<Elegantbeef> Basis is generic due to the fact `Vector` is a generic
08:55:37FromDiscord<Freakwill (William Song)> It related generic arguments which I am not familiar with
08:56:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47gz
08:56:45FromDiscord<Elegantbeef> Ok so `Vector` is a generic typeclass which means it can take any `Vector` specialization
08:56:53*hexeme quit (Quit: co'o ro do)
08:57:11FromDiscord<Freakwill (William Song)> wow, thanks a lot
08:57:26FromDiscord<Elegantbeef> as such `@[]` does not specify the type, but `@[a]` says "this is a seq of typeof(a)\`
08:57:32FromDiscord<Elegantbeef> I really need to get my quotes right
08:58:15*hexeme joined #nim
09:00:06FromDiscord<Freakwill (William Song)> It woks well with func f(a, t\:Vector)\:Basis =↵ result.add a↵ result.add t
09:00:25FromDiscord<Elegantbeef> Ah yea makes sense, type can be inferred in that case
09:00:27FromDiscord<Freakwill (William Song)> while a.L will throw an error
09:00:35FromDiscord<Elegantbeef> Could just do `func f(a, b: Vector): Basis = @[a, b]`
09:01:37FromDiscord<Freakwill (William Song)> Yes. But in fact, I shall cope with many Vectors
09:12:17FromDiscord<Freakwill (William Song)> sent a code paste, see https://play.nim-lang.org/#ix=47gC
09:12:45FromDiscord<Elegantbeef> `n: static int = 3`
09:13:00FromDiscord<Elegantbeef> `Vector[n]`
09:13:18FromDiscord<Elegantbeef> `for val in result.mitems: val = rand(1)`
09:13:30FromDiscord<Freakwill (William Song)> sent a code paste, see https://play.nim-lang.org/#ix=47gD
09:14:38FromDiscord<Freakwill (William Song)> wow, thanks so much
09:14:51FromDiscord<tandy> whats the issue?↵(@Prestige)
09:16:59FromDiscord<Prestige> I think client.sendMessage
09:17:52FromDiscord<tandy> maybe @dom96
09:19:17FromDiscord<tandy> ? one thing that u might be noticing is that spec support is all over the place, i think i should probably created a v1.3 branch and try support that first↵(@Prestige)
09:20:42*xet7 joined #nim
09:22:02FromDiscord<jmgomez> can you somehow mark a function that has side effects (controlled) as one that doesnt? So you can keep using funcs when calling it?
09:22:22FromDiscord<Elegantbeef> `{.cast(noSideEffect).}:`
09:22:28FromDiscord<Elegantbeef> On the code that has a side effect
09:25:22FromDiscord<jmgomez> cool, didnt know about cast. Thanks!
09:34:19FromDiscord<Prestige> In reply to @tandy "? one thing that": Idk if that function was supposed to exist in the matrix lib but it doesn't, but your client is using it somewhere. I didn't investigate, writing other code atm
09:36:44FromDiscord<LaughingBubba> Is there anyone here who can look at a PR for me?
09:37:10FromDiscord<tandy> cool, il try get things working with beefs macro and do the branch strategy↵(@Prestige)
09:46:48FromDiscord<Freakwill (William Song)> sent a code paste, see https://play.nim-lang.org/#ix=47gM
09:49:41FromDiscord<Rika> Please use a paste service
09:53:15FromDiscord<enthus1ast> Freakwill (William Song)\: ↵https://play.nim-lang.org/#ix=47gN
09:57:39FromDiscord<enthus1ast> could be that i misunderstand your goal
09:57:57FromDiscord<enthus1ast> but its easy to fix \:)
09:59:59*xet7 quit (Remote host closed the connection)
10:08:12FromDiscord<Phil> In reply to @Freakwill (William Song) "New question. It is": All I'm seeing is a lot of HTML
10:19:03FromDiscord<Bung> am using webgui , any idea threadpool spawn cause stuck, even sometimes it response, it does not get my task proc done
10:19:48FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=47gS
10:32:23FromDiscord<dom96> In reply to @tandy "maybe <@132595483838251008>": huh? I need more context than that
10:59:12FromDiscord<Freakwill (William Song)> sent a long message, see http://ix.io/47gZ
11:06:58FromDiscord<enthus1ast> Freakwill (William Song)\: you can use https://play.nim-lang.org/ to share code blocks
11:11:57FromDiscord<planetis> rand_vector pbl needs a generic argument
11:12:18FromDiscord<enthus1ast> @Bung\: when i use threads with nim, i usually go with channels
11:13:13FromDiscord<planetis> I am getting ahead though, what's the error?
11:13:43FromDiscord<Bung> I use it too, I just want write less code do the task
11:13:48FromDiscord<enthus1ast> is this not working?
11:18:44FromDiscord<Freakwill (William Song)> any idea?
11:18:58FromDiscord<enthus1ast> i feel ignored
11:20:15FromDiscord<Freakwill (William Song)> https://play.nim-lang.org/#ix=47h3
11:20:35FromDiscord<enthus1ast> i already send you the solution
11:20:47FromDiscord<enthus1ast> a few hours ago ;)
11:21:01FromDiscord<Freakwill (William Song)> my aim is to generate vectors (of array type) in arbitrary dim
11:22:15FromDiscord<Freakwill (William Song)> Elegantbeef helped me. but I meet with new issue
11:22:38FromDiscord<Freakwill (William Song)> hi
11:22:51FromDiscord<enthus1ast> This right? ↵@[[1, 0, 1, 1, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0], [1, 0, 0, 0, 1], [1, 0, 1, 0, 1]]
11:22:51FromDiscord<domosokrat> maybe the gitter/matrix bridge is semi-broken and only works one-way 😑
11:23:09FromDiscord<enthus1ast> domosokrat\: or i'am just ignored haha
11:24:09FromDiscord<domosokrat> enthus1ast\: yeah that's also a possibility \:)
11:24:15FromDiscord<Freakwill (William Song)> ye
11:24:21FromDiscord<enthus1ast> yes
11:24:26FromDiscord<enthus1ast> then you got your solution
11:25:24FromDiscord<enthus1ast> domosokrat\: nobody expects bots to solve programming errors, but this one can sometimes
11:25:39FromDiscord<Freakwill (William Song)> My ambition is to generate vectors with different dims. for i in 1..10\:↵ const n=i↵ echo rand\_vector(n) # n-dim vector
11:25:49FromDiscord<Freakwill (William Song)> Is it possible?
11:27:02FromDiscord<Rika> On compile time
11:27:13FromDiscord<Freakwill (William Song)> yes
11:28:54FromDiscord<Rika> Same code except put it under a “static:” block
11:30:24FromDiscord<Phil> Curiosity question, why use the `block` bit?↵It's useful when you want to scope variables but don't want to open up a new proc, right? ↵When is that?↵I'm pretty sure there's a good usecase for it, I'm just not quite seeing it yet
11:31:01FromDiscord<Rika> What are you talking about
11:32:26FromDiscord<enthus1ast> @Phil\: i use it often for tests, where i just copy and paste it
11:33:04FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=47h8
11:33:18FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47h9
11:36:01FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47ha
11:36:16FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=47ha" => "https://play.nim-lang.org/#ix=47hb"
11:36:55FromDiscord<enthus1ast> yeah, for this i use them quite often
11:38:50FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=47hd
11:39:41FromDiscord<flywind> It also shadow the global variables which is convenient for tests too.
11:41:42FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=47he
11:41:50FromDiscord<vestel> How do I statically link openssl?
11:42:18FromDiscord<enthus1ast> build it as a static lib, use dynlib override
11:42:32FromDiscord<enthus1ast> BUT its quite a hassle
11:42:51FromDiscord<enthus1ast> if you just wanna fetch some data from a website you can use puppy
11:42:54FromDiscord<vestel> cause I have some weird errors with dynamic linking on win11, but its works on win10
11:43:01FromDiscord<Phil> Just be prepared for openssl to statically link you'll be compiling for an hour
11:43:02FromDiscord<Phil> maybe 2
11:44:44FromDiscord<enthus1ast> maybe open issues in the github tracker↵(@vestel)
11:45:57FromDiscord<flywind> A known issue https://github.com/nim-lang/Nim/issues/15220
11:46:05FromDiscord<planetis> You can't have a seq with items of different size
11:46:40FromDiscord<planetis> you need refs and shit
11:47:02FromDiscord<planetis> (edit) "shit" => "dynamic dispatch"
12:15:10FromDiscord<Freakwill (William Song)> I just generate a vector/array in a random size↵(@planetis)
12:15:19FromDiscord<Freakwill (William Song)> sent a code paste, see https://play.nim-lang.org/#ix=47hn
12:17:07FromDiscord<Phil> Same issue as before with it all coming out as HTML Freakwill, try to use play nim lang ?
12:18:55FromDiscord<enthus1ast> @Phil\: looks good on matrix
12:19:21FromDiscord<planetis> you can't have a collection of different sized arrays, they are different types
12:19:35FromDiscord<planetis> use a seq for vector or oop
12:20:32FromDiscord<enthus1ast> do we have a list of bridges; wo operates them, and repos?
12:21:48FromDiscord<tandy> how can i run `nimble test` for a specific backend?↵(@dom96)
12:21:57FromDiscord<tandy> it uses the c backend by default
12:22:00FromDiscord<tandy> `nimble test --d:js` doesnt work
12:22:14FromDiscord<tandy> neither does nimble test --backend\:js
12:42:17FromDiscord<Freakwill (William Song)> sent a long message, see http://ix.io/47hx
12:43:12FromDiscord<Freakwill (William Song)> some idea? https://play.nim-lang.org/#ix=47hz
12:43:44FromDiscord<Freakwill (William Song)> ok↵(@Phil)
13:01:37*xet7 joined #nim
13:08:32FromDiscord<foobar-85> When I realized I can chain function calls without parentheses 🤯🤪
13:09:26*CyberTailor quit (Remote host closed the connection)
13:11:13*CyberTailor joined #nim
13:15:58*CyberTailor quit (Remote host closed the connection)
13:17:39*CyberTailor joined #nim
13:17:57FromDiscord<4zv4l> I don't get the error
13:17:59FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=47hO
13:18:06FromDiscord<4zv4l> the while seem to make an issue
13:18:18FromDiscord<4zv4l> I use `illwill`
13:19:35FromDiscord<4zv4l> so I don't see what's wrong
13:19:36FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=47hQ
13:20:27FromDiscord<dom96> In reply to @tandy "how can i run": I don't think you can. Best workaround is to define your own `testjs` task and run the tests manually
13:20:58*xet7 quit (Remote host closed the connection)
13:21:02FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=47hR
13:21:09FromDiscord<Rika> nim does not do "assignments as expressions"
13:21:19FromDiscord<4zv4l> so, how can I do that ?
13:21:27FromDiscord<Rika> `(c = getKey(); c)`
13:21:43FromDiscord<4zv4l> hmmm
13:22:04FromDiscord<4zv4l> alright
13:22:07FromDiscord<4zv4l> I think I get it
13:46:08FromDiscord<4zv4l> I don't see how I can convert a `Key` to a `char` to be able to print it correctly
13:46:41FromDiscord<4zv4l> but it doesn't seem to work
13:46:43FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=47i2
13:49:15FromDiscord<MagPhi> Is the nim gc more efficient than allocating memory by hand?
13:52:04FromDiscord<4zv4l> good manual memory handling will always be better than gc
13:52:25FromDiscord<4zv4l> (edit) "always" => "--always--"
13:53:15FromDiscord<4zv4l> (edit) "--always--" => "~~always~~"
13:55:10FromDiscord<MagPhi> only if the person is good at it?
13:55:12FromDiscord<MagPhi> right
13:55:55FromDiscord<enthus1ast> $Key should work @4zv4l
13:56:35FromDiscord<4zv4l> https://media.discordapp.net/attachments/371759389889003532/1007286410979573821/unknown.png
13:56:36FromDiscord<4zv4l> it prints like this
13:56:44FromDiscord<4zv4l> Space rather than " "
13:57:51FromDiscord<MagPhi> Can I do functional programming in nim?
13:58:02FromDiscord<4zv4l> In reply to @MagPhi "Can I do functional": of course you can
13:58:47FromDiscord<4zv4l> In reply to @enthus1ast "$Key should work": or is there any other function from a lib I can use to read from keyboard ? Because then that lib would support utf-8
13:59:12FromDiscord<Rika> In reply to @MagPhi "only if the person": That’s why he said “good” yes
14:00:32FromDiscord<enthus1ast> I've done it like so afaik this was working https://github.com/enthus1ast/illwillWidgets/blob/04f507cfd651df430b1421403b3a70cb061c4624/src/illwillWidgets.nim#L507
14:00:38FromDiscord<enthus1ast> @4zv4l\:
14:00:43FromDiscord<MagPhi> so what if I write some code in nim compile it to c translate that to zig do memory management and then compile it back to c or binary
14:01:32*jmdaemon quit (Ping timeout: 268 seconds)
14:01:34FromDiscord<Rika> Have fun
14:01:37FromDiscord<Rika> High effort
14:01:48FromDiscord<Rika> Could just use ARC memory management
14:07:12FromDiscord<enthus1ast> The gc discussions all the time are quite funny imho, see what manual memory management brought us\: alot of zero days
14:07:24FromDiscord<enthus1ast> But still these discussions 😁
14:11:20*gsalazar quit (Ping timeout: 268 seconds)
14:11:55FromDiscord<domosokrat> I think most know only stop-the-world gc or reference-counted interpreted language implementations.
14:12:12*arkurious joined #nim
14:13:48*gsalazar joined #nim
14:14:03*jmdaemon joined #nim
14:17:59FromDiscord<4zv4l> In reply to @enthus1ast "I've done it like": I can't make my textbox to work, it's my first time doing tui T-T
14:24:29FromDiscord<MagPhi> Wait can I do manual memory allocation in nim
14:25:38FromDiscord<enthus1ast> alloc() / dealloc() etc https://nim-lang.org/docs/system.html#alloc.t%2CNatural
14:32:36FromDiscord<Phil> In reply to @MagPhi "Wait can I do": There's a compiler flag to turn GC off
14:32:59FromDiscord<Rika> you can do manual memory management without turning the GC off
14:32:59FromDiscord<MagPhi> will nim protect me from segmentation faults when doing manual memory allocation
14:33:13FromDiscord<Rika> no
14:33:16FromDiscord<Rika> manual means manual
14:33:26FromDiscord<MagPhi> k theb
14:33:27FromDiscord<MagPhi> (edit) "theb" => "then"
14:33:44FromDiscord<MagPhi> i can use js libs with nim right
14:33:59FromDiscord<Rika> if you compile to js, which means you cant control memory anyway
14:35:04FromDiscord<Rika> im not sure why you want manual memory management
14:35:57FromDiscord<MagPhi> bc i like to shoot myself in the foot
14:36:05FromDiscord<MagPhi> In reply to @MagPhi "i can use js": ?
14:36:43FromDiscord<Phil> Rika gave you an answer for that
14:37:10FromDiscord<Phil> (edit) "that" => "whether you can use js libs"
14:40:07FromDiscord<MagPhi> In reply to @Rika "if you compile to": i cant really understand from this like is it a yes or a no
14:40:24FromDiscord<MagPhi> I know I can compile to js but I want to use js libs in nim before translating to js
14:40:44FromDiscord<Rika> you can use js libs in nim if you are using the js backend
14:41:03FromDiscord<MagPhi> So I can reference it before compiling to js?
14:41:12FromDiscord<MagPhi> (edit) "reference" => "import"
14:41:20FromDiscord<Rika> yes
14:41:30FromDiscord<Rika> i dont know how, i dont use the js backend
14:41:48FromDiscord<MagPhi> alright
14:42:30FromDiscord<Phil> Hotdog is one of the people I always recall when it comes to people using js backend (or karax)
14:43:01FromDiscord<Phil> If you want to ask further general questions and need somebody to talk to
14:44:14FromDiscord<4zv4l> is that normal that global string variable doesn't work ? or it's just my code ?
14:44:47FromDiscord<flywind> Code?
14:46:15FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=47in
14:46:29FromDiscord<4zv4l> handleMsg change the Buffer variable↵and handOut print the Buffer variable
14:46:31FromDiscord<flywind> It depends how you write it. It known that the {.global.} pragma doesn't work with string well in ARC/ORC.
14:47:08FromDiscord<4zv4l> I don't specify the gc
14:47:10FromDiscord<MagPhi> Since LLVM based languages seem to be fast is nlvm faster than nim?
14:47:16FromDiscord<4zv4l> is ORC the default now ?
14:47:30FromDiscord<flywind> No, it isn't.
14:47:54FromDiscord<4zv4l> then idk
14:47:58FromDiscord<4zv4l> when I print the Buffer it shows
14:48:08FromDiscord<4zv4l> https://media.discordapp.net/attachments/371759389889003532/1007299382602903632/unknown.png
14:48:08FromDiscord<4zv4l> lot of yyyyyyyyyyyyyyy
14:48:49FromDiscord<enthus1ast> write is a macro and a little wonky
14:48:52FromDiscord<4zv4l> I thought maybe it's because when I do↵`Buffer = ""`↵it changes the pointer to another addr in memory rather than cleaning or doing whatever idk
14:49:07FromDiscord<4zv4l> idk how strings are handled in nim so
14:49:43FromDiscord<enthus1ast> ohh \:)
14:49:54FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=47iu
14:50:02FromDiscord<enthus1ast> you also add Key.None to the buffer
14:50:09FromDiscord<4zv4l> ooooh yeah
14:50:11FromDiscord<4zv4l> my bad
14:50:18FromDiscord<4zv4l> thanks !!!
14:50:37FromDiscord<Phil> In reply to @MagPhi "Since LLVM based languages": Generally languages like zig, c,c++, rust, Nim tend to have the same performance potential,. It's mostly a matter of how familiar you are with your chosen language. There's not really a "faster", you can have slow code in any of these languages
14:51:08FromDiscord<4zv4l> In reply to @enthus1ast "ohh \:)": also that's weird, when I quit using ctrl-c (bad way) my terminal keep the cursor, but when I use Escape as it's in my code, my cursor disappear, how come ?
14:51:27FromDiscord<Rika> doesnt illwill also have something you have to call before exiting
14:51:42FromDiscord<Rika> illwill probably inserts this function to the ctrlc handler
14:52:24FromDiscord<domosokrat> you don't call your exitProc when pressing Escape
14:52:28FromDiscord<enthus1ast> mh try to also call showCursor()()
14:52:29FromDiscord<4zv4l> I break from main
14:52:33FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=47iv
14:52:40FromDiscord<4zv4l> and it gives the exirProc
14:53:07FromDiscord<4zv4l> setControlCHook(exitProc)↵↵this means it will call this proc at the end of the proc right ?
14:53:28FromDiscord<domosokrat> no, only when pressing Ctrl-C
14:54:20FromDiscord<4zv4l> ooooh alright
14:54:24FromDiscord<4zv4l> thanks
14:55:03FromDiscord<enthus1ast> trying your app, i can recommend that you do some kind of "text refresh widget" that clears a whole line
14:56:11FromDiscord<4zv4l> what do you mean ? which line ?
14:56:15FromDiscord<enthus1ast> i think i've called such a widget "newInfoBox" in illwillWidgets
14:56:26FromDiscord<4zv4l> to print the Buffer ?
14:56:48FromDiscord<enthus1ast> because you print a long line, then replace the line with a short line, then you still see the artefacts of the long line
15:00:44FromDiscord<4zv4l> alright, I'll check that ^^ Thanks !
15:02:15FromDiscord<enthus1ast> also if you wanna see a bigger illwill project\:↵https://github.com/enthus1ast/muk/blob/master/src/muk.nim↵and a smaller one\:↵https://github.com/enthus1ast/trainingThing/blob/master/src/training.nim
15:39:09FromDiscord<jmgomez> In reply to @MagPhi "So I can import": take a look at this: https://nim-lang.org/docs/jsffi.html↵I dont have much experience with the js backend, just did a quick test a few days but it seems to me that JsObject is similar to any in TS and for importing libraries you can just use importjs (I think importc also work) but if you look in the sources for importjs you will see a lot of examples. It's quite handy once you get hang of it
15:49:06FromDiscord<tandy> sad↵(@dom96)
15:51:08FromDiscord<dom96> would be a simple PR if you're interested in contributing
16:15:55FromDiscord<4zv4l> sent a long message, see http://ix.io/47j0
16:18:24*gsalazar quit (Ping timeout: 268 seconds)
16:29:04FromDiscord<enthus1ast> @4zv4l\: yeah I struggled with this a bit aswell
16:29:26FromDiscord<enthus1ast> But keeping them in memory is a good first step
16:29:53FromDiscord<enthus1ast> Do you want to scroll up again manually later?
16:30:08FromDiscord<4zv4l> oh no, the mouse will be prohibited
16:30:12FromDiscord<4zv4l> only keyboard
16:30:15FromDiscord<4zv4l> only sending messages
16:30:33FromDiscord<enthus1ast> But do you wanna go up?
16:30:37FromDiscord<4zv4l> for now I can send messages so, already a good step xD↵now I need to handle the receive messages
16:30:53FromDiscord<4zv4l> In reply to @enthus1ast "But do you wanna": like when the screen is full of messages, the oldest one go up yeah
16:31:03FromDiscord<4zv4l> but the user won't be able to scroll
16:31:17FromDiscord<enthus1ast> Ok then it's quite easy
16:31:33FromDiscord<4zv4l> or idk yet about that, I'll see
16:31:34FromDiscord<4zv4l> xD
16:31:43FromDiscord<4zv4l> for now I already wanna succeed the send/recv
16:31:47FromDiscord<enthus1ast> Figure out how many lines you can draw den just draw the last x from your buffer
16:32:02FromDiscord<4zv4l> yeah
16:32:05FromDiscord<4zv4l> that's the idea of now
16:32:19FromDiscord<4zv4l> what is not so cool for now is that with the textbox I still can't send utf-8 char
16:32:29FromDiscord<enthus1ast> Yes
16:32:48FromDiscord<4zv4l> and also the going back and forth with arrow make the string weird
16:32:58FromDiscord<4zv4l> I have to write it right the first try
16:33:07FromDiscord<enthus1ast> Illwill cannot do this
16:33:11FromDiscord<4zv4l> it's because of the way I keep the char in my buffer I think
16:33:36FromDiscord<enthus1ast> Not yet at least
16:33:40FromDiscord<enthus1ast> I have two pr's for exactly this issue lying around somewhere
16:34:10FromDiscord<enthus1ast> Think maybe you also add these chars?
16:38:05FromDiscord<enthus1ast> Do you call handleKey() ?
16:38:28FromDiscord<enthus1ast> If yes then it might be a bug in the widgets library
16:39:15FromDiscord<4zv4l> like this
16:39:16FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=47j8
16:39:29FromDiscord<4zv4l> so I insert every key to the buffer which isnt the best way I guess
16:41:16FromDiscord<enthus1ast> you can get the buffer from the TextBox
16:41:36FromDiscord<4zv4l> oooh
16:41:42FromDiscord<4zv4l> how that
16:41:52FromDiscord<enthus1ast> txtb.text
16:42:14FromDiscord<enthus1ast> and also\: ## if this function return "true" the textbox lost focus by enter
16:42:34FromDiscord<4zv4l> omg yeah
16:42:40FromDiscord<enthus1ast> https://github.com/enthus1ast/illwillWidgets/blob/04f507cfd651df430b1421403b3a70cb061c4624/examples/demo.nim#L116
16:42:44FromDiscord<4zv4l> In reply to @enthus1ast "and also\: ": yeah I saw that
16:42:59FromDiscord<enthus1ast> in the demo all widgets are used
16:43:01FromDiscord<4zv4l> but since there is no mouse in my program it never lose the focus
16:43:51FromDiscord<enthus1ast> mh yeah the description is quite bad to be honest
16:44:10FromDiscord<enthus1ast> it returns true if you hit enter
16:44:49FromDiscord<4zv4l> ooooh
16:45:28FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=47jb
16:45:37FromDiscord<enthus1ast> yes
16:45:49FromDiscord<4zv4l> alright !↵thanks !
16:47:41FromDiscord<4zv4l> how do I give an array of string to a function ? but it's not an array is a `@[]` ?
16:47:56FromDiscord<enthus1ast> a sequence
16:48:08FromDiscord<enthus1ast> proc foo(se\: seq[string])
16:48:23FromDiscord<enthus1ast> foo(@["baa", "baz"])
16:48:31FromDiscord<4zv4l> alright perfect, I think I can do something with the receive
16:48:36FromDiscord<4zv4l> super thanks !
16:59:51*\u is now known as meowray
16:59:58*meowray quit (Changing host)
16:59:58*meowray joined #nim
17:04:03FromDiscord<4zv4l> also for now the widgets code is in my source code folder because I couldn't install it with nimble, is that normal or I'm supposed to be able to install it ?
17:04:55FromDiscord<enthus1ast> could be that i've not added it to the nimble directory
17:05:09FromDiscord<enthus1ast> but you can install every nim module that has a nimble file directly from git
17:05:19FromDiscord<enthus1ast> nimble install https://github.com/enthus1ast/illwillWidgets
17:06:36FromDiscord<tandy> i am, il make an issue where we can discuss it↵(@dom96)
17:06:51FromDiscord<4zv4l> In reply to @enthus1ast "nimble install https://github.com/enthus1ast/illwil": works great, thanks !
17:10:28FromDiscord<4zv4l> I don't get how to make a nim script to build my program automatically
17:12:13FromDiscord<EyeCon> There's something that bugs me about the need for indentation and/or commas in some contexts. Why is that we need to separate the elements of an indented `import` block with commas (and optionally newlines), but we write an indented block without the commas for e.g. an object declaration? It seems that there's no source for confusion if the import block could also be separated by only newlines.
17:12:23FromDiscord<EyeCon> Or is there something I'm not seeing?
17:13:40FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=47jo
17:14:34FromDiscord<gibson> Yeah, that's inconsistent. I would expect it to work without commas.
17:14:37FromDiscord<Rika> because you can do `import a, b` but not `const a = "", b = 19230`
17:15:02FromDiscord<Prestige> In reply to @4zv4l "I don't get how": You can make a run task in your nimble file
17:15:26FromDiscord<Rika> the import with newlines works as a side effect of nim's leniency with newline placement, i'd say
17:16:11FromDiscord<Rika> In reply to @Rika "because you can do": technically you can do `const (a,b) = ("", 91273)` but thats besides the point ig
17:17:14FromDiscord<EyeCon> In reply to @Rika "the import with newlines": I get that, but is this something we want? That's a potential stumbling block for newcomers. On the other hand, I have no specific proposal which is completely consistent and have no drawbacks
17:17:18FromDiscord<dom96> In reply to @tandy "i am, il make": awesome, thank you!
17:18:24FromDiscord<Rika> In reply to @EyeCon "I get that, but": i have no opinion; it will have to wait for nim 2 in any case
17:20:20FromDiscord<Prestige> Having no commas required between imports would be cool
17:20:48*neceve joined #nim
17:22:02FromDiscord<gibson> sent a code paste, see https://play.nim-lang.org/#ix=47jq
17:22:30FromDiscord<EyeCon> Wait, how does that error
17:23:39FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=47jr
17:24:16FromDiscord<gibson> My mental model of how nim works is incorrect, because I thought the above would work. So I'd like to figure out what is actually happening.
17:25:02FromDiscord<EyeCon> Not that I'm an expert in Nim, but I have difficulties imagining how it would fail
17:25:17*rockcavera joined #nim
17:25:17*rockcavera quit (Changing host)
17:25:17*rockcavera joined #nim
17:25:43FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=47js
17:26:00FromDiscord<EyeCon> Which makes the error message even more surprising
17:26:51FromDiscord<EyeCon> We need a guru here
17:28:34FromDiscord<Rika> `proc sum(a: SomeNumber; b: distinct SomeNumber): float =`
17:28:36FromDiscord<domosokrat> sent a code paste, see https://paste.rs/Edb
17:28:52FromDiscord<Forest> What's a good image manipulation library for Nim?
17:28:56FromDiscord<Rika> pixie
17:29:07FromDiscord<Forest> I need to be able to create an image, apply a mask, and colour it
17:29:13FromDiscord<Forest> Ooh looking into it now
17:29:14FromDiscord<Rika> `proc sum(a: SomeNumber; b: SomeNumber): float =` -> `proc sum[T: SomeNumber](a, b: T): float =`
17:29:25FromDiscord<Prestige> Pixie is amazing
17:29:35FromDiscord<domosokrat> I think if you do `proc sum (a: SomeNumber; b: SomeNumber)` both have to refer to the same type
17:29:43FromDiscord<Rika> https://nim-lang.org/docs/manual.html#generics-implicit-generics
17:29:45FromDiscord<Rika> documented here
17:29:45FromDiscord<Forest> Ooh looks cool
17:29:58FromDiscord<Rika> `By default, during overload resolution, each named type class will bind to exactly one concrete type. We call such type classes bind once types.`
17:30:32FromDiscord<Phil> At some point some of treeforms libs will just be in every project out there and he'll have ultimate control!
17:30:32FromDiscord<domosokrat> Thanks, I knew that I saw it somewhere
17:32:31FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=47jt
17:32:55FromDiscord<Rika> In reply to @Rika "`By default, during overload": read this
17:33:06FromDiscord<Rika> a "SomeFloat = float|float32|float64" is a "named type class"
17:33:45FromDiscord<EyeCon> That is hell of a gotcha if I have ever seen one
17:33:52FromDiscord<4zv4l> so what should be change to make it works ? I don't get it
17:34:04FromDiscord<Rika> In reply to @Rika "`proc sum(a: SomeNumber; b:": here
17:34:11FromDiscord<Rika> read this part of the manual https://nim-lang.org/docs/manual.html#generics-implicit-generics
17:35:46FromDiscord<4zv4l> > Alternatively, the distinct type modifier can be applied to the type class to allow each param matching the type class to bind to a different type. Such type classes are called bind many types.↵alright, thanks !
17:35:52FromDiscord<leorize> the main problem is in this sentence\:↵> By default, during overload resolution, each named type class will bind to exactly one concrete type
17:36:54FromDiscord<EyeCon> The error message is misleading as hell too
17:37:22FromDiscord<enthus1ast> @Rika\: did not know about the `distinct` in this case, thank you
17:37:42FromDiscord<Rika> In reply to @EyeCon "The error message is": it doesnt help, thats for sure
17:40:20FromDiscord<Phil> Oh right I likely should do an SO for myself for the error of calling compile time procs at runtime
17:40:55FromDiscord<gibson> Is it true that specifying `(typeclass|otherTypeclass)` implies distinct? _Seems_ to be the case.
17:41:31FromDiscord<leorize> not really, the gist of it is, each typeclass will be bound once
17:41:45FromDiscord<leorize> if you have two of those I'd imagine bound-once happens to them
17:42:18FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=47jy
17:42:33FromDiscord<Rika> "By default, during overload resolution, each named type class will bind to exactly one concrete type. We call such type classes bind once types."
17:42:59FromDiscord<Rika> just to point out if you're wondering why that works
17:43:12FromDiscord<EyeCon> In reply to @Rika "just to point out": Not me, just wanted to demonstrate
17:43:21FromDiscord<leorize> yea, also that example you declared a `sum()` proc but you didn't call it \:P
17:43:27FromDiscord<gibson> sent a code paste, see https://play.nim-lang.org/#ix=47jz
17:44:00FromDiscord<EyeCon> In reply to @leorize "yea, also that example": Yeah, just noticed that 😄
17:44:43FromDiscord<Phil> In reply to @gibson "Strangely, I can't get": I assume both times you're going down the route of some integer, the first value determined that for this proc some integer is i8 and then the second one comes in being i16 which conflicts with that
17:45:07FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=47jA
17:45:13FromDiscord<gibson> (edit) "https://play.nim-lang.org/#ix=47jz" => "https://play.nim-lang.org/#ix=47jB"
17:45:21FromDiscord<Phil> There a and b aren't connected in any way
17:45:40FromDiscord<EyeCon> So after reading the manual again, it is clear why it doesn't work, but this is very confusing for newcomers too
17:46:01FromDiscord<EyeCon> Is it worth to have these "bind-once" types, in spite of all this difficulty?
17:46:51FromDiscord<Phil> I'd say it depends, this made perfect sense to me when I first ran into it.↵Having that is valuable to be able to express that 2 variables in some circumstances should absolutely be the same type
17:47:32FromDiscord<leorize> I think bind once is an artifact of supporting the expression\: `proc foo(a, b: SomeNumber): float`
17:48:03FromDiscord<EyeCon> In reply to @Isofruit "I'd say it depends,": But isn't that expressible by something like `proc sum3[T](a: T, b: T): float`?
17:48:37FromDiscord<gibson> Specificity is very useful, though.
17:48:43FromDiscord<Phil> In reply to @EyeCon "But isn't that expressible": Depends if there are more complex interactions between a and b
17:49:03FromDiscord<leorize> an overwhelming pattern in Nim is that `a, b: something` is the same as `a: something, b: something`
17:49:03FromDiscord<EyeCon> Or even `proc sum3[T: SomeFloat](a: T, b: T): float`
17:50:58FromDiscord<Phil> There can be type relationships where you might absolutely want types to be enforced as the same type of float if they're both floats, expressing that 2 types should be independently determined via distinct is also pretty nice IMO
17:51:38FromDiscord<gibson> sent a code paste, see https://play.nim-lang.org/#ix=47jE
17:52:16FromDiscord<gibson> Thanks all, this was very useful.
17:52:19FromDiscord<Phil> Makes sense to me, each of the numbers get their own some number type
18:02:06FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=47jI
18:04:43FromDiscord<Phil> That looks like the field width is not being exported
18:04:52FromDiscord<Phil> Is that your own type?
18:05:42FromDiscord<Phil> If not, does pixie provide a proc that indirectly allows accessing width?
18:06:18FromDiscord<Forest> Nope, it's Pixie
18:06:20FromDiscord<Forest> Let me see
18:07:53FromDiscord<Forest> Oh looks like i don't get to get the width since i can base the dimensions off of the older image
18:08:50FromDiscord<Phil> Aha! I am too tired to compute what that means but it sounds you understood the problem and are able to progress
18:09:13FromDiscord<Forest> I can't do that nevermind
18:09:18FromDiscord<Forest> In reply to @Isofruit "If not, does pixie": Doesn't look like it
18:14:45*kenran joined #nim
18:14:52*kenran quit (Client Quit)
18:14:55FromDiscord<guzba> In reply to @Forest "Doesn't look like it": `Image` has width and height properties: https://nimdocs.com/treeform/pixie/pixie/common.html#Image
18:17:21FromDiscord<Forest> In reply to @guzba "`Image` has width and": Yeah that's what I'm using, it fails to compile
18:18:05FromDiscord<voidwalker> Is there a special way to express an empty char literal ? I want to delete a char in a string with replace.
18:19:36*CyberTailor quit (Read error: Connection reset by peer)
18:21:07FromDiscord<domosokrat> No, but you can there is a replace taking string
18:21:09*CyberTailor joined #nim
18:21:41FromDiscord<voidwalker> Ah ok, I did this before, I thought I don't know how to
18:21:49FromDiscord<voidwalker> (edit) "Ah ok, I did this before, I thought I don't know how to ... " added "do it with char"
18:21:54FromDiscord<domosokrat> So `s.replace($c, "")`
18:22:45FromDiscord<guzba> In reply to @Forest "Yeah that's what I'm": is `pixie` imported? if so, perhaps you don't have an Image, since i can't see the code, what do you get if you echo the thing youre trying to access `.width` on?
18:24:24FromDiscord<Forest> In reply to @guzba "is `pixie` imported? if": Yup it is actually
18:24:29FromDiscord<Forest> In reply to @guzba "is `pixie` imported? if": Let me try rn
18:26:25FromDiscord<Forest> I managed to fix it
18:26:34FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=47jR
18:28:15*neceve quit (Remote host closed the connection)
18:31:44FromDiscord<Forest> How do i make the mask apply a colour to the image?
18:51:12FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=47k2
18:51:33FromDiscord<voidwalker> what is `[N: static[int]]` supposed to mean here?
18:52:23FromDiscord<domosokrat> N has to be an int known at compile time
18:54:40FromDiscord<voidwalker> https://github.com/status-im/nim-stew/blob/master/stew/byteutils.nim#L173
18:54:57FromDiscord<voidwalker> Why did they define 2 versions, one with N known at compile time, and one without ?
19:20:58FromDiscord<voidwalker> What is the most efficient way to a string of the from `d09e16dbab564012947a89da49558d15` to `d09e16db-ab56-4012-947a-89da49558d15` ? 8-4-4-4-12
19:25:40FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=47kd
19:25:41FromDiscord<Generic> I'm too lazy to write the rest
19:25:53FromDiscord<Generic> though it should only allocate once
19:26:43FromDiscord<Generic> you can probably do some clever templating to make this less ugly
19:28:02FromDiscord<voidwalker> Ah I meant in the least number of lines (prefferably 1), using the std lib procs..
19:28:20FromDiscord<voidwalker> there should be an insert that takes an openarray as positions
19:29:53FromDiscord<Fish-Face> Something in my program is using more memory than I expected. Any tips? Can I view the reserved size of a hashset? are there easy to use memory profilers?
19:30:36FromDiscord<leorize> strformat.fmt"{input[0..\<8]}-{input[8..\<12]}-{input[12..\<16]}-{input[16..\<24]}"↵(@voidwalker)
19:30:37FromDiscord<Fish-Face> (edit) "Something in my program is using more memory than I expected. Any tips? Can I view the reserved size of a hashset? are there easy to use memory profilers? ... " added "Can I just straightforwardly and recursively get how much memory is allocated for an object? (Without cycles...)"
19:31:45FromDiscord<voidwalker> huh I guess I should learn strformat , been doing it all with & so far
19:32:56FromDiscord<leorize> unfortunately there's no way to see how much memory is allocated for an object↵(@Fish-Face)
19:33:43FromDiscord<leorize> if you look into GC stats then you can see how much memory is allocated in total, though
19:33:58FromDiscord<Fish-Face> mm, I can get that from the OS though 😛
19:34:34FromDiscord<leorize> well, you can do some math to figure a rough estimate \:p
19:38:59FromDiscord<leorize> here's an insight to help you optimize\: seq will expand to 1.5 times it's current size every add once a certain threshold is reached
19:40:10FromDiscord<Fish-Face> do you know the behaviour for `HashSet`? I thought it was doubling but that's not true. I'm also interested in any overhead that scales, let's say at least linearly, with the number of items
19:44:08FromDiscord<munchii2> does anyone know why i cant reassign an object instances field? i get this error `Error: 'vault3.title' cannot be assigned to`
19:45:29NimEventerNew Nimble package! qwatcher - Monitor TCP connections and diagnose buffer and connectivity issues on Linux machines related to input and output queues, see https://github.com/pouriyajamshidi/qwatcher
19:45:44FromDiscord<Prestige> @munchii2 Needs to be a `var` to be mutable
19:45:48FromDiscord<Prestige> or a `ref object`
19:46:36FromDiscord<munchii2> In reply to @Avahe "<@555284165348818944> Needs to be": oh okay thanks
19:48:48FromDiscord<Forest> In reply to @Forest "How do i make": Quick bump because i couldn't figure it out ^^
19:49:20FromDiscord<leorize> given this\: https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/sets.nim#L59-L67 you can expect a growth rate similar to seq↵(@Fish-Face)
19:49:51FromDiscord<Prestige> In reply to @Forest "Quick bump because i": Did you see https://github.com/treeform/pixie#masking ?
19:50:01FromDiscord<Fish-Face> mmm. Clearly something is storing a lot more than I am expecting. It's not my code; I need to understand it better.
19:50:27FromDiscord<leorize> you'll have an `8 + padding` bytes worth of overhead per set entry, so take note of that
19:50:47FromDiscord<munchii2> sent a code paste, see https://play.nim-lang.org/#ix=47km
19:51:05FromDiscord<Forest> I did but i think i typed it wrong
19:51:07FromDiscord<munchii2> (edit) "https://play.nim-lang.org/#ix=47km" => "https://play.nim-lang.org/#ix=47kn"
19:51:27FromDiscord<munchii2> (edit) "https://play.nim-lang.org/#ix=47kn" => "https://play.nim-lang.org/#ix=47ko"
19:53:22FromDiscord<leorize> if you want to not use ref, switch to `var seq[T]`↵(@munchii2)
19:54:25FromDiscord<munchii2> oh okay. thanks
19:56:10FromDiscord<munchii2> still doesnt seem to work
19:56:24FromDiscord<munchii2> oh
19:56:25FromDiscord<munchii2> wait
19:56:28FromDiscord<munchii2> i forgot to remove ref
19:56:56FromDiscord<munchii2> now i get `but expression '@[vault, vault2, vault3]' is immutable, not 'var'`
19:57:28FromDiscord<leorize> yea, those are immutable, what are you trying to do?
19:57:43FromDiscord<leorize> like, only modify the array in the proc itself without affecting the one outside or?
20:01:54FromDiscord<munchii2> well the whole problem started when i tried to reassign a field on an object that was already defined. but i suppose thats because it was defined as a `let`. but if i define it as a `var` then the code breaks again. i suppose the easiest fix would be to just create a new object
20:02:57FromDiscord<munchii2> nvm
20:03:45FromDiscord<munchii2> sent a code paste, see https://play.nim-lang.org/#ix=47kt
20:08:11FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=47ku
20:08:35FromDiscord<EyeCon> (edit) "https://play.nim-lang.org/#ix=47ku" => "https://play.nim-lang.org/#ix=47kv"
20:09:10FromDiscord<voidwalker> yeah that makes sense. I was going to do an insert.insert.insert.. but the string fmt looks better
20:09:55FromDiscord<EyeCon> If that's on a hot path it would make sense to profile+optimize, else whatever is most readable to you
20:10:42FromDiscord<leorize> building a new string is generally faster for this
20:11:51FromDiscord<Phil> I mean, we got benchy, let's benchmark
20:12:17FromDiscord<Phil> Eyecon, the hyphen position is always compile-time known?
20:12:34FromDiscord<EyeCon> In reply to @Isofruit "Eyecon, the hyphen position": Not my problem, @voidwalker?
20:13:01FromDiscord<voidwalker> yes, the position is constant
20:13:26FromDiscord<voidwalker> At least I hope so, will have to run a decode(encode()) on all db items to check if I got it right
20:18:29FromDiscord<Tuatarian> Is there a way to do memory arenas
20:18:48FromDiscord<Tuatarian> Ie block allocate a bunch of memory and dole it out manually
20:20:11FromDiscord<leorize> there is fusion/pools iirc
20:23:07FromDiscord<Phil> Dang, kinda wish I could tell benchy to do sth more than 1000 times
20:23:45FromDiscord<leorize> you can also just create a bunch of executables then use `hyperfine` to benchmark them
20:24:02FromDiscord<Phil> but leorize
20:24:04FromDiscord<Phil> I am lazy
20:24:39FromDiscord<Phil> sent a code paste, see https://paste.rs/cj5
20:25:03FromDiscord<leorize> so basically it doesn't matter \:P
20:25:17FromDiscord<Phil> I may have fucked up the implementations, but generally to me it appears that just inserting seems somewhat faster
20:25:19FromDiscord<Forest> In reply to @Avahe "Did you see https://github.com/treeform/pixie#maski": Okay issue with this example is i need to make the mask also apply a colour to the image
20:25:34FromDiscord<Phil> Tbh I could only be able to tell if I could tell benchy to run this 100.000 times rather than just 1000
20:26:00FromDiscord<Forest> Like, this was made from a white sheep and a mask (someone made it in JS), i wanna do it with Pixie https://media.discordapp.net/attachments/371759389889003532/1007384410221449217/unknown-1-1.png
20:26:23FromDiscord<Phil> Can somebody generate me a seq of 100 random strings with 50 characters ?
20:26:37FromDiscord<Forest> A sequence? Sure
20:27:11FromDiscord<Phil> I'm so brainbroken atm post sport and hard workday I can barely code a benchmark
20:28:54FromDiscord<leorize> your string builder is unoptimal, though
20:29:15FromDiscord<leorize> you're copying the guid, then concating them by pieces
20:29:20FromDiscord<Phil> I'll gladly take contributions!
20:29:28FromDiscord<Phil> To give voidwalker the perfect benchmark
20:29:49FromDiscord<Forest> https://haste.powercord.dev/naxexobobi
20:29:54FromDiscord<Forest> (edit) "https://haste.powercord.dev/naxexobobi" => "https://haste.powercord.dev/naxexobobi.json"
20:30:02FromDiscord<Forest> Wait do you mean with your thing?
20:30:14FromDiscord<Forest> I just generated this in python lmao
20:30:28FromDiscord<Phil> That's fine, I just need to copypaste it as base data
20:30:33FromDiscord<Forest> Oh sweet
20:31:33FromDiscord<Forest> In reply to @Forest "Like, this was made": But yeah, struggling with this, using the white sheep as the base, the image of retina burning as the mask https://media.discordapp.net/attachments/371759389889003532/1007385802893955102/mask.png https://media.discordapp.net/attachments/371759389889003532/1007385803225313372/mob.png
20:31:38FromDiscord<Forest> But i need to make the sheep coloured
20:32:14FromDiscord<Phil> In reply to @leorize "you're copying the guid,": you mean just the initial copy of `result=guid`? Or is the entire approach flawed?
20:32:18FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=47kE
20:33:49NimEventerNew thread by Dwin: Memory leak when embedding nimscript, see https://forum.nim-lang.org/t/9361
20:34:11FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47kG
20:36:30FromDiscord<leorize> the entire approach, for a builder approach, you you want to retrieve sized pieces of the streams to add into your result↵(@Phil)
20:36:40FromDiscord<leorize> lemme code one up real quick
20:36:56FromDiscord<Phil> Thank, I tried an enumerate over the string but that was even worse than my second proc
20:37:09FromDiscord<voidwalker> Oh man, you didn't have to go through all this trouble. I have a clusterfuck of the whole decode/encode code to optimize coming up : D
20:37:22FromDiscord<Phil> It is too late voidwalker
20:37:26FromDiscord<Phil> I'm in too deep now
20:38:04FromDiscord<Phil> If this piece of code isn't gonna be among the fastest lines of code you can have with provable benchmarks I shall be disappointed in myself! Or sleepy! Or Hungry! maybe all of those... I should make dinner
20:40:11FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#ix=47kF
20:43:44FromDiscord<Phil> Hmmmm somehow I'm running into problems
20:45:14FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47kK
20:45:44FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=47kK" => "https://play.nim-lang.org/#ix=47kL"
20:46:02FromDiscord<Phil> How does it get to 50? Wha?
20:46:03FromDiscord<Elegantbeef> There's not check that `start + i < guid.len`
20:46:46FromDiscord<Phil> for do an if first?
20:46:52FromDiscord<Phil> before the result add?
20:47:05FromDiscord<domosokrat> eorize's solution wants the part length, not offsets
20:47:59FromDiscord<domosokrat> sent a code paste, see https://play.nim-lang.org/#ix=47kO
20:48:17FromDiscord<voidwalker> What is this, 5th grade CS olympiad ? : D
20:48:29FromDiscord<Elegantbeef> 4.5th\
20:49:04FromDiscord<voidwalker> This is what I'm trying to do:
20:49:24FromDiscord<voidwalker> https://play.nim-lang.org/#ix=47kP
20:50:15FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=47kP" => "https://play.nim-lang.org/#ix=47kN"
20:50:47FromDiscord<Phil> In reply to @domosokrat "I removed some loops": Hmmm still breaks with `Error: unhandled exception: index 50 not in 0 .. 49 [IndexDefect]` though on line ` result.add guid[start..start+count]`
20:50:49FromDiscord<voidwalker> I know that optimally it should return a byte array, not a seq[array], but for now it appears to work on a few samples
20:52:06FromDiscord<domosokrat> @Phil\: Are you still calling it with `[20, 16, 12, 8] ` for the positions?
20:52:31FromDiscord<domosokrat> Instead of `[8, 4, 4, 4]`?
20:52:58FromDiscord<leorize> In an ideal world, this would be as fast as my solution\: `fmt"{hexstr[0..<8]}-{hexstr[8..<12]}-{hexstr[12..<16]}-{hexstr[16..<20]}-{hexstr[20..^1]}"`
20:54:03FromDiscord<Phil> In reply to @domosokrat "<@180601887916163073>\: Are you still": Aye... wait did that change?
20:54:29FromDiscord<leorize> but ofc, this is not and `[range]` allocates a copy of the slice
20:54:48FromDiscord<leorize> maybe it will be ideal in rust
20:56:33FromDiscord<domosokrat> would the view type rfc help, if it gets implemented?
20:57:18FromDiscord<leorize> maybe
20:59:00FromDiscord<Phil> Wait... demosokrat 's solution works with 8,4,4,4... i will not question, I will just code
20:59:44*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
20:59:59FromDiscord<Phil> The final score!
21:00:00FromDiscord<domosokrat> leos version does work the same
21:00:10FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47kS
21:00:48FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47kU
21:00:50FromDiscord<Phil> The others I called as before
21:01:09FromDiscord<Phil> Essentially, dang leorize
21:02:43FromDiscord<Phil> @voidwalker There you go, leo's version is the fastest, thought he indices are... different from before, I think it translated from just the numbers to the differences between the numbers in inverted order to the original array of positions?
21:02:46FromDiscord<domosokrat> I would have expected less difference between leorize' and mine…
21:03:18FromDiscord<Phil> Could be I messed something up? Keep in mind I did manipulate the signature to keep it equal between all participating procs
21:04:52FromDiscord<domosokrat> ah, I think I know. My version does a copy for the slices
21:06:29*ehmry joined #nim
21:06:56FromDiscord<Phil> Anyway, now void has blazingly fast code, I am satisfied, time to make dinner
21:21:40FromDiscord<voidwalker> I will be more careful with the word "optimal" from now on : )
21:31:01FromDiscord<Phil> Sidenote for the SO question about to be posted here:↵It's a self-answered one so I can google that damn error next time I faceplant into it
21:31:08FromDiscord<Phil> (edit) "here:↵It's" => "here by automod:↵It's"
21:31:32FromDiscord<Phil> (edit) "automod:↵It's" => "bot:↵It's"
21:32:22NimEventerNew question by Philipp Doerner: `Error: request to generate code for .compileTime proc`, see https://stackoverflow.com/questions/73327072/error-request-to-generate-code-for-compiletime-proc
21:32:50FromDiscord<Elegantbeef> Cmon phil
21:33:03FromDiscord<Elegantbeef> `echo static(isObject(A))`
21:34:09FromDiscord<Phil> I know what static does in general, but why is that valid?
21:34:19FromDiscord<Elegantbeef> Why wouldnt it be
21:34:29FromDiscord<Phil> static generally just means "the following is now compiletime", at least htat's how I interpreted it
21:34:44FromDiscord<Elegantbeef> It says "Statically evaluate the statement"
21:35:07FromDiscord<Phil> Ah, so at runtime that line breaks down to `echo true`
21:35:40FromDiscord<Elegantbeef> Correct, the real question is why are you annotating the procedure to be compiletime
21:36:44FromDiscord<Phil> The original usecase, which this question doesn't have anything to do with, for the compiletime proc was my parsing of a db_sqlite `Row` (well, ndb, but that's a fork of db_sqlite so that's almost the same) into a ref object type
21:37:01FromDiscord<Elegantbeef> Ok but `isObject` is evaluated statically
21:37:03FromDiscord<Phil> In there I have a couple "when" statements where I check "is the type of the field on my ref object itself an object"
21:37:16FromDiscord<Elegantbeef> You do not need `{.compileTime.}` in most cases
21:37:29FromDiscord<Elegantbeef> That's valid
21:37:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47l4
21:37:38FromDiscord<Elegantbeef> And it is the same as `echo static(int.isObject)`
21:37:41FromDiscord<Phil> squint but how do I know that this is compiletime when I absolutely positively want it to be compiletime
21:38:08FromDiscord<Elegantbeef> You look at the code you're running and if it's 100% static it's the compiler will do it at compile time
21:38:19FromDiscord<Elegantbeef> Plus in Nim types only exist at compile time
21:38:59FromDiscord<Elegantbeef> Ah shit i'm wrong 😄
21:39:24FromDiscord<Elegantbeef> `T2_ = isObjecttest50_6();` oh noes a call to return false!
21:39:40FromDiscord<Phil> But even if it doesn't do stuff, having the compiletime annotation gives me the ability to communicate that I intentionally want this thing to be compile-time and not that it's a happenstance that it's compiletime
21:39:58FromDiscord<Elegantbeef> Eh you do you
21:40:06FromDiscord<Elegantbeef> I dont see that as a benefit really
21:40:39FromDiscord<Phil> And given that I have the memory of a very wise goldfish (meaning stuff sticks around my head for 5 days instead of 5 minutes) I need to plan ahead to communicate with future me
21:40:52FromDiscord<Elegantbeef> It's surprising that Nim doesnt statically evaluate this though
21:40:59FromDiscord<Elegantbeef> given that it statically evaluates other things
21:43:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47l5
21:44:04FromDiscord<Elegantbeef> Compile time error
21:44:45FromDiscord<Elegantbeef> I guess the difference is the procedure could do stuff at runtime as such it needs it
21:45:10FromDiscord<Forest> Yeah can't figure out how to fix this, did a bit of tinkering for the last 30 or so minutes, and every time it's either a coloured pic of the mask, or a flat coloured pic https://hastebin.com/ubalilipeg.nim
21:45:27FromDiscord<Elegantbeef> So in the case you turned that into a `template isObject(a: typedesc): bool = a is (object or ref object)` you'd get static evaluation
21:47:10FromDiscord<Phil> That mostly just loses out to my general rule to use a proc when a proc can do it and only a template when a proc makes no sense.↵And evaluating A to B is a perfect proc usecase
21:55:36*CyberTailor quit (Remote host closed the connection)
21:58:29*CyberTailor joined #nim
22:09:25*CyberTailor quit (Remote host closed the connection)
22:10:54*CyberTailor joined #nim
22:14:23FromDiscord<MagneticSpark> I started learning nim today, and I noticed there were multiple vscode extensions available. One of them has more downloads, but it's not the one linked in the official "Nim basics tutorial". Which one is the "official"?
22:14:59FromDiscord<huantian> Then one by saem
22:15:16FromDiscord<MagneticSpark> Ok, I'll get that one then, thanks!
22:18:13*CyberTailor quit (Remote host closed the connection)
22:19:50*CyberTailor joined #nim
22:30:15FromDiscord<dom96> There is no "official" one
22:30:56FromDiscord<dom96> only different preferences among the Nim devs
22:35:09FromDiscord<Generic> the developement on the pragmatic one is basically dead though
22:36:44FromDiscord<Generic> and the other one/s are iirc mostly oriented around PMunch's lsp server
22:37:12FromDiscord<Generic> so for most people it's definitely the best choice
22:38:24FromDiscord<Generic> (full disclosure I'm was a contributor to the pragmatic one until it died and made since then several PRs to the seam one)
22:38:49FromDiscord<Generic> (edit) "I'm" => "I" | "seam" => "saem"
22:39:44FromDiscord<dom96> I don't need much to be happy: just syntax highlighting really. Everything else just gets in my way, so the pragmatic one is just fine
22:40:11FromDiscord<Generic> the saem one has even a few fixes for that
22:40:21FromDiscord<dom96> what other features do you use?
22:40:46FromDiscord<Generic> I use nimsuggest in smaller projects and linting via `nim check`
22:41:10FromDiscord<Generic> both also received fixes in the saem extension
22:48:56FromDiscord<Phil> Is there a way I can say "accept an object, but not one with inheritance"?
22:49:03FromDiscord<Phil> For a generic proc param
22:49:21FromDiscord<Rainbow Asteroids> why?
22:50:22FromDiscord<Prestige> sent a code paste, see https://play.nim-lang.org/#ix=47lh
22:50:37FromDiscord<Prestige> You don't need to set the alpha if you don't want to, either
22:50:48*rockcavera quit (Remote host closed the connection)
22:51:10FromDiscord<Phil> In reply to @Rainbow Asteroids "why?": I'm parsing `Row` into the passed object type and I can't properly guarantee field order with inheritance.
22:51:36FromDiscord<Phil> As in, I'm relying on the columns on row to be in the order of the fields on the type
22:51:51FromDiscord<Phil> Like, first field on the type is to be filled with the first column of data on the row
22:57:21FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=47li
22:57:21FromDiscord<Forest> Simpler
22:57:23FromDiscord<Forest> Thanks!
23:01:09FromDiscord<Prestige> No prob 🙂
23:11:15FromDiscord<Prestige> I have a bit of duplicate code I'm hoping I could reduce using templates (maybe will require a macro, hoping not): https://play.nim-lang.org/#ix=47ll↵Basically, I'm doing the same exact thing as this function but with "height" instead of "width". The only thing that really needs to happen, in substituting out `child.width` for `child.height`. Is there a simple way to sub out those calls with a template or something?
23:12:32FromDiscord<Elegantbeef> Cconcept + Macro↵(@Phil)
23:13:31FromDiscord<Elegantbeef> https://github.com/beef331/oopsie/blob/master/src/oopsie.nim#L11-L33 i think works, dont recall how tested it is
23:18:38FromDiscord<Phil> In reply to @Elegantbeef "Cconcept + Macro (<@180601887916163073>)": So inherits macro and in the concept assert that type.inherits is false
23:18:42FromDiscord<Phil> Nice to know! Thanks!
23:25:25FromDiscord<Prestige> In reply to @Avahe "I have a bit": Figured out a way
23:26:04FromDiscord<Elegantbeef> You used a template and the world was better
23:26:55FromDiscord<Prestige> Yeah, was trying to the whole time, but took me a bit to figure out how
23:27:02FromDiscord<Prestige> Well, I used a template inside a proc
23:34:04*rockcavera joined #nim
23:34:04*rockcavera quit (Changing host)
23:34:04*rockcavera joined #nim
23:35:02FromDiscord<Prestige> Okay it didn't work, it just stopped showing errors. weird
23:53:00FromDiscord<leorize> beef, iirc you made an interface vtable macro thingy, right?