<< 03-05-2023 >>

00:00:43*TakinOver joined #nim
00:03:02FromDiscord<Elegantbeef> It's a building block ontop of python afaict
00:05:04demeteraLooks a bit proprietary and commercial
00:06:14FromDiscord<Nlits (Ping on reply)> In reply to @demetera "Looks a bit proprietary": yes
00:07:57FromDiscord<Elegantbeef> Yea it also lacks many things that I think are needed for a good language
00:08:26FromDiscord<Elegantbeef> No mention of static evaluation or macros, yes they say it has "powerful compile time programming" but showcase the most mundane generic
00:09:33FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1103111063391715348/image.png
00:09:42FromDiscord<Elegantbeef> Oh yay we have compile time evaluation for if expressions...?
00:10:49demeteraIf they call this as a simple exploressions...man
00:11:06demeteraexpressions*
00:15:39FromDiscord<Elegantbeef> It really has all the warts of python
00:15:57FromDiscord<Elegantbeef> `getitem` instead of something more expressive
00:17:52*lucasta quit (Remote host closed the connection)
00:21:56FromDiscord<Elegantbeef> > Mojo types do not get default constructors, move constructors, memberwise initializers or anything else by default
00:22:03FromDiscord<Elegantbeef> Man this language is so odd
00:22:18FromDiscord<Elegantbeef> It's a python shell that introduces asinine steps
00:22:48FromDiscord<Elegantbeef> To use any type you have to declare all your memory hooks, even if they're default...
00:29:56FromDiscord<Nlits (Ping on reply)> Is there any way to get the pastebin from a terminal
00:33:51FromDiscord<Elegantbeef> "the pastebin"
01:00:26*demetera quit (Quit: Leaving)
01:01:26*demetera joined #nim
01:10:32*demetera quit (Quit: Leaving)
01:11:42*demetera joined #nim
01:12:13*demetera quit (Remote host closed the connection)
01:12:45*demetera joined #nim
01:14:03*demetera quit (Remote host closed the connection)
01:16:57FromDiscord<Nlits (Ping on reply)> In reply to @Elegantbeef ""the pastebin"": trying to implement pasting into my TUI text box, idk how
01:56:55*TakinOver quit (Ping timeout: 250 seconds)
02:07:37FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4uLF
02:08:03*adigitoleo quit (Ping timeout: 268 seconds)
02:08:11FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4uLF" => "https://play.nim-lang.org/#ix=4uLG"
02:08:27*adigitoleo joined #nim
02:44:39*beholders_eye quit (Ping timeout: 260 seconds)
02:47:04FromDiscord<sOkam!> sent a code paste, see https://paste.rs/C4O
02:48:40FromDiscord<sOkam!> @Yardanico @ElegantBeef does this sound like a fuckup on my side, or is this a bug in the documentation?
02:54:57*Batzy quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
02:55:22*Batzy joined #nim
02:55:36FromDiscord<Elegantbeef> Seems like inaccurate docs from what i know
02:56:53madpropshttps://www.modular.com/mojo
02:57:01madpropswhat's up with that
03:03:18FromDiscord<Elegantbeef> Rust but python
03:05:38FromDiscord<Rika> moldy python
03:15:41madpropswhy the focus on AI?
03:16:43*azimut joined #nim
03:18:48FromDiscord<Daniel Belmes> In reply to @madprops "why the focus on": https://docs.modular.com/mojo/why-mojo.html
03:18:50FromDiscord<Rika> Because that’s all the rage nowadays
03:18:54FromDiscord<Daniel Belmes> I think this is their FAQ answer
03:22:01madpropswell they seem to know what they're talking about
03:22:12madpropslets see how it plays out
03:24:11FromDiscord<Elegantbeef> I mean they made a much more complex lifetime tracking system than Nim has and it's aimed for python progammers
03:25:10madpropslen("python syntax can be annoying")
03:25:32FromDiscord<Elegantbeef> its not even about the syntax 😄
03:25:39FromDiscord<Elegantbeef> You have to explicitly give up resources
03:31:01FromDiscord<sOkam!> In reply to @Elegantbeef "Seems like inaccurate docs": does version1 sound like a bug?
03:38:29FromDiscord<j-james> "for ai" eh that's a bit gross
03:39:22FromDiscord<Elegantbeef> The real gross part is the language design and that it can accept normal python code
03:39:27FromDiscord<Elegantbeef> It has a whole dynamic level planned
03:39:51FromDiscord<ieltan> In reply to @madprops "https://www.modular.com/mojo": Interesting but it seems like the language is closed sourced? I can't seem to find anything about it
03:40:05FromDiscord<Elegantbeef> Yea it's not open source yet
03:40:47FromDiscord<j-james> subjectively i really hate the syntax, it pulled in all the pythonic conventions i hate
03:41:03FromDiscord<Elegantbeef> I mean i looked into their memory model it's awfully unintuitive
03:41:11FromDiscord<ieltan> What does this mean?
03:41:12FromDiscord<Elegantbeef> Especially given they're aiming for the Python programmer
03:41:16FromDiscord<j-james> also i'm not convinced on the memory model↵> (TODO: Not currently enabled)
03:41:24FromDiscord<ieltan> In reply to @Elegantbeef "It has a whole": this sorry
03:41:29FromDiscord<Elegantbeef> Why the fuck does one have to do `someProcThatConsumes(myVal^)`
03:41:38FromDiscord<j-james> but more languages are always nice, i love to see people trying new things
03:41:44FromDiscord<Elegantbeef> Why do i have to tell the compiler that knows it's going to take ownership that it's taking ownership
03:42:05FromDiscord<Elegantbeef> It's planned to be a super set of python which means normal python will run inside
03:42:14FromDiscord<ieltan> I can at least praise the marketing.
03:42:25FromDiscord<ieltan> Nim needs some of that
03:42:27FromDiscord<j-james> > Small values like “Int”, “Float”, and “SIMD” are passed directly in machine registers↵oh that's really weird
03:42:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4uLN
03:42:52FromDiscord<Elegantbeef> It's not a generic like `proc doThing(a, b: auto)`
03:42:57FromDiscord<Elegantbeef> It's 100% dynamically reasoned
03:43:06FromDiscord<j-james> they don't let llvm or a related backend handle that?? seems like kind of a strange optimization to market
03:43:27FromDiscord<ieltan> In reply to @Elegantbeef "It's planned to be": Is the "super" part compiled or interpreted like python?
03:43:40FromDiscord<Elegantbeef> It's planned to compile all of python afaik
03:43:59FromDiscord<Elegantbeef> It adds in structs and static typing with python's existent syntax
03:44:21FromDiscord<j-james> compiling all of python seems like a reasonable goal
03:44:24FromDiscord<Rika> Existing, I believe existent means a different connotation
03:44:42FromDiscord<ieltan> Interesting
03:44:42FromDiscord<j-james> inferring types from python seems like very much not a reasonable goal
03:44:43FromDiscord<Elegantbeef> James no clue if you seen but they have move semantics hooks, you have to explicitly say "this uses default hooks"
03:45:00FromDiscord<Elegantbeef> Yea it doesnt infer them it is purely dynamically typed
03:45:03FromDiscord<ieltan> I sure hope the package management will be good
03:45:06FromDiscord<Elegantbeef> So hidden boxing i assume
03:45:27FromDiscord<j-james> oh interesting
03:45:37FromDiscord<ieltan> Not that I'm gonna use it tho
03:45:49FromDiscord<Elegantbeef> Rika they both mean "present" afaik 😄
03:45:59FromDiscord<ieltan> Using a language solely for AI development seems overkill
03:46:12FromDiscord<Rika> In reply to @ieltan "I sure hope the": Sounds like a big hurdle I think since you have to make sure you can access python’s ecosystem
03:46:14FromDiscord<Elegantbeef> It's supposed to be a system language that specialises for AI
03:46:53FromDiscord<ieltan> Nim SIMD and a ggml binding already goes a long way
03:46:59FromDiscord<Rika> I think dynamic typing the way python does it is bad
03:47:08FromDiscord<Elegantbeef> It's crazy though
03:47:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4uLO
03:47:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4uLP
03:47:30FromDiscord<ieltan> In reply to @Rika "Sounds like a big": Yeah, I was expecting that tbh.
03:47:50FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4uLQ
03:47:57FromDiscord<Rika> That value thing, what does it mean
03:47:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4uLR
03:48:05FromDiscord<Rika> I mean I can understand what it is
03:48:09FromDiscord<Elegantbeef> Value means "generate default hooks"
03:48:13FromDiscord<Rika> But at a glance no one would know what it means
03:48:17FromDiscord<j-james> mmm they plan to have typeclasses too
03:48:21FromDiscord<Elegantbeef> If there are no hooks a type doesnt compile
03:48:32FromDiscord<Elegantbeef> It's such a stupid complexity
03:48:42FromDiscord<Elegantbeef> Especially given that this is aimed at python programmers
03:48:43FromDiscord<Rika> I think it’s a bit cursed to use decorators in that way lol
03:48:55FromDiscord<Rika> At least name it better
03:48:56FromDiscord<Elegantbeef> It very much is
03:49:09FromDiscord<Elegantbeef> I'd also say given a majority of types will use default hooks it's just inane
03:49:40FromDiscord<Rika> You bet most programmers are gonna just slap a @value there and call it a day without knowing what it really means
03:50:03FromDiscord<Elegantbeef> Especially since they're aiming this at python but faster
03:50:04FromDiscord<Elegantbeef> Yes
03:51:04FromDiscord<Elegantbeef> I'm also repulsed that they used `name`s
03:51:11FromDiscord<j-james> god me too
03:51:13FromDiscord<Elegantbeef> Why the hell did they do that
03:51:23FromDiscord<Elegantbeef> They could've supported the old python ones but just used normal names
03:51:48FromDiscord<Elegantbeef> `lt` could be converted by the compiler into `[]` and then people could just write it like Nim
03:51:57FromDiscord<Elegantbeef> Yes mojo also has lexical stropping just like Nim
03:52:04FromDiscord<Elegantbeef> So there is like 0 reason why it could work that way
03:53:18FromDiscord<Rika> In reply to @Elegantbeef "`__lt__` could be converted": ?
03:53:25FromDiscord<Elegantbeef> sorry `<`
03:53:32FromDiscord<Elegantbeef> was thinking `getItem`
03:53:45FromDiscord<Rika> I was wondering if it was me or you getting senile
03:53:49FromDiscord<j-james> for machine learning: i haven't stuck my head in since openai hit the scene: but i was under the impression that python was mostly used to compose function calls to fast c code via torch etc
03:54:13FromDiscord<j-james> so idk how valuable a bridge language is, when python already is the bridge language itself
03:54:37FromDiscord<Elegantbeef> Think the idea is somewhat similar to using Nim for Python modules
03:55:06FromDiscord<Elegantbeef> Except of course using a language with asinine rules
03:55:09FromDiscord<j-james> i suppose, that's a thing that unfortunately doesn't really happen though
03:55:48FromDiscord<Elegantbeef> I cannot stress how much the `^` postfix operator annoys me
03:55:57FromDiscord<Elegantbeef> It's such a stupid feature
03:56:43FromDiscord<Elegantbeef> > For movable types, the ^ operator ends the lifetime of a value binding and transfers the value to something else (in this case, the take\_ptr function). To support this, you can define functions as taking owned arguments
03:56:48FromDiscord<Elegantbeef> Uuuuugh! 😄
03:57:21FromDiscord<j-james> hmm: is that equivalent to `sink t`?
03:57:30FromDiscord<Elegantbeef> yes
03:57:35FromDiscord<j-james> wait but you have to annotate it in the signature as well? wtf
03:57:41FromDiscord<Elegantbeef> Indeed
03:57:47FromDiscord<Elegantbeef> `owned name: T`
03:57:50FromDiscord<Elegantbeef> And guess what a mutable borrow is
03:57:56FromDiscord<Elegantbeef> `name&: T`
03:58:08FromDiscord<Dudugz> Are u guys talking about rust?
03:58:11FromDiscord<Elegantbeef> Guess what explicit pass by reference is
03:58:15FromDiscord<j-james> unfortunately not
03:58:18FromDiscord<Elegantbeef> `borrowed name: T`
03:58:39FromDiscord<Elegantbeef> The compiler like Nim will likely default to pass by reference and 'borrowed' is redundant
03:58:49FromDiscord<Elegantbeef> We're talking about mojo
03:58:56FromDiscord<Dudugz> Mojo?
03:59:14FromDiscord<Elegantbeef> It's a language that is best described as Rust but even more silly with a python syntax
03:59:44FromDiscord<j-james> that seems like more syntactical overhead than rust's ownership/borrows/mutable borrows distinction
03:59:45FromDiscord<Dudugz> Hm, By the tone of the conversation, can I predict that you didn't like what you found?
03:59:56FromDiscord<Dudugz> (edit) "By" => "by"
04:00:06FromDiscord<Elegantbeef> It's got a lot of silly design for a language aimed at python programmers
04:00:40FromDiscord<Elegantbeef> To declare a struct you need to know about hooks and how to write a `init` procedure
04:00:47FromDiscord<Elegantbeef> Unless you of course annotate it with `@value`
04:01:03FromDiscord<Dudugz> It seems painful to program in mongo then
04:01:11FromDiscord<Dudugz> (edit) "mongo" => "mojo"
04:01:31FromDiscord<Elegantbeef> Who knows I'm just looking at the language design!
04:01:50FromDiscord<Elegantbeef> It also dumbly uses annotations for features
04:01:51FromDiscord<j-james> yeah it's not open source or finished, yet
04:01:53FromDiscord<Dudugz> If the design is already bad, imagine the rest...
04:02:01FromDiscord<Elegantbeef> `@parameter` followed by an `if` statement is a `when` in Nim
04:02:05FromDiscord<Dudugz> In reply to @apropos "yeah it's not open": Ooh
04:02:08FromDiscord<Dudugz> Makes sense
04:02:13FromDiscord<Elegantbeef> `@parameter` followed by an internal procedure is a closure
04:02:27FromDiscord<Dudugz> I thought it was an already released and stable language
04:02:41FromDiscord<Elegantbeef> One might have noticed I didnt mention static evaluation
04:02:52FromDiscord<Elegantbeef> They have not documented their plans for that
04:03:04FromDiscord<Elegantbeef> They also do not have macros but static expressions + generics
04:03:17FromDiscord<Elegantbeef> Suffice to say I find it a funny language
04:03:52FromDiscord<Elegantbeef> Something somewhat interesting is that it's got move semantics but it isnt scoped based, it's last usage based
04:03:59FromDiscord<Elegantbeef> At the place of last usage the destructor is called
04:04:23madpropshttps://i.imgur.com/Nb4dKrh.png
04:04:35madpropsanything is better than rust lol
04:04:45FromDiscord<Elegantbeef> Lol
04:05:08FromDiscord<Elegantbeef> I mean I find the explicit move semantics mostly silly myself
04:05:19FromDiscord<Dudugz> lol, agree to disagree tho, rust is good it's just too confusing with this borrowed and owned thing. Even Microsoft is porting services to rust.
04:05:35FromDiscord<Elegantbeef> I mean `borrowed` is never explicitly written
04:05:41FromDiscord<Elegantbeef> Atleast intentionally
04:05:50FromDiscord<Elegantbeef> it's just got `owned name: T` and `name&: T` really
04:06:40FromDiscord<Dudugz> I mean, you can't even make a list of instances that you lose access to instance.
04:06:45FromDiscord<Elegantbeef> Anywho i'll shush cause someone might think I know more than I do
04:10:22FromDiscord<Dudugz> I even tried rust for 1 month, until I got too much of a headache dealing with servers that need dynamism and rust being too restrictive and confusing with arc, mutex, owned and borrowed
04:10:56FromDiscord<Elegantbeef> Yea I do not dislike move semantics, I just think they should be more like Nim's
04:11:11FromDiscord<Elegantbeef> Now just if Nim could resolve multithreading with them
04:11:35FromDiscord<Dudugz> Yea
04:12:12FromDiscord<Elegantbeef> and if it could get views functioning
04:12:49*junaid_ joined #nim
04:13:26FromDiscord<huantian> If views worked I don’t know if beef would talk about open arrays more or less
04:13:35FromDiscord<ieltan> In reply to @Elegantbeef "I'm also repulsed that": they had the opportunity to correct python but they didnt
04:13:38FromDiscord<ieltan> :/
04:14:50*TakinOver joined #nim
04:15:11FromDiscord<ieltan> In reply to @apropos "for machine learning: i": The game changer is ggml
04:15:24FromDiscord<ieltan> https://github.com/ggerganov/ggml
04:15:29FromDiscord<Dudugz> I was seeing some strange JS behavior like ``NaN^0`` which returns 0
04:17:14FromDiscord<ieltan> What's great with Nim is that you can export functions to C so you can expose a C interface in order for other languages to use your stuff
04:17:18FromDiscord<ieltan> Actual win
04:17:28FromDiscord<ieltan> I dont think you can do that with???
04:17:32FromDiscord<ieltan> erh
04:17:39FromDiscord<ieltan> mojo
04:17:40FromDiscord<Rika> mojo jojo
04:17:53FromDiscord<Elegantbeef> You probably could eventually
04:18:08FromDiscord<Elegantbeef> They do want it to be a system language
04:18:51FromDiscord<Dudugz> Mojo reminds me of Miojo in my language, which means noodles
04:18:53FromDiscord<ieltan> I will be sad if this ends up being the ai language
04:20:05FromDiscord<ieltan> In reply to @madprops "https://i.imgur.com/Nb4dKrh.png": 😦
04:20:53FromDiscord<Dudugz> In reply to @ieltan "I will be sad": I don't deal with AI but I understand your pain, in any area where this language becomes popular it will be a pain.
04:23:23FromDiscord<ieltan> I've always thought "Damn, i should really learn some rust" but memes like that unironically keeps me away. and Nim already occupying my "shiny new language i want to make stuff with" itch
04:24:42FromDiscord<ieltan> In reply to @Dudugz "I don't deal with": I dont either but i've had a thought or two about learning how to create AI models.
04:24:58FromDiscord<ieltan> It fascinates me
04:26:05FromDiscord<ieltan> In reply to @Elegantbeef "You probably could eventually": Nice!
04:27:27FromDiscord<Rika> In reply to @ieltan "I've always thought "Damn,": I feel like most people have been turned off by the community and shit
04:31:09*junaid_ quit (Remote host closed the connection)
04:33:35FromDiscord<Elegantbeef> Cannot tell if you mean Rust or Nim, I can see me turning a bunch of people off
04:33:36FromDiscord<j-james> the rust community?
04:34:16FromDiscord<Elegantbeef> Oh wait you mean using Nim not sexually
04:34:38FromDiscord<j-james> i find the rust community pretty welcoming, they can be a bit uptight about the language itself sometimes but that's the case with all language communities
04:34:39FromDiscord<j-james> beef
04:35:08FromDiscord<j-james> In reply to @madprops "anything is better than": also yeah i do find traits hideously overengineered
04:36:00FromDiscord<j-james> plus i stg you should not need lifetime annotations: it's a consciousness choice of the compiler to not always infer them
04:38:11FromDiscord<Elegantbeef> James↵(@j-james)
04:41:04FromDiscord<Dudugz> sent a code paste, see https://paste.rs/NbV
04:41:49FromDiscord<ElegantBeef> Damn the bridge is pooched
04:41:55FromDiscord<ElegantBeef> I mean this is the same issue as in Nim
04:42:40FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4uLV
04:43:16FromDiscord<ElegantBeef> Afaik you should be able to do `foo = list[0]` in Rust and reborrow
04:43:55FromDiscord<Dudugz> In reality the problem is that you can't even call a function from foo because of borrow lol, the way would be to clone which would cause this problem you mentioned
04:44:31FromDiscord<ElegantBeef> Yea the dichotomy of Rust/Nim 😄
04:45:06FromDiscord<Dudugz> In reply to @ElegantBeef "Afaik you should be": But it's not recommended method tho, on rust server they consider it as bad design
04:45:31FromDiscord<ElegantBeef> It's consistent but it's pretty weird that `foo` no longer is accessible given that it has no owenable resources
04:46:34FromDiscord<Daniel Belmes> In reply to @Elegantbeef "Seems like inaccurate docs": Added more info to the manual to hopefully help out with this case https://github.com/nim-lang/Nim/pull/21773
04:46:38FromDiscord<Dudugz> Yes, this is what confuses me the most, if push is no longer using the instance after adding why does it not return control of the instance to the scope?
04:46:45FromDiscord<j-james> In reply to @Dudugz "Now explain me the": yea the idiomatic way would be to `.clone()` it: because the data in `Foo` is now a part of `!vec[]`
04:47:00FromDiscord<j-james> In reply to @Dudugz "Yes, this is what": it is using the instance
04:47:25FromDiscord<ElegantBeef> It doesnt make much sense that you can take ownership of data that is not moveable
04:47:46FromDiscord<ElegantBeef> Like if a data type is purely stack allocated with no pointers taking ownership is a copy regardless
04:48:26FromDiscord<ElegantBeef> Like yes if it has internal resources that would be moved it makes sense that it invalidates `foo` to prevent dangling pointers
04:48:43FromDiscord<ElegantBeef> Seems it just does the consistent thing of all types are no longer usable after a move
04:48:49FromDiscord<Dudugz> In reply to @apropos "yea the idiomatic way": That's not cool tho, what if I want to change the value of an instance property? It would be horrible to have two identical objects with disconnected properties. Rust seems to assume that everything needs to be static. Although you can use Arc and Mutex which honestly just adds more headache with moves and values ​​that don't support moves.
04:48:51FromDiscord<ElegantBeef> Though to be fair Nim 0's memory after a move
04:49:13FromDiscord<j-james> yeah, like what if `foo` had an element that was a pointer to somewhere else
04:49:28FromDiscord<Dudugz> In reply to @apropos "it is using the": Uses to add the instance, after the function finishes its execution it is no longer used.
04:49:42FromDiscord<j-james> `Foo` having entirely self-contained data is kinda the exception not the norm
04:50:47FromDiscord<j-james> when learning rust i definitely had to convince myself "okay, calling clone here / wrapping this in an Rc / etc is actually fine, even if it bothers me a bit"
04:51:05FromDiscord<Dudugz> Well OOP is about having objects loading data... Like a server you create an instance of a client where the temporary data of the user's session will be.
04:51:09FromDiscord<ElegantBeef> Nim's implicit copy is just nicer 😛
04:51:20FromDiscord<j-james> yea i think i agree
04:51:25FromDiscord<Dudugz> + the functions to handle socket
04:51:50FromDiscord<ElegantBeef> Though I'd argue that Rust invalidating types without type analysis is bit funny
04:52:05FromDiscord<Dudugz> In reply to @ElegantBeef "*Nim's implicit copy is": lol, but does it actually copy the value or the pointer? In my case I use ref object
04:52:22FromDiscord<ElegantBeef> It does a value copy cause it has to be memory safe
04:52:22FromDiscord<j-james> borrowing mostly isn't the worst though. as long as you fall back to `.clone()` when needed
04:52:44FromDiscord<j-james> my rule of thumb is if i start fucking around with weird lifetime annotations, reevaluate and clone instead
04:52:45FromDiscord<ElegantBeef> Nim never lowers down to a pointer implicitly
04:53:29FromDiscord<Dudugz> In reply to @ElegantBeef "It does a value": Well it doesn't seem to affect me tho, I created a server that stores a list of client instances, modifying a client property also changed the list.
04:53:48FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4uLW
04:53:59FromDiscord<ElegantBeef> Nim's move semantics work in a way that is more trustworthy to the programmer
04:54:23FromDiscord<Dudugz> In reply to @apropos "borrowing mostly isn't the": I always tried to use clone, until I saw that you can't clone sockets and you can't implement traits on types you didn't create yourself.
04:54:45FromDiscord<j-james> In reply to @Dudugz "I always tried to": that last one may be my #1 complaint with rust
04:54:52FromDiscord<ElegantBeef> Wait a minute
04:54:55FromDiscord<j-james> actually hold on i have a list
04:55:02FromDiscord<ElegantBeef> You cannot implement traits... on types you didnt declare
04:55:11FromDiscord<Dudugz> Well yea
04:55:16FromDiscord<j-james> other people's traits
04:55:30FromDiscord<ElegantBeef> So if you want to make something with serde you cannot?
04:55:34FromDiscord<j-james> so no implementing Display on a type you don't own
04:55:37FromDiscord<Dudugz> From a security point of view this makes sense but then if a type doesn't have some feature you are also limited to not being able to implement it.
04:55:50FromDiscord<Dudugz> In reply to @ElegantBeef "So if you want": Exactly
04:55:52FromDiscord<ElegantBeef> work with serde
04:55:54FromDiscord<ElegantBeef> Lol
04:56:02FromDiscord<ElegantBeef> I thought you could this entire time, that's wild
04:56:15FromDiscord<Dudugz> I wanted to modify Deserialize and Serialize but it wasn't possible because rust won't let me
04:56:51FromDiscord<ElegantBeef> Generics win yet again
04:56:52FromDiscord<j-james> i have been told by someone in the rust discord, presumably seriously, that wrapping the type in a single-element tuple is the idiomatic way to do this
04:57:23FromDiscord<ElegantBeef> Right i vaguely recall someone making a distinct for that
04:57:31FromDiscord<Dudugz> hmm
04:57:35FromDiscord<ElegantBeef> You now need to manually unpack it to use it
04:58:35FromDiscord<ElegantBeef> Dont you also have to reimplement any other traits now aswell which forward the call to the internal trait
04:58:51FromDiscord<Dudugz> Honestly I was between Nim and Dart but seeing Flutter with all this callback hell scared me.
04:59:01FromDiscord<Dudugz> So I opted to learn Nim
04:59:09FromDiscord<ElegantBeef> This seems like patching a hole in drywall by putting up another entire sheet of drywall
04:59:19FromDiscord<Dudugz> lol
05:02:38FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4uM0
05:03:05FromDiscord<ElegantBeef> I mean you could make a proc for this
05:03:07FromDiscord<Dudugz> (edit) "https://play.nim-lang.org/#ix=4uM0" => "https://paste.rs/rmL"
05:05:16FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4uM1
05:05:26FromDiscord<ElegantBeef> Otherwise you could use a tuple and i'd hate you immensely
05:05:50FromDiscord<Dudugz> I mean dynamic like javascript, you can create any object you want not following any pattern
05:06:18FromDiscord<j-james> sent a long message, see http://ix.io/4uM2
05:06:20FromDiscord<Dudugz> sent a code paste, see https://paste.rs/ZWq
05:06:24FromDiscord<huantian> Do you mean like c# anonymous objects
05:06:30FromDiscord<ElegantBeef> You'd need to use an object variant like JsonNode
05:06:33FromDiscord<j-james> but, like, those are all of my gripes
05:06:43FromDiscord<ElegantBeef> Rust has limited UFCS 😛
05:06:51FromDiscord<Dudugz> In reply to @apropos "okay yeah, my gripes": Lol I agree with all points
05:07:36FromDiscord<j-james> and proper pattern matching with algebraic data types and the excellent (as good as nim) type system make up for it
05:07:42FromDiscord<Dudugz> In reply to @ElegantBeef "You'd need to use": Couldn't a template/macro build the type and initialize it?
05:08:00FromDiscord<ElegantBeef> My favourite issue was someone wanting to do some compile time string operations but cause a Rust compile time string is a `const char` you cannot use `std::String` ops
05:08:26FromDiscord<Dudugz> Lol I had this problem with Rust
05:08:29FromDiscord<j-james> oh, and metaprogramming seems more limited + iterator laziness could probably be better done by compiler magic than in the type system
05:08:35FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4uM3
05:08:36FromDiscord<Dudugz> Honestly it was pretty frustrating
05:08:37FromDiscord<ElegantBeef> Might need `"foo"` do not recall
05:08:47FromDiscord<j-james> In reply to @ElegantBeef "*Rust has limited UFCS*": i know, i know...
05:09:07FromDiscord<j-james> "why would ufcs be helpful? just implement everything as a trait" ugh
05:09:37FromDiscord<ElegantBeef> Arent authoring the type? Who cares!
05:10:14FromDiscord<ElegantBeef> The premise of traits are nice atleast
05:10:21FromDiscord<j-james> i do really think that a language with a strong concept system that's used everywhere and ufcs would be really pleasant to work with: you'd have to monomorphize everything which i understand is expensive at compile time, but not like that much more expensive
05:10:29FromDiscord<ElegantBeef> Checked generics is a great thing, plus the dyn trait
05:11:00FromDiscord<ElegantBeef> Well start using concepts more in Nim, problem solved 😛
05:11:10FromDiscord<j-james> i'm not familiar with the dyn trait actually outside of rust-analyzer suggesting it sometimes
05:11:25FromDiscord<j-james> In reply to @ElegantBeef "Well start using concepts": actually though
05:11:27FromDiscord<ElegantBeef> It gives you a vtable and allows you to raise a trait up into a box
05:11:41FromDiscord<ElegantBeef> So practically you get runtime dispatch across dynamic types
05:12:15FromDiscord<ElegantBeef> you can make a `vec<dyn trait>` and then hold anything that implements said trait
05:12:30FromDiscord<j-james> ah funky
05:12:43FromDiscord<j-james> what's a case when you'd do that over static dispatch?
05:12:52FromDiscord<ElegantBeef> GUI probably
05:13:16FromDiscord<ElegantBeef> You dynamically make a GUI hierarchy that is based off traits and can dispatch upon them
05:13:24FromDiscord<ElegantBeef> Or do something like Nim's `std/stream`
05:13:41FromDiscord<ElegantBeef> Where you have the same API across multiple and can consume them without regard at runtime
05:13:49FromDiscord<Dudugz> So far I love Nim, minus the part about having to manually add ``requires "x > y"`` to dependencies when I install a library.
05:13:52FromDiscord<j-james> ah i see
05:14:15FromDiscord<j-james> In reply to @Dudugz "So far I love": i mean that's nimble, which is separate from the language: and definitely has other issues
05:14:16FromDiscord<huantian> In reply to @Dudugz "So far I love": I think like half of the complaints about nim have something to do with tooling tbh
05:14:21FromDiscord<j-james> yeah agreed
05:14:28FromDiscord<Dudugz> In reply to @ElegantBeef "You dynamically make a": Yup, GUI widgets are usually made and connected through hierarchies
05:15:15FromDiscord<j-james> i still get orphaned `nimsuggest` processes eating up a core sometime (plus using rust-analyzer has spoiled me feature-wise)
05:16:17FromDiscord<Dudugz> I'm thinking of doing something like gtk in Nim but using SDL. Not sure it's worth the effort tho.
05:16:53FromDiscord<j-james> like gtk? like, making a whole ass widget + graphics library?
05:17:07FromDiscord<ElegantBeef> If you make the backend pluggable it'd have applications in embedded where software rendering is all they have
05:17:24FromDiscord<Dudugz> Hm, more focused on interface widgets, creating layouts, inputs, etc..
05:17:56FromDiscord<Dudugz> In reply to @ElegantBeef "If you make the": This looks interesting and laborious 😁
05:18:14FromDiscord<ElegantBeef> It gives you a practical reason to do it 😛
05:18:20FromDiscord<Dudugz> yea
05:22:05FromDiscord<Dudugz> Well despite the idea of ​​creating a UI lib with plugin support I'm still busy with university, I have 2 seminars to present next week 🙆‍♂️ that is, I would never finish this project.
05:23:46FromDiscord<Dudugz> I would have to have time to do research, in case I have a shallow knowledge about widgets and I would need to research more about to correctly implement each one, I would hate to create a bunch of workaround to publish lol
05:26:44FromDiscord<j-james> sent a long message, see http://ix.io/4uM7
05:26:54FromDiscord<ElegantBeef> Wow bringing up patty when i'm right here
05:27:01FromDiscord<Dudugz> lol
05:27:33FromDiscord<j-james> ah, sorry, of course i meant $presumably_beef's_equivalent_project
05:27:34FromDiscord<ElegantBeef> And chaining iterators
05:27:54FromDiscord<ElegantBeef> Nah my fungus is not equivlent it's technically different but more akin to what you want
05:28:00FromDiscord<ElegantBeef> <https://github.com/beef331/fungus>
05:28:38FromDiscord<Dudugz> About ```` i agree, I would prefer something like export before the declaration to export, in generic methods I never remember which side to put
05:28:45FromDiscord<ElegantBeef> <https://github.com/beef331/slicerator/blob/itermacros/tests/titermacros.nim> due to a change this now uses a `template`
05:28:56FromDiscord<ElegantBeef> Magical shite 0 cost chaining iterators
05:29:05FromDiscord<ElegantBeef> `` goes on the symbol
05:29:08FromDiscord<ElegantBeef> it always goes on the symbol
05:29:34FromDiscord<j-james> but it could be `pub` and always go before the symbol and life would be nice
05:29:36FromDiscord<Dudugz> Sure
05:29:49FromDiscord<ElegantBeef> Bleh I'm indifferent
05:29:56FromDiscord<ElegantBeef> `` is fine where it's at imo
05:30:21FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4uM9
05:30:37FromDiscord<ElegantBeef> I would prefer you didnt design language syntax
05:30:44FromDiscord<j-james> i think i like `export` in the context of `import foo/bar`, `export bar`
05:30:47FromDiscord<j-james> In reply to @ElegantBeef "I would prefer you": oof
05:31:05FromDiscord<ElegantBeef> It's all in good fun
05:32:16FromDiscord<j-james> man speaking of fun i do wish disruptek was still around
05:32:26FromDiscord<j-james> i don't know if i ever witnessed you and him in the same channel
05:32:29FromDiscord<ElegantBeef> He's got a dark corner full of AI right now
05:32:34FromDiscord<j-james> what a combo that would be
05:32:36FromDiscord<j-james> ohno
05:32:38FromDiscord<Dudugz> ```` já tem muitos significados, ``group parameters`` (python), ``pointers`` (C), ``multiply`` (any
05:32:57FromDiscord<j-james> yeah pretty much dudugz
05:32:59FromDiscord<ElegantBeef> Oh noes it can mean different things in different contexts dudugz!
05:33:08FromDiscord<ElegantBeef> Imagine if `"hello" + "world"` compiled
05:33:15FromDiscord<Dudugz> ```` already have too much meanings like pointers, multiply and group params
05:33:22FromDiscord<ElegantBeef> It doesnt mean pointers in Nim
05:33:26FromDiscord<Rika> does not have the
05:33:27FromDiscord<Rika> Yeah
05:33:29FromDiscord<j-james> it gets it from oberon i think: but unfortunate for a language that works with c so often to not have that connotation
05:33:37FromDiscord<ElegantBeef> So that's like saying it means revolutions of the sun cause X language used it lexically
05:33:56FromDiscord<j-james> (edit) removed "not" | "that" => "an entirely different"
05:34:03FromDiscord<ElegantBeef> Oberon used an explicit `export` word
05:34:12FromDiscord<Dudugz> My cell is a bit crazy today. Operating system is eating 2.1GB RAM out of 3GB
05:34:34FromDiscord<ElegantBeef> I mean C uses it as a pointer operator so it's on it
05:34:41FromDiscord<ElegantBeef> `^` was used for pointers in pascal
05:34:48FromDiscord<ElegantBeef> Can we not use `^` for power now?
05:35:09FromDiscord<ElegantBeef> We also use `^` for backwards indexing
05:35:19FromDiscord<ElegantBeef> Isnt it a bit crazy that it has so much meaning...
05:35:32FromDiscord<ElegantBeef> Now before you say "But no one used pascal"
05:35:33FromDiscord<j-james> In reply to @ElegantBeef "Oberon used an explicit": nah i think it was oberon? at least for types
05:35:46FromDiscord<ElegantBeef> Nim is pascal inspired through Modula and oberon
05:35:53FromDiscord<ElegantBeef> So it's more clostly a concern than ``
05:35:59FromDiscord<ElegantBeef> (edit) "clostly" => "closely"
05:36:13FromDiscord<Dudugz> lol, it's not that it's just confusing. You are used to an operator having this meaning in several languages ​​and then boom in another language has a totally different meaning
05:36:19FromDiscord<j-james> but bluh
05:36:29FromDiscord<Dudugz> (edit) "that" => "that,"
05:36:36FromDiscord<ElegantBeef> In reply to @Dudugz "lol, it's not that,": You can carry this on to any language though, so it's moot
05:36:44*jmdaemon joined #nim
05:36:52FromDiscord<ElegantBeef> In C inspired languages `{}` is scope but Nim uses it for Tables/Sets
05:37:02FromDiscord<ElegantBeef> Do we have to abide by the laws of our fathers?
05:37:21FromDiscord<Rika> In reply to @ElegantBeef "In C inspired languages": Or array
05:37:27FromDiscord<j-james> In reply to @apropos "i think for nim,": at least for all of those except the public marker and the `type Foo: struct` syntax, i can hold hope that they're improvable
05:37:30FromDiscord<Rika> C used {} for arrays too iirc
05:37:34FromDiscord<Dudugz> lol no, I think it's cool that each language has its differences
05:37:40FromDiscord<ElegantBeef> When does C's ownership of `` end, it's been released for 50 years now
05:37:51FromDiscord<ElegantBeef> C uses `{}` for intialisation rika
05:37:52FromDiscord<ElegantBeef> So yea
05:38:38FromDiscord<ElegantBeef> James you're correct oberon used `` for export
05:38:39FromDiscord<j-james> tooling, adts, pattern matching, chained iterator performance, adoptation of view types and sink, better c/python interop, stropping for literal identifiers, arbitrary lookahead for type declarations
05:38:46FromDiscord<ElegantBeef> Think i was thinking of Modula or another wirth language
05:39:26FromDiscord<Dudugz> Nim captivated me precisely because of the fact that it does not have a strict syntax, you can adjust it to whatever is best for you and no one will say "But this is against PEP ur dur"
05:39:41FromDiscord<j-james> don't know how ergonomic proper adts can be but mostly-proper pattern matching and chained iterator performance are already implemented as libraries, which is really quite excellent
05:39:41FromDiscord<ElegantBeef> > arbitrary lookahead for type declarations↵Is this just "cyclical type trees"?
05:40:01FromDiscord<j-james> yea probably
05:40:17FromDiscord<j-james> i just hate having to lump everything in one type block, especially when writing wrappers
05:40:37FromDiscord<ElegantBeef> I mean the issue with proper ADTs really pattern matching, Araq seems to want to improve that properly, but who knows how long it'll be
05:41:01FromDiscord<Dudugz> I also had to create a types.nim to have the types and each type had its file declaring the procs.
05:41:12FromDiscord<ElegantBeef> For not I think Fungus' primitive pattern matching and syntax is ideal but i also dont really care about ADTs/Pattern Matching
05:41:16FromDiscord<ElegantBeef> (edit) "not" => "now"
05:41:23FromDiscord<j-james> don't think universal option types and universal concept usage can ever happen unfortunately: but like i guess that wouldn't be the best fit for nim anyway, letting rust keep those is not the worst
05:41:38FromDiscord<ElegantBeef> "universal option types"
05:41:43FromDiscord<ElegantBeef> Why doth though hate me
05:41:47FromDiscord<ElegantBeef> (edit) "though" => "thou"
05:41:57FromDiscord<j-james> OH another bad one is not sharing field names in variant types
05:42:01FromDiscord<j-james> i hate that
05:42:20FromDiscord<ElegantBeef> That's practically the exact same as "Improper ADTs"
05:42:30FromDiscord<j-james> i don't know what kinds of limitations exist in the compiler around that but i hope for it to change someday
05:42:33FromDiscord<ElegantBeef> Not being able to share field names is cause of what the object variants give you
05:43:00FromDiscord<ElegantBeef> A field access on an object variant right now does not require any runtime reasoning
05:43:08FromDiscord<ElegantBeef> It's purely a check if field is accessible and grab it
05:43:50FromDiscord<ElegantBeef> When you introduce shared field names you now need to check which branch you're on and ensure that the name is what you want and this gets even worse when you add shared names different types
05:44:16FromDiscord<ElegantBeef> Cause field order can be different across the object variant shared fields is not great
05:44:58FromDiscord<ElegantBeef> Other languages get around this by forcing you to unpack the object(as fungus does) which means you can have shared fields cause the field is a field on a sub object
05:45:09FromDiscord<Dudugz> But couldn't there be something to allow sharing a specific field?
05:45:44FromDiscord<Dudugz> (edit) "But" => "~~But" | "field?" => "field?~~"
05:45:52FromDiscord<ElegantBeef> Of course you can share the same name across a field of the same type, the issue is just accessing is more complicated
05:46:05FromDiscord<ElegantBeef> cause instead of just being able to grab the field you now need to grab the field for a specific variant
05:46:16FromDiscord<Dudugz> Oh tendi but you said that fungus almost solves the problem
05:46:38FromDiscord<Dudugz> (edit) "tendi" => "got it"
05:46:46FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4uMc
05:46:56FromDiscord<ElegantBeef> `myObject.a` now is much more complicated
05:47:46FromDiscord<Dudugz> I hate keyboard suggestions, and I hate that my phone OS is all buggy ugh, phone updated android from 10 to 13 and now the interface keeps leaving and returning to the screen or sometimes the touch bug
05:47:48FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4uMd
05:48:37FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=4uMf
05:49:01FromDiscord<ElegantBeef> Sure but now consider you want to share a field across branches in rust
05:49:07FromDiscord<ElegantBeef> You now have to repeat yourself how many times
05:49:25FromDiscord<j-james> it's just much nicer syntactically to be able to nest arbitrary types instead of restricting it to structs
05:49:26FromDiscord<ElegantBeef> Once for each shape or you get a different struct and add this object as a child
05:49:38FromDiscord<ElegantBeef> There are benefits for both syntax
05:50:46FromDiscord<j-james> In reply to @ElegantBeef "Sure but now consider": yea i run into this much less frequently, and also find making a different struct to add the object as a child isn't so bad
05:52:00FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=4uMh
05:52:01FromDiscord<ElegantBeef> sent a code paste, see https://paste.rs/lCq
05:52:20FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=4uMi
05:52:51FromDiscord<j-james> i do have a project i've been meaning to finish that uses heavy pattern matching, i might just rewrite it to use patty or fungus then
05:52:57FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4uMj
05:53:03FromDiscord<ElegantBeef> But that was too confusing
05:53:31FromDiscord<ElegantBeef> well be prepared to be disappointed with Fungus' lacking pattern matching
05:53:37FromDiscord<ElegantBeef> It's very basic it only matches types
05:54:04FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4uMk
05:54:28FromDiscord<ElegantBeef> Also have the `from` macro for `if let Some(x)` like code
05:54:36FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4uMl
05:55:08FromDiscord<j-james> yea algebraic data types and structural pattern matching are really two sides of the same coin in my mind
05:55:28FromDiscord<j-james> that's how rust drew me in and kept me there tbh
05:55:34FromDiscord<ElegantBeef> Well you have to have pattern matching for tuple tagged unions
05:55:39FromDiscord<ElegantBeef> I refuse to call the ADTs really 😄
05:55:44FromDiscord<ElegantBeef> (edit) "the" => "them"
05:55:56FromDiscord<ElegantBeef> ADT is a general term that covers so many other things
05:56:01FromDiscord<j-james> i think the standard is probably racket's match statement: https://docs.racket-lang.org/reference/match.html
05:56:21FromDiscord<j-james> (edit) "i think the standard ... is" added "to strive to/"
05:56:24FromDiscord<j-james> (edit) "to/" => "to"
05:56:53FromDiscord<j-james> but rust's match statement is a very good contender, i keep learning that it's more powerful than i thought every day
05:57:15FromDiscord<ElegantBeef> I still dumbly content that PM is more confusing, since i've never used it
05:57:19FromDiscord<ElegantBeef> (edit) "content" => "contend"
05:57:50FromDiscord<j-james> yeah algebraic data types is just One Of Those Terms that while like kinda descriptive is thrown around and wordy enough that it's kind of an awful name
05:58:07FromDiscord<j-james> like const generics, or generic associated types, or really a lot of rust terminology
05:58:44FromDiscord<j-james> oh yeah "parametric polymorphism" and "ad hoc polymorphism"
05:59:00FromDiscord<ElegantBeef> I love when people say polymorphism!
05:59:04FromDiscord<j-james> i got fed up with it enough that i'm putting together a computer science glossary
05:59:10FromDiscord<ElegantBeef> It's not that helpful whether they mean runtime or static
06:00:51FromDiscord<ElegantBeef> In reply to @apropos "i got fed up": "Just stop"
06:01:21FromDiscord<ElegantBeef> I'm lucky cause I'm conventionally uneducated so all these terms are just funny words that mean nothing
06:03:11FromDiscord<j-james> that's the way to go tbh, i just think of them as very long words with spaces in between parts of them
06:08:27NimEventerNew thread by alexeypetrushin: Why template called when the arg list doesn't match?, see https://forum.nim-lang.org/t/10160
06:19:11*beholders_eye joined #nim
06:27:30*PMunch joined #nim
06:29:41*kenran joined #nim
06:29:56*fredrikhr joined #nim
06:36:59*fredrikhr92 joined #nim
06:38:28*fredrikhr quit (Ping timeout: 240 seconds)
06:42:20*advesperacit joined #nim
06:48:47FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4uMp
06:50:20FromDiscord<Dudugz> newSmth(Opts(...)) seems redundant seeing now. Since newSmth(...) would do the same thing without needing to instantiate another type
06:53:56FromDiscord<j-james> `proc newSmth(opt1: bool, opt2: int, opt3 = "default", ...)` seems good
06:54:10FromDiscord<j-james> esp. if you have default values: then that's definitely idiomatic
06:54:57FromDiscord<j-james> for a _lot_ of options though, taking a settings parameter and having a separate `initSettings()` constructor might be a good idea: that's what prologue does iirc
06:55:08*fredrik92 joined #nim
06:56:10*fredrik92 is now known as fredrikhr
06:58:47*fredrikhr92 quit (Ping timeout: 268 seconds)
07:03:12*Notxor joined #nim
07:17:08FromDiscord<Chronos [She/Her]> In reply to @Dudugz "What would be the": Honestly I prefer the first but as james said, an initSettings proc is a good idea
07:17:26FromDiscord<Chronos [She/Her]> But even better (imo): `Opts.init()` :)
07:18:34FromDiscord<Dudugz> In reply to @apropos "for a _lot_ of": like smthInstance.initSettings(...)?
07:18:50FromDiscord<Dudugz> In reply to @Hourglass, When the Hour Strikes "But even better (imo):": no need tho, bc Opts would be like an interface
07:18:58FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4uMt
07:19:05FromDiscord<Chronos [She/Her]> In reply to @Dudugz "no need tho, bc": What do you mean?
07:19:31FromDiscord<Dudugz> Opts(opt1: false, opt2: 20, opt3: "hello") would be more idiomatic, there's no need to create a proc to initialize this type of object
07:19:57FromDiscord<Chronos [She/Her]> Fair, but without a proc you can't have defaults so keep that in mind
07:19:59FromDiscord<Dudugz> but again you could'nt relly on default values without a proc
07:20:03FromDiscord<Dudugz> yea
07:20:05FromDiscord<Chronos [She/Her]> Yeah
07:20:19FromDiscord<Dudugz> but then could do like James suggested instance.initSettings(opt1: ....)
07:20:29FromDiscord<Dudugz> (edit) "could'nt" => "couldn't"
07:20:51FromDiscord<Chronos [She/Her]> Why the instance?
07:21:16FromDiscord<Chronos [She/Her]> And I don't think James meant it like that but it also works if that's what you're going for aha
07:21:23FromDiscord<Dudugz> well you must target something to customize?
07:21:28FromDiscord<Chronos [She/Her]> No...?
07:21:41FromDiscord<Chronos [She/Her]> You make a new object and return that aha
07:22:15FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4uMv
07:22:40FromDiscord<Chronos [She/Her]> It returns a new Opts object, and it'd depend on you to decide how to use it
07:22:40FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4uMx
07:23:11FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4uMy
07:23:25FromDiscord<Chronos [She/Her]> sent a code paste, see https://paste.rs/Xip
07:23:31FromDiscord<Dudugz> yea
07:28:34FromDiscord<Yardanico> also fyi nim 2.0 will have default values for object fields (compile-time known ones of course)
07:29:18FromDiscord<firq> If you need to pass a set of parameters to several different functions, then creating an Opts type and passing that, otherwise I'd suggest the parameters directly to the single function.
07:32:45FromDiscord<Dudugz> lol i didn't realized it was a super-reaction
07:33:08FromDiscord<Dudugz> i just clicked to react on the first emoji icon
07:34:38FromDiscord<Dudugz> What's the best design for an event poll without using an event handler?↵Something like using while loop?
07:34:49FromDiscord<Ras> sent a code paste, see https://play.nim-lang.org/#ix=4uMA
07:35:20FromDiscord<Dudugz> (edit) "loop?" => "loop?↵↵Beef said that procs like callbacks are costly so I want to avoid creating an event emitter"
07:35:33FromDiscord<Yardanico> you could importc the nim variable that holds argv, but what's your usecase for this?
07:36:41FromDiscord<Ras> (this changes `/proc/[pid]/cmdline` - `/proc/[pid]/comm` can be written to directly, but they're represented differently in `ps` output)
07:36:41FromDiscord<RandomVisitor> sometimes people overwrite argv so that tools like ps will report stuff like postfix [master] etc instead of just postfix
07:36:59FromDiscord<Yardanico> oh
07:37:08FromDiscord<RandomVisitor> but these days you're better off modifying the /proc filesystem instead of argv directly
07:37:54FromDiscord<Yardanico> you can importc and modify `cmdLine`
07:38:49FromDiscord<Ras> In reply to @Yardanico "you could importc the": I'm writing "malware" for an inject in a cyber exercise we're conducting. This would test blue teams' abilities to identify when processes run with non-default names (and whether they identify this behaviour in the forensics/RE part of the cyber exercise)
07:39:21FromDiscord<Yardanico> well maybe use RandomVisitor's suggestion since it will probably look cleaner, but you can importc cmdLine too
07:39:57FromDiscord<Ras> cool, I'll try them both out and see how the disassembly looks and probably decide on that
07:39:59FromDiscord<Ras> thank you!
07:40:00FromDiscord<Yardanico> it's originally defined at <https://github.com/nim-lang/Nim/blob/devel/compiler/cgen.nim#L1468> and assigned in <https://github.com/nim-lang/Nim/blob/devel/compiler/cgen.nim#L1522>
07:40:26FromDiscord<cmc> sent a code paste, see https://play.nim-lang.org/#ix=4uMD
07:40:31FromDiscord<Yardanico> In reply to @Ras "cool, I'll try them": also if you want somewhat cleaner disassembly you'd want to use --gc:arc (or orc if you're using async or ref types with cycles) instead of refc
07:40:35FromDiscord<Yardanico> orc will become the default in 2.0 anyway
07:40:45FromDiscord<Yardanico> cleaner as in more straightforward
07:40:49FromDiscord<Ras> yep, already using orc because of exactly that
07:40:56FromDiscord<Ras> but thanks for the tip
07:41:26FromDiscord<Yardanico> and then also things like -d:useMalloc if you don't want Nim to use its own allocator (but allocation-heavy code can be much slower if you're not using something like mimalloc)
07:41:36FromDiscord<Yardanico> and things like --panics:on that turn defects into unrecoverable errors
07:41:58FromDiscord<Rika> In reply to @cmc "I'm writing a macro": Not exactly? Because the values aren’t necessarily determinable on run time
07:42:00FromDiscord<Ras> super, thanks
07:42:04FromDiscord<Rika> I mean compile time
07:44:23FromDiscord<Chronos [She/Her]> In reply to @Yardanico "also fyi nim 2.0": Oh interesting
07:44:42FromDiscord<Yardanico> you can read the changelog for all changes
07:44:45FromDiscord<Yardanico> or just use devel :)
07:45:02FromDiscord<cmc> Well let's see- I don't need the values, just the type for each value. Oh maybe I got it- `getTypeImpl`↵(@Rika)
07:46:47FromDiscord<Ras> sent a long message, see http://ix.io/4uME
07:47:45FromDiscord<cmc> Yeah that does it for the type info, but I also need the field names if it's named...
07:50:04FromDiscord<Chronos [She/Her]> In reply to @Yardanico "and then also things": Wasn't there a proposal to make mimalloc the default allocator?
07:52:17FromDiscord<Yardanico> In reply to @Hourglass, When the Hour Strikes "Wasn't there a proposal": it was scrapped after araq improved the nim's own allocator, you can just check the PRs, it's all public
07:52:32FromDiscord<Yardanico> <https://github.com/nim-lang/Nim/pull/20359>
07:52:53FromDiscord<Yardanico> <https://github.com/nim-lang/Nim/pull/20492>
07:58:51FromDiscord<Chronos [She/Her]> Ah alright
08:05:13FromDiscord<Dudugz> what the `|` op is used for?
08:05:19FromDiscord<Dudugz> i mean docs aren't very clear about it
08:05:34FromDiscord<Dudugz> https://media.discordapp.net/attachments/371759389889003532/1103230855092109392/image.png
08:06:09FromDiscord<Ras> if you click the `source` button, you can see what the code does :) best source of documentation
08:06:10FromDiscord<Yardanico> same as or
08:06:17FromDiscord<Yardanico> for types
08:06:25FromDiscord<Yardanico> `type MyType = int | float`
08:06:33FromDiscord<Yardanico> `type MyType = int or float`
08:06:38FromDiscord<Yardanico> for use in generic stuff
08:06:53FromDiscord<Dudugz> sure
08:07:09FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#generics-type-classes
08:07:11FromDiscord<Yardanico> "Type classes can be combined using the standard boolean operators to form more complex type classes:"
08:07:15FromDiscord<Dudugz> so writing my own impl will not overload it right? i mean i'm not dealing with typedescs
08:07:26FromDiscord<Yardanico> why does it matter if it'll overload it or not?
08:07:39FromDiscord<Yardanico> you won't care if there's another proc with same name defined if it has different types from your own
08:07:43FromDiscord<Dudugz> i'll use it to join flags like C does
08:07:48FromDiscord<Yardanico> since the compiler will always do disambiguation
08:07:52FromDiscord<Yardanico> In reply to @Dudugz "i'll use it to": why not sets :((
08:08:02FromDiscord<Dudugz> i'm using enums :v
08:08:04FromDiscord<Yardanico> even if you have to interface with C's bit fields, you can use Nim sets
08:08:07FromDiscord<Yardanico> yes, enums go along with sets
08:08:19FromDiscord<Yardanico> `type MyFlags = set[MyEnum]`
08:08:29FromDiscord<Yardanico> let flagOpts = {MyEnum.Flag1, MyEnum.Flag2}
08:08:43FromDiscord<Dudugz> hm
08:08:50FromDiscord<Yardanico> and if you need interop with C you can sue https://nim-lang.org/docs/manual.html#set-type-bit-fields
08:08:53FromDiscord<Yardanico> (edit) "sue" => "use"
08:08:53FromDiscord<Dudugz> can a set be converted to uint32?
08:09:08FromDiscord<Yardanico> if you want the power of 2 style bit field
08:09:12FromDiscord<Dudugz> e.g: MyEnum.Flag1 | MyEnum.Flag2 = 129
08:09:19FromDiscord<Yardanico> yes, see my link
08:09:30FromDiscord<Dudugz> no i mean the enum hold values that you sum and pass to the c api
08:09:37FromDiscord<Yardanico> yes, this is what the link does exactly
08:09:41FromDiscord<Yardanico> you can just convert from the set to a number and back
08:09:53FromDiscord<Yardanico> and you can have the nice set syntax instead of having to OR enum values
08:10:34FromDiscord<Dudugz> sure i'll try using sets, it seems better :v
08:12:41FromDiscord<Dudugz> lol
08:12:48FromDiscord<Dudugz> ``set is too large``
08:12:50FromDiscord<Dudugz> pretty cool
08:12:54FromDiscord<Dudugz> 😄
08:13:08FromDiscord<Yardanico> how many enum values do you have?
08:13:13FromDiscord<Yardanico> 100 thousand?
08:13:38FromDiscord<Dudugz> 12
08:13:40FromDiscord<Yardanico> also maybe the docs didn't say it, but if you're using this syntax you don't have to explicitly type out enum values
08:13:45FromDiscord<Yardanico> because they'll automatically be powers of two
08:13:56FromDiscord<Dudugz> oh, then that's a issue
08:14:03FromDiscord<Yardanico> like the example just shows A, B, C, D and then A + C is 5
08:14:10FromDiscord<Dudugz> i'm using a c api that doesn't use powers of two
08:14:23FromDiscord<Dudugz> it's like "f u, i'm using random numbers for my flags"
08:14:32FromDiscord<Yardanico> are the docs available online?
08:14:39FromDiscord<Dudugz> i'm just mapping these flags to be more dev-friendly
08:15:39NimEventerNew Nimble package! grammarian - Wrapper around PEG library, enhancing PEG reusability., see https://github.com/olmeca/grammarian
08:16:01FromDiscord<Dudugz> i mean it goes til 8192 and then to a huge number
08:16:27FromDiscord<Dudugz> the last two flags are 268435456 and 536870912
08:16:33FromDiscord<Yardanico> oh
08:16:47FromDiscord<Dudugz> removing them fix set :V
08:17:43FromDiscord<Dudugz> In this case, I think the best option will be to put them as separate options that can be activated with true or false
08:17:48FromDiscord<Ras> those are 2^28 and 2^29
08:18:07FromDiscord<Dudugz> In reply to @Ras "those are 2^28 and": >.> but it complains because it doesn't follow the order
08:18:31FromDiscord<Ras> hrm
08:18:32FromDiscord<Dudugz> after 8192 comes 16384
08:19:46FromDiscord<Rika> I just got here, is this a enum set
08:19:52FromDiscord<Yardanico> In reply to @Rika "I just got here,": 536870912
08:19:57FromDiscord<Dudugz> yup :v
08:20:13FromDiscord<Rika> In that case set the values of the enums that should 2^28 and 2^29 to 28 and 29
08:20:26FromDiscord<Dudugz> it starts normally between 0 to 8192 and then the rest of the options are "random" numbers 😁
08:20:28FromDiscord<Yardanico> oh right
08:20:31FromDiscord<Ras> yeah
08:20:34FromDiscord<Yardanico> smart rika
08:20:34FromDiscord<Ras> set the 28th bit
08:20:42FromDiscord<Ras> aka set the value to 268435456
08:20:52FromDiscord<Dudugz> In reply to @Rika "In that case set": makes sense
08:21:06FromDiscord<Marcus> image.png https://media.discordapp.net/attachments/371759389889003532/1103234764657405972/image.png
08:21:26FromDiscord<Marcus> My PR for nimlangserver support in nvim-lspconfig got merged yesterday. Seems to work well 🙂
08:21:36FromDiscord<Rika> In reply to @Yardanico "smart rika": :smug:
08:21:54FromDiscord<Ras> In reply to @Marcus "My PR for nimlangserver": 🎉
08:27:20FromDiscord<Dudugz> In reply to @Ras "set the 28th bit": it worked great, thanks everyone for the help 😁
08:33:46FromDiscord<oxnan> say I have to look through many small/one big file for a bunch of smaller substrings, and I wanna do this as fast as possible. would it be faster for me to somehow parallelise running ripgrep for searching or is there some better alternative that I am not thinking about? (I am using nim for this as the stuff I am searching for is generated in obscure ways, and I am trying to get better at nim 🙂 )
08:56:29FromDiscord<Dudugz> I don't even know why I try to be organized in Nim ;-; it's easier to put all the code in the same file and avoid problems because you can't import cyclic.
08:56:43FromDiscord<Dudugz> (edit) "import cyclic." => "cyclic import."
08:59:36FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4uMQ
09:01:03FromDiscord<Dudugz> I forgot how to do it in a way where one type doesn't depend on the other. Like, doStuff needs Foo to handle some things the same way Foo needs to extend Node because they share too many similarities to be separate things.
09:01:21FromDiscord<Yardanico> usually people just have a separate file to define all types that should be shared, yeah
09:01:53FromDiscord<Dudugz> But what if foo.nim needs override draw? Wouldn't I need to import node.nim?
09:02:10FromDiscord<Dudugz> If I don't need to import then I can create a types.nim
09:02:24FromDiscord<Dudugz> (edit) "draw?" => "doStuff?"
09:02:32FromDiscord<Yardanico> In reply to @Dudugz "But what if foo.nim": hm?
09:02:34FromDiscord<Yardanico> override in what way?
09:02:46FromDiscord<Dudugz> Ops i forgot to put base pragma
09:03:33FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4uMS
09:03:52FromDiscord<Dudugz> I mean, it would be redundant but there would be other methods that don't take foo as a second parameter
09:05:05FromDiscord<Dudugz> I actually think that since it's dawn my brain cells died, I'm sure I'm forgetting something. Best left to mess with it after sleep.
09:05:16FromDiscord<Elegantbeef> Those are two different signatures
09:05:16FromDiscord<Elegantbeef> But that's multi methods
09:05:22FromDiscord<Elegantbeef> And we do not venture down multi methods
09:06:24FromDiscord<Dudugz> Would that be bad? For type extension to have the method do something according to the extension?
09:07:05FromDiscord<Dudugz> I mean, with this I could have a list of objects and just call object.doStuff and then each different object type would handle its type appropriately.
09:07:22FromDiscord<Elegantbeef> The issue is `Foo, Foo` and `Foo, Bar` are two different procedures/methods and need multi methods to dispatch
09:08:03FromDiscord<Dudugz> ... but it's the same type
09:08:58FromDiscord<Dudugz> Well I'm sure there's a better design for this I'm just sick of the time, I'm going to sleep.
09:09:02FromDiscord<Elegantbeef> I might be misremembering but I'm fairly certain that dispatch only happens on the first parameter and it's technically incorrect to downcast a parameter
09:09:34FromDiscord<Elegantbeef> Cause `Foo, Foo` being the method means that calling `Bar, Foo` is valid but if you write `Bar, Bar` it'll error
09:09:42FromDiscord<Elegantbeef> Or atleast it should error
09:10:21FromDiscord<Dudugz> Hm, I hadn't thought of that, anyway I'm going to let my 2 neurons rest, cya
09:14:21FromDiscord<Elegantbeef> Yea without multimethods i'm right
09:14:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4uMU
09:34:23*beholders_eye quit (Ping timeout: 246 seconds)
09:37:09*demetera joined #nim
09:37:50*demetera quit (Remote host closed the connection)
09:38:01FromDiscord<oxnan> Anyone have a short example of how to use threadpool spawn to run a proc and get the result from it? 🙂
09:45:20*demetera joined #nim
09:54:55advesperacitoxnan have you tried something like this? https://forum.nim-lang.org/t/494#3286
10:15:13FromDiscord<Ras> sent a code paste, see https://play.nim-lang.org/#ix=4uN5
10:16:07NimEventerNew thread by zevv: Usability of ARC/ORC in multi threaded code., see https://forum.nim-lang.org/t/10161
10:18:48FromDiscord<Ras> In reply to @Ras "so I've been trying": that is - if i `echo cmdLine[0]` after changing it, it has _seemingly_ changed, but `/proc/[pid]/cmdline` seems to be the same as if i'm not actually modifying `argv`
10:23:55FromDiscord<Ras> sent a code paste, see https://play.nim-lang.org/#ix=4uN7
10:41:18*kenran quit (Remote host closed the connection)
11:23:29FromDiscord<oxnan> In reply to @advesperacit "oxnan have you tried": thanks! managed to get it to work 🙂
11:26:46*beholders_eye joined #nim
11:27:21FromDiscord<Ras> In reply to @Ras "maybe as a workaround,": hrm, setting characters works. `cmdLine[0][0] = 'a'` changes `cmdline`. This makes it seem like there's a copy made somewhere of the `cmdLine` array itself which i seem to be modifying. I suppose I can just do a `copymem`, but that seems... kind of not like how I'm supposed to solve this
11:29:18FromDiscord<Ras> and i can only copymem up to the length of cmdline[0], which is less than ideal
11:35:55NimEventerNew Nimble package! checksums - Hash algorithms in Nim., see https://github.com/nim-lang/checksums
11:45:04*beholders_eye quit (Ping timeout: 248 seconds)
11:46:51*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
11:48:10*ehmry joined #nim
12:11:58FromDiscord<RandomVisitor> "Hash algorithms in Nim. The documentation is at https://nim-lang.github.io/checksums/theindex.html." ↵↵I don't know why, but I'm bothered that it's not index.html
12:29:42*beholders_eye joined #nim
12:45:52*jmdaemon quit (Ping timeout: 248 seconds)
13:04:46*Notxor quit (Remote host closed the connection)
13:23:28*Notxor joined #nim
13:26:25FromDiscord<sOkam!> In reply to @Marcus "My PR for nimlangserver": ❤️ ❤️ ❤️ ❤️ ❤️
13:33:08FromDiscord<Bung> `($(req.headers[i].name))[0 .. req.headers[i].namelen]` can I directly convert `ptr char` to `string` now it implicitly convert to `cstring`
13:56:38FromDiscord<Chronos [She/Her]> In reply to @Bung "`($(req.headers[i].name))[0 .. req.headers[i].namel": To convert Nim strings to C strings explicitly, there's `cstring`, so you use it like `"text".cstring`, does that help?
13:58:35FromDiscord<Bung> nah, I was asking for `ptr char` to `string`
14:01:44FromDiscord<Chronos [She/Her]> Oh ptr char to string?
14:01:57FromDiscord<Chronos [She/Her]> Can't you do `$` on it?
14:02:00FromDiscord<Chronos [She/Her]> Oh wait pointer
14:02:20FromDiscord<Chronos [She/Her]> `$(yourPtr[])`?
14:02:24FromDiscord<Chronos [She/Her]> Maybe?
14:03:03FromDiscord<Bung> hmm , the routine is ptr char -> cstring -> string -> slice
14:03:32FromDiscord<Bung> you see, what I want is ptr char -> string -> slice
14:11:28*PMunch quit (Quit: Leaving)
14:24:37*Notxor quit (Remote host closed the connection)
14:32:43FromDiscord<RaycatWhoDat> sent a code paste, see https://play.nim-lang.org/#ix=4uO2
14:33:09FromDiscord<RaycatWhoDat> (edit) "https://play.nim-lang.org/#ix=4uO2" => "https://paste.rs/yfF"
14:33:24FromDiscord<RaycatWhoDat> I know it will be a combination of `importC`, `header` and something else but I'm new to Nim
14:33:56NimEventerNew question by Bor: Nim Lang - Finding char index, see https://stackoverflow.com/questions/76165049/nim-lang-finding-char-index
14:36:49FromDiscord<sOkam!> In reply to @RaycatWhoDat "Quick question: If I": strings are not null terminated, but you can interop by just converting to cstring↵you can use the `emit` pragma for things that nim doesn't know how to do. but for most things i would stick to nim and let the compiler do its thing. there is always ways to make it do what you want, without relying on a specific/literal pure c representation
14:37:12FromDiscord<RaycatWhoDat> wha
14:37:34FromDiscord<sOkam!> types are actually types in Nim, not recommendations. so you can actually rely on the compiler to be explicit about them
14:37:50FromDiscord<sOkam!> and there are typed pointers, which are much safer than c pointers
14:38:14FromDiscord<RaycatWhoDat> Oh, that actually was directed at me, gotcha
14:38:25FromDiscord<RaycatWhoDat> I read the first line and thought you meant to ping the other person
14:38:51FromDiscord<sOkam!> oh no, i was trying to give some tip on things i noticed when coming from c
14:39:31FromDiscord<sOkam!> overall, you can very much rely on standard nim features to do the work for you. no need to be c-like at all (except on the step right before interoperating with c code)
14:40:24FromDiscord<RaycatWhoDat> Oh, nice. So, for making a file with that preamble, Nim has ways to make that happen IN Nim?
14:40:31FromDiscord<RaycatWhoDat> That's pretty sweet
14:41:04FromDiscord<RaycatWhoDat> I definitely thought I would be using the escape hatch a lot
14:41:27FromDiscord<sOkam!> i don't know what that macro does, but you can use a `template` and it would basically do the same. although templates are not the best way to achieve macro-like behavior in general, since the compiler can do that for you↵but if you -require- it... you can either inline or template the process
14:42:02FromDiscord<RaycatWhoDat> Got it
14:42:12FromDiscord<RaycatWhoDat> Thanks for the info
14:42:23FromDiscord<sOkam!> no worries
14:47:57FromDiscord<sOkam!> sent a long message, see https://paste.rs/Drm
15:14:09*Notxor joined #nim
15:21:31FromDiscord<IanB> Just saying hi (Perl dev, discovered Nim and reading Nim in Action), interesting language
15:34:24*Notxor quit (Remote host closed the connection)
15:43:24FromDiscord<pysan> sent a code paste, see https://play.nim-lang.org/#ix=4uOv
16:07:59*Notxor joined #nim
16:26:46*xaltsc joined #nim
16:28:40*beholders_eye quit (Remote host closed the connection)
16:34:25*arkurious joined #nim
16:45:47*arkurious quit (Quit: Leaving)
17:05:24*cnx quit (*.net *.split)
17:05:24*Lord_Nightmare quit (*.net *.split)
17:05:51*cnx_ joined #nim
17:06:03*cnx_ is now known as cnx
17:06:30*Lord_Nightmare joined #nim
17:17:04FromDiscord<Marcus> Hi from another Perler ;-)↵(@IanB)
17:18:42FromDiscord<Marcus> Well. Not so much in recent years. Reviewing a few mojo prs now and then.
17:21:28*rockcavera joined #nim
17:24:33*DaVinciGH joined #nim
17:32:07*Notxor quit (Remote host closed the connection)
17:36:35*DaVinciGH quit (Quit: Leaving)
17:37:10*lucasta joined #nim
18:04:46*beholders_eye joined #nim
18:26:42*xet7 joined #nim
18:31:33FromDiscord<IanB> When I understand a bit more, I may have a dabble see if mixing nim with Perl (either via Inline::C/C++ or FFI) out of interest, suspect the former will be a bit tricky tho
18:45:19*Notxor joined #nim
19:00:06FromDiscord<RaycatWhoDat> In reply to @IanB "When I understand a": VERY curious about that effort. Raku ex-pat here.
19:06:09FromDiscord<Marcus> Not XS? 🙂 nim compiles to C, so should be fairly easy I suspect.↵(@IanB)
19:06:54FromDiscord<Elegantbeef> Make a dynamic library then load it inside perl
19:07:07FromDiscord<Elegantbeef> I assume perl supports dynamic libraries
19:07:27FromDiscord<Marcus> https://perldoc.perl.org/perlxs yea
19:38:55FromDiscord<guttural666> How would I read a specific line of a file given a line index? (without actually looping over all the lines with the readLine proc=
19:39:02FromDiscord<guttural666> (edit) "proc=" => "proc)"
19:40:29FromDiscord<Elegantbeef> There is no API for "got to specific line"
19:41:09FromDiscord<ElegantBeef> In reply to @Elegantbeef "[BracketMaster (Yehowshua Immanuel)](https://matrix": Would probably be quicker than the stdlib readline
19:41:30FromDiscord<Elegantbeef> Whether it's bug free is beside the point 😛
19:42:29FromDiscord<guttural666> In reply to @Elegantbeef "There is no API": should probably read my understanding the linux kernel to understand the technical details of files ^^
19:42:52FromDiscord<Elegantbeef> I mean a file is a binary stream of data, there is no concept of lines
19:43:08FromDiscord<Elegantbeef> We only attribute `\n` as a new line
19:45:13FromDiscord<guttural666> yeah, makes sense
19:45:39FromDiscord<guttural666> may be possible to store offsets into files?
19:45:55FromDiscord<guttural666> start_bin + pointer_to_my_stuff?
19:46:08FromDiscord<guttural666> (edit) "pointer_to_my_stuff?" => "bytes?"
19:46:56FromDiscord<Elegantbeef> Huh?
19:48:32FromDiscord<guttural666> uhm, if I know the file, I could just provide an offset in terms of bytes into that file
19:48:36FromDiscord<guttural666> and then read from there?
19:48:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4uPn
19:48:43FromDiscord<Elegantbeef> Yesyou can do `setPos` or w/e it is
19:49:12FromDiscord<Chronos [She/Her]> In reply to @ElegantBeef "Would probably be quicker": Why don't you PR that to the stdlib lol
19:49:33FromDiscord<Elegantbeef> Cause I read the stdlib lines and have no clue what the hell it's doing
19:50:09FromDiscord<guttural666> In reply to @Elegantbeef "Yesyou can do `setPos`": probably this bad boy? https://media.discordapp.net/attachments/371759389889003532/1103408174956036167/image.png
19:50:23FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/system/io.nim#L376-L496
19:50:32FromDiscord<Elegantbeef> Look at that shit, it's crazy
19:51:00FromDiscord<guttural666> 😄
19:51:29FromDiscord<Elegantbeef> That function is called inside a while loop of `lines`
19:51:32FromDiscord<Elegantbeef> No wonder it's so slow
20:01:33*TakinOver quit (Ping timeout: 250 seconds)
20:06:24FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Cause I read the": Ah lmao
20:09:53FromDiscord<jmgomez> Hey beef, do you happen to know if `procInstCache` is used only for generics or both?
20:10:17FromDiscord<Elegantbeef> given it's `inst` likely generics only
20:10:20FromDiscord<Elegantbeef> Normal procedures arent instantiated they're declared 😛
20:11:12FromDiscord<jmgomez> Oh didnt know it stands for it. Thanks! Been hammering the whole day with the compiler.. So when a proc is added to the module graph?
20:11:34*TakinOver joined #nim
20:12:39FromDiscord<Elegantbeef> I assume `semProcAux`
20:13:03FromDiscord<jmgomez> Tried there but the pragmas doesnt seem to be set yet
20:13:22FromDiscord<Elegantbeef> Hey that's when it's added
20:13:33FromDiscord<Elegantbeef> It probably has a path that does pragma analysis
20:13:56FromDiscord<jmgomez> My attempt was to log it at the very last line
20:14:12FromDiscord<jmgomez> will keep looking
20:14:24FromDiscord<Elegantbeef> Well what calls `semProcAux`
20:14:24FromDiscord<Elegantbeef> Go up the stack
20:15:01FromDiscord<jmgomez> Can be called by semFunc/semPro/semMethod which is already too high
20:15:51FromDiscord<jmgomez> Will checkout the stacktrace of when a pragma is added and move from there
20:17:52FromDiscord<jmgomez> you were right, it's called from semProcAux I probably checked on the wrong symbol
20:18:21FromDiscord<jmgomez> I knew I could get something from asking you 😛
20:29:52FromDiscord<Elegantbeef> Other than sass?
20:34:52FromDiscord<jmgomez> what's sass?
20:35:44*lucasta quit (Ping timeout: 248 seconds)
20:36:15FromDiscord<Elegantbeef> Other than a CSS superset, it's a disrespectful response 😄
20:38:17FromDiscord<jmgomez> lol
20:38:42FromDiscord<jmgomez> you are fine, most of time on the right side of the line 😛
20:39:07FromDiscord<Elegantbeef> You're just encouraging me to edge the line
20:49:32FromDiscord<Marcus> Finally
20:53:37*progranner joined #nim
20:56:46NimEventerNew Nimble package! promexplorer - A simple tool to explore Prometheus exporter metrics, see https://github.com/marcusramberg/promexplorer
20:57:48*TakinOver quit (Ping timeout: 240 seconds)
20:59:02*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
21:00:01FromDiscord<jmgomez> any idea on how to resolve the module for a PType?
21:02:43*progranner joined #nim
21:22:51*Notxor quit (Remote host closed the connection)
21:24:55*advesperacit quit ()
21:25:08*progranner quit (Ping timeout: 240 seconds)
22:05:44*azimut quit (Ping timeout: 240 seconds)
22:09:53*demetera quit (Remote host closed the connection)
22:10:52*demetera joined #nim
22:13:51*lucasta joined #nim
22:57:48*TakinOver joined #nim
23:17:55FromDiscord<Prestige> I'm trying to open a file for read/write, but simple opening and reading the data seems to be deleting the contents of the file. Is this normal?
23:18:16FromDiscord<Prestige> playground seems down again
23:18:44FromDiscord<Prestige> sent a code paste, see https://play.nim-lang.org/#ix=4uPM
23:18:50FromDiscord<Prestige> file is empty after I do this ^
23:23:03FromDiscord<Elegantbeef> `fmReadWriteExisting`
23:24:08FromDiscord<Prestige> Well that's weird but ty
23:25:43FromDiscord<Elegantbeef> Yea it should probably be a `existing = false` or w/e
23:25:58FromDiscord<Elegantbeef> Or really `{Read, Write, Existing}`
23:26:47FromDiscord<voidwalker> How much faster are arrays vs seqs, and why ? I saw some variable length array implementation for nim, using maloc, but that allocates on the heap, right ? Wouldn't be as fast as normal arrays then, no ? I'm thinking about the optimal way to implement bit vectors, with a fixed but unknown at compile time array size
23:27:34FromDiscord<Elegantbeef> They're not
23:28:00FromDiscord<voidwalker> A solution would be to over allocate an array so that it fits your expected data in stack.. but that's not a good programming pattern
23:28:17FromDiscord<Elegantbeef> Arrays and sequences are just memory, there isnt any speed increases from using an array vs. seq minus allocations
23:28:40FromDiscord<voidwalker> I remember I read that arrays are faster at least a few times
23:28:47FromDiscord<voidwalker> because of compile optimisations
23:36:15FromDiscord<auxym> early optimization and the root of evil, etc. Point is, profile and see which (if any) is faster for your use case
23:37:05FromDiscord<Elegantbeef> `set[T]` is also generally sufficient aside from large range sets in that case use `intset` or `sets`
23:51:22FromDiscord<voidwalker> In reply to @auxym "early optimization and the": I was thinking in the context of maybe creating a new bit vector library, by stealing code from the existing ones 😛
23:51:42FromDiscord<voidwalker> it's obviously that a specific purpose library has to be optimized. Context was bit arrays
23:53:59FromDiscord<Elegantbeef> https://nim-lang.org/docs/packedsets.html#PackedSet
23:55:20FromDiscord<voidwalker> oh but this is different.. this is for sets of integers. Bit vectors are arrays of boolean stores as bits instead of bytes
23:55:30FromDiscord<voidwalker> (edit) "stores" => "stored"
23:55:41FromDiscord<Elegantbeef> How many of these bools are you storing?
23:55:57FromDiscord<voidwalker> well, up to a few million I guess
23:56:02FromDiscord<voidwalker> 2-3 mil max
23:56:59FromDiscord<voidwalker> but usually in the 1000-20.000 range I guess
23:57:14FromDiscord<auxym> In reply to @voidwalker "I was thinking in": maybe start with bitty and see if you can optimize it? it already has benchmarks: https://github.com/treeform/bitty/blob/master/tests/bench.nim
23:59:48FromDiscord<voidwalker> I used this one so far: https://github.com/MarcAzar/BitVector