01:03:58 | * | xet7 quit (Remote host closed the connection) |
04:31:04 | FromDiscord | <DetermiedNim1> Hey guys |
05:09:54 | * | Lord_Nightmare quit (Ping timeout: 252 seconds) |
05:12:05 | * | Lord_Nightmare joined #nim |
05:35:49 | * | acidsys quit (Ping timeout: 260 seconds) |
05:56:54 | * | acidsys joined #nim |
06:37:40 | * | andy-turner joined #nim |
07:09:20 | FromDiscord | <nocturn9x> I also just realized I might not need the object to be a const after all |
07:09:23 | FromDiscord | <nocturn9x> so long as the bytes themselves are |
07:09:24 | FromDiscord | <nocturn9x> hmmm |
07:11:57 | * | jjido joined #nim |
07:39:48 | FromDiscord | <nocturn9x> should `cast[T](string)` work if `string` is the result of dumping an instance of `T` to disk using `writeBuffer`? |
07:49:29 | FromDiscord | <nocturn9x> I've written the object to disk and read it back in via staticRead, but when I `cast` the object is all zero-initialized |
07:51:06 | Amun-Ra | how about cstring? cast[cstring](obj[0].addr) |
07:55:12 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=dzXdvSYl |
07:55:15 | FromDiscord | <nocturn9x> what is going on here exactly? |
07:56:28 | FromDiscord | <nocturn9x> if I use the value of `net` (so `network = net[]` |
07:56:32 | FromDiscord | <nocturn9x> (edit) "net[]`" => "net[]`) all works as expected" |
07:56:35 | FromDiscord | <nocturn9x> what's going on here? |
07:57:29 | FromDiscord | <nocturn9x> I have a `var network: Network;` global variable I need to fill |
07:59:08 | FromDiscord | <nocturn9x> |
07:59:16 | FromDiscord | <nocturn9x> |
07:59:21 | FromDiscord | <nocturn9x> |
08:01:14 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
08:01:36 | FromDiscord | <nocturn9x> got it to work by doing the cast on a separate variable and dereferencing it later |
08:09:37 | * | m5zs7k_ joined #nim |
08:10:49 | * | nils` quit (Ping timeout: 260 seconds) |
08:11:24 | * | m5zs7k quit (Ping timeout: 252 seconds) |
08:14:24 | * | jjido joined #nim |
08:18:07 | * | m5zs7k_ is now known as m5zs7k |
08:19:41 | FromDiscord | <nocturn9x> VM doesn't support casting from array to int16? |
08:19:50 | FromDiscord | <nocturn9x> what _does_ the VM cast support? lol |
08:19:55 | FromDiscord | <nocturn9x> I'm trying to turn 2 bytes into an int16 |
08:20:01 | FromDiscord | <nocturn9x> what's the way to do that at compile time |
08:22:48 | Amun-Ra | func foo(b1, b2: byte): int16 {.compiletime.} = (b1.int16 shl 8) or b2.int16 |
08:25:26 | FromDiscord | <nocturn9x> yeah I did it that way |
08:26:35 | FromDiscord | <nocturn9x> now this won't compile |
08:26:38 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=CcJOaeOT |
08:26:42 | FromDiscord | <nocturn9x> `/home/nocturn9x/.choosenim/toolchains/nim-2.2.4/lib/system/memory.nim(10, 5) Error: cannot 'importc' variable at compile time; c_memcpy` |
08:27:46 | FromDiscord | <nocturn9x> is there another way of dumping an object to bytes in the compile time VM? |
08:27:53 | FromDiscord | <nocturn9x> ideally without going through a file |
08:30:15 | Amun-Ra | yes, you can't use importc that way |
08:31:29 | Amun-Ra | copy like result[0..n] = … |
08:31:36 | FromDiscord | <nocturn9x> ight |
08:32:03 | Amun-Ra | if network may be accessed via toopenarray() |
08:32:06 | Amun-Ra | can* |
08:32:20 | FromDiscord | <nocturn9x> well it's a bunch of arrays |
08:32:25 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
08:32:35 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=POwUFsoV |
08:32:45 | FromDiscord | <nocturn9x> I doubt `toOpenArray` can handle this though |
08:33:27 | FromDiscord | <nocturn9x> and I need to copy the padding too |
08:33:31 | FromDiscord | <nocturn9x> it has to be the whole object |
08:33:41 | Amun-Ra | I'd make a stage 1 program that creates the binary and staticread the result in stage 2 |
08:34:12 | FromDiscord | <nocturn9x> how? |
08:34:34 | Amun-Ra | I mean creating binary blob at runtime in a separate program |
08:34:49 | Amun-Ra | if I understand the issue correctly |
08:36:14 | FromDiscord | <nocturn9x> I was hoping to automate the process as much as possible |
08:36:25 | FromDiscord | <nocturn9x> I don't want to be fiddling with external programs, it should all be done in-engine |
08:36:29 | FromDiscord | <nocturn9x> or I will just never bother to do it |
08:36:57 | FromDiscord | <nocturn9x> especially since it has to happen at build time every time |
08:39:23 | FromDiscord | <nnsee> you can compile and run binary 1 as part of the build process before building the final binary? |
08:39:38 | Amun-Ra | just two build steps instead of one |
08:40:02 | FromDiscord | <nocturn9x> eh ig |
08:40:32 | FromDiscord | <nocturn9x> there is no way to declare a global variable _inside_ a when block, yeah? |
08:41:08 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=ccwaUNIl |
08:41:10 | FromDiscord | <nocturn9x> (edit) "https://play.nim-lang.org/#pasty=aJJmOgKd" => "https://play.nim-lang.org/#pasty=XQYvRScy" |
08:41:47 | Amun-Ra | https://play.nim-lang.org/#pasty=rLyFYaBJ |
08:42:33 | FromDiscord | <nocturn9x> nice |
08:46:19 | FromDiscord | <nocturn9x> In reply to @Amun-Ra "https://play.nim-lang.org/#pasty=rLyFYaBJ": doesn't work for const oof |
08:46:31 | FromDiscord | <nocturn9x> it's OK I can work around it |
08:46:40 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=uMyGTDPu |
08:46:42 | FromDiscord | <nnsee> can you maybe lift the assignment out |
08:46:43 | FromDiscord | <nnsee> yah |
08:46:49 | FromDiscord | <nnsee> (edit) "yah" => "yeah" |
08:46:56 | FromDiscord | <nocturn9x> mhm |
08:47:04 | FromDiscord | <nocturn9x> the problem is still how to produce `verbatim_net.bin` |
08:47:11 | FromDiscord | <nocturn9x> the idea of a separate program annoys me a bit |
08:47:18 | FromDiscord | <nocturn9x> In reply to @nocturn9x "the problem is still": I created this manually so far |
08:47:55 | FromDiscord | <nocturn9x> I could probably just do it once per network and just upload it to my lfs repo |
08:49:08 | FromDiscord | <nnsee> build-time executables are a pretty common concept fwiw |
08:50:10 | FromDiscord | <nnsee> in some languages this is even a built-in feature, rust's `build.rs` for example |
08:55:48 | FromDiscord | <nocturn9x> hmm |
08:55:55 | FromDiscord | <nocturn9x> I'm remarkably lazy so right now this will do |
08:56:01 | FromDiscord | <nocturn9x> I will figure out a more automated solution at some points |
08:56:05 | FromDiscord | <nocturn9x> networks don't change that much anyway |
09:41:20 | * | andy-turner_ joined #nim |
09:44:20 | * | andy-turner quit (Ping timeout: 268 seconds) |
09:52:21 | * | andy-turner__ joined #nim |
09:55:14 | * | andy-turner_ quit (Ping timeout: 260 seconds) |
10:03:15 | * | rockcavera quit (Remote host closed the connection) |
10:47:43 | * | nils` joined #nim |
10:53:18 | * | andy-turner__ is now known as andy-turner |
10:53:41 | * | xet7 joined #nim |
10:54:50 | FromDiscord | <0xfab_10> rust has rustscripts now |
11:05:28 | * | amadaluzia joined #nim |
11:14:50 | * | andy-turner_ joined #nim |
11:17:18 | * | andy-turner quit (Ping timeout: 252 seconds) |
11:27:57 | * | andy-turner_ quit (Quit: Leaving) |
11:39:55 | * | xutaxkamay quit (Ping timeout: 244 seconds) |
11:40:42 | * | xutaxkamay joined #nim |
11:57:04 | * | xutaxkamay quit (Ping timeout: 276 seconds) |
11:58:56 | * | xutaxkamay joined #nim |
12:10:43 | * | andy-turner joined #nim |
12:13:21 | * | andy-turner quit (Remote host closed the connection) |
12:13:42 | * | andy-turner joined #nim |
13:18:20 | * | andy-turner quit (Quit: Leaving) |
13:22:58 | * | xet7 quit (Remote host closed the connection) |
14:34:07 | FromDiscord | <Robyn [She/Her]> rust scripts?↵(@0xfab_10) |
14:34:56 | FromDiscord | <0xfab_10> yeah |
14:35:11 | FromDiscord | <0xfab_10> nim c -r type of thing |
14:50:06 | FromDiscord | <janakali> why do people here and on forum always mention `nim c -r` and not `nim r`? |
14:50:29 | FromDiscord | <janakali> it's cleaner. it's shorter. |
14:53:09 | FromDiscord | <janakali> one of my favourite commands |
14:53:10 | FromDiscord | <lainlaylie> indeed. it also doesnt leave a binary sitting around in the current directory |
15:11:37 | * | amadaluzia quit (Read error: Connection reset by peer) |
15:11:47 | * | amadaluzia_ joined #nim |
15:33:36 | FromDiscord | <0xfab_10> I forget `nim r` exists |
16:13:20 | FromDiscord | <_nenc> afaik, when doesn't create a scope |
16:16:19 | FromDiscord | <_nenc> and global pragma isn't about global variables |
16:53:12 | FromDiscord | <TӨMΛ ☠> Is there a command for .nimble file that tells compiler where to put the .exe (subfolder, nothing crazy)?↵Tried using it in `--out:` but I don't think it works even for the pure name change, not to mention putting .exe in any subfolder |
17:01:59 | * | beholders_eye joined #nim |
17:03:39 | FromDiscord | <kapendev> > cargo config inside your Rust script ↵Bloat. |
17:17:56 | * | jjido joined #nim |
17:46:41 | * | amadaluzia_ quit (Ping timeout: 252 seconds) |
17:48:32 | * | amadaluzia joined #nim |
17:49:58 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
17:52:32 | * | xet7 joined #nim |
18:12:56 | * | amadaluzia quit (Quit: ZNC 1.9.1 - https://znc.in) |
18:13:55 | * | amadaluzia joined #nim |
18:16:35 | * | amadaluzia quit (Client Quit) |
18:17:41 | * | amadaluzia joined #nim |
18:31:19 | FromDiscord | <jos002> link to rust scripts thing? |
18:31:39 | FromDiscord | <jos002> it’s part of cargo or rustc built in? |
18:37:11 | * | fabricio joined #nim |
19:09:41 | FromDiscord | <nnsee> In reply to @jos002 "link to rust scripts": only thing i found is https://rust-script.org/ but it does seem like just a third party tool |
19:10:25 | FromDiscord | <kapendev> Yeah, I was looking at this. |
19:10:40 | FromDiscord | <nnsee> there's also this https://github.com/rust-lang/cargo/issues/12207 |
19:10:44 | FromDiscord | <nnsee> but this is still open |
19:11:19 | FromDiscord | <nnsee> it seems like most of it is implemented though, huh |
19:12:04 | FromDiscord | <nnsee> RFC: https://github.com/rust-lang/rfcs/pull/3424 |
19:12:07 | FromDiscord | <kapendev> I like how even the simplest stuff in Rust has a website. Did we really need a website for a script thingy? |
19:12:19 | FromDiscord | <nnsee> anyways, this should really be in #offtopic... |
19:24:57 | * | amadaluzia quit (Ping timeout: 252 seconds) |
19:25:29 | * | amadaluzia joined #nim |
19:25:41 | * | fabricio quit (Ping timeout: 248 seconds) |
19:27:22 | * | fabricio joined #nim |
19:40:01 | FromDiscord | <Elegantbeef> Domains are cheap |
19:45:36 | * | beholders_eye quit (Ping timeout: 252 seconds) |
20:43:16 | * | fabricio quit (Ping timeout: 272 seconds) |
21:01:23 | * | beholders_eye joined #nim |
21:33:40 | * | beholders_eye quit (Ping timeout: 252 seconds) |
21:40:01 | FromDiscord | <Robyn [She/Her]> In reply to @fabric.input_output "nim c -r type": ahh |
21:40:54 | * | amadaluzia quit (Ping timeout: 272 seconds) |
21:41:38 | * | amadaluzia joined #nim |
22:02:24 | FromDiscord | <morgan (ping with reply)> sent a long message, see https://pasty.ee/UDaYKlFS |
22:24:59 | * | fabricio joined #nim |
22:28:45 | * | beholders_eye joined #nim |
23:15:40 | * | xet7 quit (Ping timeout: 276 seconds) |
23:27:39 | * | xet7 joined #nim |
23:47:35 | * | fabricio quit (Quit: WeeChat 3.5) |