Thanks for your answer,

El 29/05/13 21:40, Graydon Hoare escribió:
On 13-05-29 12:51 PM, John Mija wrote:

How could be integrated the Go language in Rust?

To embed a language, it generally needs to present a cdecl callable
interface (= accept C callbacks), and be willing to schedule its
coroutines and IO operations as steps within someone else's event loop.
It will also need some form of marshaling of data values and/or mapping
between types in the embedded and embedding languages; but that part is
often the easiest part.

Rust has been shifting[1] to a structure that permits embedding _Rust_
programs in others[2]; but embedding Go in Rust would be a different
direction and probably requires work on Go's side. It seems someone is
working on it[3] but I doubt it would be very easy today.

If somebody were to write a Go compiler to be integrated in Rust[1],
which path would be the best one? To create bindings to commands
[568][acgl] [2] or write the SSA library/interpreter [3] in Rust?

That would be another option. I have no idea how mature those semantics
are or the associated tooling. That route would probably run much more
slowly; I suspect you'll have better luck trying to get the two runtimes
to cooperate via linking.

And what do you think about this one?

(a) The Go programs must use a function for that the output been to a socket in Unix systems or to a pipe in Windows systems. (b) The Go program is compiled from Rust using bindings to the Go's C compilers).
(c) Now, Rust can read the output through a socket.

So, we get fast compilation and easy access to the Go's output.

+ To Run web scripts in Go --into a fork of Servo-- which will allow
create powerful applications easily with a great performance and easily
of debugging.

Similarly here, I think the "in a web page" environment is not terribly
fertile soil for the Go semantics. Even setting aside the same argument
above (most js programs, by volume, are probably onclick="" handlers and
only a few expressions long) I think the backward compatibility issues
-- your program now only runs in GoScript-aware browsers -- would limit
applicability. It has been tried with quite a number of other languages,
even nice small terse ones.
Well, the usage of Go like web language would be mainly useful for large web applications like games.
Go has integer and float types of 64 bits.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to