My general gut feeling is: compared to the amount of code in Erlang/OTP,
Elixir, dependencies, and the code that Ash generates, the amount of code
in Ash used for code generation is going to be minimal. And all of that to
save memory on a box that most likely still needs to load hundreds of rows
from a database concurrently.

If you really believe this is worth it, then the quickest way to
explore/achieve this is by having a separate package that you won't include
in releases. It will be available for compilation, but not runtime.

On Thu, Feb 1, 2024 at 7:16 PM Zach Daniel <zachary.s.dan...@gmail.com>
wrote:

> Hey all! This isn't a fully fleshed out idea, but something that I've
> noticed especially with Ash Framework is how a *large* portion of our code
> should only ever be called when compiling.
>
> What brought this to my attention recently is that there are tons of
> places where we may do things like convert strings to atoms (not using
> `to_existing_atom`), and currently we just tell sobelow to skip that
> behavior because we know its only used at compile time.
>
> I'm aware that new code can be compiled at runtime, but my thought is that
> we can also potentially, on an opt-in basis, allow users to omit this
> compile time only code from their application, if they are *not* doing
> that. With how much code exists in Ash that serves only the compile time,
> I'm thinking this could significantly shrink the size of the code and its
> base memory footprint.
>
> I don't know if the juice would be worth the squeeze here or not, and its
> also very possible that there are reasons why, even if we wanted to, we
> couldn't do this kind of thing
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/5e1a0a22-e47a-4595-9ed3-d0a331552251n%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/5e1a0a22-e47a-4595-9ed3-d0a331552251n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4JerLxvP1FU3wxT8N4p4yVWs-x3mo42eP5xS_4pjmchgQ%40mail.gmail.com.

Reply via email to