The stately := operator feature proposal

someone someone at gmail.com
Thu May 30 07:55:37 PDT 2013


Please think about the huge math and science community. Most of 
them I came across like D for its speed and efficiency. But D can 
never replace Matlab/Octave/Ipython/Scipy because ....

.. of the messy syntax compared to almost math like syntax above 
languages offer.

For example, if I want to quickly want to plot something, in 
Octave I would do:

x = linspace(0, 2*pi, 1000);
y = sin(x);
plot(x, y)


now, how to do that in D (assuming proper libs are already 
imported):

auto x = linspace(0, 2*pi, 1000);
auto y = sin(x);
plot(x, y)


the "auto" keyword seems to be a distraction. Compare it with the 
following code:

x := linspace(0, 2*pi, 1000);
y := sin(x);
plot(x, y)

For a code of several lines or 100s of lines auto becomes too 
much of a distraction. Especially when I want to quickly write a 
code to analyze some data I want the code to look like math as 
much as possible and not get distracted by too many language 
constructs.

You can say that D was never designed for that purpose, well, too 
bad then. D has so much potential to replace python/octave/matlab 
for math/scientific computing. Please give this a thought before 
dismissing the idea.



More information about the Digitalmars-d mailing list