[rust-dev] Rust lightning talk at JavaZone 2012

Reidar Sollid rsollid at gmail.com
Mon Aug 27 06:36:10 PDT 2012


Hi Brian,

Sorry for top-posting.

Thanks a lot for great input !

Best regards
Reidar


On 8/24/12 12:48 AM, "Brian Anderson" <banderson at mozilla.com> wrote:

>On 08/21/2012 10:33 AM, Reidar Sollid wrote:
>> Hi,
>>
>> JavaZone 2012 have accepted my lightning talk on Rust, it is just 10 min
>> so it is not much time to present Rust
>>
>> 
>>http://javazone.no/incogito10/events/JavaZone%202012/sessions#a8b2bb04-03
>>f2-4e88-9663-8387692af0e0
>>
>> I am deffently  doing task, but I need to build up to the tasks.
>>
>> Any suggestions on what to press in during those 10 min to convince Java
>> devs that Rust is a great language?
>
>Hi Reidar,
>
>This is very cool!
>
>I'm not too in-tune with the Java world right now, but here are some
>notes comparing Java and Rust.
>
>Two big selling points for a Java programmer are freedom from data races
>and control over memory layout, and these are both topics relevant to
>introducing Rust tasks.
>
>Java has a complex memory model describing what happens when multiple
>threads access shared memory. Rust has no shared memory, no volatile
>keyword, no synchronized methods. Synchronization in Rust is almost
>always based on message passing instead of locks.
>
>That's not to say that Rust's memory model isn't complex, but it's
>complex in entirely different ways. In Rust you have several options on
>for where to place objects in memory. If you try you can completely
>avoid the garbage collected heap. The Rust division between the GC heap
>and the exchange heap is what allows Rust to avoid data races.
>
>Rust and Java share some qualities:
>
>* Safety guarantees - never crash, never write bad memory
>* Both allow locals to be declared and assigned in separate statements
>while ensuring that they are definitely initialized before use.
>* Existential types - Rust traits can be used like Java interfaces by
>casting the type to the trait, though this isn't the typical usage
>because it involves vtables and is less efficient than using traits to
>place bounds on type parameters.
>
>Here are some common Java grips that Rust potentially can do better:
>
>* No data races - there's no complex model describing when variables are
>between threads, no volatiles.
>* Global GC - Java has notorious stop-the-world GC behavior (though it
>is very good). Rust's GC is per-task so when one task is collecting
>others continue running in parallel. With care you can in theory write
>tasks that never GC.
>* Lambda expressions - Rust has a very simple syntax, so Rust code uses
>them everywhere, whereas Java needs a lot of ceremony to do function-y
>things.
>
>Differences
>
>* Unsafe sublanguage - Rust gives you low level control when you need it
>* Control over memory layout - Local heap/echange heap/stack
>* Iterators - Rust uses higher-order functions instead of iterator objects
>* Expressiveness - Rust code is fairly compact. A determination to avoid
>'public static void main' is the biggest influence of Java on Rust.
>
>Good luck with your talk!
>
>Regards,
>Brian
>
>_______________________________________________
>Rust-dev mailing list
>Rust-dev at mozilla.org
>https://mail.mozilla.org/listinfo/rust-dev




More information about the Rust-dev mailing list