<< 21-02-2023 >>

00:00:33FromDiscord<Hourglass [She/Her]> Naming the macro `wipe`, very creative :p
00:07:20FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oK6
00:09:22FromDiscord<auxym> `static[JsonNode]`, probably
00:09:58*azimut joined #nim
00:10:38FromDiscord<huantian> You might want to serialize the json into a proper Nim type outside of the macro first
00:12:50FromDiscord<Hourglass [She/Her]> In reply to @auxym "`static[JsonNode]`, probably": Ah
00:12:59FromDiscord<Hourglass [She/Her]> In reply to @huantian "You might want to": That'd be... Massive
00:13:42FromDiscord<Hourglass [She/Her]> JsonNodes can't be constant
00:13:47FromDiscord<Hourglass [She/Her]> Can't be a constant
00:13:49FromDiscord<Hourglass [She/Her]> So there's that
00:15:09FromDiscord<Hourglass [She/Her]> This works however
00:15:09FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oK7
00:18:32FromDiscord<Hourglass [She/Her]> I may just end up implementing the 1.19.3 protocol manually, I'm not finding any joy in this and I'm more likely to burn out than make progress
00:23:05FromDiscord<huantian> In reply to @Hourglass, When the Hour Strikes "That'd be... *Massive*": Really? Why
00:32:08FromDiscord<Hourglass [She/Her]> In reply to @huantian "Really? Why": Hold on a sec
00:32:22FromDiscord<Hourglass [She/Her]> https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.19.3/protocol.json @huantian
00:33:20*azimut quit (Remote host closed the connection)
00:33:57*azimut joined #nim
00:34:33FromDiscord<Hourglass [She/Her]> That's the json i need to parse
00:34:42FromDiscord<Hourglass [She/Her]> As you can tell: It's going to be hell for me haha
00:35:48FromDiscord<huantian> Well someone did it in rust so it should be decently possible at least
00:36:25FromDiscord<Hourglass [She/Her]> Definitely possible, but a pain™️
00:36:43FromDiscord<Hourglass [She/Her]> I'd probably have an easier time using Python to do some string manipulation to hack together the code :p
00:37:51FromDiscord<huantian> They probably have a schema somewhere for the json so json parsing shouldn’t be too bad
00:38:02FromDiscord<huantian> Regarding code generation i don’t know enough to know how hard that would be
00:38:38FromDiscord<huantian> (edit) "bad" => "bad↵Or you can use that one Nim package that generates types from json"
00:44:06FromDiscord<Hourglass [She/Her]> In reply to @huantian "They probably have a": What package is that? Also, I don't think they have a schema for it
00:44:16FromDiscord<Hourglass [She/Her]> They do have two of the types documented at least
00:45:15*azimut quit (Remote host closed the connection)
00:45:59*azimut joined #nim
00:50:07FromDiscord<huantian> can't remember the name
00:50:14FromDiscord<huantian> mayber look at this https://github.com/ProtoDef-io/ProtoDef
00:50:22FromDiscord<huantian> https://media.discordapp.net/attachments/371759389889003532/1077391797401165904/image.png
00:50:40FromDiscord<huantian> it describes the format of the protocol.json
00:52:32FromDiscord<huantian> you'd probably want to implement protodef to read and parse the protocol.json
00:54:19FromDiscord<ajusa> Has anyone been able to use any of the libraries in Nim to parse https://github.com/googleapis/googleapis ? I tried it with PMunch's library, status, and https://github.com/oskaritimperi/nimpb but wasn't able to get it to work
01:13:52NimEventerNew thread by DougT: Nico graphics line width, see https://forum.nim-lang.org/t/9920
01:15:06FromDiscord<Hourglass [She/Her]> In reply to @huantian "you'd probably want to": This sounds like hell rip
01:33:49*dropkick quit (Quit: Leaving)
02:26:24FromDiscord<Diogenes of Toronto> im kinda confused why i cant serve my karax site doesnt work my go server is serving the html document fiine and it works when i use karun
02:26:51*randomuser464876 quit (Quit: Client closed)
02:44:38*derpydoo quit (Read error: Connection reset by peer)
02:51:54*ltriant_ joined #nim
02:52:51*ltriant quit (Ping timeout: 255 seconds)
03:33:00*arkurious quit (Quit: Leaving)
03:59:15FromDiscord<Diogenes of Toronto> i go ti t working iit wasnt serving the js
04:21:23FromDiscord<Iliketwertles> sent a code paste, see https://play.nim-lang.org/#ix=4oKu
04:21:26FromDiscord<Iliketwertles> no shell stuff either
04:27:18*derpydoo joined #nim
04:29:08*azimut quit (Ping timeout: 255 seconds)
04:52:30FromDiscord<Iliketwertles> btw that syscall thing is only linux x86/x86_64 rn
05:44:37*ltriant_ quit (Ping timeout: 246 seconds)
06:27:44*tinytoast joined #nim
06:27:58*tinystoat quit (Read error: Connection reset by peer)
06:45:22*advesperacit joined #nim
06:50:43*fallback quit (Ping timeout: 252 seconds)
07:12:08*kenran joined #nim
07:12:33*kenran quit (Remote host closed the connection)
07:16:10*fallback joined #nim
07:19:11FromDiscord<marijani101> Hey there, is there a way to convert binary string to Hexadecimal string, highest digit first, something like `unpack('H', $ze_buffer)` in perl ?
07:23:51FromDiscord<Gumbercules> terrain editor progress https://media.discordapp.net/attachments/371759389889003532/1077490821915484210/fps_camera_demo.gif
07:24:01FromDiscord<Gumbercules> (edit)
07:24:22FromDiscord<Elegantbeef> Is it heightmap based?
07:25:21*tinystoat joined #nim
07:25:30*tinytoast quit (Remote host closed the connection)
07:25:46FromDiscord<Gumbercules> yeah - just updating a texture, however I can feed this texture into my compute shader tessellation technique which will perform LODing and frustum culling
07:26:35FromDiscord<Gumbercules> tessellation complicates picking unfortunately and updating a quadtree when the terrain changes is rather expensive
07:34:13*PMunch joined #nim
07:37:16FromDiscord<Ecorous> In reply to @demotomohiro "<@604653220341743618> It seems you": Ah yeah, I only planned to do one PR for now
07:38:38FromDiscord<Ecorous> Still not dure why it failed
07:40:25FromDiscord<Elegantbeef> I've seen CIs fail for no reason
08:09:00FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oLo
08:16:56FromDiscord<Ecorous> In reply to @Elegantbeef "I've seen CIs fail": It got marked as merge on ci success, so not sure what to do about that
08:25:11FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oLs
08:25:26FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oLt
08:32:11*tinytoast joined #nim
08:32:47*tinystoat quit (Read error: Connection reset by peer)
08:33:42*Notxor joined #nim
08:51:55FromDiscord<System64 ~ Flandre Scarlet> Hi, is there any way to make an interface like this in Nim? https://media.discordapp.net/attachments/371759389889003532/1077512982134784040/image.png
08:53:17FromDiscord<Rika> Yeah sure why not? That looks like imgui
08:53:39PMunchHmm, is there a way to apply a term rewriting macro to imported modules?
08:53:39FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "Yeah sure why not?": yeah it is ImGUI, very nice UI framework
08:54:12PMunch@System64_~_Flandre_Scarlet, a quick google turned up this: https://github.com/nimgl/imgui
08:54:41FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, a quick google": Yeah, I use this, very good↵But building links interactions sounds like pain
08:55:53FromDiscord<Rika> Unironically maybe go ask ChatGPT to do it for you if its that much of a pain
08:56:09FromDiscord<System64 ~ Flandre Scarlet> Good idea, let's try it
08:56:10PMunchOh you mean like drawing the curved lines?
08:56:32FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Oh you mean like": Drawing is fine↵I meant, clicking on the nodes to make links
08:56:40PMunchRight
08:57:31PMunchWhen you write "is there a way to do X in Nim" I think most people assume the issue you're facing is how to get it working in Nim specifically :P
08:57:54PMunchWhy would clicking on nodes to link them be hard?
08:59:08FromDiscord<System64 ~ Flandre Scarlet> Shouldn't I create invisible buttons?
08:59:13FromDiscord<Rika> It’s prolly better to use a drag and drop link system
08:59:28FromDiscord<Rika> Where you have a part of the node that you drag out to make a link to drag into another node
08:59:48FromDiscord<Rika> Not sure what you mean about clicking nodes to link
09:00:01FromDiscord<Rika> What I said is what I know traditionally
09:02:29FromDiscord<System64 ~ Flandre Scarlet> https://gist.github.com/ocornut/7e9b3ec566a333d725d4↵I translated this code to Nim
09:02:40FromDiscord<System64 ~ Flandre Scarlet> sadly it doesn't have link interaction
09:05:08FromDiscord<System64 ~ Flandre Scarlet> https://github.com/redacted-moose/nuklear.nim↵Oh found this, there is a Node editor example, but it isn't updated since... 6 years
09:06:28FromDiscord<Gumbercules> @ElegantBeef - I think if I implement mapping compute buffers back to the CPU, I should be able to read the height values back that the tessellation shader produces and then my raycast for mouse picking would be accurate
09:06:39FromDiscord<System64 ~ Flandre Scarlet> Even worse, it says the package Nuklear... Doesn't exist!
09:07:16FromDiscord<Phil> I swear half the time when I "spend time writing nim code" I'm actually writing docs
09:08:05FromDiscord<Phil> Just realized that one when I looked at how long I've been writing at my latest PR to add docs elsewhere and am currently preparing the second
09:09:51PMunch@Phil, that just means Nim is fast enough to use that you have time writing docs
09:10:15PMunchWriting docs is a good thing
09:10:35FromDiscord<SpiderDave> sent a code paste, see https://play.nim-lang.org/#ix=4oLC
09:10:54FromDiscord<Phil> Nono, I'm writing docs for packages I want to use so that I can actually understand them and their features properly (as well as have reference docs to stare at when I inevitably forget sth) 😛
09:12:41FromDiscord<Phil> Erm... I could tell you that one for using owlkettle (which uses GTK)
09:12:46FromDiscord<Phil> No experience with ui
09:13:54PMunchOoh, nice I was able to use `--import` in order to import a tiny module with my term rewriting macro to rewrite throughout all the imported modules
09:14:24FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oLE
09:14:50FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4oLE" => "https://play.nim-lang.org/#ix=4oLF"
09:15:20FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oLG
09:25:39FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4oLN
09:27:20FromDiscord<Phil> This is the kind of issue after which I jump to refc
09:27:43FromDiscord<Phil> Happens occasionally, I don't understand it, so I just assume that whatever exploded was intended for usage with refc
09:27:56FromDiscord<System64 ~ Flandre Scarlet> https://github.com/redacted-moose/nuklear.nim↵I use that
09:28:09FromDiscord<Phil> Yeah most definitely written during the times of refc
09:28:22FromDiscord<Phil> So may use something that ORC can't deal with properly
09:28:42FromDiscord<System64 ~ Flandre Scarlet> and if I use something like ARC?
09:29:01FromDiscord<Phil> ORC is ARC with additions
09:29:33FromDiscord<Phil> So I'd assume either it will also blow up, or you're likely to have a memory leak somewhere because GUI is notorious for cyclical references
09:29:38FromDiscord<4zv4l> is there `union` in Nim ?
09:29:46FromDiscord<Phil> There is object variants
09:29:50FromDiscord<4zv4l> so I can have a union type that is either a string either a seq[string]
09:30:00FromDiscord<4zv4l> or I can just use seq[string] ?
09:30:16FromDiscord<4zv4l> `seq[string]` of cap 1↵takes as much as a simple `string` ?
09:30:29FromDiscord<Phil> I mean, you could just always use seq[string] and sometimes it just contains a single entry
09:30:32FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "So I'd assume either": Ah alright, so I guess there is nothing to do I guess?
09:30:52FromDiscord<Phil> If you insist on having string and seq[string] then you should look at object variants
09:31:29FromDiscord<Phil> In reply to @System64 "Ah alright, so I": Unless you want to get into the weeds with nuklear and start wrapping your head around why ORC fails there, I don't see any.↵Well unless you start compiling with `--mm:refc`, that should still work
09:32:01FromDiscord<Phil> refc after all didn't go away, it just was moved to no longer be the default
09:33:02FromDiscord<System64 ~ Flandre Scarlet> still explodes
09:33:10FromDiscord<Phil> 🤷
09:33:28FromDiscord<Phil> Sorry, I'm really not familiar with it, my GUI experience is limited to owlkettle for the moment
09:33:47FromDiscord<Phil> Beef or Yard might know more what that error is about
09:34:08FromDiscord<Phil> Actually, Pmunch maybe as well
09:38:37FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oLO
09:39:52FromDiscord<Phil> Not sure what Handle is for a type
09:40:11*randomuser464876 joined #nim
09:40:16FromDiscord<4zv4l> windows type
09:40:27FromDiscord<4zv4l> basically pointer to a struct usually
09:40:35FromDiscord<Phil> And your last line is an expression
09:40:44FromDiscord<Phil> So that line is used as if it were `return GlobalUnlock(files)`
09:41:00FromDiscord<4zv4l> I thought if result was defined in the proc
09:41:07FromDiscord<4zv4l> it would indirectly return it at the end
09:41:38FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oLP
09:41:42FromDiscord<4zv4l> I guess that's because if `result = ...`
09:41:46NimEventerNew thread by rel: Difference {.importcpp.} vs {.importjs.}, see https://forum.nim-lang.org/t/9922
09:41:48PMunch@Phil, I may be what?
09:42:09FromDiscord<4zv4l> but I also thought that would be indirect that result was `@[]` at the beginning
09:42:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oLQ
09:42:55FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oLR
09:43:01FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4oLR" => "https://play.nim-lang.org/#ix=4oLS"
09:44:14FromDiscord<4zv4l> @Phil https://play.nim-lang.org/#ix=4oLT
09:44:19FromDiscord<4zv4l> I am not that wrong
09:44:35FromDiscord<4zv4l> that is how my code is for now↵the same kind
09:45:48PMunch@System64_~_Flandre_Scarlet, are you able to build the examples?
09:46:26PMunchI guess you could try wrapping it with Futhark, those bindings seem a bit outdated
09:46:59FromDiscord<SpiderDave> sent a code paste, see https://play.nim-lang.org/#ix=4oLU
09:47:40FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "I guess you could": ah yeah, futhark might work, I'll give it a try
09:53:03FromDiscord<Phil> In reply to @4zv4l "<@180601887916163073> https://play.nim-lang.org/#ix": If you need to use an extra pragma (in your case discardable) then I'd say you're using tooling for an edgecase 😛↵↵I'd see this as a hint you're about to stumble into an anti-pattern. Prefer explicit return instead of relying on result default instantiation
09:53:13FromDiscord<Phil> (edit) "instead of" => "over"
09:53:44*ltriant joined #nim
09:57:56*ltriant quit (Ping timeout: 246 seconds)
10:03:37FromDiscord<Gumbercules> In reply to @System64 "ah yeah, futhark might": maintaining bindings is a rather pointless and joyless task
10:04:05PMunchNot with Futhark :)
10:05:40FromDiscord<Gumbercules> well - that's kind of the point right, to eliminate that
10:06:00FromDiscord<Gumbercules> and it's still joyless 🙂
10:06:47FromDiscord<System64 ~ Flandre Scarlet> In reply to @Gumbercules "and it's still joyless": I brought Tilengine to Nim with that
10:07:18FromDiscord<Gumbercules> I mean, binding to stuff is cool, just not maintaining a set of bindings for other people
10:07:22FromDiscord<Gumbercules> that gets old extremely quick
10:07:33FromDiscord<Gumbercules> at least in my experience
10:10:04FromDiscord<System64 ~ Flandre Scarlet> I know there is C++ library for node editors, but C++ 🤮
10:10:36FromDiscord<Gumbercules> why not something like? https://github.com/thedmd/imgui-node-editor
10:10:57FromDiscord<Gumbercules> I mean, nuklear is cool and all but is lacking many features of dear imgui
10:11:13FromDiscord<System64 ~ Flandre Scarlet> 🗿 https://media.discordapp.net/attachments/371759389889003532/1077532940306755595/image.png
10:11:18FromDiscord<System64 ~ Flandre Scarlet> C++ oof
10:12:15FromDiscord<Gumbercules> well there are C wrappers
10:12:30FromDiscord<Gumbercules> https://github.com/cimgui/cimgui
10:12:40FromDiscord<System64 ~ Flandre Scarlet> ImGUI is not the problem
10:12:49FromDiscord<System64 ~ Flandre Scarlet> NimGL has bidings for ImGUI
10:13:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @Gumbercules "why not something like?": the problem is this Node Editor uses C++
10:14:03FromDiscord<Gumbercules> oh yeah - I just meant as an example to port
10:15:51FromDiscord<System64 ~ Flandre Scarlet> In reply to @Gumbercules "oh yeah - I": If you want to know my goal, I want to do a modular synthesizer
10:20:39FromDiscord<Gumbercules> well I think either Nuklear or Dear IMGUI would be good options - depends on what features you want
10:20:50FromDiscord<Gumbercules> like if you want docking, Dear IMGUI is probably going to be the winner
10:22:01*Notxor quit (Remote host closed the connection)
10:23:25FromDiscord<Phil> "docking"?
10:23:46*Notxor joined #nim
10:24:53FromDiscord<Gumbercules> well, not that kind of docking
10:25:07FromDiscord<Gumbercules> get your mind out of the gutter Phil
10:25:18FromDiscord<Gumbercules> window docking
10:27:18FromDiscord<Phil> I'm not even in the gutter, I just don't know what that means in the context!
10:27:25FromDiscord<Rika> I don’t even think he knows what kind of docking you thought he knew
10:27:26FromDiscord<Phil> Shame on you for thinking it was!
10:27:32FromDiscord<Phil> 😛
10:28:00FromDiscord<Phil> Oh right, the quotation marks, those were not meant with the innuendo subtext
10:28:09NimEventerNew thread by drkameleon: Help with macro/template-style transformation, see https://forum.nim-lang.org/t/9923
10:28:26FromDiscord<Gumbercules> well, regardless, it's not nearly as provocative as the other kind of docking
10:28:30FromDiscord<Gumbercules> window docking I mean
10:29:10FromDiscord<Phil> Window docking in this context just means it gets aligned like if you use the Windows + Arrow shortcut to align a window to the left/right?
10:30:05FromDiscord<Phil> Or does it mean getting displayed in the dock at the bottom (if you use windows or windows-like GUIs) with an icon?
10:32:42FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "Window docking in this": I think it's that
10:32:53FromDiscord<Phil> Ah, it's the "hold it to the right edge and it expands to take up half the screen"
10:33:13FromDiscord<System64 ~ Flandre Scarlet> In reply to @Gumbercules "well I think either": I think I need a draw list for drawing the nodes and links
10:33:50FromDiscord<Gumbercules> In reply to @System64 "I think I need": Nuklear has an example in the demo folder
10:34:06FromDiscord<System64 ~ Flandre Scarlet> In reply to @Gumbercules "Nuklear has an example": Yeah, but I can't compile it
10:34:07FromDiscord<Phil> Wait, is docking enabled on a per application basis?
10:34:09FromDiscord<Gumbercules> In reply to @Isofruit "Window docking in this": yes this is what it means
10:34:18FromDiscord<Gumbercules> but inside the application
10:34:29FromDiscord<Phil> Ohhhhhhh that way around, thanks, now I got it
10:34:35FromDiscord<Gumbercules> np
10:34:44FromDiscord<Phil> Words and meanings
10:34:49FromDiscord<Gumbercules> In reply to @System64 "Yeah, but I can't": the C demo or the Nim one?
10:34:54FromDiscord<Gumbercules> gotta go feed the baby
10:35:42FromDiscord<System64 ~ Flandre Scarlet> In reply to @Gumbercules "the C demo or": The nim one
10:40:52FromDiscord<Diogenes of Toronto> Hey I am looking to make some open source contributions! Does anyone have a desktop application they are making that needs contributors
10:41:37FromDiscord<Phil> None that are released
11:17:21*tinytoast quit (Remote host closed the connection)
11:17:31*tinystoat joined #nim
11:52:19*azimut joined #nim
12:12:32*ltriant joined #nim
12:17:35*azimut quit (Ping timeout: 255 seconds)
12:18:00*azimut joined #nim
12:32:51PMunchCurious combination, this works properly only on devel but with --gc:refc: https://github.com/PMunch/echooverride
12:33:37*derpydoo quit (Quit: derpydoo)
12:34:50PMunchWith devel and orc it crashes, with stable and either orc or refc it doesn't crash, but the output isn't quite correct
13:03:51*Notxor quit (Remote host closed the connection)
13:09:19FromDiscord<turbo> Is there a way I can set the max thread count for Prologue - there's nothing in the docs
13:19:18FromDiscord<Phil> Huh, questions I never asked myself since I always deployed prologue inside a container with a thread limit
13:32:36FromDiscord<turbo> K, another question: how do I just add a key to the context in a middleware. The docs examples don't demonstrate that (only closures by wrapping the response handler). Ideally I'd want to do: [any request] -> [middleware injects keys] -> [any request can use keys]
13:33:23PMunchLooking at the sources it ppears you should be able to set "numThreads" as a setting to override the default
13:34:09FromDiscord<Phil> In reply to @turbo "K, another question: how": ?↵You extend the context object first, then you set said field in the middleware.
13:34:48FromDiscord<turbo> Extend how - inheriting it?
13:34:54FromDiscord<Phil> Yep
13:37:00FromDiscord<Phil> sent a long message, see http://ix.io/4oNh
13:41:18FromDiscord<turbo> Oh I'm just blind - it's in "extending context", not "middlewares"
13:42:08FromDiscord<Phil> 😄 ↵Happy to have helped
14:15:49FromDiscord<Nerve> which is the real Andread? On this server
14:15:55FromDiscord<Nerve> (edit) "Andread?" => "Andreas?"
14:25:15*Notxor joined #nim
14:39:09FromDiscord<gogolxdong> Warning: A package "[email protected]" with checksum "44efec5bfa331bc020282ccb11fa462c578fb545" already exists the the cache
14:42:28FromDiscord<gogolxdong> Is this a new feature, and how to fix?
15:00:46*azimut quit (Remote host closed the connection)
15:01:45*azimut joined #nim
15:03:17FromDiscord<turbo> When `sharedtables` talks about only using non-GC values, does that mean scalars only or is a non-ref object containing scalars also fine?
15:09:12FromDiscord<4zv4l> is there a way to use `fmt` at runtime ?
15:11:54FromDiscord<gogolxdong> https://media.discordapp.net/attachments/371759389889003532/1077608609455816814/image.png
15:12:03FromDiscord<gogolxdong> Cannot open file after nimble install
15:12:11FromDiscord<Dudugz> Just for curiosity:↵ If I install a local library I made using "nimble install" and then run that library into a binary and compile that binary and put it on another computer and run it. Would this work normally? I mean the library was just installed and imported without compiling to dll's or anything.
15:12:14Amun-Ra4zv4l: nope
15:12:36FromDiscord<4zv4l> In reply to @Amun-Ra "<@329196212282458112>: nope": how come ?↵what if I need to format a string with variable at runtime ?
15:12:45Amun-Ra4zv4l: & and fmt are macros
15:12:54Amun-Ra4zv4l: std/strutils etc.
15:13:13FromDiscord<4zv4l> there is not an equivalent to `fmt ""` but for runtime ?
15:13:18Amun-Rano
15:13:20Amun-Rathere is not
15:13:28Amun-Ranot it the batteries, at least
15:13:39Amun-RaI mean not in stdlib
15:14:14FromDiscord<4zv4l> cause the string the messagebox my program will show can be customized in a config file↵since it's known at runtime, I can't use fmt with it :/
15:14:42Amun-Rais that formatting so sophisticated you can't use $#?
15:15:24FromDiscord<4zv4l> well I want that in the string they give in the config file they can for example add↵`"warning: {username} tried to {action}"`
15:16:19PMunch@Dudugz, a compiled binary wouldn't require any installed Nim library. Of course you'd have to build it for the platform you're targeting, but I've built things on my Linux machine and uploaded them to a server to run there multiple times.
15:16:20Amun-Ra"warning: {username} tried".replace("{username}", "yadda")
15:16:38FromDiscord<Dudugz> In reply to @PMunch "<@265937132886032407>, a compiled binary": Sure, thx
15:16:38Amun-Rait's not the same, but it works
15:16:39PMunchAnd the server has never seen Nim, Nimble, or choosenim
15:16:44*PMunch quit (Quit: Leaving)
15:17:07FromDiscord<4zv4l> In reply to @Amun-Ra ""warning: {username} tried".replace("{username}", "": yeah but they shouldn't have to modify the code
15:17:21FromDiscord<4zv4l> with that they have to modify it
15:17:24Amun-Ra4zv4l: there's no code modification there
15:17:40Amun-Rawhat you want *is* code modification
15:17:45FromDiscord<4zv4l> `.replace("{username}", "yadda")` ?
15:17:49FromDiscord<Dudugz> But doesn't the fmt macro in theory do the same thing as replace? In this case, it would only be syntactic sugar
15:17:50FromDiscord<4zv4l> would be in the raw string ?
15:18:23FromDiscord<4zv4l> In reply to @Amun-Ra "what you want *is*": I mean, I want them to be able to change the warning without modifying the code and they can add some specific variable name inside the format
15:18:55Amun-Ra4zv4l: you read the format string from the config file; so for example you end up with: let s = "{username} etc." then you replace all the magics, "{username}", "{action}" etc. substring after substring
15:20:17FromDiscord<4zv4l> but the replace is in the code or in the config file ?
15:20:23Amun-Rain the code
15:20:36FromDiscord<4zv4l> but what if they dont put `{username}` in the raw string ?
15:20:39FromDiscord<4zv4l> will replace nothing
15:20:42FromDiscord<4zv4l> but still work
15:20:44FromDiscord<4zv4l> right ?
15:20:48Amun-Raright
15:21:11Amun-Raif there's nothing to replace there's no substring replace
15:21:28FromDiscord<4zv4l> and that works at runtime ?
15:21:29Amun-Raso they have all the freedom
15:21:57Amun-Rayes
15:22:21Amun-Racrude example: let some_format_string = read_file "config.fmt"; echo some_format_string.replace("{user}", user)
15:23:40Amun-Rathe only real work is to parse config file
15:24:33Amun-Rawell, I forgot about std/parsecfg ;>
15:25:13FromDiscord<4zv4l> it works
15:25:15FromDiscord<4zv4l> so great
15:25:17FromDiscord<4zv4l> thank you so much !
15:25:21Amun-Rano worries :)
15:25:28Amun-Raglad I could help
15:27:36FromDiscord<4zv4l> if I return a tuple for the config↵how can I return only some of the elements and keep the defaults one for the one I don't specify value ?
15:28:42FromDiscord<4zv4l> like tuple with default values
15:32:17FromDiscord<4zv4l> because for now if in the json file, all the keys aren't there, it fails
15:32:48FromDiscord<I have 50GB of nothing on my PC> nim 2 when
15:40:08FromDiscord<gogolxdong> Anyone help to solve my issue, I think it's relevant to latest nim/nimble changes
15:40:17FromDiscord<gogolxdong> (edit) "help" => "helps"
15:41:22FromDiscord<4zv4l> is there a better way to do this ?↵https://play.nim-lang.org/#ix=4oOc↵↵I feel that is terrible code xD
15:41:43FromDiscord<gogolxdong> devel nimble install packages under pkgs2
15:42:29FromDiscord<jtv> @4zv4l https://github.com/guibar64/formatstr
15:42:34FromDiscord<gogolxdong> In reply to @I have 50GB of nothing on my PC "nim 2 when": roadmap says early in 2023
15:42:44NimEventerNew post on r/nim by akatsukiCZ: Ignoring SSL errors, see https://reddit.com/r/nim/comments/1186ko3/ignoring_ssl_errors/
15:42:56FromDiscord<4zv4l> https://nim-lang.org/docs/json.html#overview-using-default-values
15:43:01FromDiscord<4zv4l> just found this↵will be much cleaner lol
15:43:39FromDiscord<jtv> That library is a runtime format if you need it
15:45:26*arkurious joined #nim
15:55:43FromDiscord<4zv4l> `box_title = json{"box_title"}.getStr(default.box_title)`↵in the doc it is written↵> By using the {} operator instead of [], it will return nil when the field is not found↵but it still crashes when the key is not in my config file
15:57:34FromDiscord<4zv4l> ok perfect, works now
16:14:02*Notxor quit (Quit: Leaving)
16:14:16FromDiscord<gogolxdong> Is there any way to have https://github.com/status-im/nim-graphql compile and run tests
16:23:16FromDiscord<Ecorous> Eyy, my pr got merged
16:23:27FromDiscord<Coachonko> Hey I just want to say my brain is rather smooth today
16:27:00FromDiscord<Rika> damn mine's can't get any smoother
16:30:03FromDiscord<Yepoleb> show pics
16:30:16FromDiscord<Yepoleb> i like smooth brains mmh
16:44:16FromDiscord<turbo> I've got an issue: `sleepAsync`, even with `0` as the parameter, always sleeps at least 400ms. That is `await sleepAsync(1)` takes at least that long, sometimes an entire second. What's up with that?
16:56:18FromDiscord<turbo> sent a code paste, see https://play.nim-lang.org/#ix=4oOI
16:57:57FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4oOJ
16:59:30FromDiscord<Dudugz> Extra info: Foo needs access to the parent to obtain certain information that cannot be passed when created, while Bar needs to have a control list of what its "children" are.
17:01:09FromDiscord<demotomohiro> @turbo You can read Nim generated C code in nimcache directory or C compiler generated assembly with some compiler options.
17:01:28FromDiscord<turbo> In reply to @demotomohiro "<@649274482762055690> You can read": Where's the nimcache?
17:03:02FromDiscord<Rika> In reply to @turbo "I've got an issue:": not sure but maybe its because sleepasync will always yield back to the event loop to run other tasks but its kinda strange how high the overhead is
17:04:03FromDiscord<demotomohiro> @turbo https://nim-lang.org/docs/nimc.html#compiler-usage-generated-c-code-directory
17:08:57FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4oOR
17:09:17FromDiscord<Dudugz> Oh, thx i didn't know
17:10:31FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4oOT
17:18:03FromDiscord<Dudugz> It really worked thanks
17:22:03FromDiscord<Yepoleb> In reply to @turbo "I've got an issue:": on windows or linux?
17:22:13FromDiscord<turbo> macOS
17:22:35FromDiscord<Yepoleb> oh
17:22:47FromDiscord<Yepoleb> sent a code paste, see https://play.nim-lang.org/#ix=4oOY
17:22:52FromDiscord<Yepoleb> i used this to test and it works as intended
17:23:06FromDiscord<Yepoleb> on linux
17:23:29FromDiscord<Yepoleb> getting almost ms precise timings
17:24:09FromDiscord<Rika> Yeah I think it’s strange
17:24:18FromDiscord<Yepoleb> can you test if this example works for you?
17:24:22FromDiscord<Rika> It’s maybe related to the async backend macOS uses
17:29:32FromDiscord<turbo> That does work. Same thing in a prologue handler in my system has the same issue. I'll try to create a small repro at some later point
17:30:17FromDiscord<Rika> Maybe there are tasks being scheduled that you aren’t noticing
17:31:17FromDiscord<Yepoleb> it very likely is some other task blocking
17:33:05FromDiscord<turbo> sent a code paste, see https://paste.rs/FUB
17:37:08FromDiscord<Yepoleb> await can't be used outside an async procedure, so we're missing the relevant context
17:39:06FromDiscord<Yepoleb> the sleepAsync is not the problem, something else is
18:03:39FromDiscord<turbo> sent a code paste, see https://play.nim-lang.org/#ix=4oPa
18:04:24FromDiscord<turbo> The `knnThreadArgsPtr[].shmState.` is irrelevant, the same happens with channels and `tryRecv` in a loop
18:07:26*derpydoo joined #nim
18:20:44FromDiscord<Yepoleb> In reply to @turbo "There are only async": the problem is not in the code that gets slowed down but in some other task that is delaying it and could be anywhere in your application
18:22:59FromDiscord<turbo> Hm, everything else is in separate threads
18:41:58*Notxor joined #nim
19:00:47*jmdaemon quit (Ping timeout: 264 seconds)
19:05:06*oprypin quit (Ping timeout: 252 seconds)
19:07:13*oprypin joined #nim
19:12:12*azimut quit (Write error: Connection reset by peer)
19:13:02*azimut joined #nim
19:41:23*azimut quit (Remote host closed the connection)
19:41:40*azimut joined #nim
19:52:58*jmdaemon joined #nim
19:58:53FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4oPR
19:59:27FromDiscord<Dudugz> Right now I'm just using try~catch but getting warnings about unholy enum
20:04:54Amun-Rabeen there done that; there's no way except casing each value; rn I'm using distinct types for that
20:15:03*dza quit (Ping timeout: 255 seconds)
20:22:23*acidsys joined #nim
20:39:18*dza joined #nim
20:40:59FromDiscord<Elegantbeef> I mean there is a way
20:41:05FromDiscord<Elegantbeef> With macros it's quite easy 😄
20:44:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4oQ4
20:44:25FromDiscord<Elegantbeef> @Dudugz\:
20:48:01FromDiscord<Elegantbeef> One could also turn that into a chained `or` but i'm lazy
21:22:23FromDiscord<planetis> Also https://forum.nim-lang.org/t/8188
21:22:48NimEventerNew Nimble package! geolocation - Retreive geolocation details from an IP, see https://github.com/HazeCS/geolocation
21:53:12*derpydoo quit (Read error: No route to host)
21:57:52NimEventerNew Nimble package! bibleTools - Bible tools!, see https://git.ozzuu.com/thisago/bibleTools
21:57:52NimEventerNew Nimble package! bezier - Bezier curve tools, see https://github.com/Nycto/bezier-nim
22:15:52FromDiscord<pmunch> Hmm, is there a way to "defer" a statement so that it will insert a call to a macro at the end of a module?
22:16:55FromDiscord<pmunch> (and no `defer` doesn't work, it can't be put in the top-level)
22:19:19FromDiscord<demotomohiro> How about try: finally block?
22:21:52FromDiscord<demotomohiro> defer doesnt work at top level but try finally works.
22:28:03*advesperacit quit ()
22:34:36FromDiscord<pmunch> Hmm, that would mean grabbing the entire module body
22:34:53FromDiscord<pmunch> Basically I just want to undo all the macro did at the end of the module
22:37:10*oprypin quit (Ping timeout: 246 seconds)
22:38:09*oprypin joined #nim
22:40:22*rez quit (Quit: much snoozes...)
22:41:08*Guest58 joined #nim
22:41:38*Guest58 quit (Client Quit)
22:42:56NimEventerNew Nimble package! nimx2 - GUI framework, see https://github.com/777shuang/nimx2
22:54:14*Notxor quit (Quit: Leaving)
23:02:21*randomuser464876 quit (Quit: Client closed)
23:12:04FromDiscord<BobBBob> Is nimdocs.com down for everyone else?
23:17:14FromDiscord<Yepoleb> a bit slow but still reachable for me
23:18:49FromDiscord<auxym> In reply to @NimEventer "New Nimble package! nimx2": doesn't seem to explain why they felt a fork was necessary...
23:22:11FromDiscord<Yepoleb> development https://media.discordapp.net/attachments/371759389889003532/1077731991665000448/image.png
23:48:50FromDiscord<jtv> Yeah, generally when the original hasn't been updated in 2-3 years, and you see someone fork and dev, it's probable the original authors weren't responsive
23:52:45NimEventerNew thread by yalexr: What is the recommended way to use the local branch of an external git nim module in my nim project?, see https://forum.nim-lang.org/t/9924