00:00:33 | FromDiscord | <Hourglass [She/Her]> Naming the macro `wipe`, very creative :p |
00:07:20 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oK6 |
00:09:22 | FromDiscord | <auxym> `static[JsonNode]`, probably |
00:09:58 | * | azimut joined #nim |
00:10:38 | FromDiscord | <huantian> You might want to serialize the json into a proper Nim type outside of the macro first |
00:12:50 | FromDiscord | <Hourglass [She/Her]> In reply to @auxym "`static[JsonNode]`, probably": Ah |
00:12:59 | FromDiscord | <Hourglass [She/Her]> In reply to @huantian "You might want to": That'd be... Massive |
00:13:42 | FromDiscord | <Hourglass [She/Her]> JsonNodes can't be constant |
00:13:47 | FromDiscord | <Hourglass [She/Her]> Can't be a constant |
00:13:49 | FromDiscord | <Hourglass [She/Her]> So there's that |
00:15:09 | FromDiscord | <Hourglass [She/Her]> This works however |
00:15:09 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oK7 |
00:18:32 | FromDiscord | <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:05 | FromDiscord | <huantian> In reply to @Hourglass, When the Hour Strikes "That'd be... *Massive*": Really? Why |
00:32:08 | FromDiscord | <Hourglass [She/Her]> In reply to @huantian "Really? Why": Hold on a sec |
00:32:22 | FromDiscord | <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:33 | FromDiscord | <Hourglass [She/Her]> That's the json i need to parse |
00:34:42 | FromDiscord | <Hourglass [She/Her]> As you can tell: It's going to be hell for me haha |
00:35:48 | FromDiscord | <huantian> Well someone did it in rust so it should be decently possible at least |
00:36:25 | FromDiscord | <Hourglass [She/Her]> Definitely possible, but a pain™️ |
00:36:43 | FromDiscord | <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:51 | FromDiscord | <huantian> They probably have a schema somewhere for the json so json parsing shouldn’t be too bad |
00:38:02 | FromDiscord | <huantian> Regarding code generation i don’t know enough to know how hard that would be |
00:38:38 | FromDiscord | <huantian> (edit) "bad" => "bad↵Or you can use that one Nim package that generates types from json" |
00:44:06 | FromDiscord | <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:16 | FromDiscord | <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:07 | FromDiscord | <huantian> can't remember the name |
00:50:14 | FromDiscord | <huantian> mayber look at this https://github.com/ProtoDef-io/ProtoDef |
00:50:22 | FromDiscord | <huantian> https://media.discordapp.net/attachments/371759389889003532/1077391797401165904/image.png |
00:50:40 | FromDiscord | <huantian> it describes the format of the protocol.json |
00:52:32 | FromDiscord | <huantian> you'd probably want to implement protodef to read and parse the protocol.json |
00:54:19 | FromDiscord | <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:52 | NimEventer | New thread by DougT: Nico graphics line width, see https://forum.nim-lang.org/t/9920 |
01:15:06 | FromDiscord | <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:24 | FromDiscord | <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:15 | FromDiscord | <Diogenes of Toronto> i go ti t working iit wasnt serving the js |
04:21:23 | FromDiscord | <Iliketwertles> sent a code paste, see https://play.nim-lang.org/#ix=4oKu |
04:21:26 | FromDiscord | <Iliketwertles> no shell stuff either |
04:27:18 | * | derpydoo joined #nim |
04:29:08 | * | azimut quit (Ping timeout: 255 seconds) |
04:52:30 | FromDiscord | <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:11 | FromDiscord | <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:51 | FromDiscord | <Gumbercules> terrain editor progress https://media.discordapp.net/attachments/371759389889003532/1077490821915484210/fps_camera_demo.gif |
07:24:01 | FromDiscord | <Gumbercules> (edit) |
07:24:22 | FromDiscord | <Elegantbeef> Is it heightmap based? |
07:25:21 | * | tinystoat joined #nim |
07:25:30 | * | tinytoast quit (Remote host closed the connection) |
07:25:46 | FromDiscord | <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:35 | FromDiscord | <Gumbercules> tessellation complicates picking unfortunately and updating a quadtree when the terrain changes is rather expensive |
07:34:13 | * | PMunch joined #nim |
07:37:16 | FromDiscord | <Ecorous> In reply to @demotomohiro "<@604653220341743618> It seems you": Ah yeah, I only planned to do one PR for now |
07:38:38 | FromDiscord | <Ecorous> Still not dure why it failed |
07:40:25 | FromDiscord | <Elegantbeef> I've seen CIs fail for no reason |
08:09:00 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oLo |
08:16:56 | FromDiscord | <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:11 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oLs |
08:25:26 | FromDiscord | <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:55 | FromDiscord | <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:17 | FromDiscord | <Rika> Yeah sure why not? That looks like imgui |
08:53:39 | PMunch | Hmm, is there a way to apply a term rewriting macro to imported modules? |
08:53:39 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "Yeah sure why not?": yeah it is ImGUI, very nice UI framework |
08:54:12 | PMunch | @System64_~_Flandre_Scarlet, a quick google turned up this: https://github.com/nimgl/imgui |
08:54:41 | FromDiscord | <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:53 | FromDiscord | <Rika> Unironically maybe go ask ChatGPT to do it for you if its that much of a pain |
08:56:09 | FromDiscord | <System64 ~ Flandre Scarlet> Good idea, let's try it |
08:56:10 | PMunch | Oh you mean like drawing the curved lines? |
08:56:32 | FromDiscord | <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:40 | PMunch | Right |
08:57:31 | PMunch | When 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:54 | PMunch | Why would clicking on nodes to link them be hard? |
08:59:08 | FromDiscord | <System64 ~ Flandre Scarlet> Shouldn't I create invisible buttons? |
08:59:13 | FromDiscord | <Rika> It’s prolly better to use a drag and drop link system |
08:59:28 | FromDiscord | <Rika> Where you have a part of the node that you drag out to make a link to drag into another node |
08:59:48 | FromDiscord | <Rika> Not sure what you mean about clicking nodes to link |
09:00:01 | FromDiscord | <Rika> What I said is what I know traditionally |
09:02:29 | FromDiscord | <System64 ~ Flandre Scarlet> https://gist.github.com/ocornut/7e9b3ec566a333d725d4↵I translated this code to Nim |
09:02:40 | FromDiscord | <System64 ~ Flandre Scarlet> sadly it doesn't have link interaction |
09:05:08 | FromDiscord | <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:28 | FromDiscord | <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:39 | FromDiscord | <System64 ~ Flandre Scarlet> Even worse, it says the package Nuklear... Doesn't exist! |
09:07:16 | FromDiscord | <Phil> I swear half the time when I "spend time writing nim code" I'm actually writing docs |
09:08:05 | FromDiscord | <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:51 | PMunch | @Phil, that just means Nim is fast enough to use that you have time writing docs |
09:10:15 | PMunch | Writing docs is a good thing |
09:10:35 | FromDiscord | <SpiderDave> sent a code paste, see https://play.nim-lang.org/#ix=4oLC |
09:10:54 | FromDiscord | <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:41 | FromDiscord | <Phil> Erm... I could tell you that one for using owlkettle (which uses GTK) |
09:12:46 | FromDiscord | <Phil> No experience with ui |
09:13:54 | PMunch | Ooh, 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:24 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oLE |
09:14:50 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4oLE" => "https://play.nim-lang.org/#ix=4oLF" |
09:15:20 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oLG |
09:25:39 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4oLN |
09:27:20 | FromDiscord | <Phil> This is the kind of issue after which I jump to refc |
09:27:43 | FromDiscord | <Phil> Happens occasionally, I don't understand it, so I just assume that whatever exploded was intended for usage with refc |
09:27:56 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/redacted-moose/nuklear.nim↵I use that |
09:28:09 | FromDiscord | <Phil> Yeah most definitely written during the times of refc |
09:28:22 | FromDiscord | <Phil> So may use something that ORC can't deal with properly |
09:28:42 | FromDiscord | <System64 ~ Flandre Scarlet> and if I use something like ARC? |
09:29:01 | FromDiscord | <Phil> ORC is ARC with additions |
09:29:33 | FromDiscord | <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:38 | FromDiscord | <4zv4l> is there `union` in Nim ? |
09:29:46 | FromDiscord | <Phil> There is object variants |
09:29:50 | FromDiscord | <4zv4l> so I can have a union type that is either a string either a seq[string] |
09:30:00 | FromDiscord | <4zv4l> or I can just use seq[string] ? |
09:30:16 | FromDiscord | <4zv4l> `seq[string]` of cap 1↵takes as much as a simple `string` ? |
09:30:29 | FromDiscord | <Phil> I mean, you could just always use seq[string] and sometimes it just contains a single entry |
09:30:32 | FromDiscord | <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:52 | FromDiscord | <Phil> If you insist on having string and seq[string] then you should look at object variants |
09:31:29 | FromDiscord | <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:01 | FromDiscord | <Phil> refc after all didn't go away, it just was moved to no longer be the default |
09:33:02 | FromDiscord | <System64 ~ Flandre Scarlet> still explodes |
09:33:10 | FromDiscord | <Phil> 🤷 |
09:33:28 | FromDiscord | <Phil> Sorry, I'm really not familiar with it, my GUI experience is limited to owlkettle for the moment |
09:33:47 | FromDiscord | <Phil> Beef or Yard might know more what that error is about |
09:34:08 | FromDiscord | <Phil> Actually, Pmunch maybe as well |
09:38:37 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oLO |
09:39:52 | FromDiscord | <Phil> Not sure what Handle is for a type |
09:40:11 | * | randomuser464876 joined #nim |
09:40:16 | FromDiscord | <4zv4l> windows type |
09:40:27 | FromDiscord | <4zv4l> basically pointer to a struct usually |
09:40:35 | FromDiscord | <Phil> And your last line is an expression |
09:40:44 | FromDiscord | <Phil> So that line is used as if it were `return GlobalUnlock(files)` |
09:41:00 | FromDiscord | <4zv4l> I thought if result was defined in the proc |
09:41:07 | FromDiscord | <4zv4l> it would indirectly return it at the end |
09:41:38 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oLP |
09:41:42 | FromDiscord | <4zv4l> I guess that's because if `result = ...` |
09:41:46 | NimEventer | New thread by rel: Difference {.importcpp.} vs {.importjs.}, see https://forum.nim-lang.org/t/9922 |
09:41:48 | PMunch | @Phil, I may be what? |
09:42:09 | FromDiscord | <4zv4l> but I also thought that would be indirect that result was `@[]` at the beginning |
09:42:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oLQ |
09:42:55 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oLR |
09:43:01 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4oLR" => "https://play.nim-lang.org/#ix=4oLS" |
09:44:14 | FromDiscord | <4zv4l> @Phil https://play.nim-lang.org/#ix=4oLT |
09:44:19 | FromDiscord | <4zv4l> I am not that wrong |
09:44:35 | FromDiscord | <4zv4l> that is how my code is for now↵the same kind |
09:45:48 | PMunch | @System64_~_Flandre_Scarlet, are you able to build the examples? |
09:46:26 | PMunch | I guess you could try wrapping it with Futhark, those bindings seem a bit outdated |
09:46:59 | FromDiscord | <SpiderDave> sent a code paste, see https://play.nim-lang.org/#ix=4oLU |
09:47:40 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "I guess you could": ah yeah, futhark might work, I'll give it a try |
09:53:03 | FromDiscord | <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:13 | FromDiscord | <Phil> (edit) "instead of" => "over" |
09:53:44 | * | ltriant joined #nim |
09:57:56 | * | ltriant quit (Ping timeout: 246 seconds) |
10:03:37 | FromDiscord | <Gumbercules> In reply to @System64 "ah yeah, futhark might": maintaining bindings is a rather pointless and joyless task |
10:04:05 | PMunch | Not with Futhark :) |
10:05:40 | FromDiscord | <Gumbercules> well - that's kind of the point right, to eliminate that |
10:06:00 | FromDiscord | <Gumbercules> and it's still joyless 🙂 |
10:06:47 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Gumbercules "and it's still joyless": I brought Tilengine to Nim with that |
10:07:18 | FromDiscord | <Gumbercules> I mean, binding to stuff is cool, just not maintaining a set of bindings for other people |
10:07:22 | FromDiscord | <Gumbercules> that gets old extremely quick |
10:07:33 | FromDiscord | <Gumbercules> at least in my experience |
10:10:04 | FromDiscord | <System64 ~ Flandre Scarlet> I know there is C++ library for node editors, but C++ 🤮 |
10:10:36 | FromDiscord | <Gumbercules> why not something like? https://github.com/thedmd/imgui-node-editor |
10:10:57 | FromDiscord | <Gumbercules> I mean, nuklear is cool and all but is lacking many features of dear imgui |
10:11:13 | FromDiscord | <System64 ~ Flandre Scarlet> 🗿 https://media.discordapp.net/attachments/371759389889003532/1077532940306755595/image.png |
10:11:18 | FromDiscord | <System64 ~ Flandre Scarlet> C++ oof |
10:12:15 | FromDiscord | <Gumbercules> well there are C wrappers |
10:12:30 | FromDiscord | <Gumbercules> https://github.com/cimgui/cimgui |
10:12:40 | FromDiscord | <System64 ~ Flandre Scarlet> ImGUI is not the problem |
10:12:49 | FromDiscord | <System64 ~ Flandre Scarlet> NimGL has bidings for ImGUI |
10:13:48 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Gumbercules "why not something like?": the problem is this Node Editor uses C++ |
10:14:03 | FromDiscord | <Gumbercules> oh yeah - I just meant as an example to port |
10:15:51 | FromDiscord | <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:39 | FromDiscord | <Gumbercules> well I think either Nuklear or Dear IMGUI would be good options - depends on what features you want |
10:20:50 | FromDiscord | <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:25 | FromDiscord | <Phil> "docking"? |
10:23:46 | * | Notxor joined #nim |
10:24:53 | FromDiscord | <Gumbercules> well, not that kind of docking |
10:25:07 | FromDiscord | <Gumbercules> get your mind out of the gutter Phil |
10:25:18 | FromDiscord | <Gumbercules> window docking |
10:27:18 | FromDiscord | <Phil> I'm not even in the gutter, I just don't know what that means in the context! |
10:27:25 | FromDiscord | <Rika> I don’t even think he knows what kind of docking you thought he knew |
10:27:26 | FromDiscord | <Phil> Shame on you for thinking it was! |
10:27:32 | FromDiscord | <Phil> 😛 |
10:28:00 | FromDiscord | <Phil> Oh right, the quotation marks, those were not meant with the innuendo subtext |
10:28:09 | NimEventer | New thread by drkameleon: Help with macro/template-style transformation, see https://forum.nim-lang.org/t/9923 |
10:28:26 | FromDiscord | <Gumbercules> well, regardless, it's not nearly as provocative as the other kind of docking |
10:28:30 | FromDiscord | <Gumbercules> window docking I mean |
10:29:10 | FromDiscord | <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:05 | FromDiscord | <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:42 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "Window docking in this": I think it's that |
10:32:53 | FromDiscord | <Phil> Ah, it's the "hold it to the right edge and it expands to take up half the screen" |
10:33:13 | FromDiscord | <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:50 | FromDiscord | <Gumbercules> In reply to @System64 "I think I need": Nuklear has an example in the demo folder |
10:34:06 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Gumbercules "Nuklear has an example": Yeah, but I can't compile it |
10:34:07 | FromDiscord | <Phil> Wait, is docking enabled on a per application basis? |
10:34:09 | FromDiscord | <Gumbercules> In reply to @Isofruit "Window docking in this": yes this is what it means |
10:34:18 | FromDiscord | <Gumbercules> but inside the application |
10:34:29 | FromDiscord | <Phil> Ohhhhhhh that way around, thanks, now I got it |
10:34:35 | FromDiscord | <Gumbercules> np |
10:34:44 | FromDiscord | <Phil> Words and meanings |
10:34:49 | FromDiscord | <Gumbercules> In reply to @System64 "Yeah, but I can't": the C demo or the Nim one? |
10:34:54 | FromDiscord | <Gumbercules> gotta go feed the baby |
10:35:42 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Gumbercules "the C demo or": The nim one |
10:40:52 | FromDiscord | <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:37 | FromDiscord | <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:51 | PMunch | Curious 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:50 | PMunch | With 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:19 | FromDiscord | <turbo> Is there a way I can set the max thread count for Prologue - there's nothing in the docs |
13:19:18 | FromDiscord | <Phil> Huh, questions I never asked myself since I always deployed prologue inside a container with a thread limit |
13:32:36 | FromDiscord | <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:23 | PMunch | Looking at the sources it ppears you should be able to set "numThreads" as a setting to override the default |
13:34:09 | FromDiscord | <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:48 | FromDiscord | <turbo> Extend how - inheriting it? |
13:34:54 | FromDiscord | <Phil> Yep |
13:37:00 | FromDiscord | <Phil> sent a long message, see http://ix.io/4oNh |
13:41:18 | FromDiscord | <turbo> Oh I'm just blind - it's in "extending context", not "middlewares" |
13:42:08 | FromDiscord | <Phil> 😄 ↵Happy to have helped |
14:15:49 | FromDiscord | <Nerve> which is the real Andread? On this server |
14:15:55 | FromDiscord | <Nerve> (edit) "Andread?" => "Andreas?" |
14:25:15 | * | Notxor joined #nim |
14:39:09 | FromDiscord | <gogolxdong> Warning: A package "[email protected]" with checksum "44efec5bfa331bc020282ccb11fa462c578fb545" already exists the the cache |
14:42:28 | FromDiscord | <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:17 | FromDiscord | <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:12 | FromDiscord | <4zv4l> is there a way to use `fmt` at runtime ? |
15:11:54 | FromDiscord | <gogolxdong> https://media.discordapp.net/attachments/371759389889003532/1077608609455816814/image.png |
15:12:03 | FromDiscord | <gogolxdong> Cannot open file after nimble install |
15:12:11 | FromDiscord | <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:14 | Amun-Ra | 4zv4l: nope |
15:12:36 | FromDiscord | <4zv4l> In reply to @Amun-Ra "<@329196212282458112>: nope": how come ?↵what if I need to format a string with variable at runtime ? |
15:12:45 | Amun-Ra | 4zv4l: & and fmt are macros |
15:12:54 | Amun-Ra | 4zv4l: std/strutils etc. |
15:13:13 | FromDiscord | <4zv4l> there is not an equivalent to `fmt ""` but for runtime ? |
15:13:18 | Amun-Ra | no |
15:13:20 | Amun-Ra | there is not |
15:13:28 | Amun-Ra | not it the batteries, at least |
15:13:39 | Amun-Ra | I mean not in stdlib |
15:14:14 | FromDiscord | <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:42 | Amun-Ra | is that formatting so sophisticated you can't use $#? |
15:15:24 | FromDiscord | <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:19 | PMunch | @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:20 | Amun-Ra | "warning: {username} tried".replace("{username}", "yadda") |
15:16:38 | FromDiscord | <Dudugz> In reply to @PMunch "<@265937132886032407>, a compiled binary": Sure, thx |
15:16:38 | Amun-Ra | it's not the same, but it works |
15:16:39 | PMunch | And the server has never seen Nim, Nimble, or choosenim |
15:16:44 | * | PMunch quit (Quit: Leaving) |
15:17:07 | FromDiscord | <4zv4l> In reply to @Amun-Ra ""warning: {username} tried".replace("{username}", "": yeah but they shouldn't have to modify the code |
15:17:21 | FromDiscord | <4zv4l> with that they have to modify it |
15:17:24 | Amun-Ra | 4zv4l: there's no code modification there |
15:17:40 | Amun-Ra | what you want *is* code modification |
15:17:45 | FromDiscord | <4zv4l> `.replace("{username}", "yadda")` ? |
15:17:49 | FromDiscord | <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:50 | FromDiscord | <4zv4l> would be in the raw string ? |
15:18:23 | FromDiscord | <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:55 | Amun-Ra | 4zv4l: 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:17 | FromDiscord | <4zv4l> but the replace is in the code or in the config file ? |
15:20:23 | Amun-Ra | in the code |
15:20:36 | FromDiscord | <4zv4l> but what if they dont put `{username}` in the raw string ? |
15:20:39 | FromDiscord | <4zv4l> will replace nothing |
15:20:42 | FromDiscord | <4zv4l> but still work |
15:20:44 | FromDiscord | <4zv4l> right ? |
15:20:48 | Amun-Ra | right |
15:21:11 | Amun-Ra | if there's nothing to replace there's no substring replace |
15:21:28 | FromDiscord | <4zv4l> and that works at runtime ? |
15:21:29 | Amun-Ra | so they have all the freedom |
15:21:57 | Amun-Ra | yes |
15:22:21 | Amun-Ra | crude example: let some_format_string = read_file "config.fmt"; echo some_format_string.replace("{user}", user) |
15:23:40 | Amun-Ra | the only real work is to parse config file |
15:24:33 | Amun-Ra | well, I forgot about std/parsecfg ;> |
15:25:13 | FromDiscord | <4zv4l> it works |
15:25:15 | FromDiscord | <4zv4l> so great |
15:25:17 | FromDiscord | <4zv4l> thank you so much ! |
15:25:21 | Amun-Ra | no worries :) |
15:25:28 | Amun-Ra | glad I could help |
15:27:36 | FromDiscord | <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:42 | FromDiscord | <4zv4l> like tuple with default values |
15:32:17 | FromDiscord | <4zv4l> because for now if in the json file, all the keys aren't there, it fails |
15:32:48 | FromDiscord | <I have 50GB of nothing on my PC> nim 2 when |
15:40:08 | FromDiscord | <gogolxdong> Anyone help to solve my issue, I think it's relevant to latest nim/nimble changes |
15:40:17 | FromDiscord | <gogolxdong> (edit) "help" => "helps" |
15:41:22 | FromDiscord | <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:43 | FromDiscord | <gogolxdong> devel nimble install packages under pkgs2 |
15:42:29 | FromDiscord | <jtv> @4zv4l https://github.com/guibar64/formatstr |
15:42:34 | FromDiscord | <gogolxdong> In reply to @I have 50GB of nothing on my PC "nim 2 when": roadmap says early in 2023 |
15:42:44 | NimEventer | New post on r/nim by akatsukiCZ: Ignoring SSL errors, see https://reddit.com/r/nim/comments/1186ko3/ignoring_ssl_errors/ |
15:42:56 | FromDiscord | <4zv4l> https://nim-lang.org/docs/json.html#overview-using-default-values |
15:43:01 | FromDiscord | <4zv4l> just found this↵will be much cleaner lol |
15:43:39 | FromDiscord | <jtv> That library is a runtime format if you need it |
15:45:26 | * | arkurious joined #nim |
15:55:43 | FromDiscord | <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:34 | FromDiscord | <4zv4l> ok perfect, works now |
16:14:02 | * | Notxor quit (Quit: Leaving) |
16:14:16 | FromDiscord | <gogolxdong> Is there any way to have https://github.com/status-im/nim-graphql compile and run tests |
16:23:16 | FromDiscord | <Ecorous> Eyy, my pr got merged |
16:23:27 | FromDiscord | <Coachonko> Hey I just want to say my brain is rather smooth today |
16:27:00 | FromDiscord | <Rika> damn mine's can't get any smoother |
16:30:03 | FromDiscord | <Yepoleb> show pics |
16:30:16 | FromDiscord | <Yepoleb> i like smooth brains mmh |
16:44:16 | FromDiscord | <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:18 | FromDiscord | <turbo> sent a code paste, see https://play.nim-lang.org/#ix=4oOI |
16:57:57 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4oOJ |
16:59:30 | FromDiscord | <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:09 | FromDiscord | <demotomohiro> @turbo You can read Nim generated C code in nimcache directory or C compiler generated assembly with some compiler options. |
17:01:28 | FromDiscord | <turbo> In reply to @demotomohiro "<@649274482762055690> You can read": Where's the nimcache? |
17:03:02 | FromDiscord | <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:03 | FromDiscord | <demotomohiro> @turbo https://nim-lang.org/docs/nimc.html#compiler-usage-generated-c-code-directory |
17:08:57 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4oOR |
17:09:17 | FromDiscord | <Dudugz> Oh, thx i didn't know |
17:10:31 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4oOT |
17:18:03 | FromDiscord | <Dudugz> It really worked thanks |
17:22:03 | FromDiscord | <Yepoleb> In reply to @turbo "I've got an issue:": on windows or linux? |
17:22:13 | FromDiscord | <turbo> macOS |
17:22:35 | FromDiscord | <Yepoleb> oh |
17:22:47 | FromDiscord | <Yepoleb> sent a code paste, see https://play.nim-lang.org/#ix=4oOY |
17:22:52 | FromDiscord | <Yepoleb> i used this to test and it works as intended |
17:23:06 | FromDiscord | <Yepoleb> on linux |
17:23:29 | FromDiscord | <Yepoleb> getting almost ms precise timings |
17:24:09 | FromDiscord | <Rika> Yeah I think it’s strange |
17:24:18 | FromDiscord | <Yepoleb> can you test if this example works for you? |
17:24:22 | FromDiscord | <Rika> It’s maybe related to the async backend macOS uses |
17:29:32 | FromDiscord | <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:17 | FromDiscord | <Rika> Maybe there are tasks being scheduled that you aren’t noticing |
17:31:17 | FromDiscord | <Yepoleb> it very likely is some other task blocking |
17:33:05 | FromDiscord | <turbo> sent a code paste, see https://paste.rs/FUB |
17:37:08 | FromDiscord | <Yepoleb> await can't be used outside an async procedure, so we're missing the relevant context |
17:39:06 | FromDiscord | <Yepoleb> the sleepAsync is not the problem, something else is |
18:03:39 | FromDiscord | <turbo> sent a code paste, see https://play.nim-lang.org/#ix=4oPa |
18:04:24 | FromDiscord | <turbo> The `knnThreadArgsPtr[].shmState.` is irrelevant, the same happens with channels and `tryRecv` in a loop |
18:07:26 | * | derpydoo joined #nim |
18:20:44 | FromDiscord | <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:59 | FromDiscord | <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:53 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4oPR |
19:59:27 | FromDiscord | <Dudugz> Right now I'm just using try~catch but getting warnings about unholy enum |
20:04:54 | Amun-Ra | been 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:59 | FromDiscord | <Elegantbeef> I mean there is a way |
20:41:05 | FromDiscord | <Elegantbeef> With macros it's quite easy 😄 |
20:44:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4oQ4 |
20:44:25 | FromDiscord | <Elegantbeef> @Dudugz\: |
20:48:01 | FromDiscord | <Elegantbeef> One could also turn that into a chained `or` but i'm lazy |
21:22:23 | FromDiscord | <planetis> Also https://forum.nim-lang.org/t/8188 |
21:22:48 | NimEventer | New 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:52 | NimEventer | New Nimble package! bibleTools - Bible tools!, see https://git.ozzuu.com/thisago/bibleTools |
21:57:52 | NimEventer | New Nimble package! bezier - Bezier curve tools, see https://github.com/Nycto/bezier-nim |
22:15:52 | FromDiscord | <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:55 | FromDiscord | <pmunch> (and no `defer` doesn't work, it can't be put in the top-level) |
22:19:19 | FromDiscord | <demotomohiro> How about try: finally block? |
22:21:52 | FromDiscord | <demotomohiro> defer doesnt work at top level but try finally works. |
22:28:03 | * | advesperacit quit () |
22:34:36 | FromDiscord | <pmunch> Hmm, that would mean grabbing the entire module body |
22:34:53 | FromDiscord | <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:56 | NimEventer | New 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:04 | FromDiscord | <BobBBob> Is nimdocs.com down for everyone else? |
23:17:14 | FromDiscord | <Yepoleb> a bit slow but still reachable for me |
23:18:49 | FromDiscord | <auxym> In reply to @NimEventer "New Nimble package! nimx2": doesn't seem to explain why they felt a fork was necessary... |
23:22:11 | FromDiscord | <Yepoleb> development https://media.discordapp.net/attachments/371759389889003532/1077731991665000448/image.png |
23:48:50 | FromDiscord | <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:45 | NimEventer | New 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 |