On 3/23/14 12:11 AM, Phil Dawes wrote:
On Sun, Mar 23, 2014 at 2:04 AM, Patrick Walton pcwal...@mozilla.com
mailto:pcwal...@mozilla.com wrote:
Why not change the signature of `search_crate` to take `~str`?
Patrick
Hi Patrick,
The main reason I haven't done this is that it is already
On 23/03/14 18:14, Patrick Walton wrote:
On 3/23/14 12:11 AM, Phil Dawes wrote:
On Sun, Mar 23, 2014 at 2:04 AM, Patrick Walton pcwal...@mozilla.com
mailto:pcwal...@mozilla.com wrote:
Why not change the signature of `search_crate` to take `~str`?
Patrick
Hi Patrick,
The main reason
Great, thanks Patrick + Huon
On Sun, Mar 23, 2014 at 7:47 AM, Huon Wilson dbau...@gmail.com wrote:
On 23/03/14 18:14, Patrick Walton wrote:
On 3/23/14 12:11 AM, Phil Dawes wrote:
On Sun, Mar 23, 2014 at 2:04 AM, Patrick Walton pcwal...@mozilla.com
mailto:pcwal...@mozilla.com wrote:
Hi all,
Are there any plans to implement structural typing in Rust? Something like
this Scala code: http://en.wikipedia.org/wiki/Duck_typing#In_Scala
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
On 23/03/14 06:34 AM, Ziad Hatahet wrote:
Hi all,
Are there any plans to implement structural typing in Rust? Something
like this Scala code: http://en.wikipedia.org/wiki/Duck_typing#In_Scala
Rust used to have structural records. The feature was removed because
it's far from orthogonal with
IMO, this is bad.
2014年3月23日 下午6:34于 Ziad Hatahet hata...@gmail.com写道:
Hi all,
Are there any plans to implement structural typing in Rust? Something like
this Scala code: http://en.wikipedia.org/wiki/Duck_typing#In_Scala
___
Rust-dev mailing
I would note that Rust macros are actually working with structural typing:
the expanded macro cannot be compiled unless the expressions/statements it
results in can be compiled.
Regarding Scala here, it seems a weird idea to ask that each and every
method should copy+paste the interface. We all
I'm trying to experiment with rust and some embedded code. Currently I have
to do a three-pass compilation:
rustc --target arm-linux-eabi -O --emit bc main.rs -o main.bc
llc -mtriple arm-none-eabi -march=thumb -mcpu=cortex-m0 main.bc -o main.s
arm-none-linux-gnueabi-as main.s -o main.o
First,
Hello fellow Rustians,
I noticed that there is no goto statement in Rust yet. Gotos are very
useful e.g. for writing FSMs or for code generation and can, if used
sensibly, often make code more readable than code with traditional control
structures and temporary variables.
Can we please have a
Use tail call recursion for your FSMs.
On Mar 23, 2014 11:57 AM, Jérôme Bartand moije...@gmail.com wrote:
Hello fellow Rustians,
I noticed that there is no goto statement in Rust yet. Gotos are very
useful e.g. for writing FSMs or for code generation and can, if used
sensibly, often make
I think the biggest case for gotos is jumping out of nested loops. Does
rust have a nice way of doing that yet?
On Mar 23, 2014 11:57 AM, Jérôme Bartand moije...@gmail.com wrote:
Hello fellow Rustians,
I noticed that there is no goto statement in Rust yet. Gotos are very
useful e.g. for
Hello
Gotos are considered harmful for a reason. They allow you to bypass every
static block scope rules. Rust is a language with many static analysis
concerning typing and scope rules. I don't think goto statements integrate
well in such languages.
On the other hand, I never felt gotos missing
2014-03-24 1:08 GMT+09:00 Léo Testard leo.test...@gmail.com:
On the other hand, I never felt gotos missing when writing FSM simulation
code, but we do have a very nice syntax for jumping out of nested loops :
g: for i in foo.iter() {
// ...
h: loop {
if foo { break g; }
Kang Seonghoon some...@mearie.org
To be exact, it is `'g: ...` and `break 'g;` respectively. Its
resemblance with the lifetime syntax is no coincidence.
Woops, indeed, sorry for the mistake. There's no syntax highlighting when
wirting code in emails, and I'm not very used to this new syntax.
On 3/23/14 9:04 AM, Clark Gaebel wrote:
I think the biggest case for gotos is jumping out of nested loops. Does
rust have a nice way of doing that yet?
There's labeled break and continue. Use `'foo:` to denote a label. (The
reason that we use lifetime syntax there is that eventually it may be
Nevermind, I lost -O somewhere in between copying and pasting command line
flags. Optimised version doesn't have any morestack references (which is
strange concept though).
On Sun, Mar 23, 2014 at 5:44 PM, Vladimir Pouzanov farcal...@gmail.comwrote:
Figured out I can use --target
So it doesn't work in the end.
rustc --emit bc with flags set for cortex-m0 provides exact same bc with
only difference in target triple (which makes perfect sense)
However, replacing llc step with rustc --emit asm provides a different
assembler file, which requires __morestack.
Should I expect
No. See https://github.com/mozilla/rust/pull/8955 and
https://github.com/mozilla/rust/issues/11871 for discussion. You can
stub out
morestack but that won't remove the stack size checks. It's sanest to
just compile the IR yourself (the stack checking is a target-specific
machine pass, which is why
Note that there's Rust support for Ragel
(https://github.com/erickt/ragel), so you can just use that. It's much
easier than writing out your state machines by hand.
On Sun, Mar 23, 2014 at 1:18 PM, Patrick Walton pcwal...@mozilla.com wrote:
On 3/23/14 9:04 AM, Clark Gaebel wrote:
I think the
Thanks for links to bugs.
Is there anything to read on the whole morestack thing? I thought that it's
connected to segmented stacks that are (are they?) going away.
It seems that I can use #[no_split_stack] before each and every function to
generate a valid freestanding binary. If I just could
On Sun, Mar 23, 2014 at 11:42 AM, Corey Richardson co...@octayn.net wrote:
Note that there's Rust support for Ragel
(https://github.com/erickt/ragel), so you can just use that. It's much
easier than writing out your state machines by hand.
What kind of code is the Rust backend(s) capable of
On Sun, Mar 23, 2014 at 11:50 AM, Corey Richardson co...@octayn.net wrote:
Yes.
Cool! Who needs goto then? ;)
--
Tony Arcieri
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
Yep it uses the labeled break and continue. It's not quite as fast as goto
state machines because it has to use a state table to decide where to jump
to.
I've been thinking of a couple alternatives that could make us as fast as a
c state machine. The simplest night be to leverage the fact that
You wouldn't probably use this for each and every method, but what it gives
you is Go-style duck typing.
Sure you can define a trait, but what if the struct you to pass to your
function does not implement it? I guess you would have to implement a
wrapper around it manually then.
--
Ziad
On
On 3/23/14 2:19 PM, Ziad Hatahet wrote:
You wouldn't probably use this for each and every method, but what it
gives you is Go-style duck typing.
Sure you can define a trait, but what if the struct you to pass to your
function does not implement it? I guess you would have to implement a
wrapper
+1
2014年3月24日 上午5:46于 Patrick Walton pcwal...@mozilla.com写道:
On 3/23/14 2:19 PM, Ziad Hatahet wrote:
You wouldn't probably use this for each and every method, but what it
gives you is Go-style duck typing.
Sure you can define a trait, but what if the struct you to pass to your
function
How is it different from having the generic on the trait itself?
On Mar 22, 2014 10:44 AM, comex com...@gmail.com wrote:
On Sat, Mar 22, 2014 at 10:24 AM, Edward Wang edward.yu.w...@gmail.com
wrote:
But of course, it is very uncivilized :) Any suggestion on how to
refactor
this piece of
Thanks for the feedback everyone. It makes sense how things currently are
for Rust.
Keep up the great work!
--
Ziad
On Sun, Mar 23, 2014 at 4:54 PM, Liigo Zhuang com.li...@gmail.com wrote:
+1
2014年3月24日 上午5:46于 Patrick Walton pcwal...@mozilla.com写道:
On 3/23/14 2:19 PM, Ziad Hatahet wrote:
28 matches
Mail list logo