Cool. I was afraid that it will be harder for the compiler to optimize away
the enum, but it seems to be doing fine.
(If it does turn out that it's harder for the compiler, I don't see a real
problem with the approach I suggested, as a runtime failure can only be
caused by a bug in the code
On 2014-06-11, at 16:27, SiegeLord slab...@aim.com wrote:
So, I think the situation is pretty bad. What can be done to fix it?
I agree that this seems like a serious regression from C++. If it won't be
fixed, I think I'll rather stick with C++. Better the devil you know...
I have been meaning to write Rust bindings for Hammer (
https://github.com/UpstandingHackers/hammer), my C parser-combinator
library which is loosely inspired by Parsec and gratuitously rips off
Scala's packrat parser implementation. There is an issue open for it (
Might be worth checking out https://github.com/kevinmehall/rust-peg.
On Wed, Jun 11, 2014 at 2:43 AM, Akira Hayakawa hayak...@valinux.co.jp
wrote:
Hi,
Haskell's Parsec is really a good tool to parse languages.
Scala also has the equivalent.
What about Rust?
--
Akira Hayakawa
I am by no means a SWIG expert. But would it be possible to work around the
missing discriminated union functionality by supplying a typemap and using
that to generate a set of Enums? That would would likely result in a more
Rust-ish interface as well.
On Thu, Jun 12, 2014 at 8:50 AM, Ian
On 6/12/14 1:02 AM, Tommi wrote:
On 2014-06-11, at 16:27, SiegeLord slab...@aim.com
mailto:slab...@aim.com wrote:
So, I think the situation is pretty bad. What can be done to fix it?
I agree that this seems like a serious regression from C++. If it won't
be fixed, I think I'll rather stick
On 6/11/14 6:27 AM, SiegeLord wrote:
So, I think the situation is pretty bad. What can be done to fix it?
Seems to me we can just make the overloaded operator traits take
by-value self.
Patrick
___
Rust-dev mailing list
Rust-dev@mozilla.org
On 2014-06-12, at 19:08, Patrick Walton pcwal...@mozilla.com wrote:
On 6/11/14 6:27 AM, SiegeLord wrote:
So, I think the situation is pretty bad. What can be done to fix it?
Seems to me we can just make the overloaded operator traits take by-value
self.
I definitely wouldn't want to see
You could just clone the value to get around that error.
On June 12, 2014 10:03:40 AM PDT, Tommi rusty.ga...@icloud.com wrote:
On 2014-06-12, at 19:08, Patrick Walton pcwal...@mozilla.com wrote:
On 6/11/14 6:27 AM, SiegeLord wrote:
So, I think the situation is pretty bad. What can be done to
Or bound by Copy.
On Thu, Jun 12, 2014 at 10:17 AM, Patrick Walton pwal...@mozilla.com wrote:
You could just clone the value to get around that error.
On June 12, 2014 10:03:40 AM PDT, Tommi rusty.ga...@icloud.com wrote:
On 2014-06-12, at 19:08, Patrick Walton pcwal...@mozilla.com wrote:
I think a new keyword, something like `stable`, is needed for specifying that
an argument passed to a trait function is guaranteed to be logically unchanged
after the function call. For example:
trait Foo {
fn foo(stable self);
}
impl Foo for int {
fn foo(self) {} // OK
}
impl Foo for
It's called Copy. `trait Foo: Copy { ... }`.
On Thu, Jun 12, 2014 at 10:26 AM, Tommi rusty.ga...@icloud.com wrote:
I think a new keyword, something like `stable`, is needed for specifying that
an argument passed to a trait function is guaranteed to be logically
unchanged after the function
`Copy` types aren't really relevant to a discussion about adding to Rust the
C++ like optimization of moving rvalues (of non-Copy types) when they're passed
to certain functions.
On 2014-06-12, at 20:30, Corey Richardson co...@octayn.net wrote:
It's called Copy. `trait Foo: Copy { ... }`.
On 6/12/14 10:46 AM, Tommi wrote:
`Copy` types aren't really relevant to a discussion about adding to
Rust the C++ like optimization of moving rvalues (of non-Copy types)
when they're passed to certain functions.
There's nothing to add to Rust. Rust supports moves.
Patrick
Implicit cloning is a non-starter. Clones can be very expensive.
Hiding that cost is undesirable and would require adding Clone to the
language (it's currently a normal library feature).
On Thu, Jun 12, 2014 at 10:46 AM, Tommi rusty.ga...@icloud.com wrote:
`Copy` types aren't really relevant to
On 2014-06-12, at 20:51, Patrick Walton pcwal...@mozilla.com wrote:
On 6/12/14 10:46 AM, Tommi wrote:
`Copy` types aren't really relevant to a discussion about adding to
Rust the C++ like optimization of moving rvalues (of non-Copy types)
when they're passed to certain functions.
There's
Sorry, Im a little new to Rust, but I'm,as many, now considering moving
from c++ to Rust and the topic is really important for my tasks.
Could you give an Rust example for the concern listed above?
Thank you!
On Jun 12, 2014 9:51 PM, Patrick Walton pcwal...@mozilla.com wrote:
On 6/12/14 10:46
On 2014-06-12, at 20:59, Corey Richardson co...@octayn.net wrote:
Implicit cloning is a non-starter. Clones can be very expensive.
Hiding that cost is undesirable and would require adding Clone to the
language (it's currently a normal library feature).
But I think it will be easy to make the
On 6/12/14 11:15 AM, Tommi wrote:
On 2014-06-12, at 20:59, Corey Richardson co...@octayn.net
mailto:co...@octayn.net wrote:
Implicit cloning is a non-starter. Clones can be very expensive.
Hiding that cost is undesirable and would require adding Clone to the
language (it's currently a normal
On 2014-06-12, at 21:15, Patrick Walton pcwal...@mozilla.com wrote:
On 6/12/14 11:15 AM, Tommi wrote:
On 2014-06-12, at 20:59, Corey Richardson co...@octayn.net
mailto:co...@octayn.net wrote:
Implicit cloning is a non-starter. Clones can be very expensive.
Hiding that cost is undesirable
For some reason I got really side-tracked here. The whole point of that
`stable` keyword I proposed was not syntax sugar, but that it allows the
implementor of such a trait to pass by reference when the operator shouldn't
move the passed in argument(s). Like, when you multiply two matrices and
On Wed, Jun 11, 2014 at 1:26 PM, Ian Daniher explodingm...@gmail.com
wrote:
Output of make check for those of you who are interested.
failures:
[run-pass] run-pass/intrinsic-alignment.rs
[run-pass] run-pass/rec-align-u64.rs
These are failing because it seems like we just overlooked
We have a ragel backend. https://github.com/erickt/ragel
On Thu, Jun 12, 2014 at 3:28 PM, richo ri...@psych0tik.net wrote:
On 11/06/14 15:43 +0900, Akira Hayakawa wrote:
Hi,
Haskell's Parsec is really a good tool to parse languages.
Scala also has the equivalent.
What about Rust?
On 12/06/14 15:31 -0700, Corey Richardson wrote:
We have a ragel backend. https://github.com/erickt/ragel
Ask and ye shall receive. Amazing! \o/
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
It's not possible to directly write a Parsec port because we don't
have HKT and therefore monads. Ragel is probably the best bet for now.
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
25 matches
Mail list logo