<< 12-08-2023 >>

00:04:03*rockcavera quit (Remote host closed the connection)
00:04:47*rockcavera joined #nim
00:04:47*rockcavera quit (Changing host)
00:04:47*rockcavera joined #nim
00:15:57FromDiscord<System64 ~ Flandre Scarlet> wtf this lib is weird
00:21:48FromDiscord<jordan4ibanez> Which one?
00:28:33FromDiscord<Elegantbeef> y'know that one
00:28:40FromDiscord<Elegantbeef> It does the thing
00:32:35FromDiscord<jordan4ibanez> Ahhh, atomic operations, my favorite
00:34:27FromDiscord<jordan4ibanez> You can just bolt methods onto types, like kotlin, only you can read it easier
00:36:58FromDiscord<Elegantbeef> What does that have to do with atomic operations?
00:37:27FromDiscord<jordan4ibanez> Oh it doesn't, I just found myself being like "Man I wish I could just slap some methods onto this Raylib type" and then I went "O yeah u can lol"
00:53:29NimEventerNew thread by termer: Weekly Nim Streams, see https://forum.nim-lang.org/t/10398
00:53:56termerSystem64 I like your username even though I've never actually played 東方 lol
00:59:38FromDiscord<System64 ~ Flandre Scarlet> In reply to @termer "System64 I like your": Oh thanks!↵Touhou is a nice game imo↵Especially lore, characters and musics
00:59:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @jordan4ibanez "Which one?": NimBMP
01:00:03termerI have a touhou doujin CD and have always loved the music people make
01:00:12termerso much good stuff
01:00:22FromDiscord<System64 ~ Flandre Scarlet> Yeah that's incredible
01:01:23termerhttps://www.youtube.com/watch?v=WDIUxsH11A8
01:01:52FromDiscord<System64 ~ Flandre Scarlet> ah yeah, IOSYS is a well known circle
01:02:17termerof course everyone knows IOSYS lol
01:02:24termerI like that remix a lot
01:02:46termeralso タイヨウノマキナ
01:02:51termerthat's on the same album
01:09:46*_________ quit (Ping timeout: 252 seconds)
01:21:39*_________ joined #nim
01:23:50FromDiscord<System64 ~ Flandre Scarlet> Oh alright
01:26:16*lucasta joined #nim
01:43:00FromDiscord<_gumbercules> I'm excited for the upcoming swearing although I'll probably miss tomorrow's stream
01:43:32FromDiscord<_gumbercules> Maybe not - depends on whether astrophotography is going to work out tom night or not
01:46:47FromDiscord<Elegantbeef> well I can always open up audacity and just speak
01:55:47FromDiscord<_gumbercules> There was a bot link to a thread above created by Termer about resuming their stream
01:55:58FromDiscord<Elegantbeef> Oh i know
01:56:01FromDiscord<_gumbercules> 😄
01:58:08termerlol I like swearing
01:58:28termerI think most people on IRC/Discord/Matrix would agree
01:59:52FromDiscord<Chronos [She/Her]> How does crosscompiling Nim code that uses ssl work?
02:00:14FromDiscord<Elegantbeef> I never swear I'm a good Christian boy
02:00:22FromDiscord<Chronos [She/Her]> I want to compile my discord bot in Nim to x64, on an aarch64 device but only issue I can see is openssl
02:03:00termer_gumbercules, Is there a better time for you?
02:03:04termeralso are you a euro
02:04:32FromDiscord<_gumbercules> Don't structure it around me - you'll never stream (I have a one year old). I'm in Texas
02:04:44termerI'm also in Texas
02:04:48termerHouston
02:04:50FromDiscord<_gumbercules> I appreciate it though
02:05:03FromDiscord<_gumbercules> Nice! I'm outside of Austin in Kyle
02:05:21termerI was mostly wondering if you were a euro
02:05:46FromDiscord<Elegantbeef> does texas just name places with people names vebatim?
02:05:51FromDiscord<_gumbercules> Nope! I lived in Finland for a bit but that hardly qualifies me I'm pretty sure
02:06:35FromDiscord<Elegantbeef> austin, kyle, dave, steve?
02:06:59FromDiscord<_gumbercules> In reply to @Elegantbeef "does texas just name": Steve Texas sounds sketch
02:07:14termerKaty is close to Houston
02:07:21termerMost are normal first names
02:07:25termerit feels like it
02:21:43*jsomedon joined #nim
02:53:44*pbsds quit (Quit: The Lounge - https://thelounge.chat)
02:54:21*pbsds joined #nim
03:17:36*rockcavera quit (Read error: Connection reset by peer)
03:17:56*rockcavera joined #nim
03:17:57*rockcavera quit (Changing host)
03:17:57*rockcavera joined #nim
03:43:47*lucasta quit (Quit: Leaving)
04:04:20FromDiscord<fit_z> I'm looking at getting into nim. I want to just make sure that it fits my use cases . I want a language that's decent at most things, can be used to create a GUI application, web application potentially, and general system scripts.
04:05:46FromDiscord<fit_z> Does Nim fit ? I'd also love if it would fit into QA Automation Testing as well with things like playwright
04:09:24*disso-peach quit (Quit: Leaving)
04:24:36*jsomedon quit (Quit: Connection closed for inactivity)
04:25:22FromDiscord<Phil> sent a long message, see http://ix.io/4Dd4
04:26:20FromDiscord<Phil> (edit) "http://ix.io/4Dd4" => "http://ix.io/4Dd5"
04:26:31FromDiscord<Phil> (edit) "http://ix.io/4Dd5" => "http://ix.io/4Dd6"
04:27:55FromDiscord<Chronos [She/Her]> I wonder how hard it'd be to reimplement the Nim VM from scratch honestly
04:28:10FromDiscord<Phil> Sounds like a question for internals
04:28:16FromDiscord<Elegantbeef> It's like 3k loc
04:28:19FromDiscord<Elegantbeef> It's not that complex
04:28:26FromDiscord<Chronos [She/Her]> I kinda wanna look into the compiler again but I'm working on my own programming language again so-
04:28:42FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "It's not that complex": So nuking most of the logic should be fine?
04:28:57FromDiscord<Chronos [She/Her]> ~~What if we embedded wasm3 and used that as the runtime~~
04:28:59FromDiscord<Elegantbeef> Depends what you're doing
04:29:12FromDiscord<Elegantbeef> Well you'd have to rewrite a fair bit to make the VM smarter
04:29:14FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Depends what you're doing": A reimpl of the VM
04:29:20FromDiscord<Elegantbeef> It presently uses PNodes for structs which is not really that smart
04:29:31FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Well you'd have to": Oh definitely, something that we can look into but not for a while lol
04:29:35FromDiscord<Elegantbeef> Zerbina over in nimskull has done a large VM rewrite, you could see what they did
04:29:56FromDiscord<Chronos [She/Her]> Oh yeah, we actually were there for a bit while trying to work on our failed JVM backend lol
04:30:14FromDiscord<Phil> In reply to @fit_z "Does Nim fit ?": Can't make any statements about playwright, I'm not part of our QA department at work so I'm not that familiar with any tooling outside of selenium/webdriver
04:30:15FromDiscord<Chronos [She/Her]> One thing that Zerbina helped us do was making a compiler pass that collected all the sequences and such
04:30:31FromDiscord<Phil> (edit) "selenium/webdriver" => "selenium/webdriver.↵For the rest of the points I provided the list above."
04:30:49FromDiscord<Chronos [She/Her]> Going over the top level code of the module given to us first would mean dead code elimination is already done for one
04:30:58FromDiscord<Chronos [She/Her]> Since you'd recursively go through every subnode
04:31:08FromDiscord<Chronos [She/Her]> And if it's not referenced, simply ignored
04:35:16FromDiscord<Phil> To keep in mind for myself when writing: Is "us" here referring to a group that you specified somewhere above and that I missed or is that a pronoun change I should be aware of going forward?
04:38:52FromDiscord<Chronos [She/Her]> Ah, basically: OSDD1b system
04:39:08FromDiscord<Phil> Okay, that one I'll have to google
04:39:18FromDiscord<Chronos [She/Her]> Should explain pretty much everything about why I/we tend to switch between 1st and 2nd person pronouns
04:39:37FromDiscord<Chronos [She/Her]> In reply to @isofruit "Okay, that one I'll": Longstory short: Multiple people, one brain
04:39:39FromDiscord<Phil> Ahhh check, all good
04:39:48FromDiscord<Chronos [She/Her]> Media is absolutely shit for this
04:40:40FromDiscord<Phil> Wasn't aware it was called OSDD1b, a friend of mine uses some tool that swaps the name/pfp that her message is displayed as depending on who she is at the time
04:40:57FromDiscord<Phil> Could ask her for the name if that would interest you
04:41:26FromDiscord<Elegantbeef> The matrix bridge did not appreciate that 😛
04:41:39FromDiscord<Elegantbeef> Actually with discord removing numbers I dont think nicknames propagate
04:42:03FromDiscord<Chronos [She/Her]> In reply to @isofruit "Wasn't aware it was": Multiple terms for it exist actually!
04:42:05FromDiscord<Phil> It doesn't? My accountname is isofruit, I assume Phil gets propagated to matrix, does it?
04:42:27FromDiscord<ElegantBeouf> Test
04:42:29FromDiscord<Chronos [She/Her]> DID is when you fit all the criteria, including amnesia
04:42:39FromDiscord<Elegantbeef> Yea it no propagate
04:42:57FromDiscord<Elegantbeef> Though with discord changes the bridge could just as well be broke
04:43:13FromDiscord<Phil> Elegantbeouf, the french cousin of elegantbeef
04:43:22FromDiscord<Chronos [She/Her]> OSDD is more of a collection of unnamed dissociative disorders but also given to ppl who fit some criteria for DID but not all
04:43:27FromDiscord<Phil> Wait, why does my name show up on element as Phil then
04:43:43FromDiscord<Elegantbeef> Perhaps the bridge errored in a good state for you 😄
04:43:45FromDiscord<Chronos [She/Her]> Then plural is a term that exists that I think is very accurate and encompasses all types of systems
04:44:18FromDiscord<Chronos [She/Her]> As for the tool, we're already aware of it lol, we usually talk in servers with it added but obviously Nim is an exception (and the bridge very much would not like the jank)
04:44:22FromDiscord<Phil> In reply to @chronos.vitaqua "OSDD is more of": Hmm good to know!
04:44:39FromDiscord<Phil> Actually I wonder how much it would break IRC folks
04:44:46FromDiscord<Chronos [She/Her]> Oh, immensely
04:44:53FromDiscord<Chronos [She/Her]> It works by deleting and resending messages lol
04:44:59FromDiscord<Chronos [She/Her]> And edits also work as separate messages
04:45:06FromDiscord<Elegantbeef> It'd be funny for IRC since name changes don't propagate there
04:45:07FromDiscord<Chronos [She/Her]> Blame JankCord for that
04:45:18FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "It'd be funny for": Uses discord webhooks
04:45:25FromDiscord<Chronos [She/Her]> So the changes would show...i'd think
04:45:37FromDiscord<Elegantbeef> No I mean it doesnt say X changed to Y
04:46:37FromDiscord<Chronos [She/Her]> But wouldn't the webhook name show?
04:46:58FromDiscord<Chronos [She/Her]> Wait do you mean like
04:47:07FromDiscord<Chronos [She/Her]> The message everyone gets on Matrix when a name is updated?
04:47:22FromDiscord<Chronos [She/Her]> If so then that makes sense, sorry
04:48:56FromDiscord<Elegantbeef> Yea, I mean they would not realise your account changed name, they'd just see a different user talking. Which of course depending on ones disassociation is fine, otherwise could lead to very redundant conversations 😄
04:49:09FromDiscord<Chronos [She/Her]> Yeah lol
04:49:18FromDiscord<Chronos [She/Her]> On discord that's typically solved via a 'system tag'
04:49:30FromDiscord<Chronos [She/Her]> Just a small little identifying tag at the end of the username
04:53:27FromDiscord<Elegantbeef> Oh Phil a minor funny thing about the whole graffiti bumping is it just pushes the work on for the actual graffiti program to handl
04:53:31FromDiscord<Elegantbeef> So it was actually quite minor
04:55:33FromDiscord<Chronos [She/Her]> Oh, before I work on bytecode generation for my language, does anyone have a VM (besides the JVM) they'd recommend generating bytecode for?
04:55:52FromDiscord<Chronos [She/Her]> Currently considering Neko, old project from Haxe that's super maintained but is apparently decent
04:55:54FromDiscord<Elegantbeef> Wasm, Lua
04:55:59FromDiscord<Chronos [She/Her]> Also HashLink exists too tbf
04:56:41FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Wasm, Lua": Lua has a VM? Tho WASM is an option for sure hm
04:56:49FromDiscord<Elegantbeef> Lua has bytecode yes
04:57:24FromDiscord<Elegantbeef> A major benefit with wasm is it's quite easy to use a different runtime and you can benefit from things like wasm2native
04:57:59FromDiscord<Elegantbeef> Though of course there might be equivalents for lua
04:58:04FromDiscord<Chronos [She/Her]> Hm...
04:58:19FromDiscord<Chronos [She/Her]> Yeah I'll probably go with WASM then
04:58:44FromDiscord<Chronos [She/Her]> Just need to make something to model WASM in Nim
04:58:46FromDiscord<Chronos [She/Her]> Sigh
04:59:34FromDiscord<fit_z> In reply to @isofruit "Can't make any statements": Thanks I appreciate it. I've been saying for a while "if python was typed and compiled I'd be all for it"
05:00:14FromDiscord<Chronos [She/Her]> Well it is time for me to sleep for a bit, goodnight all
05:05:57*azimut quit (*.net *.split)
05:07:40FromDiscord<Phil> In reply to @fit_z "Thanks I appreciate it.": Keep in mind that nim is not quite python.↵The learning curve isn't insanely steep, but steeper than with python.↵Because while nim has a lot of opt-in features (such as metaprogramming and dealing with low-level memory movement etc.) which help if you know them but are by no means a "must-have", due to static typing some stuff like dealing with generics is unavoidable.
05:07:55*azimut joined #nim
05:09:03FromDiscord<Phil> The nice thing though is at least that optionals are provided by the std-lib so you can avoid "null" (or "nil") in nim much better
05:11:03FromDiscord<Chronos [She/Her]> (Please for the love of god avoid using nil)
05:11:20FromDiscord<fit_z> In reply to @isofruit "Keep in mind that": Thanks for the heads up. It still looks like a very intriguing language
05:11:57FromDiscord<Phil> In reply to @fit_z "Thanks for the heads": Oh absolutely, I've come around to thinking of it in terms of being just as expressive as python, while allowing you to be terse and not have so much noise in your lines of code
05:12:34FromDiscord<Phil> https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers↵This might help you and introduce you with some of the concepts
05:13:03FromDiscord<Phil> Oh and note that if you ever want to call python code in your nim program (or use nim as a python-library in your python code), you can.
05:13:13FromDiscord<Phil> The package you want to look at for that is called `nimpy`
05:13:42FromDiscord<Elegantbeef> Poor `nil` no one ever wants to use it
05:13:46FromDiscord<Elegantbeef> It never did anything wrong
05:14:00FromDiscord<Phil> What? Yes it did!
05:14:05FromDiscord<Phil> It blew up my program a thousand times!
05:14:15FromDiscord<Elegantbeef> Sounds like a PEBKAC
05:14:34FromDiscord<arathanis> ID-10-T error
05:14:57FromDiscord<arathanis> (edit)
05:15:13FromDiscord<arathanis> My most common error
05:16:31FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "It never did anything": Looks at Java
05:16:42FromDiscord<Elegantbeef> Sure but java doesnt have value types
05:16:56FromDiscord<Chronos [She/Her]> Can easily create an Option type
05:16:59FromDiscord<Elegantbeef> So even types you'd never expect to be nilable are nilable
05:17:00FromDiscord<Chronos [She/Her]> Class
05:17:03FromDiscord<Chronos [She/Her]> Whatever lol
05:17:04FromDiscord<Phil> And java does so much stuff bad it's hard to attribute all of it to null
05:17:17FromDiscord<Elegantbeef> Make a vector in java that is not heap allocated
05:17:18FromDiscord<Chronos [She/Her]> In reply to @isofruit "And java does so": True, but NPEs
05:17:32FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Make a vector in": Valhalla is becoming a thing so
05:17:35FromDiscord<Chronos [She/Her]> Soon™️?
05:17:44FromDiscord<Elegantbeef> Right, soon
05:17:58FromDiscord<Phil> In reply to @chronos.vitaqua "Can easily create an": Which is heavily discouraged as use for fields because for some insane reason java only wants you to use optionals to express that a method may return "something or nothing" instead of enabling you to do that throughout your entire codebase
05:18:01FromDiscord<Elegantbeef> Assuming that runtime is actively used and supported by anyone that has a JVM
05:18:18FromDiscord<Elegantbeef> Arent optionals in java still nullable?
05:18:23FromDiscord<Phil> That as well
05:18:38FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Assuming that runtime is": OpenJDK themselves
05:18:41FromDiscord<Elegantbeef> It doesnt solve the nullable state it just does the adding 1
05:19:03FromDiscord<Elegantbeef> Right and what is the most used JVM?
05:19:24FromDiscord<Elegantbeef> Assuming most java usage is from minecraft it's probably oracles JVM
05:19:26FromDiscord<Phil> I dunno, legitimately there's like a hundred
05:19:57FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Assuming most java usage": Oracle is working with OpenJDK usually now
05:20:08FromDiscord<Chronos [She/Her]> I heavily doubt they wouldn't implement this
05:20:20FromDiscord<Elegantbeef> Anywho it'll be nice if/when it comes
05:20:22FromDiscord<Phil> Every time I need to swap my currently active java version with sdkman I'm at awe how many people apparently were bored enough to write one themselves
05:20:23FromDiscord<Chronos [She/Her]> Especially since GraalVM
05:20:37FromDiscord<Phil> (edit) "at" => "in"
05:20:40FromDiscord<Chronos [She/Her]> In reply to @isofruit "Every time I need": Writing a JVM seems hellish
05:20:46FromDiscord<Chronos [She/Her]> Not as much as a compliant browser tho
05:21:02FromDiscord<jordan4ibanez> JVM compliant browser sounds scary
05:21:11FromDiscord<Elegantbeef> I'm lucky cause I don't use any java program regularly
05:21:40FromDiscord<Phil> Even if you did, the gc stutters would soon make you not use it again so its self selecting!
05:21:52FromDiscord<Elegantbeef> Lol
05:22:02FromDiscord<Elegantbeef> Stop the user GC
05:22:26FromDiscord<Phil> Multi purpose GC, that's what I call efficiency
05:22:43FromDiscord<Phil> Protects you from unsafe memory access (except for NPE) and from evil users that could annoy you
05:24:01FromDiscord<Elegantbeef> Well if you do not publish code due to the GC it removed all memory errors
05:24:44FromDiscord<Phil> Efficiency over efficiency, even removes the code from human memory
05:29:57FromDiscord<jordan4ibanez> If you are talking here on android you are using java, if you are talking here on pc/ios you are using javascript, pick your poison
05:30:19FromDiscord<Elegantbeef> I mean I'm using matrix so I can use any language I want
05:30:25FromDiscord<Elegantbeef> So who's drinking poison
05:30:39FromDiscord<jordan4ibanez> You touch C at some point which is a dialect of Java so you are
05:30:49FromDiscord<Elegantbeef> Lol
05:30:54FromDiscord<jordan4ibanez> https://tenor.com/view/laughing-toothless-laugh-trendizisst-gif-23028890
05:31:06FromDiscord<Elegantbeef> This is why you don't let your kids drink tap water
05:31:16FromDiscord<jordan4ibanez> I only drank lead paint, thank you very much
05:32:06FromDiscord<Elegantbeef> Ah much better
05:32:26FromDiscord<Phil> In reply to @Elegantbeef "This is why you": This is the point where I note that I've been drinking tap water my entire life and you rebuff "Yeah, I noticed"
05:32:49FromDiscord<Elegantbeef> I don't even have to
05:32:50FromDiscord<Phil> German tap water is actually good though!
05:33:09FromDiscord<Elegantbeef> I know it was mostly assuming jordan was from the USA
05:33:46FromDiscord<Phil> Fair, I wouldn't even want to eat bread in the US from what I've seen of it over there
05:33:58FromDiscord<jordan4ibanez> I don't eat the bread either m8
05:34:13FromDiscord<jordan4ibanez> Keto, have to rid the body of diabeetus somehow
05:34:39FromDiscord<Elegantbeef> Don't eat the bread so you can drink the soda
05:35:59FromDiscord<jordan4ibanez> Can't drink the soda either, all I really can do is program in nim
05:46:13FromDiscord<Chronos [She/Her]> Keto diets are made for specific people I'm pretty sure
05:46:28FromDiscord<Chronos [She/Her]> And medical professionals have said they're not suited for anyone outside of the people it's meant for
05:47:49FromDiscord<Chronos [She/Her]> Anyway I'm putting the phone down finally, night all
05:50:09FromDiscord<Phil> night
05:59:30FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Ddr
06:01:15FromDiscord<Elegantbeef> Force making the kind parameter match the descriminator's fields, then set those fields before running the user code, then just set the field names
06:03:17FromDiscord<Phil> Basically determine which fields of A get to be assigned to based on the `aKind` parameter and assign to that?↵Yeah that was the current plan.↵The only other thing I could think is trying to figure out the desired kind based on the fields B has, but that starts becoming super messy once B has fields with names that could match to multiple kinds of the variant
06:03:31FromDiscord<Phil> (edit) "has," => "has (to save the `kind` parameter),"
06:11:00FromDiscord<Phil> Actually given the debate in internals, how do atomic works given they're apparently lockless?
06:11:23FromDiscord<Elegantbeef> atomics are operations guaranteed to take a single cycle
06:11:47FromDiscord<Phil> Oh so basically it's physically impossible to do them out of order or the like
06:12:02FromDiscord<Elegantbeef> The reason they're important in regard to arc/orc is that race conditions cannot happen on the ref count
06:12:04FromDiscord<Phil> convenient when you force physics do solve your software problems
06:12:07FromDiscord<Elegantbeef> A single thread will destruct it
06:12:08FromDiscord<Phil> (edit) "do" => "to"
06:12:52FromDiscord<Phil> The amount of operations you can do atomically must be pretty limited, right?
06:13:15FromDiscord<Phil> Like increase, decrease and maybe swap out a ref with a different ref?
06:13:24FromDiscord<Elegantbeef> "swap out a ref"?
06:13:38FromDiscord<Elegantbeef> We're talking about machine instructions it does not have the concept of a ref
06:14:09FromDiscord<Phil> In that case "swap out a number that on a higher level to me means pointer with a different number that on a higher level to me means a pointer"
06:14:54FromDiscord<Elegantbeef> https://en.cppreference.com/w/c/atomic
06:17:20FromDiscord<Phil> Okay so read, add, substract, do boolean operations on and swap out
06:17:40FromDiscord<Elegantbeef> well also bitflags
06:18:02FromDiscord<Phil> I don't have an understanding of those so I skipped those
06:18:14FromDiscord<Elegantbeef> Atomic `set[T]` in Nim
06:18:48FromDiscord<Elegantbeef> Actually sorry I'm being daft
06:18:51FromDiscord<Elegantbeef> That'd be atomic add/or
06:19:59FromDiscord<Elegantbeef> Much like simd it's just a limited selection of hardware operations that fit a niche
06:34:22FromDiscord<jordan4ibanez> Does the nim atomic lib use semaphores?
06:34:45FromDiscord<jordan4ibanez> Hmm, like, is it thread blocking or main blocking?
06:34:59FromDiscord<Elegantbeef> It uses atomics
06:35:03FromDiscord<jordan4ibanez> Well, I saw a few libraries for this stuff, so I guess this question is useless
06:38:03*ntat joined #nim
06:44:06FromDiscord<Festive> Any way to record a video in nim?
06:48:24FromDiscord<jordan4ibanez> O I just realized I asked about "atomic lib" I meant "multithreading" my apologies. I think it was because you guys were talking about atomics haha
06:52:26FromDiscord<Phil> Waaaaaaait a second, I think my `object => object variant` mapping may only be failing because of a limitation of unittests
06:52:31FromDiscord<Phil> (edit) "unittests" => "std/unittests"
06:56:25FromDiscord<Elegantbeef> Phil about to learn `==` isnt defined for variant objects
06:58:40FromDiscord<Phil> It is, it simply fails because what is defined for it tries to use the `fields` iterator, which doesn't work.↵Fieldpairs would have.
06:59:22FromDiscord<Elegantbeef> If the generic instantiation fails... it's not defined
06:59:36FromDiscord<Phil> Or maybe fields also would've worked and just not in that specific setting?↵All I can see in my forloops is that fieldpairs works
07:00:08FromDiscord<Elegantbeef> but yes using fieldpairs instead of `for x, y in fields(a, b)` works
07:00:15FromDiscord<Phil> In reply to @Elegantbeef "If the generic instantiation": not defined to me means that the function call could not be matched to any proc.↵In this call it could be matched to the generic, the generic just doesn't compile
07:00:20FromDiscord<Phil> (edit) "In reply to @Elegantbeef "If the generic instantiation": not defined to me means that the function call could not be matched to any proc.↵In this call it could be matched to the generic, the generic just doesn't compile ... " added "because it wasn't built for this"
07:00:40FromDiscord<Elegantbeef> That's the same as not defined in my view, potatoes tomatoes
07:00:57FromDiscord<Phil> Eh, for me that differs but that's just viewpoints
07:01:49FromDiscord<Elegantbeef> I can see phil is someone that'd like SFINAE
07:02:02FromDiscord<Phil> I would like what now?
07:02:32FromDiscord<Elegantbeef> It's practically how C++ does generics
07:02:52FromDiscord<Phil> Assume I know nothing about C++ because that'd be accurate
07:24:56FromDiscord<odexine> In reply to @isofruit "Assume I know nothing": https://en.m.wikipedia.org/wiki/Substitution_failure_is_not_an_error
08:03:56FromDiscord<Phil> ... I don't get it right now, I'll try again later.↵Now to figure out how to get all fields of an object variant that are valid for a specific kind
08:11:33FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DdW
08:11:59FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4DdW" => "https://play.nim-lang.org/#ix=4DdX"
08:13:37FromDiscord<Phil> Wait, I have to generate that field at runtime...gnaa but like.... err wait how can I even conceptually do this
08:13:43FromDiscord<Phil> (edit) "field" => "list of fields"
08:20:01FromDiscord<Phil> Ohhhh maybe I can solve this again via proc
08:23:39*azimut quit (Ping timeout: 246 seconds)
08:35:58FromDiscord<Phil> Okay, how do I instantiate an empty set?
08:36:07FromDiscord<Phil> Because `toHashSet([])` errors out
08:36:48FromDiscord<Phil> Ah, initHashSet >_>
08:55:52FromDiscord<Phil> You can only have variants of objects right? not tuples? Please say that tuple variants are not a thing
08:56:05FromDiscord<Elegantbeef> Correct
08:56:16FromDiscord<Phil> Fuck yes, so I only have to parse one kind of typedef
08:56:46FromDiscord<Phil> What does the RecList Node stand for?
08:56:50FromDiscord<Phil> Like what is Rec? Record?
08:57:12FromDiscord<Elegantbeef> I believe so
09:21:31FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "Keep in mind that": I think you don't have to use low level featurs
09:21:41FromDiscord<System64 ~ Flandre Scarlet> (edit) "featurs" => "features"
09:22:25FromDiscord<Phil> In reply to @sys64 "I think you don't": That I fully agree in, thus the entire "opt-in" thing.↵Just static typing is something you'll have to familiarize yourself with ^^
09:22:40FromDiscord<Phil> And once you start doing more complicated stuff that sooner or later devolves into doing some stuff at compile-time
09:23:05FromDiscord<System64 ~ Flandre Scarlet> I did Java as first language so I'm familiar with static typing
09:23:38FromDiscord<Phil> Ah, didn't mean "you" specifically, meant "you" generally as in somebody starting nim will need to learn to deal with the static type system, which can be a bit tricky in more complex situations
09:25:01FromDiscord<System64 ~ Flandre Scarlet> Ah alright
09:25:58FromDiscord<System64 ~ Flandre Scarlet> But sometimes not being able to do an addition between an int and a byte is annoying↵But I understand the goal behind that
09:31:34FromDiscord<dersnof> Why Nim doesnt allow tab
09:31:37FromDiscord<dersnof> Kind of dumb lol
09:31:49FromDiscord<dersnof> It says ‘Tabs are not allowed’
09:32:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @dersnof "Why Nim doesnt allow": Consistency between editors↵A space is always the same size, not a tab
09:32:46FromDiscord<demotomohiro> In reply to @sys64 "Consistency between editors A": https://github.com/nim-lang/Nim/wiki/Unofficial-FAQ#why-are-tabs-forbidden
09:32:51FromDiscord<dersnof> In reply to @sys64 "Consistency between editors A": Most devs prefers tabs tho 😄
09:35:05FromDiscord<odexine> In reply to @dersnof "Most devs prefers tabs": Really? I think most devs don’t really care and just use what their editor makes them use
09:35:09FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "https://github.com/nim-lang/Nim/wiki/Unofficial-FAQ": So I wasn't that far
09:36:35FromDiscord<jordan4ibanez> Is it possible to construct a type in a generic proc with varargs?
09:37:13FromDiscord<demotomohiro> There were many discussions about 'tab vs space for indent'. Nim stoped it by forcing space.
09:38:32FromDiscord<jordan4ibanez> sent a code paste, see https://play.nim-lang.org/#ix=4Dem
09:39:55FromDiscord<System64 ~ Flandre Scarlet> sent a long message, see http://ix.io/4Den
09:40:10FromDiscord<jordan4ibanez> Wait you can do `/`
09:40:18FromDiscord<jordan4ibanez> O no, discord ate my thing
09:40:19FromDiscord<System64 ~ Flandre Scarlet> Only with floats
09:40:21FromDiscord<odexine> / is reserved for floating point division
09:40:27FromDiscord<dersnof> do you think studying Nim is the future
09:40:31FromDiscord<jordan4ibanez> That's because if you do it with int you're gonna have a bad time
09:40:32FromDiscord<odexine> You can do it with integers but will get a float as return IIRC
09:40:56FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "You can do it": Oh alright, why such a difference?
09:41:11FromDiscord<jordan4ibanez> because division has remainder
09:41:22FromDiscord<odexine> It’s already commonly known that / gives floating point return so changing it wouldn’t give much benefit
09:41:37FromDiscord<jordan4ibanez> I do a really bad floor cast in Vector2i with division lmao
09:42:15FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "It’s already commonly known": Even if you use 2 ints in C, Java etc ?
09:42:23FromDiscord<odexine> Yes
09:42:45FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4Deo
09:43:00FromDiscord<jordan4ibanez> In java 3 / 2 = 1
09:43:32FromDiscord<demotomohiro> In reply to @sys64 "Even if you use": As far as I know, int / int in C returns int
09:43:35FromDiscord<jordan4ibanez> In reply to @demotomohiro "I dont understand what": I'm just trying to construct the object with some sort of generic instantiation but I don't think it's possible
09:44:27FromDiscord<odexine> I believe in python division between two integers using / gives a floating point
09:44:30FromDiscord<jordan4ibanez> So 3 / 2.0 = 1.5 and 3.0 / 2 = 1.5
09:44:56FromDiscord<jordan4ibanez> implicit casting, very cule
09:46:41FromDiscord<Phil> In reply to @dersnof "Most devs prefers tabs": No.
09:47:00FromDiscord<demotomohiro> In reply to @jordan4ibanez "I'm just trying to": You can initialize objects that have seq with varargs.
09:47:43FromDiscord<Phil> In reply to @dersnof "do you think studying": Eh, it's fun, you learn a ton, either way it's valuable knowledge
09:48:09FromDiscord<jordan4ibanez> I suppose I'll just inject the object with a factory function
09:48:41FromDiscord<arathanis> In reply to @odexine "I believe in python": you can use `//` for integer (floor) division
09:49:27FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Deq
09:49:39FromDiscord<Phil> Inserting `\n` has not worked so far to force a new line
09:50:39FromDiscord<odexine> In reply to @arathanis "you can use `//`": …which is the same as needing div for integer division
09:50:59FromDiscord<arathanis> was that the context?
09:51:05FromDiscord<arathanis> i didnt read above
09:51:05FromDiscord<odexine> And the argument can’t be that python is dynamically typed because it’s still strongly typed
09:51:39FromDiscord<jordan4ibanez> I think you could probably divide a float by a char in python
09:51:43FromDiscord<odexine> In reply to @arathanis "was that the context?": Pretty much the question was why does Nim need div for integer div or at least what I understood of it
09:51:47FromDiscord<arathanis> In reply to @jordan4ibanez "I think you could": no lol
09:51:52FromDiscord<odexine> In reply to @jordan4ibanez "I think you could": I don’t think so lol
09:51:52FromDiscord<arathanis> python is strongly typed
09:51:57FromDiscord<jordan4ibanez> You simply hammer the nail into a screwdriver and then weld together a new form factor
09:51:59FromDiscord<odexine> I think you can in Nim though
09:53:38FromDiscord<arathanis> that isn't even kind of how python works lol
09:53:43FromDiscord<Phil> ... the answer was just add an additional newline >_>
09:54:11FromDiscord<demotomohiro> In reply to @isofruit "Formatting question. How do": https://nim-lang.org/docs/manual.html#lexical-analysis-triple-quoted-string-literals↵> For convenience, when the opening """ is followed by a newline (there may be whitespace between the opening """ and the newline), the newline (and the preceding whitespace) is not included in the string.
09:54:29FromDiscord<odexine> For some reason I mistakenly recalled that characters in Nim had some strange implementation,
09:55:17FromDiscord<Phil> In reply to @demotomohiro "https://nim-lang.org/docs/manual.html#lexical-analy": Ah, that explains why I need to add an additional newline essentially
09:56:51FromDiscord<dersnof> how much it takes to learn Nim, for someone
09:58:24FromDiscord<Phil> Depends on how much of the featureset you want to learn.↵There's plenty of stuff that you don't need to know (compile-time code, macros, templates, memory-management) but that you can get into.↵Each of those can take a bit of time on top of the language itself (well templates are the easier ones among those).↵To get comfortable in the language itself... I dunno, a couple weeks of full blown effort maybe?
10:00:16FromDiscord<Phil> Basically similar to how you can learn to use annotations in java or decorators in python but the majority of the time you don't really need to know how to program them yourself
10:00:25FromDiscord<toma400> In reply to @dersnof "how much it takes": For me basics were one-two days, since I just needed to learn differences between Python and Nim (considering I came from there)
10:00:26FromDiscord<Phil> (edit) "Basically" => "Opt-in features in nim are basically"
10:00:38FromDiscord<dersnof> In reply to @toma400 "For me basics were": hmm what is advanced stuff
10:01:05FromDiscord<toma400> In reply to @dersnof "hmm what is advanced": For me? Interop, memory management, macros, for example
10:02:27FromDiscord<dersnof> oh
10:02:30FromDiscord<dersnof> makes sense
10:02:34FromDiscord<dersnof> why did you learn Nim
10:02:41FromDiscord<Phil> sent a long message, see http://ix.io/4Dev
10:03:04FromDiscord<Phil> (edit) "http://ix.io/4Dev" => "http://ix.io/4Dew"
10:03:12FromDiscord<Phil> None of those are mandatory to learn, all of those are optional
10:03:30FromDiscord<Phil> (edit) "None of those are mandatory to learn, all of those are optional ... " added "and tend to only matter in certain niches"
10:05:33FromDiscord<toma400> sent a long message, see http://ix.io/4Dex
10:06:19FromDiscord<Phil> The nice thing is that it can also be a gentle introduction into the complex topics you need to know about when dealing with low level langs
10:06:32FromDiscord<dersnof> yeah right
10:06:43FromDiscord<dersnof> i feel like no one looks Nim programmer tho
10:06:45FromDiscord<dersnof> industry
10:07:28FromDiscord<Phil> shrugs so?
10:07:34FromDiscord<Phil> (edit) "shrugs" => "🤷 "
10:09:03FromDiscord<Phil> If you're optimizing for that then you're either limited to language of the industry you're looking to get into or the general big ones (JS, python, java, ruby, C++)
10:09:06FromDiscord<toma400> In reply to @isofruit "The nice thing is": Exactly! It's basically like Red, you can start with it and stay in there (obviously not recommending being fanatic, diversifying knowledge is the key, but you know what I mean)
10:09:38FromDiscord<Phil> In reply to @toma400 "Exactly! It's basically like": You'd need to link me to what you're referencing here ^^
10:09:41FromDiscord<Phil> I assume an RTS?
10:09:42FromDiscord<toma400> I'm really curious why such stellar langs like Nim and Red aren't really more popular, since both are trying to hit exactly that universal niche people strive
10:09:46FromDiscord<Phil> (edit) "RTS?" => "RTS game?"
10:09:58FromDiscord<toma400> In reply to @isofruit "I assume an RTS": Red, programming language, built on top of Rebol ^^
10:10:08FromDiscord<toma400> https://www.red-lang.org/
10:10:52FromDiscord<toma400> Even more niche than Nim, but it looks really promising (however also very strange, considering it tries to follow Rebol syntax which is... different)
10:11:46FromDiscord<dersnof> In reply to @isofruit "If you're optimizing for": ruby still used ?
10:11:48FromDiscord<dersnof> interesting
10:11:57FromDiscord<dersnof> i learn cobol nowadays lmaoü
10:12:00FromDiscord<dersnof> (edit) "lmaoü" => "lmao"
10:12:56FromDiscord<Phil> Yeah, that's one of the more industry specific langs, fintech/banking is your target I take it
10:19:45FromDiscord<dersnof> In reply to @isofruit "Yeah, that's one of": for now yeah, i may switch tho
10:19:50FromDiscord<dersnof> i just beginned my career
10:19:54FromDiscord<dersnof> (edit) "beginned" => "began"
10:20:01FromDiscord<dersnof> i was doing frontend stuff when i was student
10:22:37FromDiscord<Phil> I find in the end it's all just building systems and that's easier the better you can express intent in a language and communicate through it.↵And its most fun when languages do that job well, thus nim.
10:23:28FromDiscord<dersnof> hmm when i learn cobol, worst side is having difficulty to find resources
10:23:35FromDiscord<dersnof> so i just started reading book
10:24:12FromDiscord<Phil> The worst part will also be understanding whatever crap others wrote down before you.↵Because you won't get to develop new stuff, you'll be maintaining whatever was cobbled together over the last 40 years or so
10:24:42FromDiscord<dersnof> In reply to @isofruit "The worst part will": yeah that makes sense. i'm not even working for bank itself
10:24:44FromDiscord<dersnof> i'm outsourced
10:24:48FromDiscord<dersnof> so they probably evaluating me
10:24:51FromDiscord<dersnof> to consider hiring
10:25:10FromDiscord<dersnof> materialistic gain getting a lot nicer when ur hireed tho
10:25:15FromDiscord<dersnof> (edit) "hireed" => "hired"
10:33:36*rockcavera quit (Read error: Connection reset by peer)
10:34:25*rockcavera joined #nim
10:34:26*rockcavera quit (Changing host)
10:34:26*rockcavera joined #nim
10:35:34FromDiscord<leetnewb> In reply to @toma400 "I'm really curious why": Last I checked, red was pretty far behind schedule
10:37:42FromDiscord<toma400> In reply to @leetnewb "Last I checked, red": Yeah, Red's issue is that being niche also makes it more stale. So fun lang to learn for funsies, but I don't expect building too huge projects with it, at least not yet
10:38:08FromDiscord<toma400> In Nim's case however, I really want to produce at least several games with it, maybe even make it my goto language for this kind of stuff
10:38:29FromDiscord<leetnewb> makes sense
10:58:31FromDiscord<System64 ~ Flandre Scarlet> In reply to @toma400 "https://www.red-lang.org/": Another language to make Tilengine bindings for 👀
11:15:33FromDiscord<Phil> Erm... any decent ideas how to check if a type-node represents a type that has fields?
11:15:51FromDiscord<Phil> Like object, ref object, tuple
11:21:54*ntat quit (Quit: leaving)
11:25:47FromDiscord<System64 ~ Flandre Scarlet> Does someone already used the NimX graphics library? if yes, how can I trigger an event when a button is clicked please?
12:07:50NimEventerNew thread by impras: Battinfo - a cli tool & nim library to query battery details , see https://forum.nim-lang.org/t/10399
12:20:33FromDiscord<toma400> In reply to @sys64 "Another language to make": What's Tilengine? 👀
12:36:37FromDiscord<dersnof> why nim requires discardable
12:36:42FromDiscord<dersnof> for throwing away return values
12:36:49FromDiscord<dersnof> why it does give error otherwise lol
12:38:32FromDiscord<toma400> It's good practice
12:38:49FromDiscord<Phil> In reply to @dersnof "why it does give": Generally to protect you from logical errors and to make it explicit that a proc returns something that you otherwise might overlook.↵The better question is though: Why are you calling a proc that returns something and then not doing something with the return statement?
12:38:51FromDiscord<toma400> Just like lack of cyclic returns, it kinda teaches you to not be so loosey as in Python
12:39:00FromDiscord<toma400> (edit) "returns," => "returns or strict typing,"
12:40:28FromDiscord<odexine> In reply to @toma400 "Just like lack of": Cyclic returns?
12:40:40FromDiscord<Phil> For reference:↵It is generally considered good practice if a proc/function/method does either transform an input A to an input B and does nothing else other than that, or it executes a side-effect e.g. writing to disk, echo'ing something out, sending an HTTP request for which you don't care about the response etc.
12:41:44FromDiscord<Phil> (edit) "input" => "output"
12:43:01FromDiscord<Phil> errrrr I have a test-suite that runs over my library.↵How can I define compiler-flags for when my library gets compiled for the tests?↵I want to have a nimble-task that enables debug-logging while running the test-suite
12:43:35FromDiscord<Phil> (edit) "library.↵How" => "library.↵There are debug-log calls in my library that only get compiled in when a specific compiler-flag is present.↵How"
12:43:40FromDiscord<Phil> (edit) "errrrr I have a test-suite that runs over my library.↵There are debug-log calls in my library that only get compiled in when a specific compiler-flag is present.↵How can I define ... compiler-flags" added "a"
12:43:57FromDiscord<Phil> `nimble test <compilerparams>` was not it apparently
12:45:09FromDiscord<Phil> The answer is, I'm an idiot and it was `-d:<compilerflag>` >_>
12:57:20FromDiscord<dersnof> can i just jump to part 3 of nim tutorials lol
13:00:59FromDiscord<Phil> Depends on if you understood part 1 and 2 😛
13:01:41FromDiscord<dersnof> In reply to @isofruit "Depends on if you": I read half of part 1
13:01:47FromDiscord<dersnof> Now want to jump interesting stuff
13:01:50FromDiscord<dersnof> Lol
13:02:07FromDiscord<Phil> I mean, that's entirely a "you" decision, if you think you can skip it, skip it
13:02:29FromDiscord<dersnof> Whats interesting project to do in Nim
13:02:33FromDiscord<dersnof> After learning
13:03:25FromDiscord<leetnewb> Not sure if you made it here in the docs page, but it might offer a few ideas: https://xmonader.github.io/nimdays/
13:03:59FromDiscord<dersnof> In reply to @leetnewb "Not sure if you": I read somewhere that those project is old in codes
13:04:33FromDiscord<leetnewb> might be - I was just thinking project concepts to do from scratch
13:05:16FromDiscord<dersnof> In reply to @leetnewb "might be - I": Ah, wouldnt that be stealing
13:05:18FromDiscord<dersnof> Codes
13:07:04FromDiscord<leetnewb> those projects are pretty generic. tictactoe in nim is just a reimplementation from a million other ways
13:12:42FromDiscord<dersnof> In reply to @leetnewb "those projects are pretty": i can do tictactoe in python too though lol
13:12:49FromDiscord<dersnof> im looking more of using Nim powers
13:13:43FromDiscord<leetnewb> make it faster :p
13:18:25FromDiscord<System64 ~ Flandre Scarlet> In reply to @toma400 "What's Tilengine? 👀": A 2D tile-based graphics engine for games
13:25:26FromDiscord<Matt> sent a long message, see http://ix.io/4Dfx
13:25:48FromDiscord<Matt> https://media.discordapp.net/attachments/371759389889003532/1139912621001298011/image.png
13:27:52FromDiscord<Matt> In general I'm not super clear on the threading model, separate from the weakref stuff. All I'd like to do is pass a reference to my thread that does not keep the object alive if no other references point to it, in a safe way that can help the thread know if the object is still alive or not (so it can terminate gracefully, or keep invoking the compaction func)
13:28:33FromDiscord<Matt> I believe this is a opportunity to understand how `gcsafe` and other mem mgmt works here, but I'm lost for where to start
13:29:23FromDiscord<Matt> Happy to discuss it in a DM as well, since this channel gets noisy
13:30:49FromDiscord<odexine> It would probably be better in public, otherwise the information would be obscured
13:31:35FromDiscord<Matt> Sure
13:31:58FromDiscord<Matt> Although it's pretty safe to say that things get lost in Discord, fast
13:34:48FromDiscord<Phil> In reply to @x.hat "Although it's pretty safe": That is the case with discord in general, I'd recommend writing a self answered SO question or a blogpost with whatever solution for your problem you figure out
13:34:55FromDiscord<Phil> SO simply has better searchability
13:35:06FromDiscord<Phil> (edit) "SO" => "Stack Overflow"
13:36:55FromDiscord<Matt> I likely will
13:37:09FromDiscord<Matt> Any thoughts on the problem?
13:37:27FromDiscord<Phil> I have not once in nim written multithreaded code, so I can't really provide any expertise here
13:38:43FromDiscord<Phil> And even then, the kind of multithreaded code I'd write would be simple problems ala you have a seq and need to perform an operation on each entry that'll take a while so you process them concurrently.↵Or "Trigger this job and log your results away, IDGAF, close the thread when you're done)
13:38:45FromDiscord<Phil> (edit) "done)" => "done""
13:38:56FromDiscord<odexine> I see you pretty much copied that 10 year old weak reference forum post code
13:39:14FromDiscord<odexine> Not sure if there’s a better way to solve it though
13:39:30*jsomedon joined #nim
13:40:02FromDiscord<Matt> I did, yeah
13:40:05FromDiscord<Phil> I would claim if nobody here is present that a forum post could also help, as we don't have everyone with knowledge present in here 24/7
13:40:12FromDiscord<Matt> I was thinking it would be a starting point
13:41:02FromDiscord<toma400> In reply to @odexine "Cyclic returns?": Imports, sorry XD
13:41:20FromDiscord<odexine> Many people consider cyclic imports as pretty important though
13:41:47FromDiscord<toma400> In reply to @sys64 "A 2D tile-based graphics": Dang, that sounds nice. Does it have some Nim implementation?
13:42:04FromDiscord<toma400> In reply to @odexine "Many people consider cyclic": Yeah. I mean, I'm actually the guy who is on both sides at the same time
13:42:31NimEventerNew thread by Malp: Background thread with a weak reference to an object in main / a different thread?, see https://forum.nim-lang.org/t/10400
13:42:35FromDiscord<toma400> I like that Nim forces you for more thoughtful organising, but yet, I love having freedom of deciding that I can use unhealthy structure, sometimes it's just better
13:43:02FromDiscord<Matt> https://forum.nim-lang.org/t/10400#69295
13:43:10FromDiscord<Matt> Well, the bot beat me to it
13:43:26FromDiscord<Matt> There it is- I copied my question in and made a forum post
13:43:41FromDiscord<odexine> Is cyclic importing really an unhealthy pattern though
13:46:13FromDiscord<toma400> In reply to @odexine "Is cyclic importing really": Depends on how you code. It's just prone to issues, at least in interpreted languages which don't do pre-checking. It is quite rough to find this out then.
13:46:47FromDiscord<toma400> My sentiment is mostly because I learned a lot of unhealthy thinking with Python and now I'm trying to slowly unlearn them 😅
13:46:48FromDiscord<odexine> In reply to @toma400 "Depends on how you": What kind of issues do you mean
13:47:02FromDiscord<odexine> Python is generally pretty fucked
13:50:08FromDiscord<toma400> In reply to @odexine "What kind of issues": Hard to give you precise example, since I erased a lot of such issues over a year ago doing rewriting of my game, but in general cyclic dependency which needs to be performed, so you can for example lack resources that are needed to be passed (because initialisation of them is too late to the moment of requirement), which was my frequent issue with logging module back in the days.
13:50:32FromDiscord<demotomohiro> I have never thought I need cyclic import. It seems cyclic import is required only when you write so complicated data structures.
13:51:42FromDiscord<toma400> It's a lot about being OOP-oriented. For Java programmers it's great, and I adore this kind of imports when writing my Minecraft mods
13:51:44FromDiscord<odexine> It is uncommon for me to need cyclic imports as well, but most of the time it is because of types
13:51:53FromDiscord<odexine> In Nim
13:52:12FromDiscord<toma400> (edit) "mods" => "mods. But then, it's quite different system to work with."
13:52:38FromDiscord<toma400> (edit) "OOP-oriented." => "OOP-oriented, I feel."
13:52:51FromDiscord<dersnof> can i do smth like
13:52:59FromDiscord<dersnof> accepts language X and converts to language Y
13:53:01FromDiscord<dersnof> a program
13:53:15FromDiscord<dersnof> in basic level though
13:53:49FromDiscord<odexine> In reply to @dersnof "accepts language X and": Yeah, I don’t see why you wouldn’t be able to
13:56:11FromDiscord<dersnof> In reply to @odexine "Yeah, I don’t see": nice. wonder which converter would be easier
13:56:25FromDiscord<dersnof> macros seems might help it
14:03:50FromDiscord<odexine> If you’re not translating Nim, it is probably better to use a parsing library
14:06:28FromDiscord<dersnof> In reply to @odexine "If you’re not translating": https://github.com/loloicci/nimly
14:06:30FromDiscord<dersnof> i found this
14:06:33FromDiscord<dersnof> idk how to use though
14:24:53FromDiscord<Phil> I'm on phone right now so I can't test this but... Are things such as "double object variants" possible?
14:25:16FromDiscord<Phil> Where you have 2 "kind" fields and sets of fields based on that?
14:42:21FromDiscord<planetis_m> In reply to @isofruit "Where you have 2": Yes I believe so.
14:45:43FromDiscord<Phil> Shit... Okay I'm not supporting those for mapping, I've got enough complications supporting mapping for normal object variants
14:51:58FromDiscord<odexine> In reply to @isofruit "Shit... Okay I'm not": 0/10 trash library
14:52:00FromDiscord<odexine> SMH
15:11:47*ntat joined #nim
15:14:05FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Dg4
15:16:14FromDiscord<heysokam> oh... it returns a bool 🤦‍♂️ man im definitely blind, lol
15:18:23FromDiscord<odexine> Lol
15:49:16*jsomedon quit (Quit: Connection closed for inactivity)
16:06:59FromDiscord<heysokam> is there a way to make `std/unittest` not crash when failing a test, and continue with the other checks or files?
16:11:06FromDiscord<Phil> In reply to @odexine "0/10 trash library": Still above a native rating, success!
16:12:25FromDiscord<System64 ~ Flandre Scarlet> In reply to @toma400 "Dang, that sounds nice.": https://github.com/system64MC/nim-tilengine
16:12:28FromDiscord<Phil> (edit) "native" => "negative"
16:12:38FromDiscord<System64 ~ Flandre Scarlet> This is a fork of Exelotl's bindings. You can find thoses here : https://git.sr.ht/~exelotl/nim-tilengine
16:27:02NimEventerNew Nimble package! namenumbersort - Provides a system.cmp like function that can be used with std/algorithm.sort to smartly sort string sequences based on their contents rather than exact match, see https://github.com/amaank404/namenumbersort
16:27:41*jsomedon joined #nim
16:35:35FromDiscord<toma400> In reply to @sys64 "https://github.com/system64MC/nim-tilengine": Nice, thank you ❤️
16:40:13FromDiscord<atr101> sent a code paste, see https://play.nim-lang.org/#ix=4Dgs
16:40:37FromDiscord<atr101> (edit) "https://play.nim-lang.org/#ix=4Dgs" => "https://play.nim-lang.org/#ix=4Dgu"
16:41:46*arkanoid quit (Ping timeout: 260 seconds)
17:01:08FromDiscord<roupi.rb> In reply to @dersnof "ruby still used ?": yes github, stripe, gumroad, shopify, figma + a bunch of other companies still on ruby
17:03:08FromDiscord<roupi.rb> also a lot of new companies use ruby too
17:03:53*xet7 joined #nim
17:03:59FromDiscord<System64 ~ Flandre Scarlet> In reply to @toma400 "Nice, thank you ❤️": your're welcome
17:06:02FromDiscord<heysokam> if you have a buffer made from `uint32` converted into a bytebuffer, how would you convert the bytebuffer into its raw numerical representation as a string to debug it with print? 🤔
17:06:25FromDiscord<heysokam> (edit) "bytebuffer," => "bytebuffer (linear sequence of bytes),"
17:10:30FromDiscord<odexine> In reply to @heysokam "if you have a": Sounds like you’re encountering an endianness problem?
17:12:16FromDiscord<System64 ~ Flandre Scarlet> Alright so↵I'll use Raylib for rendering for now https://media.discordapp.net/attachments/371759389889003532/1139969609789878302/image.png
17:13:04FromDiscord<heysokam> In reply to @odexine "Sounds like you’re encountering": just trying to debug the contents, really
17:15:02FromDiscord<heysokam> In reply to @sys64 "Alright so I'll use": oh and you have shaders too. seems like a good solution!
17:15:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "oh and you have": Yeah↵It's temporary at least↵I want to have as less dependancies as possible
17:16:27FromDiscord<heysokam> In reply to @sys64 "Yeah It's temporary at": well then you need to implement the devkit part in some way, to get rid of raylib
17:17:23FromDiscord<heysokam> but if that's the goal, then raylib is probably the least dependencies you can get, without having to deal with some API instead
17:17:36FromDiscord<heysokam> (edit) "but if that's the goal, then raylib is probably the least dependencies you can get, without having to deal ... with" added "manually"
17:17:59FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "well then you need": wdym by devkit?
17:18:07FromDiscord<System64 ~ Flandre Scarlet> can't I use GLFW?
17:18:15FromDiscord<System64 ~ Flandre Scarlet> or SDL2 window?
17:21:04FromDiscord<heysokam> In reply to @sys64 "can't I use GLFW?": yes, of course. but you will be implementing the devkit functionality yourself manually with the API to get rid of raylib/sokol/ngpu/whateverElse
17:22:15FromDiscord<heysokam> even if you made a `tinyFramebuffer` library, that would still be a dependency that would fill the same gap that raylib is filling right now
17:22:47FromDiscord<System64 ~ Flandre Scarlet> Oh, so I need the dependancy for interacting with the GPU?
17:23:00FromDiscord<heysokam> you need the functionality, no matter how its made
17:23:34FromDiscord<heysokam> devkits offer that type of functionality, so you don't have to rewrite it yourself
17:23:45FromDiscord<System64 ~ Flandre Scarlet> but what is the devkit for?
17:23:55FromDiscord<heysokam> rendering or anything else
17:24:37FromDiscord<heysokam> if you mean that you want to get rid of the "bloat" from raylib, then yeah definitely useful to use some rendering with an API
17:24:59FromDiscord<heysokam> not sure if raylib is much bloat though, but depends on how lean you want to be
17:25:45FromDiscord<System64 ~ Flandre Scarlet> Yeah I don't need the entire Raylib
17:26:17FromDiscord<System64 ~ Flandre Scarlet> But at the same time, Raylib with GPU interaction so easy to work with
17:26:30FromDiscord<Elegantbeef> Well you can statically link raylib to remove all the cruft
17:26:48FromDiscord<System64 ~ Flandre Scarlet> I think Naylib compiles from source?
17:27:27FromDiscord<Elegantbeef> So then it probably already does
17:30:37FromDiscord<heysokam> In reply to @sys64 "But at the same": that's the main benefit yeah
17:30:58FromDiscord<heysokam> you would need to implement all of that yourself otherwise
17:31:19FromDiscord<heysokam> its not too too much work, but its still some. compared to raylib which JustWorksTM
17:33:11*azimut joined #nim
17:38:00termerRaylib is AWEOME
17:38:02termer*AWESOME
17:38:11termerAre you using Naylib System64?
17:38:18termerI started a game with that
17:43:54FromDiscord<System64 ~ Flandre Scarlet> In reply to @termer "Are you using Naylib": Yeah, for rendering at least
17:44:15termerIt's better than SDL for most of those things
17:44:20termerSDL is annoying
17:45:04FromDiscord<heysokam> sdl is a pain, agreed
17:45:14FromDiscord<Elegantbeef> Disagree
17:45:17FromDiscord<heysokam> beef loves it though, but that I will never understand
17:47:53FromDiscord<Elegantbeef> It's simple and easy to use
17:48:06FromDiscord<Elegantbeef> What can I say, I'm a simple man
17:54:44FromDiscord<Phil> uuuuuugh I have to write a test-suite but I also really don't wanna
18:00:16*xet7 quit (Remote host closed the connection)
18:04:42FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "It's simple and easy": How can you display a raw pixel buffer?
18:05:45FromDiscord<System64 ~ Flandre Scarlet> Btw is there a compile-time Case?
18:07:21FromDiscord<cia.gov> sent a code paste, see https://play.nim-lang.org/#ix=4DgZ
18:08:05FromDiscord<System64 ~ Flandre Scarlet> Are you doing an online game?
18:08:54FromDiscord<cia.gov> making a server for an online 2d game.
18:09:19FromDiscord<cia.gov> trying nim for the first time, looking for a new language to learn.
18:09:43FromDiscord<Elegantbeef> A macro is require for a ct case
18:10:40FromDiscord<Elegantbeef> Here you go system https://github.com/beef331/gooey/blob/master/example/sdlimpl.nim#L110-L113
18:10:44FromDiscord<Elegantbeef> `server: var Server`
18:10:50FromDiscord<Elegantbeef> Nim is immutable by default
18:12:08FromDiscord<toma400> In reply to @sys64 "Alright so I'll use": Do Raylib use F#?
18:13:11FromDiscord<toma400> I'm really eager to start making 2.5D RPG game in Nim, but I'm wondering which framework would be stable/maintained enough to pick, especially if I plan on pretty huge game, so it needs to be performant and pretty extensive.
18:13:20FromDiscord<m4ul3r> There's no way to allocate a cstring on the stack in nim is there?
18:13:40FromDiscord<toma400> (edit) "extensive." => "extensive on long run.."
18:14:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @cia.gov "making a server for": I'm making an online Shmup too https://media.discordapp.net/attachments/371759389889003532/1139985351117639830/2023-08-03_18-19-41.mp4
18:14:48FromDiscord<Elegantbeef> Make an array of characters
18:25:51FromDiscord<Phil> > Unhandled exception: assignment to discriminant changes object branch; compile with -d:nimOldCaseObjects for a transition period [FieldDefect]↵↵... that's a new one
18:29:16*jsomedon quit (Quit: Connection closed for inactivity)
18:31:29FromDiscord<System64 ~ Flandre Scarlet> In reply to @toma400 "Do Raylib use F#?": It uses C
18:32:01FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Dh0
18:32:34FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4Dh0" => "https://play.nim-lang.org/#ix=4Dh2"
18:33:21FromDiscord<konsumlamm> why don't you just initialize it when declaring it?
18:33:45FromDiscord<Phil> It's code generated via macro
18:34:04FromDiscord<Phil> Basically for "normal" object types I just initialize them as `result = T()`
18:34:22FromDiscord<Phil> But for object variants that default initializes the kind field as well of course and reassigning that is a big nono
18:34:36FromDiscord<srmordred> is `--hotcodereloading:on` working with nim 2.0?
18:35:12FromDiscord<jordan4ibanez> We have hot reloading?
18:35:42FromDiscord<Phil> I only know about incremental compilation, no idea about hotcodereloading, got to ask internals
18:40:03FromDiscord<Phil> TFW there is no `newObjConstr()` proc
18:41:33*rockcavera quit (Read error: Connection reset by peer)
18:42:18*rockcavera joined #nim
18:42:18*rockcavera quit (Changing host)
18:42:18*rockcavera joined #nim
18:44:11FromDiscord<Phil> is there a common shorthand name for the discriminator-field that is "widely recognized" ?↵typing out `discriminatorFieldName` is getting really tiring
18:44:26FromDiscord<Phil> (edit) "is there a common shorthand name for the discriminator-field ... that" added "in object variants"
18:44:58FromDiscord<Phil> reading it as well but I don't want to lose information
18:52:53FromDiscord<System64 ~ Flandre Scarlet> Is it normal I have this error? https://media.discordapp.net/attachments/371759389889003532/1139994936578674788/image.png
18:53:24FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Dh6
18:54:05FromDiscord<jordan4ibanez> Why not make that a proc?
18:54:24FromDiscord<jordan4ibanez> pragma inline it I suppose?
18:54:28FromDiscord<Phil> might be a performance thing, function calls do have slight overhead
18:54:34FromDiscord<Phil> fair, inline might do it
18:54:38FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "might be a performance": Yes, performances
18:55:12FromDiscord<Phil> In reply to @sys64 "Yes, performances": Generally I'd claim premature optimization know unless you know very well that this is one of your hotter code paths
18:55:31FromDiscord<Phil> And that this is one of the more expensive costs that you pay
18:55:40FromDiscord<System64 ~ Flandre Scarlet> wdym?
18:55:56FromDiscord<Phil> (edit) removed "know"
18:58:18FromDiscord<Phil> sent a long message, see http://ix.io/4Dh8
18:58:55FromDiscord<Phil> (edit) "http://ix.io/4Dh8" => "http://ix.io/4Dh9"
18:59:58FromDiscord<System64 ~ Flandre Scarlet> Oh alright↵But this function will be executed for window width x window height x 3 times
19:00:28FromDiscord<Phil> Sure, but do you know that this'll be a problem given that it might simply be inlined by the compiler?
19:01:16FromDiscord<Phil> That's why jorden4ibanez suggested just adding the inline pragma and I would suggest if you want to performance optimize, going over your running program codebase with valgrind or the like
19:02:10FromDiscord<Phil> See what's taking up most of the processing time and then spend the 5-30 minutes troubleshooting the template-thing would cost you here optimizing that proc instead
19:02:33FromDiscord<Phil> (edit) "what's" => "what procs are"
19:03:49FromDiscord<Phil> That's why quotes such as "Premature Optimization is the root of all evil" etc. exist, which of course is an exaggeration but one with a kernel of truth.
19:07:09FromDiscord<Phil> Ah, and the figure of speech of "hot code paths" relates to procs that you know are where most of the computations happens (either by being called very often or by just being extremely expensive)
19:07:24FromDiscord<Phil> I never know what part of my programming lingo is actually standard wording or not =/
19:08:10FromDiscord<Phil> (edit) "happens" => "happens/most of the runtime is spent" | "expensive)" => "expensive (or waiting a lot))"
19:10:35FromDiscord<jordan4ibanez> Premature optimization: If you want the most optimized code: don't write any at all with n(0) big O
19:23:09FromDiscord<System64 ~ Flandre Scarlet> So I should code first, then optimize?
19:25:14FromDiscord<jordan4ibanez> Yeah! so like my favorite example of this is a voxel chunk right?
19:25:17FromDiscord<Phil> Pretty much.↵Try to write the code first as easily understandable as possible.
19:25:41FromDiscord<Phil> Optimize for the you in 6 months that has to touch that piece of code again and has no idea what's going on
19:25:55FromDiscord<Phil> Assume they're slightly drunk and tired and need things baby simple
19:26:33FromDiscord<jordan4ibanez> OR
19:26:33FromDiscord<jordan4ibanez> sent a code paste, see https://play.nim-lang.org/#ix=4Dhe
19:26:39FromDiscord<jordan4ibanez> we can do something ridiculous
19:27:24FromDiscord<jordan4ibanez> sent a code paste, see https://play.nim-lang.org/#ix=4Dhf
19:27:54FromDiscord<Phil> I assume the second implementation hits L1 cache more often and thus becomes ridiculously fast?
19:27:58FromDiscord<jordan4ibanez> Ye
19:28:06FromDiscord<jordan4ibanez> It's fun, I love this example
19:28:30FromDiscord<Phil> But basically if you only touch this data for a brief moment it makes no sense to implement that way because then you need to deal with the complexity this brings
19:28:34FromDiscord<Phil> Makes sense as an example
19:28:53*ntat quit (Quit: leaving)
19:29:23FromDiscord<jordan4ibanez> I will show you unrelated to nim: but just keep in mind, this was quite a bit slower before the base -> optimization process https://youtu.be/fo6iCZhLlXk
19:29:52FromDiscord<jordan4ibanez> This is why you write it out basic first, simple, then you write your api into the component and make it quick, so it acts like before, but it's multitudes faster
19:30:07FromDiscord<jordan4ibanez> Correctness, cleaness, understandability, maintainability and finally, speed
19:30:42FromDiscord<Phil> Notice him sneakily not writing: testing 😛
19:30:43FromDiscord<konsumlamm> sent a code paste, see https://play.nim-lang.org/#ix=4Dhg
19:30:51FromDiscord<Phil> Because nobody likes testing 😛
19:31:10FromDiscord<jordan4ibanez> Well that's because I didn't even know unit tests were a thing in nim, used to jupiter
19:31:20FromDiscord<jordan4ibanez> But now I do
19:31:32FromDiscord<Phil> TBF unit-testing in nim is hard as fuck when you can't monkey patch the statically dispatched procs
19:32:19FromDiscord<Phil> Which beef keeps telling me is not important but I maintain my stance that for propper unit-testing I need to be able to test my proc in isolation of all other procs from myself that it calls
19:33:04FromDiscord<_fcn_> Hello there! I am running some basic tests over naive prime algorithm with Nim, Zig and V, and I was struggling with Nim been 30-40% slower, when finally I found the reason... Nin int is an int64 by default. Changing it to int32 make the trick. Is this a "know" factor to everybody here?
19:33:27FromDiscord<Phil> that int is int64? Yes.↵Though it is not always int64, that depends on the platform
19:34:20FromDiscord<Phil> I'm not super sure what exactly determined the default size of the int but I think it was the OS (?)
19:35:07FromDiscord<Phil> Like Linux, Windows etc. are 64bit nowadays so thus the int-size reflects that.↵For 32bit systems int would be int32↵↵If you want to be explicit about it, never use int and instead use int32/64.
19:35:28FromDiscord<Phil> That was recommended against but I forgot the arguments as to why as they didn't matter to me in the area where I code
19:40:46FromDiscord<Phil> sent a long message, see http://ix.io/4Dhi
19:42:18FromDiscord<djazz> btw, float is ALWAYS float64... changed some float to float32 on my pico code and it got a bit faster
19:42:29FromDiscord<Phil> This is also mentioned in the tutorial, albeit in a manner imo that makes one notice it not quite as well:↵> Most often integers are used for counting objects that reside in memory, so int has the same size as a pointer.↵https://nim-lang.org/docs/tut1.html#basic-types-integers
19:42:45FromDiscord<Phil> In reply to @djazz "btw, float is ALWAYS": always as in even on a 32bit OS?
19:42:49FromDiscord<djazz> yes
19:43:20FromDiscord<djazz> atleast on my microcontroller heh
19:43:24FromDiscord<Phil> I am fascinated by ↵1) You have a machine with a 32bit OS floating (heh) around?↵2) Okay, that is surprising to me
19:44:04FromDiscord<_fcn_> I am running ubuntu on wsl, 64bit
19:44:59FromDiscord<djazz> in nim source: "# 'float64' is now an alias to 'float'; this solves many problems"
19:45:14FromDiscord<Phil> Either way, this is one of those facts that is mentioned in a couple places and you could argue that it is visible given that it is indeed mentioned, but it is also somwhat easily missed
19:45:41FromDiscord<djazz> yeah
19:45:51FromDiscord<djazz> in C, float is 32 bit and double is 64 bit
19:45:54FromDiscord<Phil> Meaning if you were to ask everyone in the community my gut feeling would be that the responses would be somewhat mixed between those that do and don't know
19:45:57FromDiscord<djazz> cfloat is float32
19:46:01FromDiscord<djazz> cdouble is float64
19:46:24FromDiscord<Phil> (edit) "somwhat" => "somewhat"
19:47:19FromDiscord<Phil> Yeah that nim doesn't have the float double int long naming convention was a bit weird
19:47:28FromDiscord<djazz> `echo (sizeof(float), sizeof(float32), sizeof(float64))` => `(8, 4, 8)`
19:47:37FromDiscord<Phil> But then again, just having everything unified and be suffix it with the bit-length makes more sense overall to me
19:48:24FromDiscord<Elegantbeef> Well mocking is an interesting thing, since you are not testing the actual program you have to assume your mocked procedures abide by the actual program↵(@Phil)
20:01:01FromDiscord<Phil> In reply to @Elegantbeef "Well mocking is an": For the most part the alternative is though to only integration test.↵If I had a better alternative I'd point at it, but doing integration testing is pretty much the only thing you can do if mocking is out
20:02:08FromDiscord<Phil> There's of course other strategies such as Golden Rule testing etc. but imo those are approximations and checking for consistent behaviour, imo less about logically testing that things are as they should be
20:05:59FromDiscord<Elegantbeef> Isnt mocking the epitome of not testing something as they should be
20:07:54FromDiscord<_fcn_> The news for me was that the default size is not the most performative by default...
20:08:27FromDiscord<Elegantbeef> It's the most precise though
20:13:14FromDiscord<_fcn_> Yeah, it is, but worth mention that they could hurt the performance...
20:14:11FromDiscord<_fcn_> This is my fork of it, if anyone wants to check: https://github.com/vectorlab-br/primecompare.git
20:21:55FromDiscord<Elegantbeef> To be steve, it's a system language so it's half expected you understand that more data is slower
20:29:28FromDiscord<System64 ~ Flandre Scarlet> Wait, custom assignement also work with templates? https://media.discordapp.net/attachments/371759389889003532/1140019240011833364/image.png
20:30:02FromDiscord<Elegantbeef> Well yea it's a standard syntax
20:30:30FromDiscord<System64 ~ Flandre Scarlet> what's the difference between a proc and a template?
20:30:50FromDiscord<Elegantbeef> A procedure is a called a template is subsituted
20:31:09FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "A procedure is a": Oh, so template is like #define in C?
20:31:17FromDiscord<Elegantbeef> Yes
20:31:34FromDiscord<System64 ~ Flandre Scarlet> Oh alright!
20:31:40FromDiscord<System64 ~ Flandre Scarlet> and Macros ?
20:32:01FromDiscord<Elegantbeef> They're invoked on the VM and expand code using code
20:34:29FromDiscord<System64 ~ Flandre Scarlet> Oh alright
20:39:30FromDiscord<System64 ~ Flandre Scarlet> And is it possible to make a proc that is able to take a parameter of any type?
20:41:07FromDiscord<Elegantbeef> Yes we have generics
20:41:24FromDiscord<System64 ~ Flandre Scarlet> Oh nice
20:49:17FromDiscord<_fcn_> In reply to @Elegantbeef "To be steve, it's": Yeap, now I know it 😆
20:50:25*lucasta joined #nim
21:05:59FromDiscord<Phil> Basically macros are writing code that writes code but with fine-grained control, as in you can generate each line of code in a rather fine-grained manner.
21:06:32FromDiscord<Phil> (edit) "in" => "and control every individual part of a statement, fill them with strings from variables you got elsewhere etc.in"
21:06:38FromDiscord<Phil> (edit) "etc.in a rather fine-grained manner." => "etc."
21:10:19FromDiscord<System64 ~ Flandre Scarlet> Sounds powerful!
21:10:33FromDiscord<System64 ~ Flandre Scarlet> This is not generic? https://media.discordapp.net/attachments/371759389889003532/1140029579633901749/image.png
21:12:40FromDiscord<Elegantbeef> Of course not
21:12:51FromDiscord<Elegantbeef> You just put a `T` there, that means nothing
21:13:04FromDiscord<Elegantbeef> `LineCallBack[T] = proc(line: int, userData: T)`
21:26:41FromDiscord<System64 ~ Flandre Scarlet> Oh alright, thanks!
21:28:05FromDiscord<System64 ~ Flandre Scarlet> And is that normal? https://media.discordapp.net/attachments/371759389889003532/1140033990594662470/image.png
21:30:10FromDiscord<Elegantbeef> I mean yes generics are generics
21:30:10FromDiscord<Elegantbeef> You cannot have a undefined generic
21:30:16FromDiscord<Elegantbeef> undefined generic parameter
21:30:29FromDiscord<Phil> In reply to @sys64 "And is that normal?": Yeah, tell me what type the T of your LineCallback in EngineContext has
21:31:10FromDiscord<Phil> Because right now you're defining it as "This is a LineCallback of type...err... I dunno"
21:31:22FromDiscord<Phil> Same for ColumnCallback
21:31:25FromDiscord<System64 ~ Flandre Scarlet> I want userdata to be any type the user want
21:31:34FromDiscord<Elegantbeef> So then maybe `EngineContext[T]`
21:31:41FromDiscord<Phil> Sure, but that means that EngineContext has at least 1 generic parameter itself
21:31:54FromDiscord<Elegantbeef> There is no way to allow any type into a single field
21:32:02FromDiscord<Elegantbeef> This is the entire point of static typing
21:32:21FromDiscord<System64 ~ Flandre Scarlet> Oh alright↵There is maybe a way
21:32:44FromDiscord<Phil> Basically there must always be a type.↵Either it's an explicit type (int, string etc.) or a generic type that acts as a placeholder so the nim compiler can copy paste the entire construct to whenever this type is invoked with an explicit type
21:33:03FromDiscord<Phil> (edit) "type" => "construct"
21:33:24FromDiscord<System64 ~ Flandre Scarlet> Makes sense
21:33:43FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4DhR
21:33:48FromDiscord<Phil> So in your case, it's EngineContext[T] to turn the EngineContext into a generic type (aka a not-real-type as it's now only a blueprint that gets)...
21:33:50FromDiscord<Phil> don't do that please
21:33:52FromDiscord<Phil> For the love of god
21:34:07FromDiscord<Elegantbeef> I mean Phil that's what C does and nothing ever bad happens with C
21:34:10FromDiscord<Phil> Like, I know I do it, but I do it in contexts where I know how to get the original type back
21:34:33FromDiscord<Phil> In reply to @Elegantbeef "I mean Phil that's": Fucking heresy coming out of your keyboard
21:34:45FromDiscord<Elegantbeef> Lol
21:34:54FromDiscord<System64 ~ Flandre Scarlet> If you know what you're doing, you can cast the pointer
21:35:01FromDiscord<Elegantbeef> Indeed
21:35:04FromDiscord<Phil> Sure, if you get the type wrong your program dies
21:35:21FromDiscord<System64 ~ Flandre Scarlet> this is what SDL2 does with audio callback
21:35:25FromDiscord<Elegantbeef> Though the safest way is to do `userData: RefRoot` then any `ref object of X` can be passed safely and converted
21:35:35FromDiscord<Elegantbeef> Many C programs do type erasure as it's the only solution there
21:35:48FromDiscord<Phil> In terms of complexity and ways to footgun yourself, generics are incredibly much safer an option
21:35:51FromDiscord<System64 ~ Flandre Scarlet> and can I pass a tuple for example?
21:35:52FromDiscord<Elegantbeef> Well phil you say that your program dies, but it doesnt
21:35:53FromDiscord<Elegantbeef> It continues running until something bad happens
21:36:13FromDiscord<Elegantbeef> No you'd have to pass a covertible to RootRef
21:36:24FromDiscord<Elegantbeef> Which is only `ref object of RootObj` or any children of a type
21:36:36FromDiscord<System64 ~ Flandre Scarlet> Oh alright
21:36:41FromDiscord<Elegantbeef> The pointer might be the best solution for any type you want
21:37:18FromDiscord<System64 ~ Flandre Scarlet> Yeah↵It's nil by default, the user don't have to use it
21:38:29FromDiscord<Phil> sent a long message, see http://ix.io/4DhT
21:38:47FromDiscord<Elegantbeef> of course that's wrong phil
21:38:52FromDiscord<Elegantbeef> You do not cast the procedure you drongo 😄
21:39:22FromDiscord<Phil> The userdata won't make it much better
21:39:55FromDiscord<System64 ~ Flandre Scarlet> bruh why tf casting a proce... Wait↵This is a great idea
21:40:03FromDiscord<Elegantbeef> Oh god
21:40:14FromDiscord<System64 ~ Flandre Scarlet> passing a procedure as parameter
21:40:16FromDiscord<Phil> In reply to @sys64 "bruh why tf casting": Casting a proc can work for signalling systems where oyu need to store them in a hashmap but dear god
21:40:25FromDiscord<Phil> (edit) "oyu" => "you"
21:40:39FromDiscord<Phil> Make sure this is all in a system where you can guarantee that you're correctly inferring the type
21:40:45FromDiscord<Phil> (edit) "Make sure this is all in a system where you can guarantee that you're correctly inferring the type ... " added "that you cast to"
21:41:45FromDiscord<Elegantbeef> I like static typing as much as the next guy, but phil this isnt even that cursed
21:41:48FromDiscord<Phil> (edit) "In reply to @sys64 "bruh why tf casting": Casting a proc can work for signalling systems where you need to store them in a hashmap ... but" added "together and are thus forced to use pointers, while being able to infer the original type based on the key used to store the pointer,"
21:43:55FromDiscord<Phil> In reply to @Elegantbeef "I like static typing": I mean I've done it myself before in very limited scopes so it's not like I have that much of a way to protest here either, I just try to limit that happening wherever I can
21:44:35FromDiscord<Elegantbeef> Right, and depending what they're doing they might dynamically attach procedures to this context
21:44:55FromDiscord<Elegantbeef> So it could be hard to get away from, a generic is obviously the best
21:46:16FromDiscord<Elegantbeef> One can always extract type information and store that to prevent errors
21:46:52FromDiscord<Phil> store type information?
21:47:21FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/JeeVR
21:47:30FromDiscord<Elegantbeef> Yes Nim has RTTI you can use for whatever you want
21:47:51FromDiscord<Phil> The best I managed to come up with is mentally associate certain types with certain enums/hashmap keys and thus manage to cast... wait I need to check the docs for that proc
21:48:23FromDiscord<Phil> Systems module, like the one thing where I rarely lurk >_>
21:48:28FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/rne65
21:48:57FromDiscord<Elegantbeef> It's just a pointer to the type information, it's fantastic for any thing where you do not need persistent type information
21:49:14FromDiscord<that_dude.> I noticed that set already is defined, What would be a better name than set for this proc? https://media.discordapp.net/attachments/371759389889003532/1140039311778132098/image.png
21:49:17FromDiscord<Elegantbeef> I use it for my ECS to allow easily adding/grabbing components
21:50:24FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Oh god": Pfffff
21:50:41FromDiscord<Phil> In reply to @that_dude. "I noticed that set": add?↵I assume you're inserting val into the grid at the coordinates?
21:50:44FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DhV
21:50:53FromDiscord<Phil> Bracket operator is even better, take beefs approach
21:51:04FromDiscord<that_dude.> Yeah, but I feel like add assumes extending or incrementing
21:51:26FromDiscord<Phil> Fair, bracket operator than
21:51:28FromDiscord<that_dude.> Already had this lol https://media.discordapp.net/attachments/371759389889003532/1140039877476491424/image.png
21:51:34FromDiscord<that_dude.> I'm looking through some older code of mine
21:51:42FromDiscord<Elegantbeef> Jeez
21:51:50FromDiscord<Elegantbeef> Needlessly adding overloads what is this JS
21:52:02FromDiscord<Phil> In reply to @Elegantbeef "Needlessly adding overloads what": no, TS of course
21:52:03FromDiscord<Phil> We got types
21:52:09FromDiscord<that_dude.> That's how I work unfortunately. "What if I wanted to share this with others"
21:52:14FromDiscord<that_dude.> Helps me debug n stuff
21:52:39FromDiscord<that_dude.> Should I just throw away the set/get and only use brackets then?
21:53:48FromDiscord<Phil> Yeah, it's more expressive that way.↵Grid implants in you the concept of x and y coordinates anyhow, so that means you start thinking 2 D array and thus you'd access `x[y][z]`.↵`grid[y, x]` is close enough to comfortably map to that mental model
21:54:02FromDiscord<Phil> (edit) "Yeah, it's more expressive that way.↵Grid implants in you the concept of x and y coordinates anyhow, so that means you start thinking 2 D array and thus you'd ... accessvia" added "assume" | "assumeaccess ... `x[y][z]`.↵`grid[y," added "via syntax like"
21:54:39FromDiscord<that_dude.> also does `[]` work for both `var a = thing[0]` and `thing[0] = 1`?
21:54:57FromDiscord<that_dude.> Sounds good
21:55:10FromDiscord<Elegantbeef> well `[]=` and `[]`
21:55:12FromDiscord<that_dude.> Ok
21:55:16FromDiscord<that_dude.> I'll keep both then
21:55:17FromDiscord<Elegantbeef> I made an whoopsie up there
21:55:31FromDiscord<that_dude.> Fair enough
21:55:38FromDiscord<that_dude.> Glad I'm not going stupid then lol
21:55:40FromDiscord<Elegantbeef> Remember to make a `[]` that returns `var` and `lent`
21:55:54FromDiscord<Phil> In reply to @Elegantbeef "I made an whoopsie": How unelegant
21:55:58FromDiscord<Phil> (edit) "unelegant" => "inelegant"
21:56:15FromDiscord<that_dude.> Why would I need to do either of those?
21:56:45FromDiscord<Elegantbeef> So you can do `grid[y, x].doThingThatMutates`
21:56:53FromDiscord<that_dude.> Right now I'm with the assumtion that `var a = thing[0]` will give me a copy to work with (which is how the thing is designed around rn)
21:57:02FromDiscord<Elegantbeef> or do `grid[y, x].doThingThatCanBorrowALargeDataType()`
21:57:10FromDiscord<Elegantbeef> It still will give you a copy
21:57:27FromDiscord<Phil> I mean, how much do you wanna avoid the copy is the big question to ask
21:57:29FromDiscord<Elegantbeef> But the point of `lent` and `var` is to make your life easier for if you want to mutate the grid or not do unneeded copying
21:57:39FromDiscord<that_dude.> Ah ok
21:57:48FromDiscord<Phil> Ah, fair, if the grid is for maintaining state that makes more sense than having copies
21:57:53FromDiscord<Elegantbeef> It's a generic container Phil, it doesnt matter how much you want to
21:58:11FromDiscord<that_dude.> I think I'm going to stick with what I have because the philosophy of the current code was to default to copies so I don't accidentally mutate state during run time
21:58:23FromDiscord<Elegantbeef> If you ever use this on any type that is expensive to copy... you do not want to copy unless you need to
21:58:23FromDiscord<Elegantbeef> string, seq, table, array, ....
21:58:26FromDiscord<Elegantbeef> Atleast do the lent then
21:58:39FromDiscord<Elegantbeef> Do not get how you can accidentally mutate
21:58:45FromDiscord<Elegantbeef> `var a = grid[y, x]` is still a cop
21:58:47FromDiscord<Elegantbeef> copy\
21:58:51FromDiscord<Phil> In reply to @Elegantbeef "If you ever use": That one I'd agree with. But wouldn't you use ref-types there in which case you'd only be copying ref's?
21:59:03FromDiscord<Elegantbeef> but `grid[y, x].doThing()` where `doThing` taks a `var T` is fine
21:59:05FromDiscord<Elegantbeef> No you wouldnt phil
21:59:08FromDiscord<that_dude.> All of my `Grid` api is assumes that only copies are made. I don't want to mix and match it
21:59:18FromDiscord<Phil> But large objects go to heap was my understanding
21:59:23FromDiscord<Elegantbeef> There is no mix and match
21:59:36FromDiscord<that_dude.> Also `T` will basically only be either enums or small objects
21:59:37FromDiscord<Elegantbeef> Large objects do not go on the heap
21:59:44FromDiscord<Elegantbeef> In places you want to mutate you can mutate
21:59:50FromDiscord<Elegantbeef> In places you do not want to you do not
22:00:09FromDiscord<Elegantbeef> Presently if you do want to mutate a value in the grid you cannot
22:00:55FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/cfyVh
22:00:57FromDiscord<Elegantbeef> instead of `grid[y, x].doThing()`
22:02:26FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4DhZ
22:03:00FromDiscord<Elegantbeef> well anyway back to phil
22:03:11FromDiscord<Elegantbeef> `lent` is there for when you have a large object in like a sequence and want to reference it without copying
22:03:12FromDiscord<that_dude.> Sorry lol, thanks tho
22:03:18FromDiscord<Elegantbeef> Or even just expensive copies like strings
22:03:34FromDiscord<Elegantbeef> In the future with views you'll be able to hold onto those references
22:03:42FromDiscord<Elegantbeef> So you will not need this inane idea of "Use ref to not avoid copying"
22:04:18FromDiscord<Elegantbeef> "Use a ref to avoid copying"\
22:04:52FromDiscord<Elegantbeef> As it stands that's still a pretty bad take in my view, for many types you can just use `object` and make the `=copy` error and call it a day
22:05:32*lucasta quit (Quit: Leaving)
22:05:38FromDiscord<Elegantbeef> This avoids adding in unneeded `ref` and makes the code less likely to explode in your face cause you have a nil somewhere
22:17:06FromDiscord<fit_z> Are the libraries for nim a bit more small because nim is a young language or is it more of a "niche" language ?
22:23:55FromDiscord<Elegantbeef> "bit more small"
22:45:49FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Di9
22:46:06FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Dib
22:49:08termerWhat do you mean small
22:49:12termerLike few in quantity?
22:49:34termerNim is niche in the fact that it aims especially high to do everything
22:49:46termersounds self-contradictory lol
22:50:16termerIn any case, Nim isn't really targeting any particular niche, but it's not as widely used as many other languages
22:53:53FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Die
22:55:44FromDiscord<Elegantbeef> you're doing something else then
22:56:22FromDiscord<Elegantbeef> Yea termer's right, small community large possible usage = oddly diverse packages but not a lot of coverage in specific domains
22:56:48FromDiscord<Elegantbeef> small community + large possible usage\
22:57:18termerThe biggest target, either intentionally or incidentally, is use in place of C or C++
22:57:25termerI've found myself using it in place of those several times
22:57:57FromDiscord<Elegantbeef> Well that is one of the perks of using those languages as targets, you can plop yourself into their tooling without much concern
23:04:06FromDiscord<abdrahmanalakhras> hi
23:04:32FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "This avoids adding in": Why not use sink?
23:04:41FromDiscord<Elegantbeef> Hello
23:05:23termer你好
23:07:40FromDiscord<bung8954> case of in type definition can't have same field name ? they are in different branch
23:14:19FromDiscord<Elegantbeef> Yes, fields must be unique across the object
23:15:32FromDiscord<bung8954> that's anoyed.
23:15:45FromDiscord<Elegantbeef> It's a requirement of the way Nim does case objects
23:15:54FromDiscord<Elegantbeef> Checkout fungus or skinsuit for an alternative
23:28:47FromDiscord<bung8954> seems fungus fit my needs, but it assuming the type is object ?
23:41:11FromDiscord<Elegantbeef> Yes