Iota in C++ 
Author Message
 Iota in C++

I found it interesting to learn that the C++
Standard Template Library includes a function
called iota, which they clearly indicate was
taken from APL.  See :
http://www.*-*-*.com/

This makes me wonder how many other cases
there are of APL features being borrowed by
writers of libraries for mainstream programming
languages.

I have been wondering for some time if by
implementing APL arrays in a language such as
C++ one could obtain much of the convenience
and flexibility of APL with better execution speed.

--- Brian



Tue, 10 Apr 2001 03:00:00 GMT  
 Iota in C++

Quote:

> I found it interesting to learn that the C++
> Standard Template Library includes a function
> called iota, which they clearly indicate was
> taken from APL.  See :
> http://www.sgi.com/Technology/STL/index.html

> This makes me wonder how many other cases
> there are of APL features being borrowed by
> writers of libraries for mainstream programming
> languages.

Yes. Look at fortran90. It contains, among other things:
   scalar functions defined on arrays
   reductions
   several other primtives, such as rotate
   However, they don't have the generality of APL. For example,
   you get only about 6 reductions (plus, times,max,min,or, and),
   and the semantics are quite ugly. Look at my SIGPLAN Notices critique

   in Feb 1991.

Quote:

> I have been wondering for some time if by
> implementing APL arrays in a language such as
> C++ one could obtain much of the convenience
> and flexibility of APL with better execution speed.

Look at the work being done by Sven-Bodo Scholz and his colleagues
at University of Kiel on SAC: Sven-Bodo comes from a functional
programming background, and so he took a functional subset of C
(no pointers, etc), extended it to make it really functional by adding
multiple returns, etc., then added array primitives to that.

The APL98 Conference Proceedings have one of his articles in it.
I'm in the process of adding a new backend to the APEX APL compiler
to crank out SAC code, as it looks like it'll solve (eventually) some
of the remaining performance problems in APEX.

I see SAC's main value as being a stepping-stone from scalar languages
to
array languages for the (great unwashed) masses of C programmers out
there,
without requiring that they:
    - suffer the dismal performance of interpreted code on iterative
algorithms
    - suffer the heavy learning curve of an entirely new language
    - suffer the difficulty of mixing array language code with
preexisting
      code

Bob



Thu, 19 Apr 2001 03:00:00 GMT  
 Iota in C++

Quote:

>1. Does anyone have a J verb that counts the number of days between
>two dates?

   load'dates'

   -/todayno 1998 12 25 ,: 1965 7 15
12216

Quote:
>2. I am getting an "out of memory" error on my J program.
>I want to avoid this message. Would buying more memory for my
>machine help? (I am running J3 on a Mac PowerPC).

In general, the more memory the better, but it
does depend on what you are doing. Can you
be more specific?


Fri, 20 Apr 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Gauss, +/(0={quad}io)+{iota}100

2. Iota slow as hell

3. Dyadic Iota with Scan Sum

4. almost dyadic iota, but not quite

5. C++ question for Smalltalk/C++ programmers

6. NYC C++ mtg 9/7/95 Building a C++ Class Library

7. C++ or (Smalltalk and C++)?

8. to CS: or not to CS: in F-PC assembler

9. Cellular automata benchmarks: Java vs C++ vs Java vs C++

10. Request advice about C++ and Visual C++ topics

11. Migrating from UNIX C++ to MVS C++

12. Translations from Scheme to C++ as aid to teaching C++ after Scheme

 

 
Powered by phpBB® Forum Software