On Saturday, 10 May 2014 at 11:43:29 UTC, Xavier Bigand wrote:
Le 10/05/2014 11:35, Douglas Peterson a écrit :
Rust is quite seductive (own point of view of course) in its
"traits"
system. They've found the right median line between OOP and
TMP. I mean
it's a realy nice concept.
Have you a d
It increases the complexity to reason about code.
No, that's wrong.
Why it is wrong?
Because it is much harder to reason about the same things without
type system support.
Le 10/05/2014 11:35, Douglas Peterson a écrit :
Rust is quite seductive (own point of view of course) in its "traits"
system. They've found the right median line between OOP and TMP. I mean
it's a realy nice concept.
Have you a direct link about traits? Cause I am almost unable to see
their tu
Rust is quite seductive (own point of view of course) in its
"traits" system. They've found the right median line between OOP
and TMP. I mean it's a realy nice concept.
Am 09.05.2014 21:53, schrieb Araq:
It increases the complexity to reason about code.
No, that's wrong.
Why it is wrong?
Even you ever seen a programmer reason about unique pointers, shared
pointers, weak pointers, naked pointers, references and cyclic data
structures without mistakes?
It increases the complexity to reason about code.
No, that's wrong.
If the compiler does not give an helping hand, bugs are too
easy to create.
Usually a type system is used to increase safety...
On Friday, 4 November 2011 at 03:14:29 UTC, bearophile wrote:
Through Reddit I've found two introductions to the system
language Rust being developed by Mozilla. This is one of them:
http://marijnhaverbeke.nl/rust_tutorial/
This is an alpha-state tutorial, so some parts are unfinished
and som
On Friday, 9 May 2014 at 04:55:28 UTC, Caligo via Digitalmars-d
wrote:
On Thu, Nov 3, 2011 at 10:43 PM, Walter Bright
wrote:
How do you implement a moving GC in D if D has
raw pointers?
It can be done if the D compiler emits full runtime type info.
It's a
solved problem with GCs.
D s
On Thu, Nov 3, 2011 at 10:43 PM, Walter Bright
wrote:
>
> How do you implement a moving GC in D if D has
>> raw pointers?
>>
>
> It can be done if the D compiler emits full runtime type info. It's a
> solved problem with GCs.
>
>
> D semantics doesn't allow the GC to automatically modify those
>
On 11/3/2011 9:14 PM, bearophile wrote:
Regarding pointer types, in D there are function pointers and function
delegates, they are kind of two different kinds of pointers already.
And their only saving grace is they are not used that often, so the complexity
is tolerable. This is not so for po
Walter Bright:
> You're wrong still :-)
In this newsgroup I am used to being wrong several times every day :-)
> It can be done if the D compiler emits full runtime type info. It's a solved
> problem with GCs.
I see, I will have to read more on this solution.
> Besides, having two pointer t
On 11/3/2011 8:14 PM, bearophile wrote:
Mark-compact (aka moving) collectors, where live objects are moved together
to make allocated memory more compact. Note that doing this involves
updating pointers’ values on the fly. This category includes semispace
collectors as well as the more efficient
I have found a slides pack, Rust All Hands Winter 2011, with some notes on
typestates too:
http://www.slideshare.net/pcwalton/rust-all-hands-winter-2011
And here there are some tests about macros too, search the word "macro":
https://github.com/graydon/rust/tree/master/src/test/run-pass
Bye,
bea
Through Reddit I've found two introductions to the system language Rust being
developed by Mozilla. This is one of them:
http://marijnhaverbeke.nl/rust_tutorial/
This is an alpha-state tutorial, so some parts are unfinished and some parts
will probably change, in the language too.
Unfortunatel
On 10/02/2011 00:23, bearophile wrote:
But in Rust there are typestates, so while a variable can't change type, its
type sometimes changes state along the flow of the code, such state of the type
may be different in different parts of the code
Hum, this typestate concept actually looks quite
On 2/11/11, Christopher Nicholson-Sauls wrote:
>
> Even better:
>
> switch( funcall() ) {
> case "foo", "bar", "foobar", "barfoo": {
> // complex code
> break;
> }
>
> case "blue", "green": {
> // complex code
> break;
> }
>
> default:
>
On 02/10/11 13:49, Andrej Mitrovic wrote:
> On 2/10/11, Walter Bright wrote:
>> auto x = (localtime().hours >= 8) ? "awake!" : "asleep, go away.";
>
> Aye, a one liner!
>
> I hate seeing things like this:
> if (funcall())
> {
> var = "foo";
> }
> else
> {
> var = "bar";
> }
>
> So much
spir Wrote:
> On 02/11/2011 08:39 AM, Jim wrote:
> > Jacob Carlborg Wrote:
> >
> >> On 2011-02-10 20:15, Walter Bright wrote:
> >>> Nick Sabalausky wrote:
> "bearophile" wrote in message
> news:iivb5n$na3$1...@digitalmars.com...
> > auto x;
> > if (localtime().hours>= 8) {
> >>>
On 02/11/2011 08:39 AM, Jim wrote:
Jacob Carlborg Wrote:
On 2011-02-10 20:15, Walter Bright wrote:
Nick Sabalausky wrote:
"bearophile" wrote in message
news:iivb5n$na3$1...@digitalmars.com...
auto x;
if (localtime().hours>= 8) {
x = "awake!"
} else {
x = "asleep, go away."
}
log "I'm " + x;
Jim Wrote:
> Jacob Carlborg Wrote:
>
> > On 2011-02-10 20:15, Walter Bright wrote:
> > > Nick Sabalausky wrote:
> > >> "bearophile" wrote in message
> > >> news:iivb5n$na3$1...@digitalmars.com...
> > >>> auto x;
> > >>> if (localtime().hours >= 8) {
> > >>> x = "awake!"
> > >>> } else {
> > >>>
On 2011-02-11 08:39, Jim wrote:
Jacob Carlborg Wrote:
On 2011-02-10 20:15, Walter Bright wrote:
Nick Sabalausky wrote:
"bearophile" wrote in message
news:iivb5n$na3$1...@digitalmars.com...
auto x;
if (localtime().hours>= 8) {
x = "awake!"
} else {
x = "asleep, go away."
}
log "I'm " + x;
Jacob Carlborg Wrote:
> On 2011-02-10 20:15, Walter Bright wrote:
> > Nick Sabalausky wrote:
> >> "bearophile" wrote in message
> >> news:iivb5n$na3$1...@digitalmars.com...
> >>> auto x;
> >>> if (localtime().hours >= 8) {
> >>> x = "awake!"
> >>> } else {
> >>> x = "asleep, go away."
> >>> }
> >
On 2011-02-10 20:15, Walter Bright wrote:
Nick Sabalausky wrote:
"bearophile" wrote in message
news:iivb5n$na3$1...@digitalmars.com...
auto x;
if (localtime().hours >= 8) {
x = "awake!"
} else {
x = "asleep, go away."
}
log "I'm " + x;
That would be really nice to have in D.
auto x = (lo
On 2/10/11, Walter Bright wrote:
> auto x = (localtime().hours >= 8) ? "awake!" : "asleep, go away.";
Aye, a one liner!
I hate seeing things like this:
if (funcall())
{
var = "foo";
}
else
{
var = "bar";
}
So much clutter instead of using the simple:
var = funcall() ? "foo" : "bar";
I
Nick Sabalausky wrote:
"bearophile" wrote in message
news:iivb5n$na3$1...@digitalmars.com...
auto x;
if (localtime().hours >= 8) {
x = "awake!"
} else {
x = "asleep, go away."
}
log "I'm " + x;
That would be really nice to have in D.
auto x = (localtime().hours >= 8) ? "awake!" : "a
Jean Crystof Wrote:
> How about this?
> spir Wrote:
>
> auto x =
> if (localtime().hours>= 8) {
> "awake!"
> } else {
> "asleep, go away."
> };
>
> log "I'm " + x;
>
> I think it solves the problem of unkown type for x nicely. And it's very
> close to what we already have. someth
On 2/10/11, spir wrote:
> I'm not a great fan of auto, neither, use it would happily live w/o it,
> except
> for functions operating on ranges, that return types coming from who-knows
> where (certainly another planet).
auto is great for rapid prototyping. And so are templated functions.
After I'
spir Wrote:
> On 02/10/2011 06:43 AM, Nick Sabalausky wrote:
> > "bearophile" wrote in message
> > news:iivb5n$na3$1...@digitalmars.com...
> >>
> >> auto x;
> >> if (localtime().hours>= 8) {
> >> x = "awake!"
> >> } else {
> >> x = "asleep, go away."
> >> }
> >> log "I'm " + x;
> >>
> >
>
On 02/10/2011 06:43 AM, Nick Sabalausky wrote:
"bearophile" wrote in message
news:iivb5n$na3$1...@digitalmars.com...
auto x;
if (localtime().hours>= 8) {
x = "awake!"
} else {
x = "asleep, go away."
}
log "I'm " + x;
That would be really nice to have in D. There's been many times I'
"bearophile" wrote in message
news:iivb5n$na3$1...@digitalmars.com...
>
> auto x;
> if (localtime().hours >= 8) {
>x = "awake!"
> } else {
>x = "asleep, go away."
> }
> log "I'm " + x;
>
That would be really nice to have in D. There's been many times I've needed
to move a declaration up
both the name and the operator of logging are very bad choices.
Oh '+' is string concat in Rust, and log is not that bad either!
Rust is statically typed, so this is an error, it's not possible (unless
you use some kind of variant):
Not quite clear in the example but just add an extra line after if block.
log "do you want to add strings or ints?";
auto use_str = input.readline == "strings";
if (use_str) {
a = "hell
The Development of the Rust language from Mozilla and Graydon Hoare is going
on. It will probably become a quite interesting system language, quite more
interesting than Go. One of the most interesting features of Rust will be its
typestate.
Rust has structural typing too, this is sometimes use
33 matches
Mail list logo