Re: Macro code

From: Dave Froble (davef_at_tsoft-inc.com)
Date: 09/02/05


Date: Fri, 02 Sep 2005 00:37:34 -0400

John Santos wrote:
> Neil Rieck wrote:
>
>> "Dave Froble" <davef@tsoft-inc.com> wrote in message
>> news:11her0angaj8k57@corp.supernews.com...
>>
>>> gleason@encompasserve.org wrote:
>>>
>>>> In article <11he7rps3tb7mfb@corp.supernews.com>, Dave Froble
>>>> <davef@tsoft-inc.com> writes:
>>>>
>>>>
>>>>> Neil Rieck wrote:
>>>>>
>>>>>
>>>>>
>>>>>> Getting back to your question, if you are doing any low-level
>>>>>> stuff like writing a device driver, then languages like C or
>>>>>> BLISS are the only way to go. You would never use HP-BASIC to
>>>>>> produce something like an Apache web-server. :-)
>>>>>
>>>>>
>>>>> 'Never' is a bit too strong of a word to use in the above.
>>>>>
>>>>> Basic could be used to implement a web server. There is
>>>>> nothing like that now since most such software originates on
>>>>> non-VMS systems.
>>>>>
>>>>
>>>>
>>>> HP Basic, with its excellent dynamic string handling
>>>> capabilities, and easy and flexible interface to RMS files, seems
>>>> like a natural for writing a web server...I'd pick it over C any
>>>> day.
>>>
>>>
>>> All a web server is, is a program that accepts incoming connection
>>> requests, grants a connection, and satisfy's requests. The
>>> implementation should be rather easy. It's the specification of
>>> what it should be set up to do that's the hard part. Uh.. make
>>> that very hard part.
>>>
>>> I've done some services and clients that use sockets for
>>> communication. Written in Basic and uses the system service
>>> routines for socket communications. It's the sissy C programmers
>>> that have to have a socket library. :-)
>>>
>>
>>
>> I've used BASIC to do quite a bit of work with TCPware (both Telnet
>> and FTP) but realize that C does seem to have its place in
>> Open-Source projects like Apache.
>
>
> Much as I prefer BASIC over C, I think that HP BASIC is not thread-safe,
> and threads seem to be a natural and efficient way to implement a web
> server (though maybe you can do much the same thing just as efficiently
> using ASTs.)

Not thread safe, as far as I know. There are always multiple ways to
solve a problem.

> Also BASIC is not very good at creating dynamic objects.

Actually, I don't think it can create dynamic objects, totally within
BASIC. But C is not the only language that can do the equivalent of
malloc. Rundown handlers will of course be necessary.

> You have to
> do tricks like allocate a string of the right size in one routine, then
> pass the string to a function or subroutine that expects its arg to
> be a record of the appropriate type.

Still doable, and not too difficult.

> Or you have to pre-allocate all
> your objects in enormous arrays (that might never be needed) and use
> the array index to designate which thread should use it. (Or more
> complex schemes where you create a smaller pool of objects as array
> elements and set of routines to allocate and deallocate them, and then
> worry about what happens when you run out...)

The RECORD statement is rather nice.

Frame set-up and break-down is rather expensive.

> There is something to be said for object-oriented languages, or for
> languages so primitive (like Macro-32 or C) that you can emulate OOL's
> in them. :-)

I'll admit that I resort to MACRO-32 when I need to do some of the shady
stuff. That common calling standard that all (as far as I know) VMS
languages except C adhere to is rather useful.

-- 
David Froble                       Tel: 724-529-0450
Dave Froble Enterprises, Inc.      Fax: 724-529-0596
DFE Ultralights, Inc.              E-Mail: davef@tsoft-inc.com
170 Grimplin Road
Vanderbilt, PA  15486


Relevant Pages

  • Re: Rubys equivalent of PHP explode
    ... Paul Lutus wrote: ... array or a routine that can parse an .ini file and return the key ... As to the first (explode a string on word ...
    (comp.lang.ruby)
  • Re: Rubys equivalent of PHP explode
    ... array or a routine that can parse an .ini file and return the key ... As to the first (explode a string on word ... read an .ini file and break it down by line and by ...
    (comp.lang.ruby)
  • Re: How can I open a file, skip first 2 lines and get the 50th character?
    ... routine to read in an entire line from a file into a string or a ... buffer consisting of an array of char. ... string or the array. ... You use string methods or array indexing to do ...
    (alt.comp.lang.learn.c-cpp)
  • Proper way to use array
    ... So I tried to rewrite a routine that used to use a collection for storage. ... I re-wrote to use an array instead so as to test the time difference. ... Public Sub ArrayFilesAs String, ByVal sPath As String, ... 'here i'm trying to account for "empty" array, or an array that is already ...
    (microsoft.public.vb.general.discussion)
  • Help in French|Spanish|German translation.
    ... I am also an author of User-defined string functions. ... WORDTRANEX (cSearched, cArExpressionSought | cExpressionSough, ... each string of the array is searched ... If the parameter nArStartOccurrence is -1 or omitted, the replacement starts ...
    (microsoft.public.fox.helpwanted)