Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: FredZarguna; Delphster
The one place where NO language has come anywhere close to C++ even now is in template metaprogramming and Generics.

This is incorrect; Ada has a wonderful generic system.
subprograms can be parametrized on a type (or other functions, ranges, tasks, values, packages, etc.), as can packages themselves; wikipedia has an entry about Ada's generic-system on it's generic programming page.

The consequence of the above is you can make programs with a high amount of safe reuse (decomposing common elements); for example:

  1. You can define an interface (or abstract base-type in Ada 95/2005/2012) for operating on via PostScript,
  2. You can make a generic package defining a type which uses the interface from #1,
  3. You can make another generic package defining a [type of] stack, instantiate it using objects of the interface from #1,
  4. you can make another generic package which takes the package [from #3], defines four [IIRC] stack-variables (two for working, two containing "dictionaries" for functions), and operations thereon
  5. and another containing the [rest of] general postscript commands
and you'd have a PostScript interpreter.


Now some people think that the template/metaprogramming ability is more powerful than the generic facility of Ada because it is Turing-complete; this is actually quite a step backward WRT safety -- because it is Turing-complete you can state your problem in the template itself, which is not guaranteed to finish (precisely because it is Turing-complete).

78 posted on 02/03/2013 12:09:42 PM PST by OneWingedShark (Q: Why am I here? A: To do Justly, to love mercy, and to walk humbly with my God.)
[ Post Reply | Private Reply | To 58 | View Replies ]


To: OneWingedShark

Sorry. I was discussing languages people actually use.


86 posted on 02/03/2013 9:29:50 PM PST by FredZarguna (Use it as you will. I Could NOT care less.)
[ Post Reply | Private Reply | To 78 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson