00:44:39 | * | SamuelMarks quit (Ping timeout: 256 seconds) |
01:10:10 | * | SamuelMarks joined #nim |
01:15:05 | * | SamuelMarks quit (Ping timeout: 248 seconds) |
01:24:32 | FromDiscord | <Alea> possibly stupid question, but would int stringification or using an int to access a table of strings be faster? |
01:27:04 | FromDiscord | <Elegantbeef> the latter is faster |
01:27:30 | FromDiscord | <Elegantbeef> Depending on the range an array is even faster |
01:29:42 | FromDiscord | <Elegantbeef> A `Hash` is afterall just an `int` |
01:30:24 | FromDiscord | <Alea> touché, array is the way to go |
01:31:55 | FromDiscord | <Elegantbeef> Not to say that it's a straight operation, the integer is still hashed, but it's a relatively cheap operation to hashing a string |
01:33:30 | * | yoyojambo joined #nim |
01:37:40 | * | SamuelMarks joined #nim |
01:42:26 | * | SamuelMarks quit (Ping timeout: 246 seconds) |
01:46:47 | FromDiscord | <Rika> An int hash is the int itself, there is no transformation I believe |
01:54:26 | * | SamuelMarks joined #nim |
01:59:21 | * | SamuelMarks quit (Ping timeout: 248 seconds) |
02:07:55 | * | arkurious quit (Quit: Leaving) |
02:19:17 | FromDiscord | <demotomohiro> !eval import hashes; echo hash(123) |
02:19:20 | NimBot | -639173177476267748 |
02:29:01 | FromDiscord | <Rika> Might have been changed from what I remember recently |
02:29:10 | FromDiscord | <Rika> When I read the code there was no transformation |
02:32:48 | FromDiscord | <xflywind> There is a `-d:nimIntHash1` option to keep backward compatibility. |
02:34:31 | * | zeus-supreme joined #nim |
02:37:42 | * | zeus-supreme1 quit (Read error: Connection reset by peer) |
02:59:33 | FromDiscord | <demotomohiro> If I remember correctly, using int keys without hashing it cause many collision if lower half bits of input ints were same. |
03:02:49 | FromDiscord | <Rika> Huh why so |
03:13:35 | FromDiscord | <demotomohiro> Putting date in table is like internalSeq[hash(key) & (internalSeq.len - 1)] = data (internalSeq.len is power of 2). |
03:33:45 | * | rockcavera quit (Remote host closed the connection) |
03:41:32 | termer | is there any way to disable staticExec in the nim compiler? |
03:41:45 | termer | it bothers me a lot that any library can run any command on my computer during compilation |
03:45:58 | FromDiscord | <Rika> Not as of now I don’t think, chroot jail if you’re paranoid |
03:46:20 | FromDiscord | <Elegantbeef> i think you can disable vmops with a flag |
03:47:00 | termer | I don't think I should have to setup a chroot jail to compile software but I suppose that's the state of nim |
03:47:23 | termer | ElegantBeef where would that be documented? |
03:47:57 | yoyojambo | I think it is in the compiler user guide |
03:48:32 | yoyojambo | https://nim-lang.org/docs/nimc.html |
03:49:26 | termer | thanks |
03:49:52 | FromDiscord | <Elegantbeef> It seems there is no way of doing it to the compiler's VM presently |
03:50:05 | termer | that's worrying |
03:50:23 | FromDiscord | <Elegantbeef> Eh araq isnt opposed to it, just hasnt done it |
03:50:29 | FromDiscord | <Elegantbeef> It's hardly an issue, imo |
03:50:37 | FromDiscord | <Elegantbeef> After you compile code, you generally want to run it |
03:50:40 | termer | it's not an issue when you trust every library you use |
03:51:14 | FromDiscord | <Elegantbeef> Sure except you generally run code after compiling |
03:51:23 | yoyojambo | if you don't trust it, why use it in your code? |
03:51:48 | termer | execution during runtime and development are 2 different things |
03:52:01 | termer | for example, I might build something in a different environment than when it's run |
03:52:13 | FromDiscord | <Rika> If you don’t trust it to be safe during compilation why do you trust it to be safe during run time |
03:52:37 | FromDiscord | <Elegantbeef> I mean the argument is "I have untrustworthy code that is evaluated at compile time and runtime" |
03:52:43 | FromDiscord | <Elegantbeef> I mean i dont disagree that it should be able to |
03:52:52 | FromDiscord | <Rika> Me neither, it’s just not there yet |
03:53:00 | termer | development on your own machine is a big reason why |
03:53:06 | termer | you may only be compiling something |
03:53:25 | termer | or if you're wanting to cross compile something for a device you view as more secure than your compilation environment |
03:53:27 | FromDiscord | <Elegantbeef> And then whatever you pass the binary to is going to trust the malicious code |
03:53:37 | FromDiscord | <Rika> Then what, throw the binary away? If something nukes a computer during development I’m sure as hell not deploying that binary |
03:53:39 | termer | right but here's a real world example |
03:53:49 | termer | I have a virtual server that's very locked down |
03:54:03 | termer | if it had malware on it, there wouldn't be much it could do |
03:54:14 | termer | but I've compiled software on a build server to place into that server |
03:54:54 | yoyojambo | that sounds very hypothetical |
03:55:12 | termer | it's not hypothetical cause I've done it |
03:55:13 | yoyojambo | but I guess the feature wouldn't hurt |
03:55:23 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/pull/16943#ref-issue-932085919 |
03:55:28 | FromDiscord | <Elegantbeef> Bump that i guess |
03:56:31 | FromDiscord | <Rika> It would be nice to have yes |
03:56:53 | termer | people just don't usually expect that ability for source code to run arbitrary commands at compile time |
03:57:27 | termer | and for the people who are aware of it and want to close another possible vector for attack, it would be helpful |
03:57:55 | FromDiscord | <Elegantbeef> We all said it should exist, so yes |
03:59:02 | FromDiscord | <Rika> https://forum.nim-lang.org/t/5315 |
04:00:31 | termer | reading right npw |
04:00:32 | termer | now |
04:02:23 | Amun-Ra | Elegantbeef: I finally made a short test case, https://github.com/nim-lang/Nim/issues/19698 |
04:06:13 | FromDiscord | <Elegantbeef> Ah interesting bug |
04:11:56 | * | slowButPresent quit (Quit: leaving) |
04:15:41 | FromDiscord | <Elegantbeef> Seems it generates some runtime code for the static code, but it results in C attempting to access `T7_` |
04:22:14 | Amun-Ra | T7_, T14_, T21_ etc. |
04:22:39 | FromDiscord | <Elegantbeef> Yea it doesnt make much sense why it does |
04:45:31 | * | yoyojambo quit (Ping timeout: 260 seconds) |
05:29:21 | * | Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] – I don't check my email often since it's full of crap, but in any case, [email protected]) |
05:34:29 | * | SamuelMarks joined #nim |
05:39:17 | * | SamuelMarks quit (Ping timeout: 272 seconds) |
05:49:18 | * | kayabaNerve joined #nim |
05:53:46 | * | wyrd quit (Quit: leaving) |
05:54:05 | * | wyrd joined #nim |
05:58:49 | * | kayabaNerve quit (Ping timeout: 248 seconds) |
06:27:13 | FromDiscord | <Elegantbeef> @Girvo\: hey if you're about wanna help me with the cmake stuff? 😄 |
06:47:44 | FromDiscord | <Elegantbeef> Well if anyone has any clue how with CMake to link library names stored in another file and wants to tell me, that'd be great |
06:52:52 | FromDiscord | <demotomohiro> I used CMake long time ago. CMake has some command that run other CMake files in subdirectly. |
06:56:23 | * | ltriant quit (Ping timeout: 246 seconds) |
06:59:58 | FromDiscord | <Elegantbeef> Ah i think i'm cheesing it with a cmake function, but it works so alas i'm happy |
07:01:47 | FromDiscord | <demotomohiro> Here is my old CMAKE sample code to build a library and use it. https://github.com/demotomohiro/testCMakePackage |
07:02:35 | FromDiscord | <demotomohiro> add_subdirectory command loads CMake fild in subdirectly. |
07:02:57 | FromDiscord | <Elegantbeef> This is just for the rpi pico library for auto linking libraries |
07:03:06 | FromDiscord | <Elegantbeef> So it's mostly just me injecting my code there |
07:11:28 | FromDiscord | <Valdar> So, I'm assuming that if I compare 2 strings via `if someString == someOtherString:` it will compare lengths first to return a quick false: That sound right? |
07:11:40 | FromDiscord | <Elegantbeef> Yes |
07:12:19 | FromDiscord | <Valdar> Thx, I just didn't want to explicitly compare and have stupid looking code 🙂 |
07:23:52 | * | ltriant joined #nim |
07:47:18 | Amun-Ra | Elegantbeef: hmm, read file contents and store it in a variable: file(READ filaneme variable) |
07:50:30 | FromDiscord | <mratsim> @termer @Rika @ElegantBeef , I agree with termer, staticExec is both very nice and a security hole.↵↵We've had long and heated discussions about this 3 years ago, see IRC logs linked at: https://github.com/nim-lang/Nim/issues/12125 |
07:57:14 | FromDiscord | <Rika> I didn’t say I disagree |
07:57:19 | FromDiscord | <Rika> It should be part |
08:00:38 | FromDiscord | <Elegantbeef> Yea no one said it shouldnt be, it's more just a case of whether it's an overly concerning way of running malicious code |
08:12:23 | FromDiscord | <demotomohiro> Even if you disable staticExec, malicious code can be placed in procedures in the library. |
08:14:06 | FromDiscord | <Rika> Their argument is that the runner is well armoured but their builder is not |
08:14:11 | FromDiscord | <Rika> Which imo is a design flaw |
08:15:05 | FromDiscord | <demotomohiro> I see |
08:17:58 | FromDiscord | <Solitude> you still have file system access from nimscript and can do all the damage staticExec does without it |
08:18:14 | FromDiscord | <Solitude> almost all |
08:26:53 | FromDiscord | <demotomohiro> Maybe `staticRead` reads some secret file and send it to somewhere via internet at runtime. |
08:28:05 | * | PMunch joined #nim |
09:04:44 | * | zeus-supreme1 joined #nim |
09:07:00 | FromDiscord | <planetis> What does '`Error: [] must have some form of array type` mean? And how do I fix this\: https://play.nim-lang.org/#ix=3UB8 |
09:07:37 | * | zeus-supreme quit (Ping timeout: 248 seconds) |
09:07:43 | FromDiscord | <Elegantbeef> Well you cannot take an address of consts |
09:08:36 | * | koltrast quit (Quit: ZNC - http://znc.in) |
09:10:35 | FromDiscord | <Elegantbeef> May want to do https://play.nim-lang.org/#ix=3UBa |
09:10:39 | FromDiscord | <Elegantbeef> I dont know really though |
09:11:09 | FromDiscord | <planetis> cool thanks ElegantBeef |
09:11:37 | FromDiscord | <planetis> it's very similar to what I am trying to rewrite https://github.com/raysan5/raylib/blob/master/examples/others/embedded_files_loading.c#L51 |
09:11:54 | FromDiscord | <planetis> but I guess that would try to free static memory |
09:12:06 | FromDiscord | <planetis> so I don't think I can port this |
09:12:40 | FromDiscord | <Elegantbeef> There is no point in nim |
09:13:08 | FromDiscord | <Elegantbeef> We can just use static load and dont need the same api |
09:13:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3UBd |
09:14:16 | FromDiscord | <planetis> right that's easier anyway |
09:14:59 | FromDiscord | <Elegantbeef> Yea their image data is static anyway so you could use the codegen if you really wanted to |
09:16:00 | PMunch | Hmm, this reminds me of loading sprites onto the Arduboy on compile-time :P |
09:17:17 | * | koltrast joined #nim |
09:23:23 | * | lumo_e joined #nim |
09:56:40 | FromDiscord | <bryankrn> are pragmas commonly used |
09:58:00 | FromDiscord | <Rika> Yes, why do you ask |
09:59:06 | FromDiscord | <bryankrn> because im learning nim and theres like 200 pragmas in these sections combined and i dont wanna go over them https://media.discordapp.net/attachments/371759389889003532/961928160390299678/unknown.png |
10:02:09 | FromDiscord | <Rika> You don’t have to go over all of them |
10:09:16 | * | ozzz joined #nim |
10:10:09 | * | ozzz is now known as om3ga |
10:10:25 | FromDiscord | <exelotl> there are a bunch of useful ones but it really depends what you're doing (which, come to think of it, is exactly why they're pragmas) |
10:10:46 | FromDiscord | <Phil> In reply to @bryankrn "because im learning nim": Pragmas are a "look at them when you have a need"↵One I'd generally recommend keeping in mind is the compileTime pragma |
10:11:45 | FromDiscord | <Phil> (edit) "need"↵One" => "need" kind of thing↵One" |
10:12:03 | PMunch | @bryankrn, in general you don't have to think about pragmas. But if you ever feel like you're in a corner case and want to nudge Nim in some other direction then a pragma is probably what you want. The exception is the async pragma which you're going to use whenever you use async |
10:12:29 | FromDiscord | <Solitude> or ffi |
10:12:58 | PMunch | I was considering that an edge case, in a perfect world someone else has already written a wrapper for you so you don't have to think about it |
10:13:10 | PMunch | (or you use Futhark and don't have to think about it regardless) |
10:14:18 | FromDiscord | <exelotl> In reply to @Isofruit "Pragmas are a "look": hmm I'm not so sure about that, you're best off using https://nim-lang.github.io/Nim/macrocache.html so that your code works with IC when that arrives |
10:14:26 | FromDiscord | <exelotl> unless it's a `compileTime` variable that _cannot_ be influenced by anyone who's calling into your module |
10:14:55 | FromDiscord | <Rika> Macro cache is relatively new so most of us aren’t very familiar with it yet |
10:14:59 | * | jmdaemon quit (Ping timeout: 260 seconds) |
10:15:48 | FromDiscord | <Phil> In reply to @exelotl "hmm I'm not so": I use that thing for compile-time checks on my own code for the most part |
10:15:48 | FromDiscord | <Solitude> In reply to @exelotl "unless it's a `compileTime`": he probably means compiletime on procs |
10:15:55 | FromDiscord | <exelotl> ohhh |
10:15:56 | FromDiscord | <Phil> Mostly to drive beef mad |
10:16:08 | FromDiscord | <exelotl> yeah compileTime on procs is good |
10:16:16 | FromDiscord | <Phil> That's a lie, I find writing compile time procs easier than writing concepts |
10:16:28 | FromDiscord | <Phil> (edit) "lie," => "lie (me wanting to make beef mad9," |
10:16:34 | FromDiscord | <Phil> (edit) "mad9," => "mad)," |
10:17:01 | FromDiscord | <Solitude> yeah, we already heard that you're a weird fella |
10:17:11 | FromDiscord | <bryankrn> would be strangely cool if there was a nim to brainfuck transpiler |
10:17:15 | FromDiscord | <Rika> Especially after that Java-esque fiasco |
10:17:18 | FromDiscord | <Phil> You're just biased against your code screaming at you, your opinion is invalid |
10:17:56 | FromDiscord | <Rika> In reply to @bryankrn "would be strangely cool": You’re gonna have a bit of difficulty |
10:19:02 | FromDiscord | <exelotl> In reply to @Rika "Macro cache is relatively": yeah, I was totally confused, until yardanico added examples to the docs x) |
10:21:23 | FromDiscord | <Rika> It’s basically just a table though |
10:27:39 | FromDiscord | <Phil> I guess that's very useful when you calculate something at compile time that you would otherwise be recalculating over and over again? |
10:28:07 | FromDiscord | <Phil> Feels like the kind of feature that becomes useful at somewhat large-scale projects |
10:28:58 | FromDiscord | <Rika> It’s also useful for “compile time plugins” like I don’t know registering a command or so |
10:29:23 | FromDiscord | <Rika> Since it’s a “setting values propagates immediately to all readers” kinda thing |
10:29:27 | * | gsalazar joined #nim |
10:53:24 | * | Guest67 joined #nim |
10:53:32 | * | Guest67 quit (Client Quit) |
10:53:54 | FromDiscord | <Phil> Hmm what's the type of thing you'd throw into a compile-time plugin? |
11:16:15 | * | xet7 quit (Remote host closed the connection) |
11:19:22 | * | xet7 joined #nim |
11:56:47 | * | gsalazar quit (Ping timeout: 260 seconds) |
11:59:45 | FromDiscord | <mratsim> In reply to @Isofruit "Hmm what's the type": a domain specific language for example |
12:08:56 | * | gsalazar joined #nim |
12:09:26 | * | slowButPresent joined #nim |
12:14:30 | FromDiscord | <Phil> Ohhhh yeah that's pretty valid# |
12:14:54 | FromDiscord | <Phil> I'm fairly sure you could do my entire generic repository nonsense in a domain specific language and throw that in as a plugin for e.g. prologue |
12:16:06 | FromDiscord | <Phil> Though it'd have to be significantly simpler... hmm... might not make sense as its own language but more as still a set of helper procs or sth |
12:16:22 | FromDiscord | <Phil> I'll eventually have to get around to make a package and have a good long hard think on all of this |
12:18:18 | FromDiscord | <exelotl> I have a vtable macro that I use as a lightweight replacement for Nim methods. It uses a `CacheSeq` to record all the vtables that got defined over the course of the program, then when a finalize macro is called at the end of the main module it goes and generates a pointer for each one (mainly to allow you to check which vtable a particular object instance is using) |
12:19:38 | * | gsalazar quit (Ping timeout: 268 seconds) |
12:37:16 | * | v9fk joined #nim |
12:51:33 | * | rockcavera joined #nim |
12:51:33 | * | rockcavera quit (Changing host) |
12:51:33 | * | rockcavera joined #nim |
13:04:21 | * | arkurious joined #nim |
13:14:32 | FromDiscord | <mratsim> In reply to @exelotl "I have a vtable": Did someone ever collect all the VTables impl in Nim "Awesome VTables in Nim" :p |
13:39:09 | FromDiscord | <exelotl> haha |
13:42:40 | * | gsalazar joined #nim |
13:44:56 | NimEventer | New thread by Krakengore: Possible workarounds for subclassing a c++ class and overriding a virtual method, see https://forum.nim-lang.org/t/9089 |
14:03:22 | * | PMunch quit (Quit: Leaving) |
14:10:27 | FromDiscord | <hmmm> broskis I kinda want to add a check for updates button on my app, I think I must use some api for the github releases page? hmm how do I do eet? |
14:10:57 | FromDiscord | <hmmm> I think I need to use puppy to do the fetching but I don't know where to fetch |
14:20:09 | * | hellstabber joined #nim |
14:21:10 | * | SamuelMarks joined #nim |
14:30:17 | * | SamuelMarks quit (Ping timeout: 256 seconds) |
14:36:02 | FromDiscord | <Solitude> read github docs |
14:38:10 | * | SamuelMarks joined #nim |
14:39:40 | FromDiscord | <hmmm> found it! it was GET /repos/:owner/:repo/releases |
14:40:55 | FromDiscord | <hmmm> dear, @treeform puppy is awesome ty very much 😃 |
15:04:36 | * | lumidify quit (Ping timeout: 240 seconds) |
15:10:31 | * | SamuelMarks quit (Ping timeout: 256 seconds) |
15:27:21 | FromDiscord | <kulumani> hi i am learning nim. and i have a problem. I installed vscode plugin but auto indent doesn't work. is there a way to achieve this? |
15:27:31 | FromDiscord | <kulumani> https://media.discordapp.net/attachments/371759389889003532/962010812648661042/indent.mov |
15:28:09 | FromDiscord | <aph> I'm using saem's extension, idk if it makes a difference |
15:28:14 | FromDiscord | <aph> ¯\\_(ツ)\_/¯ |
15:28:36 | FromDiscord | <aph> (edit) "extension," => "extension (the second one from marketplace)," |
15:28:43 | * | LuxuryMode joined #nim |
15:29:11 | FromDiscord | <huantian> It does work for me, do try saem’s version of the extension if you aren’t using it |
15:30:45 | FromDiscord | <kulumani> wow thanks it works |
15:31:27 | FromDiscord | <kulumani> why there are two extension |
15:31:38 | * | Gustavo6046 joined #nim |
15:31:51 | FromDiscord | <kulumani> an unpleasant start |
15:32:07 | FromDiscord | <huantian> The old one is no longer maintained by the original creator |
15:32:19 | FromDiscord | <huantian> So a fork was created |
15:32:38 | FromDiscord | <huantian> I don’t think we can really remove the old one from vscode store |
15:34:06 | FromDiscord | <huantian> Wonder if we could somehow |
15:34:14 | * | zeus-supreme joined #nim |
15:34:21 | FromDiscord | <kulumani> but it seems to be in the first place and more popular. bad experience for newcomers. |
15:35:04 | FromDiscord | <kulumani> The community needs to take this seriously. |
15:35:41 | FromDiscord | <Generic> the official links are to my knowledge already updated |
15:35:52 | FromDiscord | <Generic> just the ranking in the extension market place is done by ms |
15:35:55 | FromDiscord | <xflywind> The newer one is written in Nim. And the first one works for me. |
15:36:25 | FromDiscord | <kulumani> https://media.discordapp.net/attachments/371759389889003532/962013049164791858/Ekran_Resmi_2022-04-08_18.36.18.png |
15:36:26 | FromDiscord | <Generic> yeah the auto indent after a : should have already worked with the old extension |
15:36:51 | FromDiscord | <kulumani> first one auto indent and intellisense doesn't work for me |
15:37:13 | FromDiscord | <Phil> I am chaotic neutral |
15:37:17 | FromDiscord | <Phil> I have both installed on vscodium |
15:37:17 | * | zeus-supreme1 quit (Read error: Connection reset by peer) |
15:37:43 | FromDiscord | <Rika> In reply to @kulumani "The community needs to": how would we fix this? |
15:37:44 | FromDiscord | <Phil> intellisense will always be a tough one @kulumani , it'll work to a degree but be slow as all hell very often |
15:37:49 | FromDiscord | <hmmm> I'm lawful good and that's why I'm on sublime text 🤔 |
15:38:05 | FromDiscord | <huantian> In reply to @Rika "how would we fix": We can go yell at MS a bit that seems fun |
15:38:10 | FromDiscord | <Solitude> In reply to @hmmm "I'm lawful good and": did you pay for it? |
15:38:57 | FromDiscord | <hmmm> hmmmm I kinda found a code lying around |
15:39:14 | FromDiscord | <Solitude> In reply to @hmmm "hmmmm I kinda found": and you call yourself lawful? |
15:39:25 | FromDiscord | <hmmm> as soon as I get rich I pay 4 two I swear 😅 |
15:39:33 | FromDiscord | <Phil> true neutral I say |
15:41:33 | * | lumidify joined #nim |
15:43:30 | FromDiscord | <huantian> What’s neutral evil, Visual Studio? |
15:45:53 | FromDiscord | <kulumani> Sublime Text LSP support is not at a good level. so i am using vscode. |
15:46:18 | FromDiscord | <K.io.S> I was reading the discussion earlier today, does the vm currently default to running sandboxed?↵There are two links posted earlier that deal with this. |
15:53:58 | FromDiscord | <hmmm> In reply to @kulumani "Sublime Text LSP support": well at least auto ident works on sublime text 😄 |
15:55:01 | FromDiscord | <Rika> In reply to @Atlas "I was reading the": there is no sandboxing as of now |
15:56:11 | FromDiscord | <Phil> In reply to @huantian "What’s neutral evil, Visual": neutral evil is gedit |
15:58:08 | FromDiscord | <Rika> chaotic evil is ed |
15:58:37 | FromDiscord | <Phil> Sidenote, if there's one thing I'm mildly annoyed by it's that proc-aliases are shown in their alias and not back-resolved into the actual signature you'd want.↵So like: |
15:59:35 | FromDiscord | <Phil> sent a long message, see http://ix.io/3UCZ |
16:01:18 | FromDiscord | <Phil> Though I'd also love if it could show me which one of the procs is mismatching, for these cases it doesn't tell me sadly |
16:02:08 | FromDiscord | <Phil> (edit) "me" => "me," | "me,sadly ... " added "enough" |
16:15:24 | * | gsalazar quit (Ping timeout: 240 seconds) |
16:17:52 | * | vicecea quit (Remote host closed the connection) |
16:18:22 | * | vicecea joined #nim |
16:30:58 | FromDiscord | <treeform> In reply to @hmmm "dear, <@107140179025735680> puppy is": you welcome |
16:37:55 | FromDiscord | <jmgomez> hey guys, cant you switch the backend via config.nims with a switch? |
16:41:27 | FromDiscord | <treeform> I don't think so, but you can use -d:js to trick your IDE into thinking its JS mode. But it does not force js mode by itself. |
16:41:58 | FromDiscord | <jmgomez> ouch |
16:42:13 | FromDiscord | <jmgomez> okay, what about the default nimble test? I want it to run in cpp |
16:43:00 | FromDiscord | <treeform> that is not possible, to work around this we put all of our tests in one file, usually tests/all.nim and run nim cpp on that. |
16:43:20 | FromDiscord | <treeform> See here: https://github.com/treeform/pixie/blob/master/.github/workflows/build.yml#L21 |
16:43:31 | FromDiscord | <jmgomez> umm, can you do something like include test..nim from another file and call that? |
16:43:46 | FromDiscord | <treeform> I don't think so. |
16:44:01 | FromDiscord | <treeform> this is what we do: https://github.com/treeform/pixie/blob/master/tests/all.nim |
16:44:16 | FromDiscord | <jmgomez> ahh well, that isnt too bad |
16:44:21 | FromDiscord | <jmgomez> thanks! |
16:44:31 | FromDiscord | <treeform> its the best we came up with at the moment |
16:44:41 | FromDiscord | <treeform> if you find a better solution please let us know |
16:45:04 | FromDiscord | <jmgomez> okay, I dont think so since I started doing nim a two days ago lol |
16:45:06 | FromDiscord | <treeform> maybe we should make a morenimble tool that does nimble + cpp/js |
16:45:21 | FromDiscord | <jmgomez> (edit) removed "a" |
16:45:37 | FromDiscord | <treeform> In reply to @jmgomez "okay, I dont think": Cool! |
16:46:27 | FromDiscord | <xflywind> In reply to @treeform "I don't think so,": you can probably define "--b:js" to enfore js |
16:46:35 | FromDiscord | <xflywind> (edit) "enfore" => "enforce" |
16:46:39 | FromDiscord | <treeform> what is --b? |
16:46:52 | FromDiscord | <treeform> to nimble or in the .nims file? |
16:46:59 | FromDiscord | <xflywind> in .nims file |
16:47:19 | FromDiscord | <xflywind> It is an abbreviation for backend |
16:47:40 | FromDiscord | <treeform> oh interesting |
16:47:51 | FromDiscord | <treeform> does nimble support --b? |
16:48:42 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/u8X |
16:49:59 | FromDiscord | <treeform> I tried `--b:js`in .nims file ... does not work |
16:50:16 | FromDiscord | <treeform> is there an approrate nim compile command that does not mean c backend? |
16:50:37 | FromDiscord | <treeform> `nim c -b:js .\src\biggy.nim` this works |
16:50:48 | FromDiscord | <treeform> `nim c .\src\biggy.nim` does not |
16:50:51 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3UD7 |
16:51:15 | FromDiscord | <treeform> oh `switch("backend", "js")` does work for me |
16:51:43 | FromDiscord | <treeform> `nim c .\src\biggy.nim` -> `out: C:\p\biggy\src\biggy.js` thanks! |
16:52:07 | FromDiscord | <xflywind> It is ususually combined with tun option: `nim r --b:js" |
16:52:23 | FromDiscord | <treeform> Everyone @xflywind is really cool! |
16:55:01 | FromDiscord | <jmgomez> In reply to @flywind "switch("backend", "cpp")": I had it like that before and didnt work :/ (at least for test) |
16:55:50 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3UD8 |
16:57:55 | FromDiscord | <xflywind> In reply to @treeform "Everyone @xflywind is really": It all thanks to @timotheecour's hard work => https://github.com/nim-lang/Nim/pull/14278 |
17:00:30 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3UDa |
17:07:23 | * | xet7 quit (Remote host closed the connection) |
17:10:43 | * | xet7 joined #nim |
17:16:58 | * | pro joined #nim |
17:24:28 | * | pro quit (Quit: pro) |
17:50:22 | FromDiscord | <eyecon> It's me with a possible compiler bug again |
17:50:44 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3UDo |
17:51:10 | FromDiscord | <eyecon> Am I going crazy or is the exact same expression doesn't work when wrapped in a proc? |
17:51:32 | FromDiscord | <eyecon> (edit) "is" => "does" |
17:51:41 | FromDiscord | <eyecon> (edit) "doesn't" => "not" |
17:51:52 | * | hellstabber quit (Quit: Textual IRC Client: www.textualapp.com) |
17:56:34 | FromDiscord | <jmgomez> When importing headers, the compiler seems to be evaluating macros. Is there a way to initialize them from nim? |
17:56:50 | FromDiscord | <jmgomez> (edit) "When importing headers, the compiler seems to be evaluating ... macros." added "cpp" |
18:00:42 | FromDiscord | <kulumani> https://nimble.directory/pkg/gifenc |
18:00:56 | FromDiscord | <kulumani> wtf |
18:01:08 | FromDiscord | <kulumani> this is c language repo |
18:04:23 | FromDiscord | <Phil> In reply to @eyecon "Look at this code": itertools are a module of your own? |
18:09:33 | FromDiscord | <eyecon> In reply to @Isofruit "itertools are a module": No, it's https://github.com/narimiran/itertools |
18:11:11 | FromDiscord | <kulumani> SIGBUS: Illegal storage access. |
18:14:00 | FromDiscord | <Phil> In reply to @eyecon "No, it's https://github.com/narimiran/itertools": Check, well from what it looks like it really doesn't like the itertools being used in procs like this, strangely enough |
18:14:23 | FromDiscord | <eyecon> In reply to @Isofruit "Check, well from what": Thank you! So it's not just me |
18:15:39 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3UDy |
18:16:44 | FromDiscord | <eyecon> When you say "given the line before", do you mean the one before `while`? |
18:17:08 | FromDiscord | <Solitude> you should reduce the snippet so it doesnt import itertools and submit a bugreport |
18:17:36 | FromDiscord | <eyecon> In reply to @Solitude "you should reduce the": Sure, I can, I just wanted to make sure I'm not doing something stupid |
18:17:50 | FromDiscord | <Phil> Try to play around whether you can trigger this behaviour without itertools |
18:18:17 | FromDiscord | <Phil> Gut feeling says it's something fancy done in the itertools that's the issue but I'm barely beyond a novice in the language anyway |
18:18:25 | FromDiscord | <Solitude> if itertools doesnt use emit, error from c compiler is nims fault |
18:18:39 | FromDiscord | <eyecon> In reply to @Solitude "if itertools doesnt use": It doesn't, from what I can see |
18:18:58 | FromDiscord | <eyecon> Imma go simplify the snippet |
18:19:43 | NimEventer | New thread by Jmgomez: Defining C++ Macros from Nim, see https://forum.nim-lang.org/t/9091 |
18:20:29 | FromDiscord | <kulumani> https://github.com/rxi/gifwriter |
18:21:13 | FromDiscord | <kulumani> sent a code paste, see https://paste.rs/PYn |
18:21:33 | * | pro joined #nim |
18:21:52 | FromDiscord | <kulumani> /Users/has/.nimble/pkgs/gifwriter-0.1.0/gifwriter.nim(58) newGif↵SIGBUS: Illegal storage access. (Attempt to read from nil?)↵Error: execution of an external program failed: '/Users/haz/Desktop/merhaba-nim/main '↵[Finished in 0.2s with exit code 1] |
18:22:10 | FromDiscord | <kulumani> what is this? |
18:22:35 | FromDiscord | <kulumani> (edit) "'/Users/haz/Desktop/merhaba-nim/main" => "'/Users/has/Desktop/merhaba-nim/main" |
18:28:30 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
18:36:26 | FromDiscord | <Solitude> its a broken library |
18:41:00 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3UDF |
18:44:12 | FromDiscord | <hmmm> I remember using itertools for something, I'll go check if it still compiles 🤔 |
18:46:21 | FromDiscord | <hmmm> yep works, or at least combinations works 😄 |
18:51:20 | FromDiscord | <luteva> Hi! Is there a nim wrapper for arangoDB?↵https://github.com/arangodb/arangodb |
19:05:49 | FromDiscord | <ITR> Why can't I use ..< when defining a type? |
19:15:47 | FromDiscord | <eyecon> The iterators themselves do not seem to play a role, just the fact that they are iterators |
19:16:05 | FromDiscord | <eyecon> Is it maybe `toSeq` that is emitting anti-proc magic? |
19:18:05 | FromDiscord | <Solitude> In reply to @eyecon "The iterators themselves do": if you change openArray to seq - it works |
19:18:15 | FromDiscord | <ITR> hmm |
19:18:35 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3UDR |
19:19:36 | FromDiscord | <eyecon> In reply to @Solitude "if you change openArray": Wut... |
19:20:07 | * | pro quit (Quit: pro) |
19:20:16 | FromDiscord | <eyecon> So it does |
19:20:23 | FromDiscord | <eyecon> Curioser and curioser |
19:20:43 | FromDiscord | <eyecon> It is not even the return type |
19:28:21 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3UDS |
19:29:24 | FromDiscord | <Rika> what if you use `proc(a: int): int = a` instead of sugar's => |
19:29:36 | FromDiscord | <Solitude> it still breaks |
19:30:50 | FromDiscord | <Solitude> you broke the hecking gensym facilities |
19:31:35 | FromDiscord | <eyecon> 😄 |
19:32:02 | FromDiscord | <Solitude> this looks like it could break at any moment https://media.discordapp.net/attachments/371759389889003532/962072344552165406/unknown.png |
19:34:13 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Solitude "this looks like it": Oh nice theme |
19:42:53 | * | vicfred joined #nim |
19:43:05 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3UDX |
19:43:21 | FromDiscord | <eyecon> Should I file a bug or does anyone have an idea what more I can try? |
19:43:26 | * | vicfred quit (Remote host closed the connection) |
19:43:31 | FromDiscord | <Solitude> file a bug |
19:43:53 | FromDiscord | <Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3UDY |
19:44:16 | FromDiscord | <Solitude> i can change inner iterator to seq and it will still break |
19:44:25 | FromDiscord | <Solitude> but pairwise needs to be openArray to not work |
19:45:01 | * | vicfred joined #nim |
19:46:02 | FromDiscord | <TryAngle> In reply to @Solitude "this looks like it": What theme u using 😳 |
19:46:02 | FromDiscord | <eyecon> OK, I'm including your code if it is OK for you @Solitude |
19:46:20 | FromDiscord | <Solitude> In reply to @TryAngle "What theme u using": srcery |
19:46:28 | FromDiscord | <TryAngle> ty |
19:47:18 | FromDiscord | <TryAngle> Do you guys also get no code completion and "to source/definition" click not working anymore on VSC? |
19:47:31 | FromDiscord | <Yardanico> works fine for me |
19:47:36 | FromDiscord | <Yardanico> try restarting VSC :) |
19:47:41 | FromDiscord | <Yardanico> because that'll restart nimsuggest |
19:47:47 | FromDiscord | <Yardanico> or maybe nimsuggest breaks because of some code in your project |
19:48:00 | FromDiscord | <TryAngle> I'm having this problem for a while now |
19:48:06 | FromDiscord | <TryAngle> I'm using nimsaem |
19:48:33 | FromDiscord | <Yardanico> well everyone's using it nowadays basically |
19:48:33 | FromDiscord | <TryAngle> Maybe it's a WSL issue 🤔 gonna test it on my new Linux setup later today |
19:49:17 | FromDiscord | <Yardanico> In reply to @TryAngle "Maybe it's a WSL": works for me with both WSL/native Windows/native Linux |
19:49:24 | FromDiscord | <Yardanico> (edit) "both" => "all of" |
19:50:09 | FromDiscord | <TryAngle> Right now I'm basically sitting with 2 vscs open and cloned all the repos of packages I work with search with VSC workspace search lmao |
19:51:48 | FromDiscord | <Ayy Lmao> Is using Nim on top of a large c++ framework a silly thing to do? I'm wondering if there are success stories. I'm interested in making audio plugins and something like this seems good https://github.com/iPlug2/iPlug2 |
19:52:09 | FromDiscord | <Generic> it depends on a bunch of things |
19:52:35 | FromDiscord | <Generic> like how depedent is it on templaty stuff |
19:53:05 | FromDiscord | <Generic> and stuff like where you would need to inherit stuff |
19:53:30 | FromDiscord | <Generic> it's the easiest if it's mostly just plain classes you instance and invoke methods of |
19:53:42 | FromDiscord | <eyecon> @Solitude including your example code in the bug report is OK, right? |
19:54:00 | FromDiscord | <eyecon> Also the reference to the discussion here |
19:56:34 | FromDiscord | <Ayy Lmao> In reply to @Generic "and stuff like where": Yeah I haven't found a lot of good examples of c++ interop. I don't really know how to interop with classes that inherit stuff other than doing hacky emit pragma stuff. |
19:58:26 | FromDiscord | <Ayy Lmao> There's a relatively short example here of what user code would look like https://github.com/iPlug2/iPlug2/blob/master/Examples/IPlugEffect/IPlugEffect.cpp |
19:59:42 | FromDiscord | <Generic> I don't think you could get around emit in this case |
19:59:56 | FromDiscord | <Generic> but I think you can hide most of the dirtiness with macros |
20:00:36 | FromDiscord | <Generic> I haven't tried this, though I think you could use https://nim-lang.org/docs/macros.html#signatureHash%2CNimNode |
20:00:45 | FromDiscord | <Generic> to get the mangeled name of Nim procs |
20:01:12 | FromDiscord | <Generic> then you could insert calls to Nim functions in C++ code generated with emit |
20:01:27 | FromDiscord | <Generic> (edit) "generated with" => "strings in" | "strings inemit ... " added "pragmas" |
20:05:34 | FromDiscord | <Ayy Lmao> I suppose something like that could work if I only had to do it to glue the c++ and nim code together. Then there is the problem of building the code, since it seems like you have to build with either visual studio or xcode. Figuring out a good way to build the nim code into the project seems complicated. |
20:08:50 | FromDiscord | <Generic> if it's some kind of plugin, does it need to be a dll in the end? |
20:10:02 | FromDiscord | <Ayy Lmao> In reply to @Generic "if it's some kind": Yeah it ends up being a .dll or other thing depending on the backend you choose. I think standalone apps are possible too but I'm mostly interested in plugins. |
20:10:22 | FromDiscord | <Ayy Lmao> There are unfortunately many different formats of audio plugins in the industry. |
20:11:42 | FromDiscord | <Ayy Lmao> I was able to get it to compile from the command line with `msbuild.exe`, I wonder if it is sustainable to do a nimscript or something to build the nim code and then call that. |
20:17:41 | FromDiscord | <Generic> that really makes things more complicated |
20:17:56 | FromDiscord | <Generic> build systems can be the worst to deal with |
20:27:06 | FromDiscord | <Ayy Lmao> Maybe I'm better off just using VST2.4 in that case and not trying to use a huge c++ framework |
20:30:57 | nrds | <Prestige99> Anyone looking at approving https://github.com/nim-lang/irc/pull/25 ? |
20:49:25 | NimEventer | New post on r/nim by lf_araujo: Nimlsp in Neovim's builtin lsp, see https://reddit.com/r/nim/comments/tzczjq/nimlsp_in_neovims_builtin_lsp/ |
21:00:36 | nrds | <Prestige99> What does that post mean, like go to definition? |
21:06:59 | FromDiscord | <sealmove> @Yardanico what do you suggest for bytes -> asciistring instead? |
21:07:09 | FromDiscord | <Yardanico> not sure what you mean by "asciistring" |
21:07:11 | * | jmdaemon joined #nim |
21:07:17 | FromDiscord | <Yardanico> nim strings don't have an encoding anyway |
21:07:32 | FromDiscord | <Yardanico> so you can just do cast[string](yourseq) |
21:07:36 | FromDiscord | <Yardanico> if it's seq[byte] or seq[char] |
21:08:01 | FromDiscord | <Yardanico> or if you want a copy instead of a view, you can of course do it with a loop or `newString` + `copyMem` |
21:10:03 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=3UEd |
21:10:28 | FromDiscord | <sealmove> so a cast is safe? |
21:10:29 | FromDiscord | <Yardanico> In reply to @รєคɭ๓๏שє "this is what I": well if it's a different encoding then you'll have to encode it of course |
21:10:34 | FromDiscord | <creikey> In reply to @รєคɭ๓๏שє "this is what I": my understanding was that strings are just seq[byte] assumed to be in utf-8? |
21:10:36 | FromDiscord | <Yardanico> but for ascii specifically it's just copying the memory |
21:10:43 | FromDiscord | <Yardanico> In reply to @creikey "my understanding was that": well, not really |
21:10:50 | FromDiscord | <Yardanico> Nim doesn't know about utf-8 |
21:11:01 | FromDiscord | <Yardanico> unicode handling in nim is done with std/unicode and similar |
21:11:04 | FromDiscord | <sealmove> I think I only use it for ascii, let me check |
21:11:17 | FromDiscord | <creikey> In reply to @Yardanico "unicode handling in nim": interesting |
21:11:28 | FromDiscord | <Yardanico> std/strutils is for ASCII only |
21:11:38 | FromDiscord | <creikey> is string just `type string = seq[byte]` or is it more complicated |
21:11:55 | FromDiscord | <Yardanico> In reply to @creikey "is string just `type": if you mean how it's laid out in memory, yes, but of course there are differences |
21:12:00 | FromDiscord | <Yardanico> in implementation/algorithm |
21:12:02 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=3UEe |
21:12:42 | FromDiscord | <Yardanico> In reply to @รєคɭ๓๏שє "well, it's used in": I don't think it's only ascii |
21:12:51 | FromDiscord | <Yardanico> https://github.com/kaitai-io/kaitai_struct/issues/810 |
21:12:56 | FromDiscord | <Yardanico> etc |
21:13:27 | FromDiscord | <Yardanico> so really you can just special-case ASCII instead, if that's the only thing that doesn't work on Window |
21:13:28 | FromDiscord | <Yardanico> (edit) "Window" => "Windows" |
21:14:34 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=3UEf |
21:15:19 | FromDiscord | <sealmove> i wonder if iConv works with this label (`"us-ascii"` instead of `"ascii"`) |
21:24:35 | * | xet7 quit (Remote host closed the connection) |
21:25:01 | * | SamuelMarks joined #nim |
21:25:53 | * | neurocyte8614492 joined #nim |
21:29:21 | * | xet7 joined #nim |
21:33:30 | * | SamuelMarks quit (Ping timeout: 246 seconds) |
21:43:15 | * | wyrd quit (Ping timeout: 240 seconds) |
21:50:10 | * | wyrd joined #nim |
21:52:29 | FromDiscord | <Pixtum> is there any way to use bookends or braces in nim instead of `:` I personally find it hard to read |
21:53:13 | FromDiscord | <Elegantbeef> nope though you can use `()` due to how statement's work |
21:57:40 | * | SamuelMarks joined #nim |
21:59:37 | FromDiscord | <Pixtum> sent a code paste, see https://paste.rs/hz8 |
22:00:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3UEl |
22:00:11 | FromDiscord | <Pixtum> even better! |
22:00:45 | FromDiscord | <Elegantbeef> Though it's generally just a "hey it exists" not many use it, and you're probably best to ween yourself into whitespace |
22:00:58 | FromDiscord | <Elegantbeef> If you dont already setup indention raninbows and indention lines in your editor |
22:03:03 | FromDiscord | <Elegantbeef> Personally i find those make the argument of "Whitespace hard to read" go away |
22:03:51 | * | SamuelMarks quit (Ping timeout: 260 seconds) |
22:04:51 | * | zeus-supreme1 joined #nim |
22:06:54 | * | lumo_e quit (Remote host closed the connection) |
22:07:17 | * | lumo_e joined #nim |
22:07:53 | * | zeus-supreme quit (Ping timeout: 248 seconds) |
22:15:34 | * | SamuelMarks joined #nim |
22:21:08 | FromDiscord | <treeform> people who are good at C, if I have an nim object of 3 c floats - a Vec3... and I just want to slam that into C++ struct btVector3 of 3 c floats, is there a cast in C that I can emit that will just do it? |
22:24:16 | FromDiscord | <Generic> if you need a pointer of btVector3, you can just cast the pointer |
22:24:43 | FromDiscord | <Generic> with a normal C cast or reinterpret_cast if you're fancy |
22:24:55 | FromDiscord | <treeform> I don't need a pointer |
22:25:00 | FromDiscord | <treeform> its stack allocated |
22:25:14 | FromDiscord | <Generic> do you have a Nim definition of the C++ type? |
22:25:15 | FromDiscord | <Elegantbeef> Doesnt a C cast just work there |
22:25:17 | FromDiscord | <Elegantbeef> Or a reinterpretcast |
22:25:33 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=3UEt |
22:25:58 | FromDiscord | <Generic> ah so you don't have a definition of the C++ type in Nim? |
22:25:59 | FromDiscord | <treeform> looking for a better way |
22:26:05 | FromDiscord | <treeform> I don't have the C++ type in nim |
22:26:17 | FromDiscord | <treeform> I don't know how to get it into nim, its a C++ class. |
22:26:27 | FromDiscord | <Generic> you don't need the full type |
22:26:29 | * | kayabaNerve joined #nim |
22:26:35 | FromDiscord | <Generic> just the name basically |
22:26:40 | FromDiscord | <Generic> then you can use a union object |
22:26:55 | FromDiscord | <Elegantbeef> `(myType)(v.arr)` no ? |
22:26:56 | FromDiscord | <treeform> can you show me how? |
22:26:59 | FromDiscord | <treeform> https://github.com/bulletphysics/bullet3/blob/master/src/LinearMath/btVector3.h#L80 |
22:27:40 | FromDiscord | <treeform> to pass the C++ types around I been calling them `distinct pointer` |
22:27:51 | FromDiscord | <Elegantbeef> Guess it might be `(myType)(&v.arr)` |
22:28:02 | FromDiscord | <Generic> yeah that could work too |
22:29:00 | FromDiscord | <Generic> sent a code paste, see https://play.nim-lang.org/#ix=3UEu |
22:29:05 | FromDiscord | <Generic> (edit) |
22:29:50 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=3UEv |
22:29:58 | FromDiscord | <Generic> it should be btVector3 |
22:30:29 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=3UEw |
22:30:36 | FromDiscord | <treeform> is that efficient? |
22:30:40 | FromDiscord | <treeform> its not allocating anything new |
22:30:44 | FromDiscord | <treeform> (edit) "new" => "new?" |
22:30:48 | FromDiscord | <Generic> it's breaks aliasing rules |
22:31:01 | FromDiscord | <Generic> though usually compilers can cope with this pretty well |
22:31:17 | FromDiscord | <Generic> the union thing isn't really that legal either |
22:31:31 | FromDiscord | <Generic> also I'm not sure how Nim and C++ semantics work together with |
22:31:44 | FromDiscord | <Generic> sent a code paste, see https://play.nim-lang.org/#ix= |
22:31:51 | FromDiscord | <treeform> I could not find good docs on wrapping C++ stuff. |
22:31:55 | FromDiscord | <Generic> (edit) |
22:32:01 | FromDiscord | <Generic> bah stupid escaping rules |
22:32:13 | FromDiscord | <Elegantbeef> Isnt that just an elaborate `cat[btvector3](myData`? |
22:32:13 | FromDiscord | <Elegantbeef> `cast[btvector3](myData)` |
22:32:18 | FromDiscord | <Generic> the thing is that in C, v.arr should be already a pointer |
22:32:47 | FromDiscord | <Elegantbeef> It's a C cast |
22:32:50 | FromDiscord | <Elegantbeef> Just like Nim's `cast` |
22:33:02 | FromDiscord | <Generic> no I'm talking about your previous suggestion |
22:33:08 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=3UEz |
22:33:11 | FromDiscord | <Generic> yeah that should be better |
22:33:13 | FromDiscord | <treeform> does not expose the .arr on v (which might change) |
22:33:21 | FromDiscord | <Generic> though I would definitely just try the Nim cast |
22:33:28 | FromDiscord | <Generic> to see what the Nim compiler tries to do |
22:35:04 | * | lumo_e quit (Ping timeout: 268 seconds) |
22:35:45 | FromDiscord | <Elegantbeef> The Nim compiler will do what I did 😄 |
22:36:22 | FromDiscord | <Generic> it sometimes also uses an union |
22:36:40 | FromDiscord | <Generic> like e.g. when taking the raw bits of a float |
22:36:49 | FromDiscord | <Elegantbeef> It's a retinterp cast in C++ or just a C cast in C afaik |
22:38:12 | * | lumo_e joined #nim |
22:39:19 | FromDiscord | <treeform> hmm nim cast does not work `var vv: btVector3 = cast[btVector3](v)` with `btVector3 {.importc.} = object` |
23:01:02 | FromDiscord | <Pixtum> how do I set the output file name with nim? |
23:01:21 | FromDiscord | <Elegantbeef> `--out:binname` |
23:01:25 | FromDiscord | <Pixtum> like `nim foo.nim -o bar` |
23:02:10 | FromDiscord | <Elegantbeef> compiler argumenets come beforre the nim file |
23:02:19 | FromDiscord | <Elegantbeef> Otherwise it assumes you wanted to run and pass CLI arguments |
23:02:38 | FromDiscord | <Pixtum> (edit) "like `nim ... foo.nim" added "c" |
23:07:19 | * | noeontheend joined #nim |
23:07:46 | FromDiscord | <Pixtum> https://media.discordapp.net/attachments/371759389889003532/962126633450483732/unknown.png |
23:08:21 | FromDiscord | <Elegantbeef> `-o:bar` |
23:20:50 | FromDiscord | <Pixtum> how can I silence hints from the nim output? |
23:21:08 | FromDiscord | <Elegantbeef> `--hint:hintName:off` |
23:21:39 | FromDiscord | <exelotl> or `--verbosity:0` if you want to silence everything |
23:22:03 | FromDiscord | <exelotl> well not everything |
23:22:18 | FromDiscord | <exelotl> but it reduces noise |
23:32:25 | * | noeontheend quit (Ping timeout: 268 seconds) |
23:43:44 | * | lumo_e quit (Quit: Quit) |