<< 27-09-2023 >>

00:06:39FromDiscord<.aingel.> Ohhh I figured it out
00:06:46FromDiscord<.aingel.> This stuff needs more docs really
00:06:55FromDiscord<.aingel.> `let doc = callObject(nlp, "Barack Obama was born in Hawaii. He was elected president in 2008.")`let doc = callObject(nlp, "Barack Obama was born in Hawaii. He was elected president in 2008.")
00:07:18FromDiscord<.aingel.> (edit) "`let doc = callObject(nlp, "Barack Obama was born in Hawaii. He was elected president in 2008.")`let doc = callObject(nlp, "Barack Obama was born in Hawaii. He was elected president in 2008.")" => "sent a code paste, see https://play.nim-lang.org/#ix=4Hwq"
00:07:34FromDiscord<.aingel.> This fixes it
00:07:37FromDiscord<.aingel.> (edit) "https://play.nim-lang.org/#ix=4Hwq" => "https://play.nim-lang.org/#ix=4Hwr"
01:01:47*derpydoo joined #nim
01:09:18FromDiscord<Elegantbeef> To annoy you further termer it should be ready with feeling this time
02:59:26termerAll right
03:04:05*derpydoo quit (Ping timeout: 240 seconds)
03:05:30termerMerged and added the release
03:05:39FromDiscord<Elegantbeef> Thanks
03:09:04NimEventerNew Nimble package! chalk - Software artifact metadata to make it easy to tie deployments to source code and collect metadata., see https://github.com/crashappsec/chalk
03:13:00FromDiscord<Elegantbeef> @jviega congrats on making it open source πŸ˜„
04:27:05*ntat joined #nim
05:17:03FromDiscord<pietroppeter> Wow, looks great, congrats! 🍾
05:29:13*azimut quit (Ping timeout: 252 seconds)
06:11:21*advesperacit joined #nim
06:33:50*xet7 joined #nim
06:39:55*PMunch joined #nim
07:08:24*ntat quit (Quit: leaving)
08:55:22*xet7 quit (Remote host closed the connection)
08:59:44*xet7 joined #nim
09:03:14*xet7 quit (Remote host closed the connection)
09:11:45FromDiscord<jviega> Thanks πŸ™‚
09:35:03PMunchNeat, just wrote a small Firefox plugin which stores all the RSS feeds I come across in a file. Will be interesting to see what I can do with the data
10:43:05NimEventerNew thread by TKD: Automatic Differentiation/Differentiable Programming Library, see https://forum.nim-lang.org/t/10518
10:49:12*azimut joined #nim
10:52:47FromDiscord<asakura44> hello people
11:09:47*xet7 joined #nim
11:11:32FromDiscord<Phil> In reply to @jviega "Thanks πŸ™‚": Cool! But also 404 not found when clicking on the link to getting-started. Md
11:11:39FromDiscord<Phil> In reply to @asakura44 "hello people": Cheers
11:14:28FromDiscord<Phil> And I take it chalk is more a mini application?
11:14:40FromDiscord<jviega> I think it’s actually launching in 30 mins
11:15:24FromDiscord<Phil> Ohhhh I just read early, check
11:18:23FromDiscord<jviega> Well it could be broken or it could be they haven’t flipped the switch I did mention to marketing πŸ™‚
11:34:05PMunchOh Chalk has launched? Cool!
11:34:23FromDiscord<jviega> I think they're about to post to socials in the next few minutes
11:34:32FromDiscord<jviega> Oh about an hour they just told me
11:36:54FromDiscord<jviega> Thanks, @Phil they'd missed it, and it's fixed now, phew πŸ™‚
11:59:47*ntat joined #nim
12:17:03*derpydoo joined #nim
12:29:27*beholders_eye joined #nim
12:47:27*beholders_eye quit (Ping timeout: 240 seconds)
12:51:55FromDiscord<System64 ~ Flandre Scarlet> Is there a way in Nim to let 2 instances of a software to communicate through network without the firewall blocking the packet and without opening a port ?
12:54:54FromDiscord<jviega> Depends on what your firewalls let through. The pattern that is generally considered acceptable is to have the program inside the firewall initiate a connection.
12:55:41FromDiscord<System64 ~ Flandre Scarlet> I think I can do some kind of tunelling too, but might be hard to do
12:55:44FromDiscord<jviega> But if you're a jerk about it, DNS tunneling is a pretty reliable way
12:56:47FromDiscord<System64 ~ Flandre Scarlet> I want the first person to enter the IP of the second person and boom, connection done and it synchronizes
12:57:11FromDiscord<Chronos [She/Her]> In reply to @PMunch "Oh Chalk has launched?": Chalk?
12:58:58FromDiscord<jviega> https://github.com/crashappsec/chalk
13:01:10FromDiscord<Chronos [She/Her]> Oh nice!
13:06:27*jmdaemon quit (Ping timeout: 260 seconds)
13:17:50FromDiscord<Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=4HyO
13:18:53FromDiscord<Hamid_Bluri> there are some library files in `dlls` folder but they're for Windows
13:22:28*jmdaemon joined #nim
13:25:00FromDiscord<Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=4HyU
13:42:50*beholders_eye joined #nim
13:48:25FromDiscord<Phil> In reply to @jviega "Thanks, <@180601887916163073> they'd missed": Happy to help!↡Given the install instructions I take it the main platform you guys support is Linux and Mac?↡Or is the binary itself capable of acting on all operating systems?
13:49:45FromDiscord<jviega> Just Linux and Mac, 64-bit x86 or arm platforms
13:50:50FromDiscord<jviega> We're more likely to get to PE binaries than we are to try to make it work on Windows; there's a lot that is posix in there
13:51:25*ntat quit (Quit: leaving)
14:06:52*PMunch quit (Quit: Leaving)
14:11:05*beholders_eye quit (Ping timeout: 258 seconds)
14:13:09*beholders_eye joined #nim
14:55:23FromDiscord<asakura44> nim has system like csharp ? https://media.discordapp.net/attachments/371759389889003532/1156605008977076225/442.PNG?ex=651593da&is=6514425a&hm=9067a9836d6cc9e4dbfa55225240dd537e640d3b62088fbff679e896ee302bb5&
15:06:38FromDiscord<Chronos [She/Her]> In reply to @asakura44 "nim has system like": That's just the module it's (implicitly) imported from
15:08:54FromDiscord<asakura44> In reply to @chronos.vitaqua "That's just the module": all floats32/float64 and string and bool are from import system
15:09:08FromDiscord<asakura44> (edit) "floats32/float64" => "float32/float64"
15:09:20FromDiscord<asakura44> even ptr and seq
15:10:15FromDiscord<odexine> Yes
15:10:45FromDiscord<odexine> System is just the implicitly imported module that provides a lot of the core functions and things
15:23:39*ntat joined #nim
15:25:38FromDiscord<Chronos [She/Her]> In reply to @asakura44 "even ptr and seq": Yeah
16:08:40*junaid_ joined #nim
16:21:13*Mister_Magister quit (Excess Flood)
16:21:53*junaid_ quit (Remote host closed the connection)
16:24:35*Mister_Magister joined #nim
16:25:53FromDiscord<wick3dr0se> realistic? https://media.discordapp.net/attachments/371759389889003532/1156627786706989108/Screenshot_2023-09-27-12-25-40-00_d0ef7a9810af20f7b394f4f927b723b0.jpg?ex=6515a911&is=65145791&hm=57fd9f9f60e66b2ecb930bdacbd39252718c1b32d490e19c9e4dd0ba0bfb8e19&
16:26:12FromDiscord<wick3dr0se> Nim looks like Rust searches lol
16:29:45FromDiscord<_gumbercules> Nim is Rust
16:30:04FromDiscord<_gumbercules> you've been lied to
16:30:11FromDiscord<_gumbercules> in all seriousness though - no it doesn't sound realistic at all
16:30:21FromDiscord<_gumbercules> and given Google
16:30:53FromDiscord<_gumbercules> (edit) "Google" => "Google's ngram search stuff just got called out for being widly inaccurate, I wouldn't be surprised if a lot of their statistic tracking was in other areas"
16:31:26FromDiscord<_gumbercules> oh wait
16:31:32FromDiscord<_gumbercules> that's like a day of data lol - okay in that case sure
16:31:53FromDiscord<_gumbercules> there's not much point in looking at that small of a sample size though
16:33:21FromDiscord<_gumbercules> https://media.discordapp.net/attachments/371759389889003532/1156629662999523378/Screenshot_2023-09-27_at_11.33.12_AM.png?ex=6515aad0&is=65145950&hm=ced06239b55d9858c49defe0029adc8ef5fda50da061318754a5032b0a459aaf&
16:34:35FromDiscord<_gumbercules> I mean even....
16:34:45FromDiscord<_gumbercules> https://media.discordapp.net/attachments/371759389889003532/1156630014809362513/Screenshot_2023-09-27_at_11.34.21_AM.png?ex=6515ab24&is=651459a4&hm=019c44fedafa21be086fd31f9b44c1c995f4ba618d86f40bfc58619ab39de8ef&
16:36:23FromDiscord<_gumbercules> https://media.discordapp.net/attachments/371759389889003532/1156630425855328306/Screenshot_2023-09-27_at_11.36.10_AM.png?ex=6515ab86&is=65145a06&hm=2fb128e10b6d8e1c8d963f0a5108295dd762947bc5a379d211c8925a52cc2652&
17:01:16FromDiscord<System64 ~ Flandre Scarlet> Can Nim do hot reloading ?
17:01:45FromDiscord<.aingel.> In reply to @sys64 "Can Nim do hot": Yeah kinda
17:02:38FromDiscord<System64 ~ Flandre Scarlet> In reply to @.aingel. "Yeah kinda": Oh nice, how is it possible to do that?
17:03:52FromDiscord<fabric.input_output> does someone know where can I find the documentation about the fancy squiggly braces you use to modify the behaviour of macros, procs and templates (I'm not talking about pragmas), like maybe change the precedence of an operator or smth can't exactly recall what they did.
17:05:15FromDiscord<huantian> uhhhh term rewriting macros?
17:09:17FromDiscord<fabric.input_output> maybe, I'm not sure, I don't think they were in the official docs, maybe like an experimental feature
17:19:03*ntat quit (Quit: leaving)
17:27:10FromDiscord<wick3dr0se> In reply to @_gumbercules "": Why is Nim dying?
17:28:19FromDiscord<_gumbercules> wrong person to ask
17:28:35FromDiscord<_gumbercules> In reply to @sys64 "Oh nice, how is": `dlopen`
17:29:16FromDiscord<wick3dr0se> Maybe we need more advocates and advertising.. Quite sad to see no people of power putting in the effort
17:30:07FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "`dlopen`": What's that ?
17:32:45FromDiscord<Phil> TFW it`s "usage" not "useage"
17:33:12FromDiscord<Phil> English as a language is weird and everyone involved in developing it should feel bad
17:37:21FromDiscord<michaelb.eth> In reply to @isofruit "English as a language": let's all just switch to Klingon
17:40:11FromDiscord<michaelb.eth> In reply to @sys64 "What's that ?": https://en.wikipedia.org/wiki/Dynamic_loading↡↡it's usually how Nim works with `.so` | `.dylib` | `.dll`, and why the non-statically linked libs a Nim program links to don't show up in the output of e.g. `ldd` or `otool`
17:41:04FromDiscord<jviega> I mean, you can also just patch over your functions dynamically too πŸ˜„
17:41:16FromDiscord<michaelb.eth> related discussion from some years back: https://github.com/nim-lang/RFCs/issues/58
17:46:48FromDiscord<.aingel.> In reply to @sys64 "Oh nice, how is": Do you mean for a web framework?
17:47:23FromDiscord<.aingel.> In reply to @michaelb.eth "https://en.wikipedia.org/wiki/Dynamic_loading it's": But yeah it's based on this, there's an example for it in the nimja framework repo too
17:48:23FromDiscord<Phil> Wait a fucking second.↡So double is not covered by nim's cfloat, it has to be cdouble?
17:48:42FromDiscord<Phil> gnaaaaaaaaaaa C you and your damned silly types
17:49:19FromDiscord<jviega> Why is that silly??
17:50:16FromDiscord<Phil> I may not be fully coherent there. I'm mostly annoyed that while nim does have float32 and float64, C has double and float - Which is fine, that they're covered as cdouble and cfloat as opposed to cfloat64 and cfloat32 or something like it just caught me off guard
17:51:05FromDiscord<Phil> Basically a matter of me not understanding well what C-type translates to which nim-type
17:52:07FromDiscord<Phil> Actually, the fact that float and double aren't just float32 and float64 in C already is somewhat silly, so I'll stick with that definitely being my main argument and not just me running into understanding issues with the translation layer >_>
17:52:32FromDiscord<jviega> Well, C types that don't contain a size aren't fixed across all architectures
17:52:50FromDiscord<Phil> They.... they aren't?
17:52:54FromDiscord<jviega> Which has never appealed to me
17:53:00FromDiscord<jviega> Nooooo
17:53:17FromDiscord<Phil> Imagine a meme of someone just running a way and leaving a cloud of dust behind them
17:53:20FromDiscord<Phil> What in the actual
17:53:24FromDiscord<jviega> There are things like `int64_t` `uint8_t` etc
17:53:37FromDiscord<michaelb.eth> and the horrors of `wchar_t`
17:54:04FromDiscord<Phil> I'm barely dipping my toes in by just binding some gtk functions and I feel like going any deeper is where PTSD lies
17:54:10FromDiscord<jviega> Generally, the feeling used to be 'int' should map to your machine's word size
17:54:37FromDiscord<jviega> Though most places it locked it an 32 bits when we moved to 64-bit, I guess to ease the transition
17:54:53FromDiscord<jviega> I just kept on using uint64_t as much as possible
17:55:23FromDiscord<Phil> All this stuff makes java actually sound appealing
17:55:40FromDiscord<Phil> But then I remember OO architecture patterns and the monstrosity we're currently building and I'm no longer certain
17:56:00FromDiscord<Phil> (edit) "But then I remember OO architecture patterns and the monstrosity we're currently building ... and" added "(inspired by common java patterns I'm told)"
17:56:24FromDiscord<jviega> Oh god, I was over Java by 1997
17:56:52FromDiscord<Phil> Got into appdev instead?
17:57:09FromDiscord<Phil> (edit) "instead?" => "instead with whatever low-level lang was available?"
17:58:29FromDiscord<jviega> No, I was always more a low-level person. Java was too verbose with too many crappy libraries. And it was too slow for a compiled language, and the effort to speed it up were cool but clearly adding too much complexity
17:59:04FromDiscord<jviega> I only did one big project in Java and it was a right disaster πŸ™‚
17:59:35FromDiscord<System64 ~ Flandre Scarlet> In reply to @.aingel. "Do you mean for": I meant in general
17:59:43FromDiscord<jviega> But I still liked the JVM. Just these days, it's not worth it. If you're going to compile to an IR at that level, target llvm
18:15:18FromDiscord<.aingel.> In reply to @sys64 "I meant in general": Oh okay gotcha
18:16:15FromDiscord<.aingel.> @System64 ~ Flandre Scarlet https://github.com/enthus1ast/nimja/blob/master/examples/hcr/hcrex.nim
18:16:21FromDiscord<_gumbercules> hot reloading with Nim is easy - I don't know how many times I've told people
18:16:23FromDiscord<.aingel.> This is an example for hot reloading in a web context
18:16:44FromDiscord<_gumbercules> use https://github.com/fungos/cr
18:17:05FromDiscord<.aingel.> https://github.com/enthus1ast/nimja/blob/master/src/nimja/hcrutils.nim
18:17:16FromDiscord<_gumbercules> if you want an example of a plugin system using ^ look at my old project: https://github.com/tail-wag-games/frag
18:17:18FromDiscord<_gumbercules> specifically
18:17:32FromDiscord<.aingel.> In reply to @_gumbercules "use https://github.com/fungos/cr": Interesting! So wrap this with futhark?
18:17:36FromDiscord<_gumbercules> https://github.com/Tail-Wag-Games/frag/blob/master/src/plugin.nim
18:17:42FromDiscord<_gumbercules> Wrap it with whatever you want - I don't use furthark
18:18:05FromDiscord<_gumbercules> I think the `plugin.nim` file includes bindings t oit
18:18:08FromDiscord<_gumbercules> (edit) "t oit" => "to it"
18:18:28FromDiscord<_gumbercules> nevermind
18:18:30FromDiscord<_gumbercules> they're here: https://github.com/Tail-Wag-Games/frag/blob/master/src/api.nim#L417-L426
18:18:56FromDiscord<_gumbercules> I believe I slightly modified `cr.h` to support some extra things I needed but the regular version should work fine too
18:19:00FromDiscord<.aingel.> Seems a lil complicated haha
18:19:18FromDiscord<_gumbercules> well who said it would be easy?
18:19:30FromDiscord<.aingel.> In reply to @_gumbercules "hot reloading with Nim": Uh...
18:19:36FromDiscord<_gumbercules> but the example works - preserves state across reloads, rollsback versions etc
18:19:41FromDiscord<_gumbercules> I mean easy is a relative term
18:19:45FromDiscord<_gumbercules> or subjective even
18:19:55FromDiscord<_gumbercules> what is easy to me might not be easy to you or the next person
18:20:30FromDiscord<_gumbercules> it's easy for me because I've done it multiple times in multiple projects
18:20:52FromDiscord<_gumbercules> but the question gets brought up quite frequently and my answer has been the same - dont' use Nim's HCR stuff because it doesn't and has never worked correctly
18:21:21FromDiscord<_gumbercules> `dlopen` is the solution and if you don't want to roll your own library / code to do it, libraries like cr.h exists
18:21:44FromDiscord<.aingel.> What is Nim's HCR stuff
18:21:50FromDiscord<_gumbercules> mmmm at one point Nim had a bunch of grant money from status
18:21:53FromDiscord<jviega> "hot code reloading"
18:21:53FromDiscord<Phil> In reply to @_gumbercules "but the question gets": Self answered Stack overflow question in order to link to that in the future?
18:22:02FromDiscord<_gumbercules> In reply to @isofruit "Self answered Stack overflow": by all means go for it
18:22:08FromDiscord<.aingel.> I know what HCR is but what is Nim's HCR specifically
18:22:24FromDiscord<.aingel.> That he's saying not to use
18:22:31FromDiscord<_gumbercules> In reply to @.aingel. "I know what HCR": let me find the old github issue
18:22:36FromDiscord<jviega> hot garbage
18:22:38FromDiscord<Phil> I would need to actually understand more than nothing while wrapping a widget for owlkettle, this was more a suggestion given that you mentioned explaning this multiple times
18:22:51FromDiscord<_gumbercules> https://github.com/nim-lang/RFCs/issues/511
18:23:06FromDiscord<_gumbercules> In reply to @isofruit "I would need to": ah okay - yeah I will try to do this at some point today
18:23:22FromDiscord<.aingel.> Is status no longer sponsoring nim?
18:23:36FromDiscord<_gumbercules> that I'm not sure of...
18:24:04FromDiscord<vindaar> In reply to @_gumbercules "but the question gets": the enticing thing about it being a native Nim feature to me was always that (I hoped) it would allow for much faster recompilation & reloading than doing it manually by spawning a full nim compiler etc etc. The latter is just pretty slow (which may or may not matter depending on the use case)
18:24:19FromDiscord<_gumbercules> yeah :/
18:25:28FromDiscord<.aingel.> Is the speed up from doing HCR manually-ish not good enough?
18:25:42FromDiscord<_gumbercules> it would have really been a nice feature to have but when it was implemented Nim still had the old gc / runtime and because of thread local heaps and the Nim runtime not being able to handle it, it fell apart pretty quickly outside of toy examples
18:25:52FromDiscord<.aingel.> Like the way that NimForUE is doing
18:26:02FromDiscord<_gumbercules> I think NimForUE is using Nimscript no?
18:26:32FromDiscord<_gumbercules> the problem comes down to having to recompile the code for the shared library
18:26:59FromDiscord<_gumbercules> which would make using something like this in a repl less than ideal because you'd have to wait for the Nim compiler for every recompile
18:27:07FromDiscord<_gumbercules> if IC was a thing it would probably be less of an issue
18:27:17FromDiscord<_gumbercules> assuming that IC actually improves compile times
18:29:03FromDiscord<_gumbercules> if someone is really eager - porting `cr.h` to Nim would probably be a fun exercise and then there would be a pure Nim solution for hot code reloading via shared libraries
18:29:30FromDiscord<_gumbercules> but until then besides using something like NLVM it's probably the best option for native hcr
18:32:19FromDiscord<vindaar> sent a long message, see http://ix.io/4HAD
18:34:12FromDiscord<.aingel.> Anyone know what the best/easiest way to play audio through the terminal in nim?
18:34:32FromDiscord<.aingel.> I'm seeing there is libao, wondering if there is something already done instead of having to wrap this
18:36:20FromDiscord<frobnicate> SDL maybe?
18:36:40FromDiscord<frobnicate> It has support for audio right?
18:38:39FromDiscord<.aingel.> I think so! I'll check this out, thanks @frobnicate
18:39:31FromDiscord<enthus1ast> its the same kind of silly to name a new server "newserver", then wait 10 years, the new server then must be called "reallynewserver"?↡(@jviega)
18:39:38FromDiscord<frobnicate> It's in the core libs at least
18:41:01FromDiscord<.aingel.> Does seem a lil complicated though
18:41:59FromDiscord<enthus1ast> like what, a bell? or music?↡(@.aingel.)
18:43:06FromDiscord<.aingel.> I guess there is https://github.com/treeform/openAL
18:43:10FromDiscord<.aingel.> In reply to @enthus1ast "like what, a bell?": Ya like a wav
18:43:14FromDiscord<enthus1ast> for music (like a realy player) i have used https://github.com/daniel-j/nim-mpv and liked
18:43:16FromDiscord<enthus1ast> ah
18:43:17FromDiscord<enthus1ast> ok
18:45:09FromDiscord<.aingel.> Interesting thanks!
18:45:18FromDiscord<enthus1ast> in another project i used https://github.com/yglukhov/sound
18:48:11FromDiscord<enthus1ast> https://github.com/enthus1ast/trainingThing \<--- uses sound↡https://github.com/enthus1ast/muk \<--- uses nim-mpv
18:48:42FromDiscord<jviega> cat > /dev/audio doesn't work anymore??
18:49:14FromDiscord<enthus1ast> oss long gone
18:49:41FromDiscord<djazz> In reply to @enthus1ast "for music (like a": ooh thats my old thing xD
18:50:04FromDiscord<djazz> made it just as a test
18:50:11FromDiscord<enthus1ast> but it worked great \:)
18:50:15FromDiscord<djazz> yay
18:50:48FromDiscord<enthus1ast> but just for playing some bells using mpv seems a little heavy
18:51:22FromDiscord<djazz> yea
18:51:36FromDiscord<djazz> sdl2 maybe?
19:07:32*jmdaemon quit (Ping timeout: 260 seconds)
19:16:35*jmdaemon joined #nim
19:19:35FromDiscord<jviega> In a nimble file can I easily test for versions of packages outside of a requires (i.e., without doing my own analysis)? I basically can't imagine it's supported within the nim code, so would like to define flags based on specific lib versions (whether specific API calls are available or not basically)
19:21:12*jmdaemon quit (Ping timeout: 258 seconds)
19:23:40FromDiscord<Elegantbeef> If you just want to check if a specific proc exists it can be done in Nim
19:23:40FromDiscord<Elegantbeef> I don't know anyway of querying installed version of nimble packages
19:24:21FromDiscord<jviega> How do I test for a proc existing? That's good enough
19:26:13FromDiscord<toma400> sent a code paste, see https://play.nim-lang.org/#ix=4HAO
19:31:46FromDiscord<e.e.7> @jtv Are you aware of nimble's lock files?
19:31:53FromDiscord<jviega> Yes
19:32:14FromDiscord<e.e.7> Are you aware of `when compiles(foo)`?
19:32:31FromDiscord<jviega> Oh that's what I was failing to remember, thanks.
19:32:34*ntat joined #nim
19:32:43*cnx quit (Ping timeout: 264 seconds)
19:32:59FromDiscord<e.e.7> No probs.
19:40:42*cnx joined #nim
19:42:05FromDiscord<Chronos [She/Her]> In reply to @toma400 "I'm pretty surprised seeing": forgot to export `hp` πŸ˜›
19:42:39FromDiscord<Chronos [She/Her]> Also I wouldn't know the exact reasoning but I'm pretty sure it's done like that because you're literally exporting the variable to whatever uses it, meaning any changes elsewhere should be reflected elsewhere
19:44:22FromDiscord<toma400> In reply to @chronos.vitaqua "forgot to export `hp`": Haha, true πŸ˜…
19:44:44FromDiscord<Elegantbeef> You can use `when compiles` but if you want to ensure a proc exists in a specific module you should do something else
19:45:12FromDiscord<jviega> Cool what's the idiom, I'll use it πŸ™‚
19:45:15FromDiscord<toma400> In reply to @chronos.vitaqua "Also I wouldn't know": That makes sense, I guess if you don't want that behaviour you just keep it private and pass it through procs with safe pointer ^^ and not gonna lie, in some instances this seems very useful ❀️
19:45:24*arkanoid quit (Quit: WeeChat 3.5)
19:45:37FromDiscord<Chronos [She/Her]> Exactly aha
19:46:08FromDiscord<e.e.7> Try to only use globals when necessary.
19:46:44FromDiscord<toma400> Also I love how Nim just unconsciously teaches me how pointers work, first by requiring me to put `var` in arguments, C bindings in NGFLW, and now here πŸ˜…
19:47:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4HAU
19:47:05FromDiscord<Elegantbeef> That goes right into my snippet wiki πŸ˜„
19:47:10FromDiscord<jviega> Perfect thanks
19:47:14FromDiscord<toma400> In reply to @e.e.7 "Try to only use": Yeah, I by no means will use this frequently, I just got surprised since I never used vars like that before ❀️
19:47:40*ntat quit (Quit: leaving)
19:47:56FromDiscord<Elegantbeef> Actually might be able to shorten that
19:48:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4HAV
19:49:10FromDiscord<jviega> Elegent yes
19:49:53FromDiscord<Elegantbeef> Won't work for generics of course, but alas
19:49:58FromDiscord<Elegantbeef> and `strutils.hasProc` doesn't work either πŸ˜„
19:50:16FromDiscord<Elegantbeef> For quite obvious reasons I think
19:53:30FromDiscord<e.e.7> What's the use case? Isn't the real idiom a reproducible build environment?
19:53:42FromDiscord<jviega> Yeah
19:53:57FromDiscord<Elegantbeef> What?
19:54:04FromDiscord<jviega> The reasons are obvious
19:54:16FromDiscord<jviega> I didn't read ee7's q when I wrote that
19:54:17FromDiscord<jviega> heh
19:54:23FromDiscord<Elegantbeef> You can use it to check if procedures exist in a specific module and behave differently
19:54:30FromDiscord<Elegantbeef> Modules really are not used properly in Nim
19:55:27FromDiscord<e.e.7> Yes, but my understanding is that this is for a binary, not a Nim library.
19:56:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4HAY
19:56:24FromDiscord<Elegantbeef> I think jviega is smart enough to know what they want πŸ˜„
19:56:30FromDiscord<jviega> No, it's because I sometimes produce libraries where the expectation is they're able to at least not have dependency problems across minor versions. Esp since nimble doesn't seem to be able to handle dep triangles
19:56:39FromDiscord<jviega> Lol thanks
19:58:56FromDiscord<Elegantbeef> Hey it's sorta an appeal to authority so don't say thanks too much πŸ˜›
19:59:03FromDiscord<jviega> Haha
20:00:09FromDiscord<Elegantbeef> So when do you guys publicise the CLAs
20:00:19FromDiscord<Elegantbeef> You link to them, but they're on private repos still! πŸ˜„
20:00:49FromDiscord<jviega> Yeah, this guy Rich who did the CLA has got a personal emergency
20:01:09FromDiscord<sOkam! 🫐> In reply to @toma400 "I'm pretty surprised seeing": I use this extensively with my `cfg.nim` and `state.nim` patterns↡https://github.com/heysokam/confy/blob/master/src/confy/cfg.nim↡I always store configuration variables in a single file, and global state vars in another
20:01:14FromDiscord<Elegantbeef> Ah shit my pestering is less fun
20:01:18FromDiscord<Elegantbeef> Don't ruin fun like that, thanks
20:01:35*jmdaemon joined #nim
20:01:44FromDiscord<jviega> It's basically standard assign copyright a la FSF, since it's GPL'd code
20:02:53FromDiscord<Elegantbeef> I am sorta curious who the target users are for chalk, seems like government contractors mostly to me
20:02:58FromDiscord<jviega> Yeah, it's fine, Rich would laugh when the stress is off him
20:03:12FromDiscord<Elegantbeef> It being gpl'd really confuses me to the point
20:03:16FromDiscord<jviega> No, lots of hi tech already playing around w/ it
20:03:32FromDiscord<jviega> Cloudflare for instance
20:03:45FromDiscord<Elegantbeef> I guess it's a program not a library
20:03:47FromDiscord<jviega> And financial services... Blackstone was a big beta tester
20:03:48FromDiscord<jviega> Yes
20:03:54FromDiscord<Elegantbeef> So it does not cause any virality
20:04:04FromDiscord<Elegantbeef> I was uncertain about that, makes sense now
20:04:07FromDiscord<jviega> Well, I'm going to make a small stand-alone library for self-modifying elf files
20:04:33FromDiscord<jviega> You'll notice it'll do stuff like auto-drop a bash autocomplete script on its first run
20:04:43FromDiscord<jviega> And when you reconfigure it, it edits itself
20:04:55FromDiscord<jviega> So that kind of thing should be a small library for sure
20:04:58FromDiscord<Elegantbeef> Ah real metaprogramming πŸ˜„
20:06:07FromDiscord<jviega> But the broader use is just software asset management. Things like quickly go from, "Just got a report of a bug at this URL" to, "here's the commit it's running and the people who wrote it"
20:06:15FromDiscord<e.e.7> Have you considered how the completions get updated when the user installs a new version of chalk with new commands/options?
20:06:21FromDiscord<jviega> Yes
20:06:27FromDiscord<jviega> It's handled
20:06:38FromDiscord<jviega> Basically the script gets marked too
20:06:39FromDiscord<e.e.7> Does it ask the chalk binary itself for the completions?
20:06:48FromDiscord<e.e.7> I've seen it done like that.
20:06:49FromDiscord<jviega> No, it just replaces the script right now
20:07:17FromDiscord<e.e.7> You can make the completion script be pretty meta
20:07:20FromDiscord<jviega> There's a lot of support stuff for doing command-line programs I used for it that will get some attention soon
20:07:27FromDiscord<jviega> And there I plan on doing exactly that
20:07:44FromDiscord<jviega> I already just from config generate your entire command interface, can do help and docs etc
20:08:16FromDiscord<jviega> And that was my first autocompletion script ever; was clear on doing it it would be easy to mostly automate them too
20:08:58FromDiscord<Elegantbeef> I'm also fairly surprised that you use proper cstrings for con4m
20:08:58FromDiscord<Elegantbeef> I'd have used `openArray[char]` to be a little more sane Nim wise πŸ˜„
20:08:59FromDiscord<Elegantbeef> No conversions required and still get range checking for indexing and the like
20:09:11FromDiscord<jviega> Well, it was the first thing I wrote
20:09:18FromDiscord<jviega> And most of it I wrote fairly quickly
20:09:30FromDiscord<jviega> And it's only bout 20% of what I want to do to it
20:09:58FromDiscord<jviega> So I'd say that piece is available but not "released" in the same way, it's good enough to support chalk but it's not ready
20:10:31FromDiscord<Elegantbeef> Well if you're ever concerned about copies that's probably the lowest hanging fruit
20:10:33FromDiscord<jviega> Like the parser was probably a day, and I intentionally took shortcuts to have a prototype quickly, etc
20:11:13FromDiscord<jviega> Yeah, good call. I really didn't injest openarray when drinking through the firehose.
20:11:42FromDiscord<Elegantbeef> As an argument `openArray[char]` is compatible to `char data, intptr_t len`
20:11:42FromDiscord<jviega> And at this point, when it comes to optimization I'll look at the profiler πŸ™‚
20:12:16FromDiscord<Elegantbeef> So it's very very easy to interop with all languages
20:12:21FromDiscord<jviega> I think it'll be more impactful to cache as much of the con4m interpreter state as possible in the chalk mark πŸ™‚
20:13:01FromDiscord<jviega> Yeah, 100%. Now that I finally got around to learning the FFI reasonably well I intend to make con4m a C library and write bindings for all the languages we use
20:13:32FromDiscord<jviega> Like I've said, pretty much nobody else on my team took to Nim unfortunately 😦 Some people have contributed but begrudgingly
20:13:38FromDiscord<Elegantbeef> Oh I found a bug in con4m for windows dynlib usage πŸ˜„
20:13:38FromDiscord<Elegantbeef> You do not mark the procs as `cdecl`
20:13:40FromDiscord<e.e.7> I kind of like the way e.g. `gh` does completions. You run `gh --shell bash|fish|powershell|zsh` to output a completion script, which calls `gh complete`. The idea is that the user only ever has to install the completion script once.
20:13:50FromDiscord<Elegantbeef> As such they use `Nimcall` on windows which is not the default C calling convention
20:14:00FromDiscord<e.e.7> sent a code paste, see https://play.nim-lang.org/#ix=4HB4
20:14:05FromDiscord<jviega> Yeah, I learned that later. I generally write to Posix apis
20:14:17FromDiscord<Elegantbeef> `{.pragma c4m: exportc, dynlib, cdecl.}`
20:14:18FromDiscord<Elegantbeef> If you don't know
20:14:27FromDiscord<Elegantbeef> You then can just do `proc ...(...) {.c4m.}`
20:14:34FromDiscord<Elegantbeef> Feel free to tell me to sod off whenever
20:14:45FromDiscord<e.e.7> Sod off, beef.
20:15:04FromDiscord<jviega> Yeah, I did that early on because another project we've got that's in C is using con4m and needed the ffi, so that was before I was willing to really take the time to learn it
20:15:10FromDiscord<jviega> What's there was just to get it to work
20:15:34FromDiscord<Elegantbeef> Right, probably a bad place to guess your understanding of FFI then
20:15:47FromDiscord<jviega> Frankly it wasn't until recently when I was worried about consistent docs between the cmd and the website, when I needed to wrap some C libraries
20:15:50FromDiscord<jviega> Then I took the time
20:16:23FromDiscord<jviega> And didn't really finish what I was working on for the docs... it all runs but doesn't look good πŸ™‚ But that's next week's project
20:19:52*jmdaemon quit (Ping timeout: 260 seconds)
20:20:35FromDiscord<jviega> But it's still pretty cool. I basically wrote a text formatting library that lets you use html tags w/ html colors for terminal stuff, just with print("<atomiclime>Foo</atomiclime>"), but it's basically curses-style work and some ansi code mouse handling away from being a lynx replacement... I was about half way through the renderer when I ran out of time, but it still is cool, and can set styles per tag, etc.
20:21:43FromDiscord<Elegantbeef> Seemed nifty when I was looking at it
20:21:46FromDiscord<jviega> I think sometimes you want inline stuff and want to just describe specific formatting choices, and sometimes you want to do style-based
20:22:00FromDiscord<jviega> Thanks, I'll let you know when I feel like it's ready for prime time
20:22:14FromDiscord<Elegantbeef> The final thing I will say about dynamic libraries is https://github.com/beef331/nimscripter/blob/dll/src/nimscripter/nimscr.nim might have a few ideas you can use if you want to consume a Nim DLL inside Nim but not share memory or rely on NimRTL
20:22:43FromDiscord<jviega> Cool I will check it out for sure πŸ™‚
20:22:45FromDiscord<Elegantbeef> I can just import that Nim library and use the entire C-api in an idiomatic manner, it's pretty good imo
20:23:23FromDiscord<jviega> That's useful. As I came up against the clock I kept dropping into inlined C far more because it's just faster for me still when it comes to low-level stuff
20:23:57FromDiscord<Elegantbeef> Yea, my rule for DLLs is to never own memory from outside
20:24:28FromDiscord<Elegantbeef> Not the most ideal, but it makes life easier
20:24:28FromDiscord<Elegantbeef> You can free any memory you own and use RAII to free memory you do not
20:24:32FromDiscord<jviega> Like when I wanted to not do my own tui-type library (yet), but instead send long docs to your pager; I started out trying to do the pty work from Nim but it's just a bit too indirect, so I would write stuff in C and then wrap THAT
20:24:38FromDiscord<Elegantbeef> There is no question of "Is this something I can free"
20:24:44FromDiscord<jviega> Yeah 100%
20:25:27FromDiscord<Elegantbeef> It of course can easily be used by C, but yea no actual C there
20:25:28FromDiscord<Elegantbeef> Well the stuff I shared is a Nim library consumed by Nim
20:25:40FromDiscord<jviega> Generally I think any time I wrapped something where a C lib was handing me alloc'd memory, I either copied it out into a nim object and deleted it, or I had a nim object w/ a destructor to call free
20:25:51FromDiscord<jviega> Cool
20:26:13FromDiscord<Elegantbeef> Yea destructors really are great for most APIs
20:26:39FromDiscord<Elegantbeef> This reminds me I did not implement the dup hooks
20:27:11FromDiscord<jviega> I definitely would like to get a better feel of the best idioms for such things.
20:27:36FromDiscord<jviega> Cause I feel that it's likely I'm going to wrap a bunch more now
20:27:56FromDiscord<Elegantbeef> I don't know if they're the best idioms, they're just what I stumbled on whilst trying to expose the nimscript API to C
20:28:13FromDiscord<jviega> For instance, s3 support was crucial for my community, and I had to fix the best crappy library, but eventually I'll just wrap the aws library
20:28:37FromDiscord<jviega> Cause for a lot of things the nim-native versions aren't good enough if they exist at all
20:28:41FromDiscord<Elegantbeef> So somehow made this nice API
20:28:55FromDiscord<Elegantbeef> I got very annoyed with how quickly the dynlib turned into just writing C in Nim
20:29:53FromDiscord<jviega> Yeah. It's also frustrating that little effort goes into putting decent NIM APIs around wrapped C. Like when I needed to use OpenSSL for anything, I put a more sane interface on it
20:30:34FromDiscord<jviega> Nimcrypto is truly awful btw πŸ™‚
20:30:45FromDiscord<jviega> I hate openssl but wrapping it is better than nimcrypto
20:31:10FromDiscord<Elegantbeef> Hey I contributed to otp.nim recently, that's the closest I get to crypto πŸ˜›
20:33:13*rockcavera quit (Ping timeout: 240 seconds)
20:34:55*jmdaemon joined #nim
20:34:59FromDiscord<.aingel.> In reply to @enthus1ast "in another project i": These look really good thanks!
20:34:59FromDiscord<jviega> sent a long message, see http://ix.io/4HBe
20:35:31FromDiscord<jviega> That's actually when I first decided to learn the FFI properly, to use openssl to get rid of all the crap nim dependencies
20:37:30FromDiscord<e.e.7> I thought that e.g. Thomas Pornin reviewed some of Status' crypto stuff?
20:37:43FromDiscord<jviega> I wrote GCM.
20:37:46FromDiscord<jviega> It's wrong.
20:37:46FromDiscord<e.e.7> I know.
20:38:13FromDiscord<e.e.7> I just thought that they had stuff audited.
20:39:02FromDiscord<jviega> The NIST spec clearly states that decrypt opertions can't return plaintext w/o checking the tag. They do not even check the tag, you'd have to know to do that yourself. Their implementation is a more expensive version of CTR mode.
20:39:31FromDiscord<jviega> I can tell you it's a crypto library written by people who care about cryptocurrency but don't know much about cryptography πŸ™‚
20:39:31*rockcavera joined #nim
20:39:31*rockcavera quit (Changing host)
20:39:31*rockcavera joined #nim
20:41:09FromDiscord<e.e.7> Strong words :)
20:41:17FromDiscord<e.e.7> Fair enough.
20:41:36FromDiscord<jviega> I think, like Beef said, I've earned the right to at least say them πŸ™‚
20:41:42FromDiscord<e.e.7> Sure.
20:42:27FromDiscord<jviega> But yeah I would never, ever use it. If I'd choose openssl over it, that's saying something
20:43:00FromDiscord<e.e.7> Did you check out their BearSSL stuff?
20:43:09FromDiscord<Elegantbeef> Hey freedom of speech man!
20:43:17FromDiscord<jviega> No, just native stuff
20:43:19FromDiscord<Elegantbeef> Anyway I'm outta here for a dog walk
20:43:23FromDiscord<jviega> Later
20:43:36FromDiscord<e.e.7> Who's walking you?
20:43:39FromDiscord<e.e.7> :)
20:44:30FromDiscord<jviega> But generally, I think too many crypto libraries focus on providing a cool toolbox without giving people any understand about how to use them to build a house with them, so to speak. So the stuff they build won't be good. I think high-level primitives are better
20:45:47FromDiscord<jviega> Guardrails.
20:46:13FromDiscord<e.e.7> Yeah. One way to do things.
20:46:24FromDiscord<e.e.7> Cryptographic agility considered harmful.
20:47:17FromDiscord<jviega> Cryptography is hard enough to get right that cryptographers often make mistakes w/o the right abstractions, never mind the average developer
20:49:11*Mister_Magister quit (Read error: Connection reset by peer)
20:49:52FromDiscord<e.e.7> Sure.
20:50:19FromDiscord<e.e.7> Though my background in cryptography extends only to forgetting everything I learned from cryptopals.
20:50:24FromDiscord<jviega> Lol
20:50:33FromDiscord<e.e.7> And being able to say "Bleichenbacher's Padding Oracle" and nodding sagely.
20:51:08*Mister_Magister joined #nim
20:52:18FromDiscord<jviega> That's far more than the average developer πŸ™‚ And I think that's fine!
20:56:22FromDiscord<e.e.7> Turns out that forgetting things is better than never knowing them :)
20:58:29FromDiscord<e.e.7> Zig has Frank Denis on the core team. Lots of good crypto stuff there, as far as I can tell. Shame that he didn't publish any Nim stuff.
20:59:04FromDiscord<e.e.7> I noticed that he commented on https://scripter.co/notes/nim/ in 2018
20:59:40FromDiscord<jviega> I looked at Zig a bit when I chose Nim. I didn't think it'd bring me enough value personally, if Nim weren't in the picture I would have stayed with C
21:00:12FromDiscord<jviega> Yeah too bad :/
21:01:59FromDiscord<jviega> Not that Nim's perfect; I've had to deal w/ the fact that my co-workers who are all quite talented don't particularly want to use it, having dabbled in it πŸ™‚
21:03:16FromDiscord<e.e.7> What are their reasons?
21:04:19FromDiscord<jviega> Mainly ecosystem. The docs are reference only and don't cover gotchas, lots of "common" things in other ecosystems don't have good libraries to go use, the VSCode plugins crash all the time, and nimble is a tire fire
21:04:29FromDiscord<jviega> Everyone liked it in concept
21:05:23FromDiscord<e.e.7> Ah yes, the classic "kill nimsuggest".
21:05:46FromDiscord<e.e.7> Re: nimble, have you looked at Atlas?
21:05:49FromDiscord<jviega> Oh yeah, I'm an emacs guy but apparently it just doesn't seem to work at all?
21:06:03FromDiscord<jviega> Eh, it would be a transition at this point.
21:06:24FromDiscord<e.e.7> Emacs here too, but I've definitely had to do it in the past.
21:07:44FromDiscord<jviega> Otherwise I think Nim would be doing a lot better. Should have easier access to more "official" libraries, and those two tools should be fixed πŸ™‚
21:08:09FromDiscord<jviega> Anyway, time for me to go. Got to get ready, got dinner and Wu Tang Clan tonight
21:08:37FromDiscord<e.e.7> Hah, that's one way to drop out.
21:08:44FromDiscord<e.e.7> Have a good one.
21:08:51FromDiscord<jviega> You too
21:17:14FromDiscord<michaelb.eth> In reply to @jviega "Oh yeah, I'm an": I'm also and Emacs users. nimlangserver used in conjunction with lsp-mode works great in my experience, but it's important to setup a project mapping, which isn't explained super well though I eventually figured it out
21:19:51FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4HBq
21:19:58FromDiscord<jviega> I’ve never tried it myself, all visual studio users who put in the effort complaining
21:20:38FromDiscord<jviega> Join wouldn’t add the last comma
21:21:22FromDiscord<jviega> You have a new line on the end?
21:21:23FromDiscord<sOkam! 🫐> then maybe i have some noise in the string or something πŸ€”
21:22:14FromDiscord<sOkam! 🫐> oh yeah, there is `@["0", "1", ""]`
21:22:25*advesperacit quit ()
21:22:35FromDiscord<jviega> Strip() first
21:24:02FromDiscord<sOkam! 🫐> gud idea. but best idea is to not create the `0 1 ` space at the end
21:32:39FromDiscord<Elegantbeef> Stop using split and use strscans πŸ˜„
21:32:58FromDiscord<Elegantbeef> Actually that doesnt here I guess
21:42:29*Mister_Magister quit (Read error: Connection reset by peer)
21:44:14*Mister_Magister joined #nim
21:53:02*gooba joined #nim
21:53:28FromDiscord<.aingel.> replace space with , would also work
22:36:05*Jjp137 quit (Ping timeout: 246 seconds)
22:36:35*termer quit (Remote host closed the connection)
22:36:55*termer joined #nim
22:53:43*jmdaemon quit (Ping timeout: 240 seconds)
23:33:25*Mister_Magister quit (Read error: Connection reset by peer)
23:35:00*Mister_Magister joined #nim
23:35:33FromDiscord<nixfreak> In reply to @jviega "Oh yeah, I'm an": I switched to nyoom now , works just like doom-eMacs but built in lsp https://github.com/nyoom-engineering/nyoom.nvim/blob/main/docs/getting_started.md
23:43:36*gooba_ joined #nim
23:43:37*gooba_ quit (Remote host closed the connection)
23:47:04FromDiscord<raynei486> we lost an emacs convert πŸ˜”