Better HN
topnewbestaskshowjobs
Log inSign up

xilec

9 karma · joined May 14, 2015 (11y ago) · 5 submissions

Submissions

comment 11y ago · link · parent

In section "Interfaces"

  impl Interfaces {
    fn my_method(a: isize) -> isize {
      return a;
    }
  }
It isn't implementation of trait. It specify default implementation of trait.

It must be:

  trait Interfaces {
    fn my_method(a: isize) -> isize;
  }

  struct Impl;

  impl Interfaces for Impl {
    fn my_method(a: isize) -> isize {
      return a;
    }
  }

In section "Enums", you can apply default implementation of equality trait:

  #[derive(PartialEq, Eq)]
  enum BasicEnum {
    Option1 = 1,
    Option2
  }
and compare

    if e1 == BasicEnum::Option1 {
        e1 = BasicEnum::Option2
    }

In section "Parameters", you said "All three languages default to pass-by-value if not otherwise specified". For privitive types it's true, but it's not. Classes in Java have reference semantic (copy only address in method). Structs in Rust have move semantic witch is connacted with ownership concept (https://doc.rust-lang.org/stable/book/ownership.html).

In common, many basic things for Rust have very good descriptions in Rust Book (https://doc.rust-lang.org/stable/book/). Please, pay attension on it and be more careful.

comment 11y ago · link · parent

There are LLILC project. LLILC is an LLVM based MSIL Compiler. https://github.com/dotnet/llilc . May be it helps in the future be .Net community and Rust(llvm) community collaborate close.

comment 11y ago · link · parent

We will be very appreciative if you add your notes in issues of project https://github.com/PistonDevelopers/VisualRust/issues

comment 11y ago · link · parent

Visual Rust has simple autocompletion based on Racer

comment 11y ago · link · parent

Here https://visualstudiogallery.msdn.microsoft.com/c6075d2f-8864... Your can see features, download and try