Rust switches to external iteration

Russel Winder russel at winder.org.uk
Thu Jul 4 00:20:05 PDT 2013


On Wed, 2013-07-03 at 22:04 -0700, Andrei Alexandrescu wrote:
> Evidence we've done the right thing by emphasizing ranges instead of 
> opApply.
> 
> http://www.reddit.com/r/programming/comments/1hl2qr/rust_07_released/
> https://mail.mozilla.org/pipermail/rust-dev/2013-June/004599.html

I am not sure you can make that deduction. The question of internal vs.
external iterators is not black and white. Both are needed. The question
is what is the balance of usage, and it depends on which level of the
programming "stack " you are at. People working on implementing
frameworks and APIs often need explicit iteration to realize their
abstractions, but can also use some internal iteration as that
abstraction works for them at that point. For applications programmers,
I would expect most of them to benefit from using internal iteration as
much as possible since they are users of frameworks and APIs, but the
availability 

The difficulty is that we have some serious inertia in the system.

Many programmers are still using 1970s approaches to programming, even
though they may be 20-something, because that is what they have been
taught to do. As long as they use sequence, selection and iteration that
is all they need.

At the other extreme there are the Lambda Calculus purists who try to
instil that you have to undertake the Category Theory analysis to
construction the point-free function compositions prior to writing any
code.

And neither of these groups worry about test coverage that much.

The goal has to be to write code that is appropriate to the task,
readable, comprehensible, testable and tested. It is all about Domain
Specific Languages (DSL). Any program that uses functions and procedures
is creating a DSL. Abstraction and DSL go hand in hand. We are giving a
concept a label and a meaning.

By trying to make internal vs external a black and white type argument,
we lose something from our toolkit. By trying to work on where is
internal appropriate, where is external appropriate, we move software
development on further. The whole object-oriented vs. generic vs.
functional vs. logic models, especially the OO vs. functional just now
is an important move of programming into the future.

FOOPLOG may have failed but Scala has brought programming to functional
AND object-oriented. Groovy, Kotlin, Ceylon, etc. are pushing at this as
well. It is all about the balance of use of internal and external
iteration not treating it as warfare. Python had its own consideration
of these issues in the Python 2 → Python 3 change.

Native still seems to be in the 1990s OO vs. functional war: internal OR
external. cf. C++, Go, D, Rust, Haskell, OCaml, F#, etc.

My current hypothesis is that the more abstract the DSL the more
internal iteration. Moving from implementation focus to goal focus
naturally introduces more implicit as the DSL becomes more abstract. 
 
But I get too serious and philosophical. It is perhaps because I have
just finished a two day workshop guiding people to consider these
questions in a very practical way so as to improve their software
development.
-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130704/21fd6ea8/attachment.pgp>


More information about the Digitalmars-d mailing list