[unios] Re: Semantic-based linking
Anders Petersson
anders.petersson@mbox320.swipnet.se
Sat, 26 Dec 1998 21:02:50 +0100
From: Anders Petersson <anders.petersson@mbox320.swipnet.se>
At 1998-12-25 , you wrote:
>From: Tril <dem@tunes.org>
>
>
>> If you implement something that is useful in more than one app, you can
>> let everybody that codes for the OS take advantage of it... yes, DLL's
>> do that too, but by using interfaces, others can even find the new
>> possibilities by simply looking at what the objects can do (the
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> supported interfaces and their functions), and use them directly throu
>> the scripting language. If the new features conforms to standard
>> interfaces, other applications will know how to use them, without
>> upgrades.
>
>I'm glad someone else sees the importance of this. Easier said than done,
>though. In order to use a function based on what it does, you have to
>have a high level description of what it does.
>
>So for instance, the assignment operator has to have, as part of its type
>(you called it "interface"), something that says "if you assign a value to
>this variable, and then access its value before assigning it another one,
>it will be the same value you put in" (in mathematical terms, you reified
>[made explicit] the concept of state). Then someone needing an assignment
>operator can request one by referring to the explicit definition of the
>behavior of objects that use assignment and preserve state.
I didn't mean it that way. I meant that each program still has to have
knowledge about the functions in an interface, but as soon as the program
finds out that a certain object supports a certain interface, it knows that
it can use that object in the same way as it can use *every* object that
supports the interface.
So, if you have a packed archive, but no module that handles such files,
nobody will know how to use the archive. If however such a module is added
to the system (easily done), existing interfaces will be supported by the
archive, and everybody can interact with it.
Really simple, actually.
I do, however, think the idea you presented is interesting. But I don't
understand how you actually refer to a function without a name. Would a
function name be constructed out of a description of the function, using
strong syntax rules?
>This kind of "function lookup by meaning" (I call it semantic-based
>linking, because semantics is meaning) is far better than what most
>languages use today, linking by name. Names are:
>
>1. Language (i.e. English) specific
Necessarily.
>2. Not precise specifiers of meaning, even to humans, that is, why use
>"print" in C and "write" in Pascal? "write" in C is a disk operation, and
>"print" in DOS is a printer operation. "write" in Win31 is a text editor.
Good point. BTW, if using OOP, these functions could be abstracted to a
generic "output" operation. I think this is the solution for UniOS, or
rather mOS.
>3. Meaningless to computers
I can't see how you could refer to a function in a manner that's meaningful
for computers, without using the actual address (function pointer).
>4. Hard to remember when writing code
Maybe, yes. At least the functions seldom used.
>5. Hard to understand when reading code
Not necessarily, if the chosen names are good.
>What are the requirements to get semantic-based linking? Basically, the
>entire function's source must be abstracted and put in its interface!
>"What!!!" you say. I mean an abstract representation of behavior,
>independent of implementation. I call this 'specification.' It is the
>meaning of a program (function) separate from a particular method of doing
>it. So for instance, the idea of a sort function, the fact that its input
>is unsorted data and its output is sorted data. Not whether it uses
>bubble sort or shell sort or quick sort; those are implementation details.
>But you need some way to describe what unsorted data is, and what sorted
>data is (this is done by using LOGIC! Go learn it. Too few Computer
>Scientists do). That is the semantics of the function. SYNTAX is the bare
>form of the function, the fact that it inputs a set of data and outputs
>another set of data. Too long has TYPE gone without inclusion of
>SEMANTICS.
I think a practical example of how this would work would help me understand
how it can be accomplished.
binEng
------------------------------------------------------------------------
To unsubscribe from this mailing list, or to change your subscription
to digest, go to the ONElist web site, at http://www.onelist.com and
select the User Center link from the menu bar on the left.
------------------------------------------------------------------------
UniOS Group
http://members.xoom.com/unios