Implementing expected core OS functionality



Proposal: Implement KernelLibrary>>getTickCount

Justification: Kernel32.dll represents the "kernel" or core functionality of
the host operating system. Most documentation and sample code on Windows
will reference core functionality and for purposes of backwards
compatability, it is often the "least common denominator." Dolphin has
outstanding integration with the native OS capabilities and for the most
part does an excellent jobs of wrapping the Windows API. Because of this
integration, Dolphin provides a wonderful platform for studying the OS API
and I can often port C code easily to Smalltalk without having to think
about integer sizes, types, signs, casting, etc. When I read an article
comparing different APIs, I can often very easily try out the differernt
examples even though they are given in a different language. Likewise, when
studying the MSDN documentation, I will come across a suggested
implementation that references a particular API. When Dolphin provides a
wrapper for that API, then I can continue to just think Smalltalk in my head
even though I'm reading C. I can go to a workspace and try out a call to the
API and see what comes back. When a fundamental API is missing, I'm left
with wondering what I've misread and trying to sort out the stdapi or cdecl
issues.

The MSDN documentation on GetTickCount() suggests that if you need a higher
precision timer you can use the multimedia library, and it would be an
interesting exercise to write some Smalltalk code that compares the two
approaches. I understand that the developers of the base library might think
that a particular API need not be included since another one is available
that should serve better. I respectfully disagree. First, to the extent it
is complete, the base class library can serve as excellent documentation of
the Windows API. Second, code being copied from another language or library
might reference the particular API. Third, one might want to compare
different approaches, and as a learning exercise verify that the newer one
is better.

If a particular API is much better known and used than another approach
(Google references to GetTickCount are 3X those to TimeGetTime), then
including the more popular approach seems to be justified. If another API is
"better," then reference could be made to that fact in the comments.

I can think of three possible reasons why a kernel API would be missing from
the base class library. First, because the provider of the base class
library has limited resources and that particular API is of low priority. As
a developer myself I can certainly understand this limitation. On the other
hand, if someone provides the code to you then the cost should be
significantly reduced. The second reason is that the provider of the tool
wishes to protect the customer from making the "mistake" of writing bad
code. While I understand that this philosophy forms the basis for such Java
design decisions as closed classes, I thought that this attitude was
generally foreign to the Smalltalk community. The only other reason I can
think of for excluding popular core OS functionality is because it would
take up too much space. While I very much appreciate the compact size of the
Dolphin-To-Go EXE, I don't see that this argument applies as well to a
development environment. One of the selling points of "more mature" dialects
(e.g., VisualWorks), is that the base class library is more "complete."
Advertising of these products may make reference to the thousands of classes
and tens of thousands of methods.


.



Relevant Pages

  • Re: What are the Missing Parts in the CVF Windows API?
    ... Both the documentation and third-party books say that **almost** ... | all of the full functionality of the Windows API, ...
    (comp.lang.fortran)
  • Re: Getting/Setting States of VB-Shelled Application Windows
    ... Windows when the window is created and which identifies the window) of ... VB's Shell function does not return an hWnd. ... You'll have to use the API to get that. ... any example code included in the documentation is going to be C/C++. ...
    (microsoft.public.vb.controls)
  • Re: Calling SystemParametersInfo
    ... You need to be careful which version of the documentation you are looking at ... platforms Microsoft supports and although there is a certain level of API ... For example you can find the documentation for the SystemParametersInfo API ... Windows CE / Windows Mobile specific documentation - ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: How will PatchGuard change kernel programming?
    ... An API documentation is a contract between the API vendor and ... Windows API sometimes, ... this is just another way that Microsoft is increasing its monopoly ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Determine if an item in a collection has changed
    ... What people do with API - I don't know. ... >> parent, which by necessity holds a reference to each of its children (via ... >> hold its pointer. ...
    (microsoft.public.vb.general.discussion)