<< 03-06-2023 >>

00:37:15FromDiscord<Graveflo> In reply to @sOkam! "<@200775012796334081> are you on": linux
00:47:17FromDiscord<JJ> In reply to @chmod222 "One thing Zig cannot": curious, do you have an example?
00:48:06FromDiscord<JJ> i would kind of guess that macros + `when` + `static` provide similar ergonomics but don't know what i'm comparing it to
00:54:27FromDiscord<demotomohiro> In reply to @apropos "i would kind of": You can generate procedures in a macro using genasts:↵https://nim-lang.org/docs/genasts.html
00:55:46FromDiscord<demotomohiro> Write proc definition under genAst template.
00:57:28FromDiscord<demotomohiro> Another way is generating AST that represents proc definition using procs in macro module.
00:58:18FromDiscord<demotomohiro> https://nim-lang.org/docs/macros.html#newProc%2CopenArray%5BNimNode%5D%2CNimNode%2CNimNode↵That provides best flexibility but bit hard.
01:18:49FromDiscord<Prestige> Is there a hook we can use to run code as an application is exiting?
01:18:59FromDiscord<Prestige> Like if someone ends the process or w/e
01:20:09FromDiscord<Graveflo> there is a `try` `finally`
01:23:16FromDiscord<spotlightkid> On \nix, for when the process is terminated externally, you can use signals\: https://github.com/SpotlightKid/jacket/blob/master/examples/signal.nim
01:24:08FromDiscord<spotlightkid> There's also https://nim-lang.org/docs/exitprocs.html
01:24:39*xet7 quit (Quit: Leaving)
01:40:57FromDiscord<that_dude> If you exist here I'd like to talk to ya about this project and what I can contribute https://media.discordapp.net/attachments/371759389889003532/1114368091154030673/image.png
02:03:56*xet7 joined #nim
02:09:09FromDiscord<demotomohiro> In reply to @Avahe "Is there a hook": Probably this is what you want: https://nim-lang.org/docs/exitprocs.html
02:18:32FromDiscord<Prestige> Aha, thank you
02:26:08FromDiscord<Ayy Lmao> Is it possible to make a template discardable?
02:26:18FromDiscord<Ayy Lmao> I can't seem to figure out a way.
02:26:59FromDiscord<Elegantbeef> adt cannot be discardable
02:27:01FromDiscord<Elegantbeef> ast\
02:28:09FromDiscord<Ayy Lmao> Man that sucks
02:28:11FromDiscord<Elegantbeef> make an internal proc that is discardabke
02:30:10FromDiscord<Ayy Lmao> Hmmm that might work but I would have to capture by closure I think. I basically have a block expression and I want to return an injected variable. It's weird.
02:30:51FromDiscord<Elegantbeef> code?
02:31:28FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4xmB
02:32:29FromDiscord<Ayy Lmao> I want the self at the end to be discardable
02:32:46FromDiscord<Elegantbeef> of course
02:32:52FromDiscord<Elegantbeef> simply not possible
02:33:58FromDiscord<Elegantbeef> could use pointer procs instead
02:34:33FromDiscord<Ayy Lmao> It is if I return it by closure
02:34:48FromDiscord<Elegantbeef> right
02:34:48FromDiscord<Ayy Lmao> sent a code paste, see https://paste.rs/55SaX
02:34:59FromDiscord<Elegantbeef> but i mean there are more sane impls
02:35:02FromDiscord<Ayy Lmao> (edit) "https://play.nim-lang.org/#ix=4xmD" => "https://play.nim-lang.org/#ix=4xmC"
02:35:17FromDiscord<Elegantbeef> use a proc that takes procs instead for instance
02:35:40FromDiscord<Ayy Lmao> There's a lot of context missing from the code snippet, but what I am doing is not very sane
02:36:37FromDiscord<Elegantbeef> i'm your conscience working remotely
02:38:42FromDiscord<Ayy Lmao> I'm sure you would advise against a template that writes a macro. I'm sure you would not like what you see.
02:41:26FromDiscord<Elegantbeef> Not always
03:01:51FromDiscord<emanresu3> can't you make an external discardable proc wrapping the template?
03:03:26FromDiscord<JJ> i miss beef's pfp 🙁
03:04:19FromDiscord<Rika> Same lol
03:08:28*rockcavera quit (Remote host closed the connection)
03:32:34FromDiscord<Elegantbeef> Did that fix it?
03:32:42FromDiscord<ElegantBeef> bastards
03:52:20FromDiscord<Rika> Lol
03:52:27FromDiscord<Rika> It’s probably the bridge
03:53:00FromDiscord<Elegantbeef> Yea I thought that maybe it was cause an issue with the image cache, so changed my pfp attempting to cause it to refresh, but it seems it no longer includes the pfp
04:07:48FromDiscord<Graveflo> Is there a way, even if it's hacky to inject an override into another module? Or just inject a proc even if it's not overloading/overriding?
04:08:43FromDiscord<Elegantbeef> mixin, there is not other way
04:13:03FromDiscord<Graveflo> I imagine being able to do what I said arbitrarily would create choas most of the time, but it would be nice to tell a proc that someone else wrote to kinda behave like a method in binding at least
04:13:18FromDiscord<Elegantbeef> Generics exist
04:13:23FromDiscord<Elegantbeef> Use them
04:13:29FromDiscord<Graveflo> I yam
04:14:27FromDiscord<Graveflo> maybe I'm missing something tho. Lets look at `echo` as it's defined in system. I can't make a generic `$` overload that echo is going to respect because it's down stream... at least I think I can't
04:16:37FromDiscord<Graveflo> ofc I could redefine echo but it's annoying to do that for everything that can bind in that way. The way that echo binds is way better then a manual overload I think
04:17:02FromDiscord<Elegantbeef> The proc should `mixin $`
04:18:02FromDiscord<Elegantbeef> I dont know the issue though
04:18:06FromDiscord<Elegantbeef> A generic should work fine here
04:18:38FromDiscord<Graveflo> my test beds are getting mega disorganized. I'm going to try it
04:27:47FromDiscord<Graveflo> oh ok. `mixin` works in this example. I'm going to have to read more to understand what exactly it's doing though. Thanks
04:45:51*def- quit (Quit: -)
04:46:38*def- joined #nim
05:30:07*ntat joined #nim
05:31:57*lucasta quit (Quit: Leaving)
06:04:47FromDiscord<Arathanis> i wish i fully grokked what mixin does
06:05:27FromDiscord<Elegantbeef> Considers the scope of both declaration and instantiation
06:05:30FromDiscord<Elegantbeef> So the callsite and the declaration
06:06:46FromDiscord<Arathanis> that kind of thing?
06:06:48FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xmZ
06:06:52FromDiscord<Arathanis> doStuff need not exist yet?
06:06:57FromDiscord<Elegantbeef> Yes
06:10:17FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xn3
06:10:20FromDiscord<Arathanis> so we can make bad jokes with it?
06:10:39FromDiscord<Elegantbeef> If you want to
06:10:52FromDiscord<Arathanis> i do
06:11:47FromDiscord<Rika> congrats'
06:11:52FromDiscord<Elegantbeef> The fun part there is that `destroyUniverse` can be different across different modules
06:12:09FromDiscord<Arathanis> maybe some people like heat death
06:12:11FromDiscord<Arathanis> others big crunch
06:12:19FromDiscord<Arathanis> it should be their choice 😤
06:13:01FromDiscord<Elegantbeef> Generally with mixin you want to dispatch based off the generic parameter but this does technically work 😄
06:13:09FromDiscord<Graveflo> sounds difficult to implement. I'd just use the old /0.0
06:18:54*aftalavera quit (Remote host closed the connection)
07:44:40FromDiscord<Graveflo> where should I go to propose a 1 liner change to the compiler for an error msg?
07:52:24FromDiscord<Rika> either an issue or just chat in #internals
07:58:43FromDiscord<Graveflo> ok thx
08:19:05*nyeaa492842301 quit (Ping timeout: 240 seconds)
08:20:04*nyeaa492842301 joined #nim
08:46:12*lumidify quit (Quit: leaving)
08:59:00*lumidify joined #nim
09:16:18NimEventerNew post on r/nim by thindil: [Nim Blog] This Month with Nim: April and May 2023, see https://reddit.com/r/nim/comments/13z6ynn/nim_blog_this_month_with_nim_april_and_may_2023/
09:43:34FromDiscord<stardustbiscuits> Is there any library that helps in downloading YouTube videos in mp3 format?
09:43:54FromDiscord<stardustbiscuits> like pytube for python?
09:48:57FromDiscord<chmod222> At that point I'd just go the road of least resistance and start a `youtube-dl` process from Nim, rather than trying to download it yourself
10:35:20ntatHi! I try use Nim logo to my tutorial which create in pdf file. I found thie → https://github.com/nim-lang/assets#readme My question is, what I need to do, when I want to use Nim logo in my (non-commercial) document? Should I add attribution, write where the logo came from, or something else?
11:19:35FromDiscord<⚶ Zeno> sent a code paste, see https://play.nim-lang.org/#ix=4xnO
11:20:37FromDiscord<⚶ Zeno> (edit) "https://play.nim-lang.org/#ix=4xnO" => "https://play.nim-lang.org/#ix=4xnP"
11:22:28FromDiscord<chmod222> I was about to say, yeah it can be done exactly like that
11:22:35FromDiscord<chmod222> If you want to do this is up to you
11:23:36FromDiscord<⚶ Zeno> yeah well i realized i wrote correct code and got embarassed lmao
11:23:53FromDiscord<⚶ Zeno> (edit) "correct" => "working"
11:24:13FromDiscord<chmod222> You don't even have to writeh `.x=`, `5.x = 2` will work too
11:25:20FromDiscord<⚶ Zeno> i see, thanks
12:04:43*xet7 quit (Ping timeout: 250 seconds)
12:25:48FromDiscord<voidwalker> is there no iterator for items in a seq but in reverse ?
12:31:34FromDiscord<chmod222> Not that I know of, but it should be easy to build
12:32:22FromDiscord<chmod222> `for i in countdown(high(s)): yield s[i]` or some such
13:46:28FromDiscord<jaar23> In reply to @4zv4l "am I the only": you're not alone, i do face the same thing and couldn't fix it until now. ↵did you managed to fix yours?
13:54:19FromDiscord<4zv4l> In reply to @jaar23 "you're not alone, i": Well I did not 😂🥲
14:01:50FromDiscord<jaar23> In reply to @4zv4l "Well I did not": aw... that's too bad
14:04:30FromDiscord<4zv4l> yeah I didn't code in Nim for some time since then↵mostly because of that issue I think 🥹
14:52:01*FromDiscord quit (Remote host closed the connection)
14:52:14*FromDiscord joined #nim
15:13:42FromDiscord<sOkam!> In reply to @4zv4l "am I the only": it started happening recently. i heard the issue will be fixed for 2.0 and doesn't happen on other versions than .12
15:14:42FromDiscord<sOkam!> it worked well in .10 and .11, and at some point it also worked in .12 but then something broke
15:14:43FromDiscord<4zv4l> I had this with other versions
15:14:53FromDiscord<4zv4l> but let's see
15:22:22FromDiscord<obi3112> can i use nim to make a telegram bot?
15:22:31FromDiscord<obi3112> and discord bot?
15:23:23FromDiscord<Rika> sure why not
15:53:58*koltrast quit (Quit: ZNC - http://znc.in)
15:54:17*koltrast joined #nim
16:10:01FromDiscord<guttural666> when I have a bunch of these, how can I check at runtime if the token has data in it, so I can store it away? https://media.discordapp.net/attachments/371759389889003532/1114586795351494727/image.png
16:15:45FromDiscord<Kai.> This lang looks very interesting so I wanna try it out
16:16:02FromDiscord<Kai.> I was told it's like python and c++ had a baby and is complied so it runs fast
16:16:12FromDiscord<Kai.> That made me grow puppy ears and get excited
16:16:28FromDiscord<Kai.> In reply to @obi3112 "and discord bot?": First project of mine, I'm gonna make a discord bot lib
16:16:31FromDiscord<Kai.> Cus why not
16:16:35FromDiscord<Kai.> I've done it in python
16:18:10FromDiscord<huantian> In reply to @Kai. "I was told it's": Yeah it does have a lot of the good stuff of both langs, as well as it’s own upsides ↵Do be noted that while it does share some syntax with python, it can have a very different coding feel
16:24:51FromDiscord<Kai.> In reply to @huantian "Yeah it does have": I understand
16:25:12FromDiscord<Kai.> I just want a compiled lang that's not gonna blow my brain out that's also low level that's also OOP
16:25:44FromDiscord<Kai.> Anyways can I make viruses with it
16:25:47FromDiscord<Kai.> Ooh it game hacks
16:25:52FromDiscord<Rika> nim is not OOP
16:25:56FromDiscord<Kai.> Wait I need dll files for it
16:26:04FromDiscord<Rika> well, it has OOP but it is rudimentary
16:26:04FromDiscord<Kai.> In reply to @Rika "nim is not OOP": I mean I don't need it
16:26:11FromDiscord<Kai.> In reply to @Rika "well, it has OOP": Good enough
16:26:23FromDiscord<Kai.> As long as there is some form of class based programming
16:26:24FromDiscord<Rika> also its generally frowned upon helping people blatanly making viruses or game hacks xd
16:26:37FromDiscord<Kai.> In reply to @Rika "also its generally frowned": It was a joke lmao
16:26:40FromDiscord<Rika> sure itwas
16:26:41FromDiscord<Rika> (edit) "itwas" => "it was"
16:26:42FromDiscord<Kai.> Could figure it out myself
16:26:44FromDiscord<Kai.> It was
16:26:46FromDiscord<Kai.> I make discord bots
16:26:49FromDiscord<Kai.> And Roblox games
16:26:49FromDiscord<Rika> of course
16:27:06FromDiscord<Kai.> The most virus I ever made was a rat in python
16:27:09FromDiscord<Kai.> Using discord ofc
16:27:22FromDiscord<Kai.> But I didn't distribute cus I'm not a newgen
16:27:28FromDiscord<Kai.> Just made it for educational purposes
16:27:35FromDiscord<Kai.> Oh I also make flask apps and web dev shit
16:27:50FromDiscord<guttural666> In reply to @Kai. "I was told it's": that sounds like a bastard son that I would send to the northern wall
16:28:06FromDiscord<Kai.> In reply to @guttural666 "that sounds like a": Lolol
16:28:10FromDiscord<Kai.> I'm tired
16:28:15FromDiscord<Kai.> I just worked for 11 hours
16:28:27FromDiscord<Kai.> I'm gonna eat then go sleep with my girlfriend
16:28:35FromDiscord<Kai.> In the non sexual way
16:30:34FromDiscord<guttural666> me personally, I prefer eating my girlfriend and then going to sleep alone 😛
16:30:51FromDiscord<that_dude> In reply to @guttural666 "when I have a": I think I would compare the value to default(token data)
16:31:14FromDiscord<guttural666> In reply to @that_dude "I think I would": don't think I catch your drift
16:31:21FromDiscord<that_dude> Either or use a flag, or make sure that certain variant cases can only exist with data
16:31:59FromDiscord<guttural666> In reply to @that_dude "Either or use a": yeah, been spamming case statements everywhere
16:32:04FromDiscord<guttural666> not too bad, but I guess it works
16:33:17FromDiscord<that_dude> Default(type) exists in nim afaik https://media.discordapp.net/attachments/371759389889003532/1114592651119964170/Screenshot_20230603_113244_Chrome.png
16:33:32FromDiscord<that_dude> So you can see if it's changed from the default init value
16:35:05FromDiscord<that_dude> Only works if the default value is known as special case not a normal valuu
16:37:16FromDiscord<guttural666> hmmm, yeah was thinking about including the token data as a ref in the token
16:38:22FromDiscord<that_dude> Well if it's a ref, then using nil should make it easy to check init
16:38:49FromDiscord<guttural666> thanks!
16:40:45FromDiscord<that_dude> May be interesting to you https://media.discordapp.net/attachments/371759389889003532/1114594530147188877/Screenshot_20230603_114020_Chrome.jpg
16:41:37FromDiscord<guttural666> I just got done replacing the whole lexer.tokenseq[Token] business with a single string, that encodes every token as a distinct char and feel like a fucking genious 😄 have all the additional data that some tokens need in a hash map[token_idx, TokenData]
16:42:07FromDiscord<guttural666> now I can regex the shit out of that token string in the parser, which is super awesome
16:43:38FromDiscord<guttural666> In reply to @that_dude "May be interesting to": so many cool stuff in Nim
16:52:38FromDiscord<Nlits (Ping on reply)> Nim is great
16:52:46FromDiscord<Nlits (Ping on reply)> I am currently hosting 2 projects
16:52:56FromDiscord<Nlits (Ping on reply)> On a free plan
16:53:09FromDiscord<Nlits (Ping on reply)> that gives you 5$ worth of resources once
16:53:30FromDiscord<Nlits (Ping on reply)> but because I am using nim, those free 5$ will last me 8-9 years
16:53:34FromDiscord<Nlits (Ping on reply)> 😄
16:54:10FromDiscord<Nlits (Ping on reply)> (edit) "On a free plan ... " added "(on a actually good hosting provider, unlike what I was using before)"
16:54:38FromDiscord<that_dude> Im also messing around with the primeagen thing and I feel kinda bad because I've practically replaced the current lexer with one thats closer to other nim Prs that follow the book better
16:55:58FromDiscord<guttural666> did you write the Nim version for the Primeagen? I read that
16:56:49FromDiscord<guttural666> watched the stream as well and got a lot of good ideas from that whole project
16:57:03FromDiscord<that_dude> Unfortunately the guy that got the firs nim pr in (and in turn became owner of the folder) doesn't have the booy yet
16:57:40FromDiscord<that_dude> Oh I didn't really watch it lol, I watched a diff YouTube vid and found it interesting
16:57:55FromDiscord<that_dude> (edit) "firs" => "first" | "booy" => "book"
16:58:05FromDiscord<guttural666> super interesting to see all the languages do it
16:59:11FromDiscord<guttural666> quick question, if I construct a Token in the lexer and then proceed to store the data of that token in the token_datastore below, will that actually just copy the reference/pointer into the store the way I declared my stuff? https://media.discordapp.net/attachments/371759389889003532/1114599170829975603/image.png
17:01:11FromDiscord<guttural666> want to just construct the data part once and then just store a pointer to it in the store
17:02:37FromDiscord<guttural666> so I try to identify and construct a token, if data is not nil, I want to pass that reference into the store
17:05:35FromDiscord<that_dude> Sorry refs are a weak point of mine
17:06:33FromDiscord<that_dude> But AFAIK it should just your making a copy of an object that holds a ref to another one so you only copy the ref
17:08:31FromDiscord<guttural666> yeah, basically just a pointer
17:09:00FromDiscord<guttural666> but I can destroy the temporary Token again, but my data will still be pointed to by the datastore
17:53:06*psydruid quit (Ping timeout: 265 seconds)
18:31:47FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xoY
18:33:38FromDiscord<chmod222> `typedesc` doesn't overload match `ref object`
18:34:03FromDiscord<Graveflo> but then it should bind to the definition in `system.nim` as the first example does no?
18:37:10FromDiscord<chmod222> that's true, although the `system.is` is compiler magic
18:40:57FromDiscord<guttural666> the amount of {.magic.} sprinkled into Nim is amazing, feel like fucking Harry Potter
18:41:23FromDiscord<Graveflo> I feel like a muggle
18:41:33FromDiscord<Arathanis> trying to get some python `is` action?
18:42:03FromDiscord<guttural666> In reply to @Graveflo "I feel like a": xDDDDD
18:42:08FromDiscord<Rika> echo nim is_not python
18:42:30FromDiscord<Graveflo> yea that was the idea, but now that I think about it I'm not 100% keen on how python defines that behavior in nims context. Maybe I should just make something like a congruence operator for when I want auto deference and stuff
18:42:47FromDiscord<chmod222> You can probably build a macro that converts python AST into nim A ST
18:43:00FromDiscord<Graveflo> LOL that sounds like a good idea
18:44:57FromDiscord<Graveflo> I still think that comparing a pointers dumb value is a bit too ASM for me. The way `==` is defined makes it unsuitable for overloading also. Do people overload `==` when they want high level comparisons or is there a better standard way to do that?
18:46:05FromDiscord<guttural666> https://media.discordapp.net/attachments/371759389889003532/1114626073100042280/image.png
18:49:02FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xp2
18:49:02FromDiscord<Graveflo> wait nim breaks it's own conventions because this is true: `echo @[1,2,3,4] == @[1,2,3,4]`
18:49:39NimEventerNew post on r/nim by Sebwazhere: Nim not working in VS Code, see https://reddit.com/r/nim/comments/13zlqcn/nim_not_working_in_vs_code/
18:56:41FromDiscord<chmod222> Well no
18:56:52FromDiscord<chmod222> The convention is structural equality
18:57:26FromDiscord<chmod222> Same with `string == string`
18:57:55FromDiscord<Graveflo> That would make the most sense but `==` compares a ref objects pointer value by defaults not the structure of the object being referenced.
18:58:07FromDiscord<Rika> In reply to @Graveflo "wait nim breaks it's": it does not because sequences are explicitly defined to follow value semantics
18:58:15FromDiscord<Rika> same with strings
18:58:56FromDiscord<Graveflo> It's not good if a basic operator means this or that depending on which way the wind is blowing
18:59:06FromDiscord<Arathanis> `ref` types follow value semantics too, the value of the reference 😎
18:59:16FromDiscord<Graveflo> ok dude LOL
18:59:21FromDiscord<Rika> In reply to @Arathanis "`ref` types follow value": i would say this is the best correct honestly
18:59:25FromDiscord<Rika> (edit) "In reply to @Arathanis "`ref` types follow value": i would say this is the best ... correct" added "kind of"
18:59:29FromDiscord<chmod222> It's a valid argument though
19:00:07FromDiscord<Graveflo> It's not because `string` and `seq` are refs too
19:00:23FromDiscord<chmod222> Not semantically
19:00:35FromDiscord<Graveflo> but they are the perfect example of why that mentality isn't necessarily the best choice for `==`
19:00:41FromDiscord<Rika> you could consider them as an implementation detail
19:00:49FromDiscord<Rika> whereas reference types are explicitly called refs
19:01:04FromDiscord<Rika> seqs and strings are just implemented as such but are technically not required to be
19:02:58FromDiscord<Graveflo> I get that but it seems like in order to accept this you have to rely on high levels of abstraction to justify `seq` and `string` while also being allergic to that way of thinking for `ref object`. It's just inconsistent
19:04:15FromDiscord<Arathanis> i dont think its inconsistent
19:04:51FromDiscord<Arathanis> its no more inconsistent than `int` and `str` in python being references to objects (since everything in python is an object) but being semantically immutable
19:05:57FromDiscord<Graveflo> I don't see what immutability has to do with it
19:06:24FromDiscord<Arathanis> well you are saying "because string and seq are references" this is inconsistent behavior
19:06:44FromDiscord<Arathanis> but they are only refs under the hood, semantically in the language they are value types.
19:07:40FromDiscord<Arathanis> in Python everything is technically a dictionary but they don't expose all the same methods/features of a dict cause its an implementation detail
19:08:42FromDiscord<Arathanis> we are just trying to point out that the fact that strings and seqs are technically references isn't really an argument for inconsistency cause you are comparing the runtime semantics of `==` to the implementation details of the types
19:08:57*oldpcuser_ joined #nim
19:09:18*oldpcuser quit (Killed (NickServ (GHOST command used by oldpcuser_)))
19:09:24*oldpcuser_ is now known as oldpcuser
19:13:36FromDiscord<Graveflo> sent a long message, see http://ix.io/4xpd
19:14:25FromDiscord<Arathanis> i think when they say "structural equivalence" they mean "value equivalence"
19:14:46FromDiscord<Graveflo> oh I might be confusing that term then
19:15:36FromDiscord<Arathanis> `==` always compares "by value"
19:15:59FromDiscord<Arathanis> the value of a `ref T` is a memory address
19:16:28FromDiscord<Graveflo> but it's overloaded often to not do that
19:16:51FromDiscord<Arathanis> im not aware of any times where it behaves that way, not that i dont believe you. im just not aware of them
19:22:03FromDiscord<Graveflo> well that's why I brought up `seq` and `string`. I know that we can always just say it's an implementation detail, but it wouldn't have to be excused that way if `==` was thought of as a high level operator when used on objects... which it kinda is when used that way. I'm sure this implementation details was chosen because it's much more natural.
19:22:58FromDiscord<Arathanis> well its specifically because they dont behave that way in the language because they are semantically value types
19:23:22FromDiscord<Arathanis> you are right that under the hood, at the machine code level
19:23:24FromDiscord<Arathanis> they are pointers
19:23:37FromDiscord<Arathanis> but when you are using the language they behave like values, and that keeps `==` consisteent
19:23:38FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/1114635523164741794/image.png
19:24:45FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/1114635804296347759/image.png
19:25:02FromDiscord<Graveflo> oh so this is an argument around copy semantics?
19:25:26*oldpcuser quit (Remote host closed the connection)
19:25:32FromDiscord<Arathanis> well the copy semantics behave this way because they are treated as value types
19:25:43FromDiscord<Graveflo> okay well that helps actually thanks
19:25:54FromDiscord<Arathanis> in Nim, the goal is anything that is not explicitly "ref" or "ptr" functions as a value type semantically.
19:25:54*oldpcuser joined #nim
19:26:11FromDiscord<Arathanis> for sure dude
19:26:16FromDiscord<Arathanis> i love these kinds of conversations
19:27:06FromDiscord<Arathanis> (edit) "dude" => "my friend"
19:30:26FromDiscord<Graveflo> ok one more question. In my mind this would mean that making `==` a high level operator on an object inappropriate unless that model that value behavior. Does that make sense?
19:30:39FromDiscord<Graveflo> (edit) "that" => "they"
19:31:12FromDiscord<Graveflo> (edit) "ok one more question. In my mind this would mean that making `==` a high level operator on an object inappropriate unless ... that" added "they model" | removed "model they"
19:35:11FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xpk
19:35:25FromDiscord<Arathanis> (edit) "https://play.nim-lang.org/#ix=4xpk" => "https://play.nim-lang.org/#ix=4xpl"
19:35:39FromDiscord<Arathanis> (edit) "https://play.nim-lang.org/#ix=4xpl" => "https://play.nim-lang.org/#ix=4xpm"
19:35:44FromDiscord<Arathanis> (edit) "https://play.nim-lang.org/#ix=4xpm" => "https://play.nim-lang.org/#ix=4xpn"
19:39:33FromDiscord<Arathanis> and that doing anything else would be undesirble even though its technically allowed?
19:39:51FromDiscord<Graveflo> does it not do that already? Yea that but also if I wanted to make a "logically equivalent" operator I should never use `==` for this unless the value semantics of the object match `==` behavior. Basically I'm getting that if I want a "logically equivalent" operator convention I should just make my own
19:40:12FromDiscord<Arathanis> In reply to @Graveflo "does it not do": it does do it automatically, yes
19:40:28FromDiscord<Arathanis> what is "logically" equivalent in this case?
19:40:59FromDiscord<Graveflo> lets say that a person is considered logically the same if they have the same name but their age doesn't matter. It's a bad example but you get the idea
19:40:59FromDiscord<Arathanis> like if maybe you dont care about the value of age, you only think the name should be equivalent to be equal?
19:41:10FromDiscord<Arathanis> great minds think of the same examples 🙏
19:42:31FromDiscord<Arathanis> that i do not know, someone like Beef or Rika more steeped in the language and its community could probably answer the feelings on that better than I could. My but reaction is `==` should always do structural/value equiality, and if you want to make your own impl that specifically ignores certain fields in the comparison that is fine as long as you document it.
19:42:47FromDiscord<Arathanis> documented especially if its a public part of the api
19:43:02FromDiscord<Arathanis> probably still documented for internal developers though 😉
19:44:37FromDiscord<Graveflo> for me I'm going to make the operator by default just de-reference pointers and refs, but beyond that it makes more sense for the odd cases where fields are ignored to overload that custom operator instead of `==` that was the goal it hashing this out. Thanks for the help
19:44:58FromDiscord<Arathanis> np
19:45:03FromDiscord<Arathanis> good luck with your project
19:58:30*ntat quit (Quit: Leaving)
20:28:35*oldpcuser quit (Quit: Eu uso Vum - Vi Useless not iMproved Text Editor! =D)
20:32:35*oldpcuser joined #nim
20:35:42FromDiscord<chmod222> Weird question but is there a maximum length for type names?
20:36:06FromDiscord<chmod222> Oh wait, I just noticed the problem is something else
20:36:11FromDiscord<chmod222> Disregard that
21:28:38FromDiscord<guttural666> god I love when one indentation error breaks your whole program and sends you on a wild echo debugging session that takes two hours 🥰
21:31:34FromDiscord<chmod222> Weirdly enough I never had this happen in two decades of programming
21:31:35*psydruid joined #nim
21:32:15FromDiscord<chmod222> That's why I could never take "omg significant whitespace so bad" pundits seriously
21:32:31FromDiscord<Elegantbeef> @Graveflo\: since you're defining your own rules you can do `~=` or `^==` or anything else
21:32:41FromDiscord<Arathanis> In reply to @chmod222 "That's why I could": its never bothered me either
21:32:53FromDiscord<Arathanis> ive never had it shoot me in the foot
21:33:18FromDiscord<Elegantbeef> `==` should always do pointer comparisons imo on pointer types
21:33:59*oldpcuser_ joined #nim
21:34:31FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xpN
21:35:02FromDiscord<Arathanis> i think its for safety and to make it easier to reason about programs
21:35:17FromDiscord<Arathanis> you can't mutate them unless they are explicitly ref or proc parameters are "var"
21:35:24FromDiscord<Elegantbeef> They're value types
21:35:26FromDiscord<Arathanis> its to help you reason about the code
21:35:32FromDiscord<Elegantbeef> The reason they're implemented that way is that they're value types
21:35:37*oldpcuser quit (Ping timeout: 240 seconds)
21:35:40FromDiscord<Arathanis> that is always the impression i got from making everything a value type unless its specifically "ref" or "ptr"
21:36:17FromDiscord<guttural666> In reply to @chmod222 "Weirdly enough I never": refactoring rn and one return statement that I really needed ended up with an incorrect indentation
21:36:22FromDiscord<Elegantbeef> Just cause something has heap memory underneath it does not mean it's not a value type 😛
21:36:32FromDiscord<Elegantbeef> Consider Nim's `Table` vs. `TableRef`
21:37:10FromDiscord<Graveflo> oh god does `TableRef` duplicate all over too?
21:37:12FromDiscord<guttural666> In reply to @Arathanis "ive never had it": it'll never happen if you have bracket delimited blocks of code
21:37:28FromDiscord<Elegantbeef> `TableRef` is a reference
21:37:32FromDiscord<Elegantbeef> `Table` is a value type
21:37:42FromDiscord<Elegantbeef> Exactly what you expect
21:37:44FromDiscord<Arathanis> In reply to @guttural666 "it'll never happen if": but then my code has to be a nonsense mess of uncessary characters
21:37:46FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/zPmhm
21:37:48FromDiscord<Graveflo> oh right so `Table` is the hidden pointer value type
21:37:50FromDiscord<chmod222> I think I spent quite some time chasing down why some bracket was missing despite it all looking good
21:37:50FromDiscord<Arathanis> (edit) "uncessary" => "unnecessary"
21:37:57FromDiscord<Elegantbeef> "hidden pointer"
21:38:01FromDiscord<Elegantbeef> No it's a value type
21:38:15FromDiscord<Elegantbeef> It's a pointless distinction
21:38:21FromDiscord<Graveflo> ok heap allocated value type?
21:38:31FromDiscord<Elegantbeef> Nope
21:38:31FromDiscord<Elegantbeef> It's stack allocated
21:38:39FromDiscord<Elegantbeef> It just has data that is heap allocated
21:38:49FromDiscord<Graveflo> right right ok. Heap dependent value type?
21:38:53FromDiscord<Elegantbeef> 😄
21:38:59FromDiscord<Elegantbeef> Right
21:39:11FromDiscord<Elegantbeef> It's dynamically sized value type I'd call it
21:39:26FromDiscord<chmod222> Heap allocated with extra steps
21:39:39FromDiscord<Elegantbeef> I mean you can dynamically size stack types
21:39:49FromDiscord<Elegantbeef> `alloca` incomming
21:39:52FromDiscord<Arathanis> its stack allocated
21:39:53FromDiscord<guttural666> In reply to @Arathanis "but then my code": no, you copy block a to b, to some normal refactoring stuff add some ifs and boom one line has the wrong indendation, very easy to do
21:40:00FromDiscord<Arathanis> sometimes you just need to "heap" on some more memory 😉
21:40:08FromDiscord<chmod222> alloca sounds like a great indea up until the point it's no longer a great idea
21:40:25FromDiscord<Arathanis> In reply to @guttural666 "no, you copy block": maybe my experience has kept me from making this mistake. I am always hyper indentation aware
21:40:36FromDiscord<Arathanis> never had this issue even when copy-pasting
21:41:25FromDiscord<guttural666> In reply to @Arathanis "maybe my experience has": maybe when vimming like a gigachad this may happen, hitting the u and you don't realize
21:41:52FromDiscord<Arathanis> perhaps, im sure ill foot gun myself with it in the future
21:42:12FromDiscord<Arathanis> i prefer python and nim's style of white space significance freeing me from character noise
21:42:16FromDiscord<Arathanis> but i dont hate brackets
21:42:26FromDiscord<Arathanis> i like and use plently of languages that follow that style
21:42:32FromDiscord<Arathanis> (edit) "plently" => "plenty"
21:42:39FromDiscord<chmod222> They are a bitch to type on german language keyboards, but I got used to it after all those years
21:42:49FromDiscord<Elegantbeef> Indentation lines + indention rainbows = same as `{}`
21:42:57FromDiscord<Arathanis> In reply to @Elegantbeef "Indentation lines + indention": true
21:43:02FromDiscord<guttural666> I love no brackets as well since I'm a kraut and use a quertz keyboard, but brackets do have their advantages
21:43:22FromDiscord<Elegantbeef> Yea brackets have one advantage making a parser easier to write
21:43:27FromDiscord<Elegantbeef> That's pretty much it 😛
21:43:57FromDiscord<chmod222> Proposal to switch Nim to a `begin` and `end` syntax based language
21:44:05FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xpQ
21:44:23FromDiscord<Arathanis> In reply to @Elegantbeef "Yea brackets have one": pmuch my opinion
21:44:34FromDiscord<guttural666> brackets feel like acrobatically fingering somebody on a German layout
21:44:34FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/FIzkJ
21:45:18FromDiscord<Arathanis> brackets feel like using an extra character for no reason when any reasonable coding style guide might as well have significant whitespace so why I am cluttering my code with extra characters and my hands with superfluous keystrokes?
21:45:33FromDiscord<Elegantbeef> Honestly that style is nice
21:45:34FromDiscord<chmod222> sent a code paste, see https://play.nim-lang.org/#ix=4xpS
21:45:38FromDiscord<Elegantbeef> Clearly indent everything
21:45:41FromDiscord<chmod222> sent a code paste, see https://paste.rs/jYwb6
21:45:47FromDiscord<Elegantbeef> Since `{}` are important
21:45:48FromDiscord<chmod222> sent a code paste, see https://paste.rs/gx45l
21:46:46FromDiscord<chmod222> It's too noisy for me, I can barely deal with putting every brace on a new line
21:48:16FromDiscord<Graveflo> I approach a situation like this by thinking "I i remove all unnecessary white space how easy is it to read" vs "If I remove all unnecessary } or ; or w/e how easy is it to read". Often you use the whitespace primarily even if the other characters are there
21:49:34FromDiscord<Elegantbeef> Anyone's code that would not compile inside a whitespace significant language needs to stop writing code
21:50:16FromDiscord<Graveflo> yep and luckily most programmers actually do give a damn about that formatting... but they still see the need to have the litter too
21:51:27FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xpV
21:51:40FromDiscord<Elegantbeef> If only that wasnt so hard to type out
21:51:42FromDiscord<Arathanis> In reply to @Elegantbeef "Anyone's code that would": saying what we are all thinking
21:51:45FromDiscord<Elegantbeef> Cause it makes the code so much more expressive
21:51:51FromDiscord<Arathanis> In reply to @Elegantbeef "If only that wasnt": it does
21:51:56FromDiscord<Arathanis> (edit) "does" => "did take me a long while"
21:52:00FromDiscord<Arathanis> In reply to @Elegantbeef "Cause it makes the": it absolutely does
21:52:09FromDiscord<Arathanis> no character noise to make my eyes slide off the logic
21:56:42*oldpcuser_ quit (Ping timeout: 265 seconds)
21:58:00FromDiscord<chmod222> That's what the dynamic tabstops in MS Word are perfect for
21:58:05FromDiscord<chmod222> So MS Word is the best IDE?
21:58:13FromDiscord<Elegantbeef> No it's made by MS
21:58:40FromDiscord<Arathanis> MS stands for Masterful Software
21:59:52FromDiscord<Recruit_main707> Im afraid not even the best MS IDE https://media.discordapp.net/attachments/371759389889003532/1114674843372224572/image.png
22:01:04FromDiscord<chmod222> Okay back to a Nim related question
22:01:05FromDiscord<chmod222> If I have a macro that receives the type `T`, can it determine which module `T` was declared in?
22:01:07FromDiscord<chmod222> In order to call a function defined in that module
22:01:46FromDiscord<chmod222> Or will I have to rely on ol' reliable `func myStatic(typedesc[T])`?
22:05:36FromDiscord<Elegantbeef> `T.owner`
22:10:53FromDiscord<Elegantbeef> I do think the generic procedure approach makes more sense though 😄
22:11:39FromDiscord<chmod222> I use it quite a bit in my project but I'm never sure if it is a good idea or a hack to get around "proper" module design
22:12:00FromDiscord<chmod222> Then again, it never failed me
22:27:13FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xq5
22:43:56FromDiscord<Graveflo> oh ok "checkpoint" does this nvm. Idk how I read a page and miss stuff like that every time
23:02:33*Onionhammer quit (Ping timeout: 256 seconds)
23:07:22*Onionhammer joined #nim
23:21:43*pbsds quit (Quit: The Lounge - https://thelounge.chat)
23:23:48*pbsds joined #nim
23:48:29*oldpcuser joined #nim
23:51:12FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4xqh