Re: GSoC'17 - Introduction: Rustify GJS



Sure,
https://github.com/Luke-Nukem/gjs/tree/rustify_cdylib is where I'll do most of  my work. I also have another branch where I'll be testing a static version (cdylib is dynamic).

I have quite a few things in my github these days, feel free to browse.

Also, first blog post (not in planet gnome aggregate yet),
http://lukenukem.co.nz/gsoc/2017/05/09/gsoc_1.html
I've hopefully done a much better job of a brief intro to Rust, it's a difficult task to summarise it without leaving too much out.

Cheers,
Luke.

On 15/05/2017 12:30 AM, "Carlos Soriano" <carlos soriano89 gmail com> wrote:
Nice, do you have a public repo where we can take a look out of curiosity? (it's fine if it's dirt & quick code :) )

On Sun, May 14, 2017 at 1:40 PM, Luke Jones <luke nukem jones gmail com> wrote:
Hi Carlos,

Yeah I think I tacked on the wrong description for the example I provided. Ah well.
The safety of rust makes it difficult at times to try and find examples that crash with a good descriptive error message.

In other news, I seem to have made a decent start on the project. Going to be lots of exciting stuff happening and lots to write about!

Cheers,
Luke,

On 8/05/2017 10:54 PM, "Carlos Soriano" <carlos soriano89 gmail com> wrote:
Hey Luke,

Nice to have you!

I just wanted to be picky and correct something :) On your example with rust, you put the declaration inside a different scope. This won't work in C either or any other language, that's not an use after free.
What you want is to define the variable outside of that scope, assign it to a new memory chunk inside a different scope, then outside of that scope try to acces the same var. That would be a use-after-free.

Cheers,
Carlos Soriano

On Sun, May 7, 2017 at 11:31 PM, Luke Jones <luke nukem jones gmail com> wrote:
Hello all,

I am Luke Jones, a student of software engineering in New Zealand.

The project proposal of mine that was accepted is to research and
implement the Rust language in to GJS to help reduce or eliminate
memory leaks and increase memory safety.

GJS is something that some rather important parts of the GNOME
ecosystem rely on (eg, shell), and it is imperative that it be solid,
stable, fast - as we all know, while C and C++ are wonderful languages
in their own right, they also allow many flaws to sneak past simply by
virtue of giving the programmer incredible unchecked power. This has
in the past introduced such things as memory leaks (not freeing after
use), use after free, array out of bounds and so on.

And then we have the cool new kid on the block; Rust.

Where the power of Rust comes in to play is via its compiler - it
enforces a set of rules regarding the ownership of data;
* data is immutable by default
* data may have any number of references (pointers) to it for as long
as the data is within scope of those references, or;
* data may only have one mutable reference
* if data is /moved/ it is no-longer able to be referenced by a
previous reference, and the compiler checks this.
* data /must/ have a value - null does not exist

The above means that such things as use-after-free are almost
impossible, as the compiler checks that the data is within scope and
throws an error if not. You can see a small demo here
https://is.gd/sT26Fj

So.
The aim of my project is to investigate a number of things;
* interoperation of C/C++ and Rust - Rust has an FFI
* the replacement of small sections of C/C++ with Rust
* the impact this has on such things as performance, memory safety, memory use

The ultimate goal after this is to open the way for using Rust within
GJS for mission critical sections - dependant on results of course -
and hopefully inspire others to start their own investigations in to
use of Rust within their projects.

Project: https://summerofcode.withgoogle.com/projects/#6418800843948032

I'm looking forward to seeing the benefits of this, and other
projects. Exciting times.

Luke
Oh, and yes there was the recent GNOME+Rust Hackfest, and also librsvg
slowly converting to Rust - I hope to be able to use this knowledge
base, as well as contribute to it.
_______________________________________________
gnome-soc-list mailing list
gnome-soc-list gnome org
https://mail.gnome.org/mailman/listinfo/gnome-soc-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]