Re: Macro code
From: Dave Froble (davef_at_tsoft-inc.com)
Date: 09/02/05
- Next message: Dave Froble: "Re: VAXen as a plural of VAX"
- Previous message: JF Mezei: "Percentage of customers with X-windows ?"
- In reply to: John Santos: "Re: Macro code"
- Next in thread: Neil Rieck: "Re: Macro code"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Dave Froble: "Re: VAXen as a plural of VAX"
- Previous message: JF Mezei: "Percentage of customers with X-windows ?"
- In reply to: John Santos: "Re: Macro code"
- Next in thread: Neil Rieck: "Re: Macro code"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|