| 00:51:06 | * | skippy8 joined #nim |
| 01:05:48 | * | oisota0 joined #nim |
| 01:06:03 | * | oisota quit (Read error: Connection reset by peer) |
| 01:06:03 | * | oisota0 is now known as oisota |
| 01:07:20 | * | ttkap quit (Ping timeout: 260 seconds) |
| 01:07:55 | * | FromDiscord quit (Ping timeout: 260 seconds) |
| 01:08:23 | * | FromDiscord joined #nim |
| 01:08:42 | * | ttkap joined #nim |
| 02:10:12 | * | acidsys quit (Server closed connection) |
| 02:10:35 | * | acidsys joined #nim |
| 02:45:38 | * | rockcavera quit (Remote host closed the connection) |
| 05:28:56 | * | andy-turner joined #nim |
| 06:41:08 | FromDiscord | <albassort> do any other languages have an \r\L thing |
| 06:41:19 | FromDiscord | <albassort> or is it just nim that does recvLine like this |
| 06:47:31 | FromDiscord | <albassort> beef |
| 06:47:45 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=sNxPbxdD |
| 06:49:33 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=GRLfmhjs |
| 06:50:29 | FromDiscord | <Elegantbeef> Hell not you're converting an integer to a string |
| 06:50:37 | FromDiscord | <Elegantbeef> That's not how any of this work |
| 06:51:20 | FromDiscord | <albassort> integer -> ordinals -> string |
| 06:51:44 | FromDiscord | <albassort> i bother beef when i could just reference my own code :3 |
| 06:52:03 | FromDiscord | <Elegantbeef> `cast[string]` should never be valid |
| 06:52:50 | FromDiscord | <albassort> then whats the cheap way to convert an array[char] to string |
| 06:53:20 | FromDiscord | <leorize> who doesn't have support for CRLF these days↵(@albassort) |
| 06:53:37 | FromDiscord | <albassort> gonna do byte prefix just encase |
| 06:54:51 | FromDiscord | <Elegantbeef> There is no cheap way↵(@albassort) |
| 06:55:02 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=KYrOAvTS |
| 06:55:28 | FromDiscord | <albassort> what if i just like, told the compiler that if i add a length prefix to my array[char] its now a stirng and leave me alone |
| 06:55:56 | FromDiscord | <albassort> just like that |
| 06:55:56 | FromDiscord | <albassort> at the codebase |
| 06:56:08 | FromDiscord | <Elegantbeef> That's not what a Nim string is |
| 06:56:27 | FromDiscord | <albassort> what is a nim string |
| 06:56:30 | FromDiscord | <albassort> i thought we had pascal strings |
| 06:57:29 | FromDiscord | <Elegantbeef> They are pascal |
| 06:57:45 | FromDiscord | <Elegantbeef> but they' `len, data: ptr (cap: int, chars: UncheckedArray[char]])` |
| 06:58:27 | FromDiscord | <Elegantbeef> Also cap is used to indicate whether the string is cow |
| 06:58:57 | FromDiscord | <albassort> ok but what would that look like in packed memory |
| 06:59:06 | FromDiscord | <albassort> int, int, array |
| 06:59:12 | FromDiscord | <albassort> (edit) "array" => "data" |
| 06:59:34 | FromDiscord | <leorize> I don't know why you want to mint strings like this even |
| 07:00:20 | FromDiscord | <albassort> it would be... fast? |
| 07:00:23 | FromDiscord | <Elegantbeef> This is questionable |
| 07:01:42 | FromDiscord | <Elegantbeef> Why do you need to return the array |
| 07:01:48 | FromDiscord | <Elegantbeef> Just give the procedure the socket |
| 07:02:24 | FromDiscord | <leorize> or like, perform vectorized I/O, which was designed precisely for this |
| 07:03:08 | FromDiscord | <Elegantbeef> Same difference |
| 07:03:30 | FromDiscord | <albassort> what is this |
| 07:05:00 | FromDiscord | <albassort> i can google if you wihs |
| 07:05:02 | FromDiscord | <albassort> (edit) "wihs" => "wish" |
| 07:08:55 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=nLWsBlOA |
| 07:09:26 | FromDiscord | <albassort> this does 2 copies 2 writes |
| 07:09:50 | FromDiscord | <albassort> 1. copies from the sizes, makes sure its little endian↵2. copies the message into the char array |
| 07:09:57 | FromDiscord | <Elegantbeef> `cast[array[3, char]]` are you uh... sure you want a cast? |
| 07:11:06 | FromDiscord | <leorize> you should lookup `writev` |
| 07:11:10 | FromDiscord | <albassort> no, i dont need a cast, thats stupid, why would i need that i can just copy from the integer |
| 07:11:27 | FromDiscord | <albassort> :) |
| 07:11:47 | FromDiscord | <leorize> `writev` let you drop the output buffer by allowing you to send disjoint buffers in one `write` operation |
| 07:12:34 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1404724225108869161/image.png?ex=689c3ae1&is=689ae961&hm=29e6bd21dd8680f6598744e3d5d137f7acf30cdf3a9dbbc53c13453010575d4e& |
| 07:12:48 | FromDiscord | <albassort> this one? |
| 07:13:14 | FromDiscord | <leorize> I'm not talking about nim |
| 07:13:34 | * | shrikant joined #nim |
| 07:13:41 | FromDiscord | <leorize> https://www.man7.org/linux/man-pages/man2/writev.2.html |
| 07:14:11 | FromDiscord | <albassort> ah i see |
| 07:14:20 | FromDiscord | <leorize> nim might not have high-level wrappers for this, but this is more or less a standard i/o operation by now and everyone supports it |
| 07:15:32 | FromDiscord | <albassort> In reply to @leorize "nim might not have": i could probably make one and make it part of the bundle of things im doing |
| 07:15:37 | FromDiscord | <albassort> seems somewhat useful |
| 07:15:45 | FromDiscord | <albassort> or i could just not |
| 07:22:01 | FromDiscord | <albassort> if someone says "bazinga" within the next 15 minutes I'll make a vwrite vread wrapper |
| 07:22:17 | FromDiscord | <albassort> (edit) "if someone says "bazinga" within the next 15 minutes I'll make a vwrite vread wrapper ... " added "with complete unittests and documentation" |
| 07:22:32 | FromDiscord | <albassort> and i'll have it finished before my birthday |
| 07:22:38 | FromDiscord | <albassort> (edit) "and i'll have it finished before my birthday ... " added "aug 25th" |
| 07:23:01 | FromDiscord | <albassort> (edit) "vwrite vread" => "writev readv" |
| 07:27:10 | * | xet7 joined #nim |
| 07:29:24 | FromDiscord | <albassort> i suppose not |
| 08:39:21 | * | beholders_eye joined #nim |
| 09:01:52 | * | beholders_eye quit (Ping timeout: 260 seconds) |
| 09:06:16 | * | beholders_eye joined #nim |
| 09:21:12 | * | andy-turner quit (Quit: Leaving) |
| 10:43:44 | FromDiscord | <saint._._.> Is there any progress on NIR (is that what it’s called?) |
| 10:44:09 | FromDiscord | <saint._._.> The compile to byte code that’s needed for IC |
| 11:14:14 | FromDiscord | <Phil> Forgive me if I'm wrong, brain fighting off a headache rn, but wouldn't that fall under nimony? |
| 11:59:25 | FromDiscord | <saint._._.> In reply to @isofruit "Forgive me if I'm": Oh cool thanks! That answers my question! Glad it’s coming along now |
| 13:42:03 | FromDiscord | <blashyrk> If Nim's dynamic dispatch uses subtype checking (ifs) to identify the subtype and call the appropriate method, does that mean in memory, all objects contain all possible fields of each subclass? |
| 13:42:33 | FromDiscord | <blashyrk> (edit) "If Nim's dynamic dispatch uses subtype checking (ifs) to identify the subtype and call the appropriate method, does that mean in memory, all objects ... contain" added "of base type" |
| 13:42:51 | FromDiscord | <blashyrk> (edit) "subclass?" => "subclass?↵↵For example in a seq of BaseType" |
| 14:27:41 | FromDiscord | <lainlaylie> each subtype contains the base type and its own fields, and the dispatch uses rtti to cast to the correct subtype |
| 14:27:49 | FromDiscord | <lainlaylie> you can check the generated c |
| 15:57:41 | FromDiscord | <ollicron_53732> https://tenor.com/view/ive-got-it-figured-out-thinking-idea-ive-got-it-all-gif-17924943 |
| 15:58:00 | FromDiscord | <ollicron_53732> I've figured it out! 😄 |
| 15:58:24 | FromDiscord | <ollicron_53732> I can now write macros for anything! 😄 ....MAYBE. |
| 16:33:24 | FromDiscord | <omar.bassam88> sent a long message, see https://pasty.ee/PUROgPaU |
| 16:45:02 | * | beholders_eye quit (Ping timeout: 260 seconds) |
| 16:51:13 | FromDiscord | <heysokam> In reply to @omar.bassam88 "Hi Everyone, I'm new": 1. None that I heard of↵2. https://github.com/nim-lang/nimony↵3. Dont know, but I'm sure beef would know↵4. Nim's stdlib lives in the main repo, so it sounds like the right place to me |
| 16:54:03 | FromDiscord | <omar.bassam88> In reply to @heysokam "1. None that I": So Nimony is like Nim v3 right? so does that mean hotCodeReloading is not expected to work in Nim 2? |
| 16:54:46 | FromDiscord | <heysokam> I don't know the answer to that myself, sorry |
| 17:17:05 | FromDiscord | <nervecenter> In reply to @omar.bassam88 "Hi Everyone, I'm new": iirc both concepts and object variants are going to get a look-over when Nim 3 is out, there have been implementation and syntactic discussions for quite a while |
| 17:28:32 | FromDiscord | <Phil> In reply to @ollicron_53732 "I can now write": If you want a pointer how to approach macros I can provide, I worked a decent amount with them and personally would consider my habits with them pretty decent |
| 17:30:25 | FromDiscord | <Phil> In reply to @omar.bassam88 "So Nimony is like": It isn't from all I've noticed. So far the general recommendation for larger projects have been to split the project up into a main binary and dynamically loaded libs that get compiled separately |
| 17:30:49 | FromDiscord | <Phil> (edit) "separately" => "separately, which isn't really all that different from the options you have in general in compiled languages without hot code reloading" |
| 17:48:42 | FromDiscord | <omar.bassam88> In reply to @nervecenter "iirc both concepts and": Will the code already written in Nim 2 compatible with Nim 3? or will it have breaking changes and libraries will need to be re-written? |
| 17:50:07 | FromDiscord | <Phil> I believe the aim is full compatibility, how much of that will be achieved we'll only know when the time comes |
| 18:26:50 | FromDiscord | <Elegantbeef> @omar.bassam88 Hot code reloading is not supported at all in Nim, I made my own solution myself. Automatic hot code reload is fraught with issues imo |
| 18:28:15 | FromDiscord | <Elegantbeef> Like HCR is there, but it's not tested or used |
| 18:29:46 | FromDiscord | <ollicron_53732> In reply to @isofruit "If you want a": That would be very helpful actually, as much as I find it easy to work with NimNode building, anything to speed up the process is nice |
| 18:31:14 | FromDiscord | <ollicron_53732> how does your process work ? because what I do is I write a sample, dump the tree and use it to build the AST using things like `newNimNode()` |
| 18:31:30 | FromDiscord | <Elegantbeef> Use `genast` as much as posible |
| 18:31:34 | FromDiscord | <Elegantbeef> possible even |
| 18:32:54 | FromDiscord | <ollicron_53732> genAst gets the AST from a macro; its useful for if you already have a macro and are using one to build another |
| 18:33:28 | FromDiscord | <ollicron_53732> didn't know that until you mentioned it 🤭 |
| 18:33:56 | FromDiscord | <ollicron_53732> works with templates too |
| 18:34:06 | FromDiscord | <ollicron_53732> but I like `dumpTree:` the most |
| 18:34:15 | FromDiscord | <ElegantBeef> Bridge went down, but nope |
| 18:34:17 | FromDiscord | <ElegantBeef> That's not genast |
| 18:34:20 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/genasts.html#17 is genast |
| 18:34:52 | FromDiscord | <omar.bassam88> In reply to @Elegantbeef "<@547488017737318425> Hot code reloading": Can you share your solution as an example please? I tried to make a solution myself using inotify but it felt hacky and not much re-usable |
| 18:35:07 | FromDiscord | <ElegantBeef> I also use inotify |
| 18:35:22 | FromDiscord | <ElegantBeef> My solution is very reusable and I've hooked it into two of my games https://github.com/beef331/potato |
| 18:35:52 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/genasts.html#17 |
| 18:37:20 | FromDiscord | <ElegantBeef> In reply to @omar.bassam88 "Can you share your": Checkout potatowatcher to see how I do the watching. I actually get the compiler to emit a list of all imported modules and watch every one, everytime it recompiles it gets a new list |
| 18:38:50 | FromDiscord | <ElegantBeef> But like I said automatic HCR is a bit of a pickle, I dump to a tagged union so you can add fields, but if you use pointer procedures it points to the previous procedures |
| 18:38:58 | FromDiscord | <ollicron_53732> what's a code reloader? |
| 18:39:06 | FromDiscord | <ollicron_53732> wait i should just use ai |
| 18:39:13 | FromDiscord | <ElegantBeef> No you should not just use ai |
| 18:39:57 | FromDiscord | <ollicron_53732> lol I just did, I think it's a cool concept |
| 18:40:55 | FromDiscord | <ollicron_53732> I don't even know how I would start a project like that |
| 18:41:30 | FromDiscord | <ollicron_53732> maybe using times module 🤷♂️ |
| 18:41:42 | FromDiscord | <ElegantBeef> Why would you use times to do anything? |
| 18:41:52 | FromDiscord | <ElegantBeef> There is no part of HCR that requires knowing the date or time |
| 18:42:21 | FromDiscord | <omar.bassam88> sent a code paste, see https://play.nim-lang.org/#pasty=TlFuBWQM |
| 18:43:07 | FromDiscord | <ElegantBeef> Well that's why it felt so hacky, cause it was just a hack |
| 18:43:50 | FromDiscord | <ollicron_53732> In reply to @elegantbeef "Why would you use": like use a timer to check for changes idk. |
| 18:44:02 | FromDiscord | <ElegantBeef> Your OS provides an API to alert you on file changes |
| 18:44:08 | FromDiscord | <ollicron_53732> o.O |
| 18:49:56 | * | xet7_ joined #nim |
| 18:51:04 | * | xet7 quit (Ping timeout: 276 seconds) |
| 19:48:10 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=DadQzFmd |
| 19:49:05 | FromDiscord | <leorize> it kinda explained itself |
| 19:49:08 | FromDiscord | <leorize> you're giving it a type |
| 19:49:24 | FromDiscord | <heysokam> what does that mean |
| 19:49:35 | FromDiscord | <Elegantbeef> You're giving it a type instead of a value |
| 19:50:10 | FromDiscord | <Phil> sent a long message, see https://pasty.ee/GjisqUHp |
| 19:50:13 | FromDiscord | <Elegantbeef> I'm repeating Leo today |
| 19:50:16 | FromDiscord | <heysokam> oh, `X`.. but should be `x`↵Classic me |
| 19:50:28 | FromDiscord | <Phil> (edit) "https://pasty.ee/vaLlWGAr" => "https://pasty.ee/YbNoCqzz" |
| 19:51:06 | FromDiscord | <Phil> (edit) "https://pasty.ee/ZjgRDBvF" => "https://pasty.ee/PRtKosMC" |
| 19:53:28 | FromDiscord | <Phil> Fundamentally generating code is not that different from generating HTML really. It is in fact better than generating HTML because if you generate broken HTML you only see that when you actually look at the file |
| 20:06:52 | FromDiscord | <ollicron_53732> I see, although I've never generated HTML, should be fun |
| 20:30:45 | * | Jjp137_ joined #nim |
| 20:30:51 | * | Jjp137 quit (Quit: Leaving) |
| 21:04:02 | * | shrikant quit (Ping timeout: 260 seconds) |
| 21:18:22 | * | rockcavera joined #nim |
| 21:31:39 | * | tiorock joined #nim |
| 21:31:40 | * | rockcavera quit (Killed (tungsten.libera.chat (Nickname regained by services))) |
| 21:31:40 | * | tiorock is now known as rockcavera |
| 21:42:58 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 21:43:30 | * | ehmry joined #nim |
| 22:28:36 | * | skippy8 quit (Quit: WeeChat 4.6.3) |
| 23:29:49 | * | xet7 joined #nim |
| 23:29:56 | * | xet7 quit (Remote host closed the connection) |
| 23:32:31 | * | xet7_ quit (Ping timeout: 276 seconds) |
| 23:37:04 | * | xet7 joined #nim |