<< 22-03-2024 >>

00:08:34*fallback joined #nim
00:59:29*fallback quit (Read error: Connection reset by peer)
01:03:23*fallback joined #nim
01:33:02*fallback quit (Read error: Connection reset by peer)
01:36:33*fallback joined #nim
02:21:57*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
02:22:25*SchweinDeBurg joined #nim
02:26:36*Guest49 joined #nim
02:26:59*Guest49 quit (Client Quit)
02:27:24*lucasta joined #nim
03:01:40*lucasta quit (Quit: Leaving)
03:25:10FromDiscord<mikedaddy03> Hi
03:27:56FromDiscord<Hamid_Bluri> hi @mikedaddy03
03:31:07FromDiscord<Ethin> Looking at `std/xmltree` and `std/xmlparser` it doesn't look like it supports parsing from in-memory documents....
03:31:27FromDiscord<Ethin> Or did I miss a proc somewhere?
03:31:30FromDiscord<Elegantbeef> Well `xmlParser` does support `Stream`
03:32:40FromDiscord<Ethin> Oh yeah there's a parseXml function... Lmao I missed taht one
03:32:47FromDiscord<Ethin> Oh yeah there's a parseXml function... Lmao I missed that one
03:47:32FromDiscord<Ethin> Does Zippy support decompression of in-memory files? Doesn't appear to be the case but the API docs aren't up to date either so
04:34:42NimEventerNew Nimble package! css3selectors - A Nim CSS Selectors library for the WHATWG standard compliant Chame HTML parser. Query HTML using CSS selectors with Nim just like you can with JavaScript., see https://github.com/Niminem/CSS3Selectors
05:01:55FromDiscord<intellij_gamer> Ooo neat, uses chame
05:21:56*pusewicz|away is now known as pusewicz
06:11:55*redj quit (Quit: No Ping reply in 180 seconds.)
06:13:18*redj joined #nim
06:33:31*advesperacit joined #nim
06:47:23FromDiscord<triumph76> Greetings! How do I get the "verified" role?
07:05:12NimEventerNew thread by gremlin-art: Nim2_ide: Notepad++ plug-in (IDE for Nim lang), see https://forum.nim-lang.org/t/11277
07:25:39*pusewicz is now known as pusewicz|away
07:38:57FromDiscord<ichigo7799> I should update nim
07:39:11FromDiscord<ichigo7799> nimble will fail if you run it from a read-only directory
07:39:25FromDiscord<ichigo7799> (edit) "nimble will fail if you run it from a read-only ... directory" added "current working"
07:39:40FromDiscord<ichigo7799> why it writes to $CWD I don't know
07:40:19*rockcavera quit (Remote host closed the connection)
07:41:15FromDiscord<ichigo7799> oh lol I can't install `nimterop` anyway
07:41:19FromDiscord<ichigo7799> doesn't work with msvc
07:41:50FromDiscord<ichigo7799> too bad since the library I want to wrap only works with msvc
07:42:18FromDiscord<ichigo7799> but then I haven't ever done this before anyways, so should probably try with something smaller than CRIWARE first w.
07:51:11FromDiscord<odexine> In reply to @triumph76 "Greetings! How do I": theres no verified role? wdym?
08:04:57FromDiscord<intervinn> hello people, im having some trouble with vscode extension for nim
08:05:12FromDiscord<intervinn> the code completion is working from time to time and its quite annoying
08:05:14FromDiscord<intervinn> i see nothing in output
08:10:57*nazgulsenpai quit (Ping timeout: 255 seconds)
08:12:19*nazgulsenpai joined #nim
08:20:58FromDiscord<Ethin> Okay this is really weird\: I'm getting ` Tip: 2 messages have been suppressed, use --verbose to show them` along with the indicator that there was an error but there aren't any errors on the console even with --verbose\`...
08:21:14FromDiscord<Ethin> Okay this is really weird\: I'm getting ` Tip: 2 messages have been suppressed, use --verbose to show them` along with the indicator that there was an error but there aren't any errors on the console even with `--verbose`...
08:22:30FromDiscord<Ethin> Yeah just tried two `--verbose` flags and no go
08:23:50FromDiscord<Ethin> Any ideas as what's calling this? It doesn't even look like the compiler is being invoked
08:23:58FromDiscord<Ethin> Any ideas as what's causing this? It doesn't even look like the compiler is being invoked
08:24:07FromDiscord<Ethin> The C compiler I mean
08:24:12FromDiscord<Elegantbeef> Call the compiler directly instead of using nimble
08:25:53FromDiscord<Ethin> It just pritns `..........................................................................` to the console
08:26:02FromDiscord<Ethin> It just prints `..........................................................................` to the console
08:26:15FromDiscord<Elegantbeef> Sounds like you hit a compiler bug dead locking
08:26:18FromDiscord<Ethin> Well, along with the default `nim.cfg` stuff
08:26:42FromDiscord<Ethin> Yeah I've never seen it doing that.
08:28:35FromDiscord<Ethin> Yeah I think I broke something... Not exactly positive how but
08:28:53FromDiscord<Elegantbeef> Build a debug compiler and try to compile the code
08:29:38FromDiscord<Ethin> Will do
08:34:44FromDiscord<intervinn> In reply to @intervinn "i see nothing in": ok seems that other extensions were silencing the problem or smth like that
08:34:51FromDiscord<intervinn> its nimsuggest crashing
08:35:06FromDiscord<intervinn> no idea why tho
08:46:37FromDiscord<Ethin> Well, looks like the nim compiler can't bootstrap itself.... I'm going to re-clone to see if that changes things
08:48:52FromDiscord<intervinn> i tried to uninstall choosenim for now to see if stuff will work without it
08:48:58FromDiscord<intervinn> as forums say its quite problematic
08:49:13FromDiscord<intervinn> cleared the nimble cache and installing langserver again
08:49:24FromDiscord<intervinn> yeah its still crashing
08:50:08NimEventerNew Nimble package! expect - Rust-style expect procedures, see https://github.com/penguinite/expect
08:50:08FromDiscord<Ethin> Is it a bad thing that the nim bootstrapping process is using the stdlib from my (installed) version of Nim? Is it supposed to do that?
08:50:55FromDiscord<intervinn> if you are asking me well im a complete newbie in nim
08:51:05FromDiscord<Ethin> I'm just asking anyone
08:51:09FromDiscord<intervinn> ok
08:51:22FromDiscord<Ethin> yeah it's failing to bootstrap itself, does second iteration then dies
08:51:32FromDiscord<Ethin> First iteration works though
08:51:53FromDiscord<Elegantbeef> If you did not build it before it should not use your version iirc
08:51:56FromDiscord<Ethin> As it in builds
08:52:07FromDiscord<Ethin> Yeah I'm a bit concerned about that
08:52:29FromDiscord<Ethin> Pretty sure it's not supposed to use my installed version.... Wouldn't that pollute the build? 🤔
08:53:16FromDiscord<Ethin> Though I do need nim to build koch since my installed version doesn't have it
08:53:59FromDiscord<Ethin> Or would build\_all.bat do that?
08:54:08FromDiscord<Elegantbeef> Well you can do `./build_all.sh` and it does the entire stuff
08:56:05FromDiscord<whisperecean> Can someone help me check one library with me?
08:56:23FromDiscord<whisperecean> https://github.com/ba0f3/ssh2.nim I dont know if it's a bug but I cannot connect using private key
08:58:05FromDiscord<Ethin> I'm on Windows \:-( build\_all assumes sgcc, doesn't even allow me to change the compiler
08:58:15FromDiscord<Ethin> I'm on Windows \:-( build\_all assumes gcc, doesn't even allow me to change the compiler
08:59:12FromDiscord<Ethin> Will just use wsl then \:P
09:01:41FromDiscord<Elegantbeef> Right cause it's the default compiler everywhere but on Mac
09:02:09FromDiscord<Ethin> And Windows.
09:02:16FromDiscord<Elegantbeef> No?
09:02:23FromDiscord<Elegantbeef> Nim uses mingw by default
09:02:31FromDiscord<Ethin> IMO build tools should generally be compiler agnostic. Let the user set the compiler.
09:02:45FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Nim uses mingw by": On Windows it builds via gcc iirc
09:03:11FromDiscord<Elegantbeef> What do you think mingw is?
09:03:16FromDiscord<Ethin> Yep. Or it tries to. But gccc isn't available if someone doesn't have mingw installed and instead wants to go native
09:03:25FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "What do you think": Microsoft's compiler?
09:03:29FromDiscord<Robyn [She/Her]> Wait that's msvc
09:03:37FromDiscord<Robyn [She/Her]> Is mingw gcc?
09:03:52FromDiscord<Ethin> Yep. MSVC is the default on Windows. Or rather it's the go-to for "most" people
09:04:08FromDiscord<Ethin> Yeah mingw is GCC for windows.
09:04:26FromDiscord<Elegantbeef> You can likely set the compiler you want with koch + build tools but I do not know how
09:05:21FromDiscord<Ethin> You can set it with `./koch --cc=vcc` but you can't set it with `build_all.bat` or with the compiler C sources because `build.bat` assumes GCC's availability
10:02:11*pusewicz|away is now known as pusewicz
10:02:41*pusewicz is now known as pusewicz|away
10:03:47*pusewicz|away is now known as pusewicz
10:16:04*xTrayambak joined #nim
10:22:57FromDiscord<vindaar> sent a long message, see https://pasty.ee/isETbeRJOOeE
10:37:39FromDiscord<Robyn [She/Her]> In reply to @vindaar "<@392962235737047041> I've used `futhark`": You can also copy the generated Nim code to use in the project to avoid the need of clang, by the way
10:44:09FromDiscord<vindaar> Ah, sure that's true!
10:45:51*xTrayambak quit (Remote host closed the connection)
11:05:14FromDiscord<whisperecean> In reply to @whisperecean "https://github.com/ba0f3/ssh2.nim I dont know": Anyone? 😄
11:06:39FromDiscord<Robyn [She/Her]> Sorry, no idea personally
11:11:22*pusewicz is now known as pusewicz|away
11:11:41advesperacit@whisperecean it works for me, but you've got to use both pubKey and privKey
11:11:58FromDiscord<whisperecean> Have you tried it right now?
11:12:04FromDiscord<whisperecean> Thanks for trying btw!
11:12:35advesperacityes, I used the example given on the github, but switched password for key
11:13:15FromDiscord<whisperecean> THANKS!
11:13:19FromDiscord<whisperecean> This combination works
11:13:20FromDiscord<whisperecean> I wonder why
11:14:09advesperacitit's a bit odd to require specifying your own pubKey yea
11:14:42FromDiscord<whisperecean> How did you figure it out that it's required?
11:16:01FromDiscord<whisperecean> If I want to execute custom nim code should I just scp the binary and execute it like that?
11:16:05FromDiscord<whisperecean> What would be the best way to do it?
11:17:24advesperacitit seemed reasonable when authentication failed with only the private part, and the public part was specified as a parameter
11:18:30*pusewicz|away is now known as pusewicz
11:20:34FromDiscord<whisperecean> Super odd though https://github.com/TechThupport/ssh2.nim/blob/master/src/ssh2/private/session.nim#L29
11:26:26advesperacitthat fork has changed the logic to generate the public key from private key
11:27:23advesperacitor I assume so, looking at that function in isolation
11:45:29FromDiscord<intervinn> In reply to @intervinn "yeah its still crashing": well
11:45:31FromDiscord<intervinn> it still does
12:35:35FromDiscord<intervinn> could it be the platform specific issue as im having that on linux
12:35:39FromDiscord<intervinn> from macos it works just fine
12:59:23*fallback quit (Read error: Connection reset by peer)
13:02:22*fallback joined #nim
13:26:32*rockcavera joined #nim
13:56:19*fallback quit (Read error: Connection reset by peer)
13:59:33*lucasta joined #nim
14:05:35*fallback joined #nim
14:15:14FromDiscord<whisperecean> @intervinn The langserver is crashing when you open a project that has some problems -> fucked up nimble imports, borked code
14:20:08FromDiscord<intervinn> In reply to @whisperecean "<@347365756301737994> The langserver is": problem is I didn’t even write any code
14:20:33FromDiscord<intervinn> and it already crashes
14:21:08FromDiscord<whisperecean> Even if you do nimble init
14:21:12FromDiscord<whisperecean> and open that folder in vscode?
14:23:02FromDiscord<intervinn> yea
14:26:54FromDiscord<sOkam! 🫐> In reply to @vindaar "<@392962235737047041> I've used `futhark`": I personally add it to the file that compiles the `.c` files I'm interacting with, or to the wrapper, so that the user doesn't need to care about the buildsystem much
14:27:10FromDiscord<sOkam! 🫐> (edit) "wrapper," => "wrapper/bindings of the `.h` files,"
14:27:58FromDiscord<Robyn [She/Her]> Wait does Futhark work with dynamic and static linking, as well as compiling the source?
14:28:08FromDiscord<Robyn [She/Her]> (edit) "Wait does Futhark work with dynamic and static linking, as well as compiling ... the" added "against"
14:33:23FromDiscord<Ethin> sent a code paste, see https://play.nim-lang.org/#pasty=QiDVzaefRbKq
14:36:04FromDiscord<Ethin> But changing it to a higher number doesn't appear to actually work
14:36:55*ntat joined #nim
14:37:37FromDiscord<Robyn [She/Her]> Why do you call a function recursively that many times?
14:37:49FromDiscord<Ethin> I don't. It might be in one of the macros I'm using
14:38:25FromDiscord<Ethin> @zevv1474\: I think this might be in the grammar or peg macros, but I don't know where -- the compiler is vague as to the actual cause
14:39:58FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Wait does Futhark work": you must figure that out. futhark is not a buildsystem↵futhark will generate nim importc code for .h files, in essence↵how you link to that code (static or dynamic) is your choice
14:40:39FromDiscord<Robyn [She/Her]> In reply to @heysokam "you must figure that": I meant if Futhark didn't care, but that answers my question, thanks!
14:41:08FromDiscord<sOkam! 🫐> ah gotcha. yeah it does not care
14:41:38FromDiscord<Robyn [She/Her]> Sweet!
14:41:39FromDiscord<sOkam! 🫐> I also got "stuck" in that mindset of thinking of it like a full bindings generator (including the buildsystem part of it), but its really not that
14:41:54FromDiscord<Robyn [She/Her]> Yeah it's the bare minimum, right?
14:42:17FromDiscord<sOkam! 🫐> yeah it just gives you the necesary importc code, and that's it
14:53:37FromDiscord<Robyn [She/Her]> Sweet!
14:53:41FromDiscord<kiloneie> I am trying to use Testament, but... i don't understand why it's not working, i followed ringabout's tutorial on dev.to: [testament tutorial](https://dev.to/ringabout/how-to-use-testament-in-nim-1l0h) https://media.discordapp.net/attachments/371759389889003532/1220747232496582717/image.png?ex=66101074&is=65fd9b74&hm=2cba469843fad55a3fbe2926348844222f9221e4acb3aecc62d8888521770661&
15:00:09ZevvEthin: you have a snippet I can reproduce with?
15:00:43Zevvnpeg itself can go into a loop when your rules are left recursive, but that's not a nim function call recursion and will typically not crash, just hang
15:01:15FromDiscord<Ethin> All I have that I can think of is that big UCD character rules. I could upload it here but... It's huge as I noted on the issues
15:01:36FromDiscord<Ethin> All I have that I can think of is that big file of UCD character rules. I could upload it here but... It's huge as I noted on the issues
15:02:02Zevvwell, npeg typically just creates one humonguous switch / computed goto from your grammar, but should not involve any recursive calls
15:02:06Zevvso I wonder what's happening here.
15:02:21Zevvis your error run time or compile time?
15:04:23FromDiscord<Ethin> sent a code paste, see https://play.nim-lang.org/#pasty=bIFutUEnevSs
15:05:28Zevvhm funny. afaik there is not much recursion going on at parse time typically.
15:05:38Zevvi can take a peek for you, but then i'd need to be able to repro
15:05:41FromDiscord<Ethin> So I have no idea where the recursion is coming from, and the compiler is being of no help; the stack traces all occur in Nim itself
15:06:04Zevvi have touched many broken parts of the nim language whilst implementing npeg
15:06:16FromDiscord<Ethin> I can try to upload the sources somewhere. It's in a Fossil repository but I could upload it to a Git mirror
15:06:38FromDiscord<Ethin> Then again I've yet to commit so it'd be easy to change to a git VCS
15:06:44Zevvthat's one of the reasons i preferred Nim over C for some time. With C every time I make a fucking mess and I blame the compiler, it was always *me* that was wrong, nto the compiiler. With Nim, not so much.
15:07:11Zevvwell, take your time, I don't have time today anyway so no hurries from my part
15:07:54FromDiscord<Ethin> Honestly trying to do a PEG in C sounds like a nightmare. C is not designed to be extensible
15:08:08Zevvand yes, I guess you're pushing the boundaries of what has been tested with npeg, so it wouldn't be surprised if you ran into a new issue somewhere.
15:08:14FromDiscord<Ethin> Might go a bit better in C++ but... Iww, C++ templates...
15:08:24ZevvI've seen a PEG parser in C++ once. I did not like it.
15:09:09Zevvbut I bet the C++ people do. each to their own right
15:09:46FromDiscord<Ethin> The only library I know of that lets you construct PEG parsers in C++ is pegtl. But I didn't really like it because the actions you could attach to rules used a template type, and it wasn't clear what that type would be at invocation, so I was like, "Well am I getting a string? A class?" The docs weren't very clear about that to me anyway
15:10:26Zevvso why the urge to use PEG for your parser and not just recursive descend like normal people would?
15:10:26FromDiscord<Ethin> Will get a git repo up and going. Or if you don't mind fossil (which is quite a nice VCS...)
15:10:49FromDiscord<Ethin> Because Ada is not recursive-descent friendly
15:10:57Zevvis it peg friendly then?
15:11:49FromDiscord<Ethin> I think so. I know it's Early friendly lol
15:12:00ZevvWell, as long as it's Ethin-friendly
15:13:12FromDiscord<Ethin> Lol
15:14:04FromDiscord<Ethin> I know it works with the Earley algorithm but I'm hoping it's PEG friendly too and I don't need to do much refactoring of the grammar... Trying to stick as closely to the grammar as possible
15:14:18FromDiscord<Ethin> I know it works with the Earley algorithm but I'm hoping it's PEG friendly too and I don't need to do much refactoring of the grammar... Trying to stick as closely to the officialgrammar as possible
15:14:22FromDiscord<Ethin> I know it works with the Earley algorithm but I'm hoping it's PEG friendly too and I don't need to do much refactoring of the grammar... Trying to stick as closely to the official grammar as possible
15:15:46Zevvunicode. bah.
15:16:19Zevvjust eat any sequence as non white space as an identifier
15:16:21Zevvtadaa
15:16:28FromDiscord<Ethin> Yeah Unicode is annoying. The way I did it probably isn't very optimal but I don't know many ways of parsing unicode unless you count regular expressions
15:17:19Zevvi think parser performance will be horrible anyway
15:17:40Zevvthis results in huuuuge choice expressions
15:19:01Zevvanyway need to go now sorry
15:19:06Zevvmight check in later
15:19:34FromDiscord<Ethin> I know someone suggested a while ago in a different matrix room I could lexically analyze it by just testing certain bit patterns which would result in a very small jump table but I forget how and don't have access to the room anymore since it was a PM
15:20:54FromDiscord<Ethin> alrighty
15:23:49Zevvhm if your source is a seq[Rune] you could just have some simple patterns that use nim-unicodedb to do the underlyiing work for you
15:24:12Zevvunicode_decimal <- >1: return utmDecimal in Rune($1).unicodeTypes()
15:24:20Zevvsomething like that - totally untested bacause mobile
15:29:19FromDiscord<Ethin> What does `>1` do in that?
15:33:36FromDiscord<odexine> capture one character
15:39:00FromDiscord<Ethin> Oh!
15:39:05FromDiscord<Ethin> Fancy
15:39:52FromDiscord<Ethin> Didn't know you could do that lol
15:41:13Zevvdocssss
16:12:29FromDiscord<Ethin> So would I return a boolean result in the block?
16:21:51*advesperacit quit (Ping timeout: 260 seconds)
17:13:57*lucasta quit (Remote host closed the connection)
17:14:36*lucasta joined #nim
17:15:45*lucasta quit (Remote host closed the connection)
17:17:17FromDiscord<intervinn> ok i did
17:17:19FromDiscord<intervinn> something
17:17:23FromDiscord<intervinn> and now the nimsuggest doesnt crash
17:17:37FromDiscord<intervinn> i installed back choosenim and lowered the version
17:17:41FromDiscord<intervinn> and reinstalled langserver
17:47:17FromDiscord<griffith1deadly> dont use choosenim
18:01:16FromDiscord<kiloneie> In reply to @kiloneie "I am trying to": Anyone ?
18:04:22*advesperacit joined #nim
18:05:58FromDiscord<ambient3332> Does anyone know what's the legality of shipping the entire Nim compiler bundled inside a closed source commercial application?
18:07:49FromDiscord<ambient3332> Or maybe that's not the best option to compile a custom domain specific language into machine code...
18:08:03advesperacithttps://github.com/nim-lang/Nim/blob/devel/copying.txt
18:46:02*xet7 quit (Quit: Leaving)
18:48:35*xet7 joined #nim
18:51:54FromDiscord<fosster> guys, how do you pass raw pointers in function calls?
18:52:23FromDiscord<fosster> I know that you put `ptr Type` in the definition, but how to call it?
19:04:14FromDiscord<Robyn [She/Her]> In reply to @fosster "I know that you": `addr myTypeInstance` returns `ptr MyType`
19:22:48NimEventerNew thread by Kiloneie: Having trouble with the Testament tool, see https://forum.nim-lang.org/t/11284
19:35:14FromDiscord<Robyn [She/Her]> Hey Beef you might know this: Does Nim still have source code filters? I want to start using tabs in my code
19:35:35FromDiscord<fosster> thank you Robyn \:)
19:35:44FromDiscord<Robyn [She/Her]> No worries!
19:42:44*ntat quit (Quit: Leaving)
19:53:42FromDiscord<Elegantbeef> It should but I'll despise you for using SCFs↵(@Robyn [She/Her])
19:54:10FromDiscord<Robyn [She/Her]> Lmao why-
19:55:14FromDiscord<Elegantbeef> I mean if it's only code that's not public it's fine but as soon as it's public code it forces someone to reconfigure their editor just for a single project
19:55:59FromDiscord<Robyn [She/Her]> It does? Damn :|
19:56:18FromDiscord<Elegantbeef> I mean you do not want spaces and tabs in a single project do you?
19:56:40FromDiscord<Robyn [She/Her]> No, but eh-
19:57:12FromDiscord<kiloneie> i used to copy paste code i stored in onenote, enjoy tabs at literally every space you can see
19:57:42FromDiscord<kiloneie> i don't understand why you would want tabs
19:58:09FromDiscord<Robyn [She/Her]> In reply to @kiloneie "i don't understand why": Configurable width for anyone who uses it, whether you prefer 2 spaces or 4
19:58:21FromDiscord<Robyn [She/Her]> I'm not used to tabs but just wondering if they're actually nicer to use
19:58:26FromDiscord<Elegantbeef> Tabs are very good but we're using Nim so there is no point
19:58:43FromDiscord<Robyn [She/Her]> No point?
19:58:59FromDiscord<kiloneie> well the more customization you allow in the syntax, the crazier code can get shared...
19:59:09FromDiscord<kiloneie> that's why {} support got canned
19:59:12FromDiscord<Elegantbeef> I always equate using spaces to encoding the font used to render a file in the file
19:59:12FromDiscord<Elegantbeef> There is no point in Nim since you know Nim forces spaces
19:59:12FromDiscord<Elegantbeef> Yes SCFs exist but don't use them as they're silly
19:59:13FromDiscord<Elegantbeef> Tabs are not syntax
19:59:31FromDiscord<Elegantbeef> People still do horizontal aligned code with spaces only in Nim
19:59:45FromDiscord<kiloneie> no, but it's a similar area
20:00:24FromDiscord<kiloneie> like imagine someone sharing code at 1x space, and another at like 10
20:00:51FromDiscord<kiloneie> i prefer 3 spaces, but what can i do
20:01:25FromDiscord<Elegantbeef> Right if you like 3 spaces you should enjoy tabs
20:01:36FromDiscord<Elegantbeef> It allows you to see the code how you prefer
20:02:13FromDiscord<bosinski2023> @beef hi, when i see garbled-stuff when compiled with `-d:useMalloc` and withou its stable and ok - should i care - cos' i thought i would be typically the other way around ?
20:02:29FromDiscord<Elegantbeef> What?
20:02:52FromDiscord<myxi> In reply to @chronos.vitaqua "Configurable width for anyone": well, these people could use extensions that do the same thing for space-based indentation ¯\_(ツ)_/¯
20:03:07FromDiscord<Elegantbeef> No they cannot myxi
20:03:21FromDiscord<Elegantbeef> Cause space for indention is apart of the source file
20:03:23FromDiscord<bosinski2023> In reply to @Elegantbeef "What?": when compiled with `-d:useMalloc` smthing/somebody writes into my storage area ..
20:03:39FromDiscord<Elegantbeef> Which means if I'm contributing to a project it requires me to modify the entire file to use 3 space indent
20:03:53FromDiscord<Elegantbeef> `-d:useMalloc` uses C's allocator, otherwise it uses Nim's allocator
20:04:00FromDiscord<Elegantbeef> So I have no idea what you're asking about
20:04:19FromDiscord<myxi> In reply to @Elegantbeef "Cause space for indention": I mean, they would locally appear to be of whatever width, but actually, it's following a very specific indentation that they can set per-project
20:04:19FromDiscord<kiloneie> was there ever a push towards tabs ?
20:05:05FromDiscord<kiloneie> or why does Nim use spaces ?
20:05:35FromDiscord<bosinski2023> In reply to @Elegantbeef "So I have no": thats what i understood, too. i was just surprised to see the problem when using the C-allocator.
20:05:36FromDiscord<Elegantbeef> Nim uses spaces cause when Nim was designed there was not easy customisabillity of tabs hell presently you cannot change how github renders tabs directly
20:05:52FromDiscord<Elegantbeef> bosinski I still have 0 clue what you're talking about
20:05:59FromDiscord<Robyn [She/Her]> Doubt it
20:07:16FromDiscord<fosster> sent a long message, see https://pasty.ee/BzPIQgkimRKK
20:07:50FromDiscord<myxi> In reply to @chronos.vitaqua "Doubt it": they finally added a GUI setting in 2021, before that you either had to provide ?ts=2 in the url or have a .editorconfig file for whatever reason
20:08:59FromDiscord<Elegantbeef> fosster I'd highly suggest using `pkg-config`
20:09:13FromDiscord<fosster> what is it?
20:09:40FromDiscord<Elegantbeef> It's a lovely program that allows people to specify flags required for linking, including and building with libraries
20:10:47FromDiscord<fosster> hm cool I guess, however the error I'm getting is from the pragma like it doesn't exist, when you can actually find it in the manual https://nim-lang.org/docs/manual.html#foreign-function-interface-dynlib-pragma-for-import
20:12:56FromDiscord<Elegantbeef> Types cannot be loaded from a dynlib
20:12:57FromDiscord<Elegantbeef> You cannot use dynlib on types
20:12:58FromDiscord<fosster> so if I get rid of them on types, I should be fine?
20:13:18FromDiscord<Elegantbeef> Yes
20:13:42FromDiscord<fosster> well, now I'm getting↵`fatal error: libssl3.so: No such file or directory 8 | #include "libssl3.so" | ^~~~~~~~~~~~ `
20:13:47FromDiscord<fosster> sent a code paste, see https://play.nim-lang.org/#pasty=xXhBDJJDRnXi
20:13:50FromDiscord<fosster> sent a code paste, see https://play.nim-lang.org/#pasty=qmfOTqSfKMHq
20:14:11FromDiscord<fosster> that's weeeird why is it substituing the header with they lib
20:14:15FromDiscord<fosster> that's weeeird why is it substituing the header with the lib
20:14:37FromDiscord<kiloneie> What are some other debugging modules from Nim users like Contra ?
20:16:53FromDiscord<Elegantbeef> Are you sure you're not doing `header: "libssl3.so"` anywhere?
20:18:06FromDiscord<fosster> I'm doing bindings like this\:↵`proc EVP_PKEY_CTX_newId(id: cint, e: ptr ENGINE): ptr EVP_PKEY_CTX {.importc: "EVP_PKEY_CTX_new_id", header: "openssl/evp.h", dynlib: libName.}`↵↵where `libname` is libssl3.so
20:20:51FromDiscord<Elegantbeef> @guzba8 attempting to use sunny right now why does `fromJson` have a `input` parameter?
20:39:44FromDiscord<guzba8> @ElegantBeef there are 2 types of fromJson, the first is fromJson(type, input) where input is the json string
20:40:06FromDiscord<guzba8> the second type is fromJson(type, value, input) which is the hook that can be implemented
20:40:56FromDiscord<guzba8> in the second type, value does not copy any data, so you need the raw input string to get the actual values if you need them
20:45:05FromDiscord<Elegantbeef> Is there a nice way of adding a field to `toJson` or is the best thing `str.write "\"field\" = \"arg\""`?
20:45:11FromDiscord<Elegantbeef> `str.add`\
20:46:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=BwpAvNrmaFgh
20:46:33FromDiscord<Elegantbeef> Where `Identifier -> JsonNode` has a static field that is always appended
20:50:10FromDiscord<guzba8> sent a long message, see https://pasty.ee/ZQgWbgtWIhdn
20:51:14FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=jPkStqjyvPDd I mean i have a jsonutils single file 😄
20:52:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=lmAbYenfigZL
20:52:56FromDiscord<guzba8> ok so i think you want to add the `type` field on the way out and then validate it on the way in
20:53:08FromDiscord<Elegantbeef> Yea
20:53:57FromDiscord<Elegantbeef> I of course can do `output.add ...` in the toJson and `jsonValue["type"]` I guess
20:54:49FromDiscord<guzba8> as a side-step sunny does support std.JsonNode, but i think it would be preferred to make this less costly
20:55:18FromDiscord<guzba8> in the fromjson case, validating should be pretty easy
20:55:40FromDiscord<guzba8> iterate over value.o and ensure the key you want is present and has the unescapeString value you want
20:55:46FromDiscord<guzba8> about as cheap as one can make that
20:56:00FromDiscord<guzba8> (or do a fromJson of an internal object with just the key you want to validate on it)
20:56:09FromDiscord<guzba8> toJson is the more interesting one
21:00:50FromDiscord<guzba8> i could imagine `toJson` supporting an optional additional paramenter of "extraFields" that is a seq of (string, SomeValue) where SomeValue is on of the json value kinds
21:01:06FromDiscord<guzba8> and only letting that happen for objects
21:01:45FromDiscord<guzba8> then you could either use that in the one place that matters, or set up a `toJson` hook for the type that then always calls through to the extraFields version
21:05:44FromDiscord<Elegantbeef> Hmph this is very error prone to do manually
21:09:18FromDiscord<guzba8> just a quick prototype, see the test at the bottom for usage
21:09:19FromDiscord<guzba8> https://github.com/guzba/sunny/compare/master...beefy
21:10:19FromDiscord<guzba8> then a custom hook could be used to ensure the field is always present without having to include that param everywhere
21:10:56FromDiscord<guzba8> alternatively
21:11:17FromDiscord<guzba8> perhaps a "extraJsonFields" hook that is called that expects to give me what stuff to add to a type
21:11:24FromDiscord<guzba8> returning seq[(string, ...)]
21:12:47FromDiscord<Elegantbeef> Perhaps a `type Identifier {.jsonConstants: {"type": "m.id.user"}.}`
21:13:52FromDiscord<Elegantbeef> I am preferential to the std json due to API, I feel like an intermediate representation is more intuitive and less error prone
21:14:37FromDiscord<Robyn [She/Her]> Does Sunny's hooks have a custom type (not JsonNode)?
21:14:38FromDiscord<Elegantbeef> Operating on a buffer level is of course faster, but it's quite literally making json by hand 😄
21:15:03FromDiscord<guzba8> that is not true if the required functionality is added to the lib, as we are discussing
21:15:05FromDiscord<guzba8> its possible we may not agree, since i would never use std json tbh
21:15:35FromDiscord<Elegantbeef> I mean the hooks that sunny has are quite literally manual string operations
21:16:10FromDiscord<guzba8> that is not true, only in the solution you are trying to force
21:16:19FromDiscord<Elegantbeef> What do you mean it's not true?
21:16:34FromDiscord<guzba8> one moment
21:17:20FromDiscord<Elegantbeef> In hindsight I do not even think it's the IR that makes it less error prone
21:17:28FromDiscord<Elegantbeef> It's just that it's a statically typed operation
21:18:24FromDiscord<Elegantbeef> If instead of `buffer: var string` it was `buffer: var JsonBuffer` and doing `buffer["type"] = "m.user.id"` worked I think it'd be more acceptable
21:18:33FromDiscord<Elegantbeef> Although there'd be no protection from duplications
21:19:28FromDiscord<Elegantbeef> I do know the extra fields solves my problem here
21:19:47*pusewicz quit (Ping timeout: 252 seconds)
21:21:37FromDiscord<guzba8> sent a code paste, see https://play.nim-lang.org/#pasty=FNmGPsQSSMeu
21:21:40FromDiscord<guzba8> no string operations
21:22:19FromDiscord<guzba8> i would never suggest someone do literal string appending in a hook
21:22:41FromDiscord<guzba8> ok as for a static field that is different
21:22:59FromDiscord<guzba8> could avoid error prone copying and just an unnecessary blob
21:23:19FromDiscord<guzba8> a little think on the type is better, similar to the field tags
21:23:34FromDiscord<guzba8> however, it would need to be both a static key and value, which is somewhat limiting
21:24:55FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=jxeHaNMxDySN
21:25:16FromDiscord<Elegantbeef> There is an issue with that robyn that the distinct string would be stateless
21:25:38FromDiscord<Robyn [She/Her]> Meaning?
21:25:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=WChCarbLGJTL
21:25:54FromDiscord<Elegantbeef> The issue is that you do not know what you need to insert before the field
21:25:57FromDiscord<Robyn [She/Her]> Ah okay I think I understand
21:26:29FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=tEuuIcFoDhNi
21:26:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=oDNhWSsUEzpo
21:27:12FromDiscord<guzba8> this specific case of adding a field that is not present on the type is not something that has been considered in this verison of the lib, so my example is one way of solving the issue
21:27:45FromDiscord<guzba8> but just for now, i think its a scenario ive seen before
21:27:57FromDiscord<guzba8> so it would be nice to improve
21:28:40FromDiscord<guzba8> In reply to @Elegantbeef "If instead of `buffer:": intermediate representations like this are something ive tried to avoid since they are very costly, however qol is a real thing too, unusable perf is not a good goal
21:29:38FromDiscord<Elegantbeef> I mean that has 0 overhead
21:29:51FromDiscord<Elegantbeef> It's quite literally `JsonBuffer = distinct string`
21:30:34FromDiscord<guzba8> i misunderstood then
21:30:55FromDiscord<guzba8> i thought you meant replacing `s: var string` with what amounted to `s: var Table[strubg, string]`
21:31:03FromDiscord<guzba8> (edit) "Table[strubg," => "Table[string,"
21:31:37FromDiscord<Elegantbeef> Nah it wouldn't be ideal since like I said you'd have to use things like `buffer.newObject: ...` to do it
21:31:46FromDiscord<guzba8> yeah
21:31:54FromDiscord<guzba8> lets skip me writing that all out lol
21:32:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=LLbRsvLEcnnu
21:33:08FromDiscord<Elegantbeef> Not technically infeasible since you could have a few more distinct types like `JsonObjectBuffer` and friends
21:33:17FromDiscord<guzba8> this does have issues with ignoring the `json: ""` tags and requires anytone implementing the toJson that way to know that
21:33:30FromDiscord<guzba8> (edit) "anytone" => "anyone"
21:33:42FromDiscord<guzba8> ideally one could add fields without having to reimplement the entire tojson logic
21:34:00FromDiscord<guzba8> that is what i somewhat struggled with in jsony
21:34:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=hDdCNEDWueEN
21:35:08FromDiscord<kiloneie> Why am i getting an empty profiling_results.txt file when using the nimprof as a memory profiler with the correct flags: https://nim-lang.org/docs/estp.html I get the results just fine on a normal profiler run...
21:35:13FromDiscord<Elegantbeef> But yea it forces using an ugly template and fun
21:35:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=pYbkcYeURzss
21:35:43FromDiscord<Elegantbeef> So that solves the runtime issue methinks
21:36:02FromDiscord<Elegantbeef> Though it also does not bind constants
21:36:08FromDiscord<Elegantbeef> Nor expressions
21:36:19FromDiscord<guzba8> adding a pragma to the type seems promising to me tbh, in the same way as the `json` pragma, its very clear whats happening, no hunting for hooks
21:36:43FromDiscord<Elegantbeef> Kilo it's cause you're using nimprof
21:37:00FromDiscord<Elegantbeef> Nimprof hardly is considered usable
21:39:13FromDiscord<kiloneie> i guess i did notice it sometimes requiring a much larger sample size, otherwise empty file...
21:39:43FromDiscord<kiloneie> sent a long message, see https://pasty.ee/kaFwtDGJIZfb
21:39:59FromDiscord<kiloneie> right ?
21:40:22FromDiscord<Elegantbeef> That code has a very little runtime and is mostly IO
21:41:16FromDiscord<guzba8> In reply to @Elegantbeef "But yea it forces": https://github.com/guzba/sunny/issues/3
21:41:54FromDiscord<Elegantbeef> It reads like mental illness but nice 😄
21:42:43FromDiscord<guzba8> yes its just for me, and you if you care to follow, better than being forgotten or lost in discord
21:43:38FromDiscord<Robyn [She/Her]> In reply to @kiloneie "and i am guessing": Please use triple backticks :p
21:43:43FromDiscord<kiloneie> Why all the beef oO
21:43:52FromDiscord<kiloneie> In reply to @chronos.vitaqua "Please use triple backticks": Okay, let me test
21:44:00FromDiscord<Elegantbeef> People like using me as an example
21:44:22FromDiscord<kiloneie> sent a code paste, see https://play.nim-lang.org/#pasty=PQySJKFxriFH
21:44:24FromDiscord<kiloneie> ah
21:44:26FromDiscord<kiloneie> okay
21:44:52FromDiscord<kiloneie> Remind me if i use single back ticks again
21:44:57FromDiscord<kiloneie> I don't use them much...
21:45:14FromDiscord<Robyn [She/Her]> > this does have issues with ignoring the json: "" tags...↵Could `std/options` be useful here, perhaps?
21:45:25FromDiscord<Robyn [She/Her]> In reply to @kiloneie "Remind me if i": Alright!
21:45:37FromDiscord<Robyn [She/Her]> Triple backticks also have syntax highlighting which is nice
21:45:53FromDiscord<Elegantbeef> I don't think options relates to the problem at hand
21:46:06FromDiscord<kiloneie> Also what the hell does this mean: `Define the symbol ignoreAllocationSize so that only the number of allocations is counted and the sizes of the memory allocations do not matter.` ?
21:46:21FromDiscord<kiloneie> like, define it how ?
21:46:51FromDiscord<Elegantbeef> `-d:ignoreAllocationSize`?
21:47:07FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "I don't think options": I don't understand the problem then, ignore me
21:47:52FromDiscord<Elegantbeef> So the issue robyn is that I'm toying with the Matrix API and it has something like `{"type": "m.user.id", "user": "nameHere"}`
21:48:08FromDiscord<Elegantbeef> All `Identifier`s have `type` and it's always `m.user.id`
21:48:31FromDiscord<Elegantbeef> I can have it as a field on `Identifier` but that's wasted memory and error prone
21:48:53FromDiscord<Elegantbeef> All `Identifier`s that convert to json need that field and on conversion back it should be validated to be of that value
21:49:14FromDiscord<Elegantbeef> There really is not a great way presently to do it using sunny
21:49:36FromDiscord<Robyn [She/Her]> Yeah, I get that much, but why doesn't the API using distincts solve that?
21:50:27*advesperacit quit ()
21:50:37FromDiscord<Elegantbeef> Cause it's error prone 😄
21:50:47FromDiscord<Elegantbeef> It's also manual
21:51:08FromDiscord<kiloneie> In reply to @Elegantbeef "`-d:ignoreAllocationSize`?": I thought about that for a second, then forgot. Oh well, thanks.
21:51:17FromDiscord<Elegantbeef> Since it's stateless you have no clue when to add `{}` or `,`s
21:51:46FromDiscord<Robyn [She/Her]> Ah fair enough
21:51:52FromDiscord<Elegantbeef> Consider you have `{"a": {"b": 110}, ` and do `buffer["field"] = "hmm"`
21:52:35FromDiscord<Elegantbeef> Is this a new object or a new field?
21:53:59FromDiscord<Robyn [She/Her]> It'd be a new field, no?
21:54:22FromDiscord<Robyn [She/Her]> Why would it be a new object?
21:56:26FromDiscord<guzba8> imo it is a dead end approach tbh
21:57:16FromDiscord<guzba8> entirely manual, doesnt use the `tags`, risky with `toJson` recursion for types
21:59:50FromDiscord<guzba8> sent a code paste, see https://play.nim-lang.org/#pasty=haoTEUNNcqYz
22:01:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=YobobUBmMtkY
22:05:14FromDiscord<guzba8> cool that does the trick, tytyvm
22:07:28FromDiscord<guzba8> sent a code paste, see https://play.nim-lang.org/#pasty=pjKVqkTrRzwh
22:29:55FromDiscord<guzba8> sent a code paste, see https://play.nim-lang.org/#pasty=zArzTiRFNNlV
22:35:37FromDiscord<Elegantbeef> I assume the issue is the `{nkSym}`someone thought they were clever
22:36:18FromDiscord<Elegantbeef> So many bugs are due to people forgetting X exists
22:38:17FromDiscord<guzba8> fair enough, next idea
22:42:21*krux02 joined #nim
23:07:49*emery_ joined #nim
23:08:35*ehmry quit (Read error: Connection reset by peer)
23:20:55*SchweinDeBurg quit (Ping timeout: 260 seconds)
23:40:36FromDiscord<guzba8> In reply to @Elegantbeef "Worth noting you can": i dont think that can be done actually? it appears nim turns the {} into tuples so they all need to be the same type, making {'"a":3, "b":"zoo"} not possible
23:41:18FromDiscord<guzba8> though im doing this as `template json(v = "", extraFields: varargs[untyped]) {.pragma.}` the named parameter so maybe that breaks it?
23:48:15FromDiscord<Elegantbeef> You can probably do just `extraFields: untyped`
23:48:33FromDiscord<Elegantbeef> Though you'll have to manually unpack those
23:51:02FromDiscord<guzba8> i had tried that as well, it appears to have the same issue↵im not sure why it is even getting a type at all, i need to make a small thing and try stuff i guess
23:51:32*krux02_ joined #nim
23:52:01*krux02_ quit (Client Quit)
23:53:44FromDiscord<Elegantbeef> Ah fun dispatch issue
23:54:03*krux02 quit (Ping timeout: 260 seconds)
23:54:23FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=LmAlFfnhRJcW
23:54:44FromDiscord<Elegantbeef> Not specifying the first parameter causes the second parameter to be typed
23:54:56FromDiscord<Elegantbeef> Even though it's explicitly untyped
23:55:13FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=TWnLNkUKjltf though this works
23:57:39FromDiscord<guzba8> in the context of a pragma it appears not to still? https://play.nim-lang.org/#pasty=bumnFvpcyscU
23:59:08FromDiscord<guzba8> gata run by tyty for the help and ideas
23:59:19FromDiscord<Elegantbeef> Ah you'd have to reimplement `getCustomPragmaVal` to not emit the tuple
23:59:34FromDiscord<Elegantbeef> emit the array\
23:59:39FromDiscord<Elegantbeef> You could use a tuple instead it's just uglier
23:59:59FromDiscord<Elegantbeef> `extraFields = (("a", 0) ("b", "ok"))`