<< 16-09-2022 >>

00:01:50FromDiscord<ravinder387> alright
00:02:08FromDiscord<ravinder387> i want to make argument optional.
00:03:26FromDiscord<ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4aBS
00:03:43FromDiscord<Elegantbeef> std/options
00:04:36FromDiscord<ravinder387> can i initialized value in object
00:05:01FromDiscord<Elegantbeef> You cannot set default values no
00:05:54FromDiscord<ravinder387> In reply to @Elegantbeef "std/options": can u write the code how i use options
00:06:03FromDiscord<Elegantbeef> `x: Option[int]`
00:06:44FromDiscord<ravinder387> and how to initialize tables constructor
00:06:57FromDiscord<Elegantbeef> @demotomohirowas reading your page further and https://internet-of-tomohiro.netlify.app/nim/faq.en.html#coding-how-to-store-different-types-in-seqqmark lacks `-d:useMalloc`
00:08:25FromDiscord<Elegantbeef> Read the docs↵(@ravinder387)
00:28:00FromDiscord<halc> After about 2 hours of reading the async sources, I finally understand how it works
00:28:02FromDiscord<halc> And I feel no satisfaction whatsoever
00:28:21FromDiscord<Elegantbeef> Congrats you now can make fixes to it, make the stacktrace non poop. Go! 😛
00:36:25FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4aC2
00:36:28FromDiscord<auxym> is there a way around that?
00:36:55FromDiscord<auxym> doesn't work
00:36:57FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4aC3
00:37:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aC4
00:37:38FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aC5
00:37:38FromDiscord<Elegantbeef> I'll learn to type eventually
00:39:06FromDiscord<auxym> i, too, have trouble typing 😛
00:39:08FromDiscord<auxym> smart, thanks
00:39:43FromDiscord<auxym> will make my macros slightly more readable by having less tmp1, tmp2, tmp3 littered everywhere
01:10:21FromDiscord<Elegantbeef> @auxym\: it's not well documented but https://github.com/beef331/micros/ will show some things you can do 😄
01:12:07FromDiscord<auxym> yeah, ive been meaning to peruse the tests or something for a while
01:12:37FromDiscord<auxym> writing docs sucks, no argument there
01:15:07*ehmry quit (Quit: No Ping reply in 180 seconds.)
01:16:17*ehmry joined #nim
01:19:39FromDiscord<Elegantbeef> To be fair every thing has a doc comment and i added myself to treeforms nimdocs so https://nimdocs.com/beef331/micros/micros.html
01:40:50*arkurious quit (Quit: Leaving)
01:41:44NimEventerNew thread by CircArgs: Custom macro inserts macro help, see https://forum.nim-lang.org/t/9470
01:49:49FromDiscord<! Nilts> How would i safely turn a image from a url to a uri. I tried some things and the image never renders.
01:53:34FromDiscord<! Nilts> (please ping)
01:57:20FromDiscord<! Nilts> nvm ill ask the fourm
02:03:46NimEventerNew thread by Nlits: How would i safely turn a image from a url to a uri., see https://forum.nim-lang.org/t/9471
02:08:36*wallabra quit (Ping timeout: 244 seconds)
02:18:00*oddish quit (Remote host closed the connection)
03:34:28*yolo quit (Ping timeout: 252 seconds)
03:44:31NimEventerNew post on r/nim by Mcfattti: Looking for someone to help learn Jester/Karax so we can fill out the docs!, see https://reddit.com/r/nim/comments/xfgkgn/looking_for_someone_to_help_learn_jesterkarax_so/
04:41:26FromDiscord<Iliketwertles> What's the preferable way to make printed strings have color when printed to terminal?
04:41:50FromDiscord<Elegantbeef> std/terminal
06:31:19*fallback quit (Ping timeout: 268 seconds)
06:45:43*fallback joined #nim
07:07:10FromDiscord<Yardanico> @ElegantBeef do you know if this is a valid way of using `setFrame` ? I'm wondering if it's possible to add custom stack trace entries, this works, but I don't know how safe it is
07:07:18FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4aD0
07:07:26FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4aD1
07:07:36FromDiscord<Yardanico> (edit) "https://play.nim-lang.org/#ix=4aD0" => "https://play.nim-lang.org/#ix=4aD2"
07:08:37FromDiscord<Elegantbeef> Raise an exception after the writeStackTrace and see what bubbles up
07:09:28FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4aD4
07:09:35FromDiscord<Yardanico> i'm mainly asking about doing `addr` from a stack variable
07:09:44FromDiscord<Elegantbeef> Yea i'm just testing the grounds here
07:10:00FromDiscord<Elegantbeef> I imagine that's fine
07:10:26FromDiscord<Elegantbeef> Actually call a proc inside this proc that raises an exception
07:10:49FromDiscord<Elegantbeef> That might get funky? I dont know
07:11:00FromDiscord<Elegantbeef> Truthfully i didnt realise `setFrame` was a thing
07:11:03FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4aD6
07:11:09FromDiscord<Yardanico> it's used in the C backend
07:11:22FromDiscord<Yardanico> only 1 time though it seems
07:11:31FromDiscord<Yardanico> https://github.com/nim-lang/Nim/blob/devel/compiler/ccgstmts.nim#L986
07:11:35FromDiscord<Elegantbeef> You might want to use `getFrame` to set the calldepth and the like
07:12:02FromDiscord<Elegantbeef> This seems like a useful thing for async
07:12:44FromDiscord<Yardanico> and what is `len` in TFrame ?
07:12:56FromDiscord<Elegantbeef> > ## LENGTH OF THE INSPECTABLE SLOTS.↵>
07:14:55FromDiscord<Elegantbeef> Yea i dont really know what the len and calldepth are
07:21:58FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=4aDb
07:24:33FromDiscord<flywind> The root problem seems that ARC/ORC initializes them aggressively as `static NIM_CONST` variable though.
07:24:42FromDiscord<Elegantbeef> `= ptr object`?
07:25:34FromDiscord<ravinder387> In reply to @Elegantbeef "> **## LENGTH OF": how to manipulate code like user write code "2 + 1" it eval to 3 but i wanna manipulate generate "2 - 1" by macros
07:25:46FromDiscord<flywind> In reply to @Elegantbeef "`= ptr object`?": I see, I will have a try.
07:25:57FromDiscord<mratsim> In reply to @flywind "The root problem seems": I think having a way to not initialize things is important. Especially when importing from C++
07:25:58FromDiscord<ravinder387> In reply to @flywind "I see, I will": how to manipulate code like user write code "2 + 1" it eval to 3 but i wanna manipulate generate "2 - 1" by macros
07:26:34FromDiscord<mratsim> In reply to @flywind "The root problem seems": See: https://github.com/nim-lang/Nim/issues/4687
07:26:41FromDiscord<Elegantbeef> Doesnt `{.noinit.}` work for this stuff?
07:26:56FromDiscord<Elegantbeef> Ah result
07:27:31FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=4aDc
07:27:38FromDiscord<flywind> (edit) "https://play.nim-lang.org/#ix=4aDc" => "https://play.nim-lang.org/#ix=4aDd"
07:30:06FromDiscord<mratsim> see also lengthy discussion here: https://github.com/SciNim/flambeau/issues/5
07:46:37FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=4aDh
07:51:04FromDiscord<flywind> In reply to @Elegantbeef "`= ptr object`?": Here is the PR => https://github.com/nim-lang/Nim/pull/20368, thank you!
07:52:13FromDiscord<Elegantbeef> Oh cool it works
07:53:01FromDiscord<flywind> I'm not sure since I don't have a macos 😜 debugging use CI as usual
07:53:05FromDiscord<Elegantbeef> Does that make `supportsCopyMem` fail though, dont rememeber
07:53:10FromDiscord<flywind> (edit) "use" => "using"
07:54:31FromDiscord<flywind> Soon, we will find what it breaks
08:05:06*xigoi left #nim (#nim)
08:22:09FromDiscord<planetis> I think supportsCopyMem returns true if there isn't a destructor
08:30:20NimEventerNew Nimble package! clown_limiter - Jester rate limiter plugin, see https://github.com/C-NERD/clown_limiter
08:53:11*rockcavera quit (Remote host closed the connection)
10:31:43*jjido joined #nim
11:03:59*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:10:48FromDiscord<ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4aE1
11:11:24FromDiscord<ravinder387> 5 + 4 = 10 https://media.discordapp.net/attachments/371759389889003532/1020290803496648774/2022-09-16.png
11:17:36FromDiscord<Rika> X and y are both from a
11:17:38FromDiscord<Rika> Not a and b
11:17:52FromDiscord<Rika> 5+5=10
11:19:11FromDiscord<ravinder387> sorry
11:20:07FromDiscord<ravinder387> dumTree: 1 + 1
11:20:25FromDiscord<ravinder387> how to convert into some other ast like 1 1
11:22:18FromDiscord<ravinder387> in some language it store as array [ "+", 1, 1] whcih data structure nim use to store ast
11:24:02FromDiscord<ravinder387> when i try to get arg[0] , arg[1] .... it says error how to get element from ast
11:35:47FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4aEb
11:36:51FromDiscord<Phil> Like, I get that whatever determines the hyperlinking is in between `< >` and... has to end with ` _` (?)↵But that's about it
11:40:32FromDiscord<Phil> Like, what is %25? why are their random data types thrown in afterwards?
11:41:42FromDiscord<Rika> The data types are the parameters it takes I would assume
11:42:05FromDiscord<Rika> #%25 is probably the name of the function in some sense
11:43:03FromDiscord<Phil> In reply to @Rika "The data types are": That sounds sensible, just checked with the proc that gets linked there:↵> func `%`(formatstr: string; a: openArray[string]): string {.....}↵Seems to be correct
11:43:14FromDiscord<Phil> But how the heck "%25" represents the actual proc name is beyond me
11:44:13FromDiscord<Phil> Like `%` in `%25` represents the actual symbol `%` that is the proc name... maybe?↵But what is the 25?
11:44:50FromDiscord<Phil> OHHHH THAT IS EFFING URL ENCODING
11:44:56FromDiscord<Phil> My worst foe, we meet once again
11:49:14FromDiscord<Rika> Wonder what the underscore is
11:52:01FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4aEe
11:52:38FromDiscord<Phil> Backticks delineating the entire construct... and additionally you have a random `_` at the end
11:53:18FromDiscord<Rika> Wonder why
12:01:40*jmdaemon quit (Ping timeout: 265 seconds)
12:10:07*arkurious joined #nim
12:45:27FromDiscord<enthus1ast> @cnerd\: why the dependency for sqlite in clown limiter, would it not just be a eg count table?
13:41:20*jjido joined #nim
13:53:24*wallabra joined #nim
14:28:54*rockcavera joined #nim
14:28:54*rockcavera quit (Changing host)
14:28:55*rockcavera joined #nim
14:32:09FromDiscord<Require Support> any idea how I can use `read` function from`streams` with a buffer of `char` but the size isn't known at compile time ? https://nim-lang.org/docs/streams.html#read%2CStream%2CT
14:40:18FromDiscord<Rika> Probably with read data instead
14:40:25FromDiscord<Rika> https://nim-lang.org/docs/streams.html#readData%2CStream%2Cpointer%2Cint
15:01:07*dv^_^ quit (Read error: Connection reset by peer)
15:24:05*dv^_^ joined #nim
15:30:48FromDiscord<Ecorous> In reply to @Ecorous "so uh": Anyone have ideas?
15:42:23FromDiscord<Rika> Did you put argparse in your nimble file
15:42:25FromDiscord<Rika> The required
15:42:28FromDiscord<Rika> Requires
15:42:48FromDiscord<Ecorous> am I stupid
15:43:37FromDiscord<Rika> Up to you to decide
15:43:51FromDiscord<Ecorous> I didn't know I had to do that
15:44:05FromDiscord<Ecorous> I literally reinstalled nim for thi
15:44:09FromDiscord<Ecorous> this
15:44:32FromDiscord<Rika> You have to do it when you run using nimble
15:44:36FromDiscord<Rika> If you run using Nim you do not
15:44:55FromDiscord<Ecorous> oh
15:44:58FromDiscord<Rika> Up to you if you want the “error if I mess up my dependencies” behaviour
15:45:02FromDiscord<Ecorous> that... makes sense
15:49:43FromDiscord<Ecorous> how can I pass an argument such as `-d` through `nimble run`?
15:52:42*yolo joined #nim
15:53:19FromDiscord<Phil> No idea, personally I just define nimble tasks
15:53:30FromDiscord<aruZeta> yh
15:53:48FromDiscord<Phil> One sec, copy pasting my current nimble task of my sideproject
15:54:08FromDiscord<Ecorous> https://media.discordapp.net/attachments/371759389889003532/1020361951735451689/unknown.png
15:54:19FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4aFA
15:54:30FromDiscord<Phil> That sounds like you need `--define:ssl` aka `-d:ssl` (same thing)
15:54:37FromDiscord<Phil> Wait, ddl, that's windows
15:54:55FromDiscord<Phil> hiss I shall withdraw into the darkness, I have no clue about windows and thus no competence to troubleshoot stuff about it
15:55:25FromDiscord<Ecorous> I might just run this through ssl
15:55:26FromDiscord<Phil> Sidenote, you do not need all the crap I have in my debug task, you can cut it down, it's just an example on how stuff can look like
15:55:49FromDiscord<aruZeta> In reply to @Isofruit "*hiss* I shall withdraw": me when a friend tells me about a problem they have in windows:
15:57:06FromDiscord<aruZeta> btw some hours ago I released v2.0.0 of QRgen https://github.com/aruZeta/QRgen/releases/tag/v2.0.0
15:57:33FromDiscord<aruZeta> it depends
15:57:51FromDiscord<aruZeta> lmao the bridge is sending messages from a while ago
15:58:22FromDiscord<Rika> In reply to @aruZeta "btw some hours ago": What changed
15:58:50FromDiscord<aruZeta> some api breaking changes
15:58:54FromDiscord<aruZeta> not much
16:01:41FromDiscord<Ecorous> tasks get me even less far afaics
16:02:06FromDiscord<Phil> oh?
16:02:37FromDiscord<Ecorous> nvm
16:02:47FromDiscord<Phil> Wait, do you have ssl installed? Is that by default included in windows?
16:02:52FromDiscord<Ecorous> --verbose borked
16:02:53FromDiscord<Ecorous> I think
16:04:10FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4aFD
16:05:53FromDiscord<Ecorous> I just added verbose because I thought it would be useful
16:07:27FromDiscord<Ecorous> ill try installing openssl
16:07:40FromDiscord<Ecorous> and yes I know to install openssl 1 not 3
16:17:08FromDiscord<Ecorous> In reply to @Isofruit "Wait, do you have": I installed it: Exception message: No SSL/TLS CA certificates found.
16:19:55FromDiscord<Ecorous> I really couldn't care less about this rn tbh, was just testing if dependencies was fixed
16:20:15FromDiscord<Phil> In reply to @Ecorous "I installed it: Exception": That's all I found about it, never had to deal with it myself:↵https://github.com/nim-lang/nimble/issues/904
16:20:26*yolo quit (Quit: Client closed)
16:30:03*yolo joined #nim
16:34:09FromDiscord<Require Support> is there a preferred gc for async stuff or just in general?
16:35:13FromDiscord<Require Support> (edit) "stuff or just in general?" => "stuff?"
16:56:16*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
17:03:02*yolo quit (Quit: Client closed)
17:06:41*yolo joined #nim
17:14:48*xet7 joined #nim
17:15:26FromDiscord<vestel> In reply to @Require Support "is there a preferred": probably orc
17:17:10FromDiscord<Require Support> In reply to @vestel "probably orc": wont compile with orc for some reason. problem with a `cast`
17:17:25FromDiscord<vestel> In reply to @Require Support "wont compile with orc": can you provide code?
17:19:08FromDiscord<Require Support> In reply to @vestel "can you provide code?": ill try to create quick poc code and post here
17:30:50NimEventerNew thread by archnim: Collecting keys and randomly picking values from tables, see https://forum.nim-lang.org/t/9473
18:26:32*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
18:26:53*ehmry joined #nim
18:34:37*yolo quit (Quit: Client closed)
18:42:38*jjido joined #nim
19:09:08NimEventerNew thread by juancarlospaco: Important_packages, see https://forum.nim-lang.org/t/9474
19:41:22*jmdaemon joined #nim
20:05:43*hexeme_ is now known as ldlework
20:32:52FromDiscord<Forest [She/Her]> How do i make a method runforever? :P
20:33:09FromDiscord<Elegantbeef> `while true`
20:33:12FromDiscord<Forest [She/Her]> I'm using asyncdispatch, and i wanna make a method runf
20:33:16FromDiscord<Forest [She/Her]> Run forever, since it's a server
20:33:33FromDiscord<Forest [She/Her]> I should of been more clear, my bad 😅
20:36:02FromDiscord<Forest [She/Her]> Figured it out ^^
21:41:26FromDiscord<Iliketwertles> In reply to @Iliketwertles "What's the preferable way": how would i use std/terminal to return the text colored?↵im making something that prints the return of a function and i want it to be colored
21:42:46FromDiscord<Elegantbeef> https://nim-lang.org/docs/terminal.html#styledWrite.m%2CFile%2Cvarargs%5Btyped%5D
21:45:39FromDiscord<Iliketwertles> not working https://media.discordapp.net/attachments/371759389889003532/1020450418607792208/screenshot_2022-09-16-174521.png
21:45:56FromDiscord<Elegantbeef> Oh you want a string
21:47:27FromDiscord<Iliketwertles> pretty sure it doesnt have to be for it to work aside from the function asking for one
21:48:00FromDiscord<Elegantbeef> Now that i look at that though it doesnt need strformat 😄
21:48:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aGU
21:48:01FromDiscord<Elegantbeef> I mean you're returning a string
21:48:09FromDiscord<Elegantbeef> If you dont need the string then remove the string requirement and be merry
21:48:28FromDiscord<Elegantbeef> \~\~As an aside Nim conventions are camelCased functions\~\~
21:51:01FromDiscord<Iliketwertles> `Error: invalid format string: missing closing character '}'`
21:51:25FromDiscord<Elegantbeef> Like i said it doesnt make sense to use strformat there
21:52:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aGW
21:52:41FromDiscord<Forest [She/Her]> How would i implement multiple servers forever? :P
21:53:07FromDiscord<Forest [She/Her]> I need to start a TCP server and a UDP server that run at the same time
21:53:32FromDiscord<Forest [She/Her]> Via google i saw it can be done via threads but... Is that the only way? Afaik you shouldn't mix threads and async
21:57:17*yolo joined #nim
22:01:31FromDiscord<Forest [She/Her]> Yeah I'm looking at the docs but not finding another way to so what i want rip
22:01:44FromDiscord<Elegantbeef> You can usue threads with async
22:03:24FromDiscord<Iliketwertles> sent a code paste, see https://play.nim-lang.org/#ix=4aGX
22:03:48FromDiscord<Forest [She/Her]> In reply to @Elegantbeef "You can usue threads": Aren't they discouraged though? And there's the issue of me needing to be able to pass data to them
22:03:55FromDiscord<Forest [She/Her]> (the threads)
22:04:01FromDiscord<Elegantbeef> Not really
22:04:23FromDiscord<Patitotective> In reply to @Forest "Aren't they discouraged though?": channels exist https://nim-lang.org/docs/channels_builtin.html
22:04:59FromDiscord<Elegantbeef> Threads and async solve different problems, so you can use them in conjunction
22:05:10FromDiscord<Elegantbeef> Though i dont know if you actually need threads or just are thinking you do
22:08:24FromDiscord<Forest [She/Her]> Hm neat
22:09:40FromDiscord<Forest [She/Her]> In reply to @Elegantbeef "Though i dont know": What i need to do is run multiple servers (could be multiple TCP servers, UDP servers or even a websocket server since this is acting as a cross-'platform' server) at the same time as eachother so i can read and send packets to each of them
22:11:13FromDiscord<Elegantbeef> And these all need to be in a single application?
22:13:05FromDiscord<Iliketwertles> finished project, i was rewriting a simple system fetch that i wrote in python(bottom) in nim(top) https://media.discordapp.net/attachments/371759389889003532/1020457322889363456/unknown.png
22:18:14FromDiscord<!!sharpcdf!!> sent a code paste, see https://play.nim-lang.org/#ix=4aGY
22:22:48FromDiscord<Elegantbeef> That shouldnt do anything
22:23:37FromDiscord<Forest [She/Her]> In reply to @Elegantbeef "And these all need": Yup
22:24:18FromDiscord<Forest [She/Her]> They're all intertwined, they all communicate with eachother and allow it to be bridged to each platform, with the idea of it being as close to seamless as possible
22:24:38FromDiscord<Elegantbeef> And you cannot use IPC for what reason?
22:25:02FromDiscord<Elegantbeef> Sharp you set url and path then the user says no and you dont reset them
22:25:16FromDiscord<Forest [She/Her]> IPC? Inter Process Communication?
22:25:34FromDiscord<Forest [She/Her]> Hm, i could, but no idea how it works tbh
22:25:36FromDiscord<Elegantbeef> https://github.com/sharpcdf/jitter/blob/main/jitter/github.nim#L84-L103 like you do not reset `downloadUrl` or `downloadPath`
22:25:50FromDiscord<Elegantbeef> Sockets, stdin, memfiles,....
22:28:33FromDiscord<Forest [She/Her]> Hm neat then, will try that
22:30:01NimEventerNew thread by morturo: How to get cursor position?, see https://forum.nim-lang.org/t/9475
22:31:26FromDiscord<!!sharpcdf!!> In reply to @Elegantbeef "Sharp you set url": right, thanks
22:42:42*hochata joined #nim
23:12:49*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)