00:13:58 | FromDiscord | <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:59 | FromDiscord | <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:21 | FromDiscord | <gogolxdong> https://github.com/hpcaitech/ColossalAI |
03:28:25 | FromDiscord | <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:10 | FromDiscord | <Gumbercules> In reply to @gogolxdong "Anyone has interest in": Seems like a LOT of work |
04:03:48 | * | m5zs7k joined #nim |
04:05:57 | FromDiscord | <Dudugz> Seema boring >.> |
04:06:46 | FromDiscord | <Gumbercules> To each their own 😄 |
04:07:43 | FromDiscord | <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:04 | FromDiscord | <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:27 | FromDiscord | <ricky> In reply to @gogolxdong "Anyone has interest in": for the right price ofc |
07:02:04 | FromDiscord | <ricky> otherwise i'm too busy using Nim to disrupt markets 😎 |
07:15:06 | FromDiscord | <gogolxdong> https://twitter.com/ilblackdragon/status/1641205924973928450?s=19 |
07:26:31 | * | jjido joined #nim |
07:38:14 | FromDiscord | <Phil> I'd claim that one's offtopic |
07:47:33 | PMunch | We'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:03 | FromDiscord | <Phil> Alrighty, I'll try to keep that in mind going forward! |
07:49:18 | Amun-Ra | that's a good approach tbh |
08:11:04 | PMunch | It'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:04 | PMunch | forth 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:51 | FromDiscord | <Rika> It still happens now |
08:22:15 | PMunch | True |
08:24:18 | * | cnx quit (Remote host closed the connection) |
08:25:05 | * | cnx joined #nim |
08:44:25 | PMunch | Man 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:33 | FromDiscord | <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:04 | FromDiscord | <Phil> I'm not seeing people wanting to make everything a ref object |
09:50:06 | FromDiscord | <Phil> We're safe |
09:50:36 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "I'm not seeing people": Bad practice? |
09:51:30 | FromDiscord | <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:26 | FromDiscord | <System64 ~ Flandre Scarlet> in Nim |
09:54:16 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
09:55:07 | FromDiscord | <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:58 | FromDiscord | <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:36 | FromDiscord | <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:05 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/Jd0 |
10:16:21 | FromDiscord | <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:40 | FromDiscord | <System64 ~ Flandre Scarlet> I use inheritence, so maybe I goes the wrong way? |
10:18:51 | * | Notxor joined #nim |
10:19:01 | FromDiscord | <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:06 | FromDiscord | <guttural666> can I force the i here to be of type int32 somehow? for i, item in items |
11:06:52 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @guttural666 "can I force the": wdym? you want to cast? |
11:07:05 | FromDiscord | <guttural666> In reply to @System64 "wdym? you want to": yes |
11:07:15 | FromDiscord | <Rika> let i = i.int32 |
11:07:17 | FromDiscord | <Rika> In the loop |
11:07:23 | FromDiscord | <System64 ~ Flandre Scarlet> if yes, it is something like↵myVar.int32 |
11:07:29 | FromDiscord | <System64 ~ Flandre Scarlet> it casts myVar to int32 |
11:07:32 | FromDiscord | <Rika> This is not called casting in Nim |
11:07:43 | FromDiscord | <Rika> This is called conversion |
11:07:50 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "This is not called": Oh↵What's the difference? |
11:08:03 | FromDiscord | <Rika> Casting is reinterpreting raw bytes into another type |
11:08:14 | FromDiscord | <System64 ~ Flandre Scarlet> so it's dangerous, no? |
11:08:21 | FromDiscord | <Rika> Sure |
11:08:47 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "Sure": Casting a float into a int |
11:09:53 | FromDiscord | <Rika> Yes |
11:11:43 | FromDiscord | <System64 ~ Flandre Scarlet> sent a long message, see http://ix.io/4sdC |
11:12:58 | PMunch | https://play.nim-lang.org/#ix=4sdD |
11:13:12 | * | derpydoo joined #nim |
11:13:14 | PMunch | That's the difference between conversion and casting |
11:14:00 | FromDiscord | <System64 ~ Flandre Scarlet> and C has the same behavior? |
11:14:23 | PMunch | Not sure if C has conversions like Nim does |
11:14:37 | PMunch | Or if it's all casting |
11:18:59 | FromDiscord | <System64 ~ Flandre Scarlet> https://onlinegdb.com/eo3I-DgbV |
11:19:20 | FromDiscord | <System64 ~ Flandre Scarlet> It doesn't act sussy https://media.discordapp.net/attachments/371759389889003532/1090958433865433108/image.png |
11:19:43 | FromDiscord | <Rika> C only has conversion iirc |
11:19:52 | FromDiscord | <Rika> well, technically |
11:19:56 | FromDiscord | <Andreas> Why is it not possible to cast to a `seq`? https://play.nim-lang.org/#ix=4sdH |
11:20:01 | FromDiscord | <Rika> with everything C ofc theres a fucktonne of nuances |
11:20:31 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "C only has conversion": I saw a video explaining casting in C is unsafe |
11:21:14 | FromDiscord | <Rika> In reply to @Andreas "Why is it not": its not safe to cast to reference based types because of GC things |
11:21:20 | FromDiscord | <Rika> you'll confuse the GC |
11:21:29 | PMunch | @Andreas, because you're trying to cast a pointer to a sequence to a sequence.. |
11:21:38 | FromDiscord | <Rika> oh that too is what happened ig |
11:21:47 | FromDiscord | <Rika> didnt realise mb lo |
11:21:49 | PMunch | It will try to read that pointer as the actual sequence, which probably means that the length is some arbitrary number |
11:22:08 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "its not safe to": and can conversion work? |
11:22:46 | FromDiscord | <Rika> nim doesnt handle that case iirc |
11:24:02 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Andreas "Why is it not": Wow you are doing suspicious stuff right there! |
11:24:34 | FromDiscord | <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:48 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "I'm at work, I": Ah alright, sorry then |
11:25:25 | FromDiscord | <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:48 | FromDiscord | <Rika> its a sensible mistake i would say |
11:26:25 | FromDiscord | <System64 ~ Flandre Scarlet> reference != pointer, right? |
11:26:53 | FromDiscord | <Rika> of course |
11:27:00 | FromDiscord | <Rika> yes it is |
11:27:07 | FromDiscord | <System64 ~ Flandre Scarlet> it is a pointer? |
11:27:21 | FromDiscord | <Rika> no, your statement is correct is my intention |
11:27:27 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
11:27:42 | FromDiscord | <System64 ~ Flandre Scarlet> I don't really understand the difference |
11:28:00 | FromDiscord | <Rika> references are pointers but are tracked by the GC |
11:28:05 | FromDiscord | <Andreas> @PMunch @Rika so this works.. https://play.nim-lang.org/#ix=4sdJ |
11:28:07 | FromDiscord | <Rika> or the AMM system at least |
11:28:21 | FromDiscord | <System64 ~ Flandre Scarlet> and are pointers safe to use in Nim? |
11:28:31 | FromDiscord | <Rika> safe in what way |
11:28:46 | FromDiscord | <System64 ~ Flandre Scarlet> not as dangerous as C |
11:28:58 | FromDiscord | <guttural666> if you know what you're doing anything is safe 😛 |
11:28:59 | FromDiscord | <Rika> In reply to @Andreas "<@392962235737047041> <@259277943275126785> so this": i mean, `cast[seq[int]](s1)` "works, but also doesnt actually do anything" |
11:29:13 | FromDiscord | <Rika> In reply to @System64 "not as dangerous as": as in what way? |
11:29:17 | FromDiscord | <Rika> they both leak just as easily |
11:29:39 | FromDiscord | <System64 ~ Flandre Scarlet> So in Nim you also need to manually free pointers? |
11:29:41 | PMunch | @Andreas, you don't need the ptr/addr/[] stuff for s3 |
11:29:49 | FromDiscord | <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:12 | FromDiscord | <Rika> automatically freeing memory is the point of references over pointers |
11:30:24 | FromDiscord | <Rika> well, the main point i guess? not sure if any others exist |
11:30:52 | PMunch | If 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:06 | PMunch | If you manually allocate memory you also need to manually free it |
11:31:31 | PMunch | This also applies if you interface with a C library which manually allocates memory for you |
11:31:44 | FromDiscord | <Andreas> i have a C-API in-between, that i feed a with a `pointer` and will return a `pointer` |
11:31:46 | PMunch | Of course in that case you can also write a destructor to do the job for you automatically |
11:32:28 | PMunch | @Andreas, then you need to read the C-API documentation to see what it expects you to do |
11:33:36 | FromDiscord | <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:23 | FromDiscord | <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:26 | PMunch | Right, 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:09 | PMunch | (Of course assuming that the object doesn't contain pointers to other things that the library initializes and you need to free) |
11:36:54 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/megamarc/Tilengine↵I wonder how it would look like if I rewrite this to Nim |
11:38:09 | FromDiscord | <Andreas> In reply to @System64 "https://github.com/megamarc/Tilengine I wonder how": it will look better.. |
11:38:20 | PMunch | A bit like Nico I would assume |
11:39:02 | PMunch | Alternatively like this: https://sr.ht/~exelotl/nim-tilengine/ |
11:39:52 | FromDiscord | <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:13 | PMunch | Yeah you wrapped it with Futhark didn't you? |
11:41:10 | * | Notxor quit (Quit: Leaving) |
11:41:11 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Yeah you wrapped it": Yes I did |
11:45:01 | FromDiscord | <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:36 | FromDiscord | <System64 ~ Flandre Scarlet> No idea if mine is cleaner or if Exelotl is better |
11:45:42 | FromDiscord | <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:04 | FromDiscord | <System64 ~ Flandre Scarlet> The nice thing I did is I added some abstractions for the bitmap, colors etc |
11:59:27 | FromDiscord | <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:42 | FromDiscord | <kcvinker> Is it possible to use `varargs[auto]` ? |
13:14:20 | PMunch | And get what? |
13:14:36 | PMunch | I think it would be possible, but they would all have to be the same type |
13:17:19 | FromDiscord | <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:05 | FromDiscord | <kcvinker> So that I can use `cmb.addItems(100, 250.45, "Some text")` |
13:19:36 | PMunch | Ah, no that would not be possible |
13:19:50 | PMunch | Well, not without some extra finagling |
13:21:18 | PMunch | This might be possible though: https://play.nim-lang.org/#ix=4se8 |
13:22:35 | PMunch | Yes, that is indeed valid: https://play.nim-lang.org/#ix=4sea |
13:22:45 | PMunch | @kcvinker ^ |
13:24:47 | FromDiscord | <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:59 | PMunch | That is the finagling I was talking about earlier :P |
13:43:08 | FromDiscord | <System64 ~ Flandre Scarlet> PMunch, should I use my bindings or Exelotl bindings for Tilengine? |
13:49:23 | FromDiscord | <ricky> In reply to @Rika "Casting is reinterpreting raw": types are just a bloated abstraction over bit patterns anyway |
13:55:58 | PMunch | @System64_~_Flandre_Scarlet, how would I know? I've tried neither of them |
13:56:13 | FromDiscord | <System64 ~ Flandre Scarlet> Ah alright, sorry |
13:56:57 | FromDiscord | <Rika> In reply to @Rictus "types are just a": lol |
13:56:57 | FromDiscord | <kcvinker> @PMunch Thank you. 🙂 This (`varargs[string, `$`]` seems interesting. |
13:57:02 | PMunch | The 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:53 | PMunch | @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:13 | PMunch | So if you want to do the boxed type thing we talked about earlier then you can do that with your own converter |
13:58:16 | FromDiscord | <kcvinker> In reply to @PMunch "<@633714482572689449>, yeah, it's basically": That's brilliant |
13:59:06 | FromDiscord | <kcvinker> In reply to @PMunch "So if you want": Is there any examples of it ? |
13:59:39 | PMunch | Dunno |
13:59:55 | PMunch | Hmm, I tried with `pointer, addr` and it didn't seem to like that much.. |
14:00:26 | FromDiscord | <pmunch> Might be because addr returns a specific pointer.. |
14:01:38 | FromDiscord | <kcvinker> In reply to @PMunch "Hmm, I tried with": No probs |
14:02:10 | PMunch | Hmm, actually not sure what's going on here: https://play.nim-lang.org/#ix=4sem |
14:02:15 | PMunch | I would've expected that to work |
14:02:52 | FromDiscord | <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:29 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "The Futharked bindings have": Ah alright, btw, what is the license for Exelotls' bindings? |
14:06:32 | FromDiscord | <sOkam!> sounds like a handy package if there is one |
14:06:45 | PMunch | @System64_~_Flandre_Scarlet, no idea, ask them |
14:06:49 | PMunch | Or check the repo I guess |
14:07:09 | PMunch | Don'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:13 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4seq |
14:07:22 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Don't know of a": Which ones? |
14:13:46 | FromDiscord | <System64 ~ Flandre Scarlet> Oh, there is some libs for data structures https://media.discordapp.net/attachments/371759389889003532/1091002333460172851/image.png |
14:20:56 | FromDiscord | <kcvinker> In reply to @PMunch "Hmm, actually not sure": So the `toAddr` functions is not get called |
14:22:48 | FromDiscord | <Yardanico> In reply to @PMunch "Hmm, actually not sure": isn't it because you're using addr and not unsafeAddr |
14:22:58 | FromDiscord | <Yardanico> or mark x as var T |
14:23:05 | FromDiscord | <Yardanico> both ways will make the code compile |
14:23:22 | FromDiscord | <Yardanico> and yes, in nim devel (and 2.0) addr is the same as unsafeaddr, but not in 1.6.x |
14:26:28 | FromDiscord | <kcvinker> @Yardanico `x.unsafeAddr` is working |
14:26:34 | FromDiscord | <Yardanico> yeah i know :) |
14:26:59 | FromDiscord | <Yardanico> in stable nim versions addr can't take the address of "immutable" data locations, so you need unsafeAddr |
14:27:56 | FromDiscord | <kcvinker> comparing to C family language's `&` operator, `unsafeAddr` is bit lngthy |
14:28:16 | FromDiscord | <kcvinker> (edit) "lngthy" => "lengthy" |
14:28:31 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=4sex |
14:29:18 | FromDiscord | <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:44 | FromDiscord | <kcvinker> In reply to @Yardanico "because Nim is not": That's great. It's shorter than unsafeAddr |
14:30:03 | FromDiscord | <Yardanico> no one is stopping you from making your own operator as a shorthand for addr |
14:30:24 | FromDiscord | <kcvinker> In reply to @Yardanico "no one is stopping": Oh, I see. Yeah, that's right |
14:30:29 | * | rockcavera joined #nim |
14:30:50 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4sez |
14:31:03 | FromDiscord | <Yardanico> not & itself because strformat uses it by default for string formatting, and it's also the concat operator |
14:31:04 | FromDiscord | <kcvinker> Thanks for the sample |
14:32:10 | FromDiscord | <kcvinker> In reply to @Yardanico "not & itself because": My candidates are Odin's `^` operator and FreeBasic's `@` and `ptr` |
14:32:27 | FromDiscord | <Yardanico> @ is an operator used to turn things (arrays, strings) into sequences |
14:32:33 | FromDiscord | <Yardanico> ptr is already a keyword in Nim |
14:32:50 | FromDiscord | <Yardanico> ^ is used for creating slices |
14:33:23 | FromDiscord | <Yardanico> but is there a reason you write so much raw pointers code you need a shorthand operator for it? :P |
14:33:30 | FromDiscord | <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:46 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @System64 "This is my bindings": This is the one I generated |
14:33:52 | FromDiscord | <kcvinker> In reply to @Yardanico "but is there a": Just for easiness |
14:34:53 | FromDiscord | <kcvinker> @Yardanico Yeah, in my current project, there is a lot of windows api function calls. |
14:35:34 | FromDiscord | <kcvinker> My IDE always list `unsafeAddr` under some other items in auto correction list |
14:36:20 | FromDiscord | <Yardanico> wdym other items? |
14:36:48 | FromDiscord | <Yardanico> both addr and unsafeAddr are operators, not keywords |
14:37:37 | FromDiscord | <kcvinker> In reply to @Yardanico "wdym other items?": If i remember correctly, `unsafeNew` is the first item |
14:37:45 | FromDiscord | <kcvinker> I am not sure. Let me check that |
14:37:58 | FromDiscord | <Yardanico> not sure what you mean, but it's the ide's nim plugin fault probably |
14:38:03 | FromDiscord | <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:09 | FromDiscord | <Yardanico> really there's no much difference between addr or your own proc that's called something like myAddr |
14:38:09 | FromDiscord | <kcvinker> In reply to @Yardanico "not sure what you": Oh I see |
14:38:20 | FromDiscord | <Yardanico> except that addr is implemented as a compiler magic, but it's still defined as a normal proc |
14:38:28 | FromDiscord | <Yardanico> <https://nim-lang.org/docs/system.html#addr%2CT> |
14:38:48 | FromDiscord | <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:31 | FromDiscord | <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:05 | FromDiscord | <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:33 | FromDiscord | <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:32 | FromDiscord | <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:40 | FromDiscord | <eyes> Anyone here ever parsed strings to DateTime objects? |
15:59:44 | FromDiscord | <eyes> sent a code paste, see https://play.nim-lang.org/#ix=4sfd |
15:59:55 | FromDiscord | <eyes> (edit) "https://play.nim-lang.org/#ix=4sfd" => "https://play.nim-lang.org/#ix=4sfe" |
16:00:06 | FromDiscord | <eyes> (edit) "https://play.nim-lang.org/#ix=4sfe" => "https://play.nim-lang.org/#ix=4sff" |
16:00:15 | FromDiscord | <eyes> it has a to_date function which converts string to this format |
16:00:29 | FromDiscord | <eyes> i would write a converter but idk shit about datetime formats |
16:00:47 | FromDiscord | <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:59 | FromDiscord | <eyes> worried there would be tiny difficult to debug mismatches between the original rfc3339 and the nim stdlib version |
16:03:50 | FromDiscord | <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:00 | FromDiscord | <Nerve> I think I understand DateTimes well enough |
16:15:57 | FromDiscord | <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:31 | FromDiscord | <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:19 | FromDiscord | <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:33 | FromDiscord | <Nerve> Just be careful with your timezone |
17:02:15 | FromDiscord | <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:50 | FromDiscord | <Nerve> (edit) "you" => "I" | "you're" => "I'm" |
17:04:26 | FromDiscord | <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:22 | FromDiscord | <sOkam!> kk ty ✍️ |
17:23:38 | * | derpydoo joined #nim |
17:24:37 | FromDiscord | <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:54 | luis_ | Nim taking the F right now (Primagean): https://www.youtube.com/watch?v=OG1uDoVtL_U |
17:28:21 | FromDiscord | <djazz> I saw it on stream too luis_ 😅 |
17:28:27 | FromDiscord | <djazz> compared to vlang |
17:31:07 | luis_ | Yeah, sadly.. Well, what can be said... The language is excellent, but not surfing any hype?! |
17:31:23 | FromDiscord | <Nerve> PLs are hype-driven projects |
17:31:56 | FromDiscord | <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:07 | FromDiscord | <Nerve> But people kneecap themselves because "pfft Nim what is that don't care" |
17:32:29 | FromDiscord | <Nerve> That's just human nature |
17:33:56 | FromDiscord | <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:20 | FromDiscord | <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:47 | FromDiscord | <Nerve> Everyone's gotta keep in mind that Rust has a marketing budget, and the primary audience for that is web devs |
17:35:05 | FromDiscord | <Nerve> That's a lot of people who know nothing about the wider programming world |
17:36:03 | FromDiscord | <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:54 | FromDiscord | <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:18 | FromDiscord | <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:55 | FromDiscord | <djazz> sent a code paste, see https://play.nim-lang.org/#ix=4sfH |
17:38:57 | FromDiscord | <djazz> shortened example |
17:39:06 | FromDiscord | <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:09 | FromDiscord | <Nerve> (edit) "parametert" => "parameter" |
17:39:33 | FromDiscord | <djazz> Hmm |
17:39:45 | FromDiscord | <djazz> They are in separate modules now |
17:39:54 | FromDiscord | <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:06 | FromDiscord | <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:10 | FromDiscord | <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:17 | FromDiscord | <Nerve> (edit) "two" => "multiple" |
17:41:21 | * | xet7 joined #nim |
17:41:31 | FromDiscord | <Nerve> (edit) "Basically anywhere that multiple ... types" added "object" |
17:42:21 | FromDiscord | <djazz> Yeah I know about that feature and generics, but I don't think that's the solution |
17:43:31 | FromDiscord | <djazz> since its two different fields |
17:43:40 | FromDiscord | <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:44 | FromDiscord | <Nerve> If the language is statically typed, that is |
17:52:39 | FromDiscord | <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:24 | FromDiscord | <Nerve> In reply to @Rictus "idk if Py is": Python was a secret weapon, once upon a time |
18:08:40 | FromDiscord | <ricky> 🍝 |
18:08:59 | FromDiscord | <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:39 | FromDiscord | <Andreas> In reply to @Nerve "It still has much": the new Python-Compiler from MIT might become a game-changer.. |
18:17:36 | FromDiscord | <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:56 | FromDiscord | <Nerve> sent a long message, see http://ix.io/4sfZ |
18:22:16 | FromDiscord | <Nerve> (edit) "http://ix.io/4sfZ" => "http://ix.io/4sg0" |
18:23:23 | FromDiscord | <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:38 | FromDiscord | <Nerve> (edit) "Think about how many projects ... probably" added "from the 90's and early 00's" |
18:23:44 | FromDiscord | <Nerve> (edit) "Think about how many projects from the 90's and early 00's ... probably" added "that" |
18:24:08 | FromDiscord | <Nerve> I mean, there weren't too many alternatives...but now there are |
18:26:01 | FromDiscord | <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:18 | FromDiscord | <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:12 | FromDiscord | <kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4sg1 |
18:29:41 | FromDiscord | <kcvinker> It is null terminated |
18:29:46 | FromDiscord | <Nerve> sent a long message, see http://ix.io/4sg2 |
18:31:13 | FromDiscord | <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:19 | FromDiscord | <Nerve> (edit) "java." => "Java." |
18:31:27 | FromDiscord | <Nerve> (edit) "you're" => "your" |
18:35:08 | FromDiscord | <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:34 | FromDiscord | <Nerve> I agree there that C is being recognized as a pretty-okay cross-platform assembly language |
18:36:58 | FromDiscord | <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:11 | FromDiscord | <Andreas> (edit) "one" => "know" |
18:40:12 | FromDiscord | <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:58 | FromDiscord | <Marcus> Is the nim documentation using a mashup of rst and md? Seems a bit weird. |
18:45:00 | FromDiscord | <Marcus> I can confirm this is what attracted me. Specially being able to bridge c++ stuff↵(@Andreas) |
18:48:40 | FromDiscord | <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:20 | FromDiscord | <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:35 | FromDiscord | <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:26 | FromDiscord | <Nerve> I'm saying that Nim would be a better choice than Rust for most of those projects |
19:19:54 | FromDiscord | <Nerve> Thereby pointing out that we are irrational hype-driven creatures by default |
19:20:42 | FromDiscord | <System64 ~ Flandre Scarlet> I have an idea to convince people |
19:20:53 | FromDiscord | <System64 ~ Flandre Scarlet> Tensorflow on Nim |
19:22:30 | FromDiscord | <System64 ~ Flandre Scarlet> Pillow on Nim |
19:22:33 | FromDiscord | <I have 50GB of nothing on my PC> data science people clearly dont mind using bad languages |
19:22:57 | FromDiscord | <System64 ~ Flandre Scarlet> Python is not bad, but flawed |
19:23:14 | FromDiscord | <I have 50GB of nothing on my PC> I was thinking about R more |
19:24:02 | FromDiscord | <System64 ~ Flandre Scarlet> Should we talk about↵Php? |
19:25:04 | FromDiscord | <System64 ~ Flandre Scarlet> A function that can return a string or null or an array of strings↵Bruh wtf sus?! |
19:25:31 | FromDiscord | <I have 50GB of nothing on my PC> assuming there's no undefined behaviour (not obvious with php's stdlib) |
19:25:50 | FromDiscord | <guttural666> In reply to @Nerve "I'm saying that Nim": reminds me of Nvidea |
19:26:27 | FromDiscord | <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:28 | FromDiscord | <guttural666> (edit) "In reply to @Nerve "I'm saying that Nim": reminds me of Nvidea ... " added "(they hype comment)" |
19:28:08 | FromDiscord | <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:56 | FromDiscord | <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:55 | FromDiscord | <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:33 | FromDiscord | <guttural666> In reply to @Isofruit "As someone with a": that's the employment strat |
19:30:49 | FromDiscord | <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:56 | FromDiscord | <kcvinker> How to convert a `seq[char]` into string ? |
19:32:00 | FromDiscord | <guttural666> https://media.discordapp.net/attachments/371759389889003532/1091082416862543922/image.png |
19:32:15 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sgo |
19:32:23 | FromDiscord | <Phil> Screw you! |
19:32:26 | FromDiscord | <guttural666> my AI overlord was correct hahaha |
19:32:44 | FromDiscord | <guttural666> the machine spirit never lets me down xD |
19:32:44 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @guttural666 "": CHATGPT finally supports Nim? |
19:33:06 | FromDiscord | <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:21 | FromDiscord | <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:27 | FromDiscord | <Phil> And it'll become unlikely somebody tackled your particular problem in nim before very quickly |
19:33:55 | FromDiscord | <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:14 | FromDiscord | <kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4sgr |
19:34:21 | FromDiscord | <guttural666> In reply to @Isofruit "That's less of a": well, it does more than that to be fair |
19:34:30 | FromDiscord | <guttural666> not just copying stuff from stackoverflow |
19:34:34 | FromDiscord | <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:59 | FromDiscord | <Phil> In reply to @guttural666 "not just copying stuff": Ehhhhhhhhhhhhhhhhhhhhhhhhhh↵Expand that h by a lot more h's |
19:35:10 | FromDiscord | <kcvinker> So x.join() is the answer ? |
19:36:04 | FromDiscord | <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:13 | FromDiscord | <Phil> In reply to @kcvinker "So x.join() is the": Yeah |
19:36:31 | FromDiscord | <kcvinker> In reply to @Isofruit "Yeah": Thanks. Let me try |
19:36:53 | FromDiscord | <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:15 | FromDiscord | <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:39 | FromDiscord | <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:13 | FromDiscord | <guttural666> I ended up parsing by hand because the overhead was too high, but I learned a ton |
19:40:13 | FromDiscord | <guttural666> In reply to @Isofruit "At least that's for": absolutely, but if you know that, you win anyway |
19:41:05 | FromDiscord | <kcvinker> In reply to @Isofruit "Yeah": Unfortunately `x.join()` didn't worked |
19:41:18 | FromDiscord | <Phil> Code or it didn't happen 😛 |
19:42:55 | FromDiscord | <kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4sgt |
19:44:04 | FromDiscord | <Phil> And the error is? |
19:45:07 | FromDiscord | <Phil> if it is `Error: attempting to call undeclared routine: 'join'` then I'd ask you to look at your imports 😛 |
19:45:29 | FromDiscord | <kcvinker> In reply to @Isofruit "if it is `Error:": No no |
19:45:32 | FromDiscord | <kcvinker> No error |
19:45:38 | FromDiscord | <kcvinker> Just the empty string |
19:45:49 | FromDiscord | <kcvinker> Let me check once again |
19:46:10 | FromDiscord | <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:33 | FromDiscord | <Graveflo> sent a long message, see http://ix.io/4sgu |
19:47:50 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sgv |
19:48:44 | FromDiscord | <kcvinker> In reply to @Isofruit "Like, what is your": Got the point. Let me check from the beginning |
19:48:45 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4sgv" => "https://play.nim-lang.org/#ix=4sgw" |
19:49:16 | FromDiscord | <Phil> You're never ever writing to s so currently it's the only possible outcome |
19:53:28 | FromDiscord | <kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4sgz |
19:56:22 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sgB |
19:56:36 | FromDiscord | <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:05 | FromDiscord | <Graveflo> you can see by redirecting std out to a file and look at the file in a hex editor |
19:57:08 | FromDiscord | <Phil> You want the bytes allocated for the most part? |
19:57:25 | FromDiscord | <Graveflo> (edit) "bull" => "null" |
19:57:30 | FromDiscord | <kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4sgC |
19:59:10 | FromDiscord | <Phil> I do not understand how "join" doesn't do the same here, but if it works I'm glad for you. |
19:59:13 | FromDiscord | <kcvinker> @Phil Yes, `result = s.join()` is working |
19:59:39 | FromDiscord | <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:57 | FromDiscord | <Phil> Checking with `echo x.repr`, they both produce null bytes-containing strings |
20:00:07 | FromDiscord | <Elegantbeef> Yes string is `\0` terminated whereas seq[char] is not |
20:00:32 | FromDiscord | <Elegantbeef> Note Nim strings are pascal strings and not just null terminated strings |
20:00:40 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sgG |
20:01:05 | FromDiscord | <Elegantbeef> Phil is right abotu the behaviour |
20:01:36 | FromDiscord | <kcvinker> In reply to @Elegantbeef "Yes string is `\0`": In my case this seq[char] is null terminated |
20:02:11 | FromDiscord | <Elegantbeef> No char is not null terminated |
20:02:16 | FromDiscord | <Elegantbeef> In your case you just allocated 20 characters and default for that is \\0 |
20:02:40 | FromDiscord | <Graveflo> could be a "depends how you use it" scenario |
20:02:48 | FromDiscord | <kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4sgI |
20:04:39 | FromDiscord | <kcvinker> if you print the contents of buffer, last item must be 0 |
20:05:03 | FromDiscord | <Elegantbeef> What's even the problem |
20:05:24 | FromDiscord | <kcvinker> Not at all |
20:07:08 | FromDiscord | <Elegantbeef> ok |
20:10:31 | FromDiscord | <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:57 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @guttural666 "it always has, but": Oh alright |
20:16:19 | FromDiscord | <Elegantbeef> You can `exportC` and `{.compile.}` grave |
20:16:34 | FromDiscord | <Elegantbeef> I'd need more information about that library to give better information |
20:17:04 | FromDiscord | <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:43 | FromDiscord | <Elegantbeef> Jesus this month has a shit load of productive Nim programmers 😄 |
20:17:48 | FromDiscord | <eyes> being able to do MM/DD/YYYY vs DD-MM-YYYY or whatever |
20:17:59 | FromDiscord | <eyes> we! need! threads! in the discord chat! |
20:18:04 | FromDiscord | <eyes> or maybe just more chats |
20:18:18 | FromDiscord | <Elegantbeef> Nah i was talking in response to TMWN submissions |
20:18:24 | FromDiscord | <eyes> ah |
20:18:49 | FromDiscord | <Elegantbeef> Are threads disabled in discord? |
20:18:54 | FromDiscord | <Elegantbeef> They work on matrix 😛 |
20:20:43 | FromDiscord | <eyes> oh what |
20:20:49 | FromDiscord | <eyes> maybe ill switch to the matrix chat then |
20:21:24 | FromDiscord | <morgan> oh yeah that's weird |
20:21:45 | FromDiscord | <morgan> threads have been pretty nice on other servers, highly recommend enabling them |
20:22:16 | FromDiscord | <morgan> also anyone know what's going on with nimdocs.com? i'm getting a timeout on it |
20:22:17 | FromDiscord | <Phil> In reply to @Elegantbeef "Are threads disabled in": What client you on? |
20:22:52 | FromDiscord | <morgan> i'm on the normal desktop discord client and i don't see them |
20:27:13 | FromDiscord | <Graveflo> sent a long message, see http://ix.io/4sgP |
20:30:30 | FromDiscord | <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:01 | FromDiscord | <Phil> In reply to @MorganAlyssa "also anyone know what's": Never head of the page, loads super slow for me as well |
20:31:19 | FromDiscord | <morgan> i get an error page from cloudflare |
20:31:43 | FromDiscord | <Phil> Same |
20:36:47 | FromDiscord | <Elegantbeef> @Graveflo exportc tells nim to emit types/procedures with verbatim names |
20:36:55 | FromDiscord | <Elegantbeef> It stops mangling, so it works with static and dynamic alike |
20:37:21 | FromDiscord | <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:52 | FromDiscord | <Elegantbeef> I guess it needs the C imports for the type layout, so maybe i'm silly |
20:40:00 | FromDiscord | <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:26 | FromDiscord | <Elegantbeef> Eitherway this is going to take two passes I imagine |
20:41:57 | FromDiscord | <Elegantbeef> Nim -\> Generate Types -\> C -\> Compile Normal Nim |
20:42:59 | FromDiscord | <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:38 | FromDiscord | <Graveflo> (edit) "ni" => "nim" |
20:45:11 | FromDiscord | <morgan> @treeform nimdocs is down |
20:53:44 | NimEventer | New thread by alexeypetrushin: Any bad consequence of redefining equality for ref types?, see https://forum.nim-lang.org/t/10049 |
20:55:09 | FromDiscord | <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:15 | FromDiscord | <Phil> Turns out nim also does pointer equality |
20:55:35 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sgX |
20:55:56 | FromDiscord | <Phil> Does anyone actually care about pointers being equal rather than data being equal? |
20:55:56 | FromDiscord | <Elegantbeef> Of course it does 😄 |
20:56:29 | FromDiscord | <Elegantbeef> Pointers being equal is a much cheaper check than `a[] == b[]` |
20:56:33 | FromDiscord | <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:41 | FromDiscord | <Graveflo> in python that would would be true. The analog to pointer equality would be`is` . Some langs do it differently |
20:57:08 | FromDiscord | <Elegantbeef> Generally speaking for most reference types if the ptr is different the data likely is aswell |
20:57:25 | FromDiscord | <Elegantbeef> Of course we can argue "what about ref int" or similar |
20:58:48 | FromDiscord | <Elegantbeef> The compiler for instance uses references a lot |
20:59:02 | FromDiscord | <Elegantbeef> And as such uses pointer comparisons |
20:59:36 | FromDiscord | <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:58 | FromDiscord | <Elegantbeef> What? |
21:00:45 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sh2 |
21:01:01 | FromDiscord | <Elegantbeef> I mean if i do not care about `T` i write `auto` |
21:01:46 | FromDiscord | <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:10 | FromDiscord | <Elegantbeef> Sure but you also write `let a: MyType = MyType.init(...)` |
21:02:12 | FromDiscord | <Phil> So identifying generics becomes easier, I really like markers like that for glancing through stuff |
21:02:43 | FromDiscord | <Phil> Lies!↵I write `let a: MyType = init(MyType)`! |
21:02:55 | FromDiscord | <Phil> And even that only sometimes |
21:02:57 | FromDiscord | <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:50 | FromDiscord | <Phil> Hmm that would enable you to convey more information |
21:04:10 | FromDiscord | <Phil> "This type can be whatever, but I don't particularly have any of my logic build upon which type it is" |
21:04:20 | FromDiscord | <Phil> (edit) "is"" => "is or need to do any logic on the type itself"" |
21:04:53 | FromDiscord | <Elegantbeef> auto conveys the same |
21:05:24 | FromDiscord | <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:27 | FromDiscord | <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:35 | FromDiscord | <Elegantbeef> `auto` means "I really do not care about the type, we'll be using procedures to disambiguate |
21:06:04 | FromDiscord | <Elegantbeef> So then you agree there is a reason to have auto, disembarking from your original comment |
21:06:06 | FromDiscord | <Elegantbeef> Nice |
21:06:36 | FromDiscord | <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:27 | FromDiscord | <Elegantbeef> To add on you can also do `proc doThing(a: Type[auto])` which is just an uglier `proc doThing(a: Type)` |
21:07:35 | FromDiscord | <Elegantbeef> `auto` is atleast consistent for generic parameters |
21:07:56 | FromDiscord | <Elegantbeef> Also sorta consistent as a return value |
21:15:25 | FromDiscord | <0ffh> In reply to @Isofruit "Does anyone actually care": Yup. |
21:16:04 | FromDiscord | <0ffh> For example, pointers equal implies data equal, with just one comparison. |
21:16:11 | * | derpydoo quit (Quit: derpydoo) |
21:16:13 | FromDiscord | <0ffh> That's why people do string interning. |
21:16:50 | FromDiscord | <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:22 | FromDiscord | <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:32 | FromDiscord | <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:46 | FromDiscord | <guttural666> (edit) "thethiing" => "thething" |
21:50:08 | * | xet7 quit (Ping timeout: 268 seconds) |
21:50:53 | FromDiscord | <morgan> as two separate matches or as one thing? |
21:51:13 | FromDiscord | <morgan> and no case-sensitivity? |
21:52:35 | FromDiscord | <guttural666> nah, that example would be one search string and yes, the user will not use case sensitive search |
21:53:12 | FromDiscord | <morgan> there may be an option for case-insenstive match, but you could also just convert both to lowercase first |
21:55:13 | FromDiscord | <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:13 | FromDiscord | <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:20 | FromDiscord | <michaelb.eth> (edit) "is there a mechanism at compile-time to ... get" added "automatically" |
22:17:48 | FromDiscord | <djazz> In reply to @michaelb.eth "is there a mechanism": https://nim-lang.org/docs/typetraits.html#distinctBase%2Ctypedesc%2Cstaticbool |
22:18:42 | FromDiscord | <djazz> and https://nim-lang.org/docs/typetraits.html#distinctBase.t%2CT%2Cstaticbool |
22:46:44 | FromDiscord | <oxnan> sent a code paste, see https://play.nim-lang.org/#ix=4shd |
22:47:14 | FromDiscord | <Elegantbeef> isnt `->` just dereference access? |
22:47:32 | FromDiscord | <auxym> it is in C, not sure about c++ |
22:47:42 | FromDiscord | <Elegantbeef> so just `pdata[].hsymlink` or `pdata.hsymlink` |
22:47:44 | FromDiscord | <auxym> nim just automatically dereferences ref types |
22:48:02 | FromDiscord | <oxnan> that is very possible. I don't write c++ myself, so I did not exactly know what to search for 😛 |
22:48:12 | FromDiscord | <auxym> automatically dereferences field accesses on ref types, to be exact |
22:48:25 | FromDiscord | <oxnan> i'll try some different options and see what sticks 🙂 |
22:49:19 | FromDiscord | <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:43 | FromDiscord | <michaelb.eth> In reply to @djazz "https://nim-lang.org/docs/typetraits.html#distinctB": many thanks! |
23:02:59 | * | luis_ joined #nim |
23:27:01 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4shk |
23:27:25 | FromDiscord | <Elegantbeef> Well that should be `x: (ref object or ptr object)` 😛 |
23:27:46 | FromDiscord | <Elegantbeef> And it should be `x[].y` if we want it fully compatible |
23:41:24 | FromDiscord | <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:57 | FromDiscord | <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:17 | FromDiscord | <Elegantbeef> Well matrix does now have threads, so it's mainly just a bridge issue |
23:43:28 | FromDiscord | <Yardanico> yeah, and then also a moderation one :) |
23:43:29 | FromDiscord | <Elegantbeef> And using the outdated host of t2bot isnt helping much 😄 |
23:43:38 | FromDiscord | <Yardanico> wdym? |
23:43:56 | FromDiscord | <Elegantbeef> The bridge that t2bot hosts is outdated the last i checked |
23:44:44 | FromDiscord | <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:49 | FromDiscord | <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:54 | FromDiscord | <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:35 | FromDiscord | <Elegantbeef> The nice thing is the matrix chat is capable of being fully downloaded if someone really wanted to index it |
23:49:26 | FromDiscord | <Yardanico> yes but you can download the discord chat too, such tools exist |
23:49:38 | FromDiscord | <Yardanico> but the main problem is people asking the same questions again and again, that's why things like SO exist :P |
23:49:41 | FromDiscord | <Elegantbeef> Not first part supported so I do not care |
23:49:47 | FromDiscord | <Elegantbeef> party\ |
23:57:42 | FromDiscord | <Elegantbeef> Any of you numtpies have something to submit to TMWN, already have a shit load of entries but might as well go bigger 😛 |