Jump to page: 1 26  
Page
Thread overview
Reddit: SafeD - The Safe Subset of D
Mar 23, 2008
Walter Bright
Mar 23, 2008
Bill Baxter
Mar 23, 2008
Walter Bright
Mar 23, 2008
Bjoern
Mar 25, 2008
Bill Baxter
Mar 25, 2008
Sean Kelly
Mar 23, 2008
Lars Ivar Igesund
Mar 23, 2008
Walter Bright
Mar 23, 2008
Lars Ivar Igesund
Mar 23, 2008
Charles D Hixson
Mar 23, 2008
Bill Baxter
Mar 23, 2008
Walter Bright
Mar 23, 2008
Charles D Hixson
Mar 24, 2008
Bruno Medeiros
Mar 25, 2008
Don Clugston
Mar 23, 2008
Clay Smith
Mar 23, 2008
Walter Bright
Mar 23, 2008
Clay Smith
Mar 24, 2008
Walter Bright
Mar 25, 2008
Georg Wrede
Mar 25, 2008
Walter Bright
Mar 25, 2008
Georg Wrede
Mar 25, 2008
Christopher Wright
Mar 25, 2008
Bruno Medeiros
Mar 24, 2008
Knud Soerensen
Mar 24, 2008
renoX
Mar 24, 2008
renoX
Mar 25, 2008
janderson
Mar 25, 2008
janderson
Mar 25, 2008
Dejan Lekic
Mar 25, 2008
Walter Bright
Mar 25, 2008
Charles D Hixson
Mar 25, 2008
Walter Bright
Mar 26, 2008
Georg Wrede
Apr 26, 2008
Jan Claeys
Mar 25, 2008
Chris Miller
Mar 25, 2008
Chris Miller
Mar 26, 2008
Chris Miller
Mar 26, 2008
Chris Miller
Mar 26, 2008
Brad Roberts
Mar 26, 2008
Chris Miller
Mar 31, 2008
Kevin Bealer
Mar 31, 2008
Simen Kjaeraas
Mar 31, 2008
Kevin Bealer
Mar 31, 2008
Kevin Bealer
Mar 31, 2008
e-t172
Mar 31, 2008
Sean Kelly
Mar 31, 2008
Kevin Bealer
Mar 25, 2008
Lutger
Mar 25, 2008
Walter Bright
Mar 26, 2008
Roberto Mariottini
Mar 26, 2008
Alexander Panek
Mar 31, 2008
Don Clugston
Apr 03, 2008
Walter Bright
March 23, 2008
http://reddit.com/r/programming/info/6d210/comments/
March 23, 2008
Walter Bright wrote:
> 
> http://reddit.com/r/programming/info/6d210/comments/

Is this something that actually exists?  Or just an idea being thrown around? Or just a marketing slogan for using D without pointers?

-bb
March 23, 2008
Bill Baxter wrote:
> Is this something that actually exists?  Or just an idea being thrown around? Or just a marketing slogan for using D without pointers?

It's an idea for defining a language subset that is enforceable by the compiler.
March 23, 2008
Walter Bright schrieb:
> Bill Baxter wrote:
>> Is this something that actually exists?  Or just an idea being thrown around? Or just a marketing slogan for using D without pointers?
> 
> It's an idea for defining a language subset that is enforceable by the compiler.

... in other words, an upcoming compiler switch ?
I like that idea very much.
March 23, 2008
Walter Bright wrote:

> 
> http://reddit.com/r/programming/info/6d210/comments/

In light of this I find it rather incredible that printf still is exposed through Object.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource, #d.tango & #D: larsivi
Dancing the Tango
March 23, 2008
Walter Bright wrote:
> 
> http://reddit.com/r/programming/info/6d210/comments/

http://www.digitalmars.com/d/2.0/safed.html

A bit light on the syntax, but I completely agree with avoiding pointers whenever possible.  Unchecked casts and unions are also clearly dangerous, if less so.

Unfortunately, unchecked casts seem to be necessary for some purposes.   It's not just efficiency, I literally don't see any way around them.  (I'm considering a union to be a kind of unchecked cast.)

P.S.:  What is a checked cast?  If I want to consider a long as an array of bytes:
byte[long.sizeof]  val;
it ought to be safe to later consider that array of bytes as a long.  But what's a safe (checked) way to do it?  (I'm not talking about conversion.  I don't want to end up with an array of longs.)

PPS:  When talking about casts or type conversions, please make it explicit whether the same bit pattern is maintained. I often read those descriptions, and realize that I can't figure out exactly what is happening.  With C I was always certain that I was just telling the compiler to think about the same piece of memory differently, and that nothing actually changed.  With more modern languages, a lot more magic happens under the hood, and I'm no longer as certain what's going on.  I often wonder after reading the documentation whether the same bit pattern is maintained, or whether an equivalent value is produced.  E.g., I've never tried casting a float to a long.  What would it produce?  I can't predict.  I'd often prefer to deal with ulongs or ucents rather than byte arrays, but then at other times I need to address particular bytes out of that value.  Because I don't really understand a cast, I just use byte arrays (well, ubyte).  But it's "sloppier".  Generally I'm dealing with a unitary entity, and needing to think of it as an array all the time is uncomfortable.  (I'd even like a notation for dealing with particular bits, though I haven't needed that recently.)
Note that this isn't a request for a change in how things act, but rather in how they are documented.
I *suspect* that cast is presumed to be defined by C, and that it means "Think about they type differently, but don't change it's bit pattern", but I'm never quite certain.
March 23, 2008
Walter Bright wrote:
> 
> http://reddit.com/r/programming/info/6d210/comments/

Is SafeD just a label for the programmer selectively using D features?

March 23, 2008
Charles D Hixson wrote:
> With C I was always certain that I was just telling the compiler to think about the same piece of memory differently, and that nothing actually changed.  

Not so:
   int x = (int)2.5;

Not the same bit pattern after as before (not even if it was 2.0 on the right).  But maybe you're only talking about casts with pointers in them?

--bb
March 23, 2008
Lars Ivar Igesund wrote:
> In light of this I find it rather incredible that printf still is exposed
> through Object.

printf would have to be removed from the safe D subset.
March 23, 2008
Clay Smith wrote:
> Is SafeD just a label for the programmer selectively using D features?

Yes, but it would also be enforced by a compiler switch.
« First   ‹ Prev
1 2 3 4 5 6