00:03:27 | * | krux02_ joined #nim |
00:07:25 | * | krux02 quit (Ping timeout: 264 seconds) |
00:07:36 | * | ptdel joined #nim |
00:12:02 | * | tiorock joined #nim |
00:12:02 | * | rockcavera quit (Killed (card.freenode.net (Nickname regained by services))) |
00:12:02 | * | tiorock is now known as rockcavera |
00:12:02 | * | rockcavera quit (Changing host) |
00:12:02 | * | rockcavera joined #nim |
00:22:08 | * | xet7_ joined #nim |
00:22:16 | * | xet7_ quit (Remote host closed the connection) |
00:35:16 | * | Hideki_ joined #nim |
00:39:34 | * | Hideki_ quit (Ping timeout: 240 seconds) |
00:47:50 | * | my_dude quit (Quit: ZZZzzz…) |
01:00:25 | FromDiscord | <Rika> ?? what does it mean when i get an ObjectAssignmentError |
01:04:40 | FromGitter | <kaushalmodi> axion: Thanks. Glad you found my blog useful. |
01:04:54 | FromGitter | <dumjyl> slicing probably, upcasting an object without a pointer indirection. |
01:07:06 | * | Guest83817 quit (Ping timeout: 256 seconds) |
01:08:37 | * | dadada joined #nim |
01:09:01 | * | dadada is now known as Guest4842 |
01:09:22 | * | dwdv quit (Ping timeout: 256 seconds) |
01:39:53 | leorize | Rika: it means you messed up :P |
01:40:02 | leorize | so what did you do? |
01:40:45 | FromDiscord | <Rika> uh |
01:41:09 | FromDiscord | <Rika> `object of` then using `ObjectName(x: x...)` apparently doesnt work |
01:41:16 | FromDiscord | <Rika> has to be `ref object of` |
01:42:40 | * | endragor joined #nim |
01:42:53 | FromDiscord | <Rika> its old code, and im still suspecting that its wrong since ref objects dont use the `ObjectName()` thing |
01:43:00 | FromDiscord | <Rika> or do they now? |
01:43:40 | FromGitter | <dumjyl> old nim was more lenient about object slicing. |
01:44:35 | disruptek | `when false` works better than branches? yeesh. |
02:01:15 | * | Hideki_ joined #nim |
02:19:33 | * | Trustable quit (Remote host closed the connection) |
02:20:28 | * | Hideki_ quit (Remote host closed the connection) |
02:21:21 | * | Hideki_ joined #nim |
02:25:34 | * | Hideki_ quit (Ping timeout: 240 seconds) |
02:37:58 | * | Hideki_ joined #nim |
02:41:25 | * | chemist69 quit (Ping timeout: 246 seconds) |
02:43:26 | * | chemist69 joined #nim |
03:03:34 | * | my_dude joined #nim |
03:07:12 | * | my_dude quit (Client Quit) |
03:11:13 | * | rockcavera quit (Remote host closed the connection) |
03:11:18 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
03:26:10 | * | my_dude joined #nim |
03:26:14 | * | my_dude quit (Client Quit) |
03:26:42 | * | my_dude joined #nim |
03:27:01 | * | my_dude quit (Client Quit) |
03:27:28 | * | my_dude joined #nim |
03:27:48 | * | my_dude quit (Client Quit) |
03:59:55 | * | muffindrake quit (Ping timeout: 272 seconds) |
04:01:30 | * | nsf joined #nim |
04:02:02 | * | muffindrake joined #nim |
04:17:08 | * | lvmbdv quit (Quit: FBI OPEN UP FUCKO) |
05:19:40 | * | my_dude joined #nim |
05:20:41 | * | s4mu3lbk joined #nim |
05:21:43 | * | arecaceae quit (Remote host closed the connection) |
05:22:06 | * | arecaceae joined #nim |
05:25:07 | * | my_dude quit (Quit: ZZZzzz…) |
05:36:24 | * | my_dude joined #nim |
05:38:54 | * | s4mu3lbk quit (Ping timeout: 240 seconds) |
05:41:26 | * | my_dude quit (Quit: ZZZzzz…) |
05:42:01 | * | silvernode joined #nim |
05:43:59 | * | my_dude joined #nim |
05:47:25 | * | my_dude quit (Client Quit) |
05:48:15 | * | my_dude joined #nim |
05:51:20 | silvernode | Good morning |
05:51:33 | silvernode | How is everyone doing today? |
05:52:07 | * | my_dude quit (Client Quit) |
05:52:34 | * | my_dude joined #nim |
05:54:21 | * | my_dude quit (Client Quit) |
06:02:47 | * | pbb quit (Ping timeout: 272 seconds) |
06:18:55 | rmt | I've got this pain in all the diodes down my left side, a sore throat, a dry cough, and a small castle made out of an excessive number of of toilet paper rolls. Muhaha. |
06:19:00 | rmt | Thanks for asking. |
06:28:40 | silvernode | rmt: That's crazy, those are the apparent symptoms of COVID-19 |
06:29:21 | rmt | Also the dry cough, or just the castle building? |
06:30:19 | * | pbb joined #nim |
06:33:34 | silvernode | rmt: both |
06:34:25 | rmt | Wow. I should go tell someone the news. Maybe my grandma. She always knows what to do. bbk soon. |
06:35:33 | silvernode | Man I am so bad at using arrays, seqs and tables. Every time I try to build a basic text game I also get stuck on the inventory system. I know it's not hard to iterate over something and print the results but I am bad at design and logic so I always end up getting so stuck that I give up. |
06:36:02 | silvernode | also --> always |
06:36:28 | rmt | Text game, MUD style? |
06:36:50 | silvernode | rmt: sort of but not "type until you bleed" style |
06:37:38 | rmt | I'm pretty sure MUDs is what got me typing over 120 words-per-minute. ;-) |
06:38:06 | silvernode | People here have been trying to help me with example code. Tables seem to be the way to go but I already have a custom type with a seq that is to be the inventory or cargo of a space ship. |
06:41:58 | rmt | I wrote a MudOS based MUD once .. borrowed a lot of good code to do it. Good exercise - especially tying into the inter-mud messaging service.. learning about IP networking, security models, defensive coding.. if there was a way to abuse the system, some user would find it. Wish I still had the code. :-/ |
06:43:59 | silvernode | https://play.nim-lang.org/#ix=2eJU |
06:45:25 | silvernode | I almost had it working with the add() proc but the problem was that an Item was being added but not the way I wanted. |
06:46:36 | silvernode | I want items to stack instead of the cargo saying [Fuel, Fuel, Fuel], I want it to say [Fuel[20]] (or however many the player has. |
06:47:48 | FromDiscord | <Varriount> silvernode: Hm, does the inventory have a visual representation? |
06:47:49 | * | narimiran joined #nim |
06:48:15 | FromDiscord | <Varriount> And will it allow the user to rearrange things? |
06:48:33 | FromDiscord | <Varriount> will the user be able to arrange the same kind of item in multiple stacks? |
06:48:50 | silvernode | It will eventually, think of how you'd expect a RPG to play where you press I and a screen shows you what is in your backpack. That's how I eventually want it to be. |
06:49:04 | silvernode | No need to rearrange anything |
06:49:27 | silvernode | only adding and subtracting an item by a given amount |
06:49:46 | FromDiscord | <Varriount> If the inventory space is small, you can probably get away with just doing a linear search. |
06:50:43 | FromDiscord | <Varriount> `seq[Item]` |
06:51:26 | FromDiscord | <Varriount> Otherwise, you might employ a hash table to enable `O(n)` lookup for which slot a particular item is located at. |
06:52:13 | silvernode | Someone sent me an example of how I could do things with tables which appears to work, but as I said I am working with seqs but I could change everything to tables I suppose. |
06:52:58 | silvernode | *sigh* I have to clock in to work |
06:53:07 | FromDiscord | <Varriount> 😛 |
06:53:22 | silvernode | I will leave you with my project page and maybe you can get some ideas |
06:53:37 | silvernode | https://github.com/silvernode/space-nim/tree/experimental |
06:53:53 | silvernode | Ok, have a good day everyone. Thank you |
06:57:58 | * | Hideki_ quit (Remote host closed the connection) |
06:58:25 | * | silvernode quit (Ping timeout: 264 seconds) |
06:58:44 | * | Hideki_ joined #nim |
06:59:38 | FromDiscord | <Varriount> Hm, I wonder if I should emulate disruptek, and start my own Nim programming stream |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:01:02 | FromDiscord | <fluxinator2000> I'm trying to build an emulator and want to construct a big table of functions with some meta data for each function, but I can't seem to have procs in a tuple? This doesn't compile 🤔 |
07:01:02 | FromDiscord | <fluxinator2000> ```type TupleWithProc = tuple[p: proc()] |
07:01:02 | FromDiscord | <fluxinator2000> proc myProc() = discard |
07:01:02 | FromDiscord | <fluxinator2000> var x:TupleWithProc = (myProc)``` |
07:01:15 | * | EvergreenTree quit (Quit: Ping timeout (120 seconds)) |
07:01:43 | * | EvergreenTree joined #nim |
07:01:49 | FromDiscord | <Varriount> @fluxinator2000 Please use a paste service for code snippets, as pasting code doesn't show up well across the IRC bridge |
07:01:54 | * | rmt quit (Ping timeout: 250 seconds) |
07:02:06 | FromDiscord | <Varriount> Preferably https://play.nim-lang.org/ |
07:02:33 | * | solitudesf joined #nim |
07:03:08 | FromDiscord | <Varriount> @fluxinator2000 Ah, this is one of the tricky parts about function types - the type of the function is not only specified by the parameters and return type, but also the calling convention |
07:03:32 | * | Hideki_ quit (Ping timeout: 256 seconds) |
07:03:36 | FromDiscord | <Varriount> https://nim-lang.org/docs/manual.html#types-procedural-type |
07:03:55 | FromDiscord | <Varriount> See the 2nd paragraph, after the code blocks: |
07:04:17 | FromDiscord | <Varriount> > A subtle issue with procedural types is that the calling convention of the procedure influences the type compatibility: procedural types are only compatible if they have the same calling convention. |
07:04:38 | * | gmpreussner joined #nim |
07:04:48 | * | lain quit (Ping timeout: 268 seconds) |
07:05:57 | * | lain joined #nim |
07:06:43 | FromDiscord | <Varriount> @fluxinator2000 https://play.nim-lang.org/#ix=2eJV |
07:07:20 | FromDiscord | <Varriount> Also, to make a tuple with one element, you need to add a comma at the end, to distinguish between using parenthesis as a grouping technique |
07:15:14 | * | k0mpjut0r quit (Ping timeout: 260 seconds) |
07:15:14 | * | GitterIntegratio quit (Ping timeout: 260 seconds) |
07:28:20 | * | k0mpjut0r joined #nim |
07:30:28 | FromDiscord | <fluxinator2000> @Varriount This is still confusing to me so I have some reading and experimenting to do. I have stumbled on this problem before but never really understood it. With this Corona isolation I have no reason not to learn this stuff for real. Thanks! 😁 |
07:30:53 | FromDiscord | <Varriount> @fluxinator2000 What programming languages do you have experience with? |
07:33:49 | FromDiscord | <fluxinator2000> @Varriount Mostly Javascript. Before that I wrote alot of 32-bit assembly in windows 🙂 I'm a UX designer but programming has been my hobby for close to 20 years. I have also written quite a lot of code in Pascal, C#, Java. Past two years I did Advent of Code in Nim. |
07:34:08 | FromDiscord | <Varriount> Ah, ok. So you know what calling convention is? |
07:34:49 | FromDiscord | <fluxinator2000> yeah, but I guess on an intuitive level. Never really had to think about it. |
07:35:40 | FromDiscord | <Varriount> With Nim, you have 2 main calling conventions (with more if you're interfacing with languages like C) |
07:35:47 | FromDiscord | <Varriount> nimcall, and closure |
07:35:48 | * | Hideki_ joined #nim |
07:36:09 | FromDiscord | <fluxinator2000> javascript has closures I guess |
07:36:19 | FromDiscord | <fluxinator2000> so they capture the scope of the caller in some way |
07:36:22 | FromDiscord | <Varriount> Yeah |
07:37:13 | FromDiscord | <Varriount> From https://docs.microsoft.com/en-us/cpp/build/x64-software-conventions?view=vs-2019 : |
07:37:27 | FromDiscord | <Varriount> The __fastcall convention uses registers for the first four arguments and the stack frame to pass additional arguments. |
07:37:53 | FromDiscord | <Varriount> `nimcall` is usually (always?) equivalent to fastcall |
07:38:01 | FromDiscord | <Varriount> The fastcall convention uses registers for the first four arguments and the stack frame to pass additional arguments. |
07:38:48 | * | PMunch joined #nim |
07:38:51 | FromDiscord | <fluxinator2000> ah, I think I have used this before. I wrote assemlber code in Delphi many years ago and I remember it's using registers and stack together like this. |
07:39:19 | * | andinus joined #nim |
07:39:45 | FromDiscord | <Varriount> The `closure` calling convention is what you might call a "synthetic" calling convention |
07:40:24 | FromDiscord | <Varriount> Procedures with the `closure` calling convention are passed around as (what is essentially) a tuple containing the closure's "environment", and the actual function pointer. |
07:41:03 | FromDiscord | <Varriount> A closure's environment contains all the data from parent scopes that it needs to access. |
07:41:38 | FromDiscord | <fluxinator2000> Right. I can see problems with keeping closures in tuples so maybe that is not possible. |
07:42:04 | FromDiscord | <Varriount> It's not that closure's can't be kept in tuples, it's that you can't mix `nimcall` and `closure` procedures. |
07:42:29 | FromDiscord | <Varriount> When the compiler calls a `closure` procedure, it needs to know to pass in the environment as a hidden parameter |
07:43:35 | FromDiscord | <fluxinator2000> sounds reasonable |
07:44:19 | FromDiscord | <fluxinator2000> I think I need to study the documentation. Thanks for your time 🙂 |
07:44:21 | * | andinus quit (Quit: ERC (IRC client for Emacs 26.3)) |
07:45:02 | * | andinus joined #nim |
07:46:50 | FromDiscord | <Benumbed> Question... I have a situation where I'd like to type cast/convert a parent class up to a child class (basically copy the values in the incoming parent object to the same fields in the child object), however ChildType(parentObject) throws an ObjectConversionError... am I going about this wrong? |
07:47:33 | FromDiscord | <Benumbed> Maybe I'm tired and I'm thinking about casting an inhertance backasswards... |
07:47:42 | FromDiscord | <Benumbed> Maybe I'm tired andd I'm thinking about casting an inhertance backasswards... |
07:47:49 | FromDiscord | <Benumbed> Maybe I'm tired and I'm thinking about casting an inhertance backasswards... |
07:47:58 | FromDiscord | <Benumbed> Maybe I'm tired and I'm thinking about casting and inhertance backasswards... |
07:48:16 | * | Hideki_ quit (Ping timeout: 250 seconds) |
07:49:01 | PMunch | Haha, please don't edit your discord messages :P They come through as a complete copy |
07:49:09 | FromDiscord | <Benumbed> oh goddammit |
07:49:18 | FromDiscord | <Benumbed> *Facepalm* so sorry |
07:49:23 | PMunch | No worries :) |
07:50:03 | FromDiscord | <Varriount> @fluxinator2000 https://play.nim-lang.org/#ix=2eJZ |
07:50:08 | FromDiscord | <Benumbed> Spamming the people on IRC is such a _greaaaat_ way to get to know people 😛 |
07:50:32 | PMunch | To be fair it's partially our own fault for net getting a better Discord bot set up :P |
07:50:34 | FromDiscord | <Varriount> PMunch: Sorry, I didn't know that |
07:50:50 | FromDiscord | <Varriount> I'm used to the gitter bot, which (I think?) just ignores edits |
07:51:14 | FromDiscord | <Varriount> Benumbed: Is this an object type? |
07:51:23 | FromDiscord | <Varriount> @Benumbed ^ |
07:51:44 | FromDiscord | <Varriount> Or a reference type |
07:51:46 | * | Hideki_ joined #nim |
07:51:53 | FromDiscord | <Benumbed> Oh someone changed my username on here to non-unicode, that's good 🙂 |
07:52:05 | FromDiscord | <Benumbed> It's inherited objects so they're refs |
07:52:14 | PMunch | Oh right, you were the one with the crazy nick :P |
07:52:22 | FromDiscord | <Varriount> Hm, I think `fields` might work |
07:52:35 | FromDiscord | <Benumbed> Yeah, my actual Discord username is unicord cursive 😄 |
07:53:48 | PMunch | Hmm, I just get an undefined routine: https://play.nim-lang.org/#ix=2eK0 |
07:54:46 | FromDiscord | <Benumbed> PMunch: Parent and Child should be `ref object`s should they not? |
07:55:00 | FromDiscord | <Benumbed> (At least that's what I've read in the manual) |
07:55:45 | PMunch | Don't have to be |
07:56:09 | PMunch | Ah, but now I get the same error. I was instantiating the Parent object wrong |
07:56:36 | PMunch | You could always write your own copy method: https://play.nim-lang.org/#ix=2eK1 |
07:57:22 | PMunch | I mean there are more low-level ways of doing that as well |
07:58:17 | Guest4842 | sometimes Nim is driving me nuts |
07:58:21 | * | Guest4842 dadada |
07:58:24 | FromDiscord | <Benumbed> That's the direction I was heading (copy method), I was hoping type conversion would make life easy for me |
07:58:31 | * | Guest4842 is now known as dadada |
07:58:33 | PMunch | Haha Guest4842, what's the issue? |
07:58:39 | PMunch | dadada " |
07:59:34 | dadada | PMunch: I do something in a scratch.nim it works, I do the same thing inside a macro that writes a macro inside a quote do, and it doesn't work ... ... admittedly it might not be the same thing because I might have missed something, but so far I don't see any differences |
08:00:12 | PMunch | Ah, double nested macros and quote do indeed tend to be a bit quirky to work with |
08:00:19 | PMunch | Do you have an example? |
08:00:32 | dadada | the macro creates a new ref object type containing a ref to a table |
08:00:46 | dadada | in a macro generated proc I want to check that ref to the table for being nil or not |
08:01:12 | dadada | compiler tells me something about iterators/pairs that makes no sense in that whole context |
08:01:45 | PMunch | Are you iterating anywhere? |
08:01:52 | dadada | no |
08:02:12 | dadada | just a simple if object.refTable == nil |
08:02:16 | PMunch | Are you creating this ref object on compile-time? Or do you generate code to create it on runtime? |
08:02:24 | PMunch | Ah, you should use isNil |
08:03:30 | dadada | PMunch: that seems to help somewhat, but why does it == nil work in my scratch.nim? |
08:03:30 | FromDiscord | <Varriount> Hm, would `ParentType(childValue) = parentValue` work? |
08:04:11 | * | s4mu3lbk joined #nim |
08:04:28 | FromDiscord | <Benumbed> That creates a new object of ParentType though, I need an object of ChildType |
08:04:28 | PMunch | dadada, dunno. Maybe you're not importing something that provides a `==` procedure for that type |
08:06:25 | FromDiscord | <Varriount> Benumbed: https://play.nim-lang.org/#ix=2eK3 |
08:06:51 | FromDiscord | <Varriount> Behold, the horrors of references |
08:06:52 | narimiran | dadada: how about `if object.refTable.isNil`? |
08:07:25 | dadada | narimiran: yes, PMunch told me that, it does help indeed, thank you both |
08:07:30 | FromDiscord | <Varriount> Benumbed: If you want to do a merge operation, you might be able to use fields/fieldPairs |
08:07:57 | FromDiscord | <Benumbed> That's ... I'm not even sure what to say about that, but I'll give it a shot |
08:08:17 | FromDiscord | <Benumbed> I'm so new to Nim that I keep trying to think of it like Python about 1/2 the time, and that trips me up a lot |
08:08:38 | FromDiscord | <Benumbed> (the syntax pushes my brain into Python mode, which I've been writing for over 10 years haha) |
08:08:56 | PMunch | Haha, yeah just using object hierarchies is considered a bit "out-there" in Nim land |
08:09:19 | PMunch | It has its usecases, but I find I run into them fairly seldom |
08:09:31 | FromDiscord | <Benumbed> Yeah I got that feeling... and I keep wondering if I'm doing it wrong |
08:09:51 | FromDiscord | <Benumbed> I'm trying to write a Nim AMQP library from the actual AMQP spec |
08:10:00 | FromDiscord | <Benumbed> (since no one appears to have written one yet) |
08:10:11 | FromDiscord | <Varriount> Benumbed: `Parent(child)` converts the variable to a `Parent` type. Since we are working with references, this doesn't result in a loss of data. |
08:10:24 | FromDiscord | <Benumbed> Yeah that part I got |
08:10:36 | FromDiscord | <Benumbed> it's where you used `[]` |
08:10:53 | FromDiscord | <Varriount> `[]` dereferences both sides, so we are assigning to the underlying object value, rather than the reference value |
08:10:55 | FromDiscord | <Benumbed> and I was like "uhhh is that basically magic for field setting?" |
08:11:15 | FromDiscord | <Varriount> Nim usually dereferences things for you, but not in this instance. |
08:11:58 | FromDiscord | <Benumbed> ok, that makes sense, the `[]` feels weird, but that's my newbness in Nim talking |
08:13:17 | FromDiscord | <Benumbed> Maybe I need to stop trying to use objects for this, but unfortunately most of my recent experience is all in OOP-style languages |
08:13:23 | FromDiscord | <Benumbed> So I think like that |
08:13:38 | FromDiscord | <Benumbed> well, nested/inherited objects |
08:13:46 | FromDiscord | <Benumbed> objects/structs are still needed 🙂 |
08:14:20 | FromDiscord | <Benumbed> I also chose a hell of a first project in Nim, but I generally get bored and give up if I don't throw myself into the deep end... 😛 |
08:15:12 | * | jjido joined #nim |
08:16:50 | FromDiscord | <Benumbed> @Varriount Well that magic worked |
08:16:54 | FromDiscord | <Benumbed> Test passed |
08:17:02 | FromDiscord | <Varriount> Araq: I still think assignment precedence should just be changed from left-to-right to right-to-left. From what I can tell, Python, Java, C#, etc all special-case assignment |
08:17:25 | FromDiscord | <Varriount> *special-case assigment evaluation |
08:17:50 | Araq | cool, do you know what these languages all lack? overloading of assignment. |
08:18:07 | FromDiscord | <Recruit_main707> Could you write functions like: proc CreateThread(Arg1, arg2...) = |
08:18:07 | FromDiscord | <Recruit_main707> {.emit:”CretateThread(“ $ Arg1 $ “, “ $ Arg2 $ “)”.} |
08:18:29 | FromDiscord | <Recruit_main707> To avoid writting wrappers for example? |
08:18:32 | FromDiscord | <Varriount> Araq: C++ has overloading of assigment (or at least aspects of it) doesn't it? |
08:19:35 | Araq | C++ left the order of evaluation undefined for decaded, maybe C++2020 changed it, not sure |
08:19:41 | Araq | *decades |
08:27:54 | * | s4mu3lbk quit (Ping timeout: 240 seconds) |
08:32:27 | * | s4mu3lbk joined #nim |
08:38:16 | * | Vladar joined #nim |
08:48:38 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:56:17 | * | Hideki_ quit (Remote host closed the connection) |
09:01:17 | * | Hideki_ joined #nim |
09:05:47 | * | Hideki_ quit (Ping timeout: 250 seconds) |
09:07:58 | * | SebastianM joined #nim |
09:08:08 | * | s4mu3lbk quit (Ping timeout: 256 seconds) |
09:15:21 | * | Hideki_ joined #nim |
09:28:19 | * | dddddd quit (Ping timeout: 250 seconds) |
09:30:02 | FromDiscord | <Recruit_main707> can i get the arguments passed to the c compiler without making it error on purpose? |
09:31:32 | * | Vladar quit (Quit: Leaving) |
09:33:01 | * | sleepyqt joined #nim |
09:37:22 | dadada | has anyone here done any work with Svelte? It seems interesting. Something like that using Nim instead might be a good idea. |
09:44:18 | * | sleepyqt quit (Quit: Leaving) |
09:44:35 | PMunch | I had a look at it, but haven't done anything with it |
09:45:18 | * | sleepyqt joined #nim |
09:47:26 | * | vqrs quit (Ping timeout: 240 seconds) |
09:50:13 | * | vqrs joined #nim |
09:54:01 | * | SebastianM quit (Quit: leaving) |
09:54:06 | FromDiscord | <Recruit_main707> good and bad news, i got CreateThread to work, i had to copy the c code, put it inside an emit and change the weird function name nim chose for it and manually write CreateThread |
09:54:18 | * | Hideki_ quit (Remote host closed the connection) |
09:54:44 | FromDiscord | <Recruit_main707> this is the problem with wrappers i guess |
09:54:50 | Araq | Recruit_main707: how come? threads.nim wraps CreateThread for you |
09:55:09 | FromDiscord | <Recruit_main707> i am using winim's one |
09:55:27 | FromDiscord | <Recruit_main707> (since i will also be calling those functions if i get it to work |
09:57:50 | * | jjido joined #nim |
09:58:36 | Araq | why not use system's createThread? |
09:59:18 | PMunch | There probably is a better way to do that.. |
10:00:03 | FromGitter | <alehander92> i heard about svelte |
10:00:32 | FromGitter | <alehander92> it might be a good fit but i havent really used it i think |
10:01:31 | * | tane joined #nim |
10:02:10 | * | jjido quit (Client Quit) |
10:03:21 | * | dwdv joined #nim |
10:06:51 | FromDiscord | <Recruit_main707> Araq: i guess ill have to try, but then if i want to, lets say, call MessageBox() i will have the same issue |
10:06:51 | FromDiscord | <Recruit_main707> PMunch: I hope there is lol, this is ugly af |
10:07:08 | Araq | what "same issue"? |
10:08:02 | FromDiscord | <Varriount> @Recruit_main707 you still shouldn't need to use emit |
10:08:04 | FromDiscord | <Recruit_main707> it will not the actual function, but the function that wraps it and i dont know why but it wont work |
10:08:33 | FromDiscord | <Recruit_main707> @Varriount but still its the only way it has worked properly |
10:08:56 | FromDiscord | <Varriount> Can you post a link to your sample code? |
10:09:10 | Araq | use .stdcall for your imports etc |
10:12:37 | FromDiscord | <Recruit_main707> Araq: i already do it. |
10:12:37 | FromDiscord | <Recruit_main707> its very dirty, sorry for that https://play.nim-lang.org/#ix=2eKm |
10:13:08 | FromDiscord | <Recruit_main707> compiled with--NoMain --app:lib and arc |
10:16:04 | FromDiscord | <Varriount> What error do you get if you call Create thread directly, rather than emitting a call to it? |
10:16:25 | FromDiscord | <Recruit_main707> it will compile, but wont work at runtime |
10:16:34 | FromDiscord | <Recruit_main707> no error |
10:17:02 | FromDiscord | <Varriount> Can you post a version of that code? |
10:18:01 | FromGitter | <Kvothe87> is there a way to change the extension of a file? i thought of using changeFileExt but it is only returning the string |
10:18:36 | FromDiscord | <Varriount> Kvotje87: Rename the file? |
10:18:58 | FromGitter | <Kvothe87> otherwise i saw the moveFile but it makes a copy if I understood correctly |
10:20:08 | FromDiscord | <Varriount> What gives you that idea? |
10:21:00 | FromDiscord | <Varriount> > Moves a file from source to dest. [...] Can be used to rename files. |
10:21:10 | FromGitter | <Kvothe87> i read now |
10:21:14 | FromDiscord | <Recruit_main707> i was making sure i replicated the error: https://play.nim-lang.org/#ix=2eKp |
10:21:28 | FromGitter | <Kvothe87> thanks |
10:21:45 | Araq | Recruit_main707: that code is ... unbelievable :-) |
10:21:47 | FromGitter | <Kvothe87> I was confused by the name and the parameters |
10:21:59 | Araq | try --tslEmulation:off, it's known to cause problems |
10:22:08 | FromDiscord | <Recruit_main707> Araq: in what aspect XD |
10:22:27 | Araq | look if you want to create a DLL, use --app:lib |
10:22:36 | Araq | and then Nim will generate the DllMain for you |
10:22:59 | FromDiscord | <Recruit_main707> i already do it lol, but since i am injecting it, i need to do this manually |
10:23:16 | Araq | are you writing a virus? |
10:23:41 | FromDiscord | <Recruit_main707> no, its educational purposes |
10:23:48 | FromDiscord | <Recruit_main707> not my plan at all |
10:24:08 | FromDiscord | <Recruit_main707> (note there is no sarcasm although it looks like) |
10:24:54 | FromDiscord | <Varriount> I'm surprised your first code works, as Nim needs to use it's own dllmain |
10:25:10 | FromDiscord | <Recruit_main707> i compile with --nomain |
10:25:41 | FromDiscord | <Varriount> I'll take a look at this later. Now I need to sleep |
10:25:50 | * | Hideki_ joined #nim |
10:26:11 | FromDiscord | <Recruit_main707> goodnight, ask someone in discord to @ me if you answer me back, thank you both! |
10:29:23 | * | Hideki_ quit (Remote host closed the connection) |
10:29:38 | * | Hideki_ joined #nim |
10:30:15 | * | Hideki_ quit (Remote host closed the connection) |
10:32:12 | FromDiscord | <Varriount> @Recruit_main707 one last question - what is the goal here? This looks like you're just creating a standard DLL that has it's own thread running in the background of the host process |
10:33:09 | FromDiscord | <Recruit_main707> intention for now is being able to display a messagebox from the MyThread function |
10:33:40 | * | Hideki_ joined #nim |
10:34:30 | FromDiscord | <Varriount> How is the DLL loaded? Through a random program? |
10:38:05 | * | Hideki_ quit (Ping timeout: 250 seconds) |
10:49:01 | FromDiscord | <Recruit_main707> i made myself an injector, and i also have a random program, sorry for late response |
10:49:15 | FromDiscord | <Recruit_main707> they both work |
10:49:53 | PMunch | Note that when using --nomain you have to call some Nim setup procedures yourself IIRC |
10:53:20 | FromDiscord | <Recruit_main707> which ones? |
10:53:20 | FromDiscord | <Recruit_main707> i mean, my program does work until CreateThread |
10:53:39 | FromDiscord | <Recruit_main707> aka, it print INJECTION SUCCESFUL |
10:53:46 | * | jjido joined #nim |
10:56:21 | * | jjido quit (Client Quit) |
10:58:58 | PMunch | Possible you need setupForeignThreadGC |
11:00:35 | Araq | uh oh this is a showstopper bug https://github.com/nim-lang/Nim/issues/13698 |
11:00:38 | disbot | ➥ Exception when converting csize to clong ; snippet at 12https://play.nim-lang.org/#ix=2eKB |
11:02:00 | * | natrys joined #nim |
11:03:25 | * | Ven`` joined #nim |
11:13:11 | * | Hideki_ joined #nim |
11:16:06 | * | Hideki_ quit (Remote host closed the connection) |
11:16:21 | * | Hideki_ joined #nim |
11:28:01 | * | Hideki_ quit (Remote host closed the connection) |
11:28:29 | * | Hideki_ joined #nim |
11:42:46 | * | endragor quit (Remote host closed the connection) |
11:47:11 | * | endragor joined #nim |
11:50:41 | * | endragor quit (Remote host closed the connection) |
12:01:19 | dadada | how do I define a static variable globally, that I can later use in macros and compile time procs? I put a table into a var, that I put inside a static block, but in a macro the compiler says that var is undefined |
12:01:27 | dadada | s/use/use it |
12:01:41 | dadada | s/later/then |
12:08:29 | Araq | use var x {.compileTime.}: T |
12:14:50 | * | JustASlacker joined #nim |
12:15:25 | JustASlacker | the nimlang/nim:alpine makes crazy binaries |
12:15:33 | JustASlacker | > ./nginx_vhost |
12:15:35 | JustASlacker | Failed to execute process './nginx_vhost'. Reason: |
12:15:37 | JustASlacker | The file './nginx_vhost' does not exist or could not be executed. |
12:19:01 | JustASlacker | (⊙_☉) |
12:21:59 | * | solitudesf quit (Read error: Connection reset by peer) |
12:23:08 | * | solitudesf joined #nim |
12:26:55 | * | Vladar joined #nim |
12:31:53 | krux02_ | Araq: just FU |
12:32:33 | krux02_ | https://github.com/nim-lang/Nim/pull/13687 |
12:32:34 | disbot | ➥ refactoring and yak shaving. |
12:32:45 | * | rockcavera joined #nim |
12:32:58 | krux02_ | closed because of: "I'm happier without this PR." |
12:33:10 | krux02_ | WTF? |
12:34:42 | * | krux02_ is now known as krux02 |
12:37:14 | * | jjido joined #nim |
12:37:41 | JustASlacker | why would you shave a yak |
12:37:52 | Araq | krux02, we discussed it |
12:37:59 | Araq | I don't want it, I told you |
12:39:02 | Araq | it mixes bugfixes with refactorings and new features, the new features are not backed up by an RFC |
12:39:13 | Araq | it introduces regressions |
12:39:19 | Araq | what's in there to like? |
12:40:36 | Araq | who asked for "oh I am gonna remove usages of system.compiles from the stdlib"? |
12:41:16 | Araq | I certainly didn't |
12:43:36 | krux02 | hmm: |
12:44:52 | krux02 | Should I quote you on that |
12:45:02 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:45:26 | krux02 | Araq: Your words > system.compiles [...] is under-specified in Nim, very tied to the current implementation, and finally, slow. |
12:45:36 | krux02 | here: https://github.com/nim-lang/RFCs/issues/168 |
12:45:37 | disbot | ➥ Concepts and type-checking generics ; snippet at 12https://play.nim-lang.org/#ix=23U8 |
12:45:54 | Araq | yeah. Did I say "remove it from the stdlib"? |
12:46:01 | Araq | esp |
12:46:03 | Araq | did I say |
12:46:20 | Araq | "remove it from the stdlib without any provided alternative"? |
12:46:30 | krux02 | what? |
12:46:46 | krux02 | I did code refactorings |
12:46:48 | Araq | I want typeSupportsOperation instead of 'compiles' |
12:46:53 | krux02 | simplified the implementation |
12:47:10 | krux02 | and fixed bugs that were required for the refactorings |
12:47:22 | krux02 | basically I remove bug workarounds |
12:48:38 | krux02 | So you don't want ``$`` to work generically on all types? |
12:48:46 | * | SyrupThinker quit (Quit: Gateway shutdown) |
12:48:49 | Araq | you also removed a nice optimization in toSeq |
12:49:04 | krux02 | no I din't |
12:49:11 | FromDiscord | <Goel> Hello, may I ask for help in setting up VS Code? |
12:49:11 | krux02 | it wasn't nice |
12:49:14 | krux02 | I commented on it |
12:49:39 | krux02 | But instead of a review process you used it as a reason to quickly close my PR without further discussions. |
12:50:49 | Araq | "further discussions" |
12:50:52 | krux02 | If you can give me objective reasons why this PR is bad, ok. |
12:50:53 | Araq | we discussed it online |
12:51:00 | krux02 | But it is "yea I don't feel it" |
12:51:07 | Araq | in disruptek's stream |
12:51:10 | krux02 | tell me what is bad about it. |
12:51:16 | krux02 | I know we discussed it |
12:51:29 | krux02 | you could keep it open like the other 150 open PRs |
12:51:33 | Araq | that's the only reason why I thought I can be harsh |
12:51:37 | krux02 | but no |
12:51:39 | JustASlacker | FromDiscord: you did not pick an opportune moment |
12:51:46 | JustASlacker | we are having a nerd standoff |
12:51:49 | krux02 | you are specifically against refactorings in the compiler |
12:51:55 | krux02 | you are against fixing the bugs in the compiler |
12:52:14 | krux02 | or you are specifically against me fixing bugs in the compiler |
12:52:16 | krux02 | I don't know |
12:52:23 | krux02 | but you are not working professionally here. |
12:52:44 | Araq | yeah right |
12:53:00 | krux02 | right |
12:53:12 | Araq | so back to professionalism: how about bugfixes that don't add features? |
12:53:44 | krux02 | How about: Do it on your own. |
12:53:59 | krux02 | if you only care about a small portion of my PR. Extract it yourself. |
12:54:05 | krux02 | I don't care anyomer. |
12:55:26 | krux02 | Alternatively, pay me to extract it. I don't need my changes to be upstream. |
12:57:04 | krux02 | BTW: if that optimization you are talking about is "so important" how come that it isn't tested? |
12:57:24 | Araq | it's rather hard to test |
12:57:38 | krux02 | I know. |
12:58:01 | krux02 | still is that an excuse to not build testing infrastructure for optimizations? |
12:58:20 | krux02 | Otherwise you never know if optimizations are really applied. |
12:59:10 | krux02 | BTW: did you read what I was saying about that optimization? |
12:59:27 | Araq | no I'm looking for it |
13:00:45 | Araq | ok, read it |
13:01:04 | krux02 | and? |
13:01:14 | * | zacharycarter quit (Ping timeout: 240 seconds) |
13:01:53 | Araq | I don't understand it, it uses the 'len' to safe all the reallocations that 'add' needs to do |
13:01:58 | Araq | *save |
13:02:03 | krux02 | yes |
13:02:19 | krux02 | but for that to work it first has to copy the argument into `s2` |
13:02:27 | krux02 | deep copy. |
13:03:35 | krux02 | deep copy can be arbitrarily expensive. reallocations costs of `add` are arguably there, but capped. |
13:04:02 | Araq | that only means that 'evalOnceAs' could be improved |
13:04:25 | Araq | but the real problem is that your solution cannot test for 'is len avaiable' by construction |
13:04:45 | Araq | and that your solution 'let's have $ for every type T' doesn't generalize to 'let's have len for every type T' |
13:05:02 | * | solitudesf quit (Read error: Connection reset by peer) |
13:05:09 | Araq | system.compiles is a very useful thing |
13:05:19 | * | couven92 joined #nim |
13:05:24 | Araq | and to be replaced by system.typeSupportsOperation |
13:05:33 | Araq | not by simply nuking it and hope for the best |
13:05:36 | krux02 | yes system.compiles is useful, that is why it is everywhere. |
13:06:27 | krux02 | I don't want to improve `evalOnceAs` I wanted to get rid of it. |
13:06:59 | krux02 | The primary reason for ``evalOnceAs`` is to avoid multiple evaluations of the argument. |
13:07:02 | Araq | sorry this read likes a madman's PR, you take words from me out of context to justify some feature removal that feels totally random to outsiders |
13:07:22 | krux02 | Again, I didn't remove any feature. |
13:07:27 | krux02 | Pleas stop saying that |
13:07:46 | krux02 | I just refactored the code to use a specific feature less. |
13:08:00 | Araq | and evalOnceAs is useful too, except that the implementation must work around Nim's missing borrow checking |
13:08:58 | krux02 | And you said it several times. You don't like system.compiles, same as me. You don't like when a PR contains ``system.copiles``. You complain about it in the PR's. Yet when I make a PR that reduces the calls to `system.compiles` you don't like it either. |
13:09:28 | krux02 | `evalOnceAs` is crap. |
13:09:32 | Araq | because you didn't replace it with system.typeSupportsOp |
13:09:46 | krux02 | there is no `typeSupportsOp`. |
13:09:52 | Araq | exactly |
13:10:05 | Araq | you need to add it first |
13:10:09 | krux02 | ok |
13:10:11 | Araq | then you can patch the stdlib to use it |
13:10:21 | Araq | and then we can discuss $ for cyclic refs |
13:10:23 | krux02 | but I bet if I actually add it and use it in this PR, you will still not be happy. |
13:10:27 | krux02 | You will still complain. |
13:10:44 | Araq | but less so and only because we have no RFC for typeSupportsOp |
13:10:49 | Araq | :-) |
13:12:23 | krux02 | Pleas put your review process, requested changes into the PR. |
13:12:48 | * | dddddd joined #nim |
13:13:28 | Araq | but let me apologize, I was too rude and I'm sorry. I've reopened your PR. |
13:13:36 | krux02 | ok |
13:13:42 | krux02 | thanks for the apology. |
13:13:54 | Araq | but in the end it should be a couple of PRs. |
13:14:19 | Araq | and there is one more thing |
13:14:32 | krux02 | that is? |
13:15:02 | Araq | what happens when we figure out that the implementation of 'typeSupportsOp' in the compiler looks almost the same to the existing system.compiles |
13:15:25 | krux02 | that is totally fine. |
13:16:12 | krux02 | `typeSupportsOp` can be constrained to only support a specific subset of expressions. |
13:16:29 | krux02 | That means it can be specified |
13:16:50 | * | jjido joined #nim |
13:17:19 | krux02 | it should probably be called `valueSupportsOp` to not conflic with procedures that actually work on types. |
13:18:56 | * | lritter joined #nim |
13:19:16 | Araq | or maybe just supportsOp |
13:19:29 | krux02 | yea |
13:19:40 | Araq | but the implementation will be messy I think, you might need to instantiate a generic |
13:19:43 | krux02 | Btw I found another bug through this PR. |
13:19:47 | Araq | only to throw it away later on |
13:20:01 | Araq | just like compiles currently does |
13:21:28 | Araq | in fact, I know two use cases for 'compiles' |
13:21:41 | Araq | 1) supports operation |
13:21:47 | Araq | 2) "can import" |
13:22:38 | krux02 | did you ever realize: ``when compiles(arg.foo): arg.foo`` |
13:22:58 | krux02 | instantiate arg.foo, throw it away, instantiate it again. |
13:23:08 | krux02 | were you ever bothered by it: |
13:23:53 | krux02 | How about this: tryCompile: arg.len else: 0 |
13:24:05 | krux02 | then no throwaway takes place. |
13:24:41 | * | zacharycarter joined #nim |
13:24:43 | FromDiscord | <clyybber> Can't we simply make compiles smarter? |
13:25:00 | FromDiscord | <clyybber> As in cache generic instantiations when it successfully compiles? |
13:25:24 | krux02 | clyybber: no the idea is to make things more dumb, so it is easier to use them and know about correct and incorrect behaivor. |
13:25:48 | FromDiscord | <clyybber> compiles is dumb |
13:25:58 | krux02 | it is too smart |
13:26:28 | Araq | krux02, yes, I realized that |
13:26:44 | FromDiscord | <clyybber> the thing is, ppl don't care that much about generic instantiations so as to use tryCompile instead of compiles |
13:26:48 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:27:02 | FromDiscord | <clyybber> And afaict it shouldn't break anything to do what I wrote |
13:27:02 | Araq | and now we're getting somewhere and this is turning into a fruitful discussion, thanks! |
13:27:46 | krux02 | well I got you to apologize for closing my PR and opening it up again. That is fruitful as well. |
13:27:46 | * | clyybber joined #nim |
13:28:52 | clyybber | I don't think compiles is too smart if it works as expected |
13:29:01 | clyybber | the compile-time impact is whats bad I guess |
13:29:20 | Araq | clyybber, it used to cache the instantations but that's wrong |
13:29:54 | Araq | I mean, this is not a simple thing and some mechanisms in the compiler only exist so that we could implement system.compiles |
13:30:15 | clyybber | Huh, interesting. Where did it cause issues? |
13:30:47 | * | solitudesf joined #nim |
13:31:04 | Araq | well at least if it fails you must purge the generic instantiation cache |
13:31:12 | clyybber | Yeah |
13:31:15 | clyybber | THat makes sense |
13:31:25 | Araq | but then what does it mean "it fails"? it returns a bool |
13:31:42 | Araq | and that's where krux02's idea comes in |
13:31:58 | Araq | only with 'tryCompiles' we have enough context to do it in a smarter way |
13:31:58 | clyybber | Yeah, just cache it when it returns true |
13:33:08 | Araq | but look, when compiles(a): a else b <=> when not compiles(a): b else: a |
13:33:28 | Araq | it is not all that obvious to me that you can really keep the generic instantiations if returns 'true' |
13:34:12 | Araq | in fact |
13:34:12 | * | zahary joined #nim |
13:35:02 | Araq | I'm sure it's wrong for subtle cases where you only check for 'compiles' for a warning message |
13:35:57 | clyybber | Hmm, I don't entirely get it |
13:36:06 | clyybber | I can't imagine a case where it would be broken |
13:37:04 | Araq | I can construct a case but it relies on the fact that generic instantation caching is currently unsound |
13:37:09 | Araq | :P |
13:37:12 | clyybber | Heh |
13:37:15 | clyybber | I see :p |
13:38:26 | clyybber | So we make it sound and then we have a smart and working compiles |
13:39:00 | clyybber | Although probably much harder, it seems like a better option in the long run than expose implementation details and add cruft to system |
13:39:27 | Araq | well it remains true that 'compiles' is underspecified and quirky |
13:39:50 | Araq | and 'canImport' has nothing to do with supportsOp |
13:40:14 | * | shadowbane joined #nim |
13:40:15 | Araq | in fact, I'm sure few people know 'canImport' can be written in today's Nim |
13:41:53 | clyybber | it doesn't seem to me that its "too" underspecified, as its used pretty commonly |
13:42:32 | dadada | interesting discussion |
13:42:49 | dadada | Araq: hey, thanks for the help! now it's working nicely |
13:45:56 | dadada | simple yes/no question: will arc help to catch more bugs at compile time? |
13:46:35 | * | onionhammer quit (Read error: No route to host) |
13:47:12 | clyybber | gc:arc by itself no |
13:48:12 | clyybber | in its current state at least |
13:49:13 | Araq | dadada, no but I finally merged my PR that is required for the planned Z3 tool |
13:49:31 | clyybber | The static boundchecking? |
13:49:36 | Araq | yeah |
13:49:42 | clyybber | Nice |
13:49:59 | Araq | instead of our custom "guards.nim" proof engine, replace it by Z3 |
13:50:05 | Araq | and there you go. |
13:51:00 | Araq | https://gist.github.com/Araq/69355d41f1c2d3dae461bade4e8d0591 if you want to tinker with it |
13:51:16 | Araq | it's much fun |
13:51:59 | krux02 | Araq: I have a prototype implementation for `tryCompiles` |
13:52:07 | krux02 | http://ix.io/2eL3 |
13:52:21 | krux02 | it is implemented with macros now. |
13:52:41 | krux02 | could be lifted to compiler internal. |
13:52:59 | dadada | what else could you be doing with Z3 inside Nim? |
13:53:24 | * | nsf quit (Quit: WeeChat 2.7) |
13:53:30 | clyybber | krux02: Ok thats kinda cool ngl :D |
13:54:05 | krux02 | yea it is a first proof of concept. |
13:54:07 | Araq | dadada, I thought about adding precondition, postcondition, invariant pragmas |
13:54:37 | dadada | Araq: something like ada/spark is doing? |
13:54:52 | * | s4mu3lbk joined #nim |
13:55:07 | Araq | yeah |
13:55:25 | FromDiscord | <Varriount> krux02: Since when do objects have a length? |
13:55:30 | dadada | that would make Nim attractive to billion dollar industries, so it's a splendid idea |
13:55:31 | krux02 | they don't |
13:56:02 | dadada | people building machines that fly in the air, or medical devices want such stuff |
13:56:34 | krux02 | Varriount: in generic code you often don't know if you can call `len`, so you do something with ``when compiles``, this is a pattern that works without ``when compiles``. |
13:56:49 | clyybber | Araq: Hey, its really smart! |
13:59:17 | Araq | clyybber, yeah I agree |
13:59:18 | FromDiscord | <Varriount> krux02: How does that macro work? I can see that it creates a template.. and then calls it? How does that test whether a procedure can be called on a variable? |
13:59:25 | Araq | bbl guys |
13:59:43 | krux02 | Varriount: it works via overload resolution. |
14:00:24 | krux02 | it creates the template with the same name as the call in the argument, and then hopes that it isn't picked in overload resolution |
14:00:40 | krux02 | the template should not be picked, because it's argument is `untyped` |
14:00:50 | krux02 | it should be lowest priority. |
14:01:14 | krux02 | But by puttin the template there it ensures that every call can be resolved |
14:01:30 | krux02 | there won't be a compilation error |
14:01:41 | FromDiscord | <Varriount> Huh, I would have thought the template would always be chosen, since it's in the same scope as the call |
14:01:54 | krux02 | well, no |
14:01:55 | clyybber | But the most specific overload will be chosen |
14:02:01 | krux02 | yes |
14:02:04 | clyybber | So untyped will only be chosen as a last resort |
14:02:04 | krux02 | that is the idea here |
14:02:07 | clyybber | thats how it works |
14:02:15 | krux02 | ^^ thanks |
14:02:18 | Araq | don't you care to critic C++ ever again, krux02 :P it taught you so many things |
14:03:01 | krux02 | well I will critic C++, but not for that part. |
14:04:01 | Araq | clyybber, you can iterate over two arrays in parallel via 'for i in 0..min(a.high, b.high)' |
14:04:14 | Araq | at least you should be able to... this thing needs tests |
14:06:34 | * | zacharycarter quit (Ping timeout: 240 seconds) |
14:10:37 | clyybber | Araq: Did you hardcode that for `min` ? |
14:12:42 | clyybber | Looks like it |
14:17:34 | * | shadowbane quit (Ping timeout: 240 seconds) |
14:18:11 | axion | Is there a style convention for max number of columns? 80 seems like it might be too little for type parameters and annotations |
14:18:51 | narimiran | axion: show us the code you think you cannot keep inside 80 characters |
14:19:01 | axion | If only because the compiler does not like the parameter list on a different line than the type parameters' closing bracket delimiter |
14:19:54 | axion | Well for example, this barely fits, and it isn't nearly the most complicated signature I have: proc init*[N: static[int], T: Vec[N]](t: typedesc[T], v: Vec): T {.inline.} = |
14:20:27 | clyybber | just ignore the style convention :p |
14:20:40 | clyybber | I find 80 to be pretty tight too |
14:21:41 | axion | Some may argue that that convention is only the norm because of ancient terminals, but these days we have virtual terminals (our editors split windows to maximize code visible), and it just so happens 80 allows me to fit 4 files side by side at a comfortable font size |
14:21:50 | * | zacharycarter joined #nim |
14:30:49 | FromGitter | <matrixbot> `alehander42` yes it makes sense |
14:37:45 | * | silvernode joined #nim |
14:44:19 | disruptek | 80 please. |
14:46:22 | axion | 100 for me until the compiler is more lenient on where line breaks in a signature can occur |
14:50:10 | FromDiscord | <Rika> i use a mix of 80, 100, and 120 |
14:50:40 | FromDiscord | <Rika> 90% should fit within 80, 95% in 100, and none past 120 |
14:51:43 | narimiran | btw, @Rika, do you know about 90-9-1 rule? |
14:51:51 | FromDiscord | <Rika> what ._. |
14:51:52 | narimiran | you could have used it here ;0 |
14:52:06 | narimiran | https://en.wikipedia.org/wiki/1%25_rule_(Internet_culture) |
14:52:15 | FromDiscord | <Rika> that works too |
14:52:38 | narimiran | 90% under 80 columns, 99% under 100 columns |
14:52:56 | FromDiscord | <Rika> maybe ill switch to that, maybe also write a vscode extension for showing % data too on the bottom' |
14:53:26 | FromDiscord | <Rika> AH NO im piling up projects again ;; |
14:55:44 | * | Trustable joined #nim |
14:56:57 | FromDiscord | <Recruit_main707> is there something opposite to gcsafe pragma? |
14:59:04 | FromDiscord | <Rika> removing it lol |
14:59:21 | Yardanico | @Recruit_main707 not that I know of, but why would you ever need one? :P |
14:59:43 | FromDiscord | <Recruit_main707> i am not using it (explicitly) but either exportc, dynlib or stdcall adds it |
15:00:25 | FromDiscord | <Recruit_main707> i know it bc of the new wrapping meta XD (this works btw) |
15:00:25 | FromDiscord | <Recruit_main707> {.emit:"#include <windows.h>".} |
15:00:25 | FromDiscord | <Recruit_main707> proc CreateThread*(arg1: (proc(x: pointer): int32 {.stdcall, gcsafe, locks: 0.})) = |
15:00:25 | FromDiscord | <Recruit_main707> {.emit:"""CreateThread(NULL, 0, arg1, NULL, ((NI32) 0), NULL);""".} |
15:00:45 | Yardanico | why do that? |
15:00:52 | Yardanico | nim wraps OS-specific APIs for thread creating |
15:01:01 | FromDiscord | <Recruit_main707> {.stdcall, gcsafe, locks: 0.} this pragmas appear of {.exportc, dynlib, stdcall.} |
15:01:16 | * | SyrupThinker joined #nim |
15:01:43 | Yardanico | well gcsafe is automaticallly added to all procedures which the compiler considers to be gcsafe |
15:01:51 | Yardanico | or maybe not, lemme check |
15:01:54 | FromDiscord | <Recruit_main707> Yaradinco: i will be using a lot more functions of windows, and using it this way i know exactly what it is doing |
15:02:07 | Yardanico | why make your program win-only :( |
15:02:56 | FromDiscord | <Recruit_main707> its dll injection :p if i develop serious apps ofc they will be universal <3 |
15:08:54 | FromDiscord | <Recruit_main707> well, if anyone knows if i can disable that gcsafe pragma, pls let me know |
15:10:38 | * | clyybber quit (Quit: WeeChat 2.7.1) |
15:15:52 | * | Hideki_ quit (Remote host closed the connection) |
15:16:35 | * | Hideki_ joined #nim |
15:18:46 | * | zahary quit (Quit: Leaving.) |
15:21:13 | * | Hideki_ quit (Ping timeout: 264 seconds) |
15:21:21 | * | SyrupThinker quit (Quit: ZNC 1.7.5 - https://znc.in) |
15:23:37 | * | zahary joined #nim |
15:25:01 | * | SyrupThinker joined #nim |
15:30:09 | FromDiscord | <kelly> https://nimble.directory/ is down |
15:31:25 | * | silvernode quit (Ping timeout: 264 seconds) |
15:32:23 | Yardanico | federico3 ^ |
15:32:57 | FromGitter | <zetashift> yep down for me too |
15:33:18 | axion | If I have a file that is only intended to be `include`d in another file, should I still import stuff required for that file? Not doing so causes my `nim check` on file save to yell at me of course. What's the common thing to do here? |
15:33:56 | Yardanico | it's not required |
15:34:37 | federico3 | :-/ |
15:37:35 | * | NimBot joined #nim |
15:38:06 | * | Hideki_ joined #nim |
15:38:39 | * | SebastianM joined #nim |
15:44:52 | * | JustASlacker quit (Ping timeout: 256 seconds) |
15:51:23 | * | tiorock joined #nim |
15:51:23 | * | tiorock quit (Changing host) |
15:51:23 | * | tiorock joined #nim |
15:51:23 | * | rockcavera is now known as Guest34890 |
15:51:23 | * | Guest34890 quit (Killed (weber.freenode.net (Nickname regained by services))) |
15:51:23 | * | tiorock is now known as rockcavera |
15:52:31 | * | silvernode joined #nim |
15:55:40 | * | tiorock joined #nim |
15:55:40 | * | tiorock quit (Changing host) |
15:55:40 | * | tiorock joined #nim |
15:55:40 | * | rockcavera quit (Killed (card.freenode.net (Nickname regained by services))) |
15:55:40 | * | tiorock is now known as rockcavera |
15:58:44 | * | SebastianM quit (Quit: leaving) |
15:58:53 | disruptek | ~stream |
15:58:54 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
15:59:01 | disruptek | yet more hilarious hijinks with backend caching. |
16:02:34 | * | silvernode quit (Ping timeout: 240 seconds) |
16:05:14 | dadada | can proc/template/func/macro definitions be revoked? ie. use a custom overload for add() in this one part of a source file (for example for debugging), but then revoke it's existance from a certain line on, so its not overloading anything anymore? |
16:05:34 | FromDiscord | <Rika> why? |
16:05:41 | FromDiscord | <Rika> scope it |
16:07:39 | * | Ven`` quit (Quit: Textual IRC Client: www.textualapp.com) |
16:08:43 | FromDiscord | <Recruit_main707> i actually like how wrapping with emit works. <- as a side note. how can i convert "w" into `char` and is it possible to convert an string like "adssfs" into char? |
16:13:16 | * | andinus quit (Quit: ERC (IRC client for Emacs 26.3)) |
16:14:55 | * | andinus joined #nim |
16:17:27 | zacharycarter | disruptek: yeahhhhhhh tribe |
16:17:32 | zacharycarter | I dig it |
16:19:57 | * | JustASlacker joined #nim |
16:32:53 | * | silvernode joined #nim |
16:33:02 | silvernode | Can I put a table inside of a sequence? |
16:33:11 | krux02 | why not? |
16:33:38 | silvernode | krux02: I figure I can but not sure how to write it. |
16:33:51 | narimiran | silvernode: show us your current code |
16:34:19 | krux02 | silvernode, what you you mean, not shur how to write it? |
16:34:34 | krux02 | write the seq to disk, or write into the table in the seq? |
16:34:37 | * | SyrupThinker left #nim ("WeeChat 2.7.1") |
16:34:46 | silvernode | I don't really have current code attempting this yet |
16:35:21 | silvernode | I have a seq inside of a type, and I want the seq to contain a table |
16:35:40 | silvernode | but the sy7ntax is what I am trying to find |
16:35:46 | silvernode | syntax* |
16:36:00 | FromDiscord | <Recruit_main707> {.inline.} cannot force the compiler if it doesnt want to right? |
16:36:01 | narimiran | `seq[Table[Key, Val]]` |
16:36:38 | FromDiscord | <Rika> ^ dont forget to `import tables` |
16:37:08 | silvernode | Is table a type itself similar to other types like int, string...etc? |
16:37:41 | narimiran | silvernode: similar? yes. |
16:37:42 | disruptek | disbot: you alive? |
16:37:42 | disbot | yep. 😊 |
16:37:54 | disruptek | is disbot taking a vacation day? |
16:38:46 | silvernode | narimiran: That's what I was trying to figure out basically. I tried typing 'table' but it did not appear to be a type so I started searching the internet and failed to find what I was looking for. |
16:39:04 | narimiran | Table. with a capital T. |
16:39:18 | narimiran | silvernode: start here: https://nim-lang.github.io/Nim/tables.html |
16:39:35 | silvernode | yep, I see that now. I was not exapecting that syntax since I think that means it is a custom type. |
16:40:38 | silvernode | wow I read that and missed the part I was looking for. |
16:48:10 | * | Hideki_ quit () |
16:49:41 | * | Hideki_ joined #nim |
16:51:39 | FromDiscord | <Rika> tables are a "custom type" |
16:51:47 | FromDiscord | <Rika> you mean "non-primitive" |
16:52:29 | FromDiscord | <Rika> some languages dont have a primitive table/dictionary/hashmap type, eg. Nim and JavaScript |
16:58:20 | narimiran | **ANOUNCEMENT** beta-version of Nim v1.2 is ready, you can currently build it from https://github.com/nim-lang/Nim/tree/version-1-2 (pre-built nightlies will follow later today) |
17:02:21 | FromDiscord | <Rika> WOAH |
17:02:27 | FromDiscord | <Rika> earlier than i expected... |
17:02:45 | narimiran | @Rika when did you expect it? :) |
17:05:41 | FromDiscord | <Rika> may |
17:05:54 | FromDiscord | <Rika> or april idk it just feels early |
17:06:32 | narimiran | it is 6 months since 1.0.0 |
17:08:06 | * | nsf joined #nim |
17:13:05 | FromDiscord | <Rika> wtf |
17:13:07 | FromDiscord | <Rika> no way |
17:15:03 | FromGitter | <Kvothe87> stable is still 1.06 right? |
17:16:56 | narimiran | @Kvothe87, yeah, until 1.2.0 is publicly officially released (next week). |
17:19:07 | PMunch | (note: we skip odd numbers for releases in Nim, so 1.2.0 is the next step after 1.0) |
17:19:07 | FromDiscord | <kelly> is there a changelog? |
17:19:24 | PMunch | Shouldn't we also have started on 2.0 for consistency though? |
17:19:25 | narimiran | for now: see changelog.md |
17:19:48 | FromDiscord | <Rika> i think it only applies for the minor version level |
17:20:07 | narimiran | minor and patch |
17:26:36 | FromGitter | <Kvothe87> by the way, another question i just checked my nim -v and got 1.0.4. Run choosenim update stable and it says Already up to date at version 1.0.6 |
17:27:05 | narimiran | are you sure you're using choosenim's nim, and not some other? |
17:27:27 | narimiran | what does `which nim` say? |
17:28:45 | FromGitter | <Kvothe87> i get an error |
17:29:17 | FromGitter | <Kvothe87> i'm running it from vscode on windows |
17:29:22 | FromGitter | <Kvothe87> in case it makes a difference |
17:30:51 | narimiran | i don't use neither, so somebody else might help you more |
17:35:24 | FromGitter | <kristianmandrup> How do I convert an emit into a node tree for use in a macro? |
17:35:40 | FromGitter | <kristianmandrup> I think there was a helper, sth like `quote` ?? |
17:37:33 | * | couven92 quit (Ping timeout: 250 seconds) |
17:39:40 | FromGitter | <kristianmandrup> https://nim-lang.org/docs/macros.html#quote%2Ctyped%2Cstring |
17:39:54 | FromGitter | <kristianmandrup> var importNode = quote do: ⏎ ⏎ ```{.emit: esImportImpl(name, nameOrPath).}``` ⏎ ⏎ result.add(importNode) [https://gitter.im/nim-lang/Nim?at=5e74ffea1856e0543a9828ad] |
17:40:06 | FromGitter | <kristianmandrup> `Error: cannot add to node kind: nnkEmpty` |
17:45:42 | FromGitter | <kristianmandrup> https://play.nim-lang.org/#ix=2eM9 |
17:45:45 | * | shadowbane joined #nim |
17:46:19 | FromGitter | <kristianmandrup> Getting: ` invalid pragma: var x: string` |
17:46:33 | * | jjido joined #nim |
17:51:19 | FromGitter | <dumjyl> You can't just add a NimNode to emit. It expects a string, or an array of strings and symbols. |
17:53:34 | FromGitter | <dumjyl> Oh, you probably just wanted to make result a stmt list first. |
17:54:23 | FromGitter | <kristianmandrup> result.add(body) |
17:54:27 | krux02 | that emit looks fine to me |
17:54:47 | FromGitter | <kristianmandrup> Aha, stmtlist first then add as children. Makes sense :) |
17:55:00 | FromGitter | <kristianmandrup> so create newStmtList and add to result |
17:55:05 | krux02 | kristianmandrup in the past your code used to work |
17:55:12 | krux02 | quote do always returned a stmtList |
17:55:37 | krux02 | then the stmtList got "optimized away" because why not, and my code stopped to work. |
17:56:43 | FromGitter | <kristianmandrup> hmm, krux, I think I need to use a factory function to create empty stmtList, then add each node as stmt, right? |
17:57:02 | FromGitter | <kristianmandrup> https://nim-lang.org/docs/macros.html#newStmtList%2Cvarargs%5BNimNode%5D |
17:57:17 | * | nsf quit (Quit: WeeChat 2.7) |
17:57:33 | krux02 | well you can also use, nnkStmtList.newTree(args ...) |
17:57:39 | krux02 | but yes |
17:57:42 | shashlick | @kristianmandrup: run choosenim 1.0.6 |
17:58:36 | FromGitter | <kristianmandrup> aha |
17:59:06 | shashlick | or choosenim stable for that matter |
17:59:09 | FromGitter | <kristianmandrup> ```var stmts = newStmtList([ importNode,body, assignNode]) ⏎ result = stmts``` [https://gitter.im/nim-lang/Nim?at=5e75046cb1a349586b94fabc] |
17:59:15 | krux02 | result = newStmtList(importNode, body, assignNode) |
17:59:16 | FromGitter | <kristianmandrup> ok, will try |
17:59:29 | krux02 | or result = nnkStmtList.newTree(importNode, body, assignNode) |
17:59:41 | krux02 | I really do like `newTree` because it just works |
18:00:24 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:04:47 | FromGitter | <kristianmandrup> Thanks krux, works like a charm :) |
18:04:50 | FromGitter | <kristianmandrup> except now I get |
18:05:08 | FromGitter | <kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e7505d411acde77423a9b29] |
18:05:33 | FromGitter | <Kvothe87> how can i check if the nim compiler i have is version 1.0.6 or 1.0.4? nim says 1.0.4 while choosenim says 1.0.6. is there any file that i can directly check? |
18:05:42 | FromGitter | <kristianmandrup> `$x` ? |
18:05:56 | Yardanico | echo NimVersion |
18:07:03 | FromGitter | <kristianmandrup> https://play.nim-lang.org/#ix=2eMh |
18:07:04 | Yardanico | @Kvothe87 ^ |
18:07:38 | krux02 | kristinmandrup: that one I don't know |
18:08:36 | FromGitter | <Kvothe87> @Yardanico thanks. I confirm that i have 1.0.4 don 't know why choosenim says differently |
18:09:15 | FromDiscord | <Rika> are you sure you're only using choosenim |
18:09:28 | FromDiscord | <Rika> and not choosenim + a local/packagemanager installed version |
18:10:47 | FromGitter | <kristianmandrup> simplifying it to dynvar: https://play.nim-lang.org/#ix=2eMj |
18:10:55 | FromGitter | <Kvothe87> could be but i cannot find any other nim on the computer |
18:16:06 | Araq | krux02, no, not "because why not", but because this way we fixed some other different bug |
18:16:20 | Araq | usually stuff is changed in order to fix bugs |
18:17:05 | Araq | as we have more important things to do than random changes / "refactorings" ;-) |
18:17:06 | FromGitter | <kristianmandrup> how do I set the output file, such as `test.mjs` |
18:17:31 | FromGitter | <kristianmandrup> I think there was an `--outfile` option? |
18:23:43 | FromGitter | <kristianmandrup> I kind of got nim to work with ES modules: https://github.com/kristianmandrup/esmodule_nim |
18:25:38 | FromGitter | <kristianmandrup> `arguments can only be given if the '--run' option is selected` when I try to use `--outfile` option |
18:25:53 | FromGitter | <kristianmandrup> but I want to use it for compile only |
18:30:36 | * | jwm224 quit (Ping timeout: 256 seconds) |
18:32:31 | * | jwm224 joined #nim |
18:33:04 | * | shadowbane quit (Ping timeout: 250 seconds) |
18:39:43 | * | Hideki_ quit (Remote host closed the connection) |
18:42:39 | FromDiscord | <Varriount> KristianMandrup: Put outfile before the target file to compile, not after |
18:43:40 | FromDiscord | <Varriount> `--outfile:someFile. mjs mainFile.nim` |
18:43:53 | * | Hideki_ joined #nim |
18:43:58 | FromDiscord | <Varriount> *someFile.mjs |
18:45:17 | * | Vladar quit (Quit: Leaving) |
18:45:20 | * | shadowbane joined #nim |
18:45:28 | FromGitter | <rayleyva> Hi all. I'm trying to script out a few things that are currently done via shell scripts. ⏎ It uses various tools to control cloud images, and then uses ansible for provisioning. ⏎ Is this possible within execShellCmd, or using osproc? |
18:45:46 | FromGitter | <rayleyva> Sample: https://play.nim-lang.org/#ix=2eMo |
18:46:43 | FromDiscord | <Varriount> It should be. Are you encountering any specific kind of problem? |
18:48:14 | * | Hideki_ quit (Ping timeout: 250 seconds) |
18:48:14 | FromGitter | <rayleyva> Mostly unable to activate the conda enabled Python environment that holds all the Ansible tools. |
18:48:54 | FromGitter | <rayleyva> I'm not understanding the internals of how it shells out to execute the cmd. |
18:49:18 | FromDiscord | <Recruit_main707> can i force the compiler to not ignore {.inline.}? |
18:50:52 | leorize | nope |
18:51:02 | leorize | it's not always good to inline |
18:51:19 | leorize | sometimes that's not even possible |
18:52:02 | leorize | axion, narimiran, disruptek: I've pushed a new branch called indent-rewrite, please switch over and test :) |
18:52:18 | FromDiscord | <Recruit_main707> its for debugging purposes, i guess it doesnt affect the program, but with emit it would be way easier |
18:53:06 | leorize | and for you, disruptek, just look for 'case' inside that file until you find the tweak I left there for you |
18:53:36 | leorize | you can read this for a brief: https://github.com/alaviss/nim.nvim/commit/4930fb88c2032bf17991d85145ae3fc7a26f3205 |
18:54:02 | leorize | Recruit_main707: wow, you're the first to say that it's easier :P |
18:54:29 | leorize | oh, if all the nimFrame annoys you too much, build with --stacktrace:off |
18:58:20 | FromDiscord | <Recruit_main707> oki |
19:01:20 | * | jjido joined #nim |
19:01:20 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
19:06:07 | * | Lord_Nightmare joined #nim |
19:09:04 | krux02 | Araq: I am not doing these refactoring because I don't have anything better to do. I am doing those refactoring in order to fix things. |
19:12:25 | Araq | krux02, never meant to imply this |
19:12:39 | Araq | you said "because why not" and I said "that's never the real reason" |
19:13:59 | krux02 | Araq: Well ok, "why not" is not the real reason. The real reason is ugly code is often workaround code for bugs. My mantra is, remove the workaround and address the bugs. |
19:14:42 | krux02 | That is why in my PRs refactorings always conflate with bugfixes. The bugfixes are directly related to the refactorings. |
19:14:54 | krux02 | Araq: gdb can go back in time |
19:16:02 | FromDiscord | <Recruit_main707> noob question (i am still getting used to pointers) i have var f: ptr File how should i close(f) |
19:20:48 | * | Hideki_ joined #nim |
19:21:23 | FromDiscord | <Rika> f[].close() maybe |
19:21:29 | FromDiscord | <Rika> wait ptr |
19:21:32 | FromDiscord | <Rika> dunno~ |
19:25:05 | leorize | why do you have a ptr File? |
19:25:21 | leorize | :P |
19:25:24 | FromDiscord | <Recruit_main707> ask the C function |
19:25:33 | leorize | just close(f[]) |
19:25:37 | leorize | oh then it's just File |
19:25:45 | leorize | File itself is a ptr :P |
19:26:06 | leorize | unless it said `FILE**`, then use `File` |
19:26:18 | FromDiscord | <Recruit_main707> i know, but for some reason the creator of reoen_s decided passing a pointer of a pointer of a file was great |
19:26:40 | leorize | can't you just use system.reopen? :P |
19:28:00 | FromDiscord | <Recruit_main707> idk, but now it works, also since i am messing with very low level stuff, using emit and playig it safe is the option i consider the best |
19:29:45 | leorize | well, you can start replacing those things with higher level operation once you found the things you make start biting you |
19:29:59 | leorize | {.emit.} is always a bad idea imo |
19:31:32 | * | JustASlacker quit (Ping timeout: 256 seconds) |
19:32:01 | FromDiscord | <Recruit_main707> i am wrapping things with it and if inline actually worked it would end up being pretty clean |
19:32:20 | leorize | inline doesn't do what you think it does... |
19:32:27 | leorize | and emit is a terrible way to wrap things |
19:35:31 | FromDiscord | <Recruit_main707> why terrible |
19:36:19 | FromDiscord | <Rika> merely it being emit is enough to make it pretty bad 😛 there are other better ways of wrapping isnt there? |
19:37:09 | * | Hideki_ quit (Ping timeout: 250 seconds) |
19:37:09 | FromDiscord | <Recruit_main707> to be fair, emit is the only thing it has worked for me + keeping things pretty simple (not wrapping types) |
19:40:24 | shashlick | Recruit_main707 what are you wrapping |
19:40:38 | * | abm joined #nim |
19:42:12 | * | PMunch quit (Quit: leaving) |
19:43:12 | FromDiscord | <Recruit_main707> kernel32 functions |
19:43:55 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:44:29 | shashlick | Have you tried c2nim and nimterop already? |
19:44:56 | leorize | shashlick: you can't wrap kernel32 functions with those tools |
19:45:03 | FromDiscord | <Recruit_main707> its a dll |
19:45:16 | FromDiscord | <Recruit_main707> well... |
19:45:21 | leorize | it's a microsoft thing :) you don't get the header, but microsoft expects everyone to be able to use them :P |
19:45:22 | FromDiscord | <Recruit_main707> there is windows.h |
19:45:35 | shashlick | Isn't all that already wrapped in winim |
19:45:59 | leorize | they said that doesn't work |
19:46:14 | leorize | oh... I think I know why now |
19:46:15 | FromDiscord | <Recruit_main707> i tried winim (for a few days tried to make it work) |
19:46:24 | leorize | winim uses {.dynlib.} |
19:46:47 | leorize | which will try to load "kernel32.dll" into the process (again?) |
19:46:51 | leorize | though that's just a theory :P |
19:47:20 | FromDiscord | <Recruit_main707> hmmm, its a bit weird but maybe |
19:47:54 | leorize | well --dynlibOverrideAll can be used to disable that |
19:48:38 | shashlick | What was the original issue |
19:48:46 | shashlick | I've used a lot of winim in feud |
19:57:12 | * | rnrwashere joined #nim |
19:58:10 | krux02 | cast[pointer](value) == nil |
19:58:53 | FromDiscord | <Recruit_main707> shashlick, functions wont work as expected |
19:59:09 | FromDiscord | <Recruit_main707> i am not getting actual errors back |
19:59:24 | * | rnrwashere quit (Client Quit) |
19:59:43 | * | rnrwashe_ joined #nim |
19:59:43 | * | rnrwashere joined #nim |
19:59:53 | * | rnrwashe_ quit (Client Quit) |
20:00:47 | shashlick | might be a repeat performance but can you share something I can look at |
20:01:06 | * | zahary quit (Quit: Leaving.) |
20:01:07 | shashlick | i found winim to work wonderfully |
20:01:28 | FromDiscord | <Recruit_main707> winim works well, but not with injection |
20:02:09 | shashlick | what do you mean by injection |
20:02:30 | FromDiscord | <Recruit_main707> dll injection |
20:03:15 | shashlick | you mean loading a nim dll into a nim main program? |
20:03:25 | * | rnrwashere quit (Remote host closed the connection) |
20:03:27 | shashlick | you need to use --gc:boehm - that's the only way today to get it working |
20:04:17 | FromDiscord | <Recruit_main707> i amusing an injector, allocate memory in a program (not nim necesarily) and run my DllMain |
20:04:49 | shashlick | in feud, i have a main Nim exe which loads a Nim dll which has all the windows calls |
20:05:55 | shashlick | so where does wrapping windows procs come into the picture and how does it interact with this dll |
20:09:04 | krux02 | Varriount: https://github.com/nim-lang/Nim/pull/13277 |
20:09:30 | * | disbot quit (Ping timeout: 256 seconds) |
20:09:30 | * | disruptek quit (Ping timeout: 256 seconds) |
20:10:21 | * | rnrwashe_ joined #nim |
20:10:21 | * | rnrwashere joined #nim |
20:16:45 | * | disruptek joined #nim |
20:17:18 | * | disbot joined #nim |
20:29:19 | narimiran | v1.2-beta nightlies are now also available: https://github.com/nim-lang/nightlies/releases/tag/2020-03-20-version-1-2-579e34e |
20:41:09 | * | sleepyqt quit (Quit: Leaving) |
20:43:26 | * | silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
20:46:06 | FromGitter | <sheerluck> I tried Nim Compiler Version 1.2.0 [Linux: amd64] Compiled at 2020-03-20 and it just worked. |
20:46:08 | FromGitter | <sheerluck> Then I added --gc:arc -d:useMalloc to nim.cfg |
20:46:15 | FromGitter | <sheerluck> ... and got `Error: type mismatch: got <string> but expected 'seq[byte]'` |
20:48:19 | FromGitter | <sheerluck> oh wait, it's `nimble install kaitai_struct_nim_runtime@#head --verbose` |
20:48:34 | FromGitter | <sheerluck> it has nothing to do with nim-1.2.0 |
20:58:58 | * | narimiran quit (Quit: leaving) |
21:05:14 | disruptek | good, thanks for testing. |
21:06:46 | disruptek | it's a gorgeous day here. breezy, 70-something degrees, and sunny. the town so quiet that all your can hear is the plague spreaders. |
21:06:54 | disruptek | playing. |
21:07:23 | disruptek | imagine how many thousands of people we will be finding dead in their homes in just a few weeks. |
21:07:31 | FromGitter | <sheerluck> ok it's too soon for me to use `--gc:arc` bc when it's on my `stream.close()` in my `finally:` leads to `SIGSEGV (Attempt to read from nil?)` |
21:07:57 | disruptek | it's a stdlib stream, right? |
21:08:03 | disruptek | can you create a playground repo? |
21:11:14 | FromGitter | <sheerluck> disruptek it's https://github.com/sheerluck/Toy-Nim-Project-with-Kaitai |
21:11:32 | disruptek | you know about sealmove's work, right? |
21:11:43 | FromGitter | <sheerluck> yes |
21:13:00 | disruptek | but what does it do? |
21:13:10 | disruptek | ls for mkv? |
21:13:19 | FromGitter | <sheerluck> kinda |
21:19:16 | FromDiscord | <Rika> Anyone made a vs code extension with just nim? |
21:19:40 | disruptek | i think the extensions are made against lsp. |
21:19:55 | leorize | lsp won't solve everything |
21:19:55 | disruptek | very unsure about that. |
21:20:07 | disruptek | i just mean, that's what the vscode ones are made against so far. |
21:20:41 | leorize | the vscode one uses nimsuggest directly |
21:21:00 | leorize | the vscode plugin predates nimlsp :P |
21:21:06 | disruptek | oh, cool. |
21:21:09 | FromDiscord | <Rika> ? I mean using Nim instead of ts and js |
21:21:26 | leorize | well lsp don't give you any indentation hints and things like that |
21:21:47 | leorize | @Rika: it predates the js backend so I'm pretty sure no one tried :P |
21:22:15 | FromDiscord | <Rika> Ah shit, time for a compatibility library? |
21:22:27 | leorize | yep |
21:22:42 | FromDiscord | <Rika> I'm lazy, someone else do it LOL |
21:22:52 | FromDiscord | <Rika> I have too many projects to manage basically |
21:23:08 | disruptek | leorize, how do i search for uses of a symbol? that's what i wanted to ask you days ago. 😁 |
21:23:32 | leorize | :NimReferences |
21:23:48 | leorize | if that doesn't work then `*` is a way to look for it in the current file |
21:24:17 | leorize | @Rika now you know why it's not done :P |
21:24:25 | disruptek | that one makes me have to hit enter. |
21:24:29 | disruptek | what's up with that? |
21:24:44 | leorize | the star thing? |
21:25:49 | disruptek | yeah |
21:26:00 | FromDiscord | <Rika> Semantic highlighting on Nim when |
21:26:18 | leorize | use nim.nvim |
21:26:32 | disruptek | should i expect :NimReferences to work? |
21:26:33 | * | natrys quit (Quit: natrys) |
21:26:37 | FromDiscord | <Rika> On vscode ;; though I was learning vim a while back |
21:27:00 | FromDiscord | <Rika> I liked most of the vim things it's just that skill slope tho |
21:27:01 | leorize | disruptek: sorta, the compiler is janky when it comes to complex sources |
21:27:14 | disruptek | i forgot what it was like to work without people watching me. |
21:27:26 | leorize | disruptek: can you try editing ftplugin/nim.vim:112-113 |
21:27:37 | leorize | change :execute -> :silent execute |
21:28:04 | leorize | I only get the enter thingy once everywhile, so I'm not sure what caused it |
21:28:09 | disruptek | i'm not supposed to be on the new branch, right? |
21:28:19 | leorize | it's fine there |
21:28:24 | leorize | or did you found a bug? |
21:28:51 | disruptek | no, i wasn't on there. just wanted to pull and make sure i'm up to date. |
21:29:07 | leorize | ah ok :) |
21:31:02 | disruptek | why is my outline window so tiny? |
21:32:18 | leorize | it just uses the location list |
21:32:29 | leorize | I think it depends on your settings |
21:51:27 | * | andinus quit (Quit: ERC (IRC client for Emacs 26.3)) |
21:52:25 | * | ggibson joined #nim |
21:53:08 | * | rnrwashe_ quit () |
21:53:08 | * | rnrwashere quit () |
21:53:23 | * | rnrwashe_ joined #nim |
21:53:23 | * | rnrwashere joined #nim |
21:53:33 | * | filcuc joined #nim |
21:53:58 | * | rnrwashe_ quit (Client Quit) |
21:54:13 | * | rnrwashe_ joined #nim |
21:54:30 | * | rnrwashe_ quit (Client Quit) |
21:54:30 | * | rnrwashere quit (Client Quit) |
21:54:45 | * | rnrwashere joined #nim |
21:54:48 | * | rnrwashe_ joined #nim |
21:55:15 | * | rnrwashe_ quit (Client Quit) |
21:57:49 | ggibson | What's the trick to using a nim shared lib from C? nim proc has {.exportc.}, the c code includes the generated header and calls NimMain() okay, but it can't find my actual fn definition. |
21:58:02 | leorize | ggibson: add {.dynlib.} too |
21:58:27 | leorize | disruptek: are you on the new branch? |
21:59:06 | disruptek | leorize: i'm on master. |
21:59:29 | leorize | if you have time, can you try the new branch? |
21:59:34 | disruptek | i merged in the case: change; i've been carrying it. |
21:59:39 | disruptek | sure. |
21:59:46 | ggibson | What the new branch? I just DL the nightly for Windows a few hours ago. |
22:00:09 | leorize | disruptek: the new branch have the case change, just /case for it |
22:00:17 | leorize | I disabled it by default :P |
22:00:20 | disruptek | what's it called? |
22:00:22 | ggibson | ah not talking to me :p @leorize that was it :facepalm: |
22:00:39 | * | gsingh93- joined #nim |
22:00:39 | leorize | disruptek: indent-rewrite |
22:00:42 | * | gsingh93 quit (Ping timeout: 272 seconds) |
22:00:53 | leorize | ggibson: :P we are talking about nim.nvim, the neovim plugin :P |
22:01:29 | disruptek | doesn't seem any different yet. |
22:02:00 | * | gsingh93- is now known as gsingh93 |
22:02:02 | leorize | it's just a rewrite of the indent module with one new feature built in |
22:02:13 | leorize | let me know if there's any bug |
22:02:25 | leorize | the new structure makes it easier to add features to the plugin |
22:03:50 | ggibson | @leorize Thanks. Fastest help ever (sub 1 second!). Gold star. |
22:04:34 | leorize | you're welcome :) |
22:22:14 | * | sagax quit (Ping timeout: 240 seconds) |
22:24:03 | FromDiscord | <Varriount> One day I will improve the nimlime plugin... one day |
22:27:37 | FromDiscord | <IanIAnIAN> whoever made nimjson, thank you for saving me from dotnet |
22:27:56 | FromDiscord | <Varriount> nimjson? Is that different from the built-in json module? |
22:28:03 | Yardanico | maybe https://github.com/jiro4989/nimjson ? |
22:28:18 | * | enthus1ast joined #nim |
22:28:48 | Yardanico | yeah, not the best naming but its ok :P |
22:29:32 | enthus1ast | hey i was bored during this corona crisis, i've hacked some html post hack thing: http://hackrshit.chickenkiller.com/ |
22:29:51 | FromDiscord | <Rika> better name would be probably "jsonscheme" or so |
22:30:06 | * | s4mu3lbk quit (Ping timeout: 250 seconds) |
22:30:41 | FromDiscord | <Rika> enthus1ast, why tho? What's it do? |
22:30:55 | FromDiscord | <Varriount> Or json2nim |
22:31:06 | enthus1ast | it allowes to push html (including css and js) to me and distribute it |
22:31:09 | FromDiscord | <IanIAnIAN> it does |
22:31:14 | * | solitudesf quit (Ping timeout: 240 seconds) |
22:31:24 | enthus1ast | bad idea i know but lets see :) |
22:35:18 | * | filcuc quit (Ping timeout: 250 seconds) |
22:56:13 | * | lritter quit (Quit: Leaving) |
22:59:25 | FromGitter | <awr1> hello, is there a variant of `quote do:` for macros but untyped? |
23:00:01 | FromGitter | <dumjyl> multiple but none merged into the stdlib. |
23:02:19 | * | ptdel joined #nim |
23:04:36 | * | ggibson quit (Ping timeout: 256 seconds) |
23:25:27 | * | koltrast quit (Read error: Connection reset by peer) |
23:27:15 | * | enthus1ast quit (Remote host closed the connection) |
23:29:11 | * | koltrast joined #nim |
23:34:19 | * | Hideki_ joined #nim |
23:37:07 | * | gangstacat quit (Ping timeout: 246 seconds) |
23:37:07 | * | Amun_Ra quit (Ping timeout: 246 seconds) |
23:37:57 | * | Amun_Ra joined #nim |
23:38:51 | * | gangstacat joined #nim |
23:39:10 | * | Hideki_ quit (Ping timeout: 256 seconds) |
23:40:59 | * | filcuc joined #nim |
23:44:44 | dwdv | What's the difference between --panics:on and -d:danger? |
23:45:34 | leorize | --panics:on crashes your program when someone raises a Defect |
23:45:54 | * | filcuc quit (Quit: Konversation terminated!) |
23:46:05 | leorize | -d:danger disable runtime checks for that ultimate performance |
23:46:06 | * | filcuc joined #nim |
23:48:14 | dwdv | Ehm, I might be especially dense, but doesn't that lead to the same result? |
23:48:56 | leorize | no |
23:49:17 | leorize | -d:danger make things like overflow or out of bounds becoming unchecked |
23:49:34 | dwdv | Oh, I see. |
23:49:51 | dwdv | Thanks for clearing that up. |
23:49:59 | leorize | np :) |
23:52:02 | * | filcuc quit (Quit: Konversation terminated!) |
23:52:12 | * | filcuc joined #nim |
23:53:19 | * | chemist69 quit (Ping timeout: 246 seconds) |
23:54:29 | * | chemist69 joined #nim |
23:57:21 | * | Trustable quit (Remote host closed the connection) |