Stream: ideas

Topic: self hosted compiler


view this post on Zulip Yorye Nathan (Mar 05 2022 at 11:48):

Are there plans to rewrite the compiler/editor in roc at some point?

view this post on Zulip Folkert de Vries (Mar 05 2022 at 12:07):

nope, roc is not the right language for that. Parts of the editor will be written in roc (plugins etc) but a full compiler in roc would just be slower than what we're currently making

view this post on Zulip Kesanov (Mar 22 2022 at 09:41):

Can you elaborate what are the planned limitations of roc, that will make self hosting slow?

view this post on Zulip Folkert de Vries (Mar 22 2022 at 10:00):

these are mostly limitations in mutability and control over memory allocation

view this post on Zulip Folkert de Vries (Mar 22 2022 at 10:01):

also roc does not have a first-class concept of multi-threading

view this post on Zulip Brian Carroll (Mar 22 2022 at 10:06):

It wouldn't be slow, it would just be slower than Rust, one of the fastest languages out there. Roc is higher level than Rust and gives you more guarantees and ergonomics than Rust due to immutability, pure functions, memory management, etc. We work hard to make the performance difference tiny but it's not zero.

Also I think often people are intellectually fascinated by self hosting and really really hope that this cool idea is also beneficial. But it doesn't necessarily get you much and it's several years of work.

view this post on Zulip Folkert de Vries (Mar 22 2022 at 10:07):

it's typically an excellent dog-fooding project that appeals to compiler writers. But we aim to have other such projects (editor plugins, build system, etc)

view this post on Zulip Kesanov (Mar 22 2022 at 16:44):

Doesn't roc support inplace mutation as an optimization?

view this post on Zulip Maximilian E (Mar 22 2022 at 16:52):

I think it does, as discussed in the talk about a performant functional PL for stuff like quicksort, which is a worst case for functional. Do you know the talk or am I off target?

view this post on Zulip Brian Carroll (Mar 22 2022 at 16:53):

Yes. Roc allows mutation in a smaller set of circumstances than Rust. And it is more implicit, rather than being a first class concept.

view this post on Zulip Maximilian E (Mar 22 2022 at 16:57):

@Kesanov here's the talk at the relevant spot, if you're interested: https://youtu.be/vzfy4EKwG_Y?t=872

view this post on Zulip Folkert de Vries (Mar 22 2022 at 16:59):

in particular in the type checker, mutation is essential

view this post on Zulip Folkert de Vries (Mar 22 2022 at 16:59):

for good performance

view this post on Zulip Folkert de Vries (Mar 22 2022 at 16:59):

and we just wouldn't have the fine-grained control that we'd need in roc


Last updated: Jun 16 2026 at 16:19 UTC