On 04/03/14 02:43 PM, John Mija wrote:
> Every time there is a new language, developers have to start to
> developing from scratch the same algorithms.
> The alternative has been to use C libraries already built since is much
> easier to interface with other languages and a lot of languages will let
> you call C functions directly.
> 
> But C language is unsafe and there is a penalty performance at binding.
> Besides, it is harder to debug incorrect C code.

There is no performance penalty for calling C code in Rust. It's as fast
as calling C functions from C or Rust functions from Rust.

> So, why don't use a simple language but safe like Go?

Go isn't safe. It has data races.

> The Go compilers create a single intermediate file representing the
> "binary assembly" of the compiled package, ready as input for the
> linker: http://golang.org/cmd/gc/
> 
> I'm supposed that a linker could be built to link that intermediate file
> together to a Rust program.
> 
> The main advantage is that you would use a simpler language to build
> algorithms and code of lower level (asm), wich could be linked from
> other languages.

Can you clarify what you mean? Most data structures and algorithms in
the Rust standard library need to be written in Rust because they're
generic. It reuses the standard C library when possible and there is no
performance penalty for doing so.

> Rust is a language more complex to replace to C like "universal language".

Go isn't much of a replacement for C. It requires a runtime and includes
a global garbage collector. I can't see where Rust falls short as a C
replacement though, do you have a reason for claiming this?

> Note: I love both languages; Go for web apps and Rust for everything
> else (mobile and desktop apps, and servers).

Go doesn't target web browsers. Both Rust and Go are perfectly viable
for writing servers. I would definitely prefer to write server code in a
memory safe language where I don't need to worry about data races, and
where I have niceties like type-checked format strings and reusable
generic data structures and algorithms provided by the standard library.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to