<< 26-01-2022 >>

00:01:24FromDiscord<ynfle> In reply to @Elegantbeef "I seen the comment": I'm just lost. In my mind, a varargs should be checked recursively for its base type automatically. not sure why not
00:01:42FromDiscord<Elegantbeef> Well you can always try it first and if it fails try the next stage
00:02:00FromDiscord<ynfle> What do you mean next stage?
00:02:34FromDiscord<Elegantbeef> First check if the base fits otherwise do what it does now
00:03:19FromDiscord<ynfle> Base should be checked first?
00:03:42FromDiscord<Elegantbeef> Perhaps
00:08:26FromDiscord<ynfle> That's not how it does it for a non overloaded symbol
00:10:35FromDiscord<Elegantbeef> Sure but we're trying to fix stuff so trial and error is the best way to fixing issues
00:20:00FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Nxk
00:20:20FromDiscord<Elegantbeef> A C gen error so something is going off
00:21:07FromDiscord<Elegantbeef> What's your `scan` procedure?
00:21:24FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Nxm
00:22:23FromDiscord<Patitotective> In reply to @Elegantbeef "What's your `scan` procedure?": There are actually nine procedures starting with `scan`, there is no `scan` only procedure
00:22:45FromDiscord<Elegantbeef> `scanString` `scanNumber` `scanValue`?
00:23:08FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Nxo
00:23:21FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Nxp
00:23:38FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Nxq
00:25:04FromDiscord<Elegantbeef> What's PScanner?
00:25:28FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Nxr
00:25:35FromDiscord<Patitotective> `PTokenKind` is just an enum of all the valid token kinds
00:25:48FromDiscord<Patitotective> And `PrefsNode` an object variant
00:25:57FromDiscord<Elegantbeef> That cgen error is odd, i dont exactly see why it's happening
00:26:16FromDiscord<Patitotective> should i send you all the file?
00:26:24FromDiscord<Elegantbeef> is it on a repo
00:26:30FromDiscord<Patitotective> no 😕
00:26:34FromDiscord<Patitotective> (edit) "no" => "not yet"
00:26:59FromDiscord<Patitotective> maybe i can upload it and then send the link to you (?)
00:27:14FromDiscord<Elegantbeef> Well if it's a single file throw it on the playground
00:27:22FromDiscord<Elegantbeef> If it's multiple files a git repo would be ideal
00:27:38FromDiscord<Patitotective> i gtg now but i will send you the repo link when im back
00:28:30arkanoidElegantbeef, longest issue name ever https://github.com/nim-lang/Nim/issues/19453, not sure if you have any info in brain ram to add before reboot
00:31:47FromDiscord<Elegantbeef> ` for item in items[:openArray[byte]](): # Error: expected: ':', but got: ''` will not work
00:31:57FromDiscord<Elegantbeef> `[: T]` is for MCS only not normal procedure calls
00:35:16FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Nxw here is your actual issue
00:44:36arkanoidMCS?
00:44:45FromDiscord<Elegantbeef> Method call syntax
00:47:17arkanoidyes! that's the actual problem I see
00:50:44arkanoidthanks, I'm fixing the issue
00:59:07FromDiscord<Patitotective> @ElegantBeef https://github.com/Patitotective/NiPrefs/blob/main/src/niprefs/parser/scanner.nim
00:59:10*krux02 quit (Remote host closed the connection)
01:33:40FromDiscord<Patitotective> The error occurs in `scanValue`
01:39:03FromDiscord<ynfle> Beef, when does `f.n == nil`?
01:56:15FromDiscord<ynfle> Its a PNode for a PType
02:20:57*neurocyte0917090 quit (Ping timeout: 240 seconds)
03:19:22FromDiscord<Elegantbeef> @Patitotective\: how do i compile this?
03:26:25rockcaverais it possible to make an enum return a specific type? https://play.nim-lang.org/#ix=3NxU
03:27:20FromDiscord<Elegantbeef> What do you mean by "Return"
03:27:23FromDiscord<Rika> no, i believe its either int or string
03:27:32FromDiscord<Elegantbeef> You can do `cint(One)` if you need it
03:27:34FromDiscord<Rika> hold a value thats not int or string, beef
03:27:59FromDiscord<Elegantbeef> You can make an enum array if you need
03:29:22FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3NxW for instance
03:29:43rockcaveraactually I needed the generated C code to define the enum with `typedef cint`
03:30:03FromDiscord<Elegantbeef> Why?
03:31:46FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3NxX
03:32:02rockcavera{.size: sizeof(cint).} makes the C definition of the enum an NI32, without it Nim defines the enum as a C type NU8
03:32:37FromDiscord<Elegantbeef> I forgot that C didnt like that conversion
03:33:00*arkurious quit (Quit: Leaving)
03:33:31rockcaveraa current solution is to create a `converter`
03:33:54rockcaverabut I was expecting something more hergonomic, maybe a pragma in the declaration of type
03:34:20FromDiscord<Elegantbeef> I think you can use codegendecl to do it, but i could be wrong
03:34:49rockcaveraI will test
03:47:33rockcaveracodegendecl doesn't seem to work with type. I made an emit C code and imported it in type.
03:58:38NimEventerNew post on r/nim by Ether-naut: Proc to modify a sequence's element "in place", see https://reddit.com/r/nim/comments/scwoty/proc_to_modify_a_sequences_element_in_place/
04:04:18NimEventerNew thread by Archnim: Sleep in Nimscript, see https://forum.nim-lang.org/t/8841
05:39:39*al1ranger joined #nim
06:06:46*al1ranger quit (Ping timeout: 250 seconds)
06:13:52*rockcavera quit (Remote host closed the connection)
06:17:12NimEventerNew post on r/nim by ShadowRylander: Use nim to generate binaries for Python using nimpy and nimporter, see https://reddit.com/r/nim/comments/scz6qq/use_nim_to_generate_binaries_for_python_using/
06:28:49FromDiscord<malfong> sent a code paste, see https://play.nim-lang.org/#ix=3Nyp
06:30:43NimEventerNew thread by Oyster: Convert HSlice to varargs?, see https://forum.nim-lang.org/t/8842
06:40:44NimEventerNew thread by Jdf: Choosing a specific version of SQLite, see https://forum.nim-lang.org/t/8843
07:06:35*Gustavo6046 joined #nim
07:26:59haakonis there any way to require values for an object's fields when instantiating them? nim conjures up "empty values" which as a newbie i don't quite yet see the benefit of
07:28:18FromDiscord<Elegantbeef> It's a system language so 0 initalized memory is safer 😀
07:28:28FromDiscord<Elegantbeef> What do you mean "requires values" though?
07:29:12FromDiscord<Elegantbeef> There is a `requiresInit` pragma you can attach to the object
07:29:39haakonPerhaps the object has no meaning when one of its fields is not passed a value during instantiation. A compilation error might be nice in that case
07:29:50FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/zh1
07:30:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Nyy
07:31:37FromDiscord<Elegantbeef> The big benefit of 0 initing is if you have a `var a: ref int` attempting to dereference that will cause a nil error instead of silently work
07:31:41haakonThanks, requiresInit seems to work as I hoped :-)
07:33:48FromDiscord<Elegantbeef> No problem
07:55:24*jjido joined #nim
08:04:57NimEventerNew thread by Didlybom: Nim 2.0 and backwards compatibility, see https://forum.nim-lang.org/t/8844
08:05:46FromDiscord<Rika> Oh boy
08:06:45FromDiscord<Elegantbeef> the non elaborate answer is the funny thing
08:10:20Amun-RaI like academic discussions
08:10:35FromDiscord<Elegantbeef> Ah so then you dont like when i speak
08:11:34FromDiscord<demotomohiro> Probably, we have to add `when NimMajor >= 2:` branches to existing libraries.
08:22:10*l1x joined #nim
08:33:58*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
08:38:10*Lord_Nightmare joined #nim
09:10:56*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
09:13:05NimEventerNew thread by Chaemon: Static proc argument doesn't recognize the type, see https://forum.nim-lang.org/t/8845
09:35:36FromDiscord<Shiba> what https://media.discordapp.net/attachments/371759389889003532/935830322933805056/Capture.PNG
09:35:46FromDiscord<Shiba> i tried to compile to js
09:37:52FromDiscord<Elegantbeef> Works here what's the code?
09:38:09FromDiscord<Evrensel Kişilik> ummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
09:38:13FromDiscord<hmmm> beefy beefy can you go into the HSlice forum thread and answer this: "So is there a way to unpack an HSlice to be use as varargs?" I really want that functionality lol
09:38:34FromDiscord<Evrensel Kişilik> can i work with 1:1 scale on a 2K 27" monitor?
09:38:57FromDiscord<Rika> In reply to @Evrensel Kişilik "can i work with": What does that mean
09:39:03FromDiscord<Shiba> In reply to @Elegantbeef "Works here what's the": https://media.discordapp.net/attachments/371759389889003532/935831188550078534/Capture.PNG
09:39:15FromDiscord<Evrensel Kişilik> In reply to @Rika "What does that mean": i need a large workspace
09:39:15FromDiscord<hmmm> nu u will get blind and will only see a pink smudge in your avatar
09:39:32FromDiscord<Evrensel Kişilik> i mean is 27" too small for 2K 1:1 scale?
09:39:37FromDiscord<Elegantbeef> Nico no longer uses js for the web build
09:40:16FromDiscord<hmmm> hnm it might be too small but its 50/50 and you wont know unless u try
09:40:17FromDiscord<Elegantbeef> I mean my solution doesnt work in 1.6.2
09:43:05FromDiscord<hmmm> beefy did you read that thread? 🙇‍♂️
09:44:04FromDiscord<Elegantbeef> Yes
09:44:32FromDiscord<hmmm> lets lobby to add that functionality to nim 🙇‍♂️
09:45:06FromDiscord<hmmm> lets conspire to make it happen 🕵️‍♀️
09:45:10FromDiscord<enthus1ast> could prolly be done by a macro (tm)
09:45:14FromDiscord<Elegantbeef> The toseq works though
09:45:28FromDiscord<hmmm> nununu no workarounds
09:45:34FromDiscord<hmmm> we need exactly that
09:47:00FromDiscord<Elegantbeef> You cannot unpack values like that
09:47:54FromDiscord<hmmm> I know, you already told me but its soooo comfy to be able to do that, we must do the impossible to make it work
09:48:01FromDiscord<hmmm> 🙇‍♂️
09:48:53FromDiscord<Elegantbeef> I mean make an overload that takes a `Slcie`
09:49:23FromDiscord<Elegantbeef> Well the issue is that it takes `varargs[typed]` as the person noted
09:50:04FromDiscord<Elegantbeef> It needs to be either comma seperated ints or an array literal due to that
09:50:22FromDiscord<Elegantbeef> we can always conver a slice to an array
09:50:23FromDiscord<Elegantbeef> That's easy
09:51:33FromDiscord<hmmm> hmm .... are you offering workarounds? 🤔
09:54:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NyY
09:57:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NyZ
09:59:05FromDiscord<Elegantbeef> That still will not solve the bitops issue
10:02:51FromDiscord<hmmm> thats quite good, whats missing in respect with python star?
10:03:08FromDiscord<hmmm> does it work with seqs?
10:03:25FromDiscord<Elegantbeef> I dont know what python star is
10:04:42FromDiscord<Rika> Unpack array into arguments
10:04:50FromDiscord<Rika> Regardless of type
10:04:53FromDiscord<Elegantbeef> That cannot work with nim
10:04:57FromDiscord<Rika> Of course, since it is Python
10:06:17FromDiscord<hmmm> it feeds arrays / seqs as parameters to a func as far as I can tell
10:06:23FromDiscord<Elegantbeef> I mean hmm the example you seen before is cause Nim presently doesnt allow you to inject parameters from inside a call
10:08:35FromDiscord<hmmm> it wouldn work even if we restrict the seq and parameters to the same type?
10:13:17FromDiscord<Elegantbeef> `doThing(... a)` or similar needs compiler support
10:13:43FromDiscord<Elegantbeef> What are we talking about?
10:13:49FromDiscord<Elegantbeef> Unpacking inside a call?
10:13:55FromDiscord<hmmm> yes
10:15:02FromDiscord<Elegantbeef> Then yes it wouldnt work
10:15:13FromDiscord<hmmm> 😩
10:15:19FromDiscord<Elegantbeef> The issue is the compiler does "Hey this is a call, let's look at the parameters"
10:15:26FromDiscord<Elegantbeef> The parameters presently have to be comma seperated expressions
10:16:09FromDiscord<Elegantbeef> There are hacks that'd be easy to enable unpacking like allowing `doThing((a; b; c;))` but it's clearly a hack
10:16:37FromDiscord<mratsim> In reply to @Evrensel Kişilik "i need a large": I invested in a 35", it's greate to have many vscode tabs side-by-side.
10:17:18FromDiscord<hmmm> so we need glue that looks at a seq and says you know what, I can consider 1,2,3, elements from the seq as first second and third parameter of xyzproc()
10:17:31FromDiscord<Evrensel Kişilik> In reply to @mratsim "I invested in a": soooooooo
10:17:41FromDiscord<Evrensel Kişilik> what do you think 2k 27" 1:1 scale?
10:17:50FromDiscord<Evrensel Kişilik> would it be too small?
10:18:13FromDiscord<hmmm> 144hz I presume? 🧐
10:18:22FromDiscord<Evrensel Kişilik> In reply to @hmmm "144hz I presume? 🧐": yes it is also 144hz
10:18:32FromDiscord<Evrensel Kişilik> my notebook screen is also 144hz
10:18:36FromDiscord<mratsim> In reply to @Evrensel Kişilik "would it be too": I think so, eye fatigue is a bitch
10:18:40FromDiscord<hmmm> how much it costs
10:18:54*krux02 joined #nim
10:18:57FromDiscord<Evrensel Kişilik> i think i would still continue to play games on my notebook screen because i play games in my bed xD
10:19:13FromDiscord<Evrensel Kişilik> In reply to @hmmm "how much it costs": ummmm 3.6k TRY
10:19:28FromDiscord<Evrensel Kişilik> 266$
10:19:46FromDiscord<hmmm> yea buy it and repent later
10:19:57FromDiscord<hmmm> you will be fine
10:20:08FromDiscord<Evrensel Kişilik> https://www.viewsonic.com/tr/products/lcd/VX2758-2KP-MHD
10:20:22FromDiscord<hmmm> if not you can alwasy zoom and become a zoomer 😃
10:20:33FromDiscord<Evrensel Kişilik> In reply to @hmmm "if not you can": looooooooooooook
10:20:44FromDiscord<Evrensel Kişilik> i need to use it as 1:1 scale
10:20:58FromDiscord<hmmm> who doesnt 🤔
10:21:16FromDiscord<Evrensel Kişilik> oh i found chepaer
10:21:18FromDiscord<Evrensel Kişilik> (edit) "chepaer" => "cheaper"
10:21:29FromDiscord<Evrensel Kişilik> 257$
10:21:29FromDiscord<Evrensel Kişilik> lol
10:21:32FromDiscord<mratsim> oh it's 2560 x 1440 not 2k
10:21:37FromDiscord<mratsim> yes it's perfect
10:21:43FromDiscord<Evrensel Kişilik> sooooooooo
10:21:47FromDiscord<Evrensel Kişilik> what is it?
10:21:50FromDiscord<Evrensel Kişilik> 😱
10:21:59FromDiscord<hmmm> 1440 is perfect
10:22:00FromDiscord<mratsim> I have been using 27" 1440p for 9 years now
10:22:00FromDiscord<Evrensel Kişilik> less than 2k?
10:22:05FromDiscord<hmmm> buy it now
10:22:13FromDiscord<Evrensel Kişilik> In reply to @mratsim "I have been using": in 1:1 scale?
10:22:17FromDiscord<mratsim> yup
10:22:19FromDiscord<hmmm> yea
10:22:20FromDiscord<Evrensel Kişilik> hmmmmmmmmmmm
10:22:21FromDiscord<Evrensel Kişilik> nice
10:22:36FromDiscord<Rika> In reply to @hmmm "144hz I presume? 🧐": Lol
10:22:39FromDiscord<mratsim> the DPI is about 104 or something
10:22:43FromDiscord<Evrensel Kişilik> what is the difference between 1440p and 2K?
10:22:51FromDiscord<mratsim> less pixels to display
10:22:55FromDiscord<Evrensel Kişilik> 😱
10:22:58FromDiscord<Rika> I use 1440p too, but I have like 150% zoom because I’m becoming blind as fuck
10:23:01FromDiscord<Evrensel Kişilik> something between 1080p and 2K?
10:23:11FromDiscord<mratsim> 2K AFAIK doesn't exist.
10:23:11FromDiscord<Evrensel Kişilik> In reply to @Rika "I use 1440p too,": oh no
10:23:13FromDiscord<Rika> Isn’t 2k less than 1440p?
10:23:17FromDiscord<hmmm> more juice fore the card, things are bigger
10:23:24FromDiscord<Evrensel Kişilik> In reply to @Rika "I use 1440p too,": what is your screen's size?
10:23:28FromDiscord<Rika> 27
10:23:32FromDiscord<Evrensel Kişilik> oh no
10:23:33FromDiscord<Evrensel Kişilik> 😱
10:23:44FromDiscord<Rika> And I’m a foot or two from my monitor
10:23:44FromDiscord<Evrensel Kişilik> im doing so many things
10:23:49FromDiscord<hmmm> hey dont worry rika is a special case
10:23:59FromDiscord<Evrensel Kişilik> Unity, VSCode, Android Studio and more bullshits
10:23:59FromDiscord<Rika> Hey what the fuck don’t call me a special case
10:24:07FromDiscord<mratsim> I have a 27" in portrair mode, a 35" center (1440x1440) and my laptop screen 16".
10:24:10FromDiscord<enthus1ast> just get more screens then
10:24:19FromDiscord<Evrensel Kişilik> In reply to @hmmm "hey dont worry rika": oh its nice to hear
10:24:19FromDiscord<hmmm> l9opool no offense intended ofc 🙇‍♂️
10:24:24FromDiscord<Evrensel Kişilik> soooooooooooooooooooooooo
10:24:38FromDiscord<mratsim> 27" portrait is for browser, center is for coding, and laptop screen is for the CLI.
10:25:06FromDiscord<Rika> MBN having money 😛
10:25:36FromDiscord<Evrensel Kişilik> do you recommend curved screens?
10:25:44FromDiscord<Evrensel Kişilik> there are also curved things
10:25:49FromDiscord<mratsim> for 32+ yes a small curvature is OK
10:25:51FromDiscord<Evrensel Kişilik> i hate 1080p big monitors
10:26:00FromDiscord<mratsim> it depends also if you only code or also need design
10:26:04FromDiscord<hmmm> I hate curves 🧐
10:26:13FromDiscord<Evrensel Kişilik> but i think a 4K and huge curved monitor could be good
10:26:17FromDiscord<Evrensel Kişilik> but it is sooooo expensive
10:26:26FromDiscord<Evrensel Kişilik> sooo
10:26:28FromDiscord<Evrensel Kişilik> this
10:26:42FromDiscord<Evrensel Kişilik> what does this 1440p mean exactly?
10:26:56FromDiscord<Evrensel Kişilik> is that two 1080p?
10:27:12FromDiscord<Evrensel Kişilik> how much space will i have?
10:27:34FromDiscord<hmmm> it just means you will need a 4k$ graphics card to power it and place it on the othe end of saturn or its too near
10:27:56FromDiscord<Evrensel Kişilik> In reply to @hmmm "it just means you": my GPU is RTX 2060
10:28:11FromDiscord<Evrensel Kişilik> i think it is not good for playing games in 2K
10:28:27FromDiscord<Evrensel Kişilik> oh of course it is pretty good for competetive games
10:28:51FromDiscord<Evrensel Kişilik> but i already don't think that i will play games on that screen
10:29:00FromDiscord<Evrensel Kişilik> because i play games in my bed always xD
10:29:40FromDiscord<hmmm> hey we cant talk hardware in main go offtopic or a mod wil whack us with a medieval mace
10:30:46FromDiscord<Evrensel Kişilik> In reply to @hmmm "hey we cant talk": :BANNED:
10:54:34PMunchAnyone have a nice terminal graph library in Nim?
10:55:55PMunchLike give it a series of numbers within a range, then split the range into terminalWidth buckets and fill it with bars
11:02:49FromDiscord<hethir> can I create a `DateTime` from a `Time` or a unix timestamp?
11:03:20FromDiscord<federico3> @narimiran\: would it be possible to fix https://github.com/nim-lang/Nim/issues/14424#issuecomment-927309165 in the next release please?
11:05:04FromDiscord<mratsim> In reply to @Evrensel Kişilik "i think it is": It's good enough.
11:06:07FromDiscord<mratsim> In reply to @Evrensel Kişilik "but i think a": https://www.rtings.com/monitor/reviews/samsung/odyssey-neo-g9
11:15:01FromDiscord<narimiran> In reply to @federico3 "<@719992187890434069>\: would it be": probably for 1.6.6, because 1.6.4 is about the FFI regression and we want it out ASAP
11:15:11FromDiscord<Evrensel Kişilik> In reply to @mratsim "It's good enough.": ok thank you
11:15:22FromDiscord<Evrensel Kişilik> In reply to @mratsim "https://www.rtings.com/monitor/reviews/samsung/odys": oh no 😱
11:45:43*Gustavo6046 quit (Quit: Leaving)
11:48:58*mjsir911 quit (Quit: Goodbye, World!)
11:49:13*mjsir911 joined #nim
11:55:54*jjido joined #nim
11:59:41NimEventerNew thread by Jasonfi: HttpClient error message, see https://forum.nim-lang.org/t/8846
12:28:29*jmdaemon quit (Ping timeout: 256 seconds)
13:16:00*rockcavera joined #nim
13:16:00*rockcavera quit (Changing host)
13:16:00*rockcavera joined #nim
13:41:40*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:13:17*jjido joined #nim
14:25:00*arkurious joined #nim
14:35:17FromDiscord<hethir> In reply to @hethir "can I create a": does anyone know if this is possible?
14:47:10FromDiscord<Patitotective> In reply to @Elegantbeef "<@762008715162419261>\: how do i": clone the repo and run the script (?)
14:47:31FromDiscord<Patitotective> `src/niprefs/parser/scanner.nim`
14:52:25FromDiscord<IsaacPaul> In reply to @hethir "does anyone know if": varTime.utc()
14:56:42*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
15:07:59FromDiscord<Patitotective> @ElegantBeef If on `scanValue` you comment every procedure or line that calls `addToken`, it works↵S
15:08:00FromDiscord<Patitotective> (edit) "works↵S" => "works"
15:13:41FromDiscord<Patitotective> If an `object` `init`'s procedure does not have any default-parameters, is that procedure worth? Or should I just instance the `object` directly, without any procedure?
15:13:49FromDiscord<Patitotective> (edit) "`object` `init`'s" => "`object`'s `init`"
15:22:22FromDiscord<Kerosen> It's possible to have a Nim compiler on android?
15:24:34FromDiscord<Kerosen> Like, compiling the Nim compiler for android
15:24:39FromDiscord<Rika> through termux i think is the name
15:27:45FromDiscord<IsaacPaul> yea on termux
15:27:59FromDiscord<IsaacPaul> over adb it might be a bit more tricky
15:43:06*cyraxjoe quit (Quit: No Ping reply in 180 seconds.)
15:44:21*cyraxjoe joined #nim
15:45:40NimEventerNew post on r/nim by mavavilj: Is there some idiomatic way to get the sign of a value?, see https://reddit.com/r/nim/comments/sd8why/is_there_some_idiomatic_way_to_get_the_sign_of_a/
15:50:08FromDiscord<tandy> hmm, im adding query parameters into a string like `"/user/%userId/filter/%filterId"`, using `replace`, but in some cases, the query parameters need to be added on the end like `uri.?`, is there a clever way to make params get "eaten" if they get replaced so it doesnt add them on twice?
15:50:25FromDiscord<tandy> code looks like this
15:50:26FromDiscord<tandy> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/935924579325591624): hmm, im adding query parameters into a string like `"/user/%userId/filter/%filterId"`, using `replace`, but in some cases, the query parameters need to be added on the end like `uri.?`?↵is there a clever way to make params get "eaten" if they get replaced so it doesnt add them on twice?
15:50:28FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3NAM
15:50:37FromDiscord<tandy> `https://newcircuit.io/_matrix/client/r0/user/%40dylhack%3Anewcircuit.io/filter/1?userId=%40dylhack%3Anewcircuit.io&filterId=1`
15:50:47FromDiscord<tandy> causes results like this, which cause excess query parameters to be added to the end where they are just replaces
15:56:19FromDiscord<haolian9 (高浩亮)> sent a code paste, see https://play.nim-lang.org/#ix=3NAO
15:56:30FromDiscord<tandy> i think i just need to use https://nim-lang.github.io/Nim/strutils.html#%25%2Cstring%2CopenArray%5Bstring%5D
15:58:37FromDiscord<haolian9 (高浩亮)> i did checked [the manual](https://nim-lang.org/docs/tut1.html#control-flow-statements-case-statement), but could not found such use case
15:59:05FromDiscord<Patitotective> How am I supposed to use _nepg_ to tokenize? 🧐
15:59:10FromDiscord<Patitotective> (edit) "_nepg_" => "_npeg_"
15:59:28FromDiscord<Patitotective> Or defining the rules is already tokenize?
16:05:30FromDiscord<mratsim> In reply to @Patitotective "How am I supposed": You write your own lexer. Like all dragons did.
16:07:09FromDiscord<IsaacPaul> In reply to @haolian9 (高浩亮) "i wrote a snippet": um.. you do realize that your code is hardly readable.
16:07:22FromDiscord<Patitotective> In reply to @mratsim "You write your own": Is this a lexer? https://craftinginterpreters.com/scanning.html
16:08:00FromDiscord<Patitotective> Should I use https://github.com/loloicci/nimly ? or write my own?
16:12:59FromDiscord<ark> has anyone written out DLL's or SO's with NIM? I'm in a pretty fun intro to malware analysis course and NIM was used as an example
16:13:40FromDiscord<haolian9 (高浩亮)> eh, i did not know how to reply you on this ...↵(@IsaacPaul)
16:24:31FromDiscord<IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3NAW
16:24:47FromDiscord<IsaacPaul> you want `break` not continue
16:25:45FromDiscord<IsaacPaul> oh you're right yea idk
16:26:12FromDiscord<IsaacPaul> I would expect continue to skip the rest of the current loop too
16:28:17ZevvPatitotective: https://github.com/zevv/npeg/blob/master/tests/lexparse.nim
16:29:35Zevvthat's a tiny example with two stages: the lexer first takes your input and splits it into a seq of tokens - just a flat list without any hierarchy. The second stage takes this list of tokens and constructs an AST of `Node` types
16:30:41FromDiscord<Patitotective> Thanks
16:30:42FromDiscord<Patitotective> 🙃
16:30:52Zevvthe `$`(Node) proc is used to represent the AST tree as a string, which is in the last statement used to verify that the AST tree has the right layour
16:30:55Zevvlayout
16:33:20FromDiscord<Patitotective> What is the difference between `State.tokens` and `State.stack`?
16:36:01FromDiscord<System64 ~ Flandre Scarlet> I have a question↵Does Nim have an image manipulation tool like Python's Pillow?
16:40:58*noeontheend joined #nim
16:46:39FromDiscord<haolian9 (高浩亮)> finally, i realized that `of aeiou` branch should follow with a `continue` too, if i want make this snippet work as expected.↵as you said, this snippet is a bit complicated, i just want to see how `continue` works with `case`↵thanks for your time!
16:49:28FromDiscord<Evrensel Kişilik> 😱 https://programming-language-benchmarks.vercel.app/nim-vs-go 😱
16:49:43*noeontheend quit (Ping timeout: 256 seconds)
16:50:02*arkurious quit (Ping timeout: 240 seconds)
16:50:44FromDiscord<IsaacPaul> isnt go automatically threaded?
16:51:08FromDiscord<Evrensel Kişilik> In reply to @IsaacPaul "isnt go automatically threaded?": wdym?
16:52:56FromDiscord<IsaacPaul> concurrency is built into the language so things run.. concurrently instead of serially which results in a performance boost?
16:53:13FromDiscord<ajusa> Nim beats go at some of these benchmarks, and I one example using methods which can be slow
16:57:54FromDiscord<IsaacPaul> also for fasta go is threaded and nim is single threaded
16:58:48*noeontheend joined #nim
17:01:24FromDiscord<demotomohiro> It looks like go uses mutiple threads while Nim uses only 1 threads.
17:02:52*arkurious joined #nim
17:06:57FromDiscord<demotomohiro> People spent few time to learn about Nim and write a benchmark program to compare with other well optimized program.
17:07:51*noeontheend quit (Ping timeout: 256 seconds)
17:15:02FromDiscord<Bung> how to get list of nimble packages ?
17:18:48*cyraxjoe quit (Ping timeout: 268 seconds)
17:19:31*cyraxjoe joined #nim
17:19:44FromDiscord<demotomohiro> @System64 ~ Flandre Scarlet https://github.com/xflywind/awesome-nim#image
17:20:54FromDiscord<demotomohiro> `nimble refresh`/
17:23:51FromDiscord<Bung> I mean programaticly
17:42:07FromDiscord<mratsim> In reply to @Evrensel Kişilik "😱 https://programming-language-benchmarks.vercel": I can probably slaughter everyone on secp256k1 bench https://programming-language-benchmarks.vercel.app/problem/secp256k1
17:43:11*vicfred joined #nim
17:44:06FromDiscord<Evrensel Kişilik> as we see V8 is the best xD
17:44:57FromDiscord<Evrensel Kişilik> what is secp256k1?
17:47:16FromDiscord<mratsim> In reply to @Patitotective "Is this a lexer?": lexing and scanning are synonymous.
17:47:17FromDiscord<mratsim> why is what I write red?
17:47:25FromDiscord<mratsim> In reply to @Evrensel Kişilik "what is secp256k1?": The elliptic curve used for Bitcoin
17:51:16FromDiscord<mratsim> In reply to @Evrensel Kişilik "as we see V8": also coro-prime-sieve there is a post on how to accelerate it by xx% on the Nim forum
17:51:39FromDiscord<Evrensel Kişilik> In reply to @mratsim "The elliptic curve used": 😱 I DON'T BELIEVE BLOCKCHAIN 😱
17:52:23FromDiscord<Evrensel Kişilik> we can't avoid race conditions in blockchain
17:54:06FromDiscord<mratsim> In reply to @Evrensel Kişilik "we can't avoid race": you have a consensus algorithm to deal with them.
17:54:21FromDiscord<mratsim> In reply to @Evrensel Kişilik "😱 I DON'T BELIEVE": Nim has been sponsored by a blockchain company for 3 years now
17:54:44FromDiscord<mratsim> https://nim-lang.org/sponsors.html https://media.discordapp.net/attachments/371759389889003532/935955933249536070/unknown.png
17:55:03FromDiscord<mratsim> which happened to be who I work for 😉
17:56:56*PMunch quit (Quit: leaving)
17:57:10FromDiscord<Evrensel Kişilik> In reply to @mratsim "Nim has been sponsored": why don't you be a sponsor to me?
17:57:44FromDiscord<mratsim> we do bounties to fix stuff, like we hire people to fix dev tooling
17:58:38FromDiscord<mratsim> https://github.com/nim-lang/RFCs/issues/300
17:58:58haakonis there a `contains` proc that takes a predicate? so far I'm using `count` and checking for > 0
18:03:02haakonmratsim: have you implemented secp256k1 in nim? Or wrapping libsecp256k1?
18:31:26FromDiscord<IsaacPaul> damn I must be miss understanding something about block chains. I didn't think they could make that much money.
18:40:29*neceve joined #nim
18:56:11*jjido joined #nim
19:20:35NimEventerNew post on r/nim by Ready_Photograph_279: chvancooten/NimPackt-v1: Nim-based assembly packer and shellcode loader for opsec &amp;amp; profit, see https://reddit.com/r/nim/comments/sddxa0/chvancootennimpacktv1_nimbased_assembly_packer/
19:32:01arkanoidcan I do something like "for atype in [int16,int32,int64]" without convoluted macro?
19:35:45FromDiscord<haxscramper> you might try to do it with `(int16, int32, int64)` maybe
19:35:55FromDiscord<haxscramper> certainly not with array, it must have the same type for each element
19:36:11FromDiscord<haxscramper> `std/typetraits` might have some tuple iterators that you might find useful
19:38:00FromDiscord<haxscramper> hmm, there is 1k USD bounty for interfaces in nim now https://github.com/nim-lang/RFCs/issues/39#issuecomment-1018706344
19:38:06FromDiscord<haxscramper> (edit) "hmm," => "nice,"
19:40:10arkanoidmaybe: https://nim-lang.org/docs/typetraits.html#get.t%2Ctypedesc%5B%5D%2Cstaticint
19:41:35FromDiscord<eyecon> I scanned it but didn't immediately see what an interface as described does better than a concept, does anyone know?
19:41:36arkanoidinterfaces in nim? Interesting, but what kind of interfaces? OOP like, or FP like?
19:52:04FromDiscord<haxscramper> I think specific details can be discussed along the way, but probably more OOP/go etc.?
19:56:34FromDiscord<Phil> I'm currently making a tiny package out of my minimal db connection pool thingy↵... Do I just compile libraries with nim c to see if it runs and make it so that compiling also runs the test suite?
19:57:28FromDiscord<Phil> (edit) "nim" => "`nim" | "`nimc ... to" added "src/tinypool.nim`"
20:26:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
20:41:03*jjido joined #nim
20:43:31*happycorsair[m] quit (Quit: Client limit exceeded: 20000)
20:57:41FromDiscord<lakmatiol> which vscode should I use, the one written in nim or the one written in JS?
20:57:46FromDiscord<lakmatiol> (edit) "which vscode ... should" added "extension"
20:57:55*happycorsair[m] joined #nim
21:00:32*neceve quit (Ping timeout: 240 seconds)
21:02:17FromDiscord<konsumlamm> the one written by saem
21:03:08FromDiscord<lakmatiol> ok
21:03:10FromDiscord<lakmatiol> (edit) "ok" => "ok, ty"
21:04:21FromDiscord<konsumlamm> how exactly does one use `--expandArc`? in particular, where is the output supposed to be?
21:07:09FromDiscord<leorize> it will expand a proc and show you all the copy/destructors calls
21:07:37FromDiscord<konsumlamm> yeah, but where?
21:07:53FromDiscord<konsumlamm> does it print it to stdout? because i don't see anything
21:16:13FromDiscord<leorize> yea, stdout
21:18:11FromDiscord<Vindaar> In reply to @konsumlamm "how exactly does one": but you have to tell it the proc you want expanded. So `--expeandArc:foo`
21:19:03FromDiscord<konsumlamm> i did that
21:19:59FromDiscord<konsumlamm> or does that mean that there's no destructor calls etc?
21:22:03FromDiscord<Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=3NCy
21:22:10FromDiscord<Vindaar> In reply to @konsumlamm "or does that mean": not sure, if that could explain it
21:22:30FromDiscord<Vindaar> ah
21:22:33FromDiscord<Vindaar> apparently
21:24:04FromDiscord<konsumlamm> huh, i think it's only when it gets used
21:24:14FromDiscord<konsumlamm> because otherwise it probably gets dead code eliminated?
21:33:20FromDiscord<Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=3NCG
21:34:51FromDiscord<konsumlamm> it works for me, perhaps you forgot to add `--gc:arc`
21:35:42FromDiscord<Elegantbeef> I mean `"bla"` isnt gc'd
21:36:01FromDiscord<Elegantbeef> It's a constant array `['b', 'l', 'a']` in C
21:37:17FromDiscord<Elegantbeef> Although i guess it does get converted to a Nim string to echo
21:38:16FromDiscord<Vindaar> In reply to @konsumlamm "it works for me,": indeed. I first tried the above example without arc and it shows there. but not for the `blub` case. with arc it shows it
21:38:35FromDiscord<Vindaar> there being the `Foo` using code
21:40:33FromDiscord<Elegantbeef> If you make the `echo` print a constant foo it also doesnt have destructors
21:41:27*k0mpjut0r joined #nim
21:41:59FromDiscord<Michal Maršálek> In reply to @haakon "is there a `contains`": any from sequtils
21:42:54FromDiscord<Elegantbeef> also `anyit`
21:43:37FromDiscord<Phil> can you... catch a defect at compile time to throw a better, more descriptive defect?
21:43:59FromDiscord<Elegantbeef> No defects are not to be caught
21:44:22FromDiscord<Elegantbeef> And you cant inject code into other libraries
21:45:04FromDiscord<konsumlamm> i created an issue: https://github.com/nim-lang/Nim/issues/19459
21:49:15FromDiscord<Phil> In reply to @Elegantbeef "No defects are not": ... So the answer is to check for what will raise the defect and raise your own defect before they can raise theirs, for their error message is non-descriptive and I need a more specific one for my own usecase
21:50:46FromDiscord<Elegantbeef> Pretty much
21:51:32*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:52:33FromDiscord<Phil> Can you... test for defects?
21:52:56FromDiscord<Phil> I know `expect`exists... well, might as well try it whether that can "catch" a defect
21:53:16FromDiscord<Elegantbeef> It can in certain dialects
21:53:18FromDiscord<Elegantbeef> In tests you can
21:53:25FromDiscord<Elegantbeef> You should never rely on catching defects in actual code
21:53:43FromDiscord<Elegantbeef> defects are logical issues that can be fixed, not exceptional
21:53:58FromDiscord<Phil> I never intend to catch defects in actual code
21:54:01FromDiscord<Phil> This is more a testing issue
21:54:08FromDiscord<Phil> I'm turning my database connection thing into a package
21:54:25FromDiscord<Phil> And I want to have it explode into somebody's face if they forget to initialize the pool and try to use it anyway
21:54:32FromDiscord<Phil> But I'd also like to test that that happens when I do it
21:54:43FromDiscord<Phil> (edit) "I do" => "somebody does"
21:55:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NCN
21:55:35FromDiscord<Elegantbeef> Ah then yes feel free to catch a defect and raise your own
21:58:21FromDiscord<that_dude> In reply to @Elegantbeef "And you cant inject": >:)
21:59:25FromDiscord<Elegantbeef> Get outta here you nerd
21:59:35FromDiscord<that_dude> >:D
22:00:51FromDiscord<that_dude> I think that could count as 2 people now lol
22:01:03FromDiscord<that_dude> ish
22:01:27FromDiscord<Elegantbeef> Not really
22:02:04FromDiscord<that_dude> yeah :(
22:02:12FromDiscord<that_dude> You're right
22:02:29FromDiscord<Elegantbeef> Most people are sane and dont want to inject code into libraries 😛
22:03:19FromDiscord<that_dude> I just want to make more things possible. Including being able to split up my libs
22:03:41FromDiscord<that_dude> Any way lol
22:04:10FromDiscord<Elegantbeef> Perhaps design the code that way
22:04:40FromDiscord<that_dude> I was actually wondering, it's cool that there is a vm to do compile time calculations, but why not just run the more powerfully main compiler twice instead?
22:05:24FromDiscord<Elegantbeef> Cause that makes no sense the VM is apart of the compiler
22:06:12FromDiscord<that_dude> I thought that you can just use the vm on it's own. I also thought that it's used to do it's compile time evaluations for const and stuff like that
22:06:17FromDiscord<Elegantbeef> The VM does application of logic, the Compiler just mutates AST
22:06:35FromDiscord<that_dude> Oh so all logic goes into the vm then?
22:06:57FromDiscord<Elegantbeef> Well the compiler semantically checks the constant expressions then passes them to the VM to evaluate
22:07:06FromDiscord<Elegantbeef> You can use the VM on it's own
22:07:13FromDiscord<Elegantbeef> But the compiler also ships with it for CTE
22:08:28FromDiscord<that_dude> ok
22:08:29FromDiscord<Elegantbeef> Macros and static scopes require evaluation, running the compiler twice doesnt give you evaluation without a computational unit
22:09:37FromDiscord<that_dude> I think I'm tired rn lol
22:09:45FromDiscord<that_dude> It's mid day and I'm losing it
22:34:03FromDiscord<Phil> ... I do not comprehend why I'm not getting shown my defect error message
22:34:20FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3NCW
22:34:46FromDiscord<Phil> Much, much simplified. I intentionally want to forget to call "initConnectionPool", which means the attributes of the global var "Pool" never get set
22:35:06FromDiscord<Phil> And then, if you call the template it's supposed to explode with the PoolDefect error message shown in borrowConnection
22:35:32FromDiscord<Phil> Instead if just shows you the file and the line where the error occurs, which is correct, but where's my error message
22:36:25FromDiscord<Elegantbeef> What does the actually compiler show?
22:36:36FromDiscord<Elegantbeef> well an actual binary\
22:36:54FromDiscord<Phil> Errr that is a very good question, I've only imported it in inim
22:37:04FromDiscord<Phil> I do have a binary from compiling it
22:37:50FromDiscord<Phil> a `pool` binary from the `pool.nim` module (the only module) in the `tinypool`package.↵I've also got a `tinypool.out`
22:38:13FromDiscord<Elegantbeef> Well compile it and run it outside inim
22:38:21FromDiscord<Elegantbeef> It might not be playing nice with the output
22:49:54FromDiscord<Phil> ... yeh, inim wasn't playing nice, in my tests I got it to print out correctly
22:50:47FromDiscord<Elegantbeef> `nvim /tmp/test.nim` goes brr 😜
22:58:10FromDiscord<Phil> Alright, got the basics down, strictly speaking I should still throw in a couple more unit tests but
22:58:10FromDiscord<Phil> eh
22:59:13FromDiscord<Phil> That's for tomorrow
22:59:43FromDiscord<Phil> Now to figure out how to actually publish sth to nimble
22:59:43FromDiscord<Elegantbeef> https://github.com/nim-lang/packages
22:59:44FromDiscord<Phil> Huh, thanks!
23:01:50FromDiscord<Phil> sent a long message, see http://ix.io/3ND4
23:03:21FromDiscord<Elegantbeef> You dont need to post on nimble, it doesnt mean much aside people can do `nimble install`
23:03:30FromDiscord<Elegantbeef> Nimble supports packages on git
23:06:23*k0mpjut0r quit (Ping timeout: 250 seconds)
23:19:03FromDiscord<congusbongus> maybe tiny means things like leftpad
23:20:41FromDiscord<congusbongus> or anything made by jonschlinkert
23:26:30FromDiscord<pruno> Hello, i'm having an issue with a little project. What i want to do is the following :↵After some calculation, i get a memory address in a variable. At that memory address, the following value is present : A008, is there any way to get the value at that memory address ? (Something like, myvariable.value)
23:27:01FromDiscord<Elegantbeef> `cast[ptr YourType](yourPointer)[].value`?
23:29:59FromDiscord<pruno> What do you mean by "YourType" for the cast ?
23:30:25FromDiscord<Elegantbeef> Well your object that has the `value` field
23:30:51FromDiscord<Elegantbeef> If you just want to get the value of a specific type from a pointer you'd just do `cast[ptr T](yourPointer)[]`
23:34:26*jmdaemon joined #nim
23:42:43FromDiscord<mratsim> In reply to @haakon "<@570268431522201601>: have you implemented": https://github.com/mratsim/constantine/blob/50717d8de6715647320fb69935bf8926b5769f95/constantine/config/curves_declaration.nim#L174
23:43:50FromDiscord<pruno> sent a code paste, see https://paste.rs/twc
23:45:55FromDiscord<Elegantbeef> You have a pointer you want to offset by 9 bytes?
23:46:12FromDiscord<Elegantbeef> and then you want to get the data there was a 64bit int?
23:49:22FromDiscord<pruno> I just want to be able to print the A008 at the memory location 0x1e5bbdf6a09 (not sure i understood your questions)
23:49:56FromDiscord<leorize> a 9 bytes offset is suspicious is what he meant
23:49:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NDa
23:51:53FromDiscord<leorize> it really depends on how your debugger interprets that data
23:52:03FromDiscord<pruno> Oh, it's just the calculation, p_reloc is at specific point and i need the data 9 bytes after that
23:52:18FromDiscord<Elegantbeef> Well then my code gives you that
23:52:35FromDiscord<Elegantbeef> you get the address of 9 bytes after the first byte of `pReloc`
23:52:58FromDiscord<Elegantbeef> So in theory the second byte of an int coming after pReloc
23:54:10FromDiscord<leorize> fwiw, A008 is 40968, Nim prints number in decimal
23:54:13FromDiscord<pruno> Mmh, i still get 2208 and not A008, weird
23:54:42FromDiscord<leorize> 2208 is 0x8A0
23:55:18FromDiscord<pruno> Oh, yeah, makes sense lol
23:55:47FromDiscord<Elegantbeef> Yea you're not going to get hex output
23:55:47FromDiscord<Elegantbeef> echo prints decimal as leorize pointed out
23:55:47FromDiscord<Elegantbeef> You're looking at BE and getting LE
23:55:51FromDiscord<Elegantbeef> I think that's BE... i've been known to being wrong
23:56:02FromDiscord<leorize> it's the opposite of whatever they are using \:p
23:56:08FromDiscord<Elegantbeef> Indeed
23:56:40FromDiscord<leorize> seems like it's just endian so it's an easy fix
23:56:46FromDiscord<pruno> Yes indeed
23:57:18FromDiscord<leorize> this is why you should always add `0x` to hex numbers so you don't mess them up in your head \:p
23:58:21FromDiscord<pruno> Good tip :)