<< 26-12-2022 >>

00:02:30FromDiscord<auxym> cool
00:05:18FromDiscord<Elegantbeef> What's the issue?
00:13:55*ltriant joined #nim
00:19:16*ltriant quit (Ping timeout: 268 seconds)
00:21:34FromDiscord<nqeron> In reply to @Elegantbeef "What's the issue?": I can't seem to get the set up to work. I don't know the right way to output properly
00:22:00FromDiscord<nqeron> sent a long message, see http://ix.io/4jyJ
00:22:07FromDiscord<nqeron> This is my staging code
00:22:21FromDiscord<Elegantbeef> Move is generic
00:22:26FromDiscord<nqeron> Yes
00:22:27FromDiscord<Elegantbeef> You need to provide a generic parameter
00:22:36FromDiscord<nqeron> I've tried that
00:22:46FromDiscord<nqeron> it's unclear where or how to do so
00:23:08FromDiscord<Elegantbeef> What is `MoveKind`?
00:23:30FromDiscord<nqeron> complicated
00:23:42FromDiscord<nqeron> MoveKind = Place | Spread
00:24:06FromDiscord<nqeron> sent a long message, see http://ix.io/4jyK
00:25:24FromDiscord<Elegantbeef> You need to supply that generic parameter to your procedure
00:26:27FromDiscord<nqeron> sent a long message, see http://ix.io/4jyL
00:26:31FromDiscord<nqeron> it doesn't like it
00:27:08FromDiscord<nqeron> and while I know what M will be in the default case, I don't know what it'll be it the normal case - it gets derived by parsing the moveString
00:27:33FromDiscord<Elegantbeef> Nim is statically typed so you cannot use a generic here
00:27:37FromDiscord<Elegantbeef> you want to use an object variant
00:28:28FromDiscord<nqeron> I'm not entirely sure what that means - I'm still fairly new to nim
00:29:09FromDiscord<Elegantbeef> https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants
00:33:02*ltriant joined #nim
00:40:40*ltriant quit (Ping timeout: 272 seconds)
00:54:57FromDiscord<Elegantbeef> I assume you think `A | B` is a union like in TS or similar
00:55:03FromDiscord<nqeron> Ok - there's a bit where I'm trying to read in from stdin, but it's complaining about side effects. What's the recommended way to handle this
00:55:16FromDiscord<Elegantbeef> Not use `func`
00:55:47FromDiscord<nqeron> I can double check - but I thought it was in a proc
00:56:20FromDiscord<nqeron> nvm - for some reason I had used func instead of proc
00:57:31FromDiscord<Elegantbeef> Otherwise you can do `{.cast(noSideEffect).}:`
00:57:37FromDiscord<Elegantbeef> But it's best to avoid that
01:20:14*ltriant joined #nim
01:27:16*wallabra_ joined #nim
01:28:57*ltriant quit (Ping timeout: 268 seconds)
01:30:04*wallabra quit (Ping timeout: 272 seconds)
01:30:04*wallabra_ is now known as wallabra
02:11:40*ltriant joined #nim
02:12:57FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jyX
02:13:15FromDiscord<System64 ~ Flandre Scarlet> https://github.com/inim-repl/INim↵So Nim can be interpreted now?
02:15:03FromDiscord<Elegantbeef> no inim is compiled
02:15:15FromDiscord<Elegantbeef> nimscript exists but is a subset
02:16:45FromDiscord<System64 ~ Flandre Scarlet> oh alright
02:17:02FromDiscord<System64 ~ Flandre Scarlet> still sounds powerful
02:17:03*ltriant quit (Ping timeout: 268 seconds)
02:17:30FromDiscord<albassort> nimscript is basically useless because you need the nim runtime to execute it
02:17:36FromDiscord<albassort> its in no way its own thing
02:17:45FromDiscord<albassort> its used for a few things in the nim ecosystem
02:17:48FromDiscord<System64 ~ Flandre Scarlet> Sometimes I'm thinking Nim is somewhat compiled Python lol
02:18:07FromDiscord<albassort> Yea, thats because it uses... indents...
02:18:22FromDiscord<albassort> not at all similar beyond that
02:18:30FromDiscord<System64 ~ Flandre Scarlet> In reply to @System64 "https://github.com/inim-repl/INim So Nim can": And that↵Typically Pythonic
02:18:39FromDiscord<albassort> yea look at the code i posted
02:18:40FromDiscord<PunchCake> Just discovered nim arc gc just wraps blocks of code with try finally blocks and then destroys the object lol
02:18:45FromDiscord<albassort> does that look anything like python?
02:19:02FromDiscord<albassort> In reply to @PunchCake "Just discovered nim arc": p much
02:19:13FromDiscord<System64 ~ Flandre Scarlet> No your code isn't pythonic at all
02:19:38FromDiscord<albassort> its a lot more complicated in its algorithmic concepts, but it works like that
02:19:48FromDiscord<Elegantbeef> What?↵(@albassort)
02:19:51FromDiscord<PunchCake> I wonder if the arc gc can be used with kernal dev instead of manual memory management
02:20:02FromDiscord<albassort> In reply to @Elegantbeef "What? (<@217459674700578816>)": I meant useless detached from nim projects
02:20:02FromDiscord<Elegantbeef> Likely↵(@PunchCake)
02:20:04FromDiscord<albassort> it has its uses
02:20:14FromDiscord<albassort> around the nim ecosystem
02:21:07FromDiscord<PunchCake> Anyways how hard would it be to reimplment the stdlib to be usable 100% with manual memory management
02:21:29FromDiscord<albassort> well anything is possible
02:21:36FromDiscord<Elegantbeef> Quite difficult since there are cyclical structures and seq/string hide their implementations
02:21:37FromDiscord<albassort> but why would... you wanna do that...
02:21:53FromDiscord<albassort> In reply to @Elegantbeef "Quite difficult since there": you'd need to redefine that
02:22:09FromDiscord<PunchCake> In reply to @albassort "but why would... you": To have the option to retain the stdlib for manual memory management
02:22:15FromDiscord<Elegantbeef> Stable Nim cannot even access a sequence's capacity
02:22:18FromDiscord<albassort> but why would you want that
02:22:30FromDiscord<PunchCake> To manually manage memory?
02:22:41FromDiscord<Elegantbeef> But why would you prefer manual over arc?
02:22:43FromDiscord<albassort> Yes... but... thats not nims place
02:22:49FromDiscord<albassort> nim is a modern langauge
02:22:52FromDiscord<albassort> it can have a gc
02:22:55FromDiscord<PunchCake> In reply to @Elegantbeef "But why would you": More control
02:23:11FromDiscord<Elegantbeef> Then use your own datatypes
02:23:35FromDiscord<albassort> You want to use a language which was designed from the ground up with a gc in mind
02:23:35FromDiscord<Elegantbeef> You can do everything with Nim's arc that you'd do with manual memory management when it comes to a single thread
02:23:38FromDiscord<albassort> and then just
02:23:40FromDiscord<PunchCake> OH YEAH i forgot to ask why does nim sequence use so much cpu rather than ram?
02:23:40FromDiscord<albassort> yeet it out
02:23:50FromDiscord<Elegantbeef> Sequences dont?
02:23:57FromDiscord<albassort> they... dont?
02:24:18FromDiscord<PunchCake> In python i can compute squared numbers from 1 to 1 billion without crashing but in nim if i do the same it will crash before reaching anywhere near 1 billion
02:24:42FromDiscord<PunchCake> Both get appended to either a list or a seq
02:24:42FromDiscord<albassort> i...
02:24:46FromDiscord<albassort> what?
02:24:58FromDiscord<albassort> you what an array of numbers between 1 and 1 billion?
02:25:01FromDiscord<Elegantbeef> What's the code and what's the compiler flags?
02:25:09FromDiscord<PunchCake> In reply to @albassort "you what an array": Yes
02:25:20FromDiscord<PunchCake> In reply to @Elegantbeef "What's the code and": Not near my pc rn
02:25:51FromDiscord<PunchCake> But it was very basic its just counting in a for loop from 1 to 1 billion and doing ii then appending to a seq
02:26:08FromDiscord<Elegantbeef> That's 7.4gb of ram
02:26:16FromDiscord<PunchCake> I got 16
02:26:21FromDiscord<PunchCake> And my whole pc crashed
02:26:32FromDiscord<PunchCake> Not lagged crashed crashed turned off
02:27:39FromDiscord<Elegantbeef> Took 18s on my PC
02:27:51FromDiscord<PunchCake> With appending to a seq?
02:28:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jyZ
02:28:35FromDiscord<PunchCake> Idk if there is any difference but i used countup
02:28:46FromDiscord<Elegantbeef> Literally same thing
02:28:47FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1056760458750730280/image.png
02:28:55FromDiscord<albassort> my computer cant handle it
02:28:58FromDiscord<albassort> but its fine
02:28:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jz0
02:29:27FromDiscord<PunchCake> Huh i swear it crashed on my pc
02:29:43FromDiscord<PunchCake> Maybe because i was calling it from python using nimpy bindings?
02:29:45FromDiscord<Elegantbeef> Well it runs fine here with 16gb
02:30:20FromDiscord<Elegantbeef> Do you have 8gb free albassort?
02:31:22FromDiscord<PunchCake> sent a code paste, see https://paste.rs/UQD
02:31:33FromDiscord<PunchCake> No way you're telling me it completed in 2s
02:31:38FromDiscord<albassort> i have 8 gb free from the start
02:31:43FromDiscord<albassort> i cant complete it
02:32:03FromDiscord<albassort> i think i've found the reason why beef never writes threaded code...
02:32:08FromDiscord<Elegantbeef> It certainly did complete it in 2s
02:32:21FromDiscord<albassort> beef what cpu do you have
02:32:26FromDiscord<PunchCake> Bro you rocking that i200
02:32:37FromDiscord<Elegantbeef> 5600x
02:32:50FromDiscord<PunchCake> I5600x
02:32:55FromDiscord<PunchCake> 15600 cores
02:33:00FromDiscord<Elegantbeef> I had a xeon1231v3 for like 5 years 😄
02:33:07FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1056761544945455265/image.png
02:33:10FromDiscord<albassort> sadged
02:33:17FromDiscord<Elegantbeef> Oh right optimisations
02:33:31FromDiscord<albassort> beef you gotta optimize it so i can run it without fucking dyinh
02:33:33FromDiscord<albassort> (edit) "dyinh" => "dying"
02:33:43FromDiscord<PunchCake> I wonder what 12 threads mean
02:33:54FromDiscord<PunchCake> If i run 12 threads my cpu will die or something
02:33:54FromDiscord<albassort> punch how old are you?
02:33:59FromDiscord<PunchCake> 20
02:34:08FromDiscord<PunchCake> Weird question but alright
02:34:17FromDiscord<albassort> alright who wants to explain to punch what a thread is
02:34:26FromDiscord<PunchCake> I know what a thread is
02:34:36FromDiscord<PunchCake> But what the hell does 12 threads in a cpu mean
02:34:53FromDiscord<PunchCake> Im sure a regular operating system has hundreds of threads running
02:35:06FromDiscord<albassort> 👍
02:35:11FromDiscord<Elegantbeef> Jesus i did a dumb, tried to writing it to a file after stringifing it
02:35:39FromDiscord<System64 ~ Flandre Scarlet> In reply to @System64 "https://github.com/inim-repl/INim So Nim can": About this thing, can it use stuff like SDL2 and so on?
02:36:07FromDiscord<PunchCake> lmao imagine interpreting nim so you can make sdl2 slower
02:36:15FromDiscord<PunchCake> Just use python at this point
02:36:24FromDiscord<Elegantbeef> technically it can use sdl2 but there is no point using inim for things like that
02:36:29FromDiscord<Elegantbeef> It's a REPL it's not an interpreter
02:36:48FromDiscord<System64 ~ Flandre Scarlet> Oh alright
02:36:57FromDiscord<Elegantbeef> Yea this consistently runs at 2s
02:37:16FromDiscord<System64 ~ Flandre Scarlet> In reply to @PunchCake "lmao imagine interpreting nim": Interpreting Nim inside Python
02:37:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jz2
02:38:02FromDiscord<Elegantbeef> Albassort does my code run on your system?
02:38:30FromDiscord<Elegantbeef> Also please give me a short form nickname i can write
02:38:30FromDiscord<PunchCake> In reply to @System64 "Interpreting Nim inside Python": Then using pypy to speed it up
02:38:41FromDiscord<PunchCake> Bas
02:39:13FromDiscord<PunchCake> Is there any point to compile to c++ in nim?
02:39:34FromDiscord<Elegantbeef> Anyway punch i do have to wonder what the hell code you were writing to crash your PC
02:39:34FromDiscord<Elegantbeef> I know i had some freezing due to my silly writing to a file
02:39:36FromDiscord<Elegantbeef> Allocating 16+gb isnt great when you only have 4gb of swap
02:39:45FromDiscord<Elegantbeef> If you want to use the C++ interop
02:40:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @PunchCake "Then using pypy to": what is pypy?
02:40:31FromDiscord<Elegantbeef> Why did you want to use inim with sdl?
02:40:42FromDiscord<PunchCake> In reply to @System64 "what is pypy?": JIT compiled python
02:40:51FromDiscord<Elegantbeef> If you want to script a program using Nim i'd suggest using wasm personally
02:40:54FromDiscord<PunchCake> In reply to @Elegantbeef "Anyway punch i do": Voodoo black magic lmao
02:41:29FromDiscord<Elegantbeef> Could also use std/dynlib and make a plugin system
02:41:37FromDiscord<System64 ~ Flandre Scarlet> In reply to @PunchCake "JIT compiled python": Oh wait, this is what Python needs!
02:41:47FromDiscord<PunchCake> In reply to @PunchCake "JIT compiled python": And it's amazingly fast but the downside is it can use C libraries well it would be 30x times slower than C python calling it
02:41:54FromDiscord<System64 ~ Flandre Scarlet> and does it work with pip and stuff?
02:41:55FromDiscord<Elegantbeef> Here i though python needed static typing and sensible language design
02:42:13FromDiscord<PunchCake> Its so slow even pypy devs recommended rewriting the C lib in pypy
02:42:33FromDiscord<PunchCake> In reply to @System64 "and does it work": Yes you can install all pip packages like you would in cpython
02:42:48FromDiscord<System64 ~ Flandre Scarlet> but even with pypy it's still slow af?
02:42:52FromDiscord<PunchCake> I use it with fastapi basically its performance for free
02:43:01FromDiscord<PunchCake> In reply to @System64 "but even with pypy": No pypy is fast very fast
02:43:19FromDiscord<albassort> In reply to @Elegantbeef "Albassort does my code": alba
02:43:20FromDiscord<PunchCake> Im talking about so fast it can nearly match java speed
02:43:55FromDiscord<Elegantbeef> Ah good didnt think you'd like being called ass↵(@albassort)
02:44:07FromDiscord<PunchCake> LMAO
02:44:10FromDiscord<albassort> it also means dawn you little shit
02:44:21FromDiscord<Elegantbeef> Ass does not mean dawn
02:44:26FromDiscord<albassort> alba in italian
02:44:32FromDiscord<PunchCake> In reply to @Elegantbeef "Here i though python": Mypy
02:44:33FromDiscord<albassort> your code runs fine but, my memory cant handle holding all the data
02:44:55FromDiscord<System64 ~ Flandre Scarlet> In reply to @PunchCake "Im talking about so": Oh, impressive!↵I know Java is fast, VERY fast!
02:45:00FromDiscord<Elegantbeef> optional
02:45:14FromDiscord<PunchCake> In reply to @System64 "Oh, impressive! I know": Yeah once the jit kicks in its gonna send you to the moon
02:45:18FromDiscord<PunchCake> Tbh i like java
02:45:22FromDiscord<albassort> without adding to a buffer it completes in 75 nanoseconds
02:45:24FromDiscord<PunchCake> Is it a crime to like java
02:45:28FromDiscord<albassort> holy shit buffers are slow
02:45:38FromDiscord<albassort> my opinions on java have come a long way
02:45:41FromDiscord<albassort> its "fine"
02:45:43FromDiscord<albassort> i prefer c#
02:45:44FromDiscord<System64 ~ Flandre Scarlet> In reply to @PunchCake "Tbh i like java": I like Java too, but it really should be less verbose
02:45:55FromDiscord<PunchCake> I got used to it tbh
02:46:04FromDiscord<System64 ~ Flandre Scarlet> I wrote a synth in Java
02:46:10FromDiscord<PunchCake> With a modern ide you type 4 chars and it does the rest
02:46:21FromDiscord<System64 ~ Flandre Scarlet> 100% Java + JavaFX https://media.discordapp.net/attachments/371759389889003532/1056764881463943249/image.png
02:46:35FromDiscord<albassort> not really a synth so much as a wave generator
02:46:42FromDiscord<albassort> but i digress
02:46:46FromDiscord<PunchCake> In reply to @System64 "100% Java + JavaFX": Mind asking you if you managed to package javafx into a jar?
02:46:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @albassort "not really a synth": It is a synth 'cause it can output sound
02:47:08FromDiscord<System64 ~ Flandre Scarlet> In reply to @PunchCake "Mind asking you if": I use Java 8
02:47:10FromDiscord<PunchCake> I spent 6 hours trying to until i gave up and rewrote my program im C# and avalonia
02:47:12FromDiscord<albassort> wave generators...
02:47:16FromDiscord<albassort> alright i think im done here
02:47:20FromDiscord<PunchCake> In reply to @System64 "I use Java 8": Jeez fuck why
02:47:32FromDiscord<System64 ~ Flandre Scarlet> In reply to @PunchCake "Jeez fuck why": JFX is embedded into Java 8
02:47:45FromDiscord<PunchCake> When did the bastards remove it
02:47:46FromDiscord<Elegantbeef> Are you just doing `discard x x`?↵(@albassort)
02:47:55FromDiscord<Elegantbeef> If so remember the compiler can remove code it deems that is unused
02:47:56FromDiscord<albassort> yea
02:48:04FromDiscord<albassort> oh
02:48:04FromDiscord<albassort> lmao
02:48:06FromDiscord<PunchCake> Those bastards removed javafx but kept java swing wtf
02:48:14FromDiscord<PunchCake> Java swing is obsolete
02:48:29FromDiscord<albassort> hmm how can i make sure evals without capturing
02:48:51FromDiscord<System64 ~ Flandre Scarlet> In reply to @PunchCake "Those bastards removed javafx": Don't worry, it's Oracle
02:49:04FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jz3
02:49:04FromDiscord<albassort> 184 nonecon
02:49:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jz4
02:49:09FromDiscord<PunchCake> In reply to @System64 "Don't worry, it's Oracle": Fuck em
02:49:16FromDiscord<PunchCake> Javafx is such an easy to use lib
02:49:31FromDiscord<System64 ~ Flandre Scarlet> Nothing is better than HTML / CSS for GUIs
02:49:33FromDiscord<albassort> wat do the and do
02:49:40FromDiscord<PunchCake> You'd know if you ever tried to make anything remotely none trivial in swing
02:49:44FromDiscord<albassort> 510 milliseconds, 667 microseconds, and 356 nanoseconds
02:49:54FromDiscord<PunchCake> In reply to @System64 "Nothing is better than": Yeah lets make bloated electron memory hogs
02:50:03FromDiscord<System64 ~ Flandre Scarlet> In reply to @PunchCake "Yeah lets make bloated": Fck Electron
02:50:05FromDiscord<albassort> In reply to @PunchCake "Yeah lets make bloated": L cring opinion
02:50:10FromDiscord<albassort> (edit) "cring" => "cringe"
02:50:25FromDiscord<PunchCake> bro since when is bad software engineering accepted
02:50:39FromDiscord<albassort> People who don't like electron haven't done actual work not using it
02:50:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jz5
02:50:44FromDiscord<albassort> hmmmmm
02:50:51FromDiscord<PunchCake> I did it sucks dog dick
02:50:52FromDiscord<Elegantbeef> with `-d:release --mm:arc`
02:51:01FromDiscord<System64 ~ Flandre Scarlet> I wish there is alternatives to Electron, without the cons of Electron
02:51:06FromDiscord<Elegantbeef> I dont like GUI whatsoever it's all hell
02:51:11FromDiscord<PunchCake> In reply to @System64 "I wish there is": Tauri but there is rust
02:51:17FromDiscord<PunchCake> In reply to @Elegantbeef "I dont like GUI": Agreed
02:51:31FromDiscord<albassort> In reply to @System64 "I wish there is": there are
02:51:31FromDiscord<PunchCake> But its useful tbh
02:51:44FromDiscord<albassort> https://reactnative.dev/
02:52:00FromDiscord<PunchCake> Lmao react native
02:52:00FromDiscord<albassort> stuff like this
02:52:04FromDiscord<Elegantbeef> But anyway alba we've changed what we're benchmarking anyway
02:52:10FromDiscord<PunchCake> Just use C# and avalonia
02:52:18FromDiscord<PunchCake> Or javafx and java
02:52:24FromDiscord<Elegantbeef> Not that it really matters since this could be thrown in a procedure and work identically
02:52:33FromDiscord<PunchCake> Mf or even python and qt at this point
02:52:41FromDiscord<Elegantbeef> Point is we can do it in under 2s depending on cpu
02:52:54FromDiscord<albassort> i dont think its the cpu bottlenecking me
02:52:57FromDiscord<PunchCake> In reply to @Elegantbeef "Point is we can": Now make it run on the gpu
02:53:00FromDiscord<albassort> so much of the work gets lost to roam
02:53:03FromDiscord<albassort> (edit) "roam" => "ram"
02:53:12FromDiscord<Elegantbeef> So saying it crashes your PC is either due to bad code, OS, or PC
02:53:24FromDiscord<PunchCake> Probably all combined
02:53:42FromDiscord<PunchCake> The transistors said you know what fuck this guy and crashed my pc
02:53:46FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1056766746427658280/image.png
02:53:47FromDiscord<System64 ~ Flandre Scarlet> In reply to @PunchCake "Or javafx and java": with JPhoenix 'cuz Material Design
02:53:59FromDiscord<albassort> here you can clearly see the swap latency bottlenecking my cpu
02:54:00FromDiscord<PunchCake> In reply to @System64 "with JPhoenix 'cuz Material": Based
02:54:01FromDiscord<Elegantbeef> Bleh downloading the buffer from the GPU and allocating it there will take up more time than this probably does↵(@PunchCake)
02:54:07FromDiscord<System64 ~ Flandre Scarlet> In reply to @albassort "https://reactnative.dev/": Isn't React known to be pain?
02:54:17FromDiscord<PunchCake> In reply to @System64 "Isn't React known to": No
02:54:21FromDiscord<albassort> This is the most developed one
02:54:28FromDiscord<albassort> sveltenative exists but its kinda fucked
02:54:40FromDiscord<System64 ~ Flandre Scarlet> I used Angular
02:54:40FromDiscord<albassort> basically, its implementing a CSS and HTML rendering engine on a native toolkit
02:54:45FromDiscord<PunchCake> React is shit because it ships like 3mb to the browsers or some insane number like that
02:54:47FromDiscord<albassort> I use svelte at work
02:54:50FromDiscord<Elegantbeef> Also doing it on the gpu means you need 8GB atleast of GPU memory
02:55:00FromDiscord<PunchCake> At least
02:55:02FromDiscord<PunchCake> Why
02:55:14FromDiscord<PunchCake> I've been playing gta on my gtx 1650 ez
02:55:34FromDiscord<albassort> yea your gta thing is keeping 1 billion squared floats in vram
02:55:42FromDiscord<PunchCake> LMAO
02:55:55FromDiscord<PunchCake> very casually
02:56:01FromDiscord<Elegantbeef> Why do you think loading takes forever?
02:56:26FromDiscord<PunchCake> Lets rent a 200 gb server and compute squared numbers from 1 to 100 trillion
02:56:38FromDiscord<PunchCake> In reply to @Elegantbeef "Why do you think": Because cockstar optimisation
02:56:49FromDiscord<albassort> their shading algorithms require every prime below 1 trilion
02:56:52FromDiscord<albassort> (edit) "trilion" => "trillion"
02:56:57FromDiscord<albassort> so it gotta do that on the gpu
02:56:58FromDiscord<Elegantbeef> One of the most costly things here is actually the allocations
02:57:05FromDiscord<Elegantbeef> Especially if you do it with the dumb `.add` method
02:57:12FromDiscord<Elegantbeef> So we just need ram closer to the cpu
02:57:15FromDiscord<Elegantbeef> Give me an arm processor!
02:57:15FromDiscord<albassort> it is the biggest
02:57:28FromDiscord<albassort> i cant think of anything that would take more time
02:57:29FromDiscord<PunchCake> would it be better to just write to a file
02:57:35FromDiscord<albassort> nope
02:57:39FromDiscord<PunchCake> It would take even more time opening a file right
02:57:39FromDiscord<Elegantbeef> Nope writing to a file is even slower
02:57:41FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1056767731363479562/image.png
02:57:51FromDiscord<albassort> you see the green line go up and cpu go down
02:58:02FromDiscord<albassort> thats because my swap memory is bottlenecking the cpu
02:58:17FromDiscord<PunchCake> Linux moment
02:58:23FromDiscord<albassort> what
02:58:29FromDiscord<albassort> @ElegantBeef can i get a what
02:58:35FromDiscord<PunchCake> what
02:58:58FromDiscord<albassort> this is a linux moment in the same sense that breathing is a me moment
02:59:04FromDiscord<albassort> same thing happens on windows
02:59:07FromDiscord<Elegantbeef> had to scroll up to see the image you posted Shame alba I have a xeon123v3 sitting in a closet
02:59:09FromDiscord<albassort> its a moment of having 8gb of ram
02:59:20FromDiscord<Elegantbeef> It's a plop in upgrade to that i5
02:59:29FromDiscord<albassort> not on my generation
02:59:33FromDiscord<albassort> oh is it?
02:59:37FromDiscord<albassort> might be
02:59:38FromDiscord<Elegantbeef> Yea it's a haswell
02:59:40FromDiscord<PunchCake> In reply to @albassort "its a moment of": Get more ram bro ram is cheap
02:59:48FromDiscord<albassort> DDR3 ram is not cheap lmao
02:59:53FromDiscord<PunchCake> Ddr4
03:00:00FromDiscord<Elegantbeef> haswell is ddr3
03:00:08FromDiscord<albassort> i cant put ddr4 in my cpu
03:00:10FromDiscord<PunchCake> Mf brokey ram ddr3
03:00:24FromDiscord<Elegantbeef> ...
03:00:41FromDiscord<albassort> having a bad pc is actually a good thing because it forces me to write better code
03:00:52FromDiscord<albassort> beef can just go 2 BRRRR
03:00:55FromDiscord<PunchCake> Yet here you are preaching electron
03:01:10FromDiscord<Elegantbeef> How long did my solution take on your CPU?
03:01:15FromDiscord<PunchCake> 600 MB of ram wasted on discord
03:01:18FromDiscord<albassort> dnf
03:01:24FromDiscord<Elegantbeef> Jees
03:01:34FromDiscord<Elegantbeef> 2.5 times ram speed shouldnt be that much better
03:01:48FromDiscord<Elegantbeef> I assume you have like 1.3mhz
03:01:50FromDiscord<albassort> +swap +linux trying to stop my pc from crashing
03:02:03FromDiscord<albassort> half of my free ram is swap on a m2
03:02:11FromDiscord<albassort> so its really like ddr3 and drr2
03:02:23FromDiscord<albassort> big bottlenecks
03:02:26FromDiscord<Elegantbeef> Oh you dont have 16gb of ram?
03:02:34FromDiscord<PunchCake> bro
03:03:36FromDiscord<albassort> no
03:03:46FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1056769258627022879/image.png
03:03:52FromDiscord<PunchCake> @albassort when did you buy your pc
03:04:05FromDiscord<albassort> i've evolved from a pc i bought in 2014
03:04:07FromDiscord<albassort> i refuse to upgrade
03:04:17FromDiscord<Elegantbeef> If only you lived in Canada, i'd ship you my old parts
03:04:18FromDiscord<PunchCake> This is an evolution?
03:04:26FromDiscord<albassort> yea my cpu died so i downgraded
03:04:50FromDiscord<albassort> cheaper to buy a cpu from the same gen and motherboard then to upgrade
03:04:55FromDiscord<PunchCake> So your mobo cant handle ddr4 ram now?
03:05:05FromDiscord<Elegantbeef> Haswell cannot
03:05:14FromDiscord<albassort> haswell is the best generation
03:05:18FromDiscord<albassort> i have l4 cache
03:05:20FromDiscord<albassort> none of you do
03:05:28FromDiscord<albassort> best dwarf fortress fps
03:05:30FromDiscord<Elegantbeef> It was a massive upgrade over my fx4100
03:05:54FromDiscord<Elegantbeef> Though my fx4100 was a monster that was OC'd to 4.5ghz with the stock amd cooler
03:06:01FromDiscord<albassort> when i upgrade my pc in 2036 i want 64 gb of ram
03:06:03FromDiscord<Elegantbeef> Not that it mattered that much since it was still a shit cpu
03:06:11FromDiscord<PunchCake> In reply to @albassort "when i upgrade my": 💀💀💀💀
03:06:31FromDiscord<PunchCake> Mf you better get 500 gb ram at this point
03:06:40FromDiscord<albassort> Moors law is dead
03:06:45FromDiscord<albassort> (edit) "Moors" => "Moor's"
03:06:49FromDiscord<Elegantbeef> It's really not
03:06:52FromDiscord<Elegantbeef> moore\
03:06:53FromDiscord<PunchCake> Moor was a lying bitch
03:06:57FromDiscord<albassort> it kinda is
03:07:07FromDiscord<albassort> memory isn't really advancing
03:07:23FromDiscord<PunchCake> Transistor doubling my dick and apple releases the same phone every year bruh
03:07:26FromDiscord<albassort> gpus are still holding true iirc
03:07:34FromDiscord<albassort> but cpus are bottlenecking
03:07:59FromDiscord<albassort> Apple is making the most innovative cpus in the world RN
03:08:04FromDiscord<PunchCake> Tbh i dont think there is any point to keep upgrading cpus
03:08:20FromDiscord<albassort> its unfortunate no Desktop arm platform can blossom practically like x86
03:08:26FromDiscord<albassort> maybe one day
03:08:35FromDiscord<Elegantbeef> Meh desktop arm can work
03:08:42FromDiscord<PunchCake> In reply to @albassort "Apple is making the": M1
03:08:43FromDiscord<albassort> well i mean socket wise
03:08:43FromDiscord<Elegantbeef> Box86 and friends are usable
03:09:03FromDiscord<PunchCake> M1 is really good if you tried it
03:09:09FromDiscord<PunchCake> Shit never lags no matter what
03:09:10FromDiscord<albassort> we would need a standard and a whole bunch of standards
03:09:20FromDiscord<albassort> it would be neat tho
03:10:06FromDiscord<PunchCake> Anyways alba you Italian?
03:10:06FromDiscord<albassort> hmm
03:10:33FromDiscord<albassort> Italian American. My name derives from Albatross and Alba is coincidence
03:10:45FromDiscord<Elegantbeef> Given that they're mainly aimed as SOCs that'll likely never happen
03:10:57FromDiscord<PunchCake> I swear Italy has the best guns the best women the best food the best mafia
03:11:07FromDiscord<albassort> that is a strange comment
03:11:08FromDiscord<PunchCake> Yall dont do nothing wrong
03:11:26FromDiscord<PunchCake> mamamia
03:11:42FromDiscord<Elegantbeef> Oh you literally just reversed tross
03:11:48FromDiscord<Elegantbeef> 10/10 naming
03:11:56FromDiscord<Elegantbeef> I'm a fancy steak so cannot say much
03:12:11FromDiscord<PunchCake> what
03:13:32FromDiscord<albassort> Look beef, my audio company was named AbnormalAudio
03:13:37FromDiscord<albassort> its the best named thing i've ever come with
03:13:59FromDiscord<Elegantbeef> Oddeo is right there
03:14:34FromDiscord<albassort> it would have a very oversimplified logo and we would have an office like Teenage Engineering
03:14:50FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1056772045939167252/1464445141-teenage1.png
03:15:03FromDiscord<Elegantbeef> That's a car
03:16:05FromDiscord<albassort> thats their office
03:16:06FromDiscord<Bung> Oddeo sound like audio company located at Odin
03:16:19FromDiscord<albassort> we program our stuff IN odin
03:16:56FromDiscord<Bung> it's underground parking right, from the picture
03:17:10FromDiscord<albassort> nah they just fuckin rent cars
03:17:12FromDiscord<albassort> and put em in there
03:18:07FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jz8
03:18:20FromDiscord<Bung> oh, the building structure looks very similar to underground parking
03:18:52FromDiscord<albassort> imagine drinking beer at work wtf are the europeans doing?!?
03:19:30FromDiscord<Elegantbeef> Imagine drinking beer
03:20:33FromDiscord<albassort> gotta get the balmer peak somehow
03:20:59FromDiscord<Elegantbeef> Do you?
03:23:00FromDiscord<PunchCake> In reply to @albassort "imagine drinking beer at": Wait until he finds out we drink vodka at work
03:36:10*wallabra_ joined #nim
03:37:48*wallabra quit (Ping timeout: 265 seconds)
03:37:49*wallabra_ is now known as wallabra
04:13:11*ltriant joined #nim
04:23:36*ltriant quit (Read error: Connection reset by peer)
04:28:50*ltriant joined #nim
04:35:47*ltriant quit (Ping timeout: 255 seconds)
04:43:41*jkl quit (Quit: Gone.)
04:45:20*jkl joined #nim
04:47:55*arkurious quit (Quit: Leaving)
04:57:48*rockcavera quit (Ping timeout: 272 seconds)
04:58:17*ltriant joined #nim
05:06:40*ltriant quit (Ping timeout: 272 seconds)
05:09:39*ltriant joined #nim
05:19:45FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4jzl
05:20:16FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4jzl" => "https://paste.rs/1F4"
05:21:00FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4jzm" => "https://paste.rs/ZXn"
05:21:16FromDiscord<Elegantbeef> No it does not
05:21:38FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4jzo" => "https://play.nim-lang.org/#ix=4jzn"
05:22:55FromDiscord<sOkam!> It is for a reader, so the data comes from a binary file, that contains variable amounts of that C_One type↵How can I approach storing the info instead?
05:24:12FromDiscord<Elegantbeef> This is for interop or converted code?
05:24:24FromDiscord<sOkam!> Translated, one way trip
05:24:36FromDiscord<Elegantbeef> If converted yes a seq[T]\` can work
05:25:08*ltriant quit (Ping timeout: 268 seconds)
05:25:27FromDiscord<sOkam!> how would I store the data in the pointer?↵the original was doing calloc and then storing the address, but not sure if that's needed in Nim
05:25:46FromDiscord<sOkam!> (edit) "how would I store the data in ... the" added "the sequence, so it behaves like"
05:27:50FromDiscord<sOkam!> Basically the idea is creating code that does the same as this file↵But don't know how to store those types that are pointers to structs, in a more Nim way↵https://github.com/heysokam/idtech3-modules/blob/master/simplified/load_bsp_nopatches.h
05:28:26FromDiscord<Elegantbeef> I dont think you need the pointer
05:36:19FromDiscord<Elegantbeef> I assume atleast they're just using it as a dynamically allocated collection
05:36:39FromDiscord<Elegantbeef> If they're not you can just do `NimTwo = ref NimOne`
05:48:36FromDiscord<sOkam!> Basically, its a loader for this format↵http://www.hyrtwol.dk/wolfenstein/unofficial_quake3_bsp_format.md↵I'm using their loader as a reference, because I'm porting the collision behavior. And there is a bunch of math that's done on loading that is important for collision detection after loading.↵But I just need to load this data into native nim types, to be able to use the data in an engine. That's all really
05:48:38FromDiscord<albassort> how can i do unittests at compile temp
05:48:46FromDiscord<albassort> (edit) "compile temp" => "compiletime"
05:50:14FromDiscord<sOkam!> In reply to @Elegantbeef "I assume atleast they're": which is the same as saying that I have no clue if what you mention is what they are doing or not↵all I know is that the engine allocates the map, and does some physics checks with the data loaded↵is that dynamic or static or else? I have no clue
05:50:39*ltriant joined #nim
05:51:09FromDiscord<Elegantbeef> `calloc` is dynamic allocation
05:51:31FromDiscord<sOkam!> they don't use calloc in the engine, they use Hunk_Alloc
05:52:44FromDiscord<sOkam!> This thing:↵https://github.com/heysokam/idtech3-modules/blob/a5cd0d55a32f27fc97799ac46095933d1453f013/src/mem/c/hunk.c#L59
05:53:48FromDiscord<albassort> In reply to @albassort "how can i do": i mean i can put some stuff in a const proc but i don't think thats how you're suppose to do it
05:53:50FromDiscord<Elegantbeef> Same premise
05:55:27*ltriant quit (Ping timeout: 256 seconds)
05:56:04FromDiscord<albassort> .-.
05:57:24FromDiscord<Elegantbeef> In C `T` can be a `ref T` or `seq[T]` in Nim, so without looking how they use it it's hard to say
06:15:30FromDiscord<albassort> @ElegantBeef whats some cool things i can use blocks for
06:15:48FromDiscord<offbeat-stuff (offbeat-stuff)> hi I am using pixie and trying to decodeImage, I am generating a svg image using, and it is throwning error, cause the width of svg image is not integer
06:15:54FromDiscord<albassort> sent a code paste, see https://paste.rs/vSX
06:16:06FromDiscord<Elegantbeef> Things you probably should use procedures for but dont want to
06:16:08FromDiscord<offbeat-stuff (offbeat-stuff)> \generating a image using hb-view
06:16:09FromDiscord<albassort> In reply to @offbeat-stuff (offbeat-stuff) "hi I am using": well the width of the svg image is not an integer
06:16:30FromDiscord<albassort> In reply to @Elegantbeef "Things you probably should": why wouldn't i want to
06:16:51FromDiscord<albassort> beat, how are suppose to help you with no code and not much context
06:17:03FromDiscord<albassort> 1. is the image in the file or in the output
06:17:06FromDiscord<albassort> 2. show us code
06:17:30FromDiscord<Elegantbeef> Cause you're lazy or it's a one off
06:17:33*rockcavera joined #nim
06:17:38FromDiscord<offbeat-stuff (offbeat-stuff)> ok, I guess i will file a bug report on pixie
06:18:10FromDiscord<albassort> its useful for some metal programming stuff like
06:18:13FromDiscord<offbeat-stuff (offbeat-stuff)> just wanted to say that pixies svg parsing is missing a important part
06:20:00FromDiscord<albassort> anyway this is the unit test i wrote
06:20:01FromDiscord<albassort> sent a code paste, see https://paste.rs/snz
06:20:22FromDiscord<Elegantbeef> You know you can just do `static(myTest)` 😄
06:20:30FromDiscord<albassort> BEEF I ASKED LIKE 3 TIMES
06:20:32FromDiscord<Elegantbeef> sorry `static(myTest())`
06:21:29FromDiscord<offbeat-stuff (offbeat-stuff)> Here is the code\: https://play.nim-lang.org/#ix=4jzw for pixie and svg error
06:24:38*ltriant joined #nim
06:26:27FromDiscord<albassort> In reply to @Elegantbeef "sorry `static(myTest())`": give an example?
06:27:01FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/uqZ
06:27:22FromDiscord<albassort> ok but tests aren't declared in a scope where i can execute them
06:28:17FromDiscord<albassort> oh
06:28:21FromDiscord<albassort> just put the whole thing in there
06:28:21FromDiscord<albassort> neat
06:28:37FromDiscord<albassort> wait
06:28:45FromDiscord<albassort> you cant run tests at compile time
06:28:58FromDiscord<albassort> grr
06:30:43*ltriant quit (Ping timeout: 260 seconds)
06:51:52*ltriant joined #nim
06:56:49*ltriant quit (Ping timeout: 252 seconds)
07:27:34*pro joined #nim
07:52:15*rockcavera quit (Remote host closed the connection)
08:10:03NimEventerNew thread by archnim: What is a RollingFileLogger, see https://forum.nim-lang.org/t/9760
08:13:01FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1056847085149880340/image.png
08:30:35FromDiscord<HitBlast> Is it possible to have multiple types inside a tuple? I'd like to make it so that the last named item can contain either a string or a `nil` type. https://media.discordapp.net/attachments/371759389889003532/1056851507611455528/Screenshot_2022-12-26_at_2.27.52_PM.png
08:31:18FromDiscord<HitBlast> Is it possible to have multiple types inside a tuple? I'd like to make it so that the last named item can contain either a string or a nil type. https://media.discordapp.net/attachments/371759389889003532/1056851688465629184/Screenshot_2022-12-26_at_2.31.02_PM.png
08:31:42FromDiscord<Elegantbeef> `std/options`
08:43:45FromDiscord<sOkam!> sent a code paste, see https://paste.rs/EKg
08:44:14FromDiscord<Elegantbeef> Just make a constructor
08:44:19FromDiscord<Elegantbeef> Dont use a converter as a constructor
08:45:07FromDiscord<sOkam!> Constructor doesn't let me do `(0, 1)`, would require `constructorName(0, 1)`
08:45:59FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/gHv
08:46:20FromDiscord<sOkam!> tyty
09:09:50*ltriant joined #nim
09:41:00*ltriant quit (Ping timeout: 252 seconds)
09:54:05*ltriant joined #nim
09:58:58*ltriant quit (Ping timeout: 252 seconds)
10:06:13*ltriant joined #nim
10:29:08FromDiscord<sOkam!> Is it possible to use converters for -automatically- converting enums to ints, so they can be used as indexes for a fixed sized array?↵Seems like the converter works if I call it directly, and it also works with `.ord` on the enum, but if I remove them it breaks 🤷‍♂️↵Are converters not auto-applied in this case?
10:42:53FromDiscord<Elegantbeef> Why not just use an enum indexed array?
10:43:01FromDiscord<Elegantbeef> `array[MyEnum, MyType]` @sOkam!
10:44:08FromDiscord<sOkam!> oh, didn't think of that
10:50:18FromDiscord<sOkam!> damn, and you can also iterate an enum!?↵nim is f'ing epic 👀
10:58:48NimEventerNew question by Alexandre Daubricourt: Nim check if file exists, see https://stackoverflow.com/questions/74919610/nim-check-if-file-exists
10:59:15FromDiscord<Phil> In reply to @Elegantbeef "Why not just use": You asked about my frontend before I napped off : the one for my side project, the DND wiki
10:59:39FromDiscord<Phil> That's the front-end I typically mean when talking about one
11:00:41FromDiscord<Phil> Alex doing the self answered question style! I like it!
11:03:23*ltriant quit (Ping timeout: 260 seconds)
11:22:54NimEventerNew question by Alexandre Daubricourt: Nim how to check if environment is in production?, see https://stackoverflow.com/questions/74919803/nim-how-to-check-if-environment-is-in-production
11:46:05*ltriant joined #nim
11:52:15*ltriant quit (Ping timeout: 265 seconds)
11:54:04*ltriant joined #nim
12:24:37FromDiscord<sOkam!> Is it possible to designate a string of X size, when declaring the type of a string inside an object?↵I know about `array[num, char]`, but wonder if there is another way
12:32:14FromDiscord<Phil> sent a long message, see https://paste.rs/IQl
12:32:24FromDiscord<Phil> Now to figure out how to do each of these steps
12:33:33FromDiscord<Phil> (edit) "https://paste.rs/zcf" => "http://ix.io/4jAh"
12:34:12FromDiscord<Phil> I know `std/macros.parseStmt` exists, but I don't think that's useable to throw at the code for an entire module
12:34:58FromDiscord<Vindaar> If you want to do it using regular Nim macros, I'm not sure if you won't run into some usability issues
12:35:31FromDiscord<Vindaar> It's easy to add a pragma to some procedure using macros. But doing that over a full file is the problematic part with normal macros. You'd need to `staticRead` a full file and parse that
12:35:32FromDiscord<Phil> The main thing I see approaching is that it might absolutely slaughter any formatting you applied before
12:36:11FromDiscord<Vindaar> who cares about formatting? The code you generate isn't meant to be read by a person
12:36:12FromDiscord<Phil> Because skimming through the macros module comments should survive as I swear I saw somewhere that they have their own node
12:36:22FromDiscord<Vindaar> only `##` comments
12:37:30FromDiscord<Phil> In reply to @Vindaar "who cares about formatting?": Oh right, if I manage this it'd implicitly be adding the pragma just before the actual compiling begins.↵I originally envisioned this as a minor script to help with initially adding the pragma to all your exported procs
12:37:43FromDiscord<Phil> Which I may no longer need if I manage to do it fully
12:38:07FromDiscord<Phil> Wait, no I may still run into issues with the order things must compile in
12:38:39FromDiscord<Phil> Yeah I think for my own sanity it'd be better if I treat this as a one-off script that you run once to add the pragma to all your exported procs in your codebase and moving forward you can do that manually then
12:41:05NimEventerNew thread by freeflow: Strange error: single character string constants, see https://forum.nim-lang.org/t/9762
12:41:07FromDiscord<jmgomez> In reply to @Isofruit "I know `std/macros.parseStmt` exists,": Wow didnt know that existed! Thanks for mentioning it! With that I think I can build a custom plugin on top of NimSuggest to feed in UE types
12:42:11FromDiscord<Phil> In reply to @jmgomez "Wow didnt know that": ... you don't perchance have a good idea for a one-time script that'd manage to add a pragma to all exported procs of all modules in e.g. a project of your UE project's size?
12:42:38FromDiscord<Phil> Just the fact that I'm currently seeing no better way than to parse an entire module and rewrite it doesn't mean I'm a huge fan of that
12:43:20FromDiscord<Phil> I could just look for equal signs in proc-lines, but what annoys me the most is that this will blow up in my face for default-parameters since they also have an equal sign
12:43:36FromDiscord<Phil> That and multi-line proc definitions
12:45:39FromDiscord<jmgomez> No, sorry what NUE does is to have a custom dsl and custom pragmas where the whole proc is replaced by the real thing. If you are avoiding to mark it explicitly I think you need to wrap them in another macro.. but not sure
12:46:01FromDiscord<jmgomez> if there is another way
12:47:28FromDiscord<Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4jAk
12:49:06NimEventerNew thread by tcheran: Csv column type setting, see https://forum.nim-lang.org/t/9763
12:50:50FromDiscord<Phil> In reply to @Vindaar "<@180601887916163073> With the following": That's fine, the pragma I'm throwing at it makes the proc "mockable", I just want an easy way to get it initially into the sourcecode
12:51:27FromDiscord<Phil> Once its in there it can be committed and stuff can be continued from there. I just think if an existing project wanted to adopt this macro it'd be way too much of a PITA to add this macro to all existing exported procs individually
12:51:39FromDiscord<Phil> (edit) "macro" => "pragma"
12:51:59FromDiscord<Phil> So I just wanted to provide a small tool to save some time
12:52:06FromDiscord<jmgomez> So what you want is to make a proc mockable to change for testings or something?
12:52:24FromDiscord<jmgomez> Why not just get the implementation and do it ad hoc?
12:52:47FromDiscord<Phil> In reply to @jmgomez "So what you want": Pretty much. The pragma, when a specific flag is defined, turns the proc into a `var` with a proc assigned to it that can be swapped out
12:53:05FromDiscord<Phil> So that when another proc calls this one, I can mock it out
12:53:53FromDiscord<Phil> In reply to @jmgomez "Why not just get": I'm not sure what you mean here, could you elaborate?
12:55:23FromDiscord<jmgomez> If you want it to traverse the deps and calls can get really complicated but if it's shallow you can get the implementation of the funcs that calls it and replace the calls nodes
12:55:41FromDiscord<jmgomez> that or dynamic dispatching
12:56:05FromDiscord<jmgomez> which is a bit of a pain in nim..
12:56:09FromDiscord<Phil> I still don't follow. Well I do with dynamic dispatching, that's essentially how testing in OOP works, but the first comment I don't
12:56:48FromDiscord<jmgomez> I mean, you know that you can do getImpl() on a symbol and it will returns you the AST, right?
12:57:47FromDiscord<Phil> Barely, but I know the proc exists.↵Do you mean that during testing I should modify the proc under test ?
12:58:00FromDiscord<Phil> Instead of swapping out what it calls?
12:58:09FromDiscord<jmgomez> Im not saying you should, Im just saying you could haha
12:58:36FromDiscord<jmgomez> but yeah, the mockables should be inside a nnkCall
12:58:48FromDiscord<Phil> The benefit of the pragma approach is that once the pragma is applied you no longer need to deal with anything macro related.↵You just assign different procs to the symbols
12:59:31FromDiscord<Phil> It's the closest thing in behaviour that I can imagine to mocking with dynamic dispatch
12:59:59FromDiscord<Phil> without wildly changing your source code to be more OOP-y
13:00:03FromDiscord<jmgomez> right, I like the pragma approach more, what about adding them in a macro instead?
13:00:58FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4jAn
13:02:31FromDiscord<Phil> sent a long message, see http://ix.io/4jAo
13:04:33FromDiscord<Phil> In reply to @jmgomez "if the user knows": So still add `.mockable.` pragma everywhere, just the syntax for how to assign them changes by using a `mockable` block that automatically replaces the "proc-to-mock" with a "mock-proc" that has the same name with a prefix of "mockable" ?
13:06:22FromDiscord<jmgomez> In reply to @Isofruit "So still add `.mockable.`": yes, more and less. You dont have to add the pragma, you just do whatever you need to do to them and generate the final ast with it
13:07:11FromDiscord<Phil> And the final ast is the thing I would then test if I'm understanding you right?
13:10:05FromDiscord<jmgomez> You do the same logic that you were doing in your pragma per proc there, which I dont know what it is
13:10:37FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jAs
13:10:49FromDiscord<Phil> Just in case you were wondering
13:12:09FromDiscord<Phil> But yeah, I think I'm just struggling to conjure up the mental images on what that means, likely because not too much macro experience
13:14:33FromDiscord<jmgomez> If that mockable works as pragma and do what you what it to do. You can turn it into a function, get the nnkProcDefs in the there from the p[0] which IIRC should be nnkSmtList and map them to the extracted func
13:30:24FromDiscord<Phil> I don't think I'm sure that works
13:34:52FromDiscord<Phil> sent a long message, see http://ix.io/4jAA
13:35:25FromDiscord<Phil> (edit) "http://ix.io/4jAA" => "http://ix.io/4jAB"
13:38:01FromDiscord<Phil> Wait... Shit this may still suck if it comes to testing one of the procs that you previously replaced as part of another test, unless they're individually compiled so the "swapping out" part of the mocking does not apply.↵Which I am not sure is the case
13:38:35FromDiscord<Phil> (edit) "they're" => "test files are"
13:43:47FromDiscord<jmgomez> Im not sure how you think it changes the approach, it should be the same as with the pragma alone↵The pragma implementation, I guess you assume there is a procNameBase around? (you can check it with compiles() btw). If that procNameBase is not available in the context you should make it so it works as it supposed to
13:57:20NimEventerNew thread by boia01: Javascript backend and implicit cstring conversions, see https://forum.nim-lang.org/t/9764
14:00:29*ltriant quit (Ping timeout: 260 seconds)
14:14:51*jmdaemon quit (Ping timeout: 268 seconds)
14:21:26FromDiscord<Phil> I think it might just not be sinking that this entire "make proc A in module A replaceable" could be done outside of module A and in a testModule for module B
14:26:28*ltriant joined #nim
14:36:02*ltriant quit (Ping timeout: 272 seconds)
14:38:01FromDiscord<Phil> Wait, this entire replacing with mock thing may not be an issue!
14:39:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jAP
14:42:05FromDiscord<Phil> Okay, with this minimal example out of the way, let's see how this acts if I try to follow the thing with the function you suggested @jmgomez
14:43:23*arkurious joined #nim
14:56:06FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jAR
14:57:12FromDiscord<Phil> My understanding is that I need to change what is behind the pointer that is the `get5` proc in the get5Module, since you can't swap out the pointer itself
14:59:26FromDiscord<Phil> Wait, you mentioned getImpl time to look at that
15:00:40FromDiscord<jmgomez> sent a code paste, see https://paste.rs/SRD
15:03:16FromDiscord<Phil> Wait, wouldn't that mean that I would need to do changes in the actual code?
15:03:49FromDiscord<Phil> The way I see this working is that I would need to go into `add5Module` and change the proc there to have a when flag
15:04:09FromDiscord<jmgomez> Your macro/pragma mockable does that for you
15:04:41FromDiscord<jmgomez> you still need to mark them or to put them in a mockable block though
15:05:47FromDiscord<jmgomez> Never tested that approach but you can define hooks on any module so it should work I think
15:06:53*ltriant joined #nim
15:07:43FromDiscord<Phil> Somewhere in there is a core assumption that I currently believe is impossible and is why it's just not parsing for me
15:07:52FromDiscord<Phil> The key issue I have is I don't see where that one is
15:08:48FromDiscord<Phil> I think I shall make some dumplings in the meantime, maybe it comes to me
15:12:08*ltriant quit (Ping timeout: 272 seconds)
15:22:57*rockcavera joined #nim
16:22:24*nick2 joined #nim
16:50:06FromDiscord<albassort> why does hasKeyOrPut return a boolean if it inserts the variable into the table
16:50:12*tiorock joined #nim
16:50:12*tiorock quit (Changing host)
16:50:12*tiorock joined #nim
16:50:12*rockcavera is now known as Guest1367
16:50:12*Guest1367 quit (Killed (mercury.libera.chat (Nickname regained by services)))
16:50:12*tiorock is now known as rockcavera
16:50:28FromDiscord<albassort> shouldn't it be {.discardable.}
16:52:54FromDiscord<HitBlast> In reply to @Elegantbeef "`std/options`": could it be done with `reverse: string or nil` ?
16:52:58FromDiscord<HitBlast> the error disappears if I do either of them
16:53:05FromDiscord<HitBlast> (edit) "do" => "use"
16:56:01*tiorock joined #nim
16:56:01*tiorock quit (Changing host)
16:56:01*tiorock joined #nim
16:56:01*rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services)))
16:56:01*tiorock is now known as rockcavera
17:06:23FromDiscord<Phil> Generally if you want to indicate something may be there or not, use optionals
17:06:55FromDiscord<Phil> Using nil directly in Nim code is generally discharged and usage of optionals whenever nil is a possibility generally encouraged
17:07:12FromDiscord<Phil> (edit) "discharged" => "discouraged"
17:07:44FromDiscord<HitBlast> In reply to @Isofruit "Using nil directly in": so should I wrap it using `Option[string]`?
17:08:04FromDiscord<Phil> Pretty much
17:08:07FromDiscord<HitBlast> https://media.discordapp.net/attachments/371759389889003532/1056851688465629184/Screenshot_2022-12-26_at_2.31.02_PM.png
17:08:14FromDiscord<HitBlast> here's the previous screenshot for reference
17:09:52FromDiscord<Phil> I think my life would be easier if you just put the code into a ↵\`\`\`nim↵\`\`\`↵block in chat so I could have an easier time copy pasting to try it out locally 😛
17:10:08FromDiscord<Phil> (edit) "I think my life would be easier if you just put the code into" => "sent" | "↵\`\`\`nim↵\`\`\`↵block in chat so I could have an easier time copy pasting to try it out locally 😛" => "long message, see http://ix.io/4jCB"
17:10:28FromDiscord<HitBlast> here it is
17:10:29FromDiscord<HitBlast> sent a code paste, see https://play.nim-lang.org/#ix=4jCC
17:10:32FromDiscord<HitBlast> I get an error though
17:10:38FromDiscord<HitBlast> type mismatch
17:11:05FromDiscord<HitBlast> (edit) "https://play.nim-lang.org/#ix=4jCC" => "https://paste.rs/DUW"
17:11:45FromDiscord<Phil> Ah, for reference, are you aware of how optionals generally work (they're a concept in a lot of languages, so I assumed you'd encountered them before) ?
17:12:22FromDiscord<HitBlast> In reply to @Isofruit "Ah, for reference, are": Yeah
17:12:31FromDiscord<HitBlast> In Python, especially
17:12:37FromDiscord<HitBlast> using the `typing` module
17:13:07FromDiscord<Phil> Ah dang, dinner.↵The short version is:↵"nil" is not a valid value for an optional.↵To create one you need to do `some "somestring"` or `none string` (note that for none you need to throw in the type, not an explicit value.
17:13:32FromDiscord<HitBlast> In reply to @Isofruit "Ah dang, dinner. The": could I do `none(string)` as well?
17:13:35FromDiscord<Phil> Of course you can also do `some("somestring")` and `none(string)` respectively
17:14:00FromDiscord<Phil> Yeah, it's all the same, nim allows a lot of different syntaxes to make sure you can express yourself the way you think is most sensible/understandable
17:14:07FromDiscord<albassort> In reply to @Isofruit "Using nil directly in": why
17:14:36FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1056983380505395230/image.png
17:14:40FromDiscord<albassort> theres no other way to do this really
17:15:04FromDiscord<auxym> Option forces you (at compile time) to check for some/none. It's easy to forget to check isNil and get nil error bugs at runtime
17:15:24FromDiscord<albassort> based on this comment i think you're saying i used the right usecase
17:16:27FromDiscord<auxym> I mean, feel free to use nil as long as you're aware of the tradeoffs. the XML stuff in the stdlib makes liberal usage of nil results when a node isn't found, for example.
17:17:00FromDiscord<auxym> but you have to be disciplined with isNil checks
17:17:32FromDiscord<albassort> @ElegantBeef funny thing, for some distinct types but not other having the HASH and $ procs caused compiler errors, so I ended up only keeping the ==
17:17:46FromDiscord<HitBlast> In reply to @Isofruit "Yeah, it's all the": This fixes the error.↵↵However, now if I try to loop through the items in the sequence, how would I be able to check if `reverse` represents nil https://media.discordapp.net/attachments/371759389889003532/1056984178803089448/Screenshot_2022-12-26_at_11.13.59_PM.png
17:17:48FromDiscord<HitBlast> (edit) "nil" => "nil?"
17:17:58FromDiscord<albassort> oh wait that didn't solve it
17:18:33FromDiscord<albassort> i think i gotta write one specifically for float32 and float64
17:22:35FromDiscord<albassort> hmm
17:28:40*rockcavera quit (Read error: Connection reset by peer)
17:28:56*rockcavera joined #nim
17:28:56*rockcavera quit (Changing host)
17:28:56*rockcavera joined #nim
17:37:28FromDiscord<Phil> In reply to @HitBlast "This fixes the error.": Check out the docs of the std options module. In general isNone
17:38:44FromDiscord<Phil> In reply to @albassort "why": Because nil, none and other counterparts were a terrible idea.↵Generally, being able to have runtime errors when they could just be compile-time errors instead is bad
17:39:23FromDiscord<Phil> options fix that by discouraging (though not making it impossible) code that ignores the possibility of a value not being there/existing
17:55:44FromDiscord<albassort> In reply to @Isofruit "Because nil, none and": I agree
17:55:50FromDiscord<albassort> nil shoudln't be allowed in runtime
17:55:53FromDiscord<albassort> only in static
17:55:59FromDiscord<albassort> (edit) "only in static ... " added "contexts"
17:56:13FromDiscord<albassort> I have never used nil in runtime because thats stupid
17:56:14FromDiscord<Phil> Imo it's a "whenever you can" kind of thing
17:56:19FromDiscord<Phil> It just improves correctness
17:56:44FromDiscord<Phil> whenever you can and it make sense
17:57:47FromDiscord<Phil> @Yandall Thanks for adding the feature to HTest!
17:59:27FromDiscord<Yandall> Its ok. thanks for helping me improving the library
18:11:53*pro quit (Quit: pro)
18:13:25FromDiscord<albassort> should i ever recommend someone to use INCLUDE with my library lol
18:13:38FromDiscord<albassort> because im having issues
18:14:01FromDiscord<albassort> (edit) "because im having issues ... " added "with hash using the internal defined functions"
18:20:37FromDiscord<Ailuros 💖🧡💛💚💙💜🖤> sent a long message, see http://ix.io/4jCQ
18:37:22FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jCV
18:38:19FromDiscord<Phil> In reply to @albassort "should i ever recommend": If it's technically necessary it is technically necessary.↵I require my users to literally copy paste `.nimja` files from my package directory to their project if they want to use `snorlogue` , literally not possible otherwise
18:38:40FromDiscord<Phil> Though I am still unconvinced that you can't achieve your thing with an Object Variant and somehow that makes all things better
18:38:57FromDiscord<Phil> But I also am too lazy to invest the required amount of energy to prove me right
18:39:56FromDiscord<albassort> I personally think classifiers are the best way to do it
18:40:02FromDiscord<albassort> Because of the fact that you need to write classifiers anyway
18:40:10FromDiscord<albassort> No matter what you're doing if you're using the same type you're going to use classifiers somehow
18:40:17FromDiscord<albassort> Somewhere on your tool chain you'll need to classify one from the other
18:40:23FromDiscord<albassort> It'll just be faster to embed it into the proc
18:41:53FromDiscord<albassort> No matter what you're doing if you're making a table using the same type, you're going to have no type safety even in standard tables
18:45:20FromDiscord<Phil> "no type safety" in what sense? That you can't be sure that the value you currently got came as a key or as a value?
18:47:19FromDiscord<albassort> In reply to @Isofruit ""no type safety" in": No type safety in the sense that if you don't evaluate the output you don't know if it's in a different "class" as the input
18:47:22FromDiscord<albassort> In the context where it matters
18:47:49FromDiscord<albassort> {"0": "01"}
18:47:56FromDiscord<albassort> (edit) ""01"}" => ""00"}"
18:48:12FromDiscord<albassort> there is no guarantee that key and val aren't the same
18:48:22FromDiscord<albassort> (edit) "there is no guarantee that key and val aren't the same ... " added "'type'"
18:49:01FromDiscord<albassort> you just gotta make sure you dont add {"1" : "1"} and not {"1" : "01"}
18:55:27*tiorock joined #nim
18:55:28*tiorock quit (Changing host)
18:55:28*tiorock joined #nim
18:55:28*rockcavera is now known as Guest7011
18:55:28*Guest7011 quit (Killed (erbium.libera.chat (Nickname regained by services)))
18:55:28*tiorock is now known as rockcavera
18:57:40*rockcavera quit (Remote host closed the connection)
18:58:40*rockcavera joined #nim
19:08:31*ltriant joined #nim
19:13:27*ltriant quit (Ping timeout: 252 seconds)
19:15:12om3gahi! is there any chance to access object element as its index, for example as array[n]?
19:15:50om3gaI assume this is not possible
19:16:29FromDiscord<Ailuros 💖🧡💛💚💙💜🖤> sent a long message, see http://ix.io/4jDa
19:25:41FromDiscord<Ash321> Are arrays pass by value in nim?
19:27:07FromDiscord<huantian> Yes
19:34:35*nick2 quit (Ping timeout: 248 seconds)
19:38:53FromDiscord<auxym> In reply to @om3ga "hi! is there any": yes, define a `[]` procedure for your object type. example: https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/collections/tables.nim#L340
19:39:16FromDiscord<albassort> It's weird how much of Nim we have encoded in our brains
19:39:38om3gaalbassort: wow! Thanks a lot! awesome
19:39:55FromDiscord<auxym> In reply to @Ash321 "Are arrays pass by": they are pass-by-value semantically, but internally may be compiled to pass-by-reference for performance reasons. Also, `var` arguments are always by reference, for obvious reasons
19:40:14FromDiscord<albassort> I didn't answer your question because I didn't understand what you asked
19:40:15om3gaauxym: Thanks a lot! great!
19:40:20FromDiscord<albassort> Why did you @ me
19:40:25FromDiscord<auxym> lol.np
19:40:32om3gaalbassort, by mistake, sorry
19:40:36FromDiscord<Ash321> Thanks
19:41:26FromDiscord<sealmove> wtf https://media.discordapp.net/attachments/371759389889003532/1057020333762297856/image.png
19:41:38FromDiscord<sealmove> is nim popular in data science? :p
19:41:41FromDiscord<auxym> @om3ga: you could even automate the creation of `[]` procs with a macro using compile-time introspection like fieldpairs, but that's sort of advanced
19:43:05FromDiscord<auxym> In reply to @Ash321 "Thanks": FYI, last I checked, anything larger than 24 bytes was passed by reference, internally, to avoid copies.
19:43:16FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1057020795009896518/image.png
19:43:27FromDiscord<albassort> hmmm
19:43:32FromDiscord<sealmove> weird
19:43:34FromDiscord<albassort> In reply to @รєคɭ๓๏שє "wtf": You know what happened here
19:43:42om3gaauxym, in current case I made mistake, that lead at the end to such situation, I should carefully plan data structures next time
19:43:44FromDiscord<albassort> frontend engineer heard some R guy talk about nim
19:43:52FromDiscord<albassort> and they were like "lets just make sure users aren't confused"
19:43:53FromDiscord<sealmove> lol xD yeah probably
19:44:31FromDiscord<sealmove> because it's easy to confuse "Python" with R or Nim
19:44:34FromDiscord<sealmove> very similar names
19:45:10om3gawhat the heck is data engineering
19:45:14FromDiscord<albassort> also data science vs data engineer???
19:45:18FromDiscord<albassort> (edit) "engineer???" => "engineering???"
19:45:23FromDiscord<albassort> implementation of data science i presume
19:45:33FromDiscord<auxym> apparently something nim (and R) has absolutely, never, any use in.
19:45:38FromDiscord<auxym> 🙄
19:45:44om3gawhat a stupid new terminology
19:45:45FromDiscord<albassort> sadged rip R
19:45:55FromDiscord<albassort> R had a solid 20 year run
19:45:56FromDiscord<albassort> ded
19:46:05FromDiscord<sealmove> data engineering is actually very different from data science
19:46:13FromDiscord<Ash321> Hackers are using nim?????
19:46:15om3gawhat is it then?
19:46:24FromDiscord<Phil> In reply to @Ailuros 💖🧡💛💚💙💜🖤 "It's not immediately a": what you could do, which would be slightly wild, would be you write each module exactly identically. Each module has an "executeCommand" proc and based on the incoming string you execute `module.executeCommand(input)`. You'd have a central "executeCmd" proc that contains a case-statement that checks for the incoming string which module applies.↵It's a kind of usi
19:46:28FromDiscord<albassort> In reply to @Ash321 "Hackers are using nim?????": hackers use anything with macros
19:46:31om3gahow it is possible to engineer the data
19:46:32FromDiscord<auxym> yeah, my understanding is that "data science" is coming up with models and stuff, "data engineering" is making a production system out of it.
19:46:33FromDiscord<Ash321> So i decided to take a look
19:46:42FromDiscord<sealmove> In reply to @om3ga "what is it then?": transfering and transforming data, before they are analyzed
19:46:46FromDiscord<albassort> hackers main motive is to move and lurk around antiviruses
19:46:53FromDiscord<albassort> if your memory keeps mutating its harder to detect
19:46:56FromDiscord<albassort> C macors suck
19:47:00FromDiscord<albassort> nim macros are pretty pog
19:47:02FromDiscord<albassort> so thats what they do
19:47:04FromDiscord<albassort> (edit) "do" => "use"
19:47:08FromDiscord<auxym> In reply to @albassort "hackers use anything with": especially excel macros
19:47:10om3gasealmove, we always called that re-formatting
19:47:14FromDiscord<auxym> (as an attack vector)
19:47:24FromDiscord<albassort> those are the most impressive attacks
19:47:36FromDiscord<sealmove> In reply to @om3ga "<@173424250319929344>, we always called": ok new name then ^^
19:47:37FromDiscord<albassort> mostly because of microsofts incompetence
19:47:54om3gasealmove, right, thnx for the explanation
19:48:22FromDiscord<albassort> should i learnR
19:48:24FromDiscord<Ash321> Why there is no large scale adoption of nim...given that nim is older than rust
19:48:24FromDiscord<albassort> (edit) "learnR" => "learn R"
19:48:36FromDiscord<albassort> There is small-scale
19:48:46FromDiscord<albassort> but nim is a tough sell vs C++ for companies
19:48:47FromDiscord<Ash321> It looks like a cool language
19:48:50FromDiscord<albassort> (edit) "C++" => "C++/Ru" | "companies" => "companiest"
19:48:55FromDiscord<albassort> (edit) "C++/Ru" => "C++/Rust"
19:49:22FromDiscord<albassort> because c++ and rust has far larger talent pools and a tons of code
19:49:24FromDiscord<scruz> Is Nim faster or close to being as fast as Rust in the new update
19:49:35FromDiscord<albassort> In reply to @scruz "Is Nim faster or": its been like that since Orc
19:49:38FromDiscord<albassort> so like 2019
19:49:40FromDiscord<Ash321> Rust scares me tbh
19:49:42FromDiscord<scruz> I see
19:49:59FromDiscord<auxym> In reply to @Ash321 "Why there is no": because rust is backed by mozilla
19:49:59FromDiscord<albassort> should be around 10% of Rust
19:50:05FromDiscord<Phil> In reply to @scruz "Is Nim faster or": I can make python as fast as Rust if I implement Rust badly
19:50:13FromDiscord<scruz> do it
19:50:23FromDiscord<albassort> phil is gonna implement sleep loops
19:50:25FromDiscord<auxym> rust's syntax scares me 😛
19:50:36FromDiscord<albassort> rust is bad
19:50:59FromDiscord<albassort> mostly because i haven't used it enough
19:51:00FromDiscord<albassort> thats why its bad
19:51:06FromDiscord<Phil> You misunderstand the joke, language performance comparisons stop making sense the nanosecond adequate low-level tooling is available because at that point it all becomes an exercise of "How well did you optimize?"
19:51:30FromDiscord<Ash321> C++ wasn't hard enough for them
19:51:44FromDiscord<albassort> i just like C
19:51:44FromDiscord<scruz> In reply to @Isofruit "You misunderstand the joke,": I'm trying to make a joke app so that i can compare it to the one made in rust
19:52:00FromDiscord<albassort> hehe funny joke software development :)
19:52:21FromDiscord<Phil> So asking for what's faster just isn't sensible. If I implement an algorithm badly it'll be slow, no matter what language it's in (exceptions are Python and only to a certain degree JS, as JS engines are insanely optimized)
19:52:39FromDiscord<scruz> gotcha
19:53:20FromDiscord<Phil> We had that often enough with benchmarks where "Rust is faster".... because in one example Rust was running well implemented multi-threaded code and the other was running nim single threaded
19:54:50FromDiscord<Phil> Once I saw these examples I really just stopped giving a fuck because when you're that low level it just doesn't matter, more that you have the option available to optimize that hard if you want.↵And everywhere else nim just is more convenient. easier syntax, easier metaprogramming, easier to understand even with low amounts of learning material
19:55:01FromDiscord<Ash321> https://programming-language-benchmarks.vercel.app/nim-vs-rust ↵↵Is this a valid comparision?
19:55:57FromDiscord<scruz> >timeout ? https://media.discordapp.net/attachments/371759389889003532/1057023987131105400/unknown.jpeg
19:56:35FromDiscord<scruz> is this about the multi--thread/single-thread
19:56:46FromDiscord<Phil> You can search for that very link and the least 3 times it was posted (10 months ago, 5 months ago by me, 3 months ago by albassort etc.)
19:56:47FromDiscord<scruz> (edit) "multi--thread/single-thread" => "multi-thread v/s single-thread"
19:57:12FromDiscord<albassort> do you guys think i can get a opengl->haskell->c->nim bridge working
19:57:38FromDiscord<Phil> In reply to @albassort "do you guys think": The fact you have so many conversion steps going would make me shy away from that before I even wrote a single line of code
19:58:00FromDiscord<albassort> theres probably more
19:58:11FromDiscord<Phil> Do you just like pain?
19:58:23FromDiscord<albassort> i wanna fun futhark code from nim!
19:58:43FromDiscord<Phil> It's just that at some point I feel like I'm starting to see a pattern is all 😛
19:58:56FromDiscord<scruz> CBT
19:59:09FromDiscord<albassort> that every programming thing i do is stupid
19:59:38FromDiscord<Phil> Nah, that you like to follow your implementation idea to the bitter end, that's how I'll word it 😛
19:59:42FromDiscord<scruz> Unpopular opinion - but I don't like UFCs
19:59:49FromDiscord<scruz> (edit) removed "-"
19:59:55FromDiscord<Phil> UFC as in?
20:00:08FromDiscord<scruz> Universal function calls
20:00:23FromDiscord<Phil> Ah, people will remind me of that and I will keep reading it as "Underground Fight Club"
20:00:34FromDiscord<scruz> echo('')↵echo ''
20:00:36FromDiscord<Phil> (edit) "remind" => "keep reminding"
20:00:42FromDiscord<Phil> Anyway, I think UFC is fine
20:00:55FromDiscord<albassort> In reply to @Isofruit "Nah, that you like": eventually i tear it all out and refacotr
20:00:57FromDiscord<albassort> (edit) "refacotr" => "refactor"
20:01:29FromDiscord<Phil> In reply to @albassort "eventually i tear it": Well that's why I wrote "bitter" end 😛
20:03:29FromDiscord<albassort> I'm sitting on an nearly finished project here
20:03:30FromDiscord<Phil> In reply to @albassort "rust is bad": I disagree, it's got some good ideas going on.↵Striving for more correctness is always a good idea.↵That the syntax is somewhat unwieldy in comparison and that the performance comparison questions are just so, so tired is a different matter altogether.
20:03:33FromDiscord<albassort> but I want to test it
20:04:05FromDiscord<albassort> I don't know much rust, i say its bad jokingly
20:04:10FromDiscord<albassort> my few experiences with it weren't the best
20:04:42FromDiscord<Phil> Tried it for 3 months, never clicked with me and was always way more painful than it had any right to be.↵Nim in comparison just "clicked"
20:05:28FromDiscord<Phil> If coding feels like somebody is pulling your teeth out then something is wrong
20:06:19*nick2 joined #nim
20:06:43FromDiscord<albassort> flashes back to c++
20:09:00FromDiscord<Ash321> Using chatgpt to guide me through nim docs
20:09:48FromDiscord<Ash321> It has some nice examples
20:12:37*pro joined #nim
20:13:26*pro quit (Client Quit)
20:14:03*nick2 quit (Ping timeout: 260 seconds)
20:22:12FromDiscord<Ash321> Stackoverflow gurus will be using chatgpt in future 🤣
20:28:36FromDiscord<Phil> I doubt it, particularly for Nim as chatgpt can very confidently be very wrong
20:29:11FromDiscord<Phil> Well, in the immediate future
20:29:27FromDiscord<Ash321> It will get better mate
20:29:29FromDiscord<Phil> Future iterations of that bot may be better
20:29:40FromDiscord<Phil> Yeah, would be nice
20:30:03FromDiscord<Ash321> It's nice tool over all
20:30:36FromDiscord<Ash321> The answers it gives are sometimes crazy.
20:30:52FromDiscord<Ash321> And sometimes very sane.
20:38:02*wallabra_ joined #nim
20:39:29*wallabra quit (Ping timeout: 260 seconds)
20:39:29*wallabra_ is now known as wallabra
20:50:00FromDiscord<Phil> Okay, time to put myself behind vindaars macro and understand it
20:56:31FromDiscord<ambient> chatgpt works with Nim? cool. I just wish they didn't want my phone number to use it
21:03:43FromDiscord<ShalokShalom> In reply to @Ash321 "Stackoverflow gurus will be": They already prevent that
21:05:56FromDiscord<ShalokShalom> In reply to @Isofruit "So asking for what's": Isnt it interesting, how much faster Bun is compared to V8?
21:06:21FromDiscord<ShalokShalom> Google is developing V8.
21:06:24*kenran joined #nim
21:06:37FromDiscord<ShalokShalom> And you might think, they get it up to the speed of a single developer project.
21:06:41*kenran quit (Remote host closed the connection)
21:06:45FromDiscord<Phil> In reply to @ShalokShalom "Isnt it interesting, how": I'd be much more interested to see performance comparisons between of Bun-JS vs. any kind of native code
21:07:15FromDiscord<Phil> Because if that is close enough that's a real brain breaker
21:07:27FromDiscord<ShalokShalom> Why?
21:07:30FromDiscord<Phil> That a language as terrible as JS is officially good enough to compete with native
21:07:37FromDiscord<ShalokShalom> ?
21:07:58FromDiscord<Phil> Like, JS of all things as the main-stream language for all things
21:08:01FromDiscord<ShalokShalom> I do think, JS as a language is very little related to it being a compilation target
21:08:16FromDiscord<ShalokShalom> What they do with JS, they could do with any language
21:08:24FromDiscord<ShalokShalom> I think thats hardly related.
21:09:12FromDiscord<ShalokShalom> Sure, I think ultimately can Lua be optimized more than Javascript
21:09:14FromDiscord<ShalokShalom> I guess
21:10:40FromDiscord<ShalokShalom> In reply to @Ash321 "Stackoverflow gurus will be": https://meta.stackoverflow.com/questions/421831/temporary-policy-chatgpt-is-banned
21:12:53FromDiscord<voidwalker> Uhm, what means do I have to do something like `let key, value = param.split("=", maxsplit=1)`
21:13:03FromDiscord<voidwalker> so that key is the [0] element, and value the [1]
21:14:57FromDiscord<ShalokShalom> Oh, that is nice:↵https://sourcegraph.com/search
21:15:17*ltriant joined #nim
21:18:01FromDiscord<Phil> Errr if I wanted to summarize "method", "proc" and "func" with a word, what should I call it? Callable?
21:18:23FromDiscord<Phil> For variable names.↵"callableNode" for example. Not sure if that's accurate though
21:20:54FromDiscord<jmgomez> In reply to @ShalokShalom "And you might think,": AFAIK is based on apple's js runtime
21:22:08FromDiscord<jmgomez> In reply to @ShalokShalom "I do think, JS": right, there is a lot of engineering power put it into make it fast
21:22:51FromDiscord<ShalokShalom> In reply to @jmgomez "AFAIK is based on": Yes
21:22:59FromDiscord<ShalokShalom> But that is not much faster than V8
21:23:07FromDiscord<ShalokShalom> So I guess its the work around that
21:23:20FromDiscord<ShalokShalom> Ultimately, its not faster than V8, its faster than Node.
21:23:51FromDiscord<ShalokShalom> But if Bun can make Bun faster than Node, why cant Google make Chromium so fast as Bun?
21:23:56FromDiscord<ShalokShalom> Very naive question.
21:25:04FromDiscord<ShalokShalom> In reply to @Isofruit "Errr if I wanted": Every language calls things different
21:25:13FromDiscord<ShalokShalom> I think callable is fine, in that instance
21:25:31FromDiscord<Phil> Nim has its own definition of "Callable" is mostly why I'm asking and I don't have a full grasp of callable
21:25:38FromDiscord<ShalokShalom> Although, some languages call "Callables" something, that is implemented as something specific.
21:25:50FromDiscord<ShalokShalom> In reply to @Isofruit "Nim has its own": Yeah, thats exactly what I mean. 🙂
21:26:03FromDiscord<ShalokShalom> I think macros are also callables?
21:26:15FromDiscord<ShalokShalom> And concepts?
21:26:17FromDiscord<ShalokShalom> Templates.
21:26:52FromDiscord<Phil> If that's the case then using "callable" would be incorrect for me as I do not include macros or templates
21:26:57FromDiscord<ShalokShalom> I think, ultimately, it doesnt matter, so long as you name it as something related to the implementation
21:27:08FromDiscord<ShalokShalom> Since so long will you look towards the computer
21:27:24FromDiscord<ShalokShalom> Once you talk to a human, you come up with words that relate to them
21:27:37FromDiscord<ShalokShalom> And that might be different as the implementation detail.
21:27:45FromDiscord<ShalokShalom> Thats declarative. 🙂
21:27:51FromDiscord<Phil> In reply to @ShalokShalom "Once you talk to": The thing is you implement code based on a shared understanding
21:28:04FromDiscord<Phil> The shared understanding you can assume a nim programmer to have is understanding the words of the language
21:28:22FromDiscord<ShalokShalom> The words that Nim uses?
21:28:26FromDiscord<Phil> Using those words in a way that the language doesn't use them is the confusing them
21:28:35FromDiscord<ShalokShalom> I can see that.
21:28:40FromDiscord<Phil> Nim uses callable, describing something myself as callable that nim doesn't will confuse
21:29:06FromDiscord<ShalokShalom> Sure
21:29:29FromDiscord<ShalokShalom> Where do you find the Nim definition of callable?
21:29:35FromDiscord<Phil> So its preferrable to use precise wording here, I'm currently just running into the wall that it may not be feasible to go for something else because there is no other word in the namespace that I'm aware of
21:31:51FromDiscord<Phil> sent a code paste, see https://paste.rs/7NF
21:32:30FromDiscord<Phil> I may just go for "isMockable" for my custom context
21:32:48FromDiscord<ShalokShalom> I can see that
21:32:52FromDiscord<ShalokShalom> Good definition
21:35:02FromDiscord<ShalokShalom> Hnn, has Nim a signal/slot implementation?
21:35:10FromDiscord<ShalokShalom> Or some idea of the observer pattern?
21:35:50FromDiscord<Phil> Not that I'm aware of, but a signalling system isn't that hard to implement, albeit it's slightly tricky
21:36:51FromDiscord<ShalokShalom> I just wonder
21:36:52FromDiscord<Phil> I did one for my side-project, stores a bunch of pointers to procs that all need to have the same signature in a table, then every time something happens it takes out the seq of procs for this particular occurrence, and if there are any they are executed one after another, all of this happening in sync.
21:37:04FromDiscord<ShalokShalom> It kinda fits the philosophy of Nim, I think
21:37:30FromDiscord<Phil> An async-based observer pattern I'm not aware of at all
21:37:48FromDiscord<Phil> Only seen that in rxjs so far
21:38:57FromDiscord<ShalokShalom> Does that hold weak references
21:39:16FromDiscord<ShalokShalom> Or would ORC prevent memory issues?
21:39:29FromDiscord<ShalokShalom> Like, in your implementation.
21:40:00FromDiscord<Phil> That is actually a good point and I'm not sure, I'm not that deep that I actually know precisely when I see a weak ref or not.↵All I can tell you is that it works so far and the type annotation that I have in said table is pointer
21:41:04FromDiscord<ShalokShalom> Do you think, this goes well with Nim?
21:41:21FromDiscord<ShalokShalom> I am kinda struck, that this kinda didnt come to my mind earlier ^^
21:41:25FromDiscord<Phil> https://github.com/PhilippMDoerner/NimStoryFont/blob/master/src/applications/core/signalSystem.nim↵Here for reference
21:41:43FromDiscord<ShalokShalom> You have seen the old one? https://github.com/fowlmouth/signals.nim
21:42:05FromDiscord<voidwalker> So I guess I am looking for "unpacking". I only need to unpack the seq elements so I can assign like `let (key, value) = ( param.split("=", maxsplit=1).asElements )
21:42:11FromDiscord<voidwalker> (edit) ")" => ")`"
21:42:20FromDiscord<voidwalker> possible without external macros ?
21:42:29FromDiscord<ShalokShalom> Like how you document, again 😄
21:42:49FromDiscord<Phil> In reply to @ShalokShalom "You have seen the": Can't say I have, but mine was mostly geared towards being an imitation of Django Signals and I'm iwlling to bet fowlmouth's wasn't
21:43:16FromDiscord<ShalokShalom> I mostly know them from Qt and Smalltalk
21:43:22FromDiscord<ShalokShalom> I assumed they were all the same
21:43:31FromDiscord<ShalokShalom> And GDScript
21:43:37FromDiscord<Phil> I see the readme and see that whatever signal thingy they're doing is already more complex
21:43:49FromDiscord<ShalokShalom> I mean, how different can it be
21:43:51FromDiscord<ShalokShalom> signal, slot
21:43:55FromDiscord<ShalokShalom> 😄
21:43:58FromDiscord<Phil> My "Signalsystem" is mostly a kind of "also execute these procedures before/after you perform these operations"
21:44:02FromDiscord<ShalokShalom> async maybe
21:44:08FromDiscord<Phil> That's the way Django does it
21:44:12FromDiscord<Phil> And it's all sync
21:44:23FromDiscord<ShalokShalom> So long as you can implement the observer pattern with it...
21:44:27FromDiscord<ShalokShalom> I am fine
21:44:47FromDiscord<Phil> Hmm I think mine is more limited in that regard
21:45:07FromDiscord<Phil> Observer pattern requires you to be able to have individual lists of procs for each subscription
21:45:24FromDiscord<Phil> Mine is one big fat list for each norm-model
21:46:00FromDiscord<Phil> No differences between "subscriptions" allowed (not that my signal system has a concept of subscriptions, in that sense its mostly the fact that it can store procs that its even remotely useful)
21:46:00FromDiscord<jmgomez> In reply to @ShalokShalom "Or some idea of": futures
21:46:09FromDiscord<ShalokShalom> Ah
21:46:11FromDiscord<ShalokShalom> Thanks
21:46:34FromDiscord<ShalokShalom> @PhilYou dont link the instance of your AldruneWikiFrontEnd on your README
21:46:41FromDiscord<ShalokShalom> Dont you want, that the people see it?
21:46:57FromDiscord<Phil> More a matter of "forgotten and don't care too much"
21:47:18FromDiscord<ShalokShalom> I see
21:47:21FromDiscord<ShalokShalom> Would like to see it 😄
21:47:22FromDiscord<Phil> Wait, you mean the link to the running server?
21:47:25FromDiscord<Phil> That nobody gets to see anyway
21:47:39FromDiscord<Phil> Very intentionally. There's images hosted on that thing and I own like 5% of those
21:48:06FromDiscord<Phil> So I save myself from any kind of complaints of "hey, you're hosting my art" by just making sure nobody can see it other than my buds and myself
21:48:44FromDiscord<Phil> Like, you can take a look at it, but you'll get stuck on the login page with no registration button anywhere to see
21:49:03FromDiscord<ShalokShalom> I only find this documentation https://nim-lang.org/docs/asyncfutures.html
21:49:13FromDiscord<ShalokShalom> Is that all there is? I doubt
21:49:38FromDiscord<Phil> Also: https://github.com/Tangdongle/nimobserver
21:49:46FromDiscord<ShalokShalom> @Philwell, I meant at least a screenshot
21:49:55FromDiscord<ShalokShalom> something to get an impression about it
21:50:14FromDiscord<ShalokShalom> I always think its kinda pity, if someone doesnt see the frontend.. of a frontend
21:50:50FromDiscord<Phil> Eh, fair point. You can pretty much see that for the most part this project is me implementing stuff for myself and I haven't put that much effort into making it "foreign people useable"
21:51:20*jmdaemon joined #nim
21:51:35FromDiscord<Phil> That's also visible by the fact that the only parts of this code with doc comments are the ones where the code is so out of the norm for me that I wrote them for myself
21:51:59*ltriant quit (Ping timeout: 256 seconds)
21:52:08FromDiscord<Phil> Like, basically the second I deal with pointer you can bet there's doc comments just to explain why the hell I#m doing that to myself
21:52:23FromDiscord<ShalokShalom> asyncfutures seem to be the only Futures in Nim
21:53:01FromDiscord<ShalokShalom> kinda like very well hidden
21:53:37FromDiscord<ShalokShalom> doesnt even mention "this is other peoples signal/slot principles" or something
21:54:19FromDiscord<ShalokShalom> Nim seems sometimes like a hairy guy, who wont talk about its feelings 😄
21:54:53FromDiscord<ShalokShalom> He great strengths, and some of them are hidden behind a lot of pain ^^
21:55:54FromDiscord<Phil> TBF nim's set of language capabilities are a fair bit larger than most langs
21:55:59FromDiscord<Phil> So got a fair bit more to talk about
21:56:25FromDiscord<Phil> You could say "a very rich emotional landscape"
21:57:06FromDiscord<ShalokShalom> Well, if I introduce a feature, I care about its presentation
21:57:08FromDiscord<ShalokShalom> personally
21:57:08FromDiscord<Phil> The one thing I'm missing right around now is the ability to have header files
21:57:17FromDiscord<ShalokShalom> ability?
21:57:22FromDiscord<ShalokShalom> why would you want that?
21:57:34FromDiscord<Phil> Because apparently that's what allows me to mock very easily in C
21:57:48FromDiscord<Phil> I think I found a satisfying way in nim, well, as satisfying as it's going to get for my taste
21:58:12FromDiscord<Phil> and one of these days I'll maybe understand what jmgomez described to me and maybe even be able to do it without a pragma
21:58:48FromDiscord<ShalokShalom> 💡
21:59:36FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jDM
22:00:50FromDiscord<Phil> (edit) "https://paste.rs/79P" => "https://play.nim-lang.org/#ix=4jDN"
22:02:17FromDiscord<Vindaar> well, I often use assertions when I'm too lazy and/or don't want the verbose-ness of regular exceptions. and I mean they're cheap. as long as you don't have assertions for something like array bounds checks, no reason to disable them
22:03:08FromDiscord<Phil> In reply to @Vindaar "well, I often use": I'm mostly used to seeing `assert`, `doAssert` was a first and the difference I got out of the docs for those was that `doAssert`doesn't go away when you try to compile-out the assertion checks
22:03:31FromDiscord<Vindaar> exactly, they remain even in danger mode
22:03:58FromDiscord<Phil> And since they're running for macros they don't affect runtime either way, but increase legibility of any error thrown, good point
22:04:05FromDiscord<Rika> ~~I personally believe way too many people use danger~~
22:04:57FromDiscord<Vindaar> well, I mostly write code for scientific data analysis. I don't care if my code crashes usually 🤣 (well, I care, but you get what I mean)
22:05:44FromDiscord<Phil> In reply to @Vindaar "well, I mostly write": What I think you mean is: "You write blazingly fast code for rocket-speed analysis of scientific data 🚀 "
22:06:25FromDiscord<Phil> Funny sidenote
22:07:10FromDiscord<Phil> `Nim` is close to the german `nimm` which means "take".↵And `nimm2` is a trademark for fruit-based gummy bears in germany
22:07:36FromDiscord<Phil> We're all moving towards increased snackability
22:07:40FromDiscord<Phil> It was inevitable
22:07:48FromDiscord<Vindaar> yummy 😋
22:07:51FromDiscord<Rika> In reply to @Isofruit "What I think you": Don’t forget lightspeed
22:08:20FromDiscord<Phil> In reply to @Rika "Don’t forget lightspeed": For that he'd need to throw out the memory management and do it all by hand, like our forefathers did!
22:08:45FromDiscord<ShalokShalom> Why does the freaking Git binary for Windows have 50mb
22:08:47FromDiscord<ShalokShalom> git!
22:09:03FromDiscord<Phil> I have stopped asking questions why things for windows are weird a long time ago
22:09:08FromDiscord<Phil> Somewhere around 2016 or so
22:09:28FromDiscord<Phil> Which incidentally was the time I dropped windows because Windows10 was looking like a spyware fest
22:09:39FromDiscord<Rika> Lol
22:10:14FromDiscord<ShalokShalom> Coorelates probably with the time frame, at which you started to become sane again 😄
22:10:32FromDiscord<Phil> This implies that during most of my biological studies I was insane
22:10:32FromDiscord<ShalokShalom> Like, good for your mental health
22:10:33*ltriant joined #nim
22:10:36FromDiscord<Phil> Not sure how to feel about that
22:10:43FromDiscord<ShalokShalom> ^^
22:10:49FromDiscord<Phil> Mad scientists don't have a particularly good rep
22:11:50FromDiscord<Phil> Like, when was the last time you heard somebody go "Man, am I glad the mad scientist did something, they were so helpful!"
22:12:27FromDiscord<Phil> Never, that's when!
22:16:54*ltriant quit (Ping timeout: 260 seconds)
22:17:07*sagax quit (Read error: Connection reset by peer)
22:24:42FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jDS
22:27:11FromDiscord<Phil> And I can't really use `open(filePath, FileMode.fmWrite)` because that's using "importc" at compiletime
22:28:25FromDiscord<Phil> And I also can't just return a string from the macro because it wants to return a NimNode or sth
22:32:10FromDiscord<Rika> Are you checking the right path xd
22:32:22FromDiscord<Phil> the echo is giving me correct output
22:32:37FromDiscord<Phil> So I'm at least reading in correctly
22:32:40FromDiscord<Rika> Yes but check the path
22:32:44FromDiscord<Phil> and If I'm reading in correctly I should also be writing correctly
22:32:54FromDiscord<Phil> Since I write to the file I read
22:35:21FromDiscord<Phil> Son of a gun
22:35:40FromDiscord<Phil> It... it writes to a different place than it reads from
22:35:49FromDiscord<Phil> Wait, that makes sense I think, it's just really weird
22:36:16FromDiscord<Phil> It reads in at compile-time, so for that it uses the path of the module, which is in the same directly as the module I throw in at `filePath`
22:36:40FromDiscord<Phil> But for writing it uses runtime, so that's where it uses the path of the binary, which is not the same as the path of the module
22:36:53FromDiscord<Phil> That's kind of wild
22:38:30FromDiscord<Phil> (edit) "binary," => "binary as basePath/origin,"
22:42:59*ltriant joined #nim
22:48:08*ltriant quit (Ping timeout: 272 seconds)
22:48:52FromDiscord<Phil> Sometimes I fascinate myself, how does one even create a seq of static strings
22:49:26FromDiscord<Phil> Apparently `const x: seq[static string] = static: @["string1.nim", "myModule.nim"]` is no bueno
22:52:13FromDiscord<Phil> Wait, this also is invalid? `const m1: static string = "string1.nim"`↵Okay, weird
22:56:13FromDiscord<Phil> Beeeeeeeeeef
23:01:36FromDiscord<Phil> I want to have a list of module names, iterate over them one by one at compile-time and call a macro on them that reads in the module-file, parses its AST, modifies it and overwrites the contents of that module-file with the modified version.↵↵But implicit conversions into NimNodes keep screwing with me
23:02:00FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jE1
23:03:14*ltriant joined #nim
23:04:38FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4jE4
23:05:34FromDiscord<Phil> I don't use neel so I can't say much about that, sorry ^^'
23:12:02FromDiscord<<She>Horizon</Her>> In reply to @Isofruit "Which incidentally was the": It actually completely ignores the opt out settings lol
23:12:20FromDiscord<<She>Horizon</Her>> Windows 10 AME removes all the bloat and windows update at the cost of security
23:14:09FromDiscord<Phil> In reply to @Event Horizon "Windows 10 AME removes": shrugs, either way I could feel the middle finger that win10 turned out to be in the distance and refuse to take a seat on it just to gaslight myself into believing that dealing with that is okay, so I took the plunge and am happier than ever before
23:14:29FromDiscord<Phil> (edit) "before" => "before, as my PC finally is once more a PC that does what I tell it to, instead of being a windows machine that sometimes vaguely listens to me"
23:14:49FromDiscord<Phil> (edit) "refuse" => "refused"
23:28:19FromDiscord<System64 ~ Flandre Scarlet> Is it normal one window works well, and the other (the white one) is totally frozen? https://media.discordapp.net/attachments/371759389889003532/1057077429698580560/image.png
23:28:54FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4jE9
23:31:38*ltriant quit (Ping timeout: 265 seconds)
23:31:54FromDiscord<ambient> is there a faster way to map integers to integers, like Table[int, int] but faster? There's IntSet for sets, but apparently there's no IntTable?
23:39:04*nick2 joined #nim
23:40:09FromDiscord<Phil> In reply to @sOkam! "How would you go": Lots of type aliases so that you don't have to deal with thinking arrays, but thinking in whatever you name individual things
23:40:47FromDiscord<Phil> Like, the array 3 uint8 for example is the RGB of one pixel, right?
23:42:53FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jEa
23:43:47FromDiscord<Phil> Don't think in all of the data pieces at once, think small and work your way up from there on individual abstraction layers
23:43:48FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4jEb
23:45:28FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jEc
23:46:45FromDiscord<Phil> I guess {.thread.} may implicitly spawn a new thread and run the proc
23:48:42FromDiscord<amadan> In reply to @Isofruit "I want to have": Sounds like `patchFile` (https://nim-lang.org/docs/nimscript.html#patchFile%2Cstring%2Cstring%2Cstring) no?
23:49:20FromDiscord<ambient> Seems this is a lot slower than Table[int, int] https://pastebin.com/xpj30tqj what am I doing wrong? 🤔
23:50:24FromDiscord<Phil> In reply to @ambient "is there a faster": Are both sets of integers completely random stuff? Or can one be a continuous list of integers, explicitly: Can you maybe store it in an array/seq ?
23:50:45FromDiscord<ambient> @Phil check my most recent message
23:52:36FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/ijh
23:53:40FromDiscord<Phil> In reply to @amadan "Sounds like `patchFile` (https://nim-lang.org/docs/": I am... not sure at all if that does it.↵Though generally I've managed to get this done, I'm mostly trying to figure out how on earth I can manage to run this macro over a seq of module names or sth
23:54:19FromDiscord<Phil> So I can just throw a list of names at it instead of having to write individually `addMockPragma("module1.nim")` for all modules
23:56:54*ltriant joined #nim
23:57:09FromDiscord<Phil> In reply to @ambient "Seems this is a": I'd assume the "in" statement absolutely has to be slower than in a table.↵You do way more comparisons, meanwhile in a table you just run a hash proc once, check if there's a value behind that key, done
23:57:22FromDiscord<Phil> You sure that getting a value by itself is also slower?
23:57:48FromDiscord<Phil> Like, I'd assume that your `[]=` would be faster since it saves a hashing step
23:58:02FromDiscord<Phil> While everything else is likely slower
23:58:13FromDiscord<ambient> I just do a check on the entire program runtime, haven't found out a way to run sampling profiler on Nim code using Windows 11
23:58:43FromDiscord<ambient> yeah, I'll try using IntSets for the something instead of Seq
23:58:57FromDiscord<Phil> In reply to @ambient "I just do a": You can just use benchy for quick and dirty profiling
23:59:21FromDiscord<Phil> It's "good enough" to get an idea without being hyper exact