<< 30-07-2023 >>

00:06:51FromDiscord<ajusa> ah okay. thanks so much for the help, I spent two hours on this last night and thought I was going crazy
00:08:35FromDiscord<Elegantbeef> This kids is why you don't do generics
00:24:48*xet7 joined #nim
00:43:58*xet7 quit (Remote host closed the connection)
00:45:39*xet7 joined #nim
01:16:46*ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
01:34:10*_________ quit (Ping timeout: 252 seconds)
04:03:02*rockcavera quit (Remote host closed the connection)
04:37:44FromDiscord<SuspenseFlame ZZxzxzz> Hi everyone, are there those who have worked with Nim Telebot?
04:39:48FromDiscord<.bobbbob> how do I convert a cstring to a string? casting it seems to cause an out of memory error
04:40:01FromDiscord<Elegantbeef> `$myCstring`
04:40:11FromDiscord<Elegantbeef> Never use `cast` unless you know what you're doing
04:41:01FromDiscord<.bobbbob> which I dont
04:41:19FromDiscord<Elegantbeef> Exactly, never use `cast` then 😄
04:44:33FromDiscord<Elegantbeef> For future reference it's a bit cast which means the data is converted to the other type with no type safety
04:56:58*azimut quit (Ping timeout: 240 seconds)
04:57:25FromDiscord<the_carnages> Вассап народ
05:10:45*_________ joined #nim
05:15:09FromDiscord<Phil> In reply to @the_carnages "Вассап народ": Cheers. However, most here don't speak... Russian (? Sorry, I use DeepL for the translation and it is assuming Russian). We do have a bunch of language-specific channels though if you're interested
05:21:07FromDiscord<the_carnages> In reply to @isofruit "Cheers. However, most here": Honey! I am only interested in one thing - how to handle callback query in Telebot library!↵I've been going crazy with it for 7 hours already!
05:21:28FromDiscord<the_carnages> In reply to @isofruit "Cheers. However, most here": But anyway, thanks for the offer
05:22:05FromDiscord<Phil> Yeh sadly can't help much there, I'm not familiar with the lib at all
05:41:54FromDiscord<odexine> In reply to @the_carnages "Honey! I am only": Can you link the library? I’ll try looking
05:42:42FromDiscord<griffith1deadly> In reply to @the_carnages "Вассап народ": рашн не одобряем
06:17:58*rockcavera joined #nim
06:27:48FromDiscord<the_carnages> In reply to @griffith1deadly "рашн не одобряем": Это специально была, проверка
06:27:49FromDiscord<the_carnages> )
06:28:17FromDiscord<Phil> Again, not in this channel both of you, thanks.
06:29:32FromDiscord<the_carnages> In reply to @odexine "Can you link the": Thanks, I've already figured it out.↵Actually, the library is very buggy and you have to be very careful....↵↵https://github.com/ba0f3/telebot.nim/tree/master
06:30:00FromDiscord<odexine> okay
06:30:08FromDiscord<the_carnages> In reply to @isofruit "Again, not in this": We're just talking amongst ourselves. Oh, come on.
06:58:13FromDiscord<emanresu3> silly question, why doesn't `len` return a `uint`?
06:58:58FromDiscord<Elegantbeef> Cause Nim doesnt use uints as they overflow by design
07:01:40om3gawhat is unit?
07:01:50FromDiscord<Elegantbeef> unsigned integer
07:02:04om3gaaah, uint!
07:02:52FromDiscord<emanresu3> I'm sorry what would that imply for the language if it used `uint`?
07:03:18om3gaprobably can appear negative value
07:03:23FromDiscord<Phil> In what sense?
07:03:28om3gaso it will cause troubles
07:03:35FromDiscord<emanresu3> And does it get somehow optimized to `unsigned int` when compiled to C?
07:06:11FromDiscord<Elegantbeef> Nim says unsigned integers have non checked overflow, which is why you default to `int`
07:06:13FromDiscord<emanresu3> I see, sorry I don't know enough to see why that would happen. I'm translating some C code that used unsigned ints, sized\_t and I'm getting conflicting types with operations between `int`s a `uint`s↵(<@709044657232936960_om3ga=5b=49=52=43=5d>)
07:06:50FromDiscord<Elegantbeef> Right you should use `cint` and `cuint` or `int32` and `uint32`
07:07:26FromDiscord<Elegantbeef> `sized_t` iirc is just `uint`
07:09:45FromDiscord<emanresu3> but if I get a `int` from `.len()`, how do I cast it to `cuint`?
07:10:04FromDiscord<Elegantbeef> `cuint(mycall.len())`
07:10:29om3gain C I used ssize_t type, to store error in it (value -1), maybe this is the case why .len returns int
07:10:51FromDiscord<emanresu3> oh right, I forgot silly me
07:12:12om3gagetline returns -1 if I remember it right
07:13:35om3gabut yeah, it's very interesting how string length is calculated in Nim, for example if it was read from file
07:14:27FromDiscord<Phil> mycall.len().cuint should also work I think
07:14:41om3gadoes it counts characters in iterator until \0 will not appear? and when it does it?
07:14:50FromDiscord<odexine> In reply to @om3ga "but yeah, it's very": wdym? nim string length is just byte length
07:15:10FromDiscord<odexine> and no it stores length in the internal data structure
07:15:24FromDiscord<odexine> so \0 is counted as a character, not treated as a terminator
07:15:42FromDiscord<odexine> and also length is not recalculated when asked for, only when the string is mutated
07:15:43om3gabut something fills that value
07:15:50FromDiscord<odexine> this applies to `string` and not `cstring`
07:16:38*Batzy quit (Read error: Connection reset by peer)
07:16:40FromDiscord<Elegantbeef> Nim strings are pascal strings
07:16:46FromDiscord<Elegantbeef> The length is stored
07:17:07FromDiscord<Elegantbeef> It's O(1) to get length and it's zero cost to loan it out as a cstring
07:17:11FromDiscord<odexine> calculation is done on either creation or mutation
07:18:43om3gaElegantbeef, yeah, but when it updates that value? On resize?
07:18:44om3gahttps://play.nim-lang.org/#ix=4BPI
07:19:18FromDiscord<odexine> what are you asking? i dont know what you mean by the question
07:19:20FromDiscord<Elegantbeef> Of course how else would you update it
07:19:30*Batzy joined #nim
07:19:40FromDiscord<odexine> the length is also updated alongside the data, idgi
07:23:05om3ga:) I mean from where it gets the value which needs to be stored, it calculates length arithmetically during resize, or counts bytes newly appended chunk?
07:24:47FromDiscord<odexine> i assume that the length of a string literal is embedded in the AST and is used to construct the internal data representation
07:24:57FromDiscord<odexine> then add just adds the lengths of the two strings
07:25:15om3gayeah, I understand that
07:25:39om3gaif I remember it right, it stores value with string
07:26:16FromDiscord<odexine> the length of the string and the capacity of the buffer are both stored in the data representation, alongside the string data ofc
07:27:16om3gasure, but how it gets the value needed to store in that data representation?
07:27:29om3gafor example you read from file
07:27:44FromDiscord<odexine> dont file read functions return lengths
07:28:04FromDiscord<odexine> most of them do
07:28:30om3gayes, getline returns length, and can return -1
07:29:07om3gaso nim stores return of getline to fill newly read string length?
07:29:32FromDiscord<odexine> i assume so? perhaps not exactly in that sense, but that would be my assumption
07:30:00om3gathat can explain why type of .len value is int
07:30:02FromDiscord<Elegantbeef> It likely gets the buffer then adds it as a cstring to the string
07:30:05FromDiscord<Elegantbeef> You can look at teh source
07:30:19FromDiscord<Elegantbeef> It's `int` cause of what I said
07:30:27om3gaothervise I don't understand how uint should overflow, sine size_t is uint
07:30:33FromDiscord<Elegantbeef> The default is `int` as it's checked for overflow, `uint` is not
07:30:45FromDiscord<Elegantbeef> `uint` is unchecked cause it's used in places where that's desirable
07:31:03om3gaah, so it's by design
07:32:18om3gabut what if getline for example will return veeery huge string which bytes count will not fit in int?
07:32:29FromDiscord<Elegantbeef> You've ran out of memory
07:32:31FromDiscord<Elegantbeef> `int` is 64bit
07:33:31om3gajust hypothetically, let's imagine computer with max addressable ram installed in it
07:33:47om3gasize_t will be also 64 bit
07:33:48FromDiscord<odexine> it is impractical to think about that
07:34:00om3gawhy not :) just for fun
07:34:09FromDiscord<Elegantbeef> Yes you have 2^64 bytes of ram now
07:34:16FromDiscord<Elegantbeef> You overflow when you use it all
07:34:26FromDiscord<Elegantbeef> It's the year 23213
07:34:33om3gahaha :)
07:34:58FromDiscord<odexine> btw an int can count to 8192 Pib of RAM
07:34:59om3gaso decission to use int was made because of that
07:35:11om3gaat least partially :)
07:36:02FromDiscord<Andreas> hmmm, and how do you then address the 2^64-RAM with 48-bits in a pointer ?
07:36:11FromDiscord<odexine> idk, when people have that much ram i think length being an int is less of a concern
07:36:23FromDiscord<odexine> theres the bigger concern that your pointer size is hitting its limits
07:36:25om3gait was hypothetic assumption
07:36:43FromDiscord<Elegantbeef> Very carefully↵(@Andreas)
07:36:48FromDiscord<odexine> In reply to @Andreas "hmmm, and how do": is it 48 because of aslr or something, i dont remember
07:37:10FromDiscord<Elegantbeef> It's 40+ bits it depends on the cpu iirc
07:39:26om3gaif it overflows pointer , new models will be updated to handle it
07:40:07FromDiscord<odexine> yes and its not like nim wouldnt change its data type then as well
07:40:24FromDiscord<odexine> "int" is defined to be the same size as a pointer iirc
07:40:25om3ganim in cpu haha
07:40:28FromDiscord<odexine> hence
07:43:36*xet7 quit (Ping timeout: 260 seconds)
08:08:07*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
08:18:45*ehmry joined #nim
08:46:27*xet7 joined #nim
09:20:22*rockcavera quit (Remote host closed the connection)
09:28:50FromDiscord<xyzzy> hi all .. I am trying to get this example to work on windows MSYS64. ↵https://github.com/PhilipWitte/NimQt/tree/master↵while I can compile the qt app with qmake, it seems the linker is failing for nimqt. ↵is it possible for me to run nim like coffeescript where I just generate the source file and just run qmake ? it seems nim insists calling the compiler and linker on its own
09:36:51*ajunior joined #nim
09:48:30*disso-peach joined #nim
10:12:09*ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
10:17:46*ajunior joined #nim
12:30:52*ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
12:35:52*ajunior joined #nim
13:07:18*disso-peach quit (Quit: Leaving)
13:16:04*azimut joined #nim
14:48:58*ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15:37:58*azimut quit (Ping timeout: 240 seconds)
16:12:04*junaid_ joined #nim
16:19:25FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4BRU
16:19:40FromDiscord<Chronos [She/Her]> So keywords have a higher priority than typical identifiers
16:19:51FromDiscord<odexine> i dont understand "tell the with"?
16:20:08FromDiscord<odexine> i think they have special casing in the parser yes
16:20:50FromDiscord<Chronos [She/Her]> tell the diff sorry
16:21:39FromDiscord<Chronos [She/Her]> In reply to @odexine "i think they have": Would this mean there's a special token type for keywords?
16:22:39FromDiscord<odexine> not the lexer but the parser
16:22:51FromDiscord<Chronos [She/Her]> Hm
16:23:14FromDiscord<odexine> at least that would be my assumption? and i do not know what dis/advantages there would be if it were in the lexer, but it doesnt make sense to me
16:23:32FromDiscord<Chronos [She/Her]> Fair
16:23:56FromDiscord<Chronos [She/Her]> My issue is that I don't know how I'd tell the difference when I'm at the lexer stage
16:24:57FromDiscord<odexine> idk why you would need to
16:25:09FromDiscord<Chronos [She/Her]> parser stage
16:25:13FromDiscord<odexine> lex it normally -> let the parser handle the incorrect syntax?
16:25:14FromDiscord<odexine> oh
16:25:14FromDiscord<Chronos [She/Her]> I am very tired so sorry
16:25:57FromDiscord<odexine> well in the parser, you'd know that "oh an ident should be here" but if you see lets say a non-stropped keyword then you error, otherwise continue kinda idea no?
16:26:35FromDiscord<odexine> you dont remove the stropping information on the lexer, you still have a stream like `word("let") stropstart word("let") stropend` kinda idea
16:26:52FromDiscord<Chronos [She/Her]> So if the parser feels like the identifier is meant to be a keyword and not an identifier?
16:27:04FromDiscord<odexine> what?
16:27:10FromDiscord<Chronos [She/Her]> Sorry
16:27:22FromDiscord<Chronos [She/Her]> Like
16:27:49FromDiscord<odexine> you'd have information on the parser as to where it is and what should be there, like "after the let keyword should be an ident so i parse an ident" and that portion of the parser would have the code for handling stropping and keywords
16:27:57FromDiscord<Chronos [She/Her]> If the syntax doesn't make sense while using the value of the identifier, it should then see if it is a keyword and then behave as such, is what i think you're saying?
16:28:20FromDiscord<Chronos [She/Her]> In reply to @odexine "you'd have information on": Makes sense now, thank you
16:30:02FromDiscord<Chronos [She/Her]> Still debating on making a keyword token type honestly
16:30:14FromDiscord<Chronos [She/Her]> No negative to it really since you can still strop it
16:43:46*ajunior joined #nim
16:44:33*ajunior quit (Client Quit)
17:09:12*azimut joined #nim
17:16:06*ajunior joined #nim
17:31:29FromDiscord<ratogbm> I need some help working with parsed json: https://forum.nim-lang.org/t/10362
17:32:08FromDiscord<ratogbm> (edit) "https://forum.nim-lang.org/t/10362" => "https://forum.nim-lang.org/t/10362↵(Title: "Help: Converting Json[strings] (seq[JsonNode]) to array[0..2, string]?")"
17:37:21*rockcavera joined #nim
17:41:56NimEventerNew thread by JockerBlack: Help: Converting Json[strings] (seq[JsonNode]) to array[0..2, string]?, see https://forum.nim-lang.org/t/10362
17:45:34FromDiscord<Phil> Wait a sec, the user that posted this was writing here, ma guy are you still here
17:45:44FromDiscord<Phil> I'd rather respond to you here since we can do this more step by step
17:45:48FromDiscord<Phil> (edit) "here" => "here?"
17:47:52FromDiscord<Phil> @ratogbm That was you right?
18:09:56FromDiscord<ratogbm> Yes, me
18:10:25FromDiscord<ratogbm> In reply to @isofruit "<@720535934025596929> That was you": I removed it because I figured it out and the bot posted it.
18:11:23FromDiscord<Phil> Check, gave you a reply on the post in meantime in case the syntax for dealing with seqs in general is still unfamiliar that would've been another way to solve this one (albeit the std/json one is definitely the intended one for this scenario)
18:12:17FromDiscord<Phil> Since you mentioned you're new from python, did you check out the nim beginners guide for coming from python?↵That gives you a bit of an entrypoint
18:18:22FromDiscord<ratogbm> In reply to @isofruit "Since you mentioned you're": Thanks, I read your reply, slowly getting the hang of it. I did check the beginner guides, but they can sometimes be a bit unhelpful because they don't explain what doesn't work and why. It's always confusing when you realize your conceptual model is a bit off, and you have no clue why something does or doesn't work.↵↵I use python, because in python everything "just works". None o
18:19:41FromDiscord<Phil> Check, do you solely use python or do you also have some JS experience?
18:20:29FromDiscord<ratogbm> I also know a bit of C. In C you can always be sure that if the types don't match, it just won't work. Nim is kind of in between.
18:21:22FromDiscord<ratogbm> In reply to @isofruit "Check, do you solely": I know JS from cracking paywalled chrome extensions, and I think of JS as a total mess.
18:21:51FromDiscord<ratogbm> (edit) "mess." => "mess.↵↵I can deal with it if I need to, but I am not touching it otherwise"
18:22:05FromDiscord<Phil> That's perfectly fine, it's more that JS leads you towards using some things that imo are nice to know in general (basically map, filter, foreach functions on iterable collections) which nim has equivalents for
18:22:46FromDiscord<Phil> So if you're familiar with the language then basically most of the functions it provides have statically typed nim equivalents
18:23:46FromDiscord<Phil> One more thing, do you care about the difference between arrays and seq's for your usecase and shall I go over that quickly or is it fine to leave it at "just use seqs unless you do compile-time stuff or are strongly optimizing" ?
18:24:17FromDiscord<ratogbm> In reply to @isofruit "One more thing, do": I will figure it out once I get to it.
18:26:59FromDiscord<ratogbm> They taught me JS at school, and it was a bit of a pain, because it wasn't object oriented. It's always doSomething(with_thing, argument) when in python it's with_thing.doSomething(argument)
18:31:58FromDiscord<Phil> Funnily enough I started to gain a bit of a better understanding of the more conceptual differences between procedural and object orientation (namely polymorphisms via interfaces/inheritance vs polymorphism via overloading/generics)
18:32:17FromDiscord<Phil> Since nim allows for the syntax to be whatever due to its call syntax
18:32:46FromDiscord<Phil> Where both `echo(x)` , `x.echo()` are valid
18:32:59FromDiscord<Phil> (edit) "Where both `echo(x)` , `x.echo()` are valid ... " added "and express the same"
19:17:44FromDiscord<shalokshalom> In reply to @ratogbm "They taught me JS": Funnily enough, JavaScript is completely object oriented
19:25:44*junaid_ quit (Remote host closed the connection)
19:42:10FromDiscord<undel> JS objects are weird as hell
20:27:12FromDiscord<spotlightkid> JS has prototype-based OO, not class-based. Just a different way of doing OO than Python.
20:27:53FromDiscord<shalokshalom> Something that most people miss about JavaScript
20:29:03FromDiscord<egomind> Is there a real reason to do OO with classes
20:29:46FromDiscord<egomind> After having done it a lot and having tried many other approaches as well, I genuinely don't see any good reason to do it.
20:31:53FromDiscord<spotlightkid> I think it fits the human cognitive patern with the tendency to categorize things well.↵"Oh, this is a thing of that kind! Now I know what I can expect from it!"
20:34:49FromDiscord<egomind> I think that explanation kind of ends when we enter the world of design patterns and most more complex classes. I also think approaches that are just operations on data tend to be more intuitive.
20:38:50*m5zs7k quit (Ping timeout: 245 seconds)
20:39:12*m5zs7k joined #nim
20:39:15FromDiscord<shalokshalom> In reply to @egomind "Is there a real": Honestly, I think it's simply something like the '1 billion dollar mistake'
20:39:44FromDiscord<shalokshalom> In reply to @spotlightkid "I think it fits": That's why we do have types?
20:40:19FromDiscord<shalokshalom> I also think that prototypes are basically the functional way to do OO
20:43:43FromDiscord<shalokshalom> sent a long message, see http://ix.io/4BUs
20:46:17FromDiscord<shalokshalom> And OO with classes is basically, how Armstrong described it↵↵"You want a banana, but you can't have the banana without the gorilla holding the banana. And the whole jungle around it. 😃"
20:47:38FromDiscord<egomind> I think the worst part about using Java in particular to me has always been that it's all black magic
20:48:45FromDiscord<egomind> Stuff just kinda exists or happens and there are so many layers of abstractions that it's mind boggling. Yeah, eventually you'll get a deeper understanding, but with other languages I tend to just immediately feel like I know precisely what is and isn't happening.
20:49:14FromDiscord<shalokshalom> You mean in the codebase of your own code, or of the language itself?
20:49:19FromDiscord<egomind> This might be more so the fault of its popularity than COP, but I do think COP contributed to it negatively
20:49:41FromDiscord<shalokshalom> The biggest flaw about OO seems to be, that it only really works flexible enough with dynamic typing.
20:49:55FromDiscord<egomind> In reply to @shalokshalom "You mean in the": Codebase whenever you start using libraries basically
20:50:08FromDiscord<egomind> They looove black magic
20:50:20FromDiscord<shalokshalom> Smalltalk, Python etc. These languages have an object system that can be used flexible enough and you practically trade in typing for that.
20:50:46FromDiscord<shalokshalom> @egomind I think lots of that is due to Java forcing you to do everything with classes
20:51:02FromDiscord<shalokshalom> You have no other way, than to introduce black magic
20:51:10FromDiscord<shalokshalom> It's basically the architecture the language forces on you
20:52:03*lucasta joined #nim
20:52:20FromDiscord<Andreas> Armstrong said "Java runs everywhere, Erlang runs forever.". The gorilla-quote is from another guy AFAIK - but a good one for sure..
20:52:44*ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:53:23*lucasta quit (Max SendQ exceeded)
20:53:36FromDiscord<egomind> In reply to @shalokshalom "It's basically the architecture": Yeah, exactly
20:55:08FromDiscord<shalokshalom> Armstrong has said it for sure
20:55:14FromDiscord<shalokshalom> idk if he is the original source
20:55:21FromDiscord<shalokshalom> but I am pretty sure
20:56:06FromDiscord<Andreas> i think you're right - i heard it once from a famous Adobe guy..
20:56:24FromDiscord<shalokshalom> sent a long message, see http://ix.io/4BUu
20:56:37FromDiscord<shalokshalom> But why they continue to use it, that is an entirely different argument
20:56:37FromDiscord<egomind> I do also think, though, that part of the issue is the huge popularity of the language. If you have so many users, you're bound to have plenty who either don't get or dig OOP and will just do whatever. And on top of that, the libraries that are easiest to use while also doing precisely what you need them to, will attract the most users, even if many things are very odd.
20:56:51FromDiscord<egomind> Same issue JS has in a sense
20:57:18FromDiscord<shalokshalom> The user base of Java is so inflexible as it's object system 😉
20:57:21FromDiscord<egomind> Just thinking back to stuff like leftpad, though that's a different kind of problem
20:57:48NimEventerNew Nimble package! minline - A line editing library in pure Nim, see https://github.com/h3rald/minline
20:57:51FromDiscord<shalokshalom> They depend on the language as much as their classes depend on each other
20:57:56FromDiscord<shalokshalom> "I need to eat too"
20:58:10FromDiscord<egomind> In reply to @shalokshalom "But why they continue": We should all just adopt Nim and move on 😌
20:58:11FromDiscord<Andreas> when working with the DOM - JS and its dynamic-nature are a breeze..
20:58:33FromDiscord<shalokshalom> In reply to @egomind "Same issue JS has": I think JS has this issue more than Java
20:59:18FromDiscord<shalokshalom> In reply to @egomind "We should all just": While I agree with you for a lot of reasons, do I struggle to see how Nim could take that place
20:59:59FromDiscord<shalokshalom> And I would particularly be concerned, that people would oh-so-more ready to forever stuck with this language
21:00:09FromDiscord<egomind> It very likely couldn't (yet)
21:00:16FromDiscord<egomind> And probably also shouldn't
21:00:27FromDiscord<shalokshalom> Java and Javascript do at least give it away how much they suck↵↵That makes it easier to pitch alternatives
21:00:28FromDiscord<egomind> I can see people abusing macros to no end
21:00:40FromDiscord<shalokshalom> Just imagine people would unite on a halfway decent language
21:00:49FromDiscord<shalokshalom> They would forever be stuck with it
21:01:22FromDiscord<shalokshalom> In reply to @egomind "It very likely couldn't": I think the issues behind Nim are not only technical
21:01:29FromDiscord<egomind> You know the saying, there are two types of languages: Those that people complain about and those that nobody uses.
21:01:37FromDiscord<egomind> I'm sure people would find things to nag about
21:01:37FromDiscord<shalokshalom> Yep.
21:01:44FromDiscord<shalokshalom> Probably
21:01:53FromDiscord<shalokshalom> I do 😄
21:02:55FromDiscord<shalokshalom> Do you know, that half of all programmers are with less then 5 years of experience?
21:03:01FromDiscord<shalokshalom> (edit) "then" => "than"
21:03:09FromDiscord<shalokshalom> So half of us have less than that.
21:03:29FromDiscord<shalokshalom> Then, that means in succession, every 5 years doubles the amount of programmers
21:03:40FromDiscord<shalokshalom> That is actually true for a couple of decades now
21:03:59FromDiscord<egomind> What? That's crazy
21:04:04FromDiscord<egomind> But it would make so much sense
21:04:46FromDiscord<shalokshalom> sent a long message, see http://ix.io/4BUx
21:05:11FromDiscord<shalokshalom> And now, before you answer: Who does Nim (and practically every other small language) target
21:05:41FromDiscord<egomind> The forner would likely be convinced more easily and the latter appears to be the target
21:05:49FromDiscord<shalokshalom> Yep
21:05:55FromDiscord<shalokshalom> And that not only in Nim
21:06:01FromDiscord<shalokshalom> Like, in every niche language
21:06:06FromDiscord<shalokshalom> And you can guess why
21:06:29FromDiscord<egomind> ~~corporate jobs suck the curiosity out of seniors~~
21:06:55FromDiscord<shalokshalom> We are all so quick to say "A hammer for a nail, a screwdriver for a screw" and so on
21:07:17FromDiscord<shalokshalom> But then we put people, who are great at creating compilers and ... let them do the PR
21:07:25FromDiscord<shalokshalom> And ... also everything else.
21:07:49FromDiscord<shalokshalom> Like.. why do CEOs suck at deciding the tech stack? ↵↵Because they are not freaking programmers.
21:07:55FromDiscord<shalokshalom> And we do no different
21:08:03FromDiscord<shalokshalom> Just the other way around 😅
21:09:02FromDiscord<shalokshalom> A competent CEO would know that we are a community, that grows so fast, and is constantly understaffed ↵↵I mean, in fact, they do know that
21:09:13FromDiscord<shalokshalom> How did Python become great?
21:09:43FromDiscord<Andreas> In reply to @shalokshalom "How did Python become": via education and academia and shell-admins
21:09:49FromDiscord<egomind> I think what ultimately convinced me to try the language were, next to the talks given by Andreas Rumpf, testimonials by users and an interest in playing around with macros.
21:10:03FromDiscord<egomind> I did get the impression that marketing could be a bit better
21:10:08FromDiscord<shalokshalom> They came at a time, when Perl dominated practically the space, that Python eventually overtook↵↵Why did people decide to go with Python
21:10:20FromDiscord<shalokshalom> And why did they drop Perl?
21:10:30FromDiscord<shalokshalom> Answer: They didn't.
21:10:39FromDiscord<shalokshalom> The next generation simply picked Python
21:11:07FromDiscord<egomind> And they did because it was thrown in their faces?
21:11:11FromDiscord<shalokshalom> In reply to @Andreas "via education and academia": Yeah, kinda. There is a blog post, that describes the phenomenon
21:11:40FromDiscord<shalokshalom> And it is from one of the very early comitters to the language
21:11:59FromDiscord<shalokshalom> In reply to @egomind "And they did because": Python is superb at onboarding newbies
21:12:13FromDiscord<shalokshalom> They always focused on tht
21:12:26FromDiscord<egomind> In reply to @shalokshalom "Python is superb at": I think it's pretty funny because I feel this has changed now
21:12:31FromDiscord<shalokshalom> (edit) "tht" => "that"
21:12:32FromDiscord<egomind> At least from an academic POV
21:12:50FromDiscord<shalokshalom> I am pretty much a beginner and Python is phenomenal at that
21:13:04FromDiscord<egomind> Classes tend to waste at least a week each semester just trying to get it installed, setting up venvs, anaconda and whatnot
21:13:08FromDiscord<shalokshalom> I tried hard, for many years actually, to get into the language that "nobody uses"
21:13:10FromDiscord<Andreas> In reply to @shalokshalom "And it is from": but once the ball strted rollin, there were quickly lots of well-maintained packages and some companies were behind it, too -> e.g. Zope
21:13:19FromDiscord<shalokshalom> They essentially gate keep the beginners out
21:13:50FromDiscord<shalokshalom> In reply to @egomind "Classes tend to waste": Sounds more like they could use DevContainer, or similar stuff
21:14:04FromDiscord<shalokshalom> And that the environment is complicated to begin witu
21:14:20FromDiscord<egomind> You're right
21:14:27FromDiscord<shalokshalom> And I mean: Python is no great language to develop very sizeable projects in it
21:14:35FromDiscord<shalokshalom> So they might misuse the language
21:14:51FromDiscord<shalokshalom> But the community itself: How they talk, the tutorials, the thousands of books...
21:14:58FromDiscord<shalokshalom> They have an entire culture
21:15:03FromDiscord<arathanis> i develop sizeable projects in python
21:15:07FromDiscord<shalokshalom> And Ruby? Was very similar initially
21:15:08FromDiscord<arathanis> its pretty good at it
21:15:21FromDiscord<Andreas> In reply to @shalokshalom "And I mean: Python": sure it is - the sheer number of well established python-stuff is overwhelming..
21:15:27FromDiscord<egomind> In reply to @shalokshalom "They have an entire": Oh, for sure, I 100% agree. Python rocks at this.
21:15:29FromDiscord<Phil> sent a long message, see http://ix.io/4BUA
21:15:33FromDiscord<shalokshalom> They simply made the mistake, of choosing the web space as the one and only platform
21:15:44FromDiscord<shalokshalom> In reply to @egomind "Oh, for sure, I": And that is, what Nim is missing
21:15:58FromDiscord<shalokshalom> Nim tries to target people, who have no intention of switching
21:16:24FromDiscord<shalokshalom> My main language is F#, and they try to catch C# people for two decades now, and guess what
21:16:46FromDiscord<Phil> In reply to @shalokshalom "<@304239027597606935> I think lots": The java Problem is its completely hairbrained way of solving problems, at least in the webdev area.↵That isn't necessarily the fault of classes, but of how its asking you for the information or how it is scoping its solution.
21:16:47FromDiscord<egomind> In reply to @isofruit "I've recently arrived at": This might be true, yeah.
21:16:54FromDiscord<shalokshalom> Most don't even know it exists. ↵↵And if they do, it's "that weird language, only for mathematical stuff"
21:17:14FromDiscord<shalokshalom> In reply to @isofruit "The java Problem is": Love the word 'hairbrained'
21:17:34*ajunior joined #nim
21:17:47FromDiscord<shalokshalom> In reply to @isofruit "I've recently arrived at": Nim has white magic 😄
21:17:53FromDiscord<shalokshalom> Or at least grey one 😉
21:18:15FromDiscord<Phil> The fascinating thing is that I never found it bad or exhaustingly frustrating like I find basically every other Java library
21:18:22FromDiscord<shalokshalom> In reply to @Andreas "sure it is -": I mean in LOC
21:18:27FromDiscord<egomind> A friend of mine recently learned F# in uni and I helped a bit. He still prefers C#. I think C# is just very hard to compete with wrt the average developer.
21:18:54FromDiscord<shalokshalom> And the sheer numbers of developers could cover that Python isn't the best for huge projects
21:18:56FromDiscord<Phil> Or, well, there might've been episodes where I found it frustrating but they go by faster than the same episodes in java by far
21:18:56FromDiscord<arathanis> i wish C# didn't have ugly blemishes
21:19:11FromDiscord<Andreas> In reply to @shalokshalom "I mean in LOC": LOC-wise some are quite huge,, Plone, all the NLP-stuff, Djange etc..
21:19:17FromDiscord<bostonboston> I like c# but it's just so massive
21:19:23FromDiscord<bostonboston> Too easy to explode a project
21:19:24FromDiscord<arathanis> In reply to @shalokshalom "And the sheer numbers": it works very well for large projects, you just need at least one person who "knows what they are doing" to enforce some BKMs
21:19:25FromDiscord<shalokshalom> @arathanis F# is C# without ugly blemishes :p
21:19:56FromDiscord<arathanis> In reply to @shalokshalom "<@136570191038513152> F# is C#": i just hate writing all this C# code and then still having ugly left aligned `#ifdef` stuff
21:19:57FromDiscord<arathanis> terrible
21:19:58FromDiscord<egomind> In reply to @isofruit "The fascinating thing is": I'm honestly glad I'm not alone with this feeling. I almost lost my passion for programming while I was doing Java and I never felt like I truly understood what was going on.
21:20:15FromDiscord<shalokshalom> In reply to @egomind "A friend of mine": Oh, for the average developer, I still think Kotlin is the best
21:20:26FromDiscord<Phil> In reply to @egomind "I'm honestly glad I'm": The absolutely worst thing about that feeling is that the problem those libs are solving aren't even that crazy
21:20:26FromDiscord<shalokshalom> assuming the average developer still likes a job
21:20:45FromDiscord<Phil> But somehow these flipping libs turn it into dark rituals that you need to have a PHD
21:20:56FromDiscord<Andreas> Has anybd noticed that Swift recently introduces macros ?
21:20:57FromDiscord<Phil> Like, how do you manage to make a problem ten times as complicated as it was before
21:21:09FromDiscord<shalokshalom> In reply to @egomind "I'm honestly glad I'm": How often did I read this 😄
21:21:29FromDiscord<huantian> How’s F# interop with C# code btw
21:21:32FromDiscord<shalokshalom> In reply to @Andreas "Has anybd noticed that": Didn't they always have them?
21:21:40FromDiscord<huantian> Like is it easy to use F# lib in C#?
21:21:42FromDiscord<shalokshalom> Ah nah, I am thinking of protocols
21:21:46FromDiscord<shalokshalom> Their typeclasses.
21:21:53FromDiscord<huantian> (edit) "Like is it easy to use F# lib in C#? ... " added "For say net 6"
21:22:00FromDiscord<shalokshalom> In reply to @huantian "Like is it easy": Yes. It's the same language down there
21:22:14FromDiscord<Andreas> In reply to @shalokshalom "Didn't they always have": was on HN this week, the advertise it as new..
21:22:17FromDiscord<shalokshalom> F# has, for better or worse, always put a lot of effort into compatibility
21:22:19FromDiscord<Phil> The best thing that I can say about java is that the unit-testing story and the testing story in general is vastly superior to the nim one.↵But that is tooling for the most part
21:22:50FromDiscord<shalokshalom> Unit testing is superfluous with proper typing and architecture anyway
21:22:57FromDiscord<shalokshalom> Property testing is where it's at
21:23:19FromDiscord<shalokshalom> unit tests can be just so easily flawrd
21:23:26FromDiscord<shalokshalom> (edit) "flawrd" => "flawed"
21:24:09FromDiscord<egomind> I'll be going, have a good night you all
21:24:10FromDiscord<huantian> In reply to @shalokshalom "F# has, for better": Hm might try it for a parser id want to be .net comparable
21:24:20FromDiscord<arathanis> good unit testing is vital.
21:24:29FromDiscord<arathanis> though I agree its often abused / overmocked / etc
21:24:38FromDiscord<arathanis> nothing funnier than seeing a test that ultimately tests nothing because of mocking
21:25:18FromDiscord<shalokshalom> https://fsharpforfunandprofit.com/posts/return-of-the-edfh/
21:25:45FromDiscord<shalokshalom> @arathanis How about having unit tests build into your type architecture?
21:26:07FromDiscord<shalokshalom> A failed unit test would be shown by a type mismatch.
21:26:16FromDiscord<shalokshalom> Welcome to railway oriented programming
21:26:24FromDiscord<shalokshalom> Good night @egomind
21:26:46FromDiscord<arathanis> In reply to @shalokshalom "<@136570191038513152> How about having": never heard of this but it sounds interesting
21:27:26FromDiscord<arathanis> unit tests make people comfortable changing and extending the code lol
21:27:47FromDiscord<arathanis> its very hard to maintain or extend code without unit tests because it can be hard to tell if you accidently broke something
21:28:01FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BUD
21:29:09FromDiscord<shalokshalom> sent a long message, see http://ix.io/4BUE
21:29:49FromDiscord<shalokshalom> In reply to @isofruit "The eternal question. Do": And you would know the answer, if you had read the book I recommend 😛 ↵↵Good night you all, thanks a lot 😴
21:30:28FromDiscord<shalokshalom> In reply to @arathanis "unit tests make people": As you can see in the above article, they are pretty easy to cheese.
21:31:09FromDiscord<huantian> In reply to @shalokshalom "We welcome you in": Thanks! I’ll ping you again if/when I start
21:33:10FromDiscord<arathanis> In reply to @shalokshalom "As you can see": ill give it a read
21:38:05FromDiscord<shalokshalom> sent a long message, see http://ix.io/4BUK
21:39:12FromDiscord<shalokshalom> And some of us cheese on purpose, since we dont have the patience, time or something similar ↵↵So having something like property tests, who make it unavoidable to write a proper implementation, does seem a more suitable solution
21:42:23FromDiscord<arathanis> this is what code reviews are for
21:42:33FromDiscord<arathanis> and functional decomposition is how we keep them from being overly complex
22:58:37FromDiscord<_gumbercules> Best way to test code is to write code with no bugs
22:58:53FromDiscord<_gumbercules> The you don't need tests because they always pass
22:59:24FromDiscord<_gumbercules> (edit) "The " => "Then"
23:01:42FromDiscord<_gumbercules> In reply to @shalokshalom "And some of us": This is like anything else in life and probably unwise. Unit tests aren't unique in this regard.
23:03:18FromDiscord<_gumbercules> And regarding property tests, if the test is too cumbersome to write the programmer most likely will skip writing it. Assuming it's the same hypothetical programmer we were talking about cheesing the unit test
23:05:12FromDiscord<_gumbercules> I think property-based testing has it's use cases but it's not a replacement for unit tests
23:06:05FromDiscord<_gumbercules> Typically it pays off when the number of edge cases a unit of code might produce is high
23:06:49FromDiscord<_gumbercules> If my code is simply querying a record from a database or doing something else very routine I would prefer to leverage a unit test
23:12:07FromDiscord<_gumbercules> In reply to @isofruit "The eternal question. Do": Assuming toMappedObject is thoroughly tested it would be pretty pointless to test and also pretty pointless to write a function for unless you're writing this frequently. I that case code replacement/metaprogramming would be better than all of the invocations
23:12:21FromDiscord<_gumbercules> In that case even
23:33:31FromDiscord<System64 ~ Flandre Scarlet> In reply to @bostonboston "I like c# but": C# is banger
23:33:50FromDiscord<arathanis> i dig me some C# until i don't 😂
23:34:07FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "i dig me some": Is there a problem with C#?
23:34:15FromDiscord<arathanis> only parts of it
23:34:18FromDiscord<arathanis> but that is true of all languages
23:34:38FromDiscord<arathanis> my biggest complaint is DLL hell and that it kept the `#ifdef` stuff
23:34:53FromDiscord<System64 ~ Flandre Scarlet> php has problems by the fact it exists
23:34:59FromDiscord<arathanis> PHP is hilarious
23:35:30FromDiscord<arathanis> apparently the reason its built in functions have such weird names sometimes is that they are looked up in a 256 slot hashtable and the designer wanted no collisions so some of the names are the wya they are to avoid a collision
23:35:33FromDiscord<arathanis> i find that hilarious
23:35:51FromDiscord<System64 ~ Flandre Scarlet> php is a joke
23:35:58FromDiscord<System64 ~ Flandre Scarlet> it shouldn't exist
23:37:40FromDiscord<arathanis> all my time working with it made me sad
23:38:45FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "all my time working": you should move to C#
23:38:51FromDiscord<System64 ~ Flandre Scarlet> or Nim
23:39:01FromDiscord<arathanis> I don't have to develop in PHP anymore
23:39:06FromDiscord<System64 ~ Flandre Scarlet> (Rst is goofy ahh)
23:39:17FromDiscord<arathanis> I've been free from PHP for years
23:39:32FromDiscord<System64 ~ Flandre Scarlet> And now you use JS?
23:39:32FromDiscord<intellij_gamer> Use an old version of Nim where the PHP backend still exists lol
23:39:38FromDiscord<arathanis> In reply to @sys64 "And now you use": Python and C#
23:39:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "Python and C#": Nice languages
23:39:51FromDiscord<arathanis> yes
23:39:53FromDiscord<arathanis> also occasionally nim
23:40:25FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "also occasionally nim": Nim has ONE issue↵No cyclic imports
23:40:48FromDiscord<arathanis> Python has that problem too. Importing cyclically usually is a symptom of bad application design and you should remedy it.
23:41:03FromDiscord<arathanis> So I don't really mind it.
23:41:08FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "Python has that problem": what about video games?
23:41:20FromDiscord<arathanis> In reply to @sys64 "what about video games?": I don't work in video games :P
23:41:33FromDiscord<arathanis> also usually that can be solved with Interfaces and ECS
23:41:53FromDiscord<arathanis> (edit) "also usually that can be solved with Interfaces and ECS ... " added "in video games specifically"
23:42:01FromDiscord<System64 ~ Flandre Scarlet> Me : Inheritence my beloved
23:42:16FromDiscord<arathanis> haha i was like that too
23:42:21FromDiscord<arathanis> then i got wise to the horror
23:42:50FromDiscord<arathanis> single level inheritance: fine↵2 level inheritance: justifiable on a case-by-case basis↵3+ level inheritance: you have fucked up
23:43:25FromDiscord<arathanis> multiple inheritance: only ok if everything but 1 base is a "mixin"
23:43:41FromDiscord<arathanis> but if you are doing games, you should definitely do ECS. you will get performance benefits too
23:44:27FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "but if you are": How does it work?↵https://github.com/system64MC/tfe/tree/develop↵Would it be beneficial for that?
23:44:33FromDiscord<arathanis> ECS + data driven design is how you get games as modular as Caves of Qud and performant as Factorio
23:44:42FromDiscord<arathanis> In reply to @sys64 "How does it work?": give me one second to take my turn in this TTRPG game
23:45:20FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "give me one second": Shoot them up
23:45:45FromDiscord<System64 ~ Flandre Scarlet> TFE just means "Travail de Fin d'Études"↵So final school work
23:46:12FromDiscord<arathanis> In reply to @sys64 "How does it work?": So ECS is "Entity-Component-Systems"
23:46:34FromDiscord<arathanis> You have a single "Entity" class
23:46:45FromDiscord<arathanis> the functionality of any specific Entity is defined by its components
23:46:57FromDiscord<arathanis> and then "Systems" are the pieces that act on the components and update the game state every game tick
23:47:52FromDiscord<System64 ~ Flandre Scarlet> does Unity use ECS?
23:47:56FromDiscord<arathanis> it can
23:48:04FromDiscord<arathanis> as far as I know its a choice you can make
23:48:16FromDiscord<arathanis> but its hard to wrap your head around initially so usually the base stuff just does more standard things
23:48:46FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4BV2
23:48:57FromDiscord<arathanis> and then you make a bunch of factories for each actualy entity you have
23:49:54FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4BV3
23:50:11FromDiscord<arathanis> and then your systems are what check the components of each entity
23:51:11FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4BV4
23:51:16FromDiscord<arathanis> and each collision component knows what entity it has
23:51:34FromDiscord<arathanis> the reason this is good is you get memory locality when the systems are updating their components
23:52:08FromDiscord<arathanis> rather than iterating over each entity and thrashing your performance by moving so much into and out of memory, you just iterate over the component arrays which are all next to each other in memory and give you huge performance bonuses
23:52:38FromDiscord<arathanis> this is super bare bones but I feel liek you can elaborate @System64 ~ Flandre Scarlet
23:54:30FromDiscord<Elegantbeef> As I like spamming about this, here's a very simple implementation of an ECS in Nim https://github.com/beef331/nimtrest/blob/master/yeacs.nim
23:54:55FromDiscord<arathanis> In reply to @Elegantbeef "As I like spamming": is this what you are using for your pet game?
23:55:04FromDiscord<Elegantbeef> Nah
23:55:42FromDiscord<arathanis> if you can wrap your head around it, its the best way to get both performance and heavy extensibility into your game.
23:55:46FromDiscord<arathanis> its super neat
23:56:40FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "rather than iterating over": So it only has ONE array?
23:56:46FromDiscord<arathanis> In reply to @sys64 "So it only has": one for each component
23:58:13FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4BV5
23:59:15FromDiscord<arathanis> and then the systems just iterate over their relevant component array and update based on them