00:04:43 | FromDiscord | <JJ> can i call dumpTree after a macro expansion? doing some stupid metaprogramming and running into problems |
00:06:33 | FromDiscord | <Elegantbeef> `expandMacros` |
00:06:43 | FromDiscord | <Elegantbeef> or `--expandMacro: myMacro` |
00:06:50 | FromDiscord | <Elegantbeef> or `echo result.repr` |
00:07:19 | FromDiscord | <Elegantbeef> Or share the macro so I can say you're doing stupid things with an air of superiority 😄 |
00:09:38 | FromDiscord | <takemichihanagaki3129> In reply to @Elegantbeef "Or share the macro": LMAO |
00:48:25 | NimEventer | New Nimble package! rclnim - Nim bindings for ROS2, see https://github.com/Pylgos/rclnim |
00:52:08 | * | jmd_ quit (Ping timeout: 252 seconds) |
00:53:25 | NimEventer | New Nimble package! polyrpc - A system for generating remote-procedure-calls for any pair of server and client, see https://github.com/choltreppe/polyrpc |
01:13:36 | * | jmdaemon joined #nim |
01:32:53 | * | rockcavera quit (Remote host closed the connection) |
02:08:01 | FromDiscord | <bung8954> `static wil::com_ptr<ICoreWebView2> webviewWindow;` should I use `wil::com_ptr` to make this kind of pointer? |
02:21:23 | * | disso-peach quit (Quit: Leaving) |
02:48:25 | FromDiscord | <bung8954> found the anwser. |
02:55:53 | NimEventer | New thread by oyster: Redirect echo result to make a lazy function?, see https://forum.nim-lang.org/t/10336 |
03:06:12 | FromDiscord | <gogolxdong666> How to debug Nimbus macro like `rpc` |
04:34:17 | FromDiscord | <m4ul3r> In windows, does `alloc()` from system using VirtualAlloc ? |
04:37:22 | FromDiscord | <Elegantbeef> It uses the default nim allocator |
04:37:45 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/lib/system/alloc.nim |
05:13:47 | NimEventer | New Nimble package! spotlightr - Spotlightr basic extractor to get the video, see https://git.ozzuu.com/thisago/spotlightr |
05:27:45 | FromDiscord | <JJ> In reply to @Elegantbeef "Or share the macro": agh apologies for asking and immediately going afk! |
05:27:57 | FromDiscord | <JJ> this is in fact the stupid thing |
05:28:07 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4AxX |
05:29:50 | FromDiscord | <JJ> i believe i am slightly misusing the semantics of `quote do` but i do not know why `quote do: 0` works while `quote do: 'a'` fails |
05:33:11 | FromDiscord | <Elegantbeef> The hell are you doing |
05:33:22 | FromDiscord | <Elegantbeef> Attempting to inline fib? |
05:33:32 | FromDiscord | <Elegantbeef> Rather unroll |
05:33:44 | FromDiscord | <Elegantbeef> I'm so confused |
05:33:52 | FromDiscord | <Elegantbeef> Why are you using a macro here |
05:35:46 | FromDiscord | <JJ> In reply to @Elegantbeef "The hell are you": well it's a bit of a shitpost |
05:35:51 | FromDiscord | <JJ> In reply to @Elegantbeef "Rather unroll": essentially |
05:36:40 | FromDiscord | <JJ> i think the problem is `a` is of type int rather than a NimNode |
05:36:40 | FromDiscord | <Elegantbeef> Well firstly why are you doing `result = quote do: 0` |
05:36:52 | FromDiscord | <Elegantbeef> secondly why are you doing `result = quote do: result + a` |
05:36:59 | FromDiscord | <Elegantbeef> The result of a macro is a NimNode |
05:37:48 | FromDiscord | <JJ> well the idea is it outputs literally, `0`, `0+1`, `0+1+1`, `0+1+1+2` though looking back i see my logic is wrong |
05:38:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/MWnqC |
05:38:39 | FromDiscord | <JJ> i'll need to eval `result` then use that instead of `a` |
05:39:08 | FromDiscord | <ambient3332> fib is fib-1 + fib-2 tho, not n! |
05:39:15 | FromDiscord | <ambient3332> or 1+2+3+4 etc |
05:39:24 | FromDiscord | <punchcake> https://programming-language-benchmarks.vercel.app/c-vs-nim |
05:39:34 | FromDiscord | <punchcake> acording to all of these benchmarks why is nim slower than C? |
05:39:44 | FromDiscord | <Elegantbeef> Cause benchmarks are useless |
05:39:54 | FromDiscord | <Elegantbeef> Though Nim beats C in some places |
05:40:26 | FromDiscord | <Elegantbeef> https://github.com/hanabi1224/Programming-Language-Benchmarks/blob/main/bench/algorithm/spectral-norm/4.c like how is this in the same benchmark as https://github.com/hanabi1224/Programming-Language-Benchmarks/blob/main/bench/algorithm/spectral-norm/1.nim |
05:40:46 | FromDiscord | <JJ> In reply to @punchcake "acording to all of": the first benchmark on that page has nim in fact beating c (which is a bit funny, generated c beating handcrafted c) |
05:40:53 | FromDiscord | <Elegantbeef> The C solution is using simd |
05:40:54 | FromDiscord | <punchcake> so i can use nim as a replacement for C? |
05:41:05 | FromDiscord | <Elegantbeef> Sure |
05:41:08 | FromDiscord | <Elegantbeef> If you do the same thing that the fast C does of course |
05:41:13 | FromDiscord | <punchcake> i like the gc aspect of nim |
05:41:19 | FromDiscord | <ambient3332> GC always has a cost |
05:41:31 | FromDiscord | <Elegantbeef> Using simd in a benchmark against a non simd benchmark is like entering a race shooting the other racers when it starts |
05:41:34 | FromDiscord | <punchcake> i usally implement a lot of tree graphing and it makes manual memory managment impossible |
05:41:39 | FromDiscord | <Elegantbeef> "GC always has a cost" well luckily we have arc/orc |
05:41:41 | FromDiscord | <Elegantbeef> So... there goes that |
05:41:59 | FromDiscord | <ambient3332> doubt.jpg |
05:42:02 | FromDiscord | <Elegantbeef> RAII is indistinguishable from manual memory management, fitem e |
05:42:04 | FromDiscord | <Elegantbeef> fite me\ |
05:42:32 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4AxZ |
05:42:39 | FromDiscord | <JJ> this is of course profoundly stupid |
05:42:55 | FromDiscord | <Elegantbeef> Of course |
05:43:15 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4Ay0 |
05:43:49 | FromDiscord | <ambient3332> Plus my take on Nim is that it's playing a game with the C or C++ compiler to produce optimal code, sometimes that game might fail. However the tradeoffs are worth it. |
05:43:51 | FromDiscord | <Elegantbeef> So JJ how goes UXN 😛 |
05:44:09 | FromDiscord | <Elegantbeef> Eh Nim's generated code is hardly ever why it's slow imo |
05:44:21 | FromDiscord | <Elegantbeef> It's generally due to the programmer |
05:44:25 | FromDiscord | <JJ> it's been going, i finally have time to get back to it this week |
05:44:27 | FromDiscord | <ambient3332> In reply to @Elegantbeef "Eh Nim's generated code": People say the exact same thing about Python |
05:44:44 | FromDiscord | <demotomohiro> Cost of Nim's arc is only increment/decrementing ref count and check if it 0, isnt it? |
05:44:46 | FromDiscord | <Elegantbeef> Sure, but if you look at the benchmarks nim's naive benchmarks are fairly good |
05:44:59 | FromDiscord | <Elegantbeef> Right demo, and that's only for ref types |
05:45:07 | FromDiscord | <Elegantbeef> For non refs there is no ref count |
05:45:08 | FromDiscord | <punchcake> orc isnt stop the world right? |
05:45:11 | FromDiscord | <ambient3332> --mm:refc often is performance improvement over --mm:orc |
05:45:32 | FromDiscord | <JJ> my friend finished his rust impl. he gave up on rust macros and hand-wrote each case of the 255 opcodes |
05:45:33 | FromDiscord | <Elegantbeef> Sure and refc and orc are two different memory management systems so code might need to be changed to benefit from orc |
05:45:52 | FromDiscord | <ambient3332> How do I change code to benefit from ORC? 🤔 |
05:46:10 | FromDiscord | <Elegantbeef> Use `sink`, `lent` and do not copy data accidently |
05:46:19 | FromDiscord | <punchcake> In reply to @ambient3332 "--mm:refc often is performance": refc will leak cycles |
05:46:30 | FromDiscord | <Elegantbeef> refc doesnt leak cycles |
05:46:30 | FromDiscord | <Elegantbeef> arc leaks cycles |
05:46:38 | FromDiscord | <punchcake> refc vs orc? |
05:46:43 | FromDiscord | <JJ> how much of anything does `sink` do? i was quite surprised to learn it would fall back to copying |
05:46:51 | FromDiscord | <Elegantbeef> refc is a garbage collector |
05:46:52 | FromDiscord | <JJ> instead of failing to compile |
05:46:59 | FromDiscord | <Elegantbeef> orc is mark and sweep + arc |
05:47:08 | FromDiscord | <Elegantbeef> What do you mean how much does it do? |
05:47:24 | FromDiscord | <Elegantbeef> It tells the compiler it can move memory |
05:47:28 | FromDiscord | <punchcake> bruv what do i use that wont leak cycles and doesnt stop the world |
05:48:29 | FromDiscord | <huantian> In reply to @Elegantbeef "What do you mean": i think the question is that if `sink` falls back to copying, why isn't everything just `sink` and fall back to copying? |
05:48:43 | FromDiscord | <Elegantbeef> What more can it do |
05:48:43 | FromDiscord | <Elegantbeef> Erroring is a ballache that just encourages people to write `.clone` |
05:48:50 | FromDiscord | <Elegantbeef> `orc` and `refc` |
05:49:13 | FromDiscord | <JJ> yea i remembered the conversation we had earlier |
05:49:19 | FromDiscord | <Elegantbeef> `--sinkInference:on` |
05:49:19 | FromDiscord | <Elegantbeef> There we go 😄 |
05:49:27 | FromDiscord | <JJ> i do wish `sink` would fail to compile on unsinkable types |
05:49:40 | FromDiscord | <huantian> like `float`? 😛 |
05:49:47 | FromDiscord | <JJ> lmao |
05:50:07 | FromDiscord | <huantian> if your object has a float field then it can't be used in sink lmao↵that would be a funny april fools |
05:50:07 | FromDiscord | <Elegantbeef> The issue with `sink` is it's apart of the proc signature |
05:50:33 | FromDiscord | <Elegantbeef> so `--sinkInference:on` breaks code |
05:50:52 | FromDiscord | <JJ> In reply to @huantian "like `float`? 😛": this is technically correct too right? i can't remember the threshold at which point passing by reference + counting is more efficient |
05:51:06 | FromDiscord | <Elegantbeef> It's a line of code |
05:51:07 | FromDiscord | <Elegantbeef> If you dont want a sink to be made error it for your type |
05:51:08 | FromDiscord | <Elegantbeef> Rather a copy |
05:51:31 | FromDiscord | <Elegantbeef> I know I'm hardly the pillar of good performance important code, but I've never really found an issue with the implicit copy |
05:51:44 | FromDiscord | <huantian> In reply to @punchcake "bruv what do i": just in case it wasn't clear this is beef's answer to your question https://discord.com/channels/371759389889003530/371759389889003532/1129288373232742420 |
05:52:07 | FromDiscord | <ambient3332> Seems there's never a free lunch for memory management. It's always a pain https://nim-lang.org/docs/destructors.html |
05:52:13 | FromDiscord | <punchcake> In reply to @huantian "just in case it": thanks |
05:52:26 | FromDiscord | <Elegantbeef> You only need to worry about that stuff ambient if you need hooks |
05:52:37 | FromDiscord | <Elegantbeef> Otherwise you can close your eyes and just understand move semantics |
05:52:55 | FromDiscord | <Elegantbeef> `sink` takes memory, you should not use a variable after a suspposed move |
05:52:58 | FromDiscord | <Elegantbeef> supposed\ |
05:53:22 | FromDiscord | <Elegantbeef> That's as simple as move semantics need to be if you do not need hooks |
05:53:31 | FromDiscord | <JJ> In reply to @Elegantbeef "If you dont want": would this work for the "actually your struct is on the stack dumbass" problem too? |
05:53:32 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4Ay2 |
05:53:44 | FromDiscord | <Elegantbeef> Of course you disable the copy hook |
05:53:58 | FromDiscord | <Elegantbeef> A copy would have to be done explicitly some other way |
05:54:13 | FromDiscord | <Elegantbeef> by implementing a `clone` by using `copyMem` by asking very very nicely, one of those |
05:54:45 | FromDiscord | <Elegantbeef> Hooks are just general procedures you can implement for your type |
05:55:00 | FromDiscord | <Elegantbeef> Want to implement type operations for GPIO pins of a microcontroller you can |
05:56:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/sT7AK |
05:56:15 | FromDiscord | <Elegantbeef> This even works with `distinct T` |
05:56:33 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/9976#65763 |
05:56:38 | FromDiscord | <Elegantbeef> for a full case study of that |
05:58:49 | FromDiscord | <JJ> i gotta play around with hooks more sometime |
05:59:18 | FromDiscord | <Elegantbeef> Each day we get more for some reason and I don't know how to use the new ones |
05:59:20 | FromDiscord | <JJ> also beef can you evaluate a NimNode to a value within a macro? |
05:59:27 | FromDiscord | <Elegantbeef> `=wasMoved` and `=dup` are ones I have 0 clue what they do and why they exist |
05:59:28 | FromDiscord | <Elegantbeef> Of course not |
05:59:48 | FromDiscord | <Elegantbeef> Nim is statically typed evaluating a NimNode inside a macro would be it'd be dynamically typed |
06:00:18 | FromDiscord | <Elegantbeef> Arent you just making a recursive infix tree |
06:00:41 | FromDiscord | <JJ> In reply to @Elegantbeef "`=wasMoved` and `=dup` are": oh god i was trying to understand the semantics of wasMoved a while back |
06:00:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/T2as2 |
06:01:09 | FromDiscord | <JJ> mmm. yeah i was trying to do it all with `quote do` but that's better |
06:01:13 | FromDiscord | <Elegantbeef> I stick to `=destroy` `=copy` and `=sink` |
06:01:23 | FromDiscord | <Elegantbeef> `=trace` is also simple |
06:01:29 | FromDiscord | <Elegantbeef> The rest are fucking abysmally under explained |
06:01:37 | FromDiscord | <JJ> In reply to @Elegantbeef "Nim is statically typed": wait can you elaborate on this though? if all the values in the NimNode are static it should be fine right |
06:01:45 | FromDiscord | <Elegantbeef> Nope |
06:02:20 | FromDiscord | <Elegantbeef> The type of the NimNode would have to be dynamically looked up for it to make any sense |
06:03:36 | FromDiscord | <JJ> is that not statically known? |
06:05:08 | FromDiscord | <Elegantbeef> How does the VM know what type is inside a NimNode before it's evaluated? |
06:06:41 | FromDiscord | <Elegantbeef> What does `typeof(a)` expand into when the macro is semantically checked? |
06:06:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/IyCPZ |
06:06:51 | FromDiscord | <Elegantbeef> You're describing a template that wraps a macro |
06:06:54 | FromDiscord | <JJ> well i know nothing about NimNodes but i don't see why it doesn't evaluate it |
06:07:04 | FromDiscord | <Elegantbeef> Macros are semantically checked once they're practically compile time procedures |
06:07:24 | FromDiscord | <Elegantbeef> Well the question is how can it give a type to an expression when the type can be anything? |
06:08:44 | FromDiscord | <Elegantbeef> There is no way without having a macro treated like a template to have `a` be a single type |
06:09:09 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4Ay8 |
06:09:14 | FromDiscord | <Elegantbeef> You don't |
06:09:33 | FromDiscord | <ambient3332> How do I force a function to use only refs or pointers? |
06:09:37 | FromDiscord | <JJ> seqs are heap allocated i believe |
06:09:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Ay9 |
06:10:02 | FromDiscord | <Elegantbeef> seqs are heap allocated, but that doesnt matter |
06:10:17 | FromDiscord | <Elegantbeef> They have a non gc'd object component that's stack allocated |
06:10:39 | FromDiscord | <JJ> In reply to @ambient3332 "How do I force": also i don't know if you can do that, sounds quite type unsafe |
06:10:43 | FromDiscord | <Elegantbeef> In orc/arc atleast |
06:10:44 | FromDiscord | <Elegantbeef> In refc they're just another gc'd type |
06:10:44 | FromDiscord | <Elegantbeef> But you cannot go `addr` to ref |
06:10:45 | FromDiscord | <Elegantbeef> Those are two different types |
06:11:00 | FromDiscord | <Elegantbeef> `proc doThing(t: ref T or ptr T)` 😄 |
06:11:29 | FromDiscord | <ambient3332> Not what I meant |
06:11:29 | FromDiscord | <Elegantbeef> So JJ do you understand why evaluating NimNodes is a bit of a oddball thing? |
06:11:55 | FromDiscord | <JJ> no, not really: my confusion comes from the distinction between macros and templates i think |
06:12:16 | FromDiscord | <JJ> i thought templates were raw substitution and macros were programmatic ast substitution, before or after typechecking |
06:12:20 | FromDiscord | <Elegantbeef> Macros are not code subsitution |
06:12:20 | FromDiscord | <Elegantbeef> They run on the VM |
06:12:20 | FromDiscord | <Elegantbeef> They are semantically checked once, just like a procedure |
06:12:33 | FromDiscord | <Elegantbeef> So a variable has a singular type |
06:13:57 | FromDiscord | <JJ> hmm okay i suppose that makes sense |
06:13:57 | FromDiscord | <Elegantbeef> For you to be able to evaluate a Nim node that means that variable has to be reinstantiated for every invokation |
06:14:08 | FromDiscord | <punchcake> @pmunch will you ever update wxnim? |
06:14:45 | FromDiscord | <Elegantbeef> I'm going to say "PRs welcome" for him |
06:15:00 | FromDiscord | <punchcake> bet |
06:15:10 | FromDiscord | <pmunch> For a newer version of wxWidgets? |
06:15:26 | FromDiscord | <pmunch> Or just update wxNim with more features? |
06:16:13 | FromDiscord | <punchcake> In reply to @pmunch "Or just update wxNim": update wxnim to wrap all widgets |
06:17:06 | FromDiscord | <pmunch> Ah, well I probably will, once Futhark can handle C++ |
06:20:49 | FromDiscord | <pmunch> Currently it's wrapped by an unwieldy c2nim script, and then manually edited.. |
06:21:02 | FromDiscord | <pmunch> Which isn't very update friendly |
06:22:10 | FromDiscord | <punchcake> damn why is nim lacking so much for production ready gui's |
06:22:28 | FromDiscord | <Elegantbeef> It's an uphill battle |
06:22:52 | FromDiscord | <JJ> eh isn't gintro pretty good |
06:23:31 | FromDiscord | <JJ> but yeah gui is very hard |
06:23:40 | FromDiscord | <Elegantbeef> Owlkettle is even nicer 😄 |
06:24:24 | FromDiscord | <punchcake> i think the best we got is is nim qml bindings |
06:25:00 | FromDiscord | <JJ> oh yes that is what i was thinking of! gintro wasn't too bad when i played around with it but owlkettle has been on my totry list for ages |
06:25:32 | FromDiscord | <JJ> i knew something had the nice macros |
06:30:18 | FromDiscord | <pmunch> wxNim also has nice macros. Along with genui-gtk and genui-gtk3 |
06:30:55 | FromDiscord | <pmunch> Maybe I should update the latter two to work on my Futhark'd Gtk. That's what I've been using lately |
06:32:21 | FromDiscord | <JJ> how are identifier conflicts with gtk? are there too many or is it fairly 1:1 |
06:34:19 | FromDiscord | <Elegantbeef> Futhark gets around conflicts |
06:34:21 | FromDiscord | <JJ> oh my god i didn't realize how much documentation was in `std/macros` |
06:34:44 | FromDiscord | <JJ> holy i've been driving blind this whole time |
06:35:22 | FromDiscord | <punchcake> when compiling the calculator example on windows https://github.com/neroist/uing↵i keep getting this error https://media.discordapp.net/attachments/371759389889003532/1129300085700833400/message.txt |
06:35:26 | FromDiscord | <punchcake> (edit) "error" => "error↵wtf is this" |
06:35:30 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/compiler/ast.nim#L35-L229 there's even more |
06:36:07 | FromDiscord | <punchcake> windows gcc btw |
06:36:55 | FromDiscord | <JJ> In reply to @Elegantbeef "Futhark gets around conflicts": yea i'm curious how much of it is 1:1 though, i've had some pretty gross experiences with keyboard libraries and the like that need wrapping post futhark |
06:37:36 | FromDiscord | <JJ> i suppose gtk falls into that camp purely for the gobject weirdness though |
06:41:24 | * | PMunch joined #nim |
06:43:25 | FromDiscord | <punchcake> god fucking damn |
06:43:32 | FromDiscord | <pmunch> Not quite sure what you mean @JJ |
06:43:32 | FromDiscord | <punchcake> is there no decent gui lib in nim |
06:43:38 | FromDiscord | <punchcake> at this point im gonna fucking make one |
06:43:56 | FromDiscord | <pmunch> @punchcake, I think the answer to that is that there is no good GUI lib period |
06:44:03 | FromDiscord | <punchcake> web based ui with nim backend inspired by wails.io |
06:44:07 | FromDiscord | <punchcake> In reply to @pmunch "<@655759729477287956>, I think the": wails.io |
06:44:12 | FromDiscord | <punchcake> for go at least |
06:44:18 | FromDiscord | <pmunch> Welp, you lost me at web-based.. |
06:44:24 | FromDiscord | <Elegantbeef> web based and written in go |
06:44:30 | FromDiscord | <punchcake> web based is unparalleled |
06:44:31 | FromDiscord | <Elegantbeef> Two of the worst things imaginable |
06:44:46 | FromDiscord | <JJ> yeah that is disgusting |
06:44:50 | FromDiscord | <Elegantbeef> You're right it's unparalleled cause it's tangential to a solution |
06:44:59 | FromDiscord | <punchcake> In reply to @Elegantbeef "You're right it's unparalleled": what solution is there |
06:45:04 | FromDiscord | <Elegantbeef> I did a math funny! |
06:45:04 | FromDiscord | <JJ> if you want that though i thought there were some decent web-based uis |
06:45:15 | FromDiscord | <punchcake> In reply to @omentic "if you *want* that": where is it? |
06:45:22 | FromDiscord | <Elegantbeef> owlkettle is nice ime |
06:45:28 | FromDiscord | <Elegantbeef> I'm not a proper developer though |
06:45:43 | FromDiscord | <Elegantbeef> I'm just a sophisticated monkey at a computer |
06:45:52 | FromDiscord | <JJ> In reply to @punchcake "where is it?": https://github.com/ringabout/awesome-nim#web-technology |
06:45:55 | FromDiscord | <JJ> https://github.com/treeform/fidget in particular |
06:46:13 | FromDiscord | <punchcake> fidget is abandoned |
06:46:24 | FromDiscord | <Elegantbeef> fidget isnt web based |
06:46:28 | FromDiscord | <punchcake> the maintainer treeform is too busy hopping between projects instead of finishing it |
06:46:53 | FromDiscord | <Elegantbeef> I mean he writes using his libraries that's proprietary |
06:47:17 | FromDiscord | <JJ> i really gotta try out owlkettle |
06:47:31 | FromDiscord | <JJ> gotta come up with a reason to though, i write guis so infrequently |
06:47:32 | FromDiscord | <pmunch> https://github.com/bung87/crowngui Maybe give this a try? |
06:47:42 | FromDiscord | <Elegantbeef> I wrote a doom launcher in it one day, was nice |
06:47:59 | FromDiscord | <Elegantbeef> https://github.com/webui-dev/nim-webui also there is this |
06:48:08 | FromDiscord | <JJ> also what exactly is your problem punchcake? do you want a cross-platform ui library, or a native library, or a web library, or... |
06:48:33 | FromDiscord | <JJ> or immediate mode or something |
06:48:37 | FromDiscord | <punchcake> In reply to @omentic "also what exactly is": web ui preferred but something that isnt just straight up abandoned and made for humans would work |
06:48:40 | FromDiscord | <pmunch> Or maybe this? https://github.com/juancarlospaco/webgui |
06:49:05 | FromDiscord | <pmunch> Or just go through this list yourself 😛 https://nimble.directory/search?query=gui |
06:49:13 | FromDiscord | <JJ> In reply to @punchcake "web ui preferred but": > last commit was 10 months ago↵> "straight-up abandoned" |
06:49:21 | FromDiscord | <punchcake> im making my own web ui lib |
06:49:23 | FromDiscord | <Elegantbeef> JJ if you care to see the doom launcher https://play.nim-lang.org/#ix=4Ayd |
06:49:36 | FromDiscord | <punchcake> you bind to javascript using only a macro |
06:49:40 | FromDiscord | <pmunch> But yeah, I agree that the community hasn't landed on one particular solution |
06:49:42 | FromDiscord | <punchcake> sorta like tauri |
06:49:46 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1129303710091182090/image.png |
06:49:47 | FromDiscord | <Elegantbeef> It's like totally passable on top of it |
06:50:12 | FromDiscord | <pmunch> I wanted to take Genui to be a bring-your-own-toolkit macro system for generating UIs |
06:50:18 | FromDiscord | <JJ> In reply to @punchcake "you bind to javascript": ooh nice |
06:50:30 | FromDiscord | <JJ> In reply to @Elegantbeef "JJ if you care": ooh nice |
06:50:57 | FromDiscord | <punchcake> althought uing looks promising if the thing would actually compile on my system |
06:51:30 | FromDiscord | <pmunch> https://github.com/pmunch/genui but well, 4 years since last commit. Don't quite remember what the blocker was.. |
06:52:05 | FromDiscord | <punchcake> In reply to @pmunch "https://github.com/pmunch/genui but well, 4": sorta like haxeui? |
06:52:18 | FromDiscord | <punchcake> the ui code you write is backend agonistic |
06:52:38 | FromDiscord | <punchcake> you can have wxwidgets as backend and suddenly switch to openfl and everything would work fine |
06:52:51 | FromDiscord | <Elegantbeef> I've pretty much given up on the premise of using DSLs for generating UI |
06:52:55 | FromDiscord | <punchcake> i actually convinced them to add a winui backend and they're working on it |
06:53:14 | FromDiscord | <JJ> also beef any way to use `expandMacros` when my code (not macro) doesn't compile |
06:53:22 | FromDiscord | <Elegantbeef> `echo result.repr` |
06:53:35 | FromDiscord | <pmunch> @punchcake that's a weird error message.. |
06:53:41 | FromDiscord | <punchcake> In reply to @pmunch "<@655759729477287956> that's a weird": where? |
06:53:48 | FromDiscord | <pmunch> _O_BINARY should be a built in Windows thing |
06:53:52 | FromDiscord | <JJ> In reply to @Elegantbeef "`echo result.repr`": ah nice ty |
06:54:07 | FromDiscord | <Elegantbeef> For context https://github.com/beef331/gooey/blob/master/example/sdlimpl.nim#L306-L430 to me is much more sensible to a DSL as it's just pure Nim code |
06:54:09 | FromDiscord | <punchcake> In reply to @pmunch "_O_BINARY should be a": its strange |
06:54:23 | FromDiscord | <Elegantbeef> @JJ\: I already mentioned `echo result.repr`, but no someone never listens to me 😄 |
06:54:27 | FromDiscord | <punchcake> even compiling an `echo "hello world"` doesnt work |
06:54:40 | FromDiscord | <pmunch> Yeah I guess sorta like haxeui |
06:54:49 | FromDiscord | <punchcake> perhapse i clapped my gcc install? |
06:55:00 | FromDiscord | <Elegantbeef> Possibly |
06:55:20 | FromDiscord | <punchcake> nim should really use msvc on windows |
06:55:52 | FromDiscord | <pmunch> You can use MSVC on Windows if you like |
06:55:55 | FromDiscord | <punchcake> how? |
06:56:13 | FromDiscord | <Elegantbeef> I mean it cannot ship msvc easily |
06:56:18 | FromDiscord | <pmunch> https://forum.nim-lang.org/t/2770 |
06:56:27 | FromDiscord | <Elegantbeef> Mingw is used cause it can ship it |
06:56:39 | FromDiscord | <Elegantbeef> clang could be nicer |
06:57:03 | Amun-Ra | zig cc -target windows-something-something too |
06:57:16 | FromDiscord | <punchcake> zig? |
06:57:17 | Amun-Ra | x86_64-windows-sth |
06:57:31 | FromDiscord | <Elegantbeef> amun keep your zig installation soon that wont be possible! 😛 |
06:57:39 | Amun-Ra | ;) |
06:57:41 | FromDiscord | <pmunch> In reply to @Elegantbeef "For context https://github.com/beef331/gooey/blob/m": There are so many lines though.. |
06:57:46 | Amun-Ra | Elegantbeef: why? |
06:58:03 | Amun-Ra | punchcake: I'd use mingw64/32 really |
06:58:05 | FromDiscord | <Elegantbeef> Right pmunch cause it's a game ui 😄 |
06:58:31 | FromDiscord | <Elegantbeef> Cause Zig is getting spring cleaning removing that functionality |
06:58:44 | FromDiscord | <pmunch> Yeah but I meant there are so many lines to describe what could be done in fewer lines |
06:58:50 | Amun-Ra | oh, I didn't know that… |
06:58:55 | FromDiscord | <Elegantbeef> Uhhh |
06:59:29 | FromDiscord | <Elegantbeef> Size is important, pos is important, anchor is important, .... |
06:59:30 | FromDiscord | <pmunch> Personally I think the approach I took with genui is the right one for a DSL. Basically just a code generator, nothing fancy: https://github.com/PMunch/wxnim/blob/master/examples/genuimacro/controlgallery.nim |
06:59:46 | FromDiscord | <punchcake> i think its a problem because im using the gcc that ada installer installed for me with msys2 |
06:59:51 | FromDiscord | <punchcake> hm |
06:59:51 | FromDiscord | <pmunch> It's almost a straight 1:1 mapping |
06:59:55 | FromDiscord | <Elegantbeef> In normal GUIs you don't need any of the anchoring, size, or position stuff |
07:00:51 | FromDiscord | <Elegantbeef> but that's on Nim being silly |
07:00:51 | FromDiscord | <Elegantbeef> And ideally a `.named` template would work to prevent those variables |
07:01:09 | FromDiscord | <pmunch> And compare that to gtk3genui: https://github.com/PMunch/gtk3genui/blob/master/example.nim |
07:01:32 | FromDiscord | <pmunch> The names change, but the concept is still the same |
07:01:46 | FromDiscord | <Elegantbeef> The thing with dsls that i'm weary of is stuff like https://github.com/can-lehmann/owlkettle/issues/25 |
07:02:05 | FromDiscord | <Elegantbeef> Assumptions can break otherwise valid code |
07:02:13 | FromDiscord | <pmunch> Basically just keep some context from indentation, remove some terse Cisms when it comes to creating containers and putting stuff in them, et voila |
07:02:50 | FromDiscord | <punchcake> btw is the creator of nim in this server? |
07:03:07 | FromDiscord | <Elegantbeef> Or like if you look at karax missing some specific valid html tags |
07:03:15 | FromDiscord | <pmunch> Yup, but he mainly stays in the internals channel nowadays |
07:03:30 | FromDiscord | <Elegantbeef> Cannot put up with my clown world inanity for sure |
07:03:40 | FromDiscord | <pmunch> <_< |
07:03:46 | FromDiscord | <punchcake> In reply to @pmunch "Yup, but he mainly": would like to ask him what he thinks of the state of nim gui's |
07:03:59 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/10301 |
07:04:02 | FromDiscord | <Elegantbeef> There you go already answered |
07:04:04 | FromDiscord | <punchcake> he looks pretty mad |
07:04:09 | FromDiscord | <pmunch> Haha, I was just about to link that |
07:05:18 | FromDiscord | <punchcake> how do i clear the nim compiler cache |
07:05:23 | FromDiscord | <punchcake> i think i fixed my gcc bug |
07:05:26 | FromDiscord | <pmunch> Anyways ElegantBeef, that criticism is more about DSL design in general |
07:05:30 | FromDiscord | <pmunch> And not really GUI specific |
07:05:42 | FromDiscord | <pmunch> @punchcake just delete your nimcache folder |
07:05:46 | FromDiscord | <Elegantbeef> Eh depends on the application |
07:05:47 | FromDiscord | <pmunch> Wherever that is on Windows.. |
07:05:48 | FromDiscord | <punchcake> wow |
07:05:51 | FromDiscord | <punchcake> sent a code paste, see https://play.nim-lang.org/#ix=4Ayg |
07:06:28 | FromDiscord | <punchcake> In reply to @pmunch "<@655759729477287956> just delete your": aight bet |
07:07:07 | FromDiscord | <punchcake> sent a code paste, see https://play.nim-lang.org/#ix=4Ayh |
07:07:09 | FromDiscord | <punchcake> im starting to think this is a nim bug |
07:07:15 | FromDiscord | <punchcake> gcc compile regular C just fine |
07:08:09 | FromDiscord | <pmunch> Hmm, that leading underscore is a bit strange |
07:08:29 | FromDiscord | <pmunch> But Araq himself uses Windows, so it's not like Nim doesn't compile there |
07:08:39 | FromDiscord | <punchcake> well then |
07:08:40 | FromDiscord | <punchcake> shit |
07:08:42 | FromDiscord | <pmunch> Which Nim version do you have? |
07:08:49 | FromDiscord | <punchcake> latest |
07:08:55 | FromDiscord | <pmunch> And by latest you mean? |
07:09:00 | FromDiscord | <pmunch> What does nim --version return? |
07:09:11 | FromDiscord | <punchcake> Nim Compiler Version 1.6.14 [Windows: amd64]↵Compiled at 2023-06-27↵Copyright (c) 2006-2023 by Andreas Rumpf |
07:09:14 | FromDiscord | <Elegantbeef> > 1.6.14 |
07:09:29 | FromDiscord | <pmunch> Oh duh, it says in the error trace 😛 |
07:09:40 | FromDiscord | <Elegantbeef> Hey I wasnt going to say it |
07:10:36 | FromDiscord | <punchcake> prolly a nim bug |
07:10:42 | FromDiscord | <punchcake> lemme see if downgrading nim would help |
07:12:51 | * | sagax joined #nim |
07:12:55 | FromDiscord | <punchcake> so i use the mingw provided by the nim site and i get more errors |
07:13:04 | FromDiscord | <pmunch> I mean the Windows documentation for that _setmode call says that you should be able to use _O_BINARY: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setmode?view=msvc-170 |
07:13:11 | FromDiscord | <punchcake> https://media.discordapp.net/attachments/371759389889003532/1129309602215907429/message.txt |
07:13:53 | FromDiscord | <punchcake> ffs nim should ship its own gcc or something |
07:14:00 | FromDiscord | <pmunch> That just looks like a linker error though |
07:14:08 | FromDiscord | <odexine> In reply to @punchcake "ffs nim should ship": It kinda does? |
07:14:09 | FromDiscord | <pmunch> What are you trying to compile? |
07:14:16 | FromDiscord | <punchcake> In reply to @pmunch "What are you trying": `echo "hello world"` |
07:14:35 | FromDiscord | <pmunch> I mean, the better solution is that people start to use an operating system with a sane package management system.. |
07:14:52 | FromDiscord | <punchcake> i perfer to use proprietary spyware |
07:15:02 | FromDiscord | <pmunch> I won't kink shame |
07:15:06 | FromDiscord | <odexine> Hey we don’t kink shame here |
07:15:13 | FromDiscord | <punchcake> thanks! |
07:15:14 | FromDiscord | <odexine> What the fuck don’t beat me to the punch |
07:15:28 | FromDiscord | <punchcake> In reply to @odexine "What the fuck don’t": thats what she said |
07:15:44 | FromDiscord | <huantian> In reply to @pmunch "I mean, the better": everyone go use nixos |
07:15:55 | FromDiscord | <punchcake> tried linux mint |
07:15:56 | FromDiscord | <punchcake> sucks |
07:16:06 | FromDiscord | <punchcake> tried every linux distro and i didnt like any |
07:16:12 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4Ayj |
07:16:13 | FromDiscord | <JJ> In reply to @pmunch "I mean, the better": tbf arch is actually quite awful at keeping the nim package up to date |
07:16:26 | FromDiscord | <JJ> surprisingly, they're usually very good with everything except haskell |
07:16:33 | FromDiscord | <huantian> In reply to @punchcake "tried linux mint": ngl I kinda didn't like mint |
07:16:39 | FromDiscord | <Elegantbeef> Same I liked my hard drive after installing it but it didnt taste minty |
07:16:39 | FromDiscord | <Elegantbeef> licked\ |
07:16:40 | * | ntat joined #nim |
07:16:47 | FromDiscord | <punchcake> In reply to @Elegantbeef "Same I liked my": scammed |
07:16:54 | FromDiscord | <punchcake> i have an idea |
07:16:54 | FromDiscord | <pmunch> In reply to @omentic "tbf arch is actually": Well that's because you use the Nim package and not the choosenim package 😛 |
07:17:06 | FromDiscord | <huantian> yeah you should use choosenim from the AUR 😛 |
07:17:09 | FromDiscord | <punchcake> i can compile nim directly to C then compile C using msvc right? |
07:17:20 | FromDiscord | <JJ> In reply to @pmunch "Well that's because you": nah i jumped on choosenim immediately, same for rustup etc |
07:17:37 | FromDiscord | <JJ> actually switched to disruptek's thing recently though |
07:17:40 | FromDiscord | <pmunch> @punchcake so do manually what setting the MSVC flags do? Just without all the compatibility stuff` |
07:17:44 | FromDiscord | <JJ> it was painful (i cannot read documentation) |
07:18:01 | FromDiscord | <pmunch> @JJ Does he have a choosenim alternative now as well? |
07:18:19 | FromDiscord | <JJ> yeah: https://github.com/nim-works/gitnim |
07:18:44 | FromDiscord | <punchcake> wait how do i get the c file that nim compiles to |
07:19:55 | Amun-Ra | set --nimcache |
07:21:17 | FromDiscord | <punchcake> HUH |
07:21:18 | FromDiscord | <JJ> i think mine is broken though, i only have `devel` as an option, no `stable` or anything else. kinda fucked up my installation hard the first time though so |
07:21:36 | FromDiscord | <punchcake> after clearing nimcache it somehow compiles fine |
07:21:46 | FromDiscord | <ambient3332> how do I override toFloat so that it throws an error when it's called and gives me the stack? |
07:22:13 | FromDiscord | <ambient3332> ...locally |
07:22:43 | FromDiscord | <Elegantbeef> Gitnim doesnt work on windows |
07:22:43 | FromDiscord | <Elegantbeef> Cannot tell if that was a joke by dis or a bug |
07:22:43 | FromDiscord | <Elegantbeef> libgit and all is fun |
07:22:44 | FromDiscord | <Elegantbeef> I think there is an issue with gitnim presently, didnt look into it though |
07:22:44 | FromDiscord | <Elegantbeef> `git nim stable` got like `1.4.8` iirc |
07:23:06 | FromDiscord | <JJ> oof the bridge |
07:23:11 | FromDiscord | <Elegantbeef> Do you have a converter by any chance ambient? |
07:23:18 | FromDiscord | <ambient3332> A what? |
07:23:36 | FromDiscord | <Elegantbeef> `converter someName(a: int): float = toFloat(a)` |
07:23:39 | FromDiscord | <Elegantbeef> Something like that |
07:23:52 | FromDiscord | <ambient3332> No I haven't written anything like that |
07:24:36 | FromDiscord | <Elegantbeef> Well then there is no `toFloat` inside that could you shared unless you overloaded `[]` to calll `toFloat` |
07:24:36 | FromDiscord | <Elegantbeef> that code you shared\ |
07:25:26 | FromDiscord | <odexine> In reply to @huantian "everyone go use nixos": uegh |
07:25:35 | FromDiscord | <odexine> i love nixos for my sysadmin tasks but |
07:25:44 | FromDiscord | <odexine> id prolly puke using it on my desktop/laptop |
07:26:19 | FromDiscord | <odexine> In reply to @omentic "surprisingly, they're usually very": i discovered this painfully |
07:26:34 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4Aym |
07:27:30 | FromDiscord | <Elegantbeef> Right you're not calling `toFloat` directly then, it's likey inside one of the procedures you're using so what types are those collections? |
07:27:38 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4Ayo |
07:27:39 | PMunch | Hmm gitnim has an interesting idea of putting itself next to the Nim compiler |
07:27:56 | FromDiscord | <Elegantbeef> JJ you need `: untyped` as the return type |
07:28:01 | PMunch | Ah crap.. |
07:28:10 | FromDiscord | <JJ> oh, thanks! |
07:28:13 | PMunch | I forgot choosenim uses the silly proxy executable.. |
07:28:35 | PMunch | I thought I could get nimlsp to recompile for each choosenim version.. |
07:28:40 | FromDiscord | <Elegantbeef> git nim is interesting due to the shipping a static Nim library |
07:28:49 | FromDiscord | <Elegantbeef> Just clone, build, add to path and you're off to the raises |
07:28:55 | FromDiscord | <Elegantbeef> races even |
07:28:58 | FromDiscord | <Elegantbeef> raises is funnier though |
07:29:26 | PMunch | A static Nim library? |
07:29:40 | FromDiscord | <Elegantbeef> binary |
07:29:40 | FromDiscord | <odexine> In reply to @Elegantbeef "Just clone, build, add": off to the raisins |
07:29:54 | FromDiscord | <Elegantbeef> I phonetically fucked up raises and races, you think I can get all my words right |
07:29:54 | PMunch | Oh by the way Elegantbeef, I was wondering if it would be possible to create a dynamic library out of the nimscript stuff |
07:29:59 | PMunch | Wouldn't that be neat? |
07:30:20 | FromDiscord | <Elegantbeef> Would reduce compile times |
07:30:24 | FromDiscord | <Elegantbeef> So that'd be nifty |
07:31:49 | FromDiscord | <JJ> In reply to @Elegantbeef "JJ you need `:": just checking: there's no typed/untyped distinction for macro return types, right? |
07:31:58 | FromDiscord | <demotomohiro> In reply to @punchcake "i can compile nim": If you compile Nim code with `--cc:vcc` option, Nim generate C code for msvc and calls cl.exe. |
07:31:58 | FromDiscord | <Elegantbeef> Right |
07:32:07 | FromDiscord | <Elegantbeef> You just need to tell it you're returning a value from the macro |
07:32:09 | FromDiscord | <Elegantbeef> A bit odd |
07:32:16 | FromDiscord | <JJ> oh hmm |
07:33:51 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4Ayr |
07:33:52 | PMunch | Elegantbeef, yeah and you could re-use the same library instead of having to add 5Mb to every project which wanted to use it |
07:33:57 | FromDiscord | <ambient3332> even if I specify int manually for both types |
07:36:21 | FromDiscord | <ambient3332> fixed it. apparently Nim doesn't understand const types |
07:36:41 | FromDiscord | <Elegantbeef> It does |
07:36:49 | FromDiscord | <odexine> what do you mean, yeah |
07:36:49 | FromDiscord | <ambient3332> well, it did not |
07:37:07 | FromDiscord | <Elegantbeef> Well pmunch luckily the entry module is like 200 loc so it shouldnt be too hard to do |
07:37:13 | FromDiscord | <ambient3332> sent a code paste, see https://paste.rs/YA2g7 |
07:37:27 | PMunch | Elegantbeef, yeah that's what I seemed to remember |
07:37:30 | FromDiscord | <Elegantbeef> integers are int by default |
07:38:00 | PMunch | As long as it doesn't use too much type magic.. |
07:38:21 | FromDiscord | <Elegantbeef> Although `invokeDynamic` needs to be turned into a procedure that just returns the VM stuff |
07:38:41 | FromDiscord | <Elegantbeef> I also don't know how exceptions in DLLs work |
07:40:19 | PMunch | They don't.. |
07:40:23 | PMunch | Well unless you use nimrtl |
07:40:45 | PMunch | But I was kinda thinking it should be made to work with normal C as well |
07:41:41 | PMunch | But that's mostly just a matter of setting up a try/except and turn the exception into something else |
07:41:57 | FromDiscord | <Elegantbeef> Well just removing the front facing exceptions, yea |
07:42:30 | FromDiscord | <Elegantbeef> It's completely useless as a C library though |
07:42:55 | FromDiscord | <Elegantbeef> Well mostly useless |
07:43:20 | FromDiscord | <Elegantbeef> Cause yay you can call Nimscript, but to actually do anything with the result or hook procedures you have to write a bunch of inane code |
07:45:14 | PMunch | Would you though? Say you want to use it for some configuration stuff. You define some setter procedures, and hook them to a callback. The callback is called, and you unpack the argument (same as you have to in Nim) |
07:45:44 | FromDiscord | <Elegantbeef> Except that Nim has the type information to unpack complex types and has the type information for the entire Nim AST |
07:45:56 | PMunch | Hmm, true |
07:46:07 | FromDiscord | <Elegantbeef> Unpacking primitives is easy |
07:46:27 | FromDiscord | <ambient3332> it seems the foFloat has something to do with overflow checking... 😖 |
07:46:31 | FromDiscord | <Elegantbeef> But if you want to unpack anything else you need to port `vmconversions` to your language |
07:48:09 | PMunch | True |
07:48:20 | PMunch | But you had to implement that in Nim :P |
07:48:22 | FromDiscord | <Elegantbeef> But I'll consider trying to make it a library, probably won't do it any time soon if I do though, still want to work on my game and perhaps the dumb language benchmark idea I have |
07:48:26 | PMunch | So the cost isn't really any higher |
07:49:39 | PMunch | Yeah it's not high up on my list either. Just a thought which struck me today and wanted to bounce it off you to see if you could think of something which would make it impossible |
07:52:23 | FromDiscord | <Elegantbeef> If curious I made a fractal tree toy inside Odin with sdl2 and now I kinda want to port the exact code to other system languages just to say "Look all languages are the same, shut up" |
07:52:37 | FromDiscord | <Elegantbeef> Fractal tree is a great example cause it's interactive and fun 😄 |
07:57:53 | PMunch | Fractal tree? |
07:58:23 | FromDiscord | <Elegantbeef> simplescreenrecorder-2023-07-13\_02.20.24.mp4 [simplescreenrecorder-2023-07-13_02.20.24.mp4](https://t2bot.io/_matrix/media/r0/download/matrix.org/quKqINmmjBdrQrTlGGbikXJA) |
07:58:52 | FromDiscord | <Elegantbeef> Split evenly at every split until you run out of memory or reach a small enough branch |
07:59:50 | Amun-Ra | nice |
08:05:00 | PMunch | Huh, pretty cool |
08:06:37 | FromDiscord | <Elegantbeef> The fun part is it's quite a visible graph problem when it comes to optimising it |
08:07:18 | FromDiscord | <Elegantbeef> Like moving a branch can be optimised to just move the subnodes if you set up the data type properly |
08:07:26 | FromDiscord | <Elegantbeef> iterate the subnodes\ |
08:15:55 | FromDiscord | <bung8954> any idea I get nil ? I've searched on github that the useage is same as c or using com_ptr in cpp https://github.com/bung87/webview2/blob/da054ada39c0c3905edbaf6babad332d6785febe/src/webview2/controller_completed_handler.nim#L22C2-L29C20 |
08:20:01 | FromDiscord | <demotomohiro> This PR adds `staticFileExists` and `staticDirExists`, but I cannot make calling them at runtime to compile error.↵https://github.com/nim-lang/Nim/pull/22278 |
08:23:50 | * | PMunch_ joined #nim |
08:25:26 | * | PMunch quit (Killed (NickServ (GHOST command used by PMunch_))) |
08:25:29 | * | PMunch_ is now known as PMunch |
08:25:57 | FromDiscord | <Elegantbeef> There's no way of doing it |
08:26:03 | FromDiscord | <Elegantbeef> `when nimvm` sems both branches |
08:26:48 | FromDiscord | <Elegantbeef> it might have to be made magic and error inside codegen sadly |
08:28:57 | FromDiscord | <demotomohiro> That's sounds hard.↵I don't know much about Nim compiler internals. |
08:30:48 | FromDiscord | <Elegantbeef> Best to ask inside internals though |
08:30:58 | FromDiscord | <Elegantbeef> It's a real shame that nimvm works how it does |
08:40:33 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4AyK |
08:42:57 | FromDiscord | <demotomohiro> fold? |
08:43:16 | FromDiscord | <JJ> it's not fold, fold is cumulative |
08:43:21 | FromDiscord | <JJ> it's like a blend of fold and map |
08:44:16 | FromDiscord | <nnsee> reduce? |
08:44:29 | FromDiscord | <odexine> zip + map |
08:44:39 | FromDiscord | <Elegantbeef> zap? |
08:44:44 | FromDiscord | <nnsee> function reads just like https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce |
08:44:53 | FromDiscord | <odexine> it isnt |
08:45:02 | FromDiscord | <odexine> it doesnt accumulate |
08:45:36 | FromDiscord | <nnsee> reduce doesn't either |
08:45:40 | FromDiscord | <odexine> it reads more like zip(arr[0..^2], arr[1..^1]).map() to me, except the first element is weird and its first&first |
08:46:55 | FromDiscord | <odexine> In reply to @nnsee "reduce doesn't either": reduce is `ret = fun(ret, elem)`, this is `elem = fun(prev, elem); prev = elem` |
08:46:56 | FromDiscord | <nnsee> sent a long message, see http://ix.io/4AyN |
08:47:21 | FromDiscord | <JJ> reduce seems equivalent to fold |
08:47:25 | FromDiscord | <odexine> reduce is fold |
08:47:41 | FromDiscord | <JJ> > The final result of running the reducer across all elements of the array is a single value.↵mine is mutating a `var seq[int]` |
08:47:48 | FromDiscord | <odexine> again, i think it is zip and map |
08:47:59 | FromDiscord | <nnsee> oh, I see now, right |
08:48:11 | FromDiscord | <odexine> but i dont know why you want first run to be (first, first) |
08:48:54 | FromDiscord | <JJ> i don't think zip and map can work because `prev` is the output of the previous calculation not just the previous value |
08:49:13 | FromDiscord | <odexine> ig it would be (naively) `zip(arr[0] & arr, arr).map(...)` |
08:49:18 | FromDiscord | <odexine> oh is it |
08:49:25 | FromDiscord | <odexine> okay wait i remember what the name is for that |
08:49:47 | FromDiscord | <jmgomez> The best way to know the "funtional name" is to dont mutate it and to put the signature here: https://hackage.haskell.org/packages/browse↵I found stuff like `sequence` like that |
08:50:19 | FromDiscord | <odexine> its called scanl in haskell |
08:50:25 | FromDiscord | <odexine> https://hackage.haskell.org/package/base-4.18.0.0/docs/Prelude.html#v:scanl |
08:50:27 | FromDiscord | <odexine> but |
08:50:31 | FromDiscord | <odexine> no equiv in nim |
08:50:40 | FromDiscord | <JJ> hmm interesting |
08:50:48 | FromDiscord | <JJ> i suppose it is not too widely useful |
08:50:56 | FromDiscord | <odexine> lol |
08:51:59 | FromDiscord | <JJ> well might pr it to sequtils then 😛 |
08:52:20 | FromDiscord | <odexine> eh |
08:52:31 | FromDiscord | <odexine> i mean sure ig |
08:52:50 | FromDiscord | <Elegantbeef> Firstly you should use `openarray[T]` |
08:52:59 | FromDiscord | <odexine> personally think sequtils should die and a replacement that can compose should be made, maybe i should bring Control.Arrow to nim LMFAO |
08:53:11 | FromDiscord | <JJ> yeah sequtils does suck hard |
08:53:21 | FromDiscord | <JJ> beef you had a magic replacement right? |
08:53:23 | FromDiscord | <nnsee> i like sequtils |
08:53:28 | FromDiscord | <jmgomez> My opinion on it is that it should use concepts |
08:53:32 | FromDiscord | <Elegantbeef> Secondly why are you using two generic parameters |
08:53:33 | FromDiscord | <Elegantbeef> "magic replacement" |
08:53:39 | FromDiscord | <odexine> i sure wish concepts worked better tho |
08:53:43 | FromDiscord | <Elegantbeef> concepts do not work to solve the issues it has |
08:53:59 | FromDiscord | <JJ> In reply to @nnsee "i like sequtils": it's not lazy though, chaining multiple functions will iterate through the whole seq again when you don't need to |
08:53:59 | FromDiscord | <jmgomez> what issue? |
08:54:09 | FromDiscord | <JJ> laziness yea |
08:54:15 | FromDiscord | <Elegantbeef> Allocations |
08:54:16 | FromDiscord | <jmgomez> I mean the std in general anyways |
08:54:26 | FromDiscord | <Elegantbeef> https://github.com/beef331/slicerator/blob/itermacros/tests/titermacros.nim JJ |
08:54:30 | FromDiscord | <JJ> rust does it with types and a collect but that's a little gross |
08:54:33 | FromDiscord | <Elegantbeef> Zoom did some nice work |
08:54:43 | FromDiscord | <jmgomez> ahh yeah, this was more of a general thought |
08:54:48 | FromDiscord | <Elegantbeef> Oh sure the stdlib should use concepts |
08:55:02 | FromDiscord | <Elegantbeef> sequtils needs to do what slicerator's itermacros branch has |
08:55:12 | FromDiscord | <Elegantbeef> But that makes it no longer sequtils 😄 |
08:55:14 | FromDiscord | <JJ> In reply to @Elegantbeef "Oh sure the stdlib": oh yea absolutely |
08:55:29 | FromDiscord | <JJ> that'd be totally sick if it happened (with v2 concepts) |
08:55:30 | FromDiscord | <ambient3332> My Nim FFT is only 10x slower than state of the art. Maybe it's time to do some other things |
08:55:40 | FromDiscord | <nnsee> In reply to @Elegantbeef "https://github.com/beef331/slicerator/blob/itermacr": neat |
08:55:44 | FromDiscord | <Elegantbeef> 10x slower is unacceptable |
08:56:11 | FromDiscord | <Elegantbeef> Worth noting with that itermacros module it only allocates a sequence where it calls `collect` |
08:56:16 | FromDiscord | <Elegantbeef> otherwise it's just an iterator |
08:56:26 | FromDiscord | <Elegantbeef> So chaining is quite literally 0 cost |
08:57:05 | FromDiscord | <ambient3332> You're welcome to make it faster https://pastebin.com/0ib7Hga6 |
08:57:18 | FromDiscord | <JJ> the stdlib using concepts is on my shortlist of viable-changes-with-major-improvements |
08:57:50 | FromDiscord | <JJ> unfortunately i also have an inviable shortlist |
08:58:12 | FromDiscord | <Elegantbeef> Concepts are still experimental so uhh yea |
08:59:16 | FromDiscord | <odexine> make them not experimental, duh, ex |
08:59:17 | FromDiscord | <odexine> (edit) "ex" => "ez" |
08:59:23 | FromDiscord | <odexine> such a simple solution smh |
08:59:38 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4AyR |
08:59:59 | FromDiscord | <Elegantbeef> atleast the second two can be |
09:01:07 | FromDiscord | <Elegantbeef> Eh maybe it's not worth it |
09:01:17 | FromDiscord | <Elegantbeef> Thought one could get more math out but it seems like it's the same amount of math |
09:02:12 | FromDiscord | <ambient3332> The biggest gains will probably be on algorithm level and cache locality |
09:02:32 | FromDiscord | <JJ> In reply to @omentic "the stdlib using concepts": viable shortlist is concepts in the stdlib, sum types & pattern matching, arbitrary recursive type/function lookup (declaration order not mattering) |
09:02:37 | FromDiscord | <Elegantbeef> Right but eliminating any amount of work from commonly looped code will be beneficial 😄 |
09:02:38 | FromDiscord | <ambient3332> Also usin sincos instead of separate would give a noticiable boost |
09:02:55 | FromDiscord | <JJ> In reply to @omentic "unfortunately i also have": inviable shortlist is swift-style error handling (stdlib uses Options/Results universally & you can unwrap them into try/catchable errors with `!`), no first-class iterators and instead an Iterable concept/interface that just defines a `next()` func, `pub` instead of `` for the export marker |
09:03:10 | FromDiscord | <JJ> beef you'd find swift error handling reasonable i think |
09:03:17 | FromDiscord | <Elegantbeef> Nope |
09:03:20 | FromDiscord | <JJ> options when you want them, try/catches when you don't |
09:03:25 | FromDiscord | <JJ> oh really |
09:03:40 | FromDiscord | <Elegantbeef> I do not like the pollution of the return type with errors really |
09:04:00 | FromDiscord | <JJ> when writing func? or when using funcs? |
09:04:03 | FromDiscord | <Elegantbeef> Arne says I dislike handling errors, but I just dislike handling errors when I'm writing one offs |
09:04:07 | FromDiscord | <Elegantbeef> When using |
09:04:16 | FromDiscord | <JJ> ah see but that's what swift makes nice |
09:04:27 | FromDiscord | <jmgomez> I do like them but inference in Nim will no make a nice UX for it |
09:04:51 | FromDiscord | <jmgomez> so first it has to be improved if it is even possible to do so |
09:05:07 | FromDiscord | <JJ> you just call the function name with `!` and it treats it like it throws errors |
09:05:17 | FromDiscord | <Elegantbeef> Lol |
09:05:33 | FromDiscord | <Elegantbeef> That's not a solution in Rust, it's not a solution in Swift |
09:05:55 | FromDiscord | <ambient3332> @elegantbeef https://media.discordapp.net/attachments/371759389889003532/1129337969166258236/Profiler_lwJ7MjpVeS.png |
09:06:00 | FromDiscord | <Elegantbeef> Atleast in Swift it doesnt pollute the type since it just says throws x |
09:09:34 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4AyU |
09:10:33 | FromDiscord | <JJ> result types might still pollute the function return type if only in declaration but it functions as you like it when used with `!` |
09:11:05 | FromDiscord | <Elegantbeef> Yes I know how it works |
09:11:05 | FromDiscord | <Elegantbeef> It's the same as rust |
09:12:15 | FromDiscord | <JJ> rust doesn't have try/catch i believe, and `unwrap()` directly panics instead of throwing a catchable error |
09:12:27 | FromDiscord | <Elegantbeef> Sure, same semantics though |
09:12:34 | FromDiscord | <JJ> what do you not like about it? |
09:12:40 | FromDiscord | <Elegantbeef> `!` allows you disregard the error |
09:12:53 | FromDiscord | <Elegantbeef> I want to just write code 😄 |
09:13:16 | FromDiscord | <JJ> yea you'd just have to put `!` everywhere i suppose |
09:13:55 | FromDiscord | <Elegantbeef> If you have results or error tuples like odin/go you force the handling of errors which nice I guess |
09:14:02 | FromDiscord | <JJ> but it's super minimal syntax overhead, and in exchange you can write safe code without loads of try/catches if you'd like |
09:14:11 | FromDiscord | <Elegantbeef> Sure |
09:14:14 | FromDiscord | <JJ> yeah rust really sold me on the handle-everything paradigm |
09:14:28 | FromDiscord | <Elegantbeef> I don't really like the handle everything paradigm |
09:14:56 | FromDiscord | <JJ> there's definitely two camps |
09:15:15 | FromDiscord | <JJ> and each camp "pollutes" the other if they have control of the stdlib |
09:16:03 | FromDiscord | <JJ> i haven't found a minimal syntax for going from the object-oriented throws-errors approach to a functional result-types approach however |
09:16:13 | FromDiscord | <JJ> vs. `!` is pretty minimal the other way around |
09:17:09 | FromDiscord | <JJ> anyways i'm going to play around with questionable at some point to make it work like that, see if the ergonomics are actually good |
09:17:35 | FromDiscord | <JJ> since i don't write much swift (fortunately? unfortunately?) |
09:18:34 | FromDiscord | <deeuu> Hey,↵Isn't Nim's `.raises` a fair compromise, though? i.e. force error handling where needed (and when not writing one-offs)? |
09:19:25 | FromDiscord | <deeuu> (lurking, so thought I'd chip in 😉 |
09:20:57 | FromDiscord | <JJ> imo error handling is 100% about the syntax |
09:21:10 | FromDiscord | <JJ> and raises is pretty verbose |
09:22:03 | FromDiscord | <JJ> java's checked exceptions scared a generation of programmers out of safe error handling despite being pretty good technically |
09:22:54 | FromDiscord | <JJ> oh i totally misunderstood you! nvm |
09:23:22 | FromDiscord | <odexine> {.raises: .} is what they meant |
09:23:29 | FromDiscord | <deeuu> Yeah that's what I meant, thanks |
09:24:00 | FromDiscord | <Elegantbeef> The magic part of Nim's effect system that makes it as good as options for everything but performance |
09:24:08 | NimEventer | New Nimble package! skinsuit - utility macros mostly for object variants, see https://github.com/metagn/skinsuit |
09:24:16 | FromDiscord | <Elegantbeef> Bad path is still slower than the bad path of results |
09:24:40 | FromDiscord | <JJ> you mean treat the `.raises.` that the compiler infers as an implicit `Result` type? yeah that'd be interesting, hmm. would you then have similar functional helper methods for quickly handling errors like in std/options etc? |
09:24:59 | FromDiscord | <Elegantbeef> Fuck every time I write a library related to sumtypes someone does something better |
09:25:47 | FromDiscord | <JJ> ooh looks like metagn's been working on that huh |
09:25:59 | FromDiscord | <JJ> i gotta pick up the pace 😅 |
09:26:02 | FromDiscord | <jmgomez> Was checking it, it looks nice. Is metagn a core dev? He does a lot of work |
09:26:09 | FromDiscord | <Elegantbeef> Nope |
09:26:11 | FromDiscord | <odexine> is treeform a core dev? |
09:26:14 | FromDiscord | <odexine> :baqua: |
09:26:16 | FromDiscord | <odexine> i kid |
09:26:23 | FromDiscord | <jmgomez> I mean, treeform doenst work in the compiler, does he? |
09:26:24 | FromDiscord | <Elegantbeef> Metagn does a lot of compiler stuffs |
09:26:52 | FromDiscord | <odexine> "does a lot of work" sounded kinda ambiguous |
09:27:31 | FromDiscord | <jmgomez> Well the context of core dev disambiguates it 😛 |
09:28:10 | FromDiscord | <odexine> we be malicious in interpretation sometimes |
09:30:05 | FromDiscord | <jmgomez> just checked the guy has 236 PRs, and not stuff like changing a typo in the manual precisely |
09:31:52 | FromDiscord | <Asbjørn> sent a long message, see http://ix.io/4AyY |
09:32:34 | FromDiscord | <Elegantbeef> Well they want advice from experience Nim devs so that's my signal to go to sleep |
09:34:58 | FromDiscord | <ringabout> In reply to @jmgomez "Was checking it, it": Well, I suppose everyone who has contributed to the Nim compiler dozen times is/was a core dev. Since Nim doesn't have a foundation or something, it's vague in core dev's sense, |
09:37:58 | FromDiscord | <jmgomez> In reply to @ringabout "Well, I suppose everyone": Maybe a professional Nim compiler developer is a better term then? 😛 I just meant if he was getting paid for working on it |
09:39:18 | FromDiscord | <ringabout> Yeah, could have. You can check the opencollective page of Nim. |
09:39:55 | FromDiscord | <ringabout> I think set up a page like https://crystal-lang.org/team/ should clarify the core team better. |
09:40:29 | FromDiscord | <ringabout> (edit) "set" => "setting" |
09:48:00 | * | ntat quit (Ping timeout: 272 seconds) |
09:55:03 | FromDiscord | <odexine> in seriousness what does it mean to be a core dev? |
09:55:36 | FromDiscord | <ambient3332> you dev the core |
10:31:43 | FromDiscord | <megagn> In reply to @jmgomez "Was checking it, it": nothing official, i've mostly been contributing just because i want the language to work for myself and i've been using the language heavily since like 2016. i got paid recently out of generosity but i can't guarantee consistently working on the language |
10:36:02 | FromDiscord | <megagn> i also have triage role on the main repo now but no responsibilities |
11:23:44 | FromDiscord | <gogolxdong666> Which is the better way to replace shallowCopy for orc/arc, direct assignment or system.move? |
11:44:43 | * | fallback quit (Ping timeout: 246 seconds) |
11:59:24 | FromDiscord | <punchcake> is nim sutiable for writing compilers? |
12:03:05 | FromDiscord | <demotomohiro> I think so because Nim is written in Nim. |
12:03:28 | FromDiscord | <punchcake> if nim is written in nim then what was nim written in before nim was written in nim |
12:04:00 | FromDiscord | <demotomohiro> I heard Nim was written in pascal before. |
12:04:40 | FromDiscord | <punchcake> i want to make my own language llvm frontend |
12:08:25 | PMunch | Nim is definitely suited to write compilers in |
12:09:07 | PMunch | As demotomohiro said, once an early version of Nim was built in Pascal it was ported to Nim and then compiled with Nim since then |
12:10:18 | FromDiscord | <punchcake> i see |
12:10:37 | FromDiscord | <punchcake> im really confused if i should make an llvm frontend or just target .net CLR |
12:13:34 | FromDiscord | <eliot> does nim have a suitable web scraping library? |
12:14:05 | PMunch | punchcake, why in the name of all that is good and pure would you want to target the .net CLR? |
12:14:19 | PMunch | Oh sorry, I forgot we said no kink shaming earlier |
12:14:23 | FromDiscord | <punchcake> In reply to @PMunch "<@655759729477287956>, why in the": .net jit is amazingly fast |
12:14:47 | PMunch | So is LLVM compiled binaries.. |
12:14:53 | FromDiscord | <punchcake> and i can use existing ecosystem |
12:15:01 | PMunch | Ditto for LLVM |
12:15:10 | PMunch | LLVM is the reason Zig has such great C interop |
12:15:20 | FromDiscord | <punchcake> hmmm |
12:16:04 | FromDiscord | <punchcake> i mean the goal is to be fast with a garbage collector |
12:16:13 | FromDiscord | <punchcake> sorta like C++ without its mess and with a gc |
12:16:19 | PMunch | And besides, the .net ecosystem is the .net ecosystem. It's like saying you got a good deal at an all you could eat buffet, but the dishes are all rocks and cow patties. Sure you get as much as you want, but you wouldn't really want any of it.. |
12:16:39 | PMunch | punchcake, have you heard of a little language called Nim? |
12:16:49 | FromDiscord | <punchcake> no |
12:16:56 | PMunch | Sounds like it would suit your goals :P |
12:17:02 | FromDiscord | <punchcake> nim does have classes |
12:17:03 | FromDiscord | <punchcake> sadly |
12:17:11 | FromDiscord | <punchcake> how am i supposed to abuse inheratince |
12:17:12 | PMunch | No it doesn't? |
12:17:22 | FromDiscord | <punchcake> (edit) "does" => "doesnt" |
12:17:23 | FromDiscord | <punchcake> typo |
12:17:30 | PMunch | Ah :P |
12:17:44 | FromDiscord | <punchcake> pmuch ever considered making a PL? |
12:17:51 | FromDiscord | <punchcake> (edit) "pmuch" => "pmunch" |
12:17:53 | PMunch | Well, I kinda have already :P |
12:17:58 | FromDiscord | <punchcake> what is it |
12:18:00 | FromDiscord | <punchcake> nim++ |
12:18:03 | FromDiscord | <punchcake> nim with classes |
12:18:05 | PMunch | https://github.com/PMunch/stacklang |
12:18:11 | PMunch | Nah, more like RPN++ |
12:18:53 | FromDiscord | <jmgomez> can I ask what do you understand for having classes? |
12:19:00 | FromDiscord | <punchcake> imagine making a PL compiling to nim that compiles to C |
12:19:02 | FromDiscord | <craciu25_YT> how can I use `hashlib`? I have looked and theres no docs and in the read me just says things that I don't know what they even mean. I just want to encode a string into a sha256 hash. How can I do that? |
12:19:07 | FromDiscord | <punchcake> the compile times gonna go craaazy |
12:19:31 | FromDiscord | <punchcake> In reply to @jmgomez "can I ask what": wdym |
12:19:37 | FromDiscord | <punchcake> i like classes bc inheratince |
12:19:47 | FromDiscord | <punchcake> one time i wrote a game using 60% inheratince |
12:19:53 | FromDiscord | <jmgomez> you said Nim doesnt have classes |
12:19:56 | FromDiscord | <punchcake> yes |
12:20:01 | FromDiscord | <jmgomez> well, nim actually has multiple inheritance |
12:20:06 | FromDiscord | <punchcake> huh |
12:20:07 | FromDiscord | <punchcake> where |
12:20:07 | PMunch | Of course in my language you end up with abominations such as `100 200 < if else gofwd if smaller -1 print end gofwd else larger -1 print end gofwd end` |
12:20:38 | FromDiscord | <jmgomez> you target the cpp backend and you use virtual |
12:21:06 | FromDiscord | <punchcake> In reply to @PMunch "Of course in my": is it interpreted |
12:21:07 | FromDiscord | <jmgomez> https://nim-lang.github.io/Nim/manual_experimental.html#virtual-pragma |
12:21:14 | FromDiscord | <jmgomez> (only devel though) |
12:21:27 | FromDiscord | <punchcake> no thanks looks like a mess |
12:22:01 | PMunch | I actually have a Stacklang v2 which is what I use personally. But it should be cleaned up into a v3 before I publish it. Also wrote an application called stacksheet which is a small excel-ish thing in your terminal with stacklang instead of Excel macros |
12:22:06 | FromDiscord | <jmgomez> lol, it's better to write a programming lang |
12:22:21 | PMunch | Yeah my language is interpreted |
12:22:57 | PMunch | I did write a VM at some point though, which runs bytecode. I'm just missing a step of actually writing a compiler for a language :P |
12:23:08 | FromDiscord | <demotomohiro> Example Nim code that uses inheritance from Nim manual:↵https://nim-lang.org/docs/manual.html#types-tuples-and-object-types |
12:24:01 | FromDiscord | <punchcake> tbh if im gonna write a PL i gotta solve a problem |
12:24:06 | * | fallback joined #nim |
12:24:17 | FromDiscord | <punchcake> i really want to write a PL dedicated to soley making gui apps |
12:24:20 | FromDiscord | <punchcake> run everywhere |
12:24:22 | PMunch | You also have: https://github.com/jjv360/nim-classes |
12:24:30 | PMunch | Not sure if it has multi-inheritance though |
12:25:13 | FromDiscord | <Chronos [She/Her]> Can't multi-inheritance be avoided by just adding the objects as fields in the new object? |
12:25:20 | FromDiscord | <Chronos [She/Her]> Then can write some proxy thing |
12:25:32 | FromDiscord | <punchcake> In reply to @PMunch "You also have: https://github.com/jjv360/nim-classe": oh its just macros |
12:25:39 | PMunch | Well, the entire concept of inheritance can be avoided that way :P |
12:25:41 | FromDiscord | <punchcake> yeah nim macros are so good they map to ast |
12:25:52 | PMunch | punchcake, of course, it's macros all the way down |
12:25:59 | FromDiscord | <punchcake> idk if i really should use it |
12:26:19 | FromDiscord | <punchcake> some update might break things |
12:26:26 | PMunch | That's true for all code |
12:26:34 | PMunch | And you could also just lock your version |
12:26:46 | PMunch | Seems to be fairly well maintained though |
12:26:48 | FromDiscord | <jmgomez> yeah sure, just roll your own programming lang. So it doest break |
12:26:55 | FromDiscord | <punchcake> FUCK IT |
12:26:59 | FromDiscord | <punchcake> im gonna use it |
12:27:03 | FromDiscord | <punchcake> thanks pmunch |
12:27:12 | FromDiscord | <punchcake> he carrying the whole nim community with his bindings frfr |
12:27:27 | PMunch | Sure, no problem :P That's not my library by the way |
12:27:41 | FromDiscord | <punchcake> yes i know |
12:27:45 | PMunch | And as I said, not sure if it supports multi-inheritance |
12:27:58 | FromDiscord | <punchcake> multi-inheritance is a bad idea |
12:28:10 | FromDiscord | <punchcake> im convinced if you use multi-inheritance your code is flawed |
12:28:21 | FromDiscord | <jmgomez> one could say the same about single inheritance |
12:28:25 | FromDiscord | <jmgomez> 😛 |
12:28:26 | FromDiscord | <punchcake> not really |
12:28:39 | FromDiscord | <punchcake> single inheritance is a 1:1 dependancy |
12:28:46 | FromDiscord | <punchcake> multi inheratince is 1:n |
12:28:56 | FromDiscord | <jmgomez> how that makes a difference? |
12:29:03 | FromDiscord | <punchcake> you tell me |
12:29:10 | PMunch | If you want to make a game you could also look at pararules/paranim or polymorph |
12:29:12 | FromDiscord | <punchcake> if you inherit from 3 classes good luck maintaining it |
12:29:35 | PMunch | jmgomez, very good point |
12:30:31 | FromDiscord | <Chronos [She/Her]> In reply to @punchcake "if you inherit from": Better to use components imo |
12:30:51 | FromDiscord | <Chronos [She/Her]> That way you can avoid inheritance all together |
12:31:33 | FromDiscord | <punchcake> ehh |
12:31:36 | FromDiscord | <punchcake> idk |
12:31:50 | FromDiscord | <punchcake> in games i just use a player class and make every npc inherit from it |
12:31:56 | FromDiscord | <Chronos [She/Her]> `Player`? Nah, `Entity(components: @[Controllable]` 😎 |
12:32:07 | FromDiscord | <punchcake> and chronos wtf is you wpm |
12:32:18 | FromDiscord | <punchcake> i didnt even send my message and you replied close to instantly |
12:32:24 | FromDiscord | <punchcake> xd |
12:32:38 | FromDiscord | <Chronos [She/Her]> NPCs inheriting from Players? That seems so backwards |
12:32:57 | FromDiscord | <Chronos [She/Her]> In reply to @punchcake "and chronos wtf is": No idea, I'm on my phone rn and use autocomplete a lot xD |
12:33:06 | FromDiscord | <punchcake> In reply to @yu.vitaqua.fer.chronos "NPCs inheriting from Players?": yeah |
12:33:11 | FromDiscord | <punchcake> they all have everything in common |
12:33:19 | FromDiscord | <punchcake> you need to give and take damage and heal |
12:33:27 | PMunch | But you control the player? |
12:33:32 | FromDiscord | <punchcake> you need to have an inventory for weapons |
12:33:46 | FromDiscord | <punchcake> In reply to @PMunch "But you control the": yes |
12:34:10 | FromDiscord | <Chronos [She/Her]> This is why I'd use components in a game, logic is clearly separated |
12:34:35 | PMunch | And still, with components that would mean `Entity(components: @[Health, Inventory, Attack])` or something |
12:34:45 | FromDiscord | <Chronos [She/Her]> Exactly |
12:34:59 | PMunch | Then you could have a chest which just has the `Inventory` system but without the others |
12:35:18 | PMunch | Or a door with the `Health` system so you can break it |
12:35:56 | FromDiscord | <punchcake> idk |
12:36:00 | FromDiscord | <punchcake> aye man if it works it works |
12:36:30 | PMunch | Of course, but you could also write something in Nim without classes. That works as well |
12:36:54 | FromDiscord | <punchcake> i have to learn the nim way |
12:37:01 | FromDiscord | <punchcake> which is what i dont want |
12:37:14 | PMunch | I really want to play with ECS, if only there where more hours in a day.. |
12:37:28 | PMunch | punchcake, why don't you want to learn Nim? |
12:37:38 | PMunch | I think you've gotten lost in the wrong channel :P |
12:37:42 | FromDiscord | <punchcake> because im tired of learning PL's |
12:37:59 | FromDiscord | <punchcake> i wanna hop in start programming and get out |
12:38:14 | PMunch | I can recommend Nim for that |
12:38:20 | FromDiscord | <punchcake> like go, i never really learnt go i just raw dog everything and learn as i go |
12:38:21 | PMunch | It really is the last language I properly learned |
12:39:05 | PMunch | Nim is pretty simple to learn if you know a bit of programming already |
12:39:49 | FromDiscord | <punchcake> i guess so |
12:40:12 | FromDiscord | <punchcake> i want to make a server that does video streaming but idk if i should do it in nim or go |
12:40:18 | FromDiscord | <punchcake> it has to be very concurrent |
12:42:40 | PMunch | Well concurrency is pretty much what Go was written for |
12:43:00 | FromDiscord | <punchcake> yes |
12:43:12 | FromDiscord | <punchcake> nim is more performant though |
12:43:24 | FromDiscord | <punchcake> which shouldnt matter anyways since its 100% io bound |
12:56:36 | * | disso-peach joined #nim |
13:14:25 | FromDiscord | <catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4AzD |
13:18:17 | * | sagax quit (Ping timeout: 245 seconds) |
13:27:24 | FromDiscord | <bung8954> when I wraps windows com interface does the functions order matters? |
13:38:27 | * | ntat joined #nim |
13:43:18 | FromDiscord | <punchcake> `var obj: seq[int] = seq[int]` |
13:43:23 | FromDiscord | <punchcake> why is this invalid bruh? |
13:44:33 | FromDiscord | <odexine> that makes no sense? |
13:44:42 | FromDiscord | <odexine> its invalid because thats not how that's done |
13:46:12 | FromDiscord | <punchcake> In reply to @odexine "its invalid because thats": how is it done |
13:47:08 | FromDiscord | <odexine> `var obj: seq[int]` |
13:47:13 | FromDiscord | <odexine> what are you trying to do |
13:47:25 | FromDiscord | <punchcake> make a seq clearly |
13:48:02 | FromDiscord | <odexine> no shit, what characteristics do you want this seq to have |
13:48:08 | FromDiscord | <catnowblue> In reply to @punchcake "why is this invalid": you were suppose to create an object, but you used value as type which isn't valid |
13:48:09 | FromDiscord | <k0ts> `var obj: int = int` also doesn't work, I should probably read the tutorial one of these days |
13:48:11 | FromDiscord | <odexine> length? what elements? |
13:48:14 | FromDiscord | <punchcake> In reply to @odexine "no shit, what characteristics": just a seq of int |
13:48:21 | FromDiscord | <punchcake> isnt a sequince a vector |
13:48:23 | FromDiscord | <odexine> (edit) "elements?" => "elements values?" |
13:48:30 | FromDiscord | <punchcake> In reply to @catnowblue "you were suppose to": OH LMAO |
13:48:34 | FromDiscord | <punchcake> i forgot |
13:48:37 | FromDiscord | <odexine> it is variable length yes |
13:48:49 | FromDiscord | <catnowblue> leave it as empty or put `@[]` into it |
13:49:05 | FromDiscord | <odexine> In reply to @odexine "`var obj: seq[int]`": you can just not do that as well, as i wrote |
13:49:10 | FromDiscord | <odexine> it is empty by default |
13:49:35 | FromDiscord | <punchcake> sent a code paste, see https://play.nim-lang.org/#ix=4AzL |
13:50:03 | * | hmht joined #nim |
13:50:14 | FromDiscord | <odexine> depends on what you need? |
13:50:21 | FromDiscord | <odexine> do you need it empty or with initial values |
13:50:34 | FromDiscord | <punchcake> In reply to @odexine "do you need it": empty |
13:51:00 | FromDiscord | <odexine> second then |
13:51:28 | FromDiscord | <odexine> first one you cant do if you want it empty, `var obj = newSeq[int]()` would be the equivalent, and at that point why not do the second |
13:52:14 | FromDiscord | <punchcake> i think the second one is better |
13:53:15 | FromDiscord | <punchcake> how do i even accept a seq as a ptr for a proc? |
13:53:29 | FromDiscord | <odexine> wdym? |
13:54:05 | FromDiscord | <punchcake> instead of copying a seq how do i accept it as a ptr? |
13:55:11 | FromDiscord | <odexine> do you want to delve into "unsafe" territory or do you want to do it safely? |
13:55:17 | FromDiscord | <punchcake> safley |
13:55:23 | FromDiscord | <punchcake> (edit) "safley" => "safely" |
13:56:39 | FromDiscord | <punchcake> sent a code paste, see https://play.nim-lang.org/#ix=4AzR |
13:56:40 | FromDiscord | <odexine> do you want to mutate the list? or do you just want to avoid copying? |
13:56:48 | FromDiscord | <punchcake> it takes a refrence to a vector and i can modify it there |
13:56:58 | FromDiscord | <punchcake> In reply to @odexine "do you want to": i want to do both |
13:57:34 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4AzT |
13:57:45 | FromDiscord | <odexine> make the type "var ..." |
13:57:51 | FromDiscord | <punchcake> In reply to @odexine "if you just want": this wont modify it? |
13:58:00 | FromDiscord | <punchcake> bc i dont want to copy a 100k element seq |
13:58:20 | FromDiscord | <odexine> what? |
13:58:31 | FromDiscord | <punchcake> i dont want to copy the sequance |
13:58:37 | FromDiscord | <punchcake> (edit) "modify" => "~~modify ~~ copy" |
13:58:40 | FromDiscord | <odexine> oh |
13:58:44 | FromDiscord | <punchcake> im sorry im just tired as fuck |
13:58:45 | FromDiscord | <odexine> yes it wont copy |
13:59:02 | FromDiscord | <punchcake> isnt there a `ptr` keyword? |
13:59:04 | FromDiscord | <odexine> it's equivalent to passing a pointer but nim typechecks it |
13:59:06 | FromDiscord | <odexine> yes |
13:59:08 | FromDiscord | <odexine> but that is unsafe |
13:59:35 | FromDiscord | <punchcake> unsafe in what sense |
13:59:38 | FromDiscord | <punchcake> does it generate UB? |
14:00:55 | FromDiscord | <odexine> unsafe as in the compiler will not do any checks for whether it will cause whatever problems like segfaults or whatever |
14:01:07 | FromDiscord | <odexine> youll have to put those checks in yourseklf |
14:01:09 | FromDiscord | <odexine> (edit) "yourseklf" => "yourself" |
14:01:30 | FromDiscord | <punchcake> ah so i can end up derefrencing something null? |
14:02:21 | FromDiscord | <odexine> yes |
14:03:48 | FromDiscord | <punchcake> In reply to @odexine "yes": thanks rika |
14:05:50 | FromDiscord | <punchcake> then wait when should i ever use `ptr` instead of `var`? |
14:08:02 | FromDiscord | <odexine> C interop |
14:08:08 | FromDiscord | <odexine> pretty much |
14:08:13 | FromDiscord | <punchcake> xd |
14:08:22 | FromDiscord | <odexine> or if you need more control on how nim manages memory |
14:08:26 | FromDiscord | <odexine> sometimes you want to go manual |
14:08:34 | FromDiscord | <punchcake> but wont ptr severly fuck up the GC |
14:08:35 | FromDiscord | <odexine> but that comes with responsibilities, naturally |
14:08:38 | FromDiscord | <odexine> no |
14:08:42 | FromDiscord | <odexine> ptr doesnt interact with the GC |
14:08:50 | FromDiscord | <punchcake> i see |
14:08:53 | FromDiscord | <odexine> making pointers "normally" will not crash the GC |
14:09:01 | FromDiscord | <punchcake> idk tbh |
14:09:06 | FromDiscord | <odexine> basically dont make a pointer by casting refs and stuff |
14:09:10 | FromDiscord | <punchcake> pointers tend to fuck up gcs pretty bad |
14:09:24 | FromDiscord | <odexine> only if you do stuff wrong lol |
14:09:31 | FromDiscord | <punchcake> not rlly |
14:09:40 | FromDiscord | <punchcake> its one of the reasons why every C gc failed |
14:09:46 | FromDiscord | <odexine> you can use ptr without breaking the GC, just have to be careful about it |
14:09:59 | FromDiscord | <odexine> In reply to @punchcake "its one of the": that has a different reason, i think |
14:10:04 | FromDiscord | <punchcake> nah |
14:10:14 | FromDiscord | <punchcake> its purely because of pointers |
14:10:27 | FromDiscord | <punchcake> even bohem is pretty bad |
14:13:08 | * | PMunch quit (Quit: Leaving) |
14:20:18 | FromDiscord | <catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4AA4 |
14:20:36 | FromDiscord | <catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4AA5 |
14:20:39 | FromDiscord | <catnowblue> I just don't understand |
14:25:38 | FromDiscord | <punchcake> sent a code paste, see https://play.nim-lang.org/#ix=4AA6 |
14:25:43 | FromDiscord | <punchcake> just wrap the `let json = rawJson.parseJson()` |
14:28:22 | FromDiscord | <catnowblue> yea but that variable would be inaccessible outside of try/except |
14:28:24 | FromDiscord | <catnowblue> @punchcake |
14:28:43 | FromDiscord | <punchcake> it would be? |
14:28:44 | FromDiscord | <punchcake> him |
14:28:46 | FromDiscord | <catnowblue> yes |
14:29:11 | FromDiscord | <catnowblue> except I got very confusing error which may suggest that the variable is not defined |
14:29:32 | FromDiscord | <catnowblue> nim really needs to ditch confusing error |
14:29:48 | FromDiscord | <punchcake> are you even sure that websocket is giving to you valid json? |
14:29:51 | FromDiscord | <catnowblue> it is |
14:29:59 | FromDiscord | <catnowblue> I even give the API's format to json |
14:29:59 | FromDiscord | <punchcake> log it to the console |
14:30:01 | FromDiscord | <catnowblue> everything works |
14:30:11 | FromDiscord | <catnowblue> In reply to @punchcake "log it to the": I did, it prints valid json just fine |
14:30:28 | FromDiscord | <punchcake> im not sure |
14:30:32 | FromDiscord | <punchcake> im a noob nim programmer |
14:30:42 | FromDiscord | <catnowblue> me neither |
14:30:49 | FromDiscord | <punchcake> can you post full code? |
14:31:06 | FromDiscord | <catnowblue> there's also other file modules, so that would be big |
14:31:16 | FromDiscord | <punchcake> hmm |
14:31:45 | FromDiscord | <punchcake> can you give me the sample json i wanna test it on my machine |
14:33:06 | FromDiscord | <catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4AA8 |
14:33:19 | FromDiscord | <catnowblue> In reply to @punchcake "can you give me": you need to have revolt account to do so |
14:33:32 | FromDiscord | <catnowblue> then put your token into there |
14:33:43 | FromDiscord | <punchcake> idk tbh |
14:33:46 | FromDiscord | <punchcake> this looks complicated |
14:33:58 | FromDiscord | <catnowblue> that's what it's supposed to be |
14:34:17 | FromDiscord | <catnowblue> I wish nim has helpful error like what Rust did |
14:34:52 | FromDiscord | <catnowblue> it's just... too much confusing that not even chatgpt or third party libraries will fix it |
14:34:58 | FromDiscord | <punchcake> wait bruh |
14:35:40 | FromDiscord | <punchcake> check my comment |
14:35:42 | FromDiscord | <punchcake> sent a code paste, see https://play.nim-lang.org/#ix=4AA9 |
14:36:00 | FromDiscord | <punchcake> (edit) "https://play.nim-lang.org/#ix=4AA9" => "https://play.nim-lang.org/#ix=4AAa" |
14:36:25 | FromDiscord | <catnowblue> that's websocket, it needs to create new websocket |
14:36:39 | FromDiscord | <catnowblue> and fromhandleWebSocket as you can see at the top |
14:36:45 | FromDiscord | <catnowblue> (edit) "fromhandleWebSocket" => "from handleWebSocket" |
14:36:53 | FromDiscord | <punchcake> you never called the handleWebSocket proc bro |
14:36:59 | FromDiscord | <catnowblue> ???????????????? |
14:37:02 | FromDiscord | <catnowblue> I did |
14:37:04 | FromDiscord | <punchcake> im confused |
14:37:05 | FromDiscord | <punchcake> where? |
14:37:36 | FromDiscord | <catnowblue> https://media.discordapp.net/attachments/371759389889003532/1129421440463155381/image.png |
14:37:43 | FromDiscord | <punchcake> your calling handleWebSocket with no function args |
14:37:44 | FromDiscord | <catnowblue> you didn't see the top don't you? |
14:37:45 | FromDiscord | <punchcake> (edit) "function" => "proc" |
14:37:52 | FromDiscord | <catnowblue> In reply to @punchcake "your calling handleWebSocket with": .... |
14:38:41 | FromDiscord | <punchcake> thE PROC ARGS ARE EMPTY |
14:38:57 | FromDiscord | <punchcake> it accepts 1 argument and you gave it 0 |
14:39:30 | FromDiscord | <ajusa> ws? |
14:39:36 | FromDiscord | <ajusa> It's being called with an argument |
14:39:44 | FromDiscord | <punchcake> am i blind |
14:39:45 | FromDiscord | <punchcake> where? |
14:39:53 | FromDiscord | <catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4AAd |
14:40:07 | FromDiscord | <catnowblue> (edit) "https://play.nim-lang.org/#ix=4AAd" => "https://paste.rs/PDQsy" |
14:40:32 | FromDiscord | <catnowblue> there has nothing to do with websocket issue, I'm having issue with parsing json |
14:40:37 | FromDiscord | <punchcake> hm |
14:40:38 | FromDiscord | <punchcake> idk tbh |
14:40:48 | FromDiscord | <catnowblue> fine, I'm waiting for someone to help me |
14:41:05 | FromDiscord | <catnowblue> cuz chatgpt only knows 2021 thing which nim wasn't stable at that time |
14:41:07 | FromDiscord | <ajusa> Anyway I have no idea what the context is, but if you're building a websocket server I recommend using mummy |
14:41:17 | FromDiscord | <catnowblue> no |
14:41:32 | FromDiscord | <catnowblue> I want to create new web socket client which handles each event |
14:41:33 | FromDiscord | <catnowblue> like this way |
14:41:43 | FromDiscord | <ajusa> Then I'd recommendhttps://github.com/guzba/whisky |
14:41:47 | FromDiscord | <catnowblue> it's a requirements to make the bot online |
14:42:48 | FromDiscord | <punchcake> i recommend a rewrite |
14:42:54 | FromDiscord | <punchcake> its too complicated for no reason |
14:42:58 | FromDiscord | <catnowblue> rewrite? |
14:43:02 | FromDiscord | <punchcake> yup |
14:43:06 | FromDiscord | <catnowblue> man nobody wrote a nim library for Revolt Chat |
14:43:13 | FromDiscord | <punchcake> start from scratcj |
14:43:14 | FromDiscord | <punchcake> (edit) "scratcj" => "scratcg" |
14:43:17 | FromDiscord | <punchcake> (edit) "scratcg" => "scratch" |
14:43:38 | FromDiscord | <ajusa> sent a code paste, see https://paste.rs/D9zgO |
14:44:11 | FromDiscord | <catnowblue> listen ajusa, that's not asyncious which means any actions outside of web socket client is blocked. |
14:44:31 | FromDiscord | <catnowblue> and since this library will also request http to fetch memebrs and channels |
14:44:34 | FromDiscord | <catnowblue> that would be awful |
14:44:44 | FromDiscord | <punchcake> thread pooling |
14:44:47 | FromDiscord | <catnowblue> why |
14:44:54 | FromDiscord | <punchcake> to solve the problem |
14:45:08 | FromDiscord | <catnowblue> why would I need threading |
14:45:21 | FromDiscord | <punchcake> to solve the its not async problem |
14:45:36 | FromDiscord | <catnowblue> I'm using dimscord, nim library for discord api as a reference |
14:45:44 | FromDiscord | <catnowblue> and they are all using json and websocket asyncious |
14:48:46 | FromDiscord | <ajusa> Ah fair enough. Yeah you'd need to use threads with whisky in that case. Hope someone is able to help you! I haven't used the standard library for a websocket client |
14:51:17 | FromDiscord | <punchcake> threadpooling bro |
14:59:21 | FromDiscord | <k0ts> @catnowblue , looks like it's because you don't export ResponseEvent's `type` field, so it resolves to system.`type`: https://nim-lang.org/docs/system.html#type |
14:59:37 | * | hmht left #nim (#nim) |
15:04:38 | * | jmdaemon quit (Ping timeout: 246 seconds) |
15:06:33 | FromDiscord | <catnowblue> damn thank you so much |
15:12:15 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4AAq |
15:12:26 | FromDiscord | <michaelb.eth> wdym? |
15:21:05 | * | lucasta joined #nim |
15:26:52 | * | Goodbye_Vincent joined #nim |
15:30:30 | * | Goodbye_Vincent quit (Client Quit) |
15:39:17 | FromDiscord | <System64 ~ Flandre Scarlet> Does async use multithreading? |
15:39:20 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "Does async ... use" added "pragma" |
15:46:21 | FromDiscord | <odexine> no |
15:46:27 | FromDiscord | <odexine> async and multithreading are separate |
15:48:15 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "async and multithreading are": Oh alright↵So for writing to a file, what is the best? |
15:48:33 | FromDiscord | <arathanis> In reply to @sys64 "Oh alright So for": for writing to files in parallel? |
15:48:37 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah |
15:48:59 | FromDiscord | <arathanis> probably depends on where you are sourcing the data to write to the files |
15:50:56 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "probably depends on where": I create a new synthesizer context, I use this new context to generate the waveforms without touching the main context, and then I export those waveforms to a wav file |
15:51:14 | FromDiscord | <arathanis> sent a long message, see http://ix.io/4AAA |
15:51:42 | FromDiscord | <arathanis> (edit) "http://ix.io/4AAA" => "http://ix.io/4AAC" |
15:52:03 | FromDiscord | <arathanis> (edit) "http://ix.io/4AAC" => "http://ix.io/4AAD" |
15:52:37 | FromDiscord | <arathanis> In reply to @sys64 "I create a new": is it different files? |
15:52:42 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright↵So for my case, is multithreading better? |
15:53:22 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "is it different files?": Yeah I think?↵I just copy the context so the new synth does not interact with the synth the user interacts with |
15:53:29 | FromDiscord | <catnowblue> In reply to @michaelb.eth "was just reading the": there was error regarding options, but I have no idea how it was gone |
15:53:42 | FromDiscord | <arathanis> In reply to @sys64 "Yeah I think? I": so they aren't writin to the same file, but each their own file? |
15:54:46 | FromDiscord | <arathanis> @System64 ~ Flandre Scarlet If you need them to be able to process waveforms before writing to a file, it sounds like lots of CPU work is involved so I suggest Multithreading |
15:54:51 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "so they aren't writin": The users choose the name of the file |
15:55:05 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "so they aren't writin": Yeah there is process involved |
15:55:19 | FromDiscord | <arathanis> So if you have parallel waveform processing, use multithreading. That is usually CPU intensive and async can't do multiple CPU bound things at the same time. |
15:55:38 | FromDiscord | <arathanis> In reply to @sys64 "Yeah there is process": so in your application i give it a file name, and multiple waveform processes happen. But do they all write to the same file? |
15:55:49 | FromDiscord | <arathanis> like ultimately are they combined into my result file? |
15:56:57 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4AAE |
15:57:01 | FromDiscord | <arathanis> you should use multithreading |
15:57:04 | FromDiscord | <arathanis> but only have a single file writing |
15:57:06 | FromDiscord | <arathanis> (edit) "writing" => "writer" |
15:57:40 | FromDiscord | <System64 ~ Flandre Scarlet> Here this is one thread processing a waveform, write it, process, write and so on |
15:57:41 | FromDiscord | <arathanis> opening the same file multiple times for concurrent writes is a fools errand. Have your wave processing threads which write their results to a channel and then a single other thread that listens to the incoming waveform data and outputs it to the target file |
15:57:54 | FromDiscord | <arathanis> much cleaner architecture. easier to reason about, less error prone |
15:58:26 | FromDiscord | <System64 ~ Flandre Scarlet> In the code, this is one single thread |
15:58:47 | FromDiscord | <arathanis> im assuming they share the sameoutput filename since you said it was a single file |
15:59:02 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah |
15:59:09 | FromDiscord | <System64 ~ Flandre Scarlet> But it close the file at the end |
15:59:15 | FromDiscord | <arathanis> yeah so remove the file writing from these threads. make them only do waveform processing |
15:59:33 | FromDiscord | <arathanis> when they are done, have them write their resulting waveform to a channel which is being read by a file writer |
15:59:36 | FromDiscord | <System64 ~ Flandre Scarlet> those waveforms need to be wrote in a precise order |
15:59:49 | FromDiscord | <arathanis> you cant guarantee multiple threads wont open the file at the same time and stomp all over each others data |
15:59:58 | FromDiscord | <arathanis> In reply to @sys64 "those waveforms need to": you can include order in the waveform output |
16:00:08 | FromDiscord | <arathanis> then the file writer respects that order |
16:00:43 | FromDiscord | <System64 ~ Flandre Scarlet> Btw↵If I need to generate 64 waveforms↵Can I use 64 threads? |
16:00:51 | FromDiscord | <arathanis> you can use as many threads as you want |
16:01:10 | FromDiscord | <arathanis> know that you should adjust how many threads based on the number of CPU threads poissible though |
16:01:19 | FromDiscord | <arathanis> so i suggest not hard coding 64 |
16:01:49 | FromDiscord | <arathanis> i suggest using the `std/cpuinfo` libraries `countProcessors` proc to see how many threads the computer supports |
16:02:00 | FromDiscord | <arathanis> then use that many for your default, and allow the user to change it if they want |
16:02:28 | FromDiscord | <arathanis> if I have a quadcore CPU and you open 64 threads its going to lock down the computer completely until your code is done |
16:03:13 | FromDiscord | <System64 ~ Flandre Scarlet> A single threaded file export can take more than 5 seconds |
16:03:52 | FromDiscord | <arathanis> more threads wont make it faster if the CPU cant run them at the same time |
16:04:02 | FromDiscord | <arathanis> if I have a quadcore and you open 4 threads each one can run |
16:04:07 | FromDiscord | <arathanis> if you open 8 threads 4 of them have to wait |
16:04:57 | FromDiscord | <arathanis> and if you open that many the context switching between threads creates tons of overhead, slowing it down, but also dominates the CPU so any other programs running on the computer grind to a halt. You should use a dynamic default number of threads based on the CPU of the computer which you can look up at runtime. |
16:06:08 | FromDiscord | <System64 ~ Flandre Scarlet> Multithreading is hard |
16:06:16 | FromDiscord | <arathanis> yes |
16:06:18 | FromDiscord | <arathanis> yes it is |
16:08:04 | FromDiscord | <System64 ~ Flandre Scarlet> But how is that possible? https://media.discordapp.net/attachments/371759389889003532/1129444209573773405/image.png |
16:08:42 | FromDiscord | <arathanis> a lot of them are background tasks that only run every once in a while |
16:08:47 | FromDiscord | <arathanis> pol very slowly |
16:08:50 | FromDiscord | <arathanis> or are not intensive |
16:09:08 | FromDiscord | <arathanis> waveform processing is pretty big math 100% cpu stuff |
16:10:03 | FromDiscord | <arathanis> so really it depends on the thread, but waveform processing is gonna max out the CPU its on, yeah? like crunching primes numbers |
16:10:24 | FromDiscord | <arathanis> if i make a program that checks stock prices every 5s |
16:10:28 | FromDiscord | <arathanis> i can run like 1000 of those |
16:10:34 | FromDiscord | <arathanis> once every 5 seconds is nothing to a computer |
16:11:01 | FromDiscord | <arathanis> but if its doing complex math, like an artificial intelligence its gonna use all the resources on the computer |
16:11:09 | FromDiscord | <arathanis> so if i have too many threads the CPU will be at 100% and unusable |
16:11:22 | FromDiscord | <System64 ~ Flandre Scarlet> and then blue screen |
16:11:29 | FromDiscord | <arathanis> less likely to bluescreen |
16:11:34 | FromDiscord | <arathanis> more likely to hang up and i have to wait |
16:11:39 | FromDiscord | <arathanis> maybe for a very long time |
16:12:00 | FromDiscord | <arathanis> cause so much is trying to run everything is just unusably slow |
16:12:01 | FromDiscord | <System64 ~ Flandre Scarlet> Why does Windows not have a security against thyis? |
16:12:09 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "thyis?" => "this?" |
16:12:16 | FromDiscord | <arathanis> nothing has security against this lol |
16:12:24 | FromDiscord | <arathanis> but they try |
16:12:29 | FromDiscord | <arathanis> its a halting problem thing |
16:12:39 | FromDiscord | <arathanis> if you have ever had windows say "this program is not responding, do you want to wait?" |
16:12:45 | FromDiscord | <arathanis> you have seen a form of security against this kind of thing |
16:12:55 | FromDiscord | <arathanis> (edit) "if you have ever had windows say "this program is not responding, do you want to ... wait?"" added "close it or" |
16:13:08 | FromDiscord | <System64 ~ Flandre Scarlet> But the problem can spread to stuff like explorer.exe and so on |
16:14:10 | FromDiscord | <arathanis> yeah, the cpu only has so much work it can do at a time and if too much is going on it will make the computer slow |
16:15:04 | FromDiscord | <arathanis> always best to have your default number of threads be based on the number of cores reported by the cpu |
16:15:16 | FromDiscord | <arathanis> then give a way to override like `--num-threads 64` |
16:15:23 | FromDiscord | <System64 ~ Flandre Scarlet> Imagine doing such treatments on... Python |
16:15:28 | FromDiscord | <arathanis> ive done it |
16:15:35 | FromDiscord | <arathanis> i love python lol |
16:15:49 | FromDiscord | <System64 ~ Flandre Scarlet> Python is slow 🐌 |
16:16:04 | FromDiscord | <arathanis> you wouldnt be doing any of the math stuff in pure python |
16:16:11 | FromDiscord | <arathanis> so its quite fast at doing what you are doing |
16:16:45 | FromDiscord | <System64 ~ Flandre Scarlet> Ray tracing on Python |
16:16:58 | FromDiscord | <arathanis> also there is no such thing as "slow" only "too slow" and you can't know something is too slow until its done and you profile it.↵↵Python respects your time as a developer, and if there is a hot spot you can optimize that hotspot for performance. |
16:17:23 | FromDiscord | <arathanis> In reply to @sys64 "Ray tracing on Python": yeah, you would be using something like numpy for this which is extremely fast. probably much faster than the nim code you are writing |
16:17:42 | FromDiscord | <arathanis> Python has a wealth of scientific and computing libraries that are blazingly fast |
16:17:50 | FromDiscord | <System64 ~ Flandre Scarlet> why much faster?↵Isn't Nim compiled? |
16:18:01 | FromDiscord | <System64 ~ Flandre Scarlet> and also GCC optimizations |
16:18:15 | FromDiscord | <arathanis> In reply to @sys64 "why much faster? Isn't": because the underlying code doing the heavy lifting isn't written in pure python, its a C extension written in C and compiled |
16:19:26 | FromDiscord | <catnowblue> Is there sort of `any` type in Nim? |
16:19:40 | FromDiscord | <catnowblue> I tried with auto, it yells that it's not valid |
16:20:11 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4AAI |
16:20:20 | FromDiscord | <catnowblue> I want to declare a variable that changes type depends on event type such as `ReadyEvent`, `MessageEvent` |
16:20:52 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4AAJ |
16:20:53 | FromDiscord | <catnowblue> I tried unionize them, but it says invalid type |
16:21:09 | FromDiscord | <arathanis> In reply to @sys64 "and what if we": depends if PyPy supports numpy or not |
16:21:10 | FromDiscord | <catnowblue> (edit) "them," => "them with `ReadyEvent | MessageEvent`," |
16:21:28 | FromDiscord | <System64 ~ Flandre Scarlet> also, is it possible to compile Python? |
16:21:29 | FromDiscord | <arathanis> there is an official PyPy numpy build called "numpypy" |
16:21:36 | FromDiscord | <System64 ~ Flandre Scarlet> oh wow! |
16:21:54 | FromDiscord | <arathanis> In reply to @sys64 "also, is it possible": depends what you mean, Python is compiled. but its probably not what you meant |
16:22:35 | FromDiscord | <System64 ~ Flandre Scarlet> Isn't Python interpreted? |
16:22:55 | FromDiscord | <arathanis> yes, but python is compiled to bytecode |
16:23:02 | FromDiscord | <arathanis> the interpreter runs that compiled bytecode |
16:23:22 | FromDiscord | <arathanis> i think you meant to a binary executable |
16:23:37 | FromDiscord | <System64 ~ Flandre Scarlet> Java uses bytecode↵C# uses bytecode↵So why is Python slower than thoses? |
16:24:02 | FromDiscord | <arathanis> In reply to @sys64 "Java uses bytecode C#": metaprogramming overhead and ergonomics |
16:24:22 | FromDiscord | <arathanis> the language design and features necessitate a runtime with more overhead |
16:24:29 | FromDiscord | <arathanis> its sacrificing compute timee for developer time |
16:24:37 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
16:24:46 | FromDiscord | <arathanis> the secret to leveraging python is to write your working application super fast, cause python |
16:25:04 | FromDiscord | <arathanis> then, if you find its too slow, identifying the slow spot and either↵1. use a library that does that fast |
16:25:12 | FromDiscord | <arathanis> (edit) "fast" => "fast"↵2. write a c-extension to do it" |
16:25:24 | FromDiscord | <arathanis> i actually do this with nim, Nim is very good at compiling .pyd files. |
16:25:40 | FromDiscord | <System64 ~ Flandre Scarlet> pyd? |
16:25:43 | FromDiscord | <arathanis> so ill write a Python app, get it going and if its too slow I profile it and find the one or two slow parts |
16:25:55 | FromDiscord | <arathanis> rewrite that function in nim, then have python call that function |
16:26:06 | FromDiscord | <arathanis> In reply to @sys64 "pyd?": .pyd is a DLL that Python can import and use like a module. |
16:26:16 | FromDiscord | <arathanis> so you can write it in C, or Nim as I said above |
16:26:23 | FromDiscord | <arathanis> and just use it like any old python function in python |
16:26:46 | FromDiscord | <arathanis> its why things like numpy are so fast |
16:27:55 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright!↵And does Nim have some kind of tradeoffs? |
16:28:47 | FromDiscord | <arathanis> In reply to @sys64 "Oh alright! And does": its usually a little slower than raw C, but imo not enough to matter since the language is much more ergonomic and expressive and you can always come back and optimize |
16:29:06 | FromDiscord | <arathanis> also since its a more boutique language finding supporting libraries can be hard |
16:29:14 | FromDiscord | <arathanis> cause they might↵- not exist↵- be unmaintained |
16:29:29 | FromDiscord | <System64 ~ Flandre Scarlet> Nim is underrated |
16:29:32 | FromDiscord | <arathanis> its a great language |
16:29:35 | FromDiscord | <arathanis> In reply to @sys64 "Nim is underrated": i agree |
16:29:49 | FromDiscord | <System64 ~ Flandre Scarlet> it deserves waaaaay more visibility |
16:29:50 | FromDiscord | <arathanis> my preferred workflow is to write Python, and use Nim for writing pyd extensions if I find i need more speed |
16:30:20 | FromDiscord | <System64 ~ Flandre Scarlet> Now I still have ONE problem with Nim↵No cyclic imports |
16:34:15 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4AAN |
16:35:06 | FromDiscord | <arathanis> so ill write the entire program in python, then if its too slow ill do the above for the 1 or 2 functions that are slow |
16:35:29 | FromDiscord | <arathanis> now i get all the incredible development speed of python and its ecosystem, and the blazing speed and expressiveness of Nim where I need it |
16:36:01 | * | FromDiscord quit (Remote host closed the connection) |
16:36:14 | * | FromDiscord joined #nim |
16:36:31 | FromDiscord | <System64 ~ Flandre Scarlet> can Nim be used for AI stuff? |
16:36:52 | FromDiscord | <arathanis> yes, but its probably too boutique for broad appeal. I imagine any AI libraries, if they exist, are some combination of unmaintained and low on features |
16:37:04 | FromDiscord | <arathanis> but theres nothing stopping you from doing it |
16:38:23 | FromDiscord | <System64 ~ Flandre Scarlet> I'm currently writing a game wiith Nim |
16:38:43 | FromDiscord | <arathanis> sounds like a fun project :] |
16:39:00 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1129451995426738246/2023-07-10_17-06-11.mp4 |
16:39:36 | * | lucasta quit (Remote host closed the connection) |
16:39:59 | FromDiscord | <arathanis> In reply to @sys64 "I'm currently writing a": let me see if I can write an example of the multithreaded arch I was suggesting for you... it may be in Python since im more familiar but the syntax is similar and the idea is what matters. |
16:40:10 | FromDiscord | <arathanis> is the size of a computed waveform section always the same siz? |
16:40:12 | FromDiscord | <arathanis> (edit) "siz?" => "size?" |
16:42:04 | FromDiscord | <arathanis> In reply to @sys64 "": this is cool! are you writing your own engine or using something like godot? |
16:44:08 | FromDiscord | <michaelb.eth> In reply to @arathanis "yes, but its probably": Arraymancer is maintained, though it's more of a building block: https://github.com/mratsim/Arraymancer |
16:44:17 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "this is cool! are": the graphic engine is Tilengine |
16:44:50 | FromDiscord | <arathanis> In reply to @michaelb.eth "Arraymancer is maintained, though": yeah that is a good one, but i was thinking of libraries like scipy or scikit-learn |
16:45:13 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "is the size of": You can change the length up to 4096 https://media.discordapp.net/attachments/371759389889003532/1129453556538298508/image.png |
16:45:20 | FromDiscord | <arathanis> theres a reason all these generative AIs taking the world by storm are written in Python lol. |
16:45:55 | FromDiscord | <arathanis> In reply to @sys64 "You can change the": i meant when you split it between threads do they all return the same sized waveform section to combine? |
16:46:23 | FromDiscord | <michaelb.eth> In reply to @arathanis "yeah that is a": cf. https://github.com/SciNim |
16:46:38 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "i meant when you": Yeah |
16:46:41 | FromDiscord | <michaelb.eth> though, sure, it's never going to be as popular as Python, for various reasons |
16:47:08 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/system64MC/kurumi-x↵Link to the project |
16:47:43 | FromDiscord | <arathanis> In reply to @sys64 "Yeah": perfect, when you distribute the waveform processing give them an index of what part of the waveform they are. when you load the results into the channel use a tuple that includes the index.↵↵the file writer simply reads the finished data, seeks in the file using the already known size to the write location and writes the completed waveform, then waits for the next finished waveform section |
16:47:50 | FromDiscord | <arathanis> In reply to @michaelb.eth "cf. https://github.com/SciNim": sweet ill take a look |
16:47:59 | FromDiscord | <arathanis> In reply to @michaelb.eth "though, sure, it's never": i like combining them as I stated above lol |
16:48:28 | FromDiscord | <michaelb.eth> being practical is definitely a good strategy 😄 |
16:48:50 | FromDiscord | <michaelb.eth> and it is nice that Nim makes interop with C, Python, etc. pretty simple |
16:48:58 | * | azimut quit (Ping timeout: 240 seconds) |
16:49:33 | FromDiscord | <arathanis> exactly |
16:49:53 | FromDiscord | <arathanis> in fact looking for a BKM for that practicality was how I found Nim in the first place lol |
16:50:27 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "perfect, when you distribute": You can find the code in the link I posted |
16:50:44 | FromDiscord | <System64 ~ Flandre Scarlet> caution, select the BoxUndoRedo branch |
16:52:00 | FromDiscord | <System64 ~ Flandre Scarlet> Pretty sure I have a lot of bad practices lol |
17:00:39 | * | jmdaemon joined #nim |
17:21:50 | FromDiscord | <arathanis> recognizing bad practices is the first step to good practices |
17:26:47 | FromDiscord | <System64 ~ Flandre Scarlet> True |
18:19:58 | FromDiscord | <whoman0385> I keep getting this exception: "The system cannot find the file specified." when i try to run "cls" with execCmd and im on windows so i have no idea whats wrong can someone help me? |
18:20:43 | FromDiscord | <whoman0385> nvm |
18:57:26 | * | cyraxjoe quit (Ping timeout: 260 seconds) |
18:58:05 | * | cyraxjoe joined #nim |
19:10:36 | * | ntat quit (Quit: Leaving) |
19:10:59 | * | ntat joined #nim |
19:16:50 | * | ntat quit (Quit: Leaving) |
19:17:13 | * | ntat joined #nim |
19:30:57 | * | cyraxjoe quit (Ping timeout: 250 seconds) |
19:31:13 | * | cyraxjoe joined #nim |
19:32:38 | FromDiscord | <catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4ABi |
19:32:53 | FromDiscord | <catnowblue> (edit) "https://play.nim-lang.org/#ix=4ABi" => "https://play.nim-lang.org/#ix=4ABj" |
19:41:24 | FromDiscord | <ntzeno> is there some kind of environment variable i can set for nimcache ? for example, for nimble theres NIMBLE_DIR, is there equivalent for nimcache ? or do i have to use `--nimcache` for each projects manually ? |
19:42:48 | FromDiscord | <graveflo> you can usually set parameters like that in nim.cfg. There is a global, local and project local version of the file |
19:43:00 | FromDiscord | <graveflo> https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files |
19:43:12 | FromDiscord | <ntzeno> i'll check it out, ty! |
19:45:51 | FromDiscord | <hotdog> In reply to @catnowblue "why am I getting": What do the custom objects look like? |
19:47:39 | FromDiscord | <catnowblue> it's a little bit huge |
19:48:38 | FromDiscord | <catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4ABm |
19:49:01 | FromDiscord | <catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4ABn |
19:49:03 | FromDiscord | <catnowblue> @hotdog |
19:50:19 | FromDiscord | <toma400> In reply to @sys64 "Now I still have": It's kinda like strict type system. It's useful to have this thing be available, but in the same time it can shoot you in the foot. So while I'd like some cyclic importing myself, it's one of those safety measures I also find rather good to have. |
19:50:41 | FromDiscord | <toma400> Unlike, for example, required module or variable use, like Go does |
19:51:24 | FromDiscord | <toma400> (edit) "does" => "does. It's rarely safety measure, and way more frequently an annoyance" |
19:51:33 | FromDiscord | <toma400> (edit) "an" => "just" |
19:52:15 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @toma400 "Unlike, for example, required": But how can C# and Java still be safe, despite having cyclic imports? |
19:52:54 | FromDiscord | <toma400> In reply to @sys64 "But how can C#": They work on different system, as far as I know. At least from Java, everything there is a class basically, so you do not take a risk of running something out of pure import. |
19:53:15 | FromDiscord | <toma400> Also their module system works differently, as you rather import folders instead of files |
19:53:20 | FromDiscord | <toma400> (edit) "import." => "import" |
19:53:40 | FromDiscord | <System64 ~ Flandre Scarlet> Now having cyclic imports can be useful in some cases |
19:54:16 | FromDiscord | <toma400> Oh, definitely. I kinda ran into situation my app I just designed in Nigui needs complete rewrite, as I made it work in a way that requires cyclic imports |
19:55:03 | FromDiscord | <toma400> It wouldn't make much difference if they were allowed in such case, but it's bad design choice and I kinda see it. It's intuitive for newbie programmer (who I kinda still am), but transitioning from there I see also why it is bad intuition |
19:55:07 | FromDiscord | <System64 ~ Flandre Scarlet> I have to write my game in a quirky way because of that |
19:55:44 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @toma400 "It wouldn't make much": cyclic imports are bad design? |
19:56:42 | FromDiscord | <griffith1deadly> In reply to @sys64 "cyclic imports are bad": rather depends on what you're doing↵there are some cases where you can't do without it↵especially in Java |
19:58:19 | FromDiscord | <toma400> In reply to @sys64 "cyclic imports are bad": They increase possibility of running into bugs you may not realise for long time. So maybe not bad design, but risky design. Really depends on language and architecture you are going for. |
19:58:28 | FromDiscord | <toma400> (edit) "In reply to @sys64 "cyclic imports are bad": They increase possibility of running into bugs you may not realise for long time. So maybe not bad design, but risky design. Really depends on language and architecture ... you" added "of project" |
19:59:45 | FromDiscord | <System64 ~ Flandre Scarlet> For a video game, it can be annoying |
20:00:22 | FromDiscord | <System64 ~ Flandre Scarlet> because the player module might need stuff for room↵And room module might need stuff for player |
20:00:36 | FromDiscord | <griffith1deadly> In reply to @sys64 "For a video game,": try kotlin for making game)0 |
20:01:32 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "try kotlin for making": Is it a good language? |
20:02:11 | FromDiscord | <toma400> In reply to @sys64 "because the player module": Yeah, I'm not against you here. I just see why this may be discouraged or limited. But I really hope for cyclic imports being possible in 2.0 |
20:02:16 | FromDiscord | <toma400> In reply to @sys64 "Is it a good": Absolutely ❤️ |
20:02:18 | FromDiscord | <griffith1deadly> In reply to @sys64 "Is it a good": yes, in some cases like java, but has more sugar and inline with compile time generic operations |
20:02:45 | FromDiscord | <toma400> (edit) "In reply to @sys64 "Is it a good": Absolutely ❤️ ... " added "(sorry for answering for everything, I missed this server a bit, haven't replied for two weeks or so here XD)" |
20:03:28 | FromDiscord | <griffith1deadly> but i dont recommend use kotlin/native target |
20:03:43 | FromDiscord | <griffith1deadly> if need low level -> use jnim |
20:05:00 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "if need low level": jnim? |
20:05:27 | FromDiscord | <griffith1deadly> https://github.com/yglukhov/jnim |
20:06:32 | FromDiscord | <griffith1deadly> Kotlin is a JVM language, so it will work perfectly with that |
20:07:22 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/megamarc/Tilengine↵And what if I want to use this library? |
20:08:40 | FromDiscord | <griffith1deadly> In reply to @sys64 "https://github.com/megamarc/Tilengine And what if": write your own nim binding -> make your own binding to jnim |
20:08:58 | FromDiscord | <griffith1deadly> or if u can understand c just realize it on jni |
20:09:44 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "or if u can": And will my final program be as fast as Nim? |
20:11:12 | FromDiscord | <griffith1deadly> In reply to @sys64 "And will my final": Java not faster than Nim or C |
20:11:27 | FromDiscord | <griffith1deadly> (edit) "In reply to @sys64 "And will my final": Java ... not" added "(and all jvm languages)" |
20:12:38 | FromDiscord | <griffith1deadly> at least it will be much faster to run than Python paired with Nim. |
20:20:52 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "at least it will": Oh alright↵and can I use this as a base?↵https://sr.ht/~exelotl/nim-tilengine/ |
20:24:12 | FromDiscord | <griffith1deadly> In reply to @sys64 "Oh alright and can": yes, why not? |
20:24:46 | FromDiscord | <griffith1deadly> just dont forget that u need compile your jnim binding to more platforms, to support java crosstarger |
20:24:58 | FromDiscord | <griffith1deadly> (edit) "crosstarger" => "crosstarget" |
20:25:56 | FromDiscord | <griffith1deadly> like LWJGL -> 32 bit, 64 bit, arm for Windows, Linux, MacOS |
20:26:24 | FromDiscord | <griffith1deadly> also for java exists good game engines like libgdx |
20:26:48 | FromDiscord | <griffith1deadly> that can work on mobile devices |
20:27:03 | FromDiscord | <Elegantbeef> libgdx isnt a game engine |
20:27:25 | FromDiscord | <griffith1deadly> okay, its Java game development framework |
20:30:06 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "like LWJGL -> 32": Nice cross compilation ooof↵Pain |
20:34:45 | FromDiscord | <griffith1deadly> i think u can cross compile for everything but macOS with zig cc compiler |
20:35:04 | FromDiscord | <Elegantbeef> zigcc can also target mac |
20:38:28 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "i think u can": Zig CC?↵Zig's compiler? |
20:41:57 | FromDiscord | <griffith1deadly> In reply to @sys64 "Zig CC? Zig's compiler?": yes |
20:43:12 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "yes": Interesting↵Btw↵Is Zig a good language? |
20:44:18 | FromDiscord | <griffith1deadly> in general, I would rather say that all languages are good. it depends on your desire to understand them, and your goals |
20:44:25 | FromDiscord | <griffith1deadly> (edit) "I" => "i" |
20:44:40 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "in general, i would": Except php |
20:45:53 | FromDiscord | <griffith1deadly> and rust 🙂 |
20:51:56 | * | azimut joined #nim |
20:53:36 | FromDiscord | <nimlang> In reply to @griffith1deadly "in general, i would": Yes, there's a saying that goes it does not matter what language but it matters what programmer |
20:59:42 | * | ntat quit (Quit: leaving) |
21:01:13 | FromDiscord | <michaelb.eth> A discord user named “nimlang”? |
21:12:56 | FromDiscord | <Elegantbeef> My AI works! |
21:19:13 | FromDiscord | <Elegantbeef> It's not a very good AI given that it only says what i've said |
21:24:11 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "and rust 🙂": Rst 🤣 |
21:25:43 | FromDiscord | <toma400> In reply to @griffith1deadly "and rust 🙂": Don't hate on my boi 😢 |
21:30:28 | om3ga | Elegantbeef what it does |
21:31:08 | FromDiscord | <Elegantbeef> I was suggesting nimlang was my AI |
21:34:34 | FromDiscord | <nimdev> I am not your AI |
21:41:44 | FromDiscord | <michaelb.eth> In reply to @nimdev "I am not your": that’s what an AI would say |
21:42:45 | FromDiscord | <Elegantbeef> Beep boop beep |
21:43:07 | FromDiscord | <emanresu3> we need an AI written in nim |
21:43:15 | FromDiscord | <emanresu3> god I hate python's speed |
21:43:21 | FromDiscord | <nimdev> In reply to @emanresu3 "we need an AI": True |
21:43:42 | FromDiscord | <nimdev> In reply to @emanresu3 "god I hate python's": I hate the language in general to be honest. Very overrated |
21:44:10 | FromDiscord | <Elegantbeef> Good thing most python code isnt python |
21:44:37 | FromDiscord | <nimdev> https://media.discordapp.net/attachments/1124847670012411935/1124848877724512376/caption.gif |
22:00:08 | * | dza quit (Remote host closed the connection) |
22:01:40 | * | dza joined #nim |
22:10:27 | FromDiscord | <hotdog> In reply to @catnowblue "but here's every objects": I think it's because you have module and type names the same, either rename the modules or fully qualify the type names (e.g. `Attachment.Attachment`). It's a type resolution thing |
22:10:40 | FromDiscord | <Chronos [She/Her]> In reply to @emanresu3 "we need an AI": I mean llama.cpp exists |
22:24:37 | FromDiscord | <spotlightkid> I like Python. One must also not forget that it started in the early 90s and that it IMHO is the first PL that managd to fufill the "easy for beginners" promise without giving them bad programming habits. And the success of Python in the Scicomp and AI fields show that execution speed is not the most important factor but faciitating experimentation. |
22:24:59 | FromDiscord | <spotlightkid> What I don't like about Python is the deployment story. |
22:33:06 | * | lukas joined #nim |
22:38:14 | FromDiscord | <bung8954> sent a code paste, see https://play.nim-lang.org/#ix=4ABR |
22:45:35 | lukas | Whats the best way to parse a value from a header response? With Python and requests I can for example just use: response.headers.get("total-hits"). Do I have to use regex with Nim? |
22:47:44 | FromDiscord | <graveflo> https://nim-lang.org/docs/httpclient.html#Response |
22:48:02 | FromDiscord | <graveflo> in nim it is "response.headers["total-hits"]` |
22:48:47 | FromDiscord | <graveflo> (edit) ""response.headers["total-hits"]`" => "`response.headers["total-hits"]`" |
22:48:48 | FromDiscord | <treeform> In reply to @odexine "is treeform a core": I would not say so. I did make a ton of libs though. |
22:49:20 | * | lukas quit (Read error: Connection reset by peer) |
22:51:00 | * | lukas joined #nim |
22:52:06 | lukas | @Graveflo thank you :) that's perfect |
23:34:33 | * | lukas quit (Quit: Konversation terminated!) |
23:44:51 | FromDiscord | <gogolxdong666> In reply to @emanresu3 "we need an AI": +1 |