<< 09-07-2023 >>

00:07:50*disso-peach joined #nim
01:07:15*oprypin quit (Server closed connection)
01:10:35*oprypin joined #nim
01:19:30*ltriant left #nim (#nim)
01:29:37FromDiscord<shad.ow> does anyone know if in the `jsony` lib there's a way to write a hook that parses as one type but converts to another? for example i want to parse an `array[2, int]` but then convert to a `Vec2` from `vmath` afterwards
01:29:58FromDiscord<shad.ow> alternatively i can just make two types, one as the type to parse two, and the other as the type to transform to, and write a transformation function
01:30:05FromDiscord<shad.ow> but i was just wondering if there was a way to do it in one pass
01:33:08FromDiscord<Elegantbeef> Just write a hook that parses the internal type the convert to your dest
01:33:37FromDiscord<intellj_gamer> sent a code paste, see https://play.nim-lang.org/#ix=4A7A
01:33:53FromDiscord<Elegantbeef> Insert jeff goldblum here
01:38:15*NimBot quit (Server closed connection)
01:38:28*NimBot joined #nim
01:40:57FromDiscord<shad.ow> oh hey beef it's been a while lmao
01:41:11FromDiscord<shad.ow> sent a code paste, see https://play.nim-lang.org/#ix=4A7C
01:45:53FromDiscord<heysokam> if you have a json subnode in `JsonNode` form, and you want to extract its json string literally, without modification... how do you do it?↵im trying: `json["theKeyName"].toJson`.. but its telling me that `toJson` doesn't exist 🤔
01:47:19FromDiscord<heysokam> (edit) "if you have a json subnode in `JsonNode` form, and you want to extract its json string literally, without modification... how do you do it?↵im trying: `json["theKeyName"].toJson`.. but its telling me that `toJson` doesn't exist ... 🤔" added "for JsonNode"
01:51:33FromDiscord<shad.ow> sent a code paste, see https://play.nim-lang.org/#ix=4A7E
02:08:11*Ekho joined #nim
03:07:55*m5zs7k quit (Server closed connection)
03:08:14*m5zs7k joined #nim
03:52:18FromDiscord<shad.ow> sent a code paste, see https://play.nim-lang.org/#ix=4A7Z
03:53:16FromDiscord<shad.ow> i'd want like some combination of skipping and a parse hook maybe?
03:53:17FromDiscord<Elegantbeef> Define a hook for your type that special cases that field
03:54:01FromDiscord<shad.ow> the `pos` field of my type?
03:54:05FromDiscord<shad.ow> or the `x` and `y` properties of the josn
03:54:48FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/cu0ww
03:55:06FromDiscord<Elegantbeef> `myObject.fieldPairs`
03:55:21FromDiscord<shad.ow> hm
03:55:25FromDiscord<shad.ow> but i don't want the field to appear in the result either
03:55:30FromDiscord<shad.ow> (edit) "but i don't want the field to appear in the result ... either" added "object"
03:55:30FromDiscord<huantian> Why not make an object with an x and y field and parse into that
03:55:35FromDiscord<shad.ow> yeah i had considered that idk
03:55:37FromDiscord<shad.ow> it just feels like
03:55:41FromDiscord<shad.ow> i'd be duplicating types
03:55:44FromDiscord<Elegantbeef> Yea i'm super confused what you're doing
03:55:45FromDiscord<shad.ow> with slight differences
03:55:51FromDiscord<shad.ow> should i give an example
03:55:56FromDiscord<shad.ow> yes i should
03:56:25FromDiscord<shad.ow> let's say my json is `{"x": 123.4, "y": 183.2, "foo": [1.0, 2.8, 3.2, 4.1, 5.3]}`
03:56:28FromDiscord<shad.ow> i'd like to parse that to a type
03:56:49FromDiscord<shad.ow> sent a code paste, see https://play.nim-lang.org/#ix=4A82
03:57:06FromDiscord<shad.ow> if i have to make one type for the json and one for the representation that's fine
03:57:08FromDiscord<Elegantbeef> So then write a custom hook for `Bar` that grabs the `x` and `y`
03:57:23FromDiscord<shad.ow> i see
03:57:29FromDiscord<shad.ow> and that'd be a `parseHook`?
03:59:28FromDiscord<Elegantbeef> Sure
04:00:26FromDiscord<shad.ow> ri see
04:00:28FromDiscord<shad.ow> (edit) "ri" => "i"
04:00:33FromDiscord<shad.ow> i suppose i could also just parse to a json node and transform that
04:00:44FromDiscord<shad.ow> In reply to @Elegantbeef "So then write a": alright i'll try to do it that way thanks
04:48:21*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
04:50:42*Lord_Nightmare joined #nim
05:21:48*xet7 quit (Ping timeout: 240 seconds)
06:00:16FromDiscord<br4n_d0n> I have a strange question, what are the bare minimum files need to use the nim compiler? The nim binary in /bin and anything else?
06:04:59FromDiscord<Elegantbeef> Also the system part of the libs folder
06:14:45FromDiscord<br4n_d0n> Hey Beef, long time no see. Does that include the lib/system/mm directory?
06:14:55FromDiscord<Elegantbeef> Probably
06:15:06FromDiscord<br4n_d0n> What is mm even for? lol
06:15:22FromDiscord<Elegantbeef> memory management
06:15:22FromDiscord<br4n_d0n> memory management?
06:15:32FromDiscord<br4n_d0n> beat me to it
06:15:38FromDiscord<br4n_d0n> thanks
06:16:00FromDiscord<br4n_d0n> anything else?
06:20:53*xet7 joined #nim
07:22:56*ovenpasta joined #nim
07:32:46FromDiscord<shad.ow> i'm using `spacy` currently, is there a way to use `findInRange` with just a position? (there might not be an entry at that position)
07:38:27FromDiscord<shad.ow> or does it inherently rely upon the entry being in the space
07:39:15FromDiscord<shad.ow> hm went source diving it seems i can just use an id that isn't taken
08:10:15*pbsds quit (Server closed connection)
08:10:41*pbsds joined #nim
08:12:47*ntat joined #nim
08:17:56*ovenpasta quit (Ping timeout: 245 seconds)
08:18:21*ovenpasta joined #nim
08:46:09*azimut quit (Remote host closed the connection)
08:46:37*azimut joined #nim
09:27:15FromDiscord<enthus1ast> do we have a "mime sniffing" library?
09:27:24FromDiscord<enthus1ast> That can deduce the mime type from a bytestream?
09:31:32FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/exEz9
09:35:22FromDiscord<odexine> Using magic numbers?
09:35:47FromDiscord<enthus1ast> yes
09:36:02FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4A9a
09:36:10FromDiscord<enthus1ast> https://github.com/xmonader/nim-magic does exactly what i want
09:36:32FromDiscord<odexine> Cursory search https://github.com/jiro4989/filetype
09:36:41FromDiscord<odexine> Oh okay
09:38:08FromDiscord<enthus1ast> but i'll also look at the filetype library
09:38:41FromDiscord<enthus1ast> the magic uses libmagic that basically is the `file` linux command
09:39:01FromDiscord<enthus1ast> but it has the dependency to libmagic-dev
09:53:17FromDiscord<odexine> Personally, I’d follow the extension if there is, see if it parses for that extension and if not, reject the file↵If there is no extension then I’d check for if it is plain text or not and reject if not but plain text isn’t reliably detectable so that’s another issue
09:53:53FromDiscord<odexine> And also just because something parses for it’s extension doesn’t mean it’s benign, but it depends on your threat model
10:36:12*ntat quit (Quit: Leaving)
11:10:21*xet7 quit (Ping timeout: 246 seconds)
11:11:03*jmdaemon quit (Ping timeout: 246 seconds)
13:43:20*dv^_^ quit (Quit: dv^_^)
13:44:42*dv^_^ joined #nim
13:59:03NimEventerNew Nimble package! brainimfuck - Brainfuck interpreter with some advanced features, such as syntax checking and highlighting errors., see https://github.com/nirokay/brainimfuck
14:00:01*junaid_ joined #nim
14:17:28*junaid_ quit (Remote host closed the connection)
14:28:28FromDiscord<odexine> thats interesting
14:32:04FromDiscord<bung8954> how to add msvc linker flag like `/ASSEMBLYDEBUG` ?
14:33:49FromDiscord<jmgomez> In reply to @bung8954 "how to add msvc": `-l:/ASSEMBLYDEBUG` ?
14:36:18FromDiscord<bung8954> hmm it seems it ignore all my flags starts with `-l`
14:38:06FromDiscord<jmgomez> try out "-l:\"/ASSEMBLYDEBUG \""
14:38:14FromDiscord<jmgomez> (edit) ""-l:\"/ASSEMBLYDEBUG \""" => "`"-l:\"/ASSEMBLYDEBUG \""`"
14:44:46FromDiscord<bung8954> doesn't work
14:47:54FromDiscord<jmgomez> weird, that's what I do: https://github.com/jmgomez/NimForUE/blob/2e0745711ba33c0c388502f48fcdc0651dac4ded/src/buildscripts/switches/winswitches.nim#L146
14:51:12FromDiscord<juan_carlos> In reply to @jmgomez "weird, that's what I": `--passL:` ?. 🤔
14:52:00FromDiscord<bung8954> https://github.com/nim-lang/Nim/issues/5953 now I use `{.passL:"/link /ASSEMBLYDEBUG"}` it doesn't warning me now
15:14:20FromDiscord<System64 ~ Flandre Scarlet> What is better for an undo redo feature?↵A Seq or something else?
15:14:47FromDiscord<odexine> technically a seq would do, if you model a stack
15:14:54FromDiscord<_gumbercules> It's just passL:/Assemblydebug
15:15:11FromDiscord<odexine> depends on how much features you want, programs like Vim use a tree structure for their undo/redo
15:15:26FromDiscord<odexine> as in that a new branch is made when you make a change after undoing
15:16:10FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "technically a seq would": the most common thing is a stack
15:16:17FromDiscord<odexine> yes
15:22:47FromDiscord<jmgomez> `passL` and `l` when used as cmds are exactly the same thing
15:52:35FromDiscord<heysokam> is there any practical difference between a `const seq` and a `const array`? 🤔
15:53:18FromDiscord<takemichihanagaki3129> how to force some function to be available just at compile-time?
15:55:54*ntat joined #nim
15:59:38FromDiscord<juan_carlos> In reply to @takemichihanagaki3129 "how to force some": `{.compileTime.}`
16:00:42FromDiscord<takemichihanagaki3129> In reply to @juan_carlos "`{.compileTime.}`": Thank you a lot!
16:01:59FromDiscord<juan_carlos> yw
16:15:42NimEventerNew thread by bertikrueger: FFI: How to bind to a cpp std::vector which contains another std::vector in nim?, see https://forum.nim-lang.org/t/10330
16:31:13*jmdaemon joined #nim
16:42:39*junaid_ joined #nim
16:42:47*junaid_ quit (Client Quit)
16:43:37*junaid_ joined #nim
17:42:01*junaid_ quit (Remote host closed the connection)
18:24:07FromDiscord<ieltan> another showstopper discovered 😢
18:24:23*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
18:28:56*Lord_Nightmare joined #nim
19:02:31*lucasta joined #nim
19:04:11*ntat quit (Ping timeout: 264 seconds)
19:09:28NimEventerNew post on r/nim by RoughCalligrapher906: NIM - How to Install and First Script (Hello World), see https://reddit.com/r/nim/comments/14v6uhm/nim_how_to_install_and_first_script_hello_world/
20:03:11*xet7 joined #nim
20:39:25FromDiscord<ambient3332> OTFFT is 8x faster than PocketFFT, allegedly as fast as FFTW3, but instead of GPL/FFTW3, it's MIT, plus it's pretty easy to wrap https://github.com/amb/nim_audiobook/blob/no-arraymancer/otfft-simple/otfft_c.nim have I found the endgame FFT for Nim? I still need to run it inside STFT but it looks good
22:50:38*azimut quit (Ping timeout: 240 seconds)