<< 30-03-2023 >>

00:13:58FromDiscord<treeform> In reply to @System64 "Seems it works And": The normal Nim types are supported and tested.
01:14:01*nanxiao joined #nim
01:32:00*beholders_eye quit (Ping timeout: 260 seconds)
02:10:59FromDiscord<Johnathanbtc> I'll help anyone interested in how to earn $30k within 3 days and hours but you will reimburse me 10% of your dividend when you collect it. Note: only interested people should involve send a friend request or Whatapp +1 (651) 899-4465 immediately.
03:24:21FromDiscord<gogolxdong> https://github.com/hpcaitech/ColossalAI
03:28:25FromDiscord<gogolxdong> Anyone has interest in writing this in Nim?
03:39:42*nanxiao quit (Quit: Client closed)
03:54:38*arkurious quit (Quit: Leaving)
03:56:52*nanxiao joined #nim
04:02:00*m5zs7k quit (Ping timeout: 250 seconds)
04:03:10FromDiscord<Gumbercules> In reply to @gogolxdong "Anyone has interest in": Seems like a LOT of work
04:03:48*m5zs7k joined #nim
04:05:57FromDiscord<Dudugz> Seema boring >.>
04:06:46FromDiscord<Gumbercules> To each their own 😄
04:07:43FromDiscord<Gumbercules> I'm not personally loving the ubiquity of the AI talk, but whatcha gonna do?
04:25:38*nanxiao quit (Quit: Client closed)
04:57:26*ltriant quit (Ping timeout: 265 seconds)
05:02:56*nanxiao joined #nim
05:49:04FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "The normal Nim types": Oh alright, thanks↵In any cases I discovered an undocumented feature (Serializing OOP objects)
06:15:02*advesperacit joined #nim
06:19:06*rockcavera quit (Remote host closed the connection)
06:26:19*derpydoo quit (Ping timeout: 276 seconds)
06:31:18*nanxiao quit (Quit: Client closed)
06:44:29*PMunch joined #nim
06:45:56*beholders_eye joined #nim
06:52:18*nanxiao joined #nim
07:01:27FromDiscord<ricky> In reply to @gogolxdong "Anyone has interest in": for the right price ofc
07:02:04FromDiscord<ricky> otherwise i'm too busy using Nim to disrupt markets 😎
07:15:06FromDiscord<gogolxdong> https://twitter.com/ilblackdragon/status/1641205924973928450?s=19
07:26:31*jjido joined #nim
07:38:14FromDiscord<Phil> I'd claim that one's offtopic
07:47:33PMunchWe've never been very strict about what goes in offtopic and what goes here. As long as it's not disrupting on-topic conversation then it's fine to post it here
07:49:03FromDiscord<Phil> Alrighty, I'll try to keep that in mind going forward!
07:49:18Amun-Rathat's a good approach tbh
08:11:04PMunchIt's just the way the channels naturally evolved. In the olden days we only had #nim, then we became enough people that there where multiple chats going at the same time, so it was decided that #nim-offtopic should be created to offload the channel. But since not everyone knew the channel was created (remember this is all on IRC so there was no easy way to see that the offtopic channel existed) the rollout was slow. Sometimes the conversations swung back and
08:11:04PMunchforth so much that the offtopic channel was more on topic than the regular channel :P
08:15:53*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
08:20:51FromDiscord<Rika> It still happens now
08:22:15PMunchTrue
08:24:18*cnx quit (Remote host closed the connection)
08:25:05*cnx joined #nim
08:44:25PMunchMan GitHub search is so incredibly bad.. https://uploads.peterme.net/goofygithub.png
08:55:14*jjido joined #nim
09:04:54*beholders_eye quit (Ping timeout: 265 seconds)
09:07:51*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
09:24:36*jjido joined #nim
09:37:33FromDiscord<System64 ~ Flandre Scarlet> https://nimble.directory/pkg/ooputils↵So Nim is merging with Java?
09:45:02*nanxiao quit (Quit: Client closed)
09:46:12*onetwo382 joined #nim
09:47:55*onetwo38 quit (Ping timeout: 265 seconds)
09:47:55*onetwo382 is now known as onetwo38
09:50:04FromDiscord<Phil> I'm not seeing people wanting to make everything a ref object
09:50:06FromDiscord<Phil> We're safe
09:50:36FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "I'm not seeing people": Bad practice?
09:51:30FromDiscord<Phil> Like is it bad practice to use ref objects in nim?↵Or is that a question whether ref objects are bad practice in general?
09:53:26FromDiscord<System64 ~ Flandre Scarlet> in Nim
09:54:16*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
09:55:07FromDiscord<amadan> Mean there are cases were ref objects are needed e.g. when you need ref semantics↵So wouldn't consider them bad practice in general
09:56:58FromDiscord<Phil> In reply to @System64 "in Nim": If you can avoid them, do it.↵As amadan stated they're not a bad practice in general, but they have less guarantees unless you want to start working around them.↵let obj: Mytype when MyType is a ref type for example does not guarantee you immutability of the data, only that the pointer assigned to this variable won't change.↵Which I can't say I'd care about, I'd want data immutability
10:06:36FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "If you can avoid": I use them a lot for my game, where I use inheritence
10:11:09*xet7 quit (Quit: Leaving)
10:13:05FromDiscord<Phil> sent a code paste, see https://paste.rs/Jd0
10:16:21FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "As stated, sometimes they": Oh alright↵https://github.com/system64MC/tfe/tree/master/src↵And does it make sense to use them for actors here? (if you mind the title, it means "Travail de Fin d'Etudes", or Final School Work in english)
10:17:22*jjido joined #nim
10:18:40FromDiscord<System64 ~ Flandre Scarlet> I use inheritence, so maybe I goes the wrong way?
10:18:51*Notxor joined #nim
10:19:01FromDiscord<System64 ~ Flandre Scarlet> (edit) "goes" => "go"
10:21:24*Notxor quit (Client Quit)
10:21:44*Notxor joined #nim
10:27:18*ltriant joined #nim
10:30:55*guest_ joined #nim
10:31:50*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
10:33:18*fredrik92 joined #nim
10:36:59*fredrikhr92 quit (Ping timeout: 248 seconds)
10:37:58*guest_ quit (Ping timeout: 268 seconds)
10:40:12*onetwo38 is now known as onetwo
10:43:06*nanxiao joined #nim
10:47:55*nanxiao quit (Client Quit)
10:48:46*jjido joined #nim
10:58:49*fredrikhr92 joined #nim
11:00:22*fredrikhr joined #nim
11:02:34*fredrik92 quit (Ping timeout: 276 seconds)
11:03:19*fredrikhr92 quit (Ping timeout: 252 seconds)
11:04:06FromDiscord<guttural666> can I force the i here to be of type int32 somehow? for i, item in items
11:06:52FromDiscord<System64 ~ Flandre Scarlet> In reply to @guttural666 "can I force the": wdym? you want to cast?
11:07:05FromDiscord<guttural666> In reply to @System64 "wdym? you want to": yes
11:07:15FromDiscord<Rika> let i = i.int32
11:07:17FromDiscord<Rika> In the loop
11:07:23FromDiscord<System64 ~ Flandre Scarlet> if yes, it is something like↵myVar.int32
11:07:29FromDiscord<System64 ~ Flandre Scarlet> it casts myVar to int32
11:07:32FromDiscord<Rika> This is not called casting in Nim
11:07:43FromDiscord<Rika> This is called conversion
11:07:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "This is not called": Oh↵What's the difference?
11:08:03FromDiscord<Rika> Casting is reinterpreting raw bytes into another type
11:08:14FromDiscord<System64 ~ Flandre Scarlet> so it's dangerous, no?
11:08:21FromDiscord<Rika> Sure
11:08:47FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "Sure": Casting a float into a int
11:09:53FromDiscord<Rika> Yes
11:11:43FromDiscord<System64 ~ Flandre Scarlet> sent a long message, see http://ix.io/4sdC
11:12:58PMunchhttps://play.nim-lang.org/#ix=4sdD
11:13:12*derpydoo joined #nim
11:13:14PMunchThat's the difference between conversion and casting
11:14:00FromDiscord<System64 ~ Flandre Scarlet> and C has the same behavior?
11:14:23PMunchNot sure if C has conversions like Nim does
11:14:37PMunchOr if it's all casting
11:18:59FromDiscord<System64 ~ Flandre Scarlet> https://onlinegdb.com/eo3I-DgbV
11:19:20FromDiscord<System64 ~ Flandre Scarlet> It doesn't act sussy https://media.discordapp.net/attachments/371759389889003532/1090958433865433108/image.png
11:19:43FromDiscord<Rika> C only has conversion iirc
11:19:52FromDiscord<Rika> well, technically
11:19:56FromDiscord<Andreas> Why is it not possible to cast to a `seq`? https://play.nim-lang.org/#ix=4sdH
11:20:01FromDiscord<Rika> with everything C ofc theres a fucktonne of nuances
11:20:31FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "C only has conversion": I saw a video explaining casting in C is unsafe
11:21:14FromDiscord<Rika> In reply to @Andreas "Why is it not": its not safe to cast to reference based types because of GC things
11:21:20FromDiscord<Rika> you'll confuse the GC
11:21:29PMunch@Andreas, because you're trying to cast a pointer to a sequence to a sequence..
11:21:38FromDiscord<Rika> oh that too is what happened ig
11:21:47FromDiscord<Rika> didnt realise mb lo
11:21:49PMunchIt will try to read that pointer as the actual sequence, which probably means that the length is some arbitrary number
11:22:08FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "its not safe to": and can conversion work?
11:22:46FromDiscord<Rika> nim doesnt handle that case iirc
11:24:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @Andreas "Why is it not": Wow you are doing suspicious stuff right there!
11:24:34FromDiscord<Phil> In reply to @System64 "Oh alright https://github.com/system64MC/tfe/tree/m": I'm at work, I don't have the mental capacity to go that deep into architecture when I should be coding a frontend and reworking some components 😛
11:24:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "I'm at work, I": Ah alright, sorry then
11:25:25FromDiscord<System64 ~ Flandre Scarlet> In reply to @System64 "Wow you are doing": like↵That doesn't even make sense to cast a pointer to a sequence to a sequence↵Just... What??
11:25:48FromDiscord<Rika> its a sensible mistake i would say
11:26:25FromDiscord<System64 ~ Flandre Scarlet> reference != pointer, right?
11:26:53FromDiscord<Rika> of course
11:27:00FromDiscord<Rika> yes it is
11:27:07FromDiscord<System64 ~ Flandre Scarlet> it is a pointer?
11:27:21FromDiscord<Rika> no, your statement is correct is my intention
11:27:27FromDiscord<System64 ~ Flandre Scarlet> Oh alright
11:27:42FromDiscord<System64 ~ Flandre Scarlet> I don't really understand the difference
11:28:00FromDiscord<Rika> references are pointers but are tracked by the GC
11:28:05FromDiscord<Andreas> @PMunch @Rika so this works.. https://play.nim-lang.org/#ix=4sdJ
11:28:07FromDiscord<Rika> or the AMM system at least
11:28:21FromDiscord<System64 ~ Flandre Scarlet> and are pointers safe to use in Nim?
11:28:31FromDiscord<Rika> safe in what way
11:28:46FromDiscord<System64 ~ Flandre Scarlet> not as dangerous as C
11:28:58FromDiscord<guttural666> if you know what you're doing anything is safe 😛
11:28:59FromDiscord<Rika> In reply to @Andreas "<@392962235737047041> <@259277943275126785> so this": i mean, `cast[seq[int]](s1)` "works, but also doesnt actually do anything"
11:29:13FromDiscord<Rika> In reply to @System64 "not as dangerous as": as in what way?
11:29:17FromDiscord<Rika> they both leak just as easily
11:29:39FromDiscord<System64 ~ Flandre Scarlet> So in Nim you also need to manually free pointers?
11:29:41PMunch@Andreas, you don't need the ptr/addr/[] stuff for s3
11:29:49FromDiscord<Rika> maybe C has a lot more nuances to track but in terms of "do i need to free the things myself" theyre both as unsafe
11:30:12FromDiscord<Rika> automatically freeing memory is the point of references over pointers
11:30:24FromDiscord<Rika> well, the main point i guess? not sure if any others exist
11:30:52PMunchIf you grab a pointer to some memory which Nim managed you should not free it (and you have to make sure Nim doesn't free it either as long as you want your pointer to be valid)
11:31:06PMunchIf you manually allocate memory you also need to manually free it
11:31:31PMunchThis also applies if you interface with a C library which manually allocates memory for you
11:31:44FromDiscord<Andreas> i have a C-API in-between, that i feed a with a `pointer` and will return a `pointer`
11:31:46PMunchOf course in that case you can also write a destructor to do the job for you automatically
11:32:28PMunch@Andreas, then you need to read the C-API documentation to see what it expects you to do
11:33:36FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "If you grab a": Oh alright↵But I still use pointers only when I really need them, when interop with a C library for example, but they usually provide abstractions for freeing memory
11:34:23FromDiscord<Andreas> In reply to @PMunch "<@754284517316886598>, then you need": the API promises to return excatly the pointer i passed in before, once its done with it, so i can dispose/destroy..
11:35:26PMunchRight, in that case you should be safe to use Nim managed memory, grab a pointer to that, and then just use the object which pointer you passed in as you normally would
11:36:09PMunch(Of course assuming that the object doesn't contain pointers to other things that the library initializes and you need to free)
11:36:54FromDiscord<System64 ~ Flandre Scarlet> https://github.com/megamarc/Tilengine↵I wonder how it would look like if I rewrite this to Nim
11:38:09FromDiscord<Andreas> In reply to @System64 "https://github.com/megamarc/Tilengine I wonder how": it will look better..
11:38:20PMunchA bit like Nico I would assume
11:39:02PMunchAlternatively like this: https://sr.ht/~exelotl/nim-tilengine/
11:39:52FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Alternatively like this: https://sr.ht/~exelotl/nim": I also made my own bindings before discovering this exists
11:40:13PMunchYeah you wrapped it with Futhark didn't you?
11:41:10*Notxor quit (Quit: Leaving)
11:41:11FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Yeah you wrapped it": Yes I did
11:45:01FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Yeah you wrapped it": This is my bindings https://media.discordapp.net/attachments/371759389889003532/1090964894293164062/Tilengine.zip
11:45:36FromDiscord<System64 ~ Flandre Scarlet> No idea if mine is cleaner or if Exelotl is better
11:45:42FromDiscord<System64 ~ Flandre Scarlet> (edit) "Exelotl" => "Exelotl's one"
11:54:15*beholders_eye joined #nim
11:56:36*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
11:57:04FromDiscord<System64 ~ Flandre Scarlet> The nice thing I did is I added some abstractions for the bitmap, colors etc
11:59:27FromDiscord<System64 ~ Flandre Scarlet> But I can still adapt to Exelotl's bindings
12:27:45*Notxor joined #nim
12:43:32*jjido joined #nim
13:13:42FromDiscord<kcvinker> Is it possible to use `varargs[auto]` ?
13:14:20PMunchAnd get what?
13:14:36PMunchI think it would be possible, but they would all have to be the same type
13:17:19FromDiscord<kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4se5
13:17:19*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
13:19:05FromDiscord<kcvinker> So that I can use `cmb.addItems(100, 250.45, "Some text")`
13:19:36PMunchAh, no that would not be possible
13:19:50PMunchWell, not without some extra finagling
13:21:18PMunchThis might be possible though: https://play.nim-lang.org/#ix=4se8
13:22:35PMunchYes, that is indeed valid: https://play.nim-lang.org/#ix=4sea
13:22:45PMunch@kcvinker ^
13:24:47FromDiscord<jtv> Well, you can make your own box type, and then add converters to automatically box.
13:26:13*derpydoo quit (Ping timeout: 276 seconds)
13:27:59PMunchThat is the finagling I was talking about earlier :P
13:43:08FromDiscord<System64 ~ Flandre Scarlet> PMunch, should I use my bindings or Exelotl bindings for Tilengine?
13:49:23FromDiscord<ricky> In reply to @Rika "Casting is reinterpreting raw": types are just a bloated abstraction over bit patterns anyway
13:55:58PMunch@System64_~_Flandre_Scarlet, how would I know? I've tried neither of them
13:56:13FromDiscord<System64 ~ Flandre Scarlet> Ah alright, sorry
13:56:57FromDiscord<Rika> In reply to @Rictus "types are just a": lol
13:56:57FromDiscord<kcvinker> @PMunch Thank you. 🙂 This (`varargs[string, `$`]` seems interesting.
13:57:02PMunchThe Futharked bindings have the benefit of being more or less guaranteed to be correct and complete. Exelotls bindings have the benefit of being Nim tailored and probably more "royale"
13:57:53PMunch@kcvinker, yeah, it's basically "give me varargs of string, and use `$` if the argument isn't a string to convert it into one"
13:58:13PMunchSo if you want to do the boxed type thing we talked about earlier then you can do that with your own converter
13:58:16FromDiscord<kcvinker> In reply to @PMunch "<@633714482572689449>, yeah, it's basically": That's brilliant
13:59:06FromDiscord<kcvinker> In reply to @PMunch "So if you want": Is there any examples of it ?
13:59:39PMunchDunno
13:59:55PMunchHmm, I tried with `pointer, addr` and it didn't seem to like that much..
14:00:26FromDiscord<pmunch> Might be because addr returns a specific pointer..
14:01:38FromDiscord<kcvinker> In reply to @PMunch "Hmm, I tried with": No probs
14:02:10PMunchHmm, actually not sure what's going on here: https://play.nim-lang.org/#ix=4sem
14:02:15PMunchI would've expected that to work
14:02:52FromDiscord<System64 ~ Flandre Scarlet> Btw is there some Nimble packages for data structures such as lists, trees, graphs and so on?↵Most known data structures
14:06:29FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "The Futharked bindings have": Ah alright, btw, what is the license for Exelotls' bindings?
14:06:32FromDiscord<sOkam!> sounds like a handy package if there is one
14:06:45PMunch@System64_~_Flandre_Scarlet, no idea, ask them
14:06:49PMunchOr check the repo I guess
14:07:09PMunchDon't know of a package which contains all of them, but there are a couple in the stdlib
14:07:13*PMunch quit (Quit: Leaving)
14:07:13FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4seq
14:07:22FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Don't know of a": Which ones?
14:13:46FromDiscord<System64 ~ Flandre Scarlet> Oh, there is some libs for data structures https://media.discordapp.net/attachments/371759389889003532/1091002333460172851/image.png
14:20:56FromDiscord<kcvinker> In reply to @PMunch "Hmm, actually not sure": So the `toAddr` functions is not get called
14:22:48FromDiscord<Yardanico> In reply to @PMunch "Hmm, actually not sure": isn't it because you're using addr and not unsafeAddr
14:22:58FromDiscord<Yardanico> or mark x as var T
14:23:05FromDiscord<Yardanico> both ways will make the code compile
14:23:22FromDiscord<Yardanico> and yes, in nim devel (and 2.0) addr is the same as unsafeaddr, but not in 1.6.x
14:26:28FromDiscord<kcvinker> @Yardanico `x.unsafeAddr` is working
14:26:34FromDiscord<Yardanico> yeah i know :)
14:26:59FromDiscord<Yardanico> in stable nim versions addr can't take the address of "immutable" data locations, so you need unsafeAddr
14:27:56FromDiscord<kcvinker> comparing to C family language's `&` operator, `unsafeAddr` is bit lngthy
14:28:16FromDiscord<kcvinker> (edit) "lngthy" => "lengthy"
14:28:31FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=4sex
14:29:18FromDiscord<Yardanico> In reply to @kcvinker "comparing to C family": because Nim is not from C family :) and in nim 2.0 you'll be able to use addr for all locations
14:29:44FromDiscord<kcvinker> In reply to @Yardanico "because Nim is not": That's great. It's shorter than unsafeAddr
14:30:03FromDiscord<Yardanico> no one is stopping you from making your own operator as a shorthand for addr
14:30:24FromDiscord<kcvinker> In reply to @Yardanico "no one is stopping": Oh, I see. Yeah, that's right
14:30:29*rockcavera joined #nim
14:30:50FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4sez
14:31:03FromDiscord<Yardanico> not & itself because strformat uses it by default for string formatting, and it's also the concat operator
14:31:04FromDiscord<kcvinker> Thanks for the sample
14:32:10FromDiscord<kcvinker> In reply to @Yardanico "not & itself because": My candidates are Odin's `^` operator and FreeBasic's `@` and `ptr`
14:32:27FromDiscord<Yardanico> @ is an operator used to turn things (arrays, strings) into sequences
14:32:33FromDiscord<Yardanico> ptr is already a keyword in Nim
14:32:50FromDiscord<Yardanico> ^ is used for creating slices
14:33:23FromDiscord<Yardanico> but is there a reason you write so much raw pointers code you need a shorthand operator for it? :P
14:33:30FromDiscord<System64 ~ Flandre Scarlet> In reply to @exelotl "It's the 0BSD license.": Ah alright, pretty nice then!↵Btw, what do you think of the bindings I generated? (I started this before being aware you did a binding, so I dunno if I should migrate to your binding or if I should still use mine)
14:33:46FromDiscord<System64 ~ Flandre Scarlet> In reply to @System64 "This is my bindings": This is the one I generated
14:33:52FromDiscord<kcvinker> In reply to @Yardanico "but is there a": Just for easiness
14:34:53FromDiscord<kcvinker> @Yardanico Yeah, in my current project, there is a lot of windows api function calls.
14:35:34FromDiscord<kcvinker> My IDE always list `unsafeAddr` under some other items in auto correction list
14:36:20FromDiscord<Yardanico> wdym other items?
14:36:48FromDiscord<Yardanico> both addr and unsafeAddr are operators, not keywords
14:37:37FromDiscord<kcvinker> In reply to @Yardanico "wdym other items?": If i remember correctly, `unsafeNew` is the first item
14:37:45FromDiscord<kcvinker> I am not sure. Let me check that
14:37:58FromDiscord<Yardanico> not sure what you mean, but it's the ide's nim plugin fault probably
14:38:03FromDiscord<sOkam!> how do you correctly forward declare in Nim?↵right now, to me, the syntax either randomly works, or randomnly doesn't↵I figure I'm making some mistake in how they are declared, but I don't know what exactly↵Isn't a forward declaration just the function without the `=` part?
14:38:09FromDiscord<Yardanico> really there's no much difference between addr or your own proc that's called something like myAddr
14:38:09FromDiscord<kcvinker> In reply to @Yardanico "not sure what you": Oh I see
14:38:20FromDiscord<Yardanico> except that addr is implemented as a compiler magic, but it's still defined as a normal proc
14:38:28FromDiscord<Yardanico> <https://nim-lang.org/docs/system.html#addr%2CT>
14:38:48FromDiscord<Yardanico> In reply to @sOkam! "how do you correctly": > Isn't a forward declaration just the function without the = part?↵↵yes, can you show the code that doesn't work?
14:39:31FromDiscord<sOkam!> i will try. but its random. sometimes it works for some reason. ill try to catch an example
14:47:44*arkurious joined #nim
14:51:05FromDiscord<exelotl> In reply to @System64 "Ah alright, pretty nice": It's up to you which one you use! But I personally prefer mine because I think it's more idiomatic - not split into 20 modules, lowercase filenames, exceptions instead of bool returns, shorter names (`tilemap.setTile` instead of `tilemap.setTilemapTile`), var params instead of raw pointers, sets & distinct types instead of raw bitfields
14:52:33FromDiscord<System64 ~ Flandre Scarlet> In reply to @exelotl "It's up to you": Ah yeah, so your bindings are more intuitive↵I still can mod it or doing an expansion module with my extras
14:54:32FromDiscord<System64 ~ Flandre Scarlet> It also has ways to interact with tile flags, my version doesn't really have that
15:39:49*fallback_ joined #nim
15:58:40FromDiscord<eyes> Anyone here ever parsed strings to DateTime objects?
15:59:44FromDiscord<eyes> sent a code paste, see https://play.nim-lang.org/#ix=4sfd
15:59:55FromDiscord<eyes> (edit) "https://play.nim-lang.org/#ix=4sfd" => "https://play.nim-lang.org/#ix=4sfe"
16:00:06FromDiscord<eyes> (edit) "https://play.nim-lang.org/#ix=4sfe" => "https://play.nim-lang.org/#ix=4sff"
16:00:15FromDiscord<eyes> it has a to_date function which converts string to this format
16:00:29FromDiscord<eyes> i would write a converter but idk shit about datetime formats
16:00:47FromDiscord<sOkam!> whats the `SomeXX` generic for matching both unsigned and signed ints, but not floats?↵I thought it was `SomeInteger` but it seems to be complaining when passing a uint32 🤔
16:00:59FromDiscord<eyes> worried there would be tiny difficult to debug mismatches between the original rfc3339 and the nim stdlib version
16:03:50FromDiscord<Nerve> In reply to @eyes "Anyone here ever parsed": Yes, I've had to parse custom-formatted UTC timestamps into DateTimes, shift them according to a separately attached local timezone using some DateTime arithmetic, and format them in an entirely different way for display
16:09:00FromDiscord<Nerve> I think I understand DateTimes well enough
16:15:57FromDiscord<eyes> In reply to @Nerve "Yes, I've had to": sounds exciting! (it does not, that was a joke). do you have any idea how I might convert that rfc3339 object I sent earlier into stdlib datetimes?
16:16:31FromDiscord<eyes> the rfc3339 implementation im using has a ``to_epoch`` function so i was thinking of converting to unix epoch and then back to stdlib datetime
16:26:19*Notxor quit (Quit: Leaving)
17:00:19FromDiscord<Nerve> That would probably be the easiest way to get a lossless conversion if you're not needing any more than 1-second resolution
17:00:33FromDiscord<Nerve> Just be careful with your timezone
17:02:15FromDiscord<Nerve> I keep forgetting exactly how timezones are interpreted because they're always so confusing that you only understand them when you're in the middle of working on them
17:02:50FromDiscord<Nerve> (edit) "you" => "I" | "you're" => "I'm"
17:04:26FromDiscord<demotomohiro> In reply to @sOkam! "whats the `SomeXX` generic": Type SomeXX type classes are defined in system module: https://nim-lang.org/docs/system.html↵If the type class you want is not defined in system module, you can create new type class like `SomeInteger or SomeUnsignedInt`.
17:05:22FromDiscord<sOkam!> kk ty ✍️
17:23:38*derpydoo joined #nim
17:24:37FromDiscord<treeform> In reply to @eyes "Anyone here ever parsed": I have a whole date time library (not based on std lib) if you want my way of parsing things: https://github.com/treeform/chrono
17:27:35*luis_ joined #nim
17:27:54luis_Nim taking the F right now (Primagean): https://www.youtube.com/watch?v=OG1uDoVtL_U
17:28:21FromDiscord<djazz> I saw it on stream too luis_ 😅
17:28:27FromDiscord<djazz> compared to vlang
17:31:07luis_Yeah, sadly.. Well, what can be said... The language is excellent, but not surfing any hype?!
17:31:23FromDiscord<Nerve> PLs are hype-driven projects
17:31:56FromDiscord<Nerve> It's why Rust is being used in endless numbers of projects where Nim or V or any GC native-compiled language would be a more productive long-term solution
17:32:07FromDiscord<Nerve> But people kneecap themselves because "pfft Nim what is that don't care"
17:32:29FromDiscord<Nerve> That's just human nature
17:33:56FromDiscord<Nerve> I see Nim in the same boat as Lisp or Python: A secret weapon, which may or may not gain momentum over time. If it does, it slowly becomes dominant and people naturally have to learn it. If not, it sticks around in the background for decades as a secret weapon for anyone who embraces it.
17:34:20FromDiscord<Nerve> (edit) "I see Nim in the same boat as Lisp or Python: A secret weapon, which may or may not gain ... momentum" added "grassroots"
17:34:47FromDiscord<Nerve> Everyone's gotta keep in mind that Rust has a marketing budget, and the primary audience for that is web devs
17:35:05FromDiscord<Nerve> That's a lot of people who know nothing about the wider programming world
17:36:03FromDiscord<Nerve> (edit) "Everyone's gotta keep in mind that Rust has a marketing budget, and the primary audience for that ... is(for" added "budget" | "budgetis web devs ... " added "(for some reason, I guess because Mozilla)"
17:36:54FromDiscord<Nerve> At least, in my personal experience, every web dev I talk to has never heard of basically anything outside of the JS/Rust bubble
17:38:18FromDiscord<djazz> Soo, umm a question i asked in #embedded but applies to Nim in general.↵When using object variants, how to avoid duplicating code for calling methods on the variant types? The field names are different, the types are different but they implement the same API.
17:38:55FromDiscord<djazz> sent a code paste, see https://play.nim-lang.org/#ix=4sfH
17:38:57FromDiscord<djazz> shortened example
17:39:06FromDiscord<Nerve> In reply to @djazz "Soo, umm a question": The API procs could use the `|` type separator on the `self` first input parametert
17:39:09FromDiscord<Nerve> (edit) "parametert" => "parameter"
17:39:33FromDiscord<djazz> Hmm
17:39:45FromDiscord<djazz> They are in separate modules now
17:39:54FromDiscord<Nerve> Alternatively, implement the API procs on the contained types, and make fetch procs that reach inside and grab types which have consistent structures
17:40:06FromDiscord<Nerve> (edit) "Alternatively, implement the API procs on the contained types, and make fetch procs that reach inside and grab ... types" added "contained"
17:41:10FromDiscord<Nerve> Basically anywhere that two types share field names and types, you can use `|` and the compiler will template out separate functions for you, or otherwise warn you if the given types don't implement something
17:41:17FromDiscord<Nerve> (edit) "two" => "multiple"
17:41:21*xet7 joined #nim
17:41:31FromDiscord<Nerve> (edit) "Basically anywhere that multiple ... types" added "object"
17:42:21FromDiscord<djazz> Yeah I know about that feature and generics, but I don't think that's the solution
17:43:31FromDiscord<djazz> since its two different fields
17:43:40FromDiscord<Nerve> It's really the same boat as in any other language with sum types, you have to cover all the cases unambiguously and there isn't a super consistent way to disappear all that code without using obfuscating macro magic
17:44:44FromDiscord<Nerve> If the language is statically typed, that is
17:52:39FromDiscord<ricky> In reply to @Nerve "I see Nim in": idk if Py is a secret weapon but ye Nim is 100% slept on
17:56:05*anddam joined #nim
18:08:24FromDiscord<Nerve> In reply to @Rictus "idk if Py is": Python was a secret weapon, once upon a time
18:08:40FromDiscord<ricky> 🍝
18:08:59FromDiscord<Nerve> It still has much of that power in many respects but other languages have managed to do what it does with cleaner project structure or native compilation
18:16:39FromDiscord<Andreas> In reply to @Nerve "It still has much": the new Python-Compiler from MIT might become a game-changer..
18:17:36FromDiscord<Andreas> (edit) "In reply to @Nerve "It still has much": the new Python-Compiler from MIT might become a game-changer.. ... " added "Codon https://github.com/exaloop/codon"
18:21:56FromDiscord<Nerve> sent a long message, see http://ix.io/4sfZ
18:22:16FromDiscord<Nerve> (edit) "http://ix.io/4sfZ" => "http://ix.io/4sg0"
18:23:23FromDiscord<Nerve> Think about how many projects probably shouldn't have been made with Java which are now basically dead relics with no future
18:23:38FromDiscord<Nerve> (edit) "Think about how many projects ... probably" added "from the 90's and early 00's"
18:23:44FromDiscord<Nerve> (edit) "Think about how many projects from the 90's and early 00's ... probably" added "that"
18:24:08FromDiscord<Nerve> I mean, there weren't too many alternatives...but now there are
18:26:01FromDiscord<Andreas> In reply to @Nerve "I have my doubts": i have doubts too. Its the sheer amount of well-maintained projects on the python-side , that will inspire people to carry on with these codebases, trying a new compiler, changing a bit here and there and just get along... we need more better projects on the nim-side - simple as that..
18:27:18FromDiscord<Andreas> (edit) "that.." => "that..↵And once people make the macro-experience - they will prbly never go away from nim - since thats the sharpest knive in the shed 🙂"
18:29:12FromDiscord<kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4sg1
18:29:41FromDiscord<kcvinker> It is null terminated
18:29:46FromDiscord<Nerve> sent a long message, see http://ix.io/4sg2
18:31:13FromDiscord<Nerve> With strong, opinionated language semantics and very clear assumptions, you limit you're language's power but you make more code and more programmers interchangeable. This is why companies beyond a certain size like java.
18:31:19FromDiscord<Nerve> (edit) "java." => "Java."
18:31:27FromDiscord<Nerve> (edit) "you're" => "your"
18:35:08FromDiscord<Andreas> In reply to @Nerve "Macros are also a": right, it's just one thing that makes nim stand out. Python became popular as a GPS glue-language. I feel there is trend aiming towards compilers. Svelte for example. So these days people might look out for a compiler that is flexible and one can easily build bridges e.g. between C/Objective-C/C++ Codebases - thats nim..
18:36:34FromDiscord<Nerve> I agree there that C is being recognized as a pretty-okay cross-platform assembly language
18:36:58FromDiscord<Andreas> In reply to @Nerve "With strong, opinionated language": The company-sphere has its own rules - certification, legal aspects etc. And sure enough Microsoft one has a interest to make Python faster - good for Python - there will be progress..
18:37:11FromDiscord<Andreas> (edit) "one" => "know"
18:40:12FromDiscord<Andreas> My impression is, that Nim is a good example for european efforts in computing, which is often-times not recognized as on-par with US projects. Thinking of Prolog(France), Python(Netherlands), Oberon(Swiss-made) and Nim, too
18:42:58FromDiscord<Marcus> Is the nim documentation using a mashup of rst and md? Seems a bit weird.
18:45:00FromDiscord<Marcus> I can confirm this is what attracted me. Specially being able to bridge c++ stuff↵(@Andreas)
18:48:40FromDiscord<Elegantbeef> It used to be rst only but i believe it now supports both for a transition to MD
19:02:58*Notxor joined #nim
19:18:20FromDiscord<System64 ~ Flandre Scarlet> In reply to @Nerve "It's why Rust is": I love Nim because it is clean, very flexible, fast, (at least, safer than C/C++)
19:18:35FromDiscord<System64 ~ Flandre Scarlet> (edit) "In reply to @Nerve "It's why Rust is": I love Nim because it is clean, very flexible, fast, ... (at" added "safe"
19:19:26FromDiscord<Nerve> I'm saying that Nim would be a better choice than Rust for most of those projects
19:19:54FromDiscord<Nerve> Thereby pointing out that we are irrational hype-driven creatures by default
19:20:42FromDiscord<System64 ~ Flandre Scarlet> I have an idea to convince people
19:20:53FromDiscord<System64 ~ Flandre Scarlet> Tensorflow on Nim
19:22:30FromDiscord<System64 ~ Flandre Scarlet> Pillow on Nim
19:22:33FromDiscord<I have 50GB of nothing on my PC> data science people clearly dont mind using bad languages
19:22:57FromDiscord<System64 ~ Flandre Scarlet> Python is not bad, but flawed
19:23:14FromDiscord<I have 50GB of nothing on my PC> I was thinking about R more
19:24:02FromDiscord<System64 ~ Flandre Scarlet> Should we talk about↵Php?
19:25:04FromDiscord<System64 ~ Flandre Scarlet> A function that can return a string or null or an array of strings↵Bruh wtf sus?!
19:25:31FromDiscord<I have 50GB of nothing on my PC> assuming there's no undefined behaviour (not obvious with php's stdlib)
19:25:50FromDiscord<guttural666> In reply to @Nerve "I'm saying that Nim": reminds me of Nvidea
19:26:27FromDiscord<System64 ~ Flandre Scarlet> In reply to @I have 50GB of nothing on my PC "assuming there's no undefined": Bruh php Arrays wtf wtf↵A php array can contains everything at every index
19:27:28FromDiscord<guttural666> (edit) "In reply to @Nerve "I'm saying that Nim": reminds me of Nvidea ... " added "(they hype comment)"
19:28:08FromDiscord<Nerve> In reply to @I have 50GB of nothing on my PC "data science people clearly": I come from academia and can tell you unambiguously that data science and machine learning people clearly don't mind writing bad code. Looking at sources in that field is an atrocious experience. For all the scientific hemming and hawing about reproducibility, their code is itself unusably awful.
19:28:56FromDiscord<guttural666> In reply to @Nerve "I come from academia": my company pays Bearingpoint 1000 a day to shit in our systems with atrocious code, what are you talking about, everything is fine haha
19:29:55FromDiscord<Phil> In reply to @Nerve "I come from academia": As someone with a bioinformatics background:↵I have yet to see academia actually produce any code that is maintainable by more than just the guy who wrote it, and often not even that
19:30:33FromDiscord<guttural666> In reply to @Isofruit "As someone with a": that's the employment strat
19:30:49FromDiscord<Phil> I'm willing to believe that the actual informatics driven sections are capable of it, but I have a hard time seeing it in intermingling fields of academia like bioinformatics
19:30:56FromDiscord<kcvinker> How to convert a `seq[char]` into string ?
19:32:00FromDiscord<guttural666> https://media.discordapp.net/attachments/371759389889003532/1091082416862543922/image.png
19:32:15FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sgo
19:32:23FromDiscord<Phil> Screw you!
19:32:26FromDiscord<guttural666> my AI overlord was correct hahaha
19:32:44FromDiscord<guttural666> the machine spirit never lets me down xD
19:32:44FromDiscord<System64 ~ Flandre Scarlet> In reply to @guttural666 "": CHATGPT finally supports Nim?
19:33:06FromDiscord<Phil> It supports every programming language, the second your question becomes nieche though you're dependant on somebody having solved the problem for you already
19:33:21FromDiscord<guttural666> In reply to @System64 "CHATGPT finally supports Nim?": it always has, but it's outdated and sometimes stupid, but if you learn the limitations, it's the best shit ever
19:33:27FromDiscord<Phil> And it'll become unlikely somebody tackled your particular problem in nim before very quickly
19:33:55FromDiscord<Phil> That's less of a concern in langs like java, JS or python because everything in those language has likely aready been done by somebody before you
19:34:14FromDiscord<kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4sgr
19:34:21FromDiscord<guttural666> In reply to @Isofruit "That's less of a": well, it does more than that to be fair
19:34:30FromDiscord<guttural666> not just copying stuff from stackoverflow
19:34:34FromDiscord<Phil> In reply to @kcvinker "I didn't get the": I was using inim. ↵Basically, if it doesn't have `nim>` as a prefix then it is the result of a line of code
19:34:59FromDiscord<Phil> In reply to @guttural666 "not just copying stuff": Ehhhhhhhhhhhhhhhhhhhhhhhhhh↵Expand that h by a lot more h's
19:35:10FromDiscord<kcvinker> So x.join() is the answer ?
19:36:04FromDiscord<Phil> You'll find me unconvinced that it'll be accurately and correctly inferring correct use of syntax for larger problems that it hasn't received somewhat explained code-snippets before
19:36:13FromDiscord<Phil> In reply to @kcvinker "So x.join() is the": Yeah
19:36:31FromDiscord<kcvinker> In reply to @Isofruit "Yeah": Thanks. Let me try
19:36:53FromDiscord<Phil> At least that's for GPT3, maybe GPT4 is better, but it'll still be suffering from low amounts of training data
19:37:15FromDiscord<guttural666> In reply to @Isofruit "You'll find me unconvinced": yeah, but that's a matter of learning how to use and interpret what it does, just like googling, you can get a shit ton of value from it if you know how to utilize it
19:38:39FromDiscord<guttural666> just interrogated it about the YAML lib in nim and it was super helpful, just 10x more efficient in directing me to what I need than reading docs
19:39:13FromDiscord<guttural666> I ended up parsing by hand because the overhead was too high, but I learned a ton
19:40:13FromDiscord<guttural666> In reply to @Isofruit "At least that's for": absolutely, but if you know that, you win anyway
19:41:05FromDiscord<kcvinker> In reply to @Isofruit "Yeah": Unfortunately `x.join()` didn't worked
19:41:18FromDiscord<Phil> Code or it didn't happen 😛
19:42:55FromDiscord<kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4sgt
19:44:04FromDiscord<Phil> And the error is?
19:45:07FromDiscord<Phil> if it is `Error: attempting to call undeclared routine: 'join'` then I'd ask you to look at your imports 😛
19:45:29FromDiscord<kcvinker> In reply to @Isofruit "if it is `Error:": No no
19:45:32FromDiscord<kcvinker> No error
19:45:38FromDiscord<kcvinker> Just the empty string
19:45:49FromDiscord<kcvinker> Let me check once again
19:46:10FromDiscord<Phil> I mean, it is concatenating all your entries in seq[char]↵An empty seq, even if it has 20 empty cells in it, will joined together lead to an empty string
19:47:33FromDiscord<Graveflo> sent a long message, see http://ix.io/4sgu
19:47:50FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sgv
19:48:44FromDiscord<kcvinker> In reply to @Isofruit "Like, what is your": Got the point. Let me check from the beginning
19:48:45FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4sgv" => "https://play.nim-lang.org/#ix=4sgw"
19:49:16FromDiscord<Phil> You're never ever writing to s so currently it's the only possible outcome
19:53:28FromDiscord<kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4sgz
19:56:22FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sgB
19:56:36FromDiscord<Graveflo> In reply to @Isofruit "Like, what is your": I don't know if this will help you at all, but this code will output n bull bytes to std out. where n=20 in this case. It looks like an empty string but the null bytes are there
19:57:05FromDiscord<Graveflo> you can see by redirecting std out to a file and look at the file in a hex editor
19:57:08FromDiscord<Phil> You want the bytes allocated for the most part?
19:57:25FromDiscord<Graveflo> (edit) "bull" => "null"
19:57:30FromDiscord<kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4sgC
19:59:10FromDiscord<Phil> I do not understand how "join" doesn't do the same here, but if it works I'm glad for you.
19:59:13FromDiscord<kcvinker> @Phil Yes, `result = s.join()` is working
19:59:39FromDiscord<Graveflo> The string is aware of the length of the string, not just the length of the allocated buffer, where I think the char seq has a fixed length and doesn't respect a null character as a termination mark
19:59:57FromDiscord<Phil> Checking with `echo x.repr`, they both produce null bytes-containing strings
20:00:07FromDiscord<Elegantbeef> Yes string is `\0` terminated whereas seq[char] is not
20:00:32FromDiscord<Elegantbeef> Note Nim strings are pascal strings and not just null terminated strings
20:00:40FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sgG
20:01:05FromDiscord<Elegantbeef> Phil is right abotu the behaviour
20:01:36FromDiscord<kcvinker> In reply to @Elegantbeef "Yes string is `\0`": In my case this seq[char] is null terminated
20:02:11FromDiscord<Elegantbeef> No char is not null terminated
20:02:16FromDiscord<Elegantbeef> In your case you just allocated 20 characters and default for that is \\0
20:02:40FromDiscord<Graveflo> could be a "depends how you use it" scenario
20:02:48FromDiscord<kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4sgI
20:04:39FromDiscord<kcvinker> if you print the contents of buffer, last item must be 0
20:05:03FromDiscord<Elegantbeef> What's even the problem
20:05:24FromDiscord<kcvinker> Not at all
20:07:08FromDiscord<Elegantbeef> ok
20:10:31FromDiscord<Graveflo> In reply to @Graveflo "I have an odd": Hey beef, you have any words of wisdom on this or am I on my own. I know its a weird scenario
20:11:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @guttural666 "it always has, but": Oh alright
20:16:19FromDiscord<Elegantbeef> You can `exportC` and `{.compile.}` grave
20:16:34FromDiscord<Elegantbeef> I'd need more information about that library to give better information
20:17:04FromDiscord<eyes> In reply to @treeform "I have a whole": this is really cool and i might use it- does it support parsing strings to dates in multiple formats?
20:17:43FromDiscord<Elegantbeef> Jesus this month has a shit load of productive Nim programmers 😄
20:17:48FromDiscord<eyes> being able to do MM/DD/YYYY vs DD-MM-YYYY or whatever
20:17:59FromDiscord<eyes> we! need! threads! in the discord chat!
20:18:04FromDiscord<eyes> or maybe just more chats
20:18:18FromDiscord<Elegantbeef> Nah i was talking in response to TMWN submissions
20:18:24FromDiscord<eyes> ah
20:18:49FromDiscord<Elegantbeef> Are threads disabled in discord?
20:18:54FromDiscord<Elegantbeef> They work on matrix 😛
20:20:43FromDiscord<eyes> oh what
20:20:49FromDiscord<eyes> maybe ill switch to the matrix chat then
20:21:24FromDiscord<morgan> oh yeah that's weird
20:21:45FromDiscord<morgan> threads have been pretty nice on other servers, highly recommend enabling them
20:22:16FromDiscord<morgan> also anyone know what's going on with nimdocs.com? i'm getting a timeout on it
20:22:17FromDiscord<Phil> In reply to @Elegantbeef "Are threads disabled in": What client you on?
20:22:52FromDiscord<morgan> i'm on the normal desktop discord client and i don't see them
20:27:13FromDiscord<Graveflo> sent a long message, see http://ix.io/4sgP
20:30:30FromDiscord<morgan> In reply to @MorganAlyssa "also anyone know what's": i was trying to figure out pixie and the docs seem to only be there
20:31:01FromDiscord<Phil> In reply to @MorganAlyssa "also anyone know what's": Never head of the page, loads super slow for me as well
20:31:19FromDiscord<morgan> i get an error page from cloudflare
20:31:43FromDiscord<Phil> Same
20:36:47FromDiscord<Elegantbeef> @Graveflo exportc tells nim to emit types/procedures with verbatim names
20:36:55FromDiscord<Elegantbeef> It stops mangling, so it works with static and dynamic alike
20:37:21FromDiscord<Elegantbeef> It sounds like the C library is doing a silly thing, it should just use the static linker, but it's using C includes
20:37:52FromDiscord<Elegantbeef> I guess it needs the C imports for the type layout, so maybe i'm silly
20:40:00FromDiscord<Graveflo> In reply to @Elegantbeef "<@200775012796334081> exportc tells nim": That makes sense, I suppose that means I just have to figure out how to tell the nim compiler to output the header to a fixed location instead of the nim cache so the library code can import the header that is produced by the nim compiler. Perhaps then when I cimport and compile it will work? I'm just going to have to stop stalling a try stuff. I'm going to make a proo
20:41:26FromDiscord<Elegantbeef> Eitherway this is going to take two passes I imagine
20:41:57FromDiscord<Elegantbeef> Nim -\> Generate Types -\> C -\> Compile Normal Nim
20:42:59FromDiscord<Graveflo> I have very limited knowledge of now the nim compiler actually functions, but if the imports are done in the right order and nim doesn't hold onto things I think it is possible for the macro to generate the types, have the compiler generate the c code, then do the ni code with the c imports and then a final statically linked compile. Might be able to do this in one command
20:43:38FromDiscord<Graveflo> (edit) "ni" => "nim"
20:45:11FromDiscord<morgan> @treeform nimdocs is down
20:53:44NimEventerNew thread by alexeypetrushin: Any bad consequence of redefining equality for ref types?, see https://forum.nim-lang.org/t/10049
20:55:09FromDiscord<Phil> In regards to the question, I just checked if nim, similar to any other language I've seen so far, defines "equality" for ref types as "pointer-equality" or "data-equality"
20:55:15FromDiscord<Phil> Turns out nim also does pointer equality
20:55:35FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sgX
20:55:56FromDiscord<Phil> Does anyone actually care about pointers being equal rather than data being equal?
20:55:56FromDiscord<Elegantbeef> Of course it does 😄
20:56:29FromDiscord<Elegantbeef> Pointers being equal is a much cheaper check than `a[] == b[]`
20:56:33FromDiscord<Phil> Or is this just one of those age old standards so deeply ingrained that changing them would be deeply unintuitive for most folks?
20:56:41FromDiscord<Graveflo> in python that would would be true. The analog to pointer equality would be`is` . Some langs do it differently
20:57:08FromDiscord<Elegantbeef> Generally speaking for most reference types if the ptr is different the data likely is aswell
20:57:25FromDiscord<Elegantbeef> Of course we can argue "what about ref int" or similar
20:58:48FromDiscord<Elegantbeef> The compiler for instance uses references a lot
20:59:02FromDiscord<Elegantbeef> And as such uses pointer comparisons
20:59:36FromDiscord<Phil> Question though, why do we have `auto`when we have a way for generic writing style that allows more clearly to distinguish them from other procs?
20:59:58FromDiscord<Elegantbeef> What?
21:00:45FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sh2
21:01:01FromDiscord<Elegantbeef> I mean if i do not care about `T` i write `auto`
21:01:46FromDiscord<Phil> I'd want to use T (or something like it) purely because it's more easier to see when skimming through code
21:02:10FromDiscord<Elegantbeef> Sure but you also write `let a: MyType = MyType.init(...)`
21:02:12FromDiscord<Phil> So identifying generics becomes easier, I really like markers like that for glancing through stuff
21:02:43FromDiscord<Phil> Lies!↵I write `let a: MyType = init(MyType)`!
21:02:55FromDiscord<Phil> And even that only sometimes
21:02:57FromDiscord<Graveflo> I think what beef said is an argument for how it can convey meaning. As in the proc doesn't actually re-use the type declarative ly
21:03:50FromDiscord<Phil> Hmm that would enable you to convey more information
21:04:10FromDiscord<Phil> "This type can be whatever, but I don't particularly have any of my logic build upon which type it is"
21:04:20FromDiscord<Phil> (edit) "is"" => "is or need to do any logic on the type itself""
21:04:53FromDiscord<Elegantbeef> auto conveys the same
21:05:24FromDiscord<Elegantbeef> I'd argue `proc name[T]` indicates you care about the type since you are saying "Introduce a symbol so i can use the type in other locations"
21:05:27FromDiscord<Phil> That's where I was trying to go with it. `Auto`expresses that, while `T` can't.↵By having T you implicitly state "I'll use that somewhere"
21:05:35FromDiscord<Elegantbeef> `auto` means "I really do not care about the type, we'll be using procedures to disambiguate
21:06:04FromDiscord<Elegantbeef> So then you agree there is a reason to have auto, disembarking from your original comment
21:06:06FromDiscord<Elegantbeef> Nice
21:06:36FromDiscord<Phil> Yeah, I follow you there, just hadn't considered this implicit statement of T means "I want to use it in my code", while auto removes that, giving you a guarantee that it isn't used, which T can't
21:07:27FromDiscord<Elegantbeef> To add on you can also do `proc doThing(a: Type[auto])` which is just an uglier `proc doThing(a: Type)`
21:07:35FromDiscord<Elegantbeef> `auto` is atleast consistent for generic parameters
21:07:56FromDiscord<Elegantbeef> Also sorta consistent as a return value
21:15:25FromDiscord<0ffh> In reply to @Isofruit "Does anyone actually care": Yup.
21:16:04FromDiscord<0ffh> For example, pointers equal implies data equal, with just one comparison.
21:16:11*derpydoo quit (Quit: derpydoo)
21:16:13FromDiscord<0ffh> That's why people do string interning.
21:16:50FromDiscord<guttural666> does this look wrong? can't get this to find anything, I am at a loss https://media.discordapp.net/attachments/371759389889003532/1091108798497816768/image.png
21:41:22FromDiscord<morgan> are you trying to make the right regex? or are you struggling on the rest of it? for developing regexes i use regex101
21:46:32FromDiscord<guttural666> I actually don't know where the problem is: user inputs pls thethiing and I want it to find Plsment TheThingIwantInLife, that is it
21:46:46FromDiscord<guttural666> (edit) "thethiing" => "thething"
21:50:08*xet7 quit (Ping timeout: 268 seconds)
21:50:53FromDiscord<morgan> as two separate matches or as one thing?
21:51:13FromDiscord<morgan> and no case-sensitivity?
21:52:35FromDiscord<guttural666> nah, that example would be one search string and yes, the user will not use case sensitive search
21:53:12FromDiscord<morgan> there may be an option for case-insenstive match, but you could also just convert both to lowercase first
21:55:13FromDiscord<guttural666> I reckon the {reIgnoreCase} flag would take care of that
22:09:46*ltriant quit (Read error: Connection reset by peer)
22:11:59*advesperacit quit ()
22:12:48*Notxor quit (Quit: Leaving)
22:15:00*ltriant joined #nim
22:16:13FromDiscord<michaelb.eth> is there a mechanism at compile-time to get the base type of a `distinct` type, e.g. `type MyUint = distinct uint32`?
22:17:20FromDiscord<michaelb.eth> (edit) "is there a mechanism at compile-time to ... get" added "automatically"
22:17:48FromDiscord<djazz> In reply to @michaelb.eth "is there a mechanism": https://nim-lang.org/docs/typetraits.html#distinctBase%2Ctypedesc%2Cstaticbool
22:18:42FromDiscord<djazz> and https://nim-lang.org/docs/typetraits.html#distinctBase.t%2CT%2Cstaticbool
22:46:44FromDiscord<oxnan> sent a code paste, see https://play.nim-lang.org/#ix=4shd
22:47:14FromDiscord<Elegantbeef> isnt `->` just dereference access?
22:47:32FromDiscord<auxym> it is in C, not sure about c++
22:47:42FromDiscord<Elegantbeef> so just `pdata[].hsymlink` or `pdata.hsymlink`
22:47:44FromDiscord<auxym> nim just automatically dereferences ref types
22:48:02FromDiscord<oxnan> that is very possible. I don't write c++ myself, so I did not exactly know what to search for 😛
22:48:12FromDiscord<auxym> automatically dereferences field accesses on ref types, to be exact
22:48:25FromDiscord<oxnan> i'll try some different options and see what sticks 🙂
22:49:19FromDiscord<Q-Master> Operator -\> behaves the same in C and C++. It might be extended or overloaded in C++, but common usage is the same.
22:59:25*luis_ quit (Ping timeout: 260 seconds)
23:02:43FromDiscord<michaelb.eth> In reply to @djazz "https://nim-lang.org/docs/typetraits.html#distinctB": many thanks!
23:02:59*luis_ joined #nim
23:27:01FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4shk
23:27:25FromDiscord<Elegantbeef> Well that should be `x: (ref object or ptr object)` 😛
23:27:46FromDiscord<Elegantbeef> And it should be `x[].y` if we want it fully compatible
23:41:24FromDiscord<Yardanico> In reply to @MorganAlyssa "threads have been pretty": that's because those servers are pure-discord, and locking people to only one platform isn't so great, so historically nim used bridges :)
23:41:57FromDiscord<Yardanico> i can agree that almost no people use irc nowadays for #main (although the IRC bridge still works), but bridging threads between discord and matrix still is a big problem
23:43:17FromDiscord<Elegantbeef> Well matrix does now have threads, so it's mainly just a bridge issue
23:43:28FromDiscord<Yardanico> yeah, and then also a moderation one :)
23:43:29FromDiscord<Elegantbeef> And using the outdated host of t2bot isnt helping much 😄
23:43:38FromDiscord<Yardanico> wdym?
23:43:56FromDiscord<Elegantbeef> The bridge that t2bot hosts is outdated the last i checked
23:44:44FromDiscord<Yardanico> <https://github.com/t2bot/matrix-appservice-discord> does seem to have some commits not present in the original repo although it does lag behind a bit
23:44:49FromDiscord<Yardanico> but even <https://github.com/matrix-org/matrix-appservice-discord> doesn't seem that well developed
23:46:55*luis_ quit (Quit: Leaving)
23:47:54FromDiscord<Yardanico> and of course the biggest problem of discord is that it's not indexable by search engines at all, although https://www.answeroverflow.com/ might work for threads (or a forum channel) specifically
23:48:35FromDiscord<Elegantbeef> The nice thing is the matrix chat is capable of being fully downloaded if someone really wanted to index it
23:49:26FromDiscord<Yardanico> yes but you can download the discord chat too, such tools exist
23:49:38FromDiscord<Yardanico> but the main problem is people asking the same questions again and again, that's why things like SO exist :P
23:49:41FromDiscord<Elegantbeef> Not first part supported so I do not care
23:49:47FromDiscord<Elegantbeef> party\
23:57:42FromDiscord<Elegantbeef> Any of you numtpies have something to submit to TMWN, already have a shit load of entries but might as well go bigger 😛