Functions abstractly represented by objects and compilers
From: Piotr Sawuk (piotr5_at_unet.univie.ac.at)
Date: 02/07/04
- Next message: Tak To: "Re: Iterators redux"
- Previous message: David Lightstone: "Re: TDD: Test-Driven Design or Test-Driven Development?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Feb 2004 10:00:43 GMT
now I probably will argue from ignorance, but I have thought some time
about my problem with functions as OOP-objects and found that the best
solution would be: take the sources of a compiler and alter them for
the needs of my application (even including some compiler-snippets and
methods, as suggested in some like I got drawn attention to by a response
to my original question). it seems for mathematics the ideas of OOP are
not sufficient, one needs an extended OOP-model allowing for infinite
inheritance, automatic object-definitions from a template (with higher
complexity than mere type-name substitution), automatic translation of
abstract object-definitions into concrete object-generating classes who's
abstract class-definition is the mentioned object-template, standardized
function-parameters (i.e. parameters are not treated as a list but as
a mapping between name and value), dynamic class-definition (by reusing
old class-definitions and modifying them) and maybe even some means of
altering the generated assembler-code for optimization. all these things
could easily be done by writing a compiler in a script-based language
(object-oriented of course) and allowing for some of the compiler's
methods to get altered by the sourcecode it compiles. what do you think?
does anyone know of such attempts? is it a new idea to add abstraction
layers to the single layer OOP does offer? are there any projects into
that direction? practical applications of math do get a lot of attention
from the programming-language designers, but as far as I can see all
the theoretical applications of math need special code-generating tools
to be written, or else the resulting program is simply much too slow
and difficult to maintain. since compilers are not optimized for the
mathematical optimizations of highly mathematical code :-)...
one problem I did encounter is that optimizing an algorithm for speed
does require writing code-generating programs, and the more optimization
one does wish, the stronger is the code's inseperability from the
underlying problem, the more difficult it will become to actually
change a small part of the problem because of more work needed to
be dode. a program creating sources does rely on a certain structure
of the problem, and changing this structure by including new constraints
or making the problem more general does make the code-generating
code useless, as a different optimization-method needs to be used.
another problem is seperation of error-checking of source-code
from actual binary compilation. the usual compiler's input looks
like some sort of coding-theory applied on raw thoughts (especially
in the functional languages I did learn about here). the programmer
has 2 tasks: optimizing algorithms and making them error-free.
but yet those 2 tasks are done with one tool: the programming-language.
for example in C++ inheritance means 2 things: that the new object
will automatically (and efficiently) be casted to function as a
drop-in replacement of the old object it did inherit from, and that
the new object actually shares code and structure with the old object.
besides of inheritance there also is object-instantiation, which
too describes a dependency between 2 data-structures which share
one class-definition. those two things together describe some sort
of order on the question of which data-structures can be used in
place of which. to make things more complicated C++ also does declare
some things as public and some as private or protected, in order to
describe some hierarchy of who can access which functions (another
ordering gets described which somewhat is related to the inheritance
ordering). this paradigm is not maintainable when the amount of parties
involved in programming get increased (i.e. open source). more people
means more groups of methodologies to get seperated from eachother
through some sort of abstraction-layer, and this abstraction-layer
does only involve the error-checking and not the actual creation
of binaries from source. so we need an error-checking layer, another
layer for code-optimization (probably again seperated into mathematical
transformation of the underlying algorithms handled seperately from
the search for optimal use of assembler-language which again can very
well be application-specific since no compiler is able to take all
possible obscure assembler-commands into account when analyzing what
the code is supposed to do), another layer for code-reuse and binary
compatibility (especially the dreaded wrapper-functions which needs
to be written when using 3rd-party libraries), and another layer for
the lazy programmers who wish to just write down their thoughts as
a program as dome in those lazy functional languages. so basically
one should need 4-6 tools for creating a program, but yet all those
needs are supposed to get fulfilled by a single compiler and a single
source-code file-format. doesn't that ring wrong to someone? how many
object-oriented programming-languages are there optimized for processing
of text or text-alike data? how many are there optimized for custom
designed algebraic transformations (i.e. where the normal rules of
real-numbers and such do not neccessarily apply)? how many programming
languages are specialized for transforming a mathematical formula
into the source-code of an algorithm? how many programs do exist which
would check a program for errors thereby turning ancient programming
languages into "object-oriented" ones with strong type-checking?
how many of those tools exist for the assembler-language (apart
from the inline-assembler of C++)? how many tools do exist for
modifying a compiler's output-assemblercode according to custom
optimization-rulesets while taking the original source-code into
account? all those tools would help to build such a layered development
if unified into a new extension of the OOP-idea, but for example
in the area of text-processing I haven't found much object-oriented
preprocessors, even perl doesn't seem to support class-definitions
stored in datafiles which aren't available during program-creation
(which is needed in order to offer an object-oriented preprocessor).
as far as I can see this is a newsgroup specialized in database-objects
and not into the very abstraction of programs, but I hope that at
least someone might get interested in answering my questions and
commenting on my ideas. as I said, I know nearly nothing about
Object-oriented programming and the ideas behind it, all I know
is that mathematical objects can not get represented easily. again
I ask: where there discussions and thoughts into the same direction
as the topic I discussed here? is anyone working on some of the
programs I outlined above? or is the development a few steps more
ahead of my little thoughts and there where better solutions offered
than my two proposals?
please reply to this thread, or at least put the word "abstract"
into the subject, since I am reading this group through a filter
because of the high traffic in-here. and for the same reasons also
excuse when I obviously am lacking knowledge about the things
discussed in other threads. also I didn't read much books on
that topic, so I am greatful for any links someone could provide
or commonly used basics-books on those topics which can be found
in some local library...
dependencies between modules
-- Better send the eMails to netscape.net, as to evade useless burthening of my provider's /dev/null... before complaining because of my rudeness, read http://www.unet.univie.ac.at/~a9702387/en/adl/liar-faq.txt and killfile me... P
- Next message: Tak To: "Re: Iterators redux"
- Previous message: David Lightstone: "Re: TDD: Test-Driven Design or Test-Driven Development?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|