littlekernel / lk

LK embedded kernel
MIT License
3.11k stars 611 forks source link

Rust #361

Open Surysingh opened 1 year ago

Surysingh commented 1 year ago

Rust has lot of features which can help prevent common memory related issues. Recently Linux Kernel is also moving towards Rust.

Is there any plan for LK to also use Rust?

Thank you.

travisg commented 1 year ago

I've spent some time this last holiday learning some rust and it is definitely something that could be done. The hard question is defining exactly how to fully integrate it into the system. ie, which direction can apis call? Is it okay to define a rust module that C code calls into, or is it more of a C -> Rust as some sort of leaf node library.

GravisZro commented 1 year ago

Rust would be a poor choice because it doesn't support all the target architectures.

Surysingh commented 1 year ago

Rust would be a poor choice because it doesn't support all the target architectures.

Which target architectures are not supported in Rust? We can still have conditional build to use rust for supported architectures?

Surysingh commented 1 year ago

code

Thank you for the reply.

For example, the memory manager like dlmalloc written in Rust, the malloc-free api users are written in say C/C++, then the benefits offered by rust, will no longer apply in C program. So would it be very effective, is this the question being considered?