TelluIoT / ThingML

The ThingML modelling language
https://github.com/TelluIoT/ThingML
Apache License 2.0
101 stars 32 forks source link

Implement a Rust compiler #286

Open fungiboletus opened 5 years ago

fungiboletus commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

brice-morin commented 5 years ago

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