v
v copied to clipboard
Add `-prod-small` flag as alias for `-cflags -0s`
Describe the feature
Right now, if a user wants a binary that is as small as possible, they need to know the C flags. I think that in order to use V, the user does not need to know all the flags of the C compilers.
It's also useful to be more abstract as this flag will work for other backends in the future.
This flag can be documented and explicitly visible to the user, unlike -cflags -0s
which only experienced C developers will know.
Use Case
See above.
Proposed Solution
No response
Other Information
No response
Acknowledgements
- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
Version used
0.3.3
Environment details (OS name and version, etc.)
macOS 13
This may be a premature optimization. V still needs to get the -skip-unused
option finished so it becomes the default, before we start worrying about "as small as possible" (since it can't get a lot smaller until we stop including all of builtin
on every build).
This may be a premature optimization. V still needs to get the
-skip-unused
option finished so it becomes the default, before we start worrying about "as small as possible" (since it can't get a lot smaller until we stop including all ofbuiltin
on every build).
yeah, that's right, but it's just adding a flag, nothing more is needed. But with it, you can automatically enable additional flags in the future, if they appear. It's more of a vision for the future than for now.
Speaking of skip-unused.
I will be working on enabling skip-unused, use-cache, and parallel-cc by default this month.