Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a Rust compiler #286

Open
fungiboletus opened this issue May 8, 2019 · 5 comments
Open

Implement a Rust compiler #286

fungiboletus opened this issue May 8, 2019 · 5 comments

Comments

@fungiboletus
Copy link
Contributor

@vetlevo and I are trying to convince @ffleurey to use a modern programming language to replace his C deployments whenever possible. Safety and more specifically memory safety are the main concerns with C and C++.

We are facing some resistance with moving towards Go, Java, or JavaScript. Java or JavaScript are too heavy and not low level enough. Go is perhaps too simple and still has a garbage collector.

At the same time,

Rust was the "most loved programming language" in the Stack Overflow Developer Survey for 2016, 2017, 2018, and 2019.

It offers similar performances to C and C++ while offering more memory safety (as long as you don't use the unsafe keyword) and a more modern API.

We think it could be a good fit for ThingML and the Rust compiler could replace the C compiler with only positive impacts in many deployments.

@brice-morin
Copy link
Collaborator

  • it has a concurrency model aligned with ThingML with message passing between threads (a bit like Go), which would remove the need for generating the internal serialization/deserialization whenever we send messages in ThingML (even between local instances). Less code to generate, less code to maintain in the compilers.

  • the C family of compilers starts to be "crowded". It could be the occasion to only focus the C compiler on micro-controllers only, and clean a lot of things there....

So, I like the idea :-)

One question is whether we should go for a full generative approach like in C compiler, or a "semi-generative" approach like in other compilers, which rely on a framework for state machines.

Also, the biggest question is who is going to implement it :-)

@fungiboletus
Copy link
Contributor Author

Also, the biggest question is who is going to implement it :-)

It's a very good question. At Tellu we do not know Rust yet.

@brice-morin
Copy link
Collaborator

Let's wait for a concrete use case, and a common project for this use case :-)

Happy @ffleurey ? But we keep the issue open ;-)

@fungiboletus
Copy link
Contributor Author

I did my first Rust Hello World yesterday, so things are going pretty well I would say.

@brice-morin
Copy link
Collaborator

Good, good :-) We might discuss that around lunch tomorrow as I'll be at Tellu in the morning for another project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants