00:23:53 | FromDiscord | <bendugo> In reply to @ricky._.spanish "anyone know where the": spanish? |
00:24:01 | FromDiscord | <bendugo> maybe you'll find this useful |
00:24:02 | FromDiscord | <bendugo> https://nim-lang.org/1.0.6/gc.html |
00:32:38 | FromDiscord | <zumi.dxy> That's for `--mm:refc` though |
00:33:14 | FromDiscord | <zumi.dxy> that being said there could've been more here https://nim-lang.org/docs/mm.html |
01:50:20 | * | tiorock joined #nim |
01:50:20 | * | rockcavera quit (Killed (copper.libera.chat (Nickname regained by services))) |
01:50:20 | * | tiorock is now known as rockcavera |
01:52:27 | * | tiorock joined #nim |
01:52:27 | * | rockcavera is now known as Guest2812 |
01:52:27 | * | Guest2812 quit (Killed (tantalum.libera.chat (Nickname regained by services))) |
01:52:27 | * | tiorock is now known as rockcavera |
02:28:51 | FromDiscord | <janakali> sent a code paste, see https://play.nim-lang.org/#pasty=OTUFpFXb |
02:30:26 | FromDiscord | <janakali> In reply to @sys64 "but seems it doesn't": ^ @System64 ~ Flandre Scarlet |
03:19:22 | FromDiscord | <fl4shk> on second thought, it seems I can't examine generic arguments of a function |
03:19:34 | FromDiscord | <fl4shk> wait... I can |
03:19:39 | FromDiscord | <fl4shk> I just realized I can |
03:20:05 | FromDiscord | <fl4shk> at least, I can do it better when I'm I not tied |
03:20:08 | FromDiscord | <fl4shk> tired |
03:20:32 | FromDiscord | <fl4shk> or not |
03:20:37 | FromDiscord | <fl4shk> seems I need macros after all |
03:58:07 | FromDiscord | <fl4shk> it's... possible to do this if a function takes arguments |
03:59:28 | FromDiscord | <fl4shk> but I can't see the generics directly |
03:59:44 | FromDiscord | <fl4shk> (edit) "but I can't see the generics ... directly" added "of the function call" |
03:59:51 | FromDiscord | <fl4shk> more investigation is needed |
04:41:25 | * | rockcavera quit (Remote host closed the connection) |
06:31:35 | * | ntat joined #nim |
07:12:07 | FromDiscord | <xtrayambak> Is there a way to set the kind of an ADT after it has been allocated using a custom allocation function? |
07:19:46 | FromDiscord | <Elegantbeef> I do still love that people call tagged unions ADTs is it's such a pointless term |
07:19:47 | FromDiscord | <Elegantbeef> Objects and tuples are by definition ADTs but for some reason they only ever mean tagged unions |
07:20:53 | FromDiscord | <xtrayambak> In reply to @Elegantbeef "I do still love": I just call em that because it's a shorthand |
07:21:18 | FromDiscord | <Elegantbeef> Oh I see my link didn't come through |
07:21:20 | FromDiscord | <xtrayambak> (edit) "a shorthand" => "shorter" |
07:21:20 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#types-cast-uncheckedassign |
07:21:38 | FromDiscord | <xtrayambak> Thanks |
07:23:21 | FromDiscord | <xtrayambak> Huh, I still get the same error |
07:23:40 | FromDiscord | <Elegantbeef> Was there an error I missed? |
07:23:49 | FromDiscord | <xtrayambak> sent a code paste, see https://play.nim-lang.org/#pasty=pgzCGtFG |
07:23:52 | FromDiscord | <xtrayambak> sent a code paste, see https://play.nim-lang.org/#pasty=BwvQZJYz |
07:23:57 | FromDiscord | <xtrayambak> This is the error I got before and after that |
07:24:03 | FromDiscord | <xtrayambak> (edit) "and" => "_and_" |
07:24:13 | FromDiscord | <Elegantbeef> That's unrelated to the kind |
07:24:32 | FromDiscord | <Elegantbeef> That's not Nim erroring that's bali's vm |
07:24:40 | FromDiscord | <xtrayambak> Ah |
07:24:58 | FromDiscord | <xtrayambak> I should learn to read |
07:24:59 | FromDiscord | <Elegantbeef> You have a custom destructor and it's not liking it |
07:25:10 | FromDiscord | <xtrayambak> yep, removing the destructor fixes it |
07:25:16 | FromDiscord | <Elegantbeef> Also is `MAtom` even right? |
07:25:28 | FromDiscord | <xtrayambak> In reply to @Elegantbeef "Also is `MAtom` even": It should be `ptr MAtom` |
07:25:29 | FromDiscord | <xtrayambak> I think |
07:25:41 | FromDiscord | <Elegantbeef> Probably |
07:26:46 | FromDiscord | <xtrayambak> oh lord my garbage collector entered an infinite loop |
07:26:47 | FromDiscord | <xtrayambak> I love my life |
07:29:55 | FromDiscord | <Elegantbeef> Just don't make cycles |
07:30:15 | FromDiscord | <xtrayambak> No, it isn't Nim, it's my own crappy one I'm writing |
07:30:27 | FromDiscord | <Elegantbeef> Did I stutter? |
07:33:40 | FromDiscord | <xtrayambak> In reply to @Elegantbeef "Did I stutter?": Haha it isn't due to cycles, it did that because some unrelated pre-VM initialization code tried to allocate using the GC |
07:33:55 | FromDiscord | <xtrayambak> (edit) "cycles," => "cycles (yet)," |
07:44:54 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @janakali "^ <@380360389377916939>": Oh I have to use the old gc? |
07:50:16 | FromDiscord | <janakali> In reply to @sys64 "Oh I have to": yep, see https://github.com/nim-lang/Nim/issues/21446 |
07:54:21 | FromDiscord | <janakali> oh just found that Arc/Orc works with `-d:useMalloc` https://github.com/nim-lang/Nim/issues/22392 |
08:02:43 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @janakali "oh just found that": Oh, I can do this!↵Will it make my iteration cycles faster? |
08:05:28 | * | ntat quit (Quit: Leaving) |
11:24:21 | FromDiscord | <pmunch> Has Nim gotten more lenient about what you can use as names for stuff? |
11:35:11 | * | coldfeet joined #nim |
12:02:17 | * | coldfeet quit (Quit: Lost terminal) |
13:15:30 | FromDiscord | <Robyn [She/Her]> In reply to @pmunch "Has Nim gotten more": not afaik, why? |
13:19:28 | FromDiscord | <pmunch> Just faced some confusing issues |
13:19:39 | FromDiscord | <Robyn [She/Her]> wweird |
13:38:38 | FromDiscord | <pmunch> In a Nimble test, is there any way to specify extra command line arguments? |
15:06:48 | FromDiscord | <bostonboston> In reply to @pmunch "In a Nimble test,": You can "overload" the test task |
15:07:31 | FromDiscord | <bostonboston> https://nim-lang.github.io/nimble/create-packages.html#nimble-test |
16:00:37 | FromDiscord | <bostonboston> Alternatively, if you're referring to runtime args and don't mind every test file getting the same args then `nimble test yourArg` passes yourArg as a command line param |
16:03:19 | FromDiscord | <pmunch> I didn't want to completely redo the testing system though.. |
16:03:48 | FromDiscord | <pmunch> Ended up just creating a .nims file with the same name as the test which seems to work fine |
16:28:04 | FromDiscord | <firasuke> what's the accepted way to run a proc on program exit? say removing a lock file? does wrapping the entire execution block by `try:` and `finally:` make sense here? |
16:29:25 | FromDiscord | <bostonboston> std/exitprocs |
16:33:08 | FromDiscord | <firasuke> In reply to @bostonboston "std/exitprocs": does it handle cases where the program might panic or throws an exception? |
16:35:08 | FromDiscord | <bostonboston> I don't believe ao |
16:35:12 | FromDiscord | <bostonboston> (edit) "ao" => "so" |
16:36:01 | FromDiscord | <firasuke> sigh |
16:37:00 | FromDiscord | <firasuke> I am trying to create a simple locking mechanism for a program where a lock file is created when the program is run, and the lock file has to be removed when the program exits (be it whether it exits successfully or it throws an exception or if it panics or if it gets interrupted).. |
16:41:34 | FromDiscord | <firasuke> would a defer work here? |
16:45:46 | FromDiscord | <bostonboston> I don't think it would in all cases, for example of out of mem is raised quit is used, which bypasses all control flow |
16:46:21 | FromDiscord | <bostonboston> There is the outofmemhook, but I don't know if there are other weird cases |
16:48:35 | FromDiscord | <firasuke> hmm would signal handlers work then? |
17:08:27 | FromDiscord | <bostonboston> I can't confidently answer.↵↵Maybe you could make a PR that adds a customer handler to the setTerminate handler in excpt.nim |
17:09:04 | FromDiscord | <bostonboston> Custom handler |
17:28:33 | FromDiscord | <firasuke> ok thanks |
17:48:49 | * | pbsds35 quit (Ping timeout: 268 seconds) |
17:57:39 | * | coldfeet joined #nim |
18:01:34 | FromDiscord | <determiedmech1> Hi guys quick question |
18:01:45 | FromDiscord | <determiedmech1> I was looking at some pragma stuff |
18:02:04 | FromDiscord | <determiedmech1> sent a code paste, see https://play.nim-lang.org/#pasty=LORIxnEO |
18:02:28 | FromDiscord | <determiedmech1> what is the `procedure[^1].add(...)`? |
18:02:44 | FromDiscord | <determiedmech1> https://forum.nim-lang.org/t/11370 |
18:06:31 | FromDiscord | <lainlaylie> the last node in a nnkprocdef is the body |
18:16:34 | FromDiscord | <determiedmech1> ah |
18:16:45 | FromDiscord | <determiedmech1> Wait is this stuff documented in macros |
18:18:21 | FromDiscord | <determiedmech1> oooh so does `quote do:` return AST? |
18:19:05 | FromDiscord | <determiedmech1> aaaahhhhh |
18:31:40 | FromDiscord | <lainlaylie> In reply to @determiedmech1 "Wait is this stuff": yes its all in https://nim-lang.org/docs/macros.html |
18:34:45 | FromDiscord | <fl4shk> I've been doing macro stuff too |
18:37:35 | FromDiscord | <fl4shk> is there any way to get the definition of a `proc` that takes generics, just with the generics expanded? |
18:44:31 | FromDiscord | <fl4shk> from within a macro, I mean |
18:45:46 | * | pbsds35 joined #nim |
18:46:51 | FromDiscord | <fl4shk> maybe I need untyped macros |
18:48:02 | FromDiscord | <fl4shk> those don't appear to be the right answer |
18:49:00 | FromDiscord | <fl4shk> guess I'll have to do type substitution myself somehow |
18:51:53 | * | coldfeet quit (Quit: Lost terminal) |
18:52:05 | * | alice left #nim (#nim) |
19:09:50 | FromDiscord | <threefour> Is there any way to know the size of a table built from the table constructor, and use that in a type definition at compile-time? |
19:13:18 | FromDiscord | <Elegantbeef> `len({...})` |
19:21:05 | * | ntat joined #nim |
19:34:24 | FromDiscord | <fl4shk> okay I finally got generics mostly working! |
19:34:30 | FromDiscord | <fl4shk> for function calls at least |
19:48:05 | * | ntat_ joined #nim |
19:48:15 | * | ntat quit (Ping timeout: 260 seconds) |
20:06:48 | FromDiscord | <xenon_tech> Hello! |
20:21:45 | FromDiscord | <xenon_tech> Um, why am I getting this error? https://media.discordapp.net/attachments/371759389889003532/1338605851417645197/image.png?ex=67abb159&is=67aa5fd9&hm=437a86fce59e2a3328d761c2efc46ff30bb3d250bab6448c9ea6bb26f855da45& |
20:22:14 | FromDiscord | <Elegantbeef> You don't have gcc in your path |
20:23:12 | FromDiscord | <xenon_tech> In reply to @Elegantbeef "You don't have gcc": Oh, how to get it? |
20:23:48 | FromDiscord | <Elegantbeef> Install gcc and add it to the environmental variable |
20:23:57 | FromDiscord | <xenon_tech> Ok |
20:42:33 | FromDiscord | <xenon_tech> In reply to @Elegantbeef "Install gcc and add": Are you real |
20:43:45 | FromDiscord | <Elegantbeef> My parents told me I was |
20:43:51 | FromDiscord | <Elegantbeef> That is in the past so who knows now |
20:44:59 | * | lumidify quit (Quit: leaving) |
20:45:03 | FromDiscord | <xenon_tech> In reply to @Elegantbeef "That is in the": 🧐 💀 |
20:46:08 | * | lumidify joined #nim |
20:46:23 | FromDiscord | <determiedmech1> oh yeah I had a question about cross compiling |
20:47:01 | FromDiscord | <determiedmech1> https://cdn.discordapp.com/attachments/1133080287824334878/1337858985667067955/image.png?ex=67ab9cc6&is=67aa4b46&hm=022ebb555ac6b6f37a11b847e8284810bbf66664276a0c246b8cbb9feafe74e5&↵This happens when I use --os:windows -d:MingW64 |
20:47:10 | FromDiscord | <determiedmech1> whatever the flags in the example are |
20:47:16 | FromDiscord | <Elegantbeef> Are you on Linux? |
20:47:17 | FromDiscord | <determiedmech1> embed fail 😭 |
20:47:21 | FromDiscord | <determiedmech1> In reply to @Elegantbeef "Are you on Linux?": Yes |
20:47:31 | FromDiscord | <Elegantbeef> `-d:mingw` is all you need |
20:47:40 | FromDiscord | <determiedmech1> ah ok |
20:47:57 | FromDiscord | <determiedmech1> This is what was happening https://media.discordapp.net/attachments/371759389889003532/1338612441411751977/image.png?ex=67abb77c&is=67aa65fc&hm=491e3856937cde6b12d65bdc10885dd0aca7f05f9bdef03c81d541f9ec62bb88& |
20:50:41 | FromDiscord | <Elegantbeef> Was or is? |
20:51:47 | FromDiscord | <xenon_tech> Can you make a game with Nim? |
20:52:18 | FromDiscord | <Elegantbeef> It's a Turing complete language you can make anything |
20:53:05 | * | ntat_ quit (Quit: Leaving) |
20:53:15 | FromDiscord | <solitudesf> In reply to @xenon_tech "Can you make a": no, i cant... |
20:53:18 | FromDiscord | <determiedmech1> In reply to @Elegantbeef "Was or is?": I'll try again later and send a screenshot |
20:53:25 | FromDiscord | <xenon_tech> In reply to @solitudesf "no, i cant...": Why |
20:53:28 | FromDiscord | <determiedmech1> can't rn 😞 |
20:53:36 | FromDiscord | <Elegantbeef> Solitude giving the real answers |
20:53:49 | FromDiscord | <determiedmech1> actually I can see if it works on my phone if I can get mingw in termux |
20:54:17 | FromDiscord | <Elegantbeef> I don't imagine mingw will be in termux |
20:54:24 | FromDiscord | <Elegantbeef> Who is cross compiling on termux to windows |
20:57:06 | FromDiscord | <bendugo> anyone know if the front end for nimble.directory is open source? |
20:58:37 | FromDiscord | <Elegantbeef> https://github.com/FedericoCeratto/nim-package-directory |
21:02:08 | FromDiscord | <determiedmech1> It actually doesn't fun fact |
21:02:18 | FromDiscord | <michaelb.eth> he archived it back in Aug... is he also hosting it, or maybe it's a gh-pages thing, I never looked very closely |
21:02:26 | FromDiscord | <determiedmech1> In reply to @Elegantbeef "Who is cross compiling": some llvm stuff is |
21:03:37 | FromDiscord | <determiedmech1> https://media.discordapp.net/attachments/371759389889003532/1338616384867008512/image0.jpg?ex=67abbb28&is=67aa69a8&hm=4647a8bcd8ca1fe398127f24dca8da0a73bc7774039ef80f3d69b54fed500228& |
21:03:53 | FromDiscord | <determiedmech1> but that's llvm |
21:03:59 | FromDiscord | <determiedmech1> 😔 |
21:33:04 | * | rockcavera joined #nim |
22:13:06 | FromDiscord | <System64 ~ Flandre Scarlet> Hi! Is there a library that let me serialize (and save to file) stuff with key-value pairs, so I can extend my objects without worrying about versionning please?↵I avoid JSON because values are text. |
22:36:45 | FromDiscord | <Elegantbeef> Messagepack or if you're adventurous https://github.com/beef331/vsbf |
22:38:59 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Messagepack or if you're": Does Messagepack let me iterate through values? and writing values individually while keeping key-value pairs? |
22:39:35 | FromDiscord | <Elegantbeef> It's practically a binary json variant |
22:40:30 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=OyKrTuFY |
22:40:58 | FromDiscord | <System64 ~ Flandre Scarlet> I use msgpack4nim |
22:43:28 | FromDiscord | <Elegantbeef> vsbf does store the field names in the binary |
22:43:39 | FromDiscord | <Elegantbeef> So if that's something you want consider being adventurous and being my first customer |
22:46:14 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "So if that's something": Gotta give it a try!↵But what happens if I add a new field to the object and I try to load an old version of this object? |
22:46:35 | FromDiscord | <Elegantbeef> It stores the field names so it works just like json |
22:47:04 | FromDiscord | <Elegantbeef> It's a versionless format that allows easish migration as fields are typed and you can write hooks for specific types |
22:59:44 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "It's a versionless format": I tested quickly, and seems robust and doesn't fail when I add new fields!↵However it seems I can't set a default value up? And how would it act with inheritence? |
23:00:12 | FromDiscord | <Elegantbeef> It doesn't work with inheritance as that loses type information |
23:00:16 | FromDiscord | <Elegantbeef> "set a default value up"? |
23:01:04 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef ""set a default value": Yeah↵Because if I add a new field, it is automatically set to 0, but maybe I want something else |
23:02:21 | FromDiscord | <Elegantbeef> Can you not just use the type level defaults? |
23:02:49 | FromDiscord | <System64 ~ Flandre Scarlet> Nope, doesn't work |
23:03:29 | FromDiscord | <Elegantbeef> huh |
23:13:16 | FromDiscord | <Elegantbeef> Well thanks, bug found and eliminated |
23:13:18 | FromDiscord | <Elegantbeef> https://github.com/beef331/vsbf/blob/master/tests/tbasics.nim#L42-L55 Just to ensure you're doing the same |
23:15:43 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "https://github.com/beef331/vsbf/blob/master/tests/t": It works! Thanks! |
23:28:36 | FromDiscord | <System64 ~ Flandre Scarlet> However, is it normal that I have vsbf as header and not the type name? |
23:31:48 | FromDiscord | <Elegantbeef> Yes |
23:32:09 | FromDiscord | <Elegantbeef> I'm uncertain what you mean though, but only the file starts with vsbf |
23:32:42 | FromDiscord | <Elegantbeef> The type is a single byte with the last reserved for "type name follows this" |
23:33:55 | FromDiscord | <Elegantbeef> So for an `tuple[a, b: int]` you should have like `vsbf Version1 Version0 Struct Int 1 'a' IntValue Int 1 'b' IntValue` |
23:34:43 | FromDiscord | <Elegantbeef> If that's not the way the file is written I seemed to have messed up majorly and have no clue how 😄 |
23:35:09 | FromDiscord | <Elegantbeef> Oh I left out the `StructEnd` |
23:35:24 | FromDiscord | <Elegantbeef> That should be the last byte of every vsbf file |
23:35:56 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=PgaGRyIo |
23:37:36 | FromDiscord | <Elegantbeef> every vsbf struct\ |
23:37:37 | FromDiscord | <Elegantbeef> Are you using the proper vsbf? |
23:38:18 | FromDiscord | <System64 ~ Flandre Scarlet> Yes |
23:39:41 | FromDiscord | <fl4shk> can someone tell me how to correctly use `ptr` types in Nim |
23:39:52 | FromDiscord | <Elegantbeef> If you need to ask you don't need them |
23:40:00 | FromDiscord | <fl4shk> I understand pointers in C++ |
23:40:03 | FromDiscord | <fl4shk> already |
23:40:13 | FromDiscord | <Elegantbeef> Then you understand pointers in Nim |
23:40:15 | FromDiscord | <fl4shk> I'm getting an error from attempting to dereference a `ptr` |
23:40:40 | FromDiscord | <fl4shk> sent a code paste, see https://play.nim-lang.org/#pasty=XeEQZkxG |
23:40:56 | FromDiscord | <Elegantbeef> You hit a compiler error so you're probably using pointers in the VM |
23:41:01 | FromDiscord | <fl4shk> oh gotcha, probably, yeah |
23:41:05 | FromDiscord | <fl4shk> these are in macros |
23:41:09 | FromDiscord | <Elegantbeef> Use `ref T` instead |
23:41:13 | FromDiscord | <fl4shk> good enough for me |
23:44:15 | FromDiscord | <Elegantbeef> It's so odd System |
23:44:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=eQevlsME |
23:44:36 | FromDiscord | <Elegantbeef> Like it's clearly being saved right, but seems like a Nim bug has crept in |
23:45:27 | FromDiscord | <System64 ~ Flandre Scarlet> OOF!! |
23:45:37 | FromDiscord | <System64 ~ Flandre Scarlet> I found a language bug |
23:45:39 | FromDiscord | <Elegantbeef> Oh I think I found the bug |
23:54:21 | * | jkl quit (Excess Flood) |
23:54:55 | * | jkl joined #nim |
23:56:41 | FromDiscord | <Elegantbeef> Well sorry about that @System64 ~ Flandre Scarlet but hopefully that's the last bug. I swear I tested this! |
23:56:58 | FromDiscord | <Elegantbeef> I just never tested it with inheritance or defaults cause I don't use them as I mostly use object variants |
23:59:56 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "I just never tested": It works! Thanks!↵However doesn't work with Ref Objects sadly (it is a compilation error) |