Stream: ideas

Topic: static lib or object file flag


view this post on Zulip Brendan Hansknecht (Feb 12 2022 at 05:30):

Having a flag to generate a static lib or at least an object file could be quite useful. Something that doesn't try to build the platform at all and could be used when roc isn't the final linker/build system. Gives Roc more interoperability with little cost. I am currently specifically thinking about embedded where I don't think it will be reasonable for roc to be the final linker. Thoughts?

view this post on Zulip Richard Feldman (Feb 12 2022 at 12:32):

for sure! Emitting shared objects is what we should do for plugins, for example.

view this post on Zulip Richard Feldman (Feb 12 2022 at 12:33):

I think maybe instead of a compiler flag it makes more sense to be configurable at the platform level though? :thinking:

view this post on Zulip Richard Feldman (Feb 12 2022 at 12:33):

like some platforms will always want to generate that, and others will never want it

view this post on Zulip Richard Feldman (Feb 12 2022 at 12:33):

and maybe if the platform is aware of it, roc Plugin.roc can do something more useful than just generating and exiting?

view this post on Zulip Brendan Hansknecht (Feb 12 2022 at 17:35):

That would also be quite useful. That actually reminds me about how we wanted a way to specify build commands in roc config so that we didn't have to teach roc to use every different compiler.


Last updated: Jun 16 2026 at 16:19 UTC