00:02:30 | FromDiscord | <auxym> cool |
00:05:18 | FromDiscord | <Elegantbeef> What's the issue? |
00:13:55 | * | ltriant joined #nim |
00:19:16 | * | ltriant quit (Ping timeout: 268 seconds) |
00:21:34 | FromDiscord | <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:00 | FromDiscord | <nqeron> sent a long message, see http://ix.io/4jyJ |
00:22:07 | FromDiscord | <nqeron> This is my staging code |
00:22:21 | FromDiscord | <Elegantbeef> Move is generic |
00:22:26 | FromDiscord | <nqeron> Yes |
00:22:27 | FromDiscord | <Elegantbeef> You need to provide a generic parameter |
00:22:36 | FromDiscord | <nqeron> I've tried that |
00:22:46 | FromDiscord | <nqeron> it's unclear where or how to do so |
00:23:08 | FromDiscord | <Elegantbeef> What is `MoveKind`? |
00:23:30 | FromDiscord | <nqeron> complicated |
00:23:42 | FromDiscord | <nqeron> MoveKind = Place | Spread |
00:24:06 | FromDiscord | <nqeron> sent a long message, see http://ix.io/4jyK |
00:25:24 | FromDiscord | <Elegantbeef> You need to supply that generic parameter to your procedure |
00:26:27 | FromDiscord | <nqeron> sent a long message, see http://ix.io/4jyL |
00:26:31 | FromDiscord | <nqeron> it doesn't like it |
00:27:08 | FromDiscord | <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:33 | FromDiscord | <Elegantbeef> Nim is statically typed so you cannot use a generic here |
00:27:37 | FromDiscord | <Elegantbeef> you want to use an object variant |
00:28:28 | FromDiscord | <nqeron> I'm not entirely sure what that means - I'm still fairly new to nim |
00:29:09 | FromDiscord | <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:57 | FromDiscord | <Elegantbeef> I assume you think `A | B` is a union like in TS or similar |
00:55:03 | FromDiscord | <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:16 | FromDiscord | <Elegantbeef> Not use `func` |
00:55:47 | FromDiscord | <nqeron> I can double check - but I thought it was in a proc |
00:56:20 | FromDiscord | <nqeron> nvm - for some reason I had used func instead of proc |
00:57:31 | FromDiscord | <Elegantbeef> Otherwise you can do `{.cast(noSideEffect).}:` |
00:57:37 | FromDiscord | <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:57 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jyX |
02:13:15 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/inim-repl/INim↵So Nim can be interpreted now? |
02:15:03 | FromDiscord | <Elegantbeef> no inim is compiled |
02:15:15 | FromDiscord | <Elegantbeef> nimscript exists but is a subset |
02:16:45 | FromDiscord | <System64 ~ Flandre Scarlet> oh alright |
02:17:02 | FromDiscord | <System64 ~ Flandre Scarlet> still sounds powerful |
02:17:03 | * | ltriant quit (Ping timeout: 268 seconds) |
02:17:30 | FromDiscord | <albassort> nimscript is basically useless because you need the nim runtime to execute it |
02:17:36 | FromDiscord | <albassort> its in no way its own thing |
02:17:45 | FromDiscord | <albassort> its used for a few things in the nim ecosystem |
02:17:48 | FromDiscord | <System64 ~ Flandre Scarlet> Sometimes I'm thinking Nim is somewhat compiled Python lol |
02:18:07 | FromDiscord | <albassort> Yea, thats because it uses... indents... |
02:18:22 | FromDiscord | <albassort> not at all similar beyond that |
02:18:30 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @System64 "https://github.com/inim-repl/INim So Nim can": And that↵Typically Pythonic |
02:18:39 | FromDiscord | <albassort> yea look at the code i posted |
02:18:40 | FromDiscord | <PunchCake> Just discovered nim arc gc just wraps blocks of code with try finally blocks and then destroys the object lol |
02:18:45 | FromDiscord | <albassort> does that look anything like python? |
02:19:02 | FromDiscord | <albassort> In reply to @PunchCake "Just discovered nim arc": p much |
02:19:13 | FromDiscord | <System64 ~ Flandre Scarlet> No your code isn't pythonic at all |
02:19:38 | FromDiscord | <albassort> its a lot more complicated in its algorithmic concepts, but it works like that |
02:19:48 | FromDiscord | <Elegantbeef> What?↵(@albassort) |
02:19:51 | FromDiscord | <PunchCake> I wonder if the arc gc can be used with kernal dev instead of manual memory management |
02:20:02 | FromDiscord | <albassort> In reply to @Elegantbeef "What? (<@217459674700578816>)": I meant useless detached from nim projects |
02:20:02 | FromDiscord | <Elegantbeef> Likely↵(@PunchCake) |
02:20:04 | FromDiscord | <albassort> it has its uses |
02:20:14 | FromDiscord | <albassort> around the nim ecosystem |
02:21:07 | FromDiscord | <PunchCake> Anyways how hard would it be to reimplment the stdlib to be usable 100% with manual memory management |
02:21:29 | FromDiscord | <albassort> well anything is possible |
02:21:36 | FromDiscord | <Elegantbeef> Quite difficult since there are cyclical structures and seq/string hide their implementations |
02:21:37 | FromDiscord | <albassort> but why would... you wanna do that... |
02:21:53 | FromDiscord | <albassort> In reply to @Elegantbeef "Quite difficult since there": you'd need to redefine that |
02:22:09 | FromDiscord | <PunchCake> In reply to @albassort "but why would... you": To have the option to retain the stdlib for manual memory management |
02:22:15 | FromDiscord | <Elegantbeef> Stable Nim cannot even access a sequence's capacity |
02:22:18 | FromDiscord | <albassort> but why would you want that |
02:22:30 | FromDiscord | <PunchCake> To manually manage memory? |
02:22:41 | FromDiscord | <Elegantbeef> But why would you prefer manual over arc? |
02:22:43 | FromDiscord | <albassort> Yes... but... thats not nims place |
02:22:49 | FromDiscord | <albassort> nim is a modern langauge |
02:22:52 | FromDiscord | <albassort> it can have a gc |
02:22:55 | FromDiscord | <PunchCake> In reply to @Elegantbeef "But why would you": More control |
02:23:11 | FromDiscord | <Elegantbeef> Then use your own datatypes |
02:23:35 | FromDiscord | <albassort> You want to use a language which was designed from the ground up with a gc in mind |
02:23:35 | FromDiscord | <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:38 | FromDiscord | <albassort> and then just |
02:23:40 | FromDiscord | <PunchCake> OH YEAH i forgot to ask why does nim sequence use so much cpu rather than ram? |
02:23:40 | FromDiscord | <albassort> yeet it out |
02:23:50 | FromDiscord | <Elegantbeef> Sequences dont? |
02:23:57 | FromDiscord | <albassort> they... dont? |
02:24:18 | FromDiscord | <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:42 | FromDiscord | <PunchCake> Both get appended to either a list or a seq |
02:24:42 | FromDiscord | <albassort> i... |
02:24:46 | FromDiscord | <albassort> what? |
02:24:58 | FromDiscord | <albassort> you what an array of numbers between 1 and 1 billion? |
02:25:01 | FromDiscord | <Elegantbeef> What's the code and what's the compiler flags? |
02:25:09 | FromDiscord | <PunchCake> In reply to @albassort "you what an array": Yes |
02:25:20 | FromDiscord | <PunchCake> In reply to @Elegantbeef "What's the code and": Not near my pc rn |
02:25:51 | FromDiscord | <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:08 | FromDiscord | <Elegantbeef> That's 7.4gb of ram |
02:26:16 | FromDiscord | <PunchCake> I got 16 |
02:26:21 | FromDiscord | <PunchCake> And my whole pc crashed |
02:26:32 | FromDiscord | <PunchCake> Not lagged crashed crashed turned off |
02:27:39 | FromDiscord | <Elegantbeef> Took 18s on my PC |
02:27:51 | FromDiscord | <PunchCake> With appending to a seq? |
02:28:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jyZ |
02:28:35 | FromDiscord | <PunchCake> Idk if there is any difference but i used countup |
02:28:46 | FromDiscord | <Elegantbeef> Literally same thing |
02:28:47 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1056760458750730280/image.png |
02:28:55 | FromDiscord | <albassort> my computer cant handle it |
02:28:58 | FromDiscord | <albassort> but its fine |
02:28:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jz0 |
02:29:27 | FromDiscord | <PunchCake> Huh i swear it crashed on my pc |
02:29:43 | FromDiscord | <PunchCake> Maybe because i was calling it from python using nimpy bindings? |
02:29:45 | FromDiscord | <Elegantbeef> Well it runs fine here with 16gb |
02:30:20 | FromDiscord | <Elegantbeef> Do you have 8gb free albassort? |
02:31:22 | FromDiscord | <PunchCake> sent a code paste, see https://paste.rs/UQD |
02:31:33 | FromDiscord | <PunchCake> No way you're telling me it completed in 2s |
02:31:38 | FromDiscord | <albassort> i have 8 gb free from the start |
02:31:43 | FromDiscord | <albassort> i cant complete it |
02:32:03 | FromDiscord | <albassort> i think i've found the reason why beef never writes threaded code... |
02:32:08 | FromDiscord | <Elegantbeef> It certainly did complete it in 2s |
02:32:21 | FromDiscord | <albassort> beef what cpu do you have |
02:32:26 | FromDiscord | <PunchCake> Bro you rocking that i200 |
02:32:37 | FromDiscord | <Elegantbeef> 5600x |
02:32:50 | FromDiscord | <PunchCake> I5600x |
02:32:55 | FromDiscord | <PunchCake> 15600 cores |
02:33:00 | FromDiscord | <Elegantbeef> I had a xeon1231v3 for like 5 years 😄 |
02:33:07 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1056761544945455265/image.png |
02:33:10 | FromDiscord | <albassort> sadged |
02:33:17 | FromDiscord | <Elegantbeef> Oh right optimisations |
02:33:31 | FromDiscord | <albassort> beef you gotta optimize it so i can run it without fucking dyinh |
02:33:33 | FromDiscord | <albassort> (edit) "dyinh" => "dying" |
02:33:43 | FromDiscord | <PunchCake> I wonder what 12 threads mean |
02:33:54 | FromDiscord | <PunchCake> If i run 12 threads my cpu will die or something |
02:33:54 | FromDiscord | <albassort> punch how old are you? |
02:33:59 | FromDiscord | <PunchCake> 20 |
02:34:08 | FromDiscord | <PunchCake> Weird question but alright |
02:34:17 | FromDiscord | <albassort> alright who wants to explain to punch what a thread is |
02:34:26 | FromDiscord | <PunchCake> I know what a thread is |
02:34:36 | FromDiscord | <PunchCake> But what the hell does 12 threads in a cpu mean |
02:34:53 | FromDiscord | <PunchCake> Im sure a regular operating system has hundreds of threads running |
02:35:06 | FromDiscord | <albassort> 👍 |
02:35:11 | FromDiscord | <Elegantbeef> Jesus i did a dumb, tried to writing it to a file after stringifing it |
02:35:39 | FromDiscord | <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:07 | FromDiscord | <PunchCake> lmao imagine interpreting nim so you can make sdl2 slower |
02:36:15 | FromDiscord | <PunchCake> Just use python at this point |
02:36:24 | FromDiscord | <Elegantbeef> technically it can use sdl2 but there is no point using inim for things like that |
02:36:29 | FromDiscord | <Elegantbeef> It's a REPL it's not an interpreter |
02:36:48 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
02:36:57 | FromDiscord | <Elegantbeef> Yea this consistently runs at 2s |
02:37:16 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PunchCake "lmao imagine interpreting nim": Interpreting Nim inside Python |
02:37:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jz2 |
02:38:02 | FromDiscord | <Elegantbeef> Albassort does my code run on your system? |
02:38:30 | FromDiscord | <Elegantbeef> Also please give me a short form nickname i can write |
02:38:30 | FromDiscord | <PunchCake> In reply to @System64 "Interpreting Nim inside Python": Then using pypy to speed it up |
02:38:41 | FromDiscord | <PunchCake> Bas |
02:39:13 | FromDiscord | <PunchCake> Is there any point to compile to c++ in nim? |
02:39:34 | FromDiscord | <Elegantbeef> Anyway punch i do have to wonder what the hell code you were writing to crash your PC |
02:39:34 | FromDiscord | <Elegantbeef> I know i had some freezing due to my silly writing to a file |
02:39:36 | FromDiscord | <Elegantbeef> Allocating 16+gb isnt great when you only have 4gb of swap |
02:39:45 | FromDiscord | <Elegantbeef> If you want to use the C++ interop |
02:40:18 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PunchCake "Then using pypy to": what is pypy? |
02:40:31 | FromDiscord | <Elegantbeef> Why did you want to use inim with sdl? |
02:40:42 | FromDiscord | <PunchCake> In reply to @System64 "what is pypy?": JIT compiled python |
02:40:51 | FromDiscord | <Elegantbeef> If you want to script a program using Nim i'd suggest using wasm personally |
02:40:54 | FromDiscord | <PunchCake> In reply to @Elegantbeef "Anyway punch i do": Voodoo black magic lmao |
02:41:29 | FromDiscord | <Elegantbeef> Could also use std/dynlib and make a plugin system |
02:41:37 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PunchCake "JIT compiled python": Oh wait, this is what Python needs! |
02:41:47 | FromDiscord | <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:54 | FromDiscord | <System64 ~ Flandre Scarlet> and does it work with pip and stuff? |
02:41:55 | FromDiscord | <Elegantbeef> Here i though python needed static typing and sensible language design |
02:42:13 | FromDiscord | <PunchCake> Its so slow even pypy devs recommended rewriting the C lib in pypy |
02:42:33 | FromDiscord | <PunchCake> In reply to @System64 "and does it work": Yes you can install all pip packages like you would in cpython |
02:42:48 | FromDiscord | <System64 ~ Flandre Scarlet> but even with pypy it's still slow af? |
02:42:52 | FromDiscord | <PunchCake> I use it with fastapi basically its performance for free |
02:43:01 | FromDiscord | <PunchCake> In reply to @System64 "but even with pypy": No pypy is fast very fast |
02:43:19 | FromDiscord | <albassort> In reply to @Elegantbeef "Albassort does my code": alba |
02:43:20 | FromDiscord | <PunchCake> Im talking about so fast it can nearly match java speed |
02:43:55 | FromDiscord | <Elegantbeef> Ah good didnt think you'd like being called ass↵(@albassort) |
02:44:07 | FromDiscord | <PunchCake> LMAO |
02:44:10 | FromDiscord | <albassort> it also means dawn you little shit |
02:44:21 | FromDiscord | <Elegantbeef> Ass does not mean dawn |
02:44:26 | FromDiscord | <albassort> alba in italian |
02:44:32 | FromDiscord | <PunchCake> In reply to @Elegantbeef "Here i though python": Mypy |
02:44:33 | FromDiscord | <albassort> your code runs fine but, my memory cant handle holding all the data |
02:44:55 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PunchCake "Im talking about so": Oh, impressive!↵I know Java is fast, VERY fast! |
02:45:00 | FromDiscord | <Elegantbeef> optional |
02:45:14 | FromDiscord | <PunchCake> In reply to @System64 "Oh, impressive! I know": Yeah once the jit kicks in its gonna send you to the moon |
02:45:18 | FromDiscord | <PunchCake> Tbh i like java |
02:45:22 | FromDiscord | <albassort> without adding to a buffer it completes in 75 nanoseconds |
02:45:24 | FromDiscord | <PunchCake> Is it a crime to like java |
02:45:28 | FromDiscord | <albassort> holy shit buffers are slow |
02:45:38 | FromDiscord | <albassort> my opinions on java have come a long way |
02:45:41 | FromDiscord | <albassort> its "fine" |
02:45:43 | FromDiscord | <albassort> i prefer c# |
02:45:44 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PunchCake "Tbh i like java": I like Java too, but it really should be less verbose |
02:45:55 | FromDiscord | <PunchCake> I got used to it tbh |
02:46:04 | FromDiscord | <System64 ~ Flandre Scarlet> I wrote a synth in Java |
02:46:10 | FromDiscord | <PunchCake> With a modern ide you type 4 chars and it does the rest |
02:46:21 | FromDiscord | <System64 ~ Flandre Scarlet> 100% Java + JavaFX https://media.discordapp.net/attachments/371759389889003532/1056764881463943249/image.png |
02:46:35 | FromDiscord | <albassort> not really a synth so much as a wave generator |
02:46:42 | FromDiscord | <albassort> but i digress |
02:46:46 | FromDiscord | <PunchCake> In reply to @System64 "100% Java + JavaFX": Mind asking you if you managed to package javafx into a jar? |
02:46:57 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @albassort "not really a synth": It is a synth 'cause it can output sound |
02:47:08 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PunchCake "Mind asking you if": I use Java 8 |
02:47:10 | FromDiscord | <PunchCake> I spent 6 hours trying to until i gave up and rewrote my program im C# and avalonia |
02:47:12 | FromDiscord | <albassort> wave generators... |
02:47:16 | FromDiscord | <albassort> alright i think im done here |
02:47:20 | FromDiscord | <PunchCake> In reply to @System64 "I use Java 8": Jeez fuck why |
02:47:32 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PunchCake "Jeez fuck why": JFX is embedded into Java 8 |
02:47:45 | FromDiscord | <PunchCake> When did the bastards remove it |
02:47:46 | FromDiscord | <Elegantbeef> Are you just doing `discard x x`?↵(@albassort) |
02:47:55 | FromDiscord | <Elegantbeef> If so remember the compiler can remove code it deems that is unused |
02:47:56 | FromDiscord | <albassort> yea |
02:48:04 | FromDiscord | <albassort> oh |
02:48:04 | FromDiscord | <albassort> lmao |
02:48:06 | FromDiscord | <PunchCake> Those bastards removed javafx but kept java swing wtf |
02:48:14 | FromDiscord | <PunchCake> Java swing is obsolete |
02:48:29 | FromDiscord | <albassort> hmm how can i make sure evals without capturing |
02:48:51 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PunchCake "Those bastards removed javafx": Don't worry, it's Oracle |
02:49:04 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jz3 |
02:49:04 | FromDiscord | <albassort> 184 nonecon |
02:49:07 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jz4 |
02:49:09 | FromDiscord | <PunchCake> In reply to @System64 "Don't worry, it's Oracle": Fuck em |
02:49:16 | FromDiscord | <PunchCake> Javafx is such an easy to use lib |
02:49:31 | FromDiscord | <System64 ~ Flandre Scarlet> Nothing is better than HTML / CSS for GUIs |
02:49:33 | FromDiscord | <albassort> wat do the and do |
02:49:40 | FromDiscord | <PunchCake> You'd know if you ever tried to make anything remotely none trivial in swing |
02:49:44 | FromDiscord | <albassort> 510 milliseconds, 667 microseconds, and 356 nanoseconds |
02:49:54 | FromDiscord | <PunchCake> In reply to @System64 "Nothing is better than": Yeah lets make bloated electron memory hogs |
02:50:03 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PunchCake "Yeah lets make bloated": Fck Electron |
02:50:05 | FromDiscord | <albassort> In reply to @PunchCake "Yeah lets make bloated": L cring opinion |
02:50:10 | FromDiscord | <albassort> (edit) "cring" => "cringe" |
02:50:25 | FromDiscord | <PunchCake> bro since when is bad software engineering accepted |
02:50:39 | FromDiscord | <albassort> People who don't like electron haven't done actual work not using it |
02:50:41 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jz5 |
02:50:44 | FromDiscord | <albassort> hmmmmm |
02:50:51 | FromDiscord | <PunchCake> I did it sucks dog dick |
02:50:52 | FromDiscord | <Elegantbeef> with `-d:release --mm:arc` |
02:51:01 | FromDiscord | <System64 ~ Flandre Scarlet> I wish there is alternatives to Electron, without the cons of Electron |
02:51:06 | FromDiscord | <Elegantbeef> I dont like GUI whatsoever it's all hell |
02:51:11 | FromDiscord | <PunchCake> In reply to @System64 "I wish there is": Tauri but there is rust |
02:51:17 | FromDiscord | <PunchCake> In reply to @Elegantbeef "I dont like GUI": Agreed |
02:51:31 | FromDiscord | <albassort> In reply to @System64 "I wish there is": there are |
02:51:31 | FromDiscord | <PunchCake> But its useful tbh |
02:51:44 | FromDiscord | <albassort> https://reactnative.dev/ |
02:52:00 | FromDiscord | <PunchCake> Lmao react native |
02:52:00 | FromDiscord | <albassort> stuff like this |
02:52:04 | FromDiscord | <Elegantbeef> But anyway alba we've changed what we're benchmarking anyway |
02:52:10 | FromDiscord | <PunchCake> Just use C# and avalonia |
02:52:18 | FromDiscord | <PunchCake> Or javafx and java |
02:52:24 | FromDiscord | <Elegantbeef> Not that it really matters since this could be thrown in a procedure and work identically |
02:52:33 | FromDiscord | <PunchCake> Mf or even python and qt at this point |
02:52:41 | FromDiscord | <Elegantbeef> Point is we can do it in under 2s depending on cpu |
02:52:54 | FromDiscord | <albassort> i dont think its the cpu bottlenecking me |
02:52:57 | FromDiscord | <PunchCake> In reply to @Elegantbeef "Point is we can": Now make it run on the gpu |
02:53:00 | FromDiscord | <albassort> so much of the work gets lost to roam |
02:53:03 | FromDiscord | <albassort> (edit) "roam" => "ram" |
02:53:12 | FromDiscord | <Elegantbeef> So saying it crashes your PC is either due to bad code, OS, or PC |
02:53:24 | FromDiscord | <PunchCake> Probably all combined |
02:53:42 | FromDiscord | <PunchCake> The transistors said you know what fuck this guy and crashed my pc |
02:53:46 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1056766746427658280/image.png |
02:53:47 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PunchCake "Or javafx and java": with JPhoenix 'cuz Material Design |
02:53:59 | FromDiscord | <albassort> here you can clearly see the swap latency bottlenecking my cpu |
02:54:00 | FromDiscord | <PunchCake> In reply to @System64 "with JPhoenix 'cuz Material": Based |
02:54:01 | FromDiscord | <Elegantbeef> Bleh downloading the buffer from the GPU and allocating it there will take up more time than this probably does↵(@PunchCake) |
02:54:07 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @albassort "https://reactnative.dev/": Isn't React known to be pain? |
02:54:17 | FromDiscord | <PunchCake> In reply to @System64 "Isn't React known to": No |
02:54:21 | FromDiscord | <albassort> This is the most developed one |
02:54:28 | FromDiscord | <albassort> sveltenative exists but its kinda fucked |
02:54:40 | FromDiscord | <System64 ~ Flandre Scarlet> I used Angular |
02:54:40 | FromDiscord | <albassort> basically, its implementing a CSS and HTML rendering engine on a native toolkit |
02:54:45 | FromDiscord | <PunchCake> React is shit because it ships like 3mb to the browsers or some insane number like that |
02:54:47 | FromDiscord | <albassort> I use svelte at work |
02:54:50 | FromDiscord | <Elegantbeef> Also doing it on the gpu means you need 8GB atleast of GPU memory |
02:55:00 | FromDiscord | <PunchCake> At least |
02:55:02 | FromDiscord | <PunchCake> Why |
02:55:14 | FromDiscord | <PunchCake> I've been playing gta on my gtx 1650 ez |
02:55:34 | FromDiscord | <albassort> yea your gta thing is keeping 1 billion squared floats in vram |
02:55:42 | FromDiscord | <PunchCake> LMAO |
02:55:55 | FromDiscord | <PunchCake> very casually |
02:56:01 | FromDiscord | <Elegantbeef> Why do you think loading takes forever? |
02:56:26 | FromDiscord | <PunchCake> Lets rent a 200 gb server and compute squared numbers from 1 to 100 trillion |
02:56:38 | FromDiscord | <PunchCake> In reply to @Elegantbeef "Why do you think": Because cockstar optimisation |
02:56:49 | FromDiscord | <albassort> their shading algorithms require every prime below 1 trilion |
02:56:52 | FromDiscord | <albassort> (edit) "trilion" => "trillion" |
02:56:57 | FromDiscord | <albassort> so it gotta do that on the gpu |
02:56:58 | FromDiscord | <Elegantbeef> One of the most costly things here is actually the allocations |
02:57:05 | FromDiscord | <Elegantbeef> Especially if you do it with the dumb `.add` method |
02:57:12 | FromDiscord | <Elegantbeef> So we just need ram closer to the cpu |
02:57:15 | FromDiscord | <Elegantbeef> Give me an arm processor! |
02:57:15 | FromDiscord | <albassort> it is the biggest |
02:57:28 | FromDiscord | <albassort> i cant think of anything that would take more time |
02:57:29 | FromDiscord | <PunchCake> would it be better to just write to a file |
02:57:35 | FromDiscord | <albassort> nope |
02:57:39 | FromDiscord | <PunchCake> It would take even more time opening a file right |
02:57:39 | FromDiscord | <Elegantbeef> Nope writing to a file is even slower |
02:57:41 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1056767731363479562/image.png |
02:57:51 | FromDiscord | <albassort> you see the green line go up and cpu go down |
02:58:02 | FromDiscord | <albassort> thats because my swap memory is bottlenecking the cpu |
02:58:17 | FromDiscord | <PunchCake> Linux moment |
02:58:23 | FromDiscord | <albassort> what |
02:58:29 | FromDiscord | <albassort> @ElegantBeef can i get a what |
02:58:35 | FromDiscord | <PunchCake> what |
02:58:58 | FromDiscord | <albassort> this is a linux moment in the same sense that breathing is a me moment |
02:59:04 | FromDiscord | <albassort> same thing happens on windows |
02:59:07 | FromDiscord | <Elegantbeef> had to scroll up to see the image you posted Shame alba I have a xeon123v3 sitting in a closet |
02:59:09 | FromDiscord | <albassort> its a moment of having 8gb of ram |
02:59:20 | FromDiscord | <Elegantbeef> It's a plop in upgrade to that i5 |
02:59:29 | FromDiscord | <albassort> not on my generation |
02:59:33 | FromDiscord | <albassort> oh is it? |
02:59:37 | FromDiscord | <albassort> might be |
02:59:38 | FromDiscord | <Elegantbeef> Yea it's a haswell |
02:59:40 | FromDiscord | <PunchCake> In reply to @albassort "its a moment of": Get more ram bro ram is cheap |
02:59:48 | FromDiscord | <albassort> DDR3 ram is not cheap lmao |
02:59:53 | FromDiscord | <PunchCake> Ddr4 |
03:00:00 | FromDiscord | <Elegantbeef> haswell is ddr3 |
03:00:08 | FromDiscord | <albassort> i cant put ddr4 in my cpu |
03:00:10 | FromDiscord | <PunchCake> Mf brokey ram ddr3 |
03:00:24 | FromDiscord | <Elegantbeef> ... |
03:00:41 | FromDiscord | <albassort> having a bad pc is actually a good thing because it forces me to write better code |
03:00:52 | FromDiscord | <albassort> beef can just go 2 BRRRR |
03:00:55 | FromDiscord | <PunchCake> Yet here you are preaching electron |
03:01:10 | FromDiscord | <Elegantbeef> How long did my solution take on your CPU? |
03:01:15 | FromDiscord | <PunchCake> 600 MB of ram wasted on discord |
03:01:18 | FromDiscord | <albassort> dnf |
03:01:24 | FromDiscord | <Elegantbeef> Jees |
03:01:34 | FromDiscord | <Elegantbeef> 2.5 times ram speed shouldnt be that much better |
03:01:48 | FromDiscord | <Elegantbeef> I assume you have like 1.3mhz |
03:01:50 | FromDiscord | <albassort> +swap +linux trying to stop my pc from crashing |
03:02:03 | FromDiscord | <albassort> half of my free ram is swap on a m2 |
03:02:11 | FromDiscord | <albassort> so its really like ddr3 and drr2 |
03:02:23 | FromDiscord | <albassort> big bottlenecks |
03:02:26 | FromDiscord | <Elegantbeef> Oh you dont have 16gb of ram? |
03:02:34 | FromDiscord | <PunchCake> bro |
03:03:36 | FromDiscord | <albassort> no |
03:03:46 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1056769258627022879/image.png |
03:03:52 | FromDiscord | <PunchCake> @albassort when did you buy your pc |
03:04:05 | FromDiscord | <albassort> i've evolved from a pc i bought in 2014 |
03:04:07 | FromDiscord | <albassort> i refuse to upgrade |
03:04:17 | FromDiscord | <Elegantbeef> If only you lived in Canada, i'd ship you my old parts |
03:04:18 | FromDiscord | <PunchCake> This is an evolution? |
03:04:26 | FromDiscord | <albassort> yea my cpu died so i downgraded |
03:04:50 | FromDiscord | <albassort> cheaper to buy a cpu from the same gen and motherboard then to upgrade |
03:04:55 | FromDiscord | <PunchCake> So your mobo cant handle ddr4 ram now? |
03:05:05 | FromDiscord | <Elegantbeef> Haswell cannot |
03:05:14 | FromDiscord | <albassort> haswell is the best generation |
03:05:18 | FromDiscord | <albassort> i have l4 cache |
03:05:20 | FromDiscord | <albassort> none of you do |
03:05:28 | FromDiscord | <albassort> best dwarf fortress fps |
03:05:30 | FromDiscord | <Elegantbeef> It was a massive upgrade over my fx4100 |
03:05:54 | FromDiscord | <Elegantbeef> Though my fx4100 was a monster that was OC'd to 4.5ghz with the stock amd cooler |
03:06:01 | FromDiscord | <albassort> when i upgrade my pc in 2036 i want 64 gb of ram |
03:06:03 | FromDiscord | <Elegantbeef> Not that it mattered that much since it was still a shit cpu |
03:06:11 | FromDiscord | <PunchCake> In reply to @albassort "when i upgrade my": 💀💀💀💀 |
03:06:31 | FromDiscord | <PunchCake> Mf you better get 500 gb ram at this point |
03:06:40 | FromDiscord | <albassort> Moors law is dead |
03:06:45 | FromDiscord | <albassort> (edit) "Moors" => "Moor's" |
03:06:49 | FromDiscord | <Elegantbeef> It's really not |
03:06:52 | FromDiscord | <Elegantbeef> moore\ |
03:06:53 | FromDiscord | <PunchCake> Moor was a lying bitch |
03:06:57 | FromDiscord | <albassort> it kinda is |
03:07:07 | FromDiscord | <albassort> memory isn't really advancing |
03:07:23 | FromDiscord | <PunchCake> Transistor doubling my dick and apple releases the same phone every year bruh |
03:07:26 | FromDiscord | <albassort> gpus are still holding true iirc |
03:07:34 | FromDiscord | <albassort> but cpus are bottlenecking |
03:07:59 | FromDiscord | <albassort> Apple is making the most innovative cpus in the world RN |
03:08:04 | FromDiscord | <PunchCake> Tbh i dont think there is any point to keep upgrading cpus |
03:08:20 | FromDiscord | <albassort> its unfortunate no Desktop arm platform can blossom practically like x86 |
03:08:26 | FromDiscord | <albassort> maybe one day |
03:08:35 | FromDiscord | <Elegantbeef> Meh desktop arm can work |
03:08:42 | FromDiscord | <PunchCake> In reply to @albassort "Apple is making the": M1 |
03:08:43 | FromDiscord | <albassort> well i mean socket wise |
03:08:43 | FromDiscord | <Elegantbeef> Box86 and friends are usable |
03:09:03 | FromDiscord | <PunchCake> M1 is really good if you tried it |
03:09:09 | FromDiscord | <PunchCake> Shit never lags no matter what |
03:09:10 | FromDiscord | <albassort> we would need a standard and a whole bunch of standards |
03:09:20 | FromDiscord | <albassort> it would be neat tho |
03:10:06 | FromDiscord | <PunchCake> Anyways alba you Italian? |
03:10:06 | FromDiscord | <albassort> hmm |
03:10:33 | FromDiscord | <albassort> Italian American. My name derives from Albatross and Alba is coincidence |
03:10:45 | FromDiscord | <Elegantbeef> Given that they're mainly aimed as SOCs that'll likely never happen |
03:10:57 | FromDiscord | <PunchCake> I swear Italy has the best guns the best women the best food the best mafia |
03:11:07 | FromDiscord | <albassort> that is a strange comment |
03:11:08 | FromDiscord | <PunchCake> Yall dont do nothing wrong |
03:11:26 | FromDiscord | <PunchCake> mamamia |
03:11:42 | FromDiscord | <Elegantbeef> Oh you literally just reversed tross |
03:11:48 | FromDiscord | <Elegantbeef> 10/10 naming |
03:11:56 | FromDiscord | <Elegantbeef> I'm a fancy steak so cannot say much |
03:12:11 | FromDiscord | <PunchCake> what |
03:13:32 | FromDiscord | <albassort> Look beef, my audio company was named AbnormalAudio |
03:13:37 | FromDiscord | <albassort> its the best named thing i've ever come with |
03:13:59 | FromDiscord | <Elegantbeef> Oddeo is right there |
03:14:34 | FromDiscord | <albassort> it would have a very oversimplified logo and we would have an office like Teenage Engineering |
03:14:50 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1056772045939167252/1464445141-teenage1.png |
03:15:03 | FromDiscord | <Elegantbeef> That's a car |
03:16:05 | FromDiscord | <albassort> thats their office |
03:16:06 | FromDiscord | <Bung> Oddeo sound like audio company located at Odin |
03:16:19 | FromDiscord | <albassort> we program our stuff IN odin |
03:16:56 | FromDiscord | <Bung> it's underground parking right, from the picture |
03:17:10 | FromDiscord | <albassort> nah they just fuckin rent cars |
03:17:12 | FromDiscord | <albassort> and put em in there |
03:18:07 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jz8 |
03:18:20 | FromDiscord | <Bung> oh, the building structure looks very similar to underground parking |
03:18:52 | FromDiscord | <albassort> imagine drinking beer at work wtf are the europeans doing?!? |
03:19:30 | FromDiscord | <Elegantbeef> Imagine drinking beer |
03:20:33 | FromDiscord | <albassort> gotta get the balmer peak somehow |
03:20:59 | FromDiscord | <Elegantbeef> Do you? |
03:23:00 | FromDiscord | <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:45 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4jzl |
05:20:16 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4jzl" => "https://paste.rs/1F4" |
05:21:00 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4jzm" => "https://paste.rs/ZXn" |
05:21:16 | FromDiscord | <Elegantbeef> No it does not |
05:21:38 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4jzo" => "https://play.nim-lang.org/#ix=4jzn" |
05:22:55 | FromDiscord | <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:12 | FromDiscord | <Elegantbeef> This is for interop or converted code? |
05:24:24 | FromDiscord | <sOkam!> Translated, one way trip |
05:24:36 | FromDiscord | <Elegantbeef> If converted yes a seq[T]\` can work |
05:25:08 | * | ltriant quit (Ping timeout: 268 seconds) |
05:25:27 | FromDiscord | <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:46 | FromDiscord | <sOkam!> (edit) "how would I store the data in ... the" added "the sequence, so it behaves like" |
05:27:50 | FromDiscord | <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:26 | FromDiscord | <Elegantbeef> I dont think you need the pointer |
05:36:19 | FromDiscord | <Elegantbeef> I assume atleast they're just using it as a dynamically allocated collection |
05:36:39 | FromDiscord | <Elegantbeef> If they're not you can just do `NimTwo = ref NimOne` |
05:48:36 | FromDiscord | <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:38 | FromDiscord | <albassort> how can i do unittests at compile temp |
05:48:46 | FromDiscord | <albassort> (edit) "compile temp" => "compiletime" |
05:50:14 | FromDiscord | <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:09 | FromDiscord | <Elegantbeef> `calloc` is dynamic allocation |
05:51:31 | FromDiscord | <sOkam!> they don't use calloc in the engine, they use Hunk_Alloc |
05:52:44 | FromDiscord | <sOkam!> This thing:↵https://github.com/heysokam/idtech3-modules/blob/a5cd0d55a32f27fc97799ac46095933d1453f013/src/mem/c/hunk.c#L59 |
05:53:48 | FromDiscord | <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:50 | FromDiscord | <Elegantbeef> Same premise |
05:55:27 | * | ltriant quit (Ping timeout: 256 seconds) |
05:56:04 | FromDiscord | <albassort> .-. |
05:57:24 | FromDiscord | <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:30 | FromDiscord | <albassort> @ElegantBeef whats some cool things i can use blocks for |
06:15:48 | FromDiscord | <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:54 | FromDiscord | <albassort> sent a code paste, see https://paste.rs/vSX |
06:16:06 | FromDiscord | <Elegantbeef> Things you probably should use procedures for but dont want to |
06:16:08 | FromDiscord | <offbeat-stuff (offbeat-stuff)> \generating a image using hb-view |
06:16:09 | FromDiscord | <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:30 | FromDiscord | <albassort> In reply to @Elegantbeef "Things you probably should": why wouldn't i want to |
06:16:51 | FromDiscord | <albassort> beat, how are suppose to help you with no code and not much context |
06:17:03 | FromDiscord | <albassort> 1. is the image in the file or in the output |
06:17:06 | FromDiscord | <albassort> 2. show us code |
06:17:30 | FromDiscord | <Elegantbeef> Cause you're lazy or it's a one off |
06:17:33 | * | rockcavera joined #nim |
06:17:38 | FromDiscord | <offbeat-stuff (offbeat-stuff)> ok, I guess i will file a bug report on pixie |
06:18:10 | FromDiscord | <albassort> its useful for some metal programming stuff like |
06:18:13 | FromDiscord | <offbeat-stuff (offbeat-stuff)> just wanted to say that pixies svg parsing is missing a important part |
06:20:00 | FromDiscord | <albassort> anyway this is the unit test i wrote |
06:20:01 | FromDiscord | <albassort> sent a code paste, see https://paste.rs/snz |
06:20:22 | FromDiscord | <Elegantbeef> You know you can just do `static(myTest)` 😄 |
06:20:30 | FromDiscord | <albassort> BEEF I ASKED LIKE 3 TIMES |
06:20:32 | FromDiscord | <Elegantbeef> sorry `static(myTest())` |
06:21:29 | FromDiscord | <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:27 | FromDiscord | <albassort> In reply to @Elegantbeef "sorry `static(myTest())`": give an example? |
06:27:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/uqZ |
06:27:22 | FromDiscord | <albassort> ok but tests aren't declared in a scope where i can execute them |
06:28:17 | FromDiscord | <albassort> oh |
06:28:21 | FromDiscord | <albassort> just put the whole thing in there |
06:28:21 | FromDiscord | <albassort> neat |
06:28:37 | FromDiscord | <albassort> wait |
06:28:45 | FromDiscord | <albassort> you cant run tests at compile time |
06:28:58 | FromDiscord | <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:03 | NimEventer | New thread by archnim: What is a RollingFileLogger, see https://forum.nim-lang.org/t/9760 |
08:13:01 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1056847085149880340/image.png |
08:30:35 | FromDiscord | <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:18 | FromDiscord | <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:42 | FromDiscord | <Elegantbeef> `std/options` |
08:43:45 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/EKg |
08:44:14 | FromDiscord | <Elegantbeef> Just make a constructor |
08:44:19 | FromDiscord | <Elegantbeef> Dont use a converter as a constructor |
08:45:07 | FromDiscord | <sOkam!> Constructor doesn't let me do `(0, 1)`, would require `constructorName(0, 1)` |
08:45:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/gHv |
08:46:20 | FromDiscord | <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:08 | FromDiscord | <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:53 | FromDiscord | <Elegantbeef> Why not just use an enum indexed array? |
10:43:01 | FromDiscord | <Elegantbeef> `array[MyEnum, MyType]` @sOkam! |
10:44:08 | FromDiscord | <sOkam!> oh, didn't think of that |
10:50:18 | FromDiscord | <sOkam!> damn, and you can also iterate an enum!?↵nim is f'ing epic 👀 |
10:58:48 | NimEventer | New question by Alexandre Daubricourt: Nim check if file exists, see https://stackoverflow.com/questions/74919610/nim-check-if-file-exists |
10:59:15 | FromDiscord | <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:39 | FromDiscord | <Phil> That's the front-end I typically mean when talking about one |
11:00:41 | FromDiscord | <Phil> Alex doing the self answered question style! I like it! |
11:03:23 | * | ltriant quit (Ping timeout: 260 seconds) |
11:22:54 | NimEventer | New 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:37 | FromDiscord | <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:14 | FromDiscord | <Phil> sent a long message, see https://paste.rs/IQl |
12:32:24 | FromDiscord | <Phil> Now to figure out how to do each of these steps |
12:33:33 | FromDiscord | <Phil> (edit) "https://paste.rs/zcf" => "http://ix.io/4jAh" |
12:34:12 | FromDiscord | <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:58 | FromDiscord | <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:31 | FromDiscord | <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:32 | FromDiscord | <Phil> The main thing I see approaching is that it might absolutely slaughter any formatting you applied before |
12:36:11 | FromDiscord | <Vindaar> who cares about formatting? The code you generate isn't meant to be read by a person |
12:36:12 | FromDiscord | <Phil> Because skimming through the macros module comments should survive as I swear I saw somewhere that they have their own node |
12:36:22 | FromDiscord | <Vindaar> only `##` comments |
12:37:30 | FromDiscord | <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:43 | FromDiscord | <Phil> Which I may no longer need if I manage to do it fully |
12:38:07 | FromDiscord | <Phil> Wait, no I may still run into issues with the order things must compile in |
12:38:39 | FromDiscord | <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:05 | NimEventer | New thread by freeflow: Strange error: single character string constants, see https://forum.nim-lang.org/t/9762 |
12:41:07 | FromDiscord | <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:11 | FromDiscord | <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:38 | FromDiscord | <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:20 | FromDiscord | <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:36 | FromDiscord | <Phil> That and multi-line proc definitions |
12:45:39 | FromDiscord | <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:01 | FromDiscord | <jmgomez> if there is another way |
12:47:28 | FromDiscord | <Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4jAk |
12:49:06 | NimEventer | New thread by tcheran: Csv column type setting, see https://forum.nim-lang.org/t/9763 |
12:50:50 | FromDiscord | <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:27 | FromDiscord | <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:39 | FromDiscord | <Phil> (edit) "macro" => "pragma" |
12:51:59 | FromDiscord | <Phil> So I just wanted to provide a small tool to save some time |
12:52:06 | FromDiscord | <jmgomez> So what you want is to make a proc mockable to change for testings or something? |
12:52:24 | FromDiscord | <jmgomez> Why not just get the implementation and do it ad hoc? |
12:52:47 | FromDiscord | <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:05 | FromDiscord | <Phil> So that when another proc calls this one, I can mock it out |
12:53:53 | FromDiscord | <Phil> In reply to @jmgomez "Why not just get": I'm not sure what you mean here, could you elaborate? |
12:55:23 | FromDiscord | <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:41 | FromDiscord | <jmgomez> that or dynamic dispatching |
12:56:05 | FromDiscord | <jmgomez> which is a bit of a pain in nim.. |
12:56:09 | FromDiscord | <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:48 | FromDiscord | <jmgomez> I mean, you know that you can do getImpl() on a symbol and it will returns you the AST, right? |
12:57:47 | FromDiscord | <Phil> Barely, but I know the proc exists.↵Do you mean that during testing I should modify the proc under test ? |
12:58:00 | FromDiscord | <Phil> Instead of swapping out what it calls? |
12:58:09 | FromDiscord | <jmgomez> Im not saying you should, Im just saying you could haha |
12:58:36 | FromDiscord | <jmgomez> but yeah, the mockables should be inside a nnkCall |
12:58:48 | FromDiscord | <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:31 | FromDiscord | <Phil> It's the closest thing in behaviour that I can imagine to mocking with dynamic dispatch |
12:59:59 | FromDiscord | <Phil> without wildly changing your source code to be more OOP-y |
13:00:03 | FromDiscord | <jmgomez> right, I like the pragma approach more, what about adding them in a macro instead? |
13:00:58 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4jAn |
13:02:31 | FromDiscord | <Phil> sent a long message, see http://ix.io/4jAo |
13:04:33 | FromDiscord | <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:22 | FromDiscord | <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:11 | FromDiscord | <Phil> And the final ast is the thing I would then test if I'm understanding you right? |
13:10:05 | FromDiscord | <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:37 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jAs |
13:10:49 | FromDiscord | <Phil> Just in case you were wondering |
13:12:09 | FromDiscord | <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:33 | FromDiscord | <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:24 | FromDiscord | <Phil> I don't think I'm sure that works |
13:34:52 | FromDiscord | <Phil> sent a long message, see http://ix.io/4jAA |
13:35:25 | FromDiscord | <Phil> (edit) "http://ix.io/4jAA" => "http://ix.io/4jAB" |
13:38:01 | FromDiscord | <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:35 | FromDiscord | <Phil> (edit) "they're" => "test files are" |
13:43:47 | FromDiscord | <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:20 | NimEventer | New 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:26 | FromDiscord | <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:01 | FromDiscord | <Phil> Wait, this entire replacing with mock thing may not be an issue! |
14:39:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jAP |
14:42:05 | FromDiscord | <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:06 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jAR |
14:57:12 | FromDiscord | <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:26 | FromDiscord | <Phil> Wait, you mentioned getImpl time to look at that |
15:00:40 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/SRD |
15:03:16 | FromDiscord | <Phil> Wait, wouldn't that mean that I would need to do changes in the actual code? |
15:03:49 | FromDiscord | <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:09 | FromDiscord | <jmgomez> Your macro/pragma mockable does that for you |
15:04:41 | FromDiscord | <jmgomez> you still need to mark them or to put them in a mockable block though |
15:05:47 | FromDiscord | <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:43 | FromDiscord | <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:52 | FromDiscord | <Phil> The key issue I have is I don't see where that one is |
15:08:48 | FromDiscord | <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:06 | FromDiscord | <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:28 | FromDiscord | <albassort> shouldn't it be {.discardable.} |
16:52:54 | FromDiscord | <HitBlast> In reply to @Elegantbeef "`std/options`": could it be done with `reverse: string or nil` ? |
16:52:58 | FromDiscord | <HitBlast> the error disappears if I do either of them |
16:53:05 | FromDiscord | <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:23 | FromDiscord | <Phil> Generally if you want to indicate something may be there or not, use optionals |
17:06:55 | FromDiscord | <Phil> Using nil directly in Nim code is generally discharged and usage of optionals whenever nil is a possibility generally encouraged |
17:07:12 | FromDiscord | <Phil> (edit) "discharged" => "discouraged" |
17:07:44 | FromDiscord | <HitBlast> In reply to @Isofruit "Using nil directly in": so should I wrap it using `Option[string]`? |
17:08:04 | FromDiscord | <Phil> Pretty much |
17:08:07 | FromDiscord | <HitBlast> https://media.discordapp.net/attachments/371759389889003532/1056851688465629184/Screenshot_2022-12-26_at_2.31.02_PM.png |
17:08:14 | FromDiscord | <HitBlast> here's the previous screenshot for reference |
17:09:52 | FromDiscord | <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:08 | FromDiscord | <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:28 | FromDiscord | <HitBlast> here it is |
17:10:29 | FromDiscord | <HitBlast> sent a code paste, see https://play.nim-lang.org/#ix=4jCC |
17:10:32 | FromDiscord | <HitBlast> I get an error though |
17:10:38 | FromDiscord | <HitBlast> type mismatch |
17:11:05 | FromDiscord | <HitBlast> (edit) "https://play.nim-lang.org/#ix=4jCC" => "https://paste.rs/DUW" |
17:11:45 | FromDiscord | <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:22 | FromDiscord | <HitBlast> In reply to @Isofruit "Ah, for reference, are": Yeah |
17:12:31 | FromDiscord | <HitBlast> In Python, especially |
17:12:37 | FromDiscord | <HitBlast> using the `typing` module |
17:13:07 | FromDiscord | <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:32 | FromDiscord | <HitBlast> In reply to @Isofruit "Ah dang, dinner. The": could I do `none(string)` as well? |
17:13:35 | FromDiscord | <Phil> Of course you can also do `some("somestring")` and `none(string)` respectively |
17:14:00 | FromDiscord | <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:07 | FromDiscord | <albassort> In reply to @Isofruit "Using nil directly in": why |
17:14:36 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1056983380505395230/image.png |
17:14:40 | FromDiscord | <albassort> theres no other way to do this really |
17:15:04 | FromDiscord | <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:24 | FromDiscord | <albassort> based on this comment i think you're saying i used the right usecase |
17:16:27 | FromDiscord | <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:00 | FromDiscord | <auxym> but you have to be disciplined with isNil checks |
17:17:32 | FromDiscord | <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:46 | FromDiscord | <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:48 | FromDiscord | <HitBlast> (edit) "nil" => "nil?" |
17:17:58 | FromDiscord | <albassort> oh wait that didn't solve it |
17:18:33 | FromDiscord | <albassort> i think i gotta write one specifically for float32 and float64 |
17:22:35 | FromDiscord | <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:28 | FromDiscord | <Phil> In reply to @HitBlast "This fixes the error.": Check out the docs of the std options module. In general isNone |
17:38:44 | FromDiscord | <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:23 | FromDiscord | <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:44 | FromDiscord | <albassort> In reply to @Isofruit "Because nil, none and": I agree |
17:55:50 | FromDiscord | <albassort> nil shoudln't be allowed in runtime |
17:55:53 | FromDiscord | <albassort> only in static |
17:55:59 | FromDiscord | <albassort> (edit) "only in static ... " added "contexts" |
17:56:13 | FromDiscord | <albassort> I have never used nil in runtime because thats stupid |
17:56:14 | FromDiscord | <Phil> Imo it's a "whenever you can" kind of thing |
17:56:19 | FromDiscord | <Phil> It just improves correctness |
17:56:44 | FromDiscord | <Phil> whenever you can and it make sense |
17:57:47 | FromDiscord | <Phil> @Yandall Thanks for adding the feature to HTest! |
17:59:27 | FromDiscord | <Yandall> Its ok. thanks for helping me improving the library |
18:11:53 | * | pro quit (Quit: pro) |
18:13:25 | FromDiscord | <albassort> should i ever recommend someone to use INCLUDE with my library lol |
18:13:38 | FromDiscord | <albassort> because im having issues |
18:14:01 | FromDiscord | <albassort> (edit) "because im having issues ... " added "with hash using the internal defined functions" |
18:20:37 | FromDiscord | <Ailuros 💖🧡💛💚💙💜🖤> sent a long message, see http://ix.io/4jCQ |
18:37:22 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jCV |
18:38:19 | FromDiscord | <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:40 | FromDiscord | <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:57 | FromDiscord | <Phil> But I also am too lazy to invest the required amount of energy to prove me right |
18:39:56 | FromDiscord | <albassort> I personally think classifiers are the best way to do it |
18:40:02 | FromDiscord | <albassort> Because of the fact that you need to write classifiers anyway |
18:40:10 | FromDiscord | <albassort> No matter what you're doing if you're using the same type you're going to use classifiers somehow |
18:40:17 | FromDiscord | <albassort> Somewhere on your tool chain you'll need to classify one from the other |
18:40:23 | FromDiscord | <albassort> It'll just be faster to embed it into the proc |
18:41:53 | FromDiscord | <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:20 | FromDiscord | <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:19 | FromDiscord | <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:22 | FromDiscord | <albassort> In the context where it matters |
18:47:49 | FromDiscord | <albassort> {"0": "01"} |
18:47:56 | FromDiscord | <albassort> (edit) ""01"}" => ""00"}" |
18:48:12 | FromDiscord | <albassort> there is no guarantee that key and val aren't the same |
18:48:22 | FromDiscord | <albassort> (edit) "there is no guarantee that key and val aren't the same ... " added "'type'" |
18:49:01 | FromDiscord | <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:12 | om3ga | hi! is there any chance to access object element as its index, for example as array[n]? |
19:15:50 | om3ga | I assume this is not possible |
19:16:29 | FromDiscord | <Ailuros 💖🧡💛💚💙💜🖤> sent a long message, see http://ix.io/4jDa |
19:25:41 | FromDiscord | <Ash321> Are arrays pass by value in nim? |
19:27:07 | FromDiscord | <huantian> Yes |
19:34:35 | * | nick2 quit (Ping timeout: 248 seconds) |
19:38:53 | FromDiscord | <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:16 | FromDiscord | <albassort> It's weird how much of Nim we have encoded in our brains |
19:39:38 | om3ga | albassort: wow! Thanks a lot! awesome |
19:39:55 | FromDiscord | <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:14 | FromDiscord | <albassort> I didn't answer your question because I didn't understand what you asked |
19:40:15 | om3ga | auxym: Thanks a lot! great! |
19:40:20 | FromDiscord | <albassort> Why did you @ me |
19:40:25 | FromDiscord | <auxym> lol.np |
19:40:32 | om3ga | albassort, by mistake, sorry |
19:40:36 | FromDiscord | <Ash321> Thanks |
19:41:26 | FromDiscord | <sealmove> wtf https://media.discordapp.net/attachments/371759389889003532/1057020333762297856/image.png |
19:41:38 | FromDiscord | <sealmove> is nim popular in data science? :p |
19:41:41 | FromDiscord | <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:05 | FromDiscord | <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:16 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1057020795009896518/image.png |
19:43:27 | FromDiscord | <albassort> hmmm |
19:43:32 | FromDiscord | <sealmove> weird |
19:43:34 | FromDiscord | <albassort> In reply to @รєคɭ๓๏שє "wtf": You know what happened here |
19:43:42 | om3ga | auxym, in current case I made mistake, that lead at the end to such situation, I should carefully plan data structures next time |
19:43:44 | FromDiscord | <albassort> frontend engineer heard some R guy talk about nim |
19:43:52 | FromDiscord | <albassort> and they were like "lets just make sure users aren't confused" |
19:43:53 | FromDiscord | <sealmove> lol xD yeah probably |
19:44:31 | FromDiscord | <sealmove> because it's easy to confuse "Python" with R or Nim |
19:44:34 | FromDiscord | <sealmove> very similar names |
19:45:10 | om3ga | what the heck is data engineering |
19:45:14 | FromDiscord | <albassort> also data science vs data engineer??? |
19:45:18 | FromDiscord | <albassort> (edit) "engineer???" => "engineering???" |
19:45:23 | FromDiscord | <albassort> implementation of data science i presume |
19:45:33 | FromDiscord | <auxym> apparently something nim (and R) has absolutely, never, any use in. |
19:45:38 | FromDiscord | <auxym> 🙄 |
19:45:44 | om3ga | what a stupid new terminology |
19:45:45 | FromDiscord | <albassort> sadged rip R |
19:45:55 | FromDiscord | <albassort> R had a solid 20 year run |
19:45:56 | FromDiscord | <albassort> ded |
19:46:05 | FromDiscord | <sealmove> data engineering is actually very different from data science |
19:46:13 | FromDiscord | <Ash321> Hackers are using nim????? |
19:46:15 | om3ga | what is it then? |
19:46:24 | FromDiscord | <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:28 | FromDiscord | <albassort> In reply to @Ash321 "Hackers are using nim?????": hackers use anything with macros |
19:46:31 | om3ga | how it is possible to engineer the data |
19:46:32 | FromDiscord | <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:33 | FromDiscord | <Ash321> So i decided to take a look |
19:46:42 | FromDiscord | <sealmove> In reply to @om3ga "what is it then?": transfering and transforming data, before they are analyzed |
19:46:46 | FromDiscord | <albassort> hackers main motive is to move and lurk around antiviruses |
19:46:53 | FromDiscord | <albassort> if your memory keeps mutating its harder to detect |
19:46:56 | FromDiscord | <albassort> C macors suck |
19:47:00 | FromDiscord | <albassort> nim macros are pretty pog |
19:47:02 | FromDiscord | <albassort> so thats what they do |
19:47:04 | FromDiscord | <albassort> (edit) "do" => "use" |
19:47:08 | FromDiscord | <auxym> In reply to @albassort "hackers use anything with": especially excel macros |
19:47:10 | om3ga | sealmove, we always called that re-formatting |
19:47:14 | FromDiscord | <auxym> (as an attack vector) |
19:47:24 | FromDiscord | <albassort> those are the most impressive attacks |
19:47:36 | FromDiscord | <sealmove> In reply to @om3ga "<@173424250319929344>, we always called": ok new name then ^^ |
19:47:37 | FromDiscord | <albassort> mostly because of microsofts incompetence |
19:47:54 | om3ga | sealmove, right, thnx for the explanation |
19:48:22 | FromDiscord | <albassort> should i learnR |
19:48:24 | FromDiscord | <Ash321> Why there is no large scale adoption of nim...given that nim is older than rust |
19:48:24 | FromDiscord | <albassort> (edit) "learnR" => "learn R" |
19:48:36 | FromDiscord | <albassort> There is small-scale |
19:48:46 | FromDiscord | <albassort> but nim is a tough sell vs C++ for companies |
19:48:47 | FromDiscord | <Ash321> It looks like a cool language |
19:48:50 | FromDiscord | <albassort> (edit) "C++" => "C++/Ru" | "companies" => "companiest" |
19:48:55 | FromDiscord | <albassort> (edit) "C++/Ru" => "C++/Rust" |
19:49:22 | FromDiscord | <albassort> because c++ and rust has far larger talent pools and a tons of code |
19:49:24 | FromDiscord | <scruz> Is Nim faster or close to being as fast as Rust in the new update |
19:49:35 | FromDiscord | <albassort> In reply to @scruz "Is Nim faster or": its been like that since Orc |
19:49:38 | FromDiscord | <albassort> so like 2019 |
19:49:40 | FromDiscord | <Ash321> Rust scares me tbh |
19:49:42 | FromDiscord | <scruz> I see |
19:49:59 | FromDiscord | <auxym> In reply to @Ash321 "Why there is no": because rust is backed by mozilla |
19:49:59 | FromDiscord | <albassort> should be around 10% of Rust |
19:50:05 | FromDiscord | <Phil> In reply to @scruz "Is Nim faster or": I can make python as fast as Rust if I implement Rust badly |
19:50:13 | FromDiscord | <scruz> do it |
19:50:23 | FromDiscord | <albassort> phil is gonna implement sleep loops |
19:50:25 | FromDiscord | <auxym> rust's syntax scares me 😛 |
19:50:36 | FromDiscord | <albassort> rust is bad |
19:50:59 | FromDiscord | <albassort> mostly because i haven't used it enough |
19:51:00 | FromDiscord | <albassort> thats why its bad |
19:51:06 | FromDiscord | <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:30 | FromDiscord | <Ash321> C++ wasn't hard enough for them |
19:51:44 | FromDiscord | <albassort> i just like C |
19:51:44 | FromDiscord | <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:00 | FromDiscord | <albassort> hehe funny joke software development :) |
19:52:21 | FromDiscord | <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:39 | FromDiscord | <scruz> gotcha |
19:53:20 | FromDiscord | <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:50 | FromDiscord | <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:01 | FromDiscord | <Ash321> https://programming-language-benchmarks.vercel.app/nim-vs-rust ↵↵Is this a valid comparision? |
19:55:57 | FromDiscord | <scruz> >timeout ? https://media.discordapp.net/attachments/371759389889003532/1057023987131105400/unknown.jpeg |
19:56:35 | FromDiscord | <scruz> is this about the multi--thread/single-thread |
19:56:46 | FromDiscord | <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:47 | FromDiscord | <scruz> (edit) "multi--thread/single-thread" => "multi-thread v/s single-thread" |
19:57:12 | FromDiscord | <albassort> do you guys think i can get a opengl->haskell->c->nim bridge working |
19:57:38 | FromDiscord | <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:00 | FromDiscord | <albassort> theres probably more |
19:58:11 | FromDiscord | <Phil> Do you just like pain? |
19:58:23 | FromDiscord | <albassort> i wanna fun futhark code from nim! |
19:58:43 | FromDiscord | <Phil> It's just that at some point I feel like I'm starting to see a pattern is all 😛 |
19:58:56 | FromDiscord | <scruz> CBT |
19:59:09 | FromDiscord | <albassort> that every programming thing i do is stupid |
19:59:38 | FromDiscord | <Phil> Nah, that you like to follow your implementation idea to the bitter end, that's how I'll word it 😛 |
19:59:42 | FromDiscord | <scruz> Unpopular opinion - but I don't like UFCs |
19:59:49 | FromDiscord | <scruz> (edit) removed "-" |
19:59:55 | FromDiscord | <Phil> UFC as in? |
20:00:08 | FromDiscord | <scruz> Universal function calls |
20:00:23 | FromDiscord | <Phil> Ah, people will remind me of that and I will keep reading it as "Underground Fight Club" |
20:00:34 | FromDiscord | <scruz> echo('')↵echo '' |
20:00:36 | FromDiscord | <Phil> (edit) "remind" => "keep reminding" |
20:00:42 | FromDiscord | <Phil> Anyway, I think UFC is fine |
20:00:55 | FromDiscord | <albassort> In reply to @Isofruit "Nah, that you like": eventually i tear it all out and refacotr |
20:00:57 | FromDiscord | <albassort> (edit) "refacotr" => "refactor" |
20:01:29 | FromDiscord | <Phil> In reply to @albassort "eventually i tear it": Well that's why I wrote "bitter" end 😛 |
20:03:29 | FromDiscord | <albassort> I'm sitting on an nearly finished project here |
20:03:30 | FromDiscord | <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:33 | FromDiscord | <albassort> but I want to test it |
20:04:05 | FromDiscord | <albassort> I don't know much rust, i say its bad jokingly |
20:04:10 | FromDiscord | <albassort> my few experiences with it weren't the best |
20:04:42 | FromDiscord | <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:28 | FromDiscord | <Phil> If coding feels like somebody is pulling your teeth out then something is wrong |
20:06:19 | * | nick2 joined #nim |
20:06:43 | FromDiscord | <albassort> flashes back to c++ |
20:09:00 | FromDiscord | <Ash321> Using chatgpt to guide me through nim docs |
20:09:48 | FromDiscord | <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:12 | FromDiscord | <Ash321> Stackoverflow gurus will be using chatgpt in future 🤣 |
20:28:36 | FromDiscord | <Phil> I doubt it, particularly for Nim as chatgpt can very confidently be very wrong |
20:29:11 | FromDiscord | <Phil> Well, in the immediate future |
20:29:27 | FromDiscord | <Ash321> It will get better mate |
20:29:29 | FromDiscord | <Phil> Future iterations of that bot may be better |
20:29:40 | FromDiscord | <Phil> Yeah, would be nice |
20:30:03 | FromDiscord | <Ash321> It's nice tool over all |
20:30:36 | FromDiscord | <Ash321> The answers it gives are sometimes crazy. |
20:30:52 | FromDiscord | <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:00 | FromDiscord | <Phil> Okay, time to put myself behind vindaars macro and understand it |
20:56:31 | FromDiscord | <ambient> chatgpt works with Nim? cool. I just wish they didn't want my phone number to use it |
21:03:43 | FromDiscord | <ShalokShalom> In reply to @Ash321 "Stackoverflow gurus will be": They already prevent that |
21:05:56 | FromDiscord | <ShalokShalom> In reply to @Isofruit "So asking for what's": Isnt it interesting, how much faster Bun is compared to V8? |
21:06:21 | FromDiscord | <ShalokShalom> Google is developing V8. |
21:06:24 | * | kenran joined #nim |
21:06:37 | FromDiscord | <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:45 | FromDiscord | <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:15 | FromDiscord | <Phil> Because if that is close enough that's a real brain breaker |
21:07:27 | FromDiscord | <ShalokShalom> Why? |
21:07:30 | FromDiscord | <Phil> That a language as terrible as JS is officially good enough to compete with native |
21:07:37 | FromDiscord | <ShalokShalom> ? |
21:07:58 | FromDiscord | <Phil> Like, JS of all things as the main-stream language for all things |
21:08:01 | FromDiscord | <ShalokShalom> I do think, JS as a language is very little related to it being a compilation target |
21:08:16 | FromDiscord | <ShalokShalom> What they do with JS, they could do with any language |
21:08:24 | FromDiscord | <ShalokShalom> I think thats hardly related. |
21:09:12 | FromDiscord | <ShalokShalom> Sure, I think ultimately can Lua be optimized more than Javascript |
21:09:14 | FromDiscord | <ShalokShalom> I guess |
21:10:40 | FromDiscord | <ShalokShalom> In reply to @Ash321 "Stackoverflow gurus will be": https://meta.stackoverflow.com/questions/421831/temporary-policy-chatgpt-is-banned |
21:12:53 | FromDiscord | <voidwalker> Uhm, what means do I have to do something like `let key, value = param.split("=", maxsplit=1)` |
21:13:03 | FromDiscord | <voidwalker> so that key is the [0] element, and value the [1] |
21:14:57 | FromDiscord | <ShalokShalom> Oh, that is nice:↵https://sourcegraph.com/search |
21:15:17 | * | ltriant joined #nim |
21:18:01 | FromDiscord | <Phil> Errr if I wanted to summarize "method", "proc" and "func" with a word, what should I call it? Callable? |
21:18:23 | FromDiscord | <Phil> For variable names.↵"callableNode" for example. Not sure if that's accurate though |
21:20:54 | FromDiscord | <jmgomez> In reply to @ShalokShalom "And you might think,": AFAIK is based on apple's js runtime |
21:22:08 | FromDiscord | <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:51 | FromDiscord | <ShalokShalom> In reply to @jmgomez "AFAIK is based on": Yes |
21:22:59 | FromDiscord | <ShalokShalom> But that is not much faster than V8 |
21:23:07 | FromDiscord | <ShalokShalom> So I guess its the work around that |
21:23:20 | FromDiscord | <ShalokShalom> Ultimately, its not faster than V8, its faster than Node. |
21:23:51 | FromDiscord | <ShalokShalom> But if Bun can make Bun faster than Node, why cant Google make Chromium so fast as Bun? |
21:23:56 | FromDiscord | <ShalokShalom> Very naive question. |
21:25:04 | FromDiscord | <ShalokShalom> In reply to @Isofruit "Errr if I wanted": Every language calls things different |
21:25:13 | FromDiscord | <ShalokShalom> I think callable is fine, in that instance |
21:25:31 | FromDiscord | <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:38 | FromDiscord | <ShalokShalom> Although, some languages call "Callables" something, that is implemented as something specific. |
21:25:50 | FromDiscord | <ShalokShalom> In reply to @Isofruit "Nim has its own": Yeah, thats exactly what I mean. 🙂 |
21:26:03 | FromDiscord | <ShalokShalom> I think macros are also callables? |
21:26:15 | FromDiscord | <ShalokShalom> And concepts? |
21:26:17 | FromDiscord | <ShalokShalom> Templates. |
21:26:52 | FromDiscord | <Phil> If that's the case then using "callable" would be incorrect for me as I do not include macros or templates |
21:26:57 | FromDiscord | <ShalokShalom> I think, ultimately, it doesnt matter, so long as you name it as something related to the implementation |
21:27:08 | FromDiscord | <ShalokShalom> Since so long will you look towards the computer |
21:27:24 | FromDiscord | <ShalokShalom> Once you talk to a human, you come up with words that relate to them |
21:27:37 | FromDiscord | <ShalokShalom> And that might be different as the implementation detail. |
21:27:45 | FromDiscord | <ShalokShalom> Thats declarative. 🙂 |
21:27:51 | FromDiscord | <Phil> In reply to @ShalokShalom "Once you talk to": The thing is you implement code based on a shared understanding |
21:28:04 | FromDiscord | <Phil> The shared understanding you can assume a nim programmer to have is understanding the words of the language |
21:28:22 | FromDiscord | <ShalokShalom> The words that Nim uses? |
21:28:26 | FromDiscord | <Phil> Using those words in a way that the language doesn't use them is the confusing them |
21:28:35 | FromDiscord | <ShalokShalom> I can see that. |
21:28:40 | FromDiscord | <Phil> Nim uses callable, describing something myself as callable that nim doesn't will confuse |
21:29:06 | FromDiscord | <ShalokShalom> Sure |
21:29:29 | FromDiscord | <ShalokShalom> Where do you find the Nim definition of callable? |
21:29:35 | FromDiscord | <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:51 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/7NF |
21:32:30 | FromDiscord | <Phil> I may just go for "isMockable" for my custom context |
21:32:48 | FromDiscord | <ShalokShalom> I can see that |
21:32:52 | FromDiscord | <ShalokShalom> Good definition |
21:35:02 | FromDiscord | <ShalokShalom> Hnn, has Nim a signal/slot implementation? |
21:35:10 | FromDiscord | <ShalokShalom> Or some idea of the observer pattern? |
21:35:50 | FromDiscord | <Phil> Not that I'm aware of, but a signalling system isn't that hard to implement, albeit it's slightly tricky |
21:36:51 | FromDiscord | <ShalokShalom> I just wonder |
21:36:52 | FromDiscord | <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:04 | FromDiscord | <ShalokShalom> It kinda fits the philosophy of Nim, I think |
21:37:30 | FromDiscord | <Phil> An async-based observer pattern I'm not aware of at all |
21:37:48 | FromDiscord | <Phil> Only seen that in rxjs so far |
21:38:57 | FromDiscord | <ShalokShalom> Does that hold weak references |
21:39:16 | FromDiscord | <ShalokShalom> Or would ORC prevent memory issues? |
21:39:29 | FromDiscord | <ShalokShalom> Like, in your implementation. |
21:40:00 | FromDiscord | <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:04 | FromDiscord | <ShalokShalom> Do you think, this goes well with Nim? |
21:41:21 | FromDiscord | <ShalokShalom> I am kinda struck, that this kinda didnt come to my mind earlier ^^ |
21:41:25 | FromDiscord | <Phil> https://github.com/PhilippMDoerner/NimStoryFont/blob/master/src/applications/core/signalSystem.nim↵Here for reference |
21:41:43 | FromDiscord | <ShalokShalom> You have seen the old one? https://github.com/fowlmouth/signals.nim |
21:42:05 | FromDiscord | <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:11 | FromDiscord | <voidwalker> (edit) ")" => ")`" |
21:42:20 | FromDiscord | <voidwalker> possible without external macros ? |
21:42:29 | FromDiscord | <ShalokShalom> Like how you document, again 😄 |
21:42:49 | FromDiscord | <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:16 | FromDiscord | <ShalokShalom> I mostly know them from Qt and Smalltalk |
21:43:22 | FromDiscord | <ShalokShalom> I assumed they were all the same |
21:43:31 | FromDiscord | <ShalokShalom> And GDScript |
21:43:37 | FromDiscord | <Phil> I see the readme and see that whatever signal thingy they're doing is already more complex |
21:43:49 | FromDiscord | <ShalokShalom> I mean, how different can it be |
21:43:51 | FromDiscord | <ShalokShalom> signal, slot |
21:43:55 | FromDiscord | <ShalokShalom> 😄 |
21:43:58 | FromDiscord | <Phil> My "Signalsystem" is mostly a kind of "also execute these procedures before/after you perform these operations" |
21:44:02 | FromDiscord | <ShalokShalom> async maybe |
21:44:08 | FromDiscord | <Phil> That's the way Django does it |
21:44:12 | FromDiscord | <Phil> And it's all sync |
21:44:23 | FromDiscord | <ShalokShalom> So long as you can implement the observer pattern with it... |
21:44:27 | FromDiscord | <ShalokShalom> I am fine |
21:44:47 | FromDiscord | <Phil> Hmm I think mine is more limited in that regard |
21:45:07 | FromDiscord | <Phil> Observer pattern requires you to be able to have individual lists of procs for each subscription |
21:45:24 | FromDiscord | <Phil> Mine is one big fat list for each norm-model |
21:46:00 | FromDiscord | <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:00 | FromDiscord | <jmgomez> In reply to @ShalokShalom "Or some idea of": futures |
21:46:09 | FromDiscord | <ShalokShalom> Ah |
21:46:11 | FromDiscord | <ShalokShalom> Thanks |
21:46:34 | FromDiscord | <ShalokShalom> @PhilYou dont link the instance of your AldruneWikiFrontEnd on your README |
21:46:41 | FromDiscord | <ShalokShalom> Dont you want, that the people see it? |
21:46:57 | FromDiscord | <Phil> More a matter of "forgotten and don't care too much" |
21:47:18 | FromDiscord | <ShalokShalom> I see |
21:47:21 | FromDiscord | <ShalokShalom> Would like to see it 😄 |
21:47:22 | FromDiscord | <Phil> Wait, you mean the link to the running server? |
21:47:25 | FromDiscord | <Phil> That nobody gets to see anyway |
21:47:39 | FromDiscord | <Phil> Very intentionally. There's images hosted on that thing and I own like 5% of those |
21:48:06 | FromDiscord | <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:44 | FromDiscord | <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:03 | FromDiscord | <ShalokShalom> I only find this documentation https://nim-lang.org/docs/asyncfutures.html |
21:49:13 | FromDiscord | <ShalokShalom> Is that all there is? I doubt |
21:49:38 | FromDiscord | <Phil> Also: https://github.com/Tangdongle/nimobserver |
21:49:46 | FromDiscord | <ShalokShalom> @Philwell, I meant at least a screenshot |
21:49:55 | FromDiscord | <ShalokShalom> something to get an impression about it |
21:50:14 | FromDiscord | <ShalokShalom> I always think its kinda pity, if someone doesnt see the frontend.. of a frontend |
21:50:50 | FromDiscord | <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:35 | FromDiscord | <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:08 | FromDiscord | <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:23 | FromDiscord | <ShalokShalom> asyncfutures seem to be the only Futures in Nim |
21:53:01 | FromDiscord | <ShalokShalom> kinda like very well hidden |
21:53:37 | FromDiscord | <ShalokShalom> doesnt even mention "this is other peoples signal/slot principles" or something |
21:54:19 | FromDiscord | <ShalokShalom> Nim seems sometimes like a hairy guy, who wont talk about its feelings 😄 |
21:54:53 | FromDiscord | <ShalokShalom> He great strengths, and some of them are hidden behind a lot of pain ^^ |
21:55:54 | FromDiscord | <Phil> TBF nim's set of language capabilities are a fair bit larger than most langs |
21:55:59 | FromDiscord | <Phil> So got a fair bit more to talk about |
21:56:25 | FromDiscord | <Phil> You could say "a very rich emotional landscape" |
21:57:06 | FromDiscord | <ShalokShalom> Well, if I introduce a feature, I care about its presentation |
21:57:08 | FromDiscord | <ShalokShalom> personally |
21:57:08 | FromDiscord | <Phil> The one thing I'm missing right around now is the ability to have header files |
21:57:17 | FromDiscord | <ShalokShalom> ability? |
21:57:22 | FromDiscord | <ShalokShalom> why would you want that? |
21:57:34 | FromDiscord | <Phil> Because apparently that's what allows me to mock very easily in C |
21:57:48 | FromDiscord | <Phil> I think I found a satisfying way in nim, well, as satisfying as it's going to get for my taste |
21:58:12 | FromDiscord | <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:48 | FromDiscord | <ShalokShalom> 💡 |
21:59:36 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jDM |
22:00:50 | FromDiscord | <Phil> (edit) "https://paste.rs/79P" => "https://play.nim-lang.org/#ix=4jDN" |
22:02:17 | FromDiscord | <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:08 | FromDiscord | <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:31 | FromDiscord | <Vindaar> exactly, they remain even in danger mode |
22:03:58 | FromDiscord | <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:05 | FromDiscord | <Rika> ~~I personally believe way too many people use danger~~ |
22:04:57 | FromDiscord | <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:44 | FromDiscord | <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:25 | FromDiscord | <Phil> Funny sidenote |
22:07:10 | FromDiscord | <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:36 | FromDiscord | <Phil> We're all moving towards increased snackability |
22:07:40 | FromDiscord | <Phil> It was inevitable |
22:07:48 | FromDiscord | <Vindaar> yummy 😋 |
22:07:51 | FromDiscord | <Rika> In reply to @Isofruit "What I think you": Don’t forget lightspeed |
22:08:20 | FromDiscord | <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:45 | FromDiscord | <ShalokShalom> Why does the freaking Git binary for Windows have 50mb |
22:08:47 | FromDiscord | <ShalokShalom> git! |
22:09:03 | FromDiscord | <Phil> I have stopped asking questions why things for windows are weird a long time ago |
22:09:08 | FromDiscord | <Phil> Somewhere around 2016 or so |
22:09:28 | FromDiscord | <Phil> Which incidentally was the time I dropped windows because Windows10 was looking like a spyware fest |
22:09:39 | FromDiscord | <Rika> Lol |
22:10:14 | FromDiscord | <ShalokShalom> Coorelates probably with the time frame, at which you started to become sane again 😄 |
22:10:32 | FromDiscord | <Phil> This implies that during most of my biological studies I was insane |
22:10:32 | FromDiscord | <ShalokShalom> Like, good for your mental health |
22:10:33 | * | ltriant joined #nim |
22:10:36 | FromDiscord | <Phil> Not sure how to feel about that |
22:10:43 | FromDiscord | <ShalokShalom> ^^ |
22:10:49 | FromDiscord | <Phil> Mad scientists don't have a particularly good rep |
22:11:50 | FromDiscord | <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:27 | FromDiscord | <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:42 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jDS |
22:27:11 | FromDiscord | <Phil> And I can't really use `open(filePath, FileMode.fmWrite)` because that's using "importc" at compiletime |
22:28:25 | FromDiscord | <Phil> And I also can't just return a string from the macro because it wants to return a NimNode or sth |
22:32:10 | FromDiscord | <Rika> Are you checking the right path xd |
22:32:22 | FromDiscord | <Phil> the echo is giving me correct output |
22:32:37 | FromDiscord | <Phil> So I'm at least reading in correctly |
22:32:40 | FromDiscord | <Rika> Yes but check the path |
22:32:44 | FromDiscord | <Phil> and If I'm reading in correctly I should also be writing correctly |
22:32:54 | FromDiscord | <Phil> Since I write to the file I read |
22:35:21 | FromDiscord | <Phil> Son of a gun |
22:35:40 | FromDiscord | <Phil> It... it writes to a different place than it reads from |
22:35:49 | FromDiscord | <Phil> Wait, that makes sense I think, it's just really weird |
22:36:16 | FromDiscord | <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:40 | FromDiscord | <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:53 | FromDiscord | <Phil> That's kind of wild |
22:38:30 | FromDiscord | <Phil> (edit) "binary," => "binary as basePath/origin," |
22:42:59 | * | ltriant joined #nim |
22:48:08 | * | ltriant quit (Ping timeout: 272 seconds) |
22:48:52 | FromDiscord | <Phil> Sometimes I fascinate myself, how does one even create a seq of static strings |
22:49:26 | FromDiscord | <Phil> Apparently `const x: seq[static string] = static: @["string1.nim", "myModule.nim"]` is no bueno |
22:52:13 | FromDiscord | <Phil> Wait, this also is invalid? `const m1: static string = "string1.nim"`↵Okay, weird |
22:56:13 | FromDiscord | <Phil> Beeeeeeeeeef |
23:01:36 | FromDiscord | <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:00 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jE1 |
23:03:14 | * | ltriant joined #nim |
23:04:38 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4jE4 |
23:05:34 | FromDiscord | <Phil> I don't use neel so I can't say much about that, sorry ^^' |
23:12:02 | FromDiscord | <<She>Horizon</Her>> In reply to @Isofruit "Which incidentally was the": It actually completely ignores the opt out settings lol |
23:12:20 | FromDiscord | <<She>Horizon</Her>> Windows 10 AME removes all the bloat and windows update at the cost of security |
23:14:09 | FromDiscord | <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:29 | FromDiscord | <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:49 | FromDiscord | <Phil> (edit) "refuse" => "refused" |
23:28:19 | FromDiscord | <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:54 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4jE9 |
23:31:38 | * | ltriant quit (Ping timeout: 265 seconds) |
23:31:54 | FromDiscord | <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:09 | FromDiscord | <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:47 | FromDiscord | <Phil> Like, the array 3 uint8 for example is the RGB of one pixel, right? |
23:42:53 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jEa |
23:43:47 | FromDiscord | <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:48 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4jEb |
23:45:28 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jEc |
23:46:45 | FromDiscord | <Phil> I guess {.thread.} may implicitly spawn a new thread and run the proc |
23:48:42 | FromDiscord | <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:20 | FromDiscord | <ambient> Seems this is a lot slower than Table[int, int] https://pastebin.com/xpj30tqj what am I doing wrong? 🤔 |
23:50:24 | FromDiscord | <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:45 | FromDiscord | <ambient> @Phil check my most recent message |
23:52:36 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/ijh |
23:53:40 | FromDiscord | <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:19 | FromDiscord | <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:09 | FromDiscord | <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:22 | FromDiscord | <Phil> You sure that getting a value by itself is also slower? |
23:57:48 | FromDiscord | <Phil> Like, I'd assume that your `[]=` would be faster since it saves a hashing step |
23:58:02 | FromDiscord | <Phil> While everything else is likely slower |
23:58:13 | FromDiscord | <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:43 | FromDiscord | <ambient> yeah, I'll try using IntSets for the something instead of Seq |
23:58:57 | FromDiscord | <Phil> In reply to @ambient "I just do a": You can just use benchy for quick and dirty profiling |
23:59:21 | FromDiscord | <Phil> It's "good enough" to get an idea without being hyper exact |