Conversation

introspection is a curse

2
0
2

@breaadyboy compile-time introspection can be fun once you start macromoding it

1
0
1

@breaadyboy flesh introspection or computer introspection?

0
0
0

@TheDarkBomber @breaadyboy u should guide me through what youre talking about it seems interesting

1
0
0

@shroomie @breaadyboy using introspection with macros, so you know the sizes and structures of variƤbles and things and what functions are available and so forth

1
0
1

@TheDarkBomber @breaadyboy oh introspection is getting a program to look at its own code? what is a macro btw?

1
0
0

@shroomie @breaadyboy generating code according to a set of rules, kind of like a function but it applies to the program itself during compilation rather than at runtime, so you effectively get to transform code into different code before it runs, which is useful to avoid having to copy code to make things happen in different specific use cases when you can define one macro that covers all cases generally and becomes the specific cases when you call them (see also: metaprogramming)

1
0
1

@TheDarkBomber @breaadyboy oh so like. typing a thing and then having another thing that needs to work similarly, so you just kinda tell the second thing to point to the first?

1
0
1

@shroomie @breaadyboy that's a use case for it yeah, you can also do more complicated stuff like serialisation (save files) where you can have a macro that tells you how structures are laid out in memory, following pointers so you can easily write code for saving and loading data

0
0
0