00:37:27 | * | audiophile_ quit (Remote host closed the connection) |
00:37:44 | * | audiophile_ joined #nim |
00:38:22 | * | audiophile_ quit (Client Quit) |
01:25:21 | nrds | <Prestige99> Some of these definitions don't seem to exist.. I wonder if they're all required in a wrapper, anyway. |
01:26:34 | nrds | <Prestige99> I'm not sure how types are used in C if there's no definition, I grep'd the whole chipmunk2d project |
01:54:06 | nrds | <Prestige99> Wonder if I need to change how this is wrapped https://github.com/slembcke/Chipmunk2D/blob/master/include/chipmunk/chipmunk_structs.h#L226 not sure about this whole `ptr object of Shape` business is correct: https://github.com/avahe-kellenberger/nim-chipmunk/blob/master/src/chipmunk7.nim#L93 |
01:54:32 | nrds | <Prestige99> in the c def, these structs wrap a "cpShape" |
01:55:06 | nrds | <Prestige99> (I hate working with c libraries now) |
02:32:29 | * | arkurious quit (Quit: Leaving) |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:31 | * | supakeen joined #nim |
05:55:08 | FromDiscord | <acek7> why dont programming books have audio books |
06:05:47 | FromDiscord | <Rika> its hard to represent code in audio |
06:26:04 | FromDiscord | <Smarc> Could anyone explain me why nvim is not recognizing the imported module/procedure? The main.nim file is compiling fine, so it has to be some local nvim issue. You can find my .vimrc here: https://gist.github.com/Smarcy/a39bddf17c8dd0dcb2c59bde60fe219e https://media.discordapp.net/attachments/371759389889003532/899181446621700127/Screenshot_20211016_145604.png |
06:27:15 | FromDiscord | <Smarc> Also nvim tells me that "piece_factory" would be an unusedImport |
06:44:27 | FromDiscord | <Rika> reopen |
06:51:13 | FromDiscord | <Smarc> My god, that fixed it .. Thank you first of all. How do I avoid that behaviour? |
06:59:57 | FromDiscord | <Rika> It just happens lol |
07:00:14 | FromDiscord | <Rika> It’s to do with how nimsuggest works I guess |
08:12:30 | * | max22- joined #nim |
08:57:17 | FromDiscord | <leorize> you can't, unfortunately. It usually clears up after typing for awhile on the problematic file, but there is no concrete way to fix this other than restarting nimsuggest↵(@Smarc) |
09:05:20 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
09:16:31 | FromDiscord | <Fancy> In reply to @Gumber "have a good night!": Oh just coincidence then. I saw some engines that utilised data orientated design I think it was Orx and Heaps, but it was a long time ago so I could be wrong. I think you have mentioned Unity and Godot a couple times now, I am guessing that you have used them before. |
09:23:44 | FromDiscord | <Fancy> @Gumber https://discord.com/channels/371759389889003530/706542664643772436/899226028852006914 |
09:24:19 | FromDiscord | <Fancy> In reply to @Gumber "have a good night!": https://discord.com/channels/371759389889003530/706542664643772436/899226028852006914 |
10:08:48 | FromDiscord | <levovix> how to cast seq to seq of type with different size?↵for example seq[byte] to seq[int] |
10:09:20 | FromDiscord | <haxscramper> `cast[seq[int]](<seq[byte>)` |
10:09:36 | FromDiscord | <haxscramper> This is of course unsafe, but assuming you know what you are doing it is the only solution I know of |
10:11:11 | FromDiscord | <levovix> In reply to @haxscramper "`cast[seq[int]](<seq[byte>)`": len will be incorrect |
10:12:40 | FromDiscord | <haxscramper> Then convert things manually, read four bytes into `array[4, byte]` cast to int and append to the sequence |
10:13:11 | FromDiscord | <levovix> ok |
10:35:56 | FromDiscord | <walter248_gitlab (Walter Mulder)> Hi, I have executed "nimble install minwc" for WebSiteCreator, no error messages. This follows instructions (1a) for Install with Nimble. But when I type "./minwc" I get a series of messages\: |
10:36:05 | FromDiscord | <walter248_gitlab (Walter Mulder)> sent a long message, see http://ix.io/3BZf |
10:36:49 | FromDiscord | <walter248_gitlab (Walter Mulder)> I imagine nim.cfg must be set up differently... does anyone have information on what is needed? |
11:11:18 | * | rusua joined #nim |
11:55:32 | * | max22- quit (Ping timeout: 268 seconds) |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:31 | * | supakeen joined #nim |
12:57:26 | FromDiscord | <Fancy> Can someone tell me what I shouldn't use Nim for? |
12:58:18 | FromDiscord | <haxscramper> malware |
12:58:34 | FromDiscord | <Fancy> haha nice |
12:58:38 | FromDiscord | <haxscramper> and on more serious note, I don't think there is something you should not use nim for |
12:58:58 | FromDiscord | <haxscramper> there are of course things that nim is better for, but as far as I'm concerned it is even suitable for hardcore cryptography |
12:59:20 | FromDiscord | <haxscramper> I use it for CLI scripts, compiler development |
12:59:26 | FromDiscord | <Fancy> Seriously I have been looking for ages and I can't find any reason I shouldn't use it |
12:59:36 | FromDiscord | <Fancy> Nice to meet you btw |
12:59:42 | FromDiscord | <haxscramper> There are web frameworks, GUI etc. pretty much whole spectrum |
13:02:24 | FromDiscord | <Fancy> Oh I always wanted to have a look into cryptography. |
13:02:31 | FromDiscord | <Fancy> Ohh |
13:02:40 | FromDiscord | <Fancy> I wanted to ask someone about this.. |
13:02:50 | FromDiscord | <Fancy> compiler development |
13:03:26 | FromDiscord | <Fancy> Do you have much friction when doing compiler development in Nim? |
13:03:38 | FromDiscord | <enthus1ast> the nim compiler is build IN nim |
13:03:38 | FromDiscord | <haxscramper> No, not really |
13:03:48 | FromDiscord | <haxscramper> That does not really say much tbh |
13:03:48 | FromDiscord | <Fancy> Ohh so it is |
13:04:08 | FromDiscord | <haxscramper> Yes, but it is a large codebase with some technical debt etc. |
13:04:08 | FromDiscord | <Fancy> I just opened up github and yeah you're right |
13:04:10 | FromDiscord | <Fancy> cool |
13:04:15 | FromDiscord | <haxscramper> More than a decade of nim |
13:04:22 | FromDiscord | <haxscramper> But yes, it is 100% nim |
13:04:42 | FromDiscord | <haxscramper> First converted from pascal |
13:04:48 | FromDiscord | <Fancy> Ahhh |
13:04:55 | FromDiscord | <haxscramper> But usually there is not a lot of friction when developing compilers in nim |
13:04:56 | FromDiscord | <Fancy> Yeah I just watched a talk |
13:05:17 | FromDiscord | <haxscramper> I guess you just need to accept some code patterns like object variants and stuff |
13:05:20 | FromDiscord | <haxscramper> And then it becomes very easy yo do |
13:05:37 | FromDiscord | <haxscramper> there is a lot of stuff https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6 |
13:07:44 | FromDiscord | <Fancy> In reply to @haxscramper "But usually there is": This is really good to know because this is something I would like to have a go at in the future. I might have a go at implementing a brainfuck interpreter first from the link on the Nim site. |
13:09:07 | FromDiscord | <Fancy> In reply to @haxscramper "I guess you just": Alright thanks for the tip. I really appreciate it. |
13:09:41 | FromDiscord | <Fancy> Ahh this link is to your project? |
13:10:13 | FromDiscord | <haxscramper> no, most of them are not mine |
13:10:23 | FromDiscord | <haxscramper> actually only htsparse in this list is my project |
13:13:27 | FromDiscord | <Fancy> Don't belittle yourself. 🙂 It is very impressive. I don't even have anything up on github yet at all. 🙂 |
13:14:47 | FromDiscord | <Fancy> I have one concern about Nim, but I believe it is probably a non issue |
13:16:16 | * | arkurious joined #nim |
13:19:02 | FromDiscord | <Fancy> I created a tiny wrapper for the canvas api yesterday and the javascript file was about 1000 lines |
13:20:27 | FromDiscord | <xflywind> Have you tried `-d:danger` option? |
13:20:27 | FromDiscord | <Fancy> Is there a reason for this? |
13:20:35 | FromDiscord | <Fancy> Me? |
13:20:41 | FromDiscord | <xflywind> yeah |
13:20:46 | FromDiscord | <Fancy> No not yet |
13:20:48 | FromDiscord | <xflywind> `nim js -d:danger` |
13:21:02 | FromDiscord | <Fancy> I have just got into the Nim language |
13:21:05 | * | max22- joined #nim |
13:21:07 | FromDiscord | <Fancy> What does it do? |
13:21:11 | FromDiscord | <xflywind> (edit) "`nim js -d:danger` ... " added "or `nim js -d:release`." |
13:22:36 | FromDiscord | <xflywind> `-d:release` remove debug information and reduce the lines of code generated. |
13:22:41 | FromDiscord | <Rika> In reply to @Fancy "Can someone tell me": distributed computing? |
13:23:54 | FromDiscord | <Rika> In reply to @Fancy "I created a tiny": nim compilation artifacts are not meant to be readable |
13:24:07 | FromDiscord | <Rika> they can be though, as flywind sayds |
13:24:09 | FromDiscord | <Rika> (edit) "sayds" => "says" |
13:24:48 | FromDiscord | <Fancy> In reply to @flywind "`-d:release` remove debug information": Ohhhh I would have never known this even existed if you didn't tell me. thank you |
13:25:12 | FromDiscord | <xflywind> no problem |
13:26:13 | FromDiscord | <Rika> In reply to @Rika "distributed computing?": or anything that requires utmost stability, perhaps |
13:26:30 | FromDiscord | <Fancy> In reply to @Rika "distributed computing?": Ahh I read somewhere that elixir was good for distributed computing which I believe discord uses |
13:26:32 | FromDiscord | <Rika> though even then you can use nim for that, youll just have much more work |
13:26:45 | FromDiscord | <haxscramper> isn't status a prime example of such system |
13:26:53 | FromDiscord | <Rika> yes |
13:26:58 | FromDiscord | <Fancy> In reply to @flywind "no problem": I seriously really appreciate the help. |
13:27:02 | FromDiscord | <haxscramper> distributed computing, extreme requirements for stablitiy etc |
13:27:04 | FromDiscord | <Rika> but as i mentioned it's a lot of work needed |
13:27:30 | FromDiscord | <haxscramper> Yes, but the problem itself means there is a lot of wokr |
13:27:31 | FromDiscord | <Rika> i mean i guess you can argue that it's a lot of work in any language |
13:27:57 | FromDiscord | <haxscramper> yes, you said it just as I typed |
13:28:10 | FromDiscord | <haxscramper> ecosystem is weaker for this sort of thing |
13:28:15 | FromDiscord | <Rika> well then i guess the nutshell here is that if you're not up to write a lot of code (or you want a batteries included ecosystem) then yeah |
13:28:19 | FromDiscord | <Rika> nim isnt really well suited |
13:28:26 | FromDiscord | <Rika> god damn it |
13:28:27 | FromDiscord | <haxscramper> you can't just go, pick random library from top of hackernews praise list and go with it |
13:28:35 | FromDiscord | <Rika> yeah |
13:28:41 | FromDiscord | <haxscramper> hivemind |
13:28:42 | FromDiscord | <Rika> we dont even have a praise list do we |
13:29:32 | FromDiscord | <Rika> well thats the gist then, be ready to write serious amounts of code otherwise you'll cry |
13:29:38 | FromDiscord | <Fancy> In reply to @Rika "though even then you": Oh I see. I am not sure if it is something I will be using so should be fine. 🙂 |
13:30:04 | FromDiscord | <enthus1ast> stable distributed system are hard, even more so when the environment is hostile (eg the internet) |
13:30:43 | FromDiscord | <Rika> ~~do yall have books regarding such systems and how to make them btw~ |
13:30:44 | FromDiscord | <Rika> (edit) "btw~" => "btw~~" |
13:34:14 | FromDiscord | <Fancy> If I needed to build a distributed system for some reason, couldn't I just use node.js? |
13:34:19 | FromDiscord | <Fancy> Or nah |
13:35:24 | FromDiscord | <Rika> you can use any language |
13:35:29 | FromDiscord | <Fancy> I saw some book on creating distributed systems with node.js |
13:35:31 | FromDiscord | <Rika> its just a matter of how much effort itll take on such language |
13:35:51 | FromDiscord | <Fancy> I was meaning to say would it be more suitable |
13:36:31 | FromDiscord | <dom96> Nim is pretty good for distributed systems |
13:36:57 | FromDiscord | <dom96> we've got a good set of networking libraries which is the primary thing you need |
13:37:13 | FromDiscord | <Fancy> A language like elixir would be more suitable though right? |
13:37:50 | FromDiscord | <Fancy> In reply to @dom96 "we've got a good": Would you be able to send a link to them? |
13:38:00 | FromDiscord | <dom96> Not too familiar with Elixir. Why do you think it would be more suitable? |
13:38:23 | FromDiscord | <Fancy> I think it might of said on their site. |
13:38:28 | FromDiscord | <Fancy> I will go and check |
13:38:29 | FromDiscord | <Rika> elixir is afaik either a compiles-to-erlang or uses erlang vm |
13:38:31 | FromDiscord | <Fancy> one moment |
13:38:36 | FromDiscord | <Rika> and you know erlang |
13:38:38 | FromDiscord | <Rika> i hope |
13:39:19 | FromDiscord | <Fancy> "Elixir is a dynamic, functional language for building scalable and maintainable applications.↵Elixir leverages the Erlang VM, known for running low-latency, distributed, and fault-tolerant systems. Elixir is successfully used in web development, embedded software, data ingestion, and multimedia processing, across a wide range of industries." |
13:39:47 | FromDiscord | <dom96> Yes, I know those buzz words. I think it's important to dig deeper 🙂 |
13:40:09 | FromDiscord | <dom96> A distributed system is already a very overloaded term |
13:40:41 | FromDiscord | <Rika> yeah pretty much just as specific as saying something "utilises the internet" like ??? |
13:46:28 | FromDiscord | <retsyo (retsyo)> since I can't receive my password recovery mail from https://forum.nim-lang.org/. Is there any other way to log in? |
13:47:14 | FromDiscord | <xflywind> what's you username? |
13:47:30 | * | max22- quit (Ping timeout: 260 seconds) |
13:47:40 | FromDiscord | <retsyo (retsyo)> oyster |
13:48:10 | FromDiscord | <xflywind> In reply to @retsyo (retsyo) "oyster": @dom96 ^ |
13:48:49 | FromDiscord | <dom96> hm, can't do much other than resend the password recovery email |
13:48:52 | FromDiscord | <dom96> why can't you receive it? |
13:49:38 | FromDiscord | <dom96> I just reset mine and received the email (was in my spam folder though) |
13:50:00 | FromDiscord | <Fancy> In reply to @dom96 "Yes, I know those": Alright I will have a bit more of a look. |
13:51:08 | FromDiscord | <Fancy> In reply to @dom96 "A distributed system is": I have found an article about different kinds of distributed systems, so I will read up on that. |
13:51:55 | FromDiscord | <Fancy> In reply to @Rika "yeah pretty much just": I guess it is pretty broad. haha! sorry haha |
13:52:53 | FromDiscord | <Fancy> @dom96 What is something that you would use another language for over Nim? |
13:56:21 | FromDiscord | <Fancy> I really appreciate your guys feedback a lot as I have only been using this language for a couple of days so far, so having people with more experience to answer my questions really helps clears things up for me. 🙂 |
13:56:59 | FromDiscord | <Fancy> (edit) "clears" => "clear" |
13:58:23 | FromDiscord | <retsyo (retsyo)> sorry, please ignore my above question. I can't recieve any recovery email days(weeks?) ago. But I tried few minutes ago, now I can log in the forum again \:) |
13:58:32 | FromDiscord | <dom96> great 🙂 |
13:58:37 | FromDiscord | <Fancy> I would really like to know what got you guys into the language and what your experiences have been like so far. |
13:59:47 | FromDiscord | <haxscramper> Interop with Cxx is good |
13:59:50 | FromDiscord | <haxscramper> And macros |
14:00:00 | FromDiscord | <haxscramper> Basically this caught my attention at first |
14:00:06 | FromDiscord | <dom96> In reply to @Fancy "<@!132595483838251008> What is something": I would personally try to use Nim for everything. I guess an exception would be where another language has a well established library for what I want to do and I don't have time to implement it in Nim myself (or to even wrap it if it's implemented in C/C++) |
14:00:30 | FromDiscord | <dom96> Example could be Pandas in Python |
14:00:31 | FromDiscord | <haxscramper> There are some rough edges if you get into somewhat advanced stuff though, especially deep into typed macros/generics |
14:00:51 | * | rusua quit (Quit: Connection closed for inactivity) |
14:01:23 | FromDiscord | <dom96> or specialised stuff like backtesting financial algorithms I would grab Python since there is a big ecosystem for that there |
14:02:14 | FromDiscord | <Fancy> In reply to @haxscramper "Interop with Cxx is": From CMake? |
14:03:02 | FromDiscord | <Fancy> In reply to @haxscramper "There are some rough": So in general macros and generics caught your eye, right? |
14:05:39 | * | max22- joined #nim |
14:06:14 | FromDiscord | <Fancy> In reply to @dom96 "I would personally try": If you feel that way it must be pretty damn flexible. That makes sense it is probably better to just use the tools you already have at your disposal sometimes instead of trying to recreate an entire toolset. |
14:10:29 | FromDiscord | <Fancy> In reply to @dom96 "or specialised stuff like": Definitely. For a financial things in general I have seen a lot of recommendations for using Python, or Java. |
14:20:49 | FromDiscord | <haxscramper> In reply to @Fancy "So in general macros": macros and Cxx interop |
14:21:14 | FromDiscord | <Fancy> Nice |
14:22:03 | FromDiscord | <Fancy> So can you tell me what is so good about the macros in Nim? |
14:24:54 | FromDiscord | <haxscramper> They are procedural, which means you can put arbitrarily complex logic in them, they operate on the syntax level (not like C text substitution preprocessor) so you can create own DSLs when needed |
14:25:25 | FromDiscord | <haxscramper> https://nim-lang.org/blog/2021/03/10/fusion-and-pattern-matching.html for example this is a macro |
14:26:13 | FromDiscord | <haxscramper> And for `typed` macros you can also get access to types, so you can for example accept a type symbol into macro and then iterate over all fields in this symbol |
14:27:26 | FromDiscord | <haxscramper> for example here I pull out type information from tuple type https://stackoverflow.com/a/69462862/6086513 |
14:29:28 | FromDiscord | <haxscramper> https://forum.nim-lang.org/t/6753#41973 largely talks about nim AST macros are better than other alternatives (it was a discussion about the language comparison with nim, so the response is also A vs B) |
14:31:33 | FromDiscord | <Fancy> In reply to @haxscramper "They are procedural, which": Damn I definitely didn't know that. I just got into it because of the amazing interop with other languages. That is actually really useful for me because as a person who is obsessed with these things in general I can get a lot out of it. Besides that that is wicked cool. |
14:33:40 | FromDiscord | <retsyo (retsyo)> It is a pity that there is no python-pandas-like module (with the ability to reader/writer excel's XLS and XLSX via other packages) for nim, which I often treate in my work. And I think it is impossible to develop such a module for static language. |
14:34:45 | FromDiscord | <Fancy> In reply to @haxscramper "And for `typed` macros": What really? I think I am going to have to look into this a lot more damn that's cool. I can't think of any other language that does this but I could be wrong. |
14:35:42 | FromDiscord | <haxscramper> You mean full excel compute engine features, or just using it as a static data frame? |
14:36:09 | FromDiscord | <haxscramper> i.e. just for dumb static excel generation |
14:39:22 | FromDiscord | <Fancy> In reply to @haxscramper "https://forum.nim-lang.org/t/6753#41973 largely tal": I will give it a read. I am having a bit of a look into the macros right now and I don't know if I have seen anything this fantastic. seriously |
14:42:53 | FromDiscord | <retsyo (retsyo)> read data in excel files(both XLS and XLSX format, because some colleagues always supply XLS) into pandas DataFrame, then I perform the operations(sort/filter/pivot-table/...) in pandas |
14:45:20 | FromDiscord | <Fancy> @haxscramper Hey man I just want to let you know that you sharing your love and knowledge of the language has really motivated me to continue on using it |
14:47:39 | FromDiscord | <Fancy> I can't believe a language like this exists |
14:47:56 | FromDiscord | <retsyo (retsyo)> any step-by-step macros tutorial with more explanation for an amateur programmer? I think it is hard for me to understand official https://nim-lang.org/docs/macros.html |
14:49:17 | FromDiscord | <Fancy> I believe fullstack webdev could be possible with the interop capabilities |
14:51:38 | FromDiscord | <Fancy> In reply to @retsyo (retsyo) "any step-by-step macros tutorial": Maybe it would be helpful to go through some of the basics of Nim, if you haven't already. I don't know your experience, but if it is hard it is probably because there are some gaps in your knowledge. |
14:52:03 | FromDiscord | <Rika> In reply to @Fancy "I believe fullstack webdev": and it is |
14:53:23 | FromDiscord | <Fancy> dayumm |
14:55:33 | FromDiscord | <Fancy> In reply to @Rika "and it is": I am so sold on this language |
14:55:36 | FromDiscord | <Fancy> seriously |
14:56:02 | FromDiscord | <Fancy> I know it is just a tool, but it is an amazing one at that |
14:57:42 | FromDiscord | <haxscramper> https://dev.to/beef331/demystification-of-macros-in-nim-13n8 this one is good I suppose? At this point I don't really remember basic stuff to be honest, so I can't really recommend anything |
15:02:17 | FromDiscord | <Fancy> I saw some people saying they used c++ in parts of their game where performance was critical. I am guessing I could achieve this with nim too right? |
15:08:09 | FromDiscord | <haxscramper> correct |
15:08:22 | FromDiscord | <haxscramper> well, you can write games entirely in nim |
15:08:36 | FromDiscord | <haxscramper> I guess C++ was used only in parts because it is very painful to write in |
15:09:05 | FromDiscord | <haxscramper> was not used for the whole game because it is painful |
15:10:16 | FromDiscord | <Fancy> I think C++ is not too bad if you are only doing simple things, but I have tried to do more complicated things in it and I felt like I was in a special kind of hell haha |
15:10:57 | FromDiscord | <Fancy> In reply to @haxscramper "well, you can write": That is absolutely fantastic |
15:11:57 | FromDiscord | <Fancy> In reply to @haxscramper "well, you can write": I have wanted a language like this for quite some time now. Something that doesn't get in my way and just allows me to do what I want to do. |
15:14:11 | FromDiscord | <Fancy> In reply to @haxscramper "was not used for": C++ in small doses is the only approach that should be taken in my books unless you really know what you are doing. It is just by opinion but I kept on feeling like the language was trying to fight me. |
15:20:09 | FromDiscord | <retsyo (retsyo)> thank you for the macros article. I will try to read it carefully. |
15:45:51 | * | Gustavo6046 joined #nim |
17:09:45 | * | Gustavo6046 quit (Remote host closed the connection) |
17:09:48 | * | Gustavo6046_ joined #nim |
17:12:34 | * | Gustavo6046_ is now known as Gustavo6046 |
17:21:05 | * | Gustavo6046_ joined #nim |
17:21:40 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
17:23:50 | * | Gustavo6046_ is now known as Gustavo6046 |
17:40:48 | Amun-Ra | I have p: ptr cchar, how to write to p[1]? |
17:41:23 | FromDiscord | <haxscramper> u need to cast it to `ptr UncheckedArray[cchar]` |
17:41:30 | FromDiscord | <haxscramper> Nim pointers are never arrays |
17:41:43 | FromDiscord | <haxscramper> `UncheckedArray` has all the necessary operations |
17:42:00 | Amun-Ra | ah, thanks |
17:57:19 | Amun-Ra | what would be the best way of passing chunk of an array to a function (I need to write to the chunk inside it) |
17:58:53 | Amun-Ra | hmm, passing array and start index… |
17:59:39 | * | xet7 quit (Remote host closed the connection) |
18:00:43 | * | xet7 joined #nim |
18:03:37 | FromDiscord | <ynfle (ynfle)> Is it an unchecked array? |
18:03:58 | FromDiscord | <ynfle (ynfle)> for a seq, seq[start..stop] (FYI it's inclusive) |
18:06:07 | * | max22- quit (Ping timeout: 240 seconds) |
18:11:36 | Amun-Ra | woudn't that seq be immutable? |
18:18:31 | * | max22- joined #nim |
18:24:44 | Amun-Ra | (I'm writing a small embedded project and I have to operate in gcless world) |
18:25:20 | FromDiscord | <haxscramper> `seq[a..b]` copies a sequence |
18:25:37 | FromDiscord | <haxscramper> your best solution would be to pass seq+ranges to the proc |
18:34:22 | Amun-Ra | or openArray with start offset |
18:44:55 | FromDiscord | <ynfle (ynfle)> Not if it's a `var` |
18:45:03 | FromDiscord | <ynfle (ynfle)> It's mutable then |
18:45:15 | FromDiscord | <ynfle (ynfle)> Do you want a mutable view? |
18:49:29 | Amun-Ra | yes |
18:58:54 | FromDiscord | <exelotl> how efficient are tables in nimscript? |
19:18:39 | FromDiscord | <haxscramper> just as any nimscript object |
19:18:46 | FromDiscord | <haxscramper> there is not table-specific overhead for nimscript |
19:19:23 | FromDiscord | <haxscramper> they use nim implementation from `std/tables.nim` |
19:22:07 | FromDiscord | <exelotl> ah, I was hoping there might be some efficient "soft object" built into nimscript |
19:22:48 | FromDiscord | <exelotl> well really I just need to map strings to ints |
19:28:41 | FromDiscord | <Elegantbeef> Time for CoW strings that are pre hashed 😛 |
20:41:21 | * | mahlon quit (Ping timeout: 245 seconds) |
21:13:20 | * | neurocyte0132889 joined #nim |
21:13:20 | * | neurocyte0132889 quit (Changing host) |
21:13:20 | * | neurocyte0132889 joined #nim |
21:18:20 | FromDiscord | <Elegantbeef> @impbox [ftsf]\: @geekrelief we've now got state reload capabilities for exported global symbols!(Needs latest Nim commit though) https://streamable.com/9zr8w4 |
21:19:18 | FromDiscord | <geekrelief> In reply to @Elegantbeef "<@309937753699778561>\: <@109484839480107008> we've": whoa! sweet! |
21:19:51 | FromDiscord | <Elegantbeef> uses `loadState` and `saveState` from `nimscripter` |
21:20:05 | FromDiscord | <Elegantbeef> Soon enough i'll have to document/test all this stuff |
21:23:33 | FromDiscord | <geekrelief> is it correct to pass a `{.cdecl.}` proc to C via a pointer parameter? |
21:24:49 | FromDiscord | <Elegantbeef> Possibly, dont recall how cdecl gens code |
21:25:43 | FromDiscord | <geekrelief> On another note, anyone know how to resolve a `too many initializers` error from generated C? I'm creating an array of structs and passing it into a C function via (myarray[0].unsafeAddr). |
21:26:12 | FromDiscord | <geekrelief> The weird part is each struct looks like it's code gen'ed correctly |
21:28:47 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C4F |
21:29:42 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C4G |
21:31:57 | FromDiscord | <geekrelief> The weird part is this error only appears when I define this variable: `let p: pointer = truthCreateTypes` where `trutCreateTypes` is a `{.cdecl.}` proc I pass to C. |
21:32:38 | FromDiscord | <geekrelief> this is so weird |
21:33:32 | FromDiscord | <impbox [ftsf]> In reply to @Elegantbeef "<@309937753699778561>\: <@109484839480107008> we've": Exciting!! |
21:34:31 | FromDiscord | <geekrelief> oh crap.. it' must be a template! |
21:35:06 | FromDiscord | <geekrelief> nvm |
21:35:39 | FromDiscord | <geekrelief> time to take a break I guess.. |
21:38:35 | * | mahlon joined #nim |
21:39:08 | * | neurocyte0132889 quit (Read error: Connection reset by peer) |
21:39:46 | * | neurocyte0132889 joined #nim |
21:39:46 | * | neurocyte0132889 quit (Changing host) |
21:39:46 | * | neurocyte0132889 joined #nim |
21:47:06 | * | max22- quit (Quit: Leaving) |
22:04:08 | nrds | <Prestige99> I'm storing a ref object with a pointer, and trying to bring it back later for modification. But I think the object might not be the same? https://play.nim-lang.org/#ix=3C4P as an example |
22:04:30 | nrds | <Prestige99> @Elegantbeef I think this may be the problem with the code I've been sharing with you ^ (in part) |
22:08:16 | FromDiscord | <geekrelief> lol, nimterop wasn't able to convert `tm_the_truth_property_definition_t` properly because there's a union in the struct. |
22:10:59 | FromDiscord | <Elegantbeef> No prestige the issue with that code is you're doing stuff wrong |
22:11:25 | nrds | <Prestige99> Yeah that's what I mean, it seems I can do the above |
22:11:28 | nrds | <Prestige99> cant* |
22:11:47 | FromDiscord | <Elegantbeef> Well of course not `foo.addr` != `cast[ptr Foo](foo)` |
22:12:04 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3C4Q |
22:12:33 | FromDiscord | <Elegantbeef> Like look at https://play.nim-lang.org/#ix=3C4R |
22:13:08 | nrds | <Prestige99> oh so addr is a pointer to a ref? 🤔 |
22:13:16 | FromDiscord | <Elegantbeef> Well yea |
22:13:26 | FromDiscord | <Elegantbeef> you're getting the address of the variable |
22:13:37 | FromDiscord | <Elegantbeef> Which is a pointer |
22:13:41 | FromDiscord | <Elegantbeef> It's the same with pointers |
22:14:01 | nrds | <Prestige99> hm I always thought refs were essentially pointers |
22:14:12 | FromDiscord | <Elegantbeef> They are |
22:14:13 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3C4S |
22:14:15 | FromDiscord | <Elegantbeef> They behave identically in this case |
22:14:35 | FromDiscord | <Elegantbeef> `addr` of a variable returns the address of that variable regardless if it's a pointer or not |
22:14:51 | FromDiscord | <Elegantbeef> It does not return the address of where it points at |
22:16:01 | nrds | <Prestige99> Alright, so this might get me closer.. |
22:16:28 | FromDiscord | <Elegantbeef> Hopefully that explanation makes sense 😀 |
22:16:40 | nrds | <Prestige99> so if you look here https://git.einheit.tech/EinheitTechnologies/shade/src/branch/example/platformer/src/shadepkg/game/physicsbody.nim#L73 `userData` is a `pointer` |
22:16:54 | nrds | <Prestige99> then it's being used here https://git.einheit.tech/EinheitTechnologies/shade/src/branch/example/platformer/src/shadepkg/game/physicsbody.nim#L106 |
22:17:24 | nrds | <Prestige99> but I believe I should be saying cast[ptr PhysicsBody](body.userData) |
22:17:40 | FromDiscord | <Elegantbeef> Indeed |
22:17:43 | nrds | <Prestige99> but I still get an illegal storage access error in that case. Unless ptr != pointer |
22:17:56 | FromDiscord | <Elegantbeef> pointer is a `void` |
22:18:03 | FromDiscord | <Elegantbeef> well physicsbody is a ref object no? |
22:18:09 | nrds | <Prestige99> Yes it is |
22:19:56 | FromDiscord | <Elegantbeef> so you should be doing `physicsBody.body.userData = cast[pointer](physicsBody)` ? |
22:21:23 | nrds | <Prestige99> oh wow I think that worked (at least it didn't crash) |
22:21:44 | nrds | <Prestige99> Thanks; this whole thing is a bit confusing, need to read about refs.. |
22:22:13 | FromDiscord | <Elegantbeef> Refs are just pointers which are managed by the GC |
22:22:24 | nrds | <Prestige99> ah, alright cool. Thanks! |
22:24:28 | FromDiscord | <Elegantbeef> Of course casting to ptr is unsafe and can result in bad behaviour if you dont manage the C side code |
22:24:37 | FromDiscord | <Elegantbeef> But we have destructors now, so use those where applicable |
22:24:50 | nrds | <Prestige99> only available with arc/orc yeah? |
22:25:07 | FromDiscord | <Elegantbeef> They work everywhere but work better with rcs |
22:25:21 | FromDiscord | <Elegantbeef> with refc you dont have them deterministically so they behave oddly |
22:25:27 | nrds | <Prestige99> Been stuck on this for days, thanks for helping :) |
22:25:40 | FromDiscord | <Elegantbeef> No problem |
22:43:39 | * | rockcavera joined #nim |
22:43:39 | * | rockcavera quit (Changing host) |
22:43:39 | * | rockcavera joined #nim |
22:47:04 | * | User11 joined #nim |
23:28:35 | FromDiscord | <KimJongUnstoppable> Does anyone know if there's a way to specify a specific virtual offset when loading a DLL with loadLib and/or trying to call the process with symAddr? |
23:57:11 | FromDiscord | <Elegantbeef> @KimJongUnstoppable\: is the offset just offset from the symaddr pointer? |