An interview about Scala

2009-04-04 Thread bearophile
"A Conversation with Steve Jenson, Alex Payne, and Robey Pointer" by Bill Venners, April 3, 2009, about the Scala language: http://www.artima.com/scalazine/articles/twitter_on_scala.html Scala is one of the few modern languages (like C#, F#, Clojure) that deserve to be followed by D designers.

Re: Proposal: fixing the 'pure' floating point problem.

2009-04-04 Thread Philip Miess
of course my example makes no sense try pure float square(float x, invariant roundingMode round = default) { return x*x; } in case that helps Phil

Re: Proposal: fixing the 'pure' floating point problem.

2009-04-04 Thread Philip Miess
Walter Bright wrote: Don wrote: That's true, but if you're in a floatingpoint module, and you call a non-floatingpoint module, it's your responsibility to make sure that the rounding mode is back to normal. You're saying that you don't care about the status flags. So it's your own fault if you

Re: Andrei's interface requests

2009-04-04 Thread Kagamin
Andrei Alexandrescu Wrote: > > I grant that it would be quicker and clearer to write: > > interface Foo > > { > >static void stuff(); > >this (int); > > } > > template Template(Arg : Foo) {} > > > > than to write: > > template Template(Arg) if (is (typeof (new Arg(0)) && > > isStaticFunc

Re: What Scala?

2009-04-04 Thread Georg Wrede
Walter Bright wrote: Georg Wrede wrote: OTOH, to make things really happen, we need the other kind of guys. Those of us who want to understand. They're the ones who advance the state of the art, and without that, we'd still be traveling on steam trains. I just wish there were more schools and

Re: Andrei's interface requests

2009-04-04 Thread Kagamin
Kagamin Wrote: > 1. If template constraints suck, why not fixing *them*? There were so many proposals... For example my :) compile time reflection api will be much more flexible and readable than any declarational syntax and with it you can throw away that declarational burden from parser.

Re: Link Problem

2009-04-04 Thread TomD
TomD Wrote: > After a couple of miniutes googling around this seems > to be a bug in ld. Some aritlcles from 2007 or so > recommend to downgrade to binutils 2.15 from 2.16. > *If* your installed binutils is 2.16, you may give it a try. > > Ciao > Tom After a bit harder googling I found http://

Re: Andrei's interface requests

2009-04-04 Thread Denis Koroskin
On Sat, 04 Apr 2009 16:49:23 +0400, Kagamin wrote: Andrei Alexandrescu Wrote: > I grant that it would be quicker and clearer to write: > interface Foo > { >static void stuff(); >this (int); > } > template Template(Arg : Foo) {} > > than to write: > template Template(Arg) if (is (typeo

Re: Andrei's interface requests

2009-04-04 Thread Andrei Alexandrescu
Kagamin wrote: Andrei Alexandrescu Wrote: I grant that it would be quicker and clearer to write: interface Foo { static void stuff(); this (int); } template Template(Arg : Foo) {} than to write: template Template(Arg) if (is (typeof (new Arg(0)) && isStaticFunction!(Arg, "stuff")) {} Ya

Re: What Scala?

2009-04-04 Thread Georg Wrede
Walter Bright wrote: dsimcha wrote: == Quote from Walter Bright ([email protected])'s article Nick Sabalausky wrote: If there's one thing my school experience taught me, it's that teachers are only interested in focusing on the low-to-mid-range students. That wasn't my college experi

Re: What Scala?

2009-04-04 Thread Georg Wrede
Walter Bright wrote: Nick Sabalausky wrote: Well, when it comes to college, what you're paying for are the classes and the degree (and, of course, books/room/board). So I'm certainly going to measure it's worth with that in mind. Having a dinner with Carl Segan, as great as he was, is hardly w

Re: Stack tracing on Linux ?

2009-04-04 Thread Jérôme M. Berger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Fawzi Mohamed wrote: > On 2009-04-02 21:18:55 +0200, Sean Kelly said: > >> == Quote from Georg Wrede ([email protected])'s article >>> Fawzi Mohamed wrote: The tracing of tango svn version (that uses libc backtrace) seems to work rath

Re: What Scala?

2009-04-04 Thread Georg Wrede
Sean Kelly wrote: Walter Bright wrote: Multiple choice exams were against the rules at Caltech (even though we did have a few huge lecture-based classes). I'll still hold forth, however, that you're going to get out of it what you are willing to put into it. If you're only going to target

Re: Andrei's interface requests

2009-04-04 Thread Kagamin
Andrei Alexandrescu Wrote: > > 1. If template constraints suck, why not fixing *them*? > > That's a fix. This is a fix to interfaces, not to template constraints. If template constraints fail to serve their purpose, what are they for? Make them work, not others to work for them.

Re: Andrei's interface requests

2009-04-04 Thread Denis Koroskin
On Sat, 04 Apr 2009 01:13:09 +0400, Andrei Alexandrescu wrote: Christopher Wright wrote: Andrei has put up a few enhancement requests in the bugzilla: http://d.puremagic.com/issues/show_bug.cgi?id=2784 http://d.puremagic.com/issues/show_bug.cgi?id=2785 http://d.puremagic.com/issues/show_bug.c

Re: Andrei's interface requests

2009-04-04 Thread Kagamin
Denis Koroskin Wrote: > interface Foo > { > this(int i); > typedef Bar; > } > > Foo foo = new Foo(42); // huh? > Foo.Bar x; //what's x.typeof? I think, template will accept type T:Foo that satisfies concept Foo and T foo=new T(42); T.Bar x;

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread Georg Wrede
grauzone wrote: But my point was that variadic templates can be ideal wrappers for the non-templated variadics, which can be virtual. It's the best of both worlds, you get no bloating and comfortable calling syntax too. The problem is: you can't go back. Here I use runtime as synonym for pass

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread grauzone
Very funny.

Re: Proposal: fixing the 'pure' floating point problem.

2009-04-04 Thread Denis Koroskin
On Sat, 04 Apr 2009 15:19:46 +0400, Philip Miess wrote: of course my example makes no sense try pure float square(float x, invariant roundingMode round = default) { return x*x; } in case that helps Phil I don't see roundingMode used anywhere in your example.

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread Georg Wrede
Andrei Alexandrescu wrote: void foo_templated(T...)(T args) { Variant[args.length] dynatyped; foreach (i, arg; args) dynatyped[i] = arg; return foo(dynatyped); } void foo(Variant[] dynatyped...) { ... } Hmm. An idiom. My sweet tooth just got thirsty for syntactic sugar!

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread Georg Wrede
Andrei Alexandrescu wrote: Christopher Wright wrote: Andrei Alexandrescu wrote: Jarrett Billingsley wrote: On Fri, Apr 3, 2009 at 11:20 AM, Andrei Alexandrescu wrote: You can't. D's varargs suck. Of course you can. Where did that come from? void foo(T...)(T args) { bar(args); } void bar(

Re: what prevents dynamic array from being deprecated & tuple being

2009-04-04 Thread Andrei Alexandrescu
bearophile wrote: davidl: Something like following can substitute dynamic array: struct da(T){ T* ptr; int len, capacity; T opIndex(int i){} ... On 32 bit systems that struct is 3*4 bytes long, but the current GC allocates small sizes using blocks of memory long as powers of 2,

VTable Benchmarking

2009-04-04 Thread Michel Fortin
In February I proposed a few ideas to make the virtual call ABI non-fragile. In the last two months I've built a small benchmark program to check the actual performance impact it'd have. Now I have the results. Unfortunatly, I can't pretend they're very reliable, but I want to share them. Here'

Re: Andrei's interface requests

2009-04-04 Thread Robert Jacques
2784: interface Foo { typedef Bar; } - confused me for a while, so a clearer description might be nice -- i.e. clarify that something like 'new I.bar()' is invalid. - seems only to be useful as part of the other contract-like interface enhancements -- Like 2786 & 2785 below, this creates a diffe

Re: Andrei's interface requests

2009-04-04 Thread Christopher Wright
Kagamin wrote: Andrei Alexandrescu Wrote: 1. If template constraints suck, why not fixing *them*? That's a fix. This is a fix to interfaces, not to template constraints. If template constraints fail to serve their purpose, what are they for? Make them work, not others to work for them. T

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread Christopher Wright
Andrei Alexandrescu wrote: void foo_templated(T...)(T args) { Variant[args.length] dynatyped; foreach (i, arg; args) dynatyped[i] = arg; return foo(dynatyped); } void foo(Variant[] dynatyped...) { ... } Andrei Okay, that's a reasonable solution, except that it doesn't work with in

Re: Andrei's interface requests

2009-04-04 Thread Andrei Alexandrescu
Denis Koroskin wrote: I'm not sure I understand everything you intend so lets clear things a little. I agree there should be a way to enforce struct to implement some.. contract. But I believe you took a wrong way by using pseudo-interface inheritance. First of all, it's called Concept in C+

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread Andrei Alexandrescu
Georg Wrede wrote: Andrei Alexandrescu wrote: void foo_templated(T...)(T args) { Variant[args.length] dynatyped; foreach (i, arg; args) dynatyped[i] = arg; return foo(dynatyped); } void foo(Variant[] dynatyped...) { ... } Hmm. An idiom. My sweet tooth just got thirsty for syntacti

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread Andrei Alexandrescu
Christopher Wright wrote: Andrei Alexandrescu wrote: void foo_templated(T...)(T args) { Variant[args.length] dynatyped; foreach (i, arg; args) dynatyped[i] = arg; return foo(dynatyped); } void foo(Variant[] dynatyped...) { ... } Andrei Okay, that's a reasonable solution, except th

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread grauzone
Andrei Alexandrescu wrote: Georg Wrede wrote: Andrei Alexandrescu wrote: void foo_templated(T...)(T args) { Variant[args.length] dynatyped; foreach (i, arg; args) dynatyped[i] = arg; return foo(dynatyped); } void foo(Variant[] dynatyped...) { ... } Hmm. An idiom. My sweet tooth j

Re: Proposal: fixing the 'pure' floating point problem.

2009-04-04 Thread Don
Philip Miess wrote: Walter Bright wrote: Don wrote: That's true, but if you're in a floatingpoint module, and you call a non-floatingpoint module, it's your responsibility to make sure that the rounding mode is back to normal. You're saying that you don't care about the status flags. So it's

Re: What Scala?

2009-04-04 Thread Sean Kelly
Walter Bright wrote: Nick Sabalausky wrote: Well, when it comes to college, what you're paying for are the classes and the degree (and, of course, books/room/board). So I'm certainly going to measure it's worth with that in mind. Having a dinner with Carl Segan, as great as he was, is hardly w

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread superdan
Jarrett Billingsley Wrote: > On Fri, Apr 3, 2009 at 6:09 PM, eljay wrote: > > Hi Jarrett, > > > > Thanks for the information (I've read quite a few responses further into > > this thread). > > > > I thought I was missing something, but this appears to be an area in D that > > could use some imp

Variant[string] associative array ... fail?

2009-04-04 Thread Eljay
Hi everyone, This code works... -- import std.variant; import std.stdio; void main() { Variant v; v = "hello"; writeln(v); } -- But this code does not... -- import std.variant; import std.stdio; void main() { Variant[string] v;

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread Andrei Alexandrescu
grauzone wrote: Andrei Alexandrescu wrote: Georg Wrede wrote: Andrei Alexandrescu wrote: void foo_templated(T...)(T args) { Variant[args.length] dynatyped; foreach (i, arg; args) dynatyped[i] = arg; return foo(dynatyped); } void foo(Variant[] dynatyped...) { ... } Hmm. An idiom.

Re: Variant[string] associative array ... fail?

2009-04-04 Thread Walter Bright
Is it this one? http://d.puremagic.com/issues/show_bug.cgi?id=2451

Re: Variant[string] associative array ... fail?

2009-04-04 Thread Andrei Alexandrescu
Eljay wrote: Hi everyone, This code works... -- import std.variant; import std.stdio; void main() { Variant v; v = "hello"; writeln(v); } -- But this code does not... -- import std.variant; import std.stdio; void main() { Varia

Re: Andrei's interface requests

2009-04-04 Thread Yigal Chripun
On 04/04/2009 17:41, Denis Koroskin wrote: I'm not sure I understand everything you intend so lets clear things a little. I agree there should be a way to enforce struct to implement some.. contract. But I believe you took a wrong way by using pseudo-interface inheritance. First of all, it's ca

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread grauzone
Andrei Alexandrescu wrote: grauzone wrote: Andrei Alexandrescu wrote: Georg Wrede wrote: Andrei Alexandrescu wrote: void foo_templated(T...)(T args) { Variant[args.length] dynatyped; foreach (i, arg; args) dynatyped[i] = arg; return foo(dynatyped); } void foo(Variant[] dynatyped...)

Re: What Scala?

2009-04-04 Thread superdan
Sean Kelly Wrote: > Walter Bright wrote: > > Nick Sabalausky wrote: > >> Well, when it comes to college, what you're paying for are the classes > >> and the degree (and, of course, books/room/board). So I'm certainly > >> going to measure it's worth with that in mind. Having a dinner with > >>

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread Andrei Alexandrescu
grauzone wrote: Consider if opImplicitCastFrom was implemented and you had a function "void foo(Variant[] x...)", would it be possible to pass a Variant[] to it, that will be directly used as "x"? For example: void foo(Variant[] x...) { writefln(x); } Variant[] t = [1,2,3]; foo(t); Yah

Re: Andrei's interface requests

2009-04-04 Thread Yigal Chripun
Also, I don't understand why D needs a separate syntax for primitive types. I don't like this whole "alias this" idea. why can't we just use: struct S : int { ... } after all, that exactly what's that feature is trying to do, isn't it?

Mixin mystic

2009-04-04 Thread Georg Wrede
On December 14, Nick Sabalausky wrote: > That explains a certain mystery I encountered in a library I wrote. > Everything *seemed* like it should have worked with "scope" instead > of "auto" but it never did. The variables that were mysteriously > unconvertable to "scope" were declared in a mixin.

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread grauzone
Andrei Alexandrescu wrote: grauzone wrote: Consider if opImplicitCastFrom was implemented and you had a function "void foo(Variant[] x...)", would it be possible to pass a Variant[] to it, that will be directly used as "x"? For example: void foo(Variant[] x...) { writefln(x); } Variant[

Re: Andrei's interface requests

2009-04-04 Thread grauzone
bearophile wrote: Yigal Chripun: Also, I don't understand why D needs a separate syntax for primitive types. Generally D can work some more in the direction of unifying primitive types and objects. Some of it can be done with no performance price to pay. Like which? Bye, bearophile

Re: Andrei's interface requests

2009-04-04 Thread bearophile
Yigal Chripun: > Also, I don't understand why D needs a separate syntax for primitive types. Generally D can work some more in the direction of unifying primitive types and objects. Some of it can be done with no performance price to pay. Bye, bearophile

Re: Andrei's interface requests

2009-04-04 Thread Robert Jacques
On Sat, 04 Apr 2009 15:38:03 -0400, grauzone wrote: bearophile wrote: Yigal Chripun: Also, I don't understand why D needs a separate syntax for primitive types. Generally D can work some more in the direction of unifying primitive types and objects. Some of it can be done with no performan

Re: Variant[string] associative array ... fail?

2009-04-04 Thread Eljay
> Hey Eljay, thanks for being around :o). It's good you raise scrutiny > about the dynamic style of coding in D. The code is correct but subject > to a compiler bug: > > http://d.puremagic.com/issues/show_bug.cgi?id=2451 > > I just voted that up (it's supposed to raise its informal importance),

Re: Mixin mystic

2009-04-04 Thread Nick Sabalausky
"Georg Wrede" wrote in message news:[email protected]... > On December 14, Nick Sabalausky wrote: > > That explains a certain mystery I encountered in a library I wrote. > > Everything *seemed* like it should have worked with "scope" instead > > of "auto" but it never did. The variable

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread Michel Fortin
On 2009-04-03 08:43:48 -0400, Eljay said: Hi Michel, Thanks for the tip on D-style variadic. I'll give those a spin. And you are spot on with what I want to be able to do. Objective-C, with C replaced by D. (Hmmm, I think #1 slipped in from my Borland CScript days.) I'm not exactly sur

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread Christopher Wright
Andrei Alexandrescu wrote: Christopher Wright wrote: Andrei Alexandrescu wrote: void foo_templated(T...)(T args) { Variant[args.length] dynatyped; foreach (i, arg; args) dynatyped[i] = arg; return foo(dynatyped); } void foo(Variant[] dynatyped...) { ... } Andrei Okay, that's a re

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread Andrei Alexandrescu
Christopher Wright wrote: Andrei Alexandrescu wrote: Christopher Wright wrote: Andrei Alexandrescu wrote: void foo_templated(T...)(T args) { Variant[args.length] dynatyped; foreach (i, arg; args) dynatyped[i] = arg; return foo(dynatyped); } void foo(Variant[] dynatyped...) { ... }

Re: Objective-D, reflective programming, dynamic typing

2009-04-04 Thread Daniel Keep
Christopher Wright wrote: > ... > > I don't find that this is the case. I implemented a Variant type that > can be created from a void* and a typeinfo -- I had to, since tango's > Variant doesn't support this (and, incidentally, because there is no way > to get a representation of the data insid

Multithreaded I/O in the DMD compiler (DDJ article by Walter)

2009-04-04 Thread Daniel Keep
http://dobbscodetalk.com/index.php?option=com_myblog&show=Multithreaded-I-O.html&Itemid=29 -- Daniel P.S. "It really seems barbaric in our digital age that we all have motors and levers and gears and spinning things in our boxes." Those damned spinning things!