From: ekkehard.horner on
Peter Olcott schrieb:
> On 8/10/2010 2:58 AM, ekkehard.horner wrote:
>> Peter Olcott schrieb:
>>> Iterating over the members of a class?
>>> Is there any way to do this?
>>>
[...]
>> The answer to "Is there any way to do this?", however, is "yes". If
>> you have lots of time to spend, are willing to pay a price of reduced
>> efficiency, and like work hard against the grain of language to get
>> what other languages offer for free, you could

do it. But why on earth?

> This sort of thing was my plan. I was looking to see if there was an
> easier way. If VBScript already stored its class members in an array,
> and this array was directly accessible, then what I need to do would
> have been easier.

To do what you need to do in VBScript will be difficult. A large part
of your efforts will be spend on bending the language to fit your
needs.

> It has to be an interpreted language.

Why? Nowadays you can get compilers for every language suitable for
your project (and for both Windows and Linux/Unix)

> It has to be able to use and
> create ActiveX components.

This will make things difficult for Linux:

The one bit that is not supported are COM components, since Linux
has no equivalent to COM. If a Visual Basic application requires
COM or ActiveX controls, those will not run.
http://www.mono-project.com/VisualBasic.NET_support

> It has to have classes.

Why not say "good OOP support" and rule out VBScript?

> Ideally it should be
> universally available (at least on Windows platforms) at no cost.

Python, JScript, Perl, Ruby and the .NET languages meet this
requirement

> The language should have minimal learning curve/development time cost.
>

Looking at your questions so far, I assume you plan to increase
your knowledge of VBScript. Every hour you spend on that is wasted,
because Microsoft won't put further efforts in that language.
Invest that time in learning VB.NET, C#, or (Iron)Python.

> My current plans are to implement the design in VBScript, and adapt it
> so that it can be applied to every language that can use and create
> ActiveX components including compiled languages.

If you implement your design in VBScript, about XX% (let's say 40%)
of your code will deal with putting objects into arrays to make them
iterable, determining whether a member is an object or a simple
variable (to use Set correctly), dirty tricks to use composition
where inheritance would be appropriate, methods with funny suffixes
to get polymorphism, ExecuteGlobal as an ersatz for a decent
library/module system, and the sick joke of On Error Resume Next.
From: Peter Olcott on
On 8/10/2010 1:45 PM, ekkehard.horner wrote:
> Peter Olcott schrieb:
>> On 8/10/2010 2:58 AM, ekkehard.horner wrote:
>>> Peter Olcott schrieb:
>>>> Iterating over the members of a class?
>>>> Is there any way to do this?
>>>>
> [...]
>>> The answer to "Is there any way to do this?", however, is "yes". If
>>> you have lots of time to spend, are willing to pay a price of reduced
>>> efficiency, and like work hard against the grain of language to get
>>> what other languages offer for free, you could
>
> do it. But why on earth?
>
>> This sort of thing was my plan. I was looking to see if there was an
>> easier way. If VBScript already stored its class members in an array,
>> and this array was directly accessible, then what I need to do would
>> have been easier.
>
> To do what you need to do in VBScript will be difficult. A large part
> of your efforts will be spend on bending the language to fit your
> needs.
>
>> It has to be an interpreted language.
>
> Why? Nowadays you can get compilers for every language suitable for
> your project (and for both Windows and Linux/Unix)
>
> > It has to be able to use and
>> create ActiveX components.
>
> This will make things difficult for Linux:
>
> The one bit that is not supported are COM components, since Linux
> has no equivalent to COM. If a Visual Basic application requires
> COM or ActiveX controls, those will not run.
> http://www.mono-project.com/VisualBasic.NET_support
>
> > It has to have classes.
>
> Why not say "good OOP support" and rule out VBScript?
>
> > Ideally it should be
>> universally available (at least on Windows platforms) at no cost.
>
> Python, JScript, Perl, Ruby and the .NET languages meet this
> requirement
>
>> The language should have minimal learning curve/development time cost.
>>
>
> Looking at your questions so far, I assume you plan to increase
> your knowledge of VBScript. Every hour you spend on that is wasted,
> because Microsoft won't put further efforts in that language.
> Invest that time in learning VB.NET, C#, or (Iron)Python.
>
>> My current plans are to implement the design in VBScript, and adapt it
>> so that it can be applied to every language that can use and create
>> ActiveX components including compiled languages.
>
> If you implement your design in VBScript, about XX% (let's say 40%)
> of your code will deal with putting objects into arrays to make them
> iterable, determining whether a member is an object or a simple
> variable (to use Set correctly), dirty tricks to use composition
> where inheritance would be appropriate, methods with funny suffixes
> to get polymorphism, ExecuteGlobal as an ersatz for a decent
> library/module system, and the sick joke of On Error Resume Next.

Because of the proprietary nature of my design I can not share enough
details to show how this completely makes sense. The design that I am
making for VBScript will equally apply to C# .NET, except that it will
require 1/2 the development time for the VBScript version.

Since it has to be compatible with every Microsoft language, I have to
use ActiveX as my interface basis. .NET can use and produce COM
components, non .NET languages can not use .NET components.

--
100% Accurate Display Screen OCR
http://www.OCR4Screen.com
From: Peter Olcott on
On 8/10/2010 1:45 PM, ekkehard.horner wrote:
> Peter Olcott schrieb:
>> On 8/10/2010 2:58 AM, ekkehard.horner wrote:
>>> Peter Olcott schrieb:
>>>> Iterating over the members of a class?
>>>> Is there any way to do this?
>>>>
> [...]
>>> The answer to "Is there any way to do this?", however, is "yes". If
>>> you have lots of time to spend, are willing to pay a price of reduced
>>> efficiency, and like work hard against the grain of language to get
>>> what other languages offer for free, you could
>
> do it. But why on earth?
>
>> This sort of thing was my plan. I was looking to see if there was an
>> easier way. If VBScript already stored its class members in an array,
>> and this array was directly accessible, then what I need to do would
>> have been easier.
>
> To do what you need to do in VBScript will be difficult. A large part
> of your efforts will be spend on bending the language to fit your
> needs.
>
>> It has to be an interpreted language.
>
> Why? Nowadays you can get compilers for every language suitable for
> your project (and for both Windows and Linux/Unix)
>
> > It has to be able to use and
>> create ActiveX components.
>
> This will make things difficult for Linux:
>
> The one bit that is not supported are COM components, since Linux
> has no equivalent to COM. If a Visual Basic application requires
> COM or ActiveX controls, those will not run.
> http://www.mono-project.com/VisualBasic.NET_support
>
> > It has to have classes.
>
> Why not say "good OOP support" and rule out VBScript?
>
> > Ideally it should be
>> universally available (at least on Windows platforms) at no cost.
>
> Python, JScript, Perl, Ruby and the .NET languages meet this
> requirement
>
>> The language should have minimal learning curve/development time cost.
>>
>
> Looking at your questions so far, I assume you plan to increase
> your knowledge of VBScript. Every hour you spend on that is wasted,
> because Microsoft won't put further efforts in that language.
> Invest that time in learning VB.NET, C#, or (Iron)Python.
>
>> My current plans are to implement the design in VBScript, and adapt it
>> so that it can be applied to every language that can use and create
>> ActiveX components including compiled languages.
>
> If you implement your design in VBScript, about XX% (let's say 40%)
> of your code will deal with putting objects into arrays to make them
> iterable, determining whether a member is an object or a simple
> variable (to use Set correctly), dirty tricks to use composition
> where inheritance would be appropriate, methods with funny suffixes
> to get polymorphism, ExecuteGlobal as an ersatz for a decent
> library/module system, and the sick joke of On Error Resume Next.

I thought about it some more and will probably switch to C# .NET
instead. It looks like C# .NET can create COM components that VBScript
(and other scripting languages) can use quite easily. As long as the
Express Editions of C# .NET can do this it would seem to be a sufficient
match for my needs.

--
100% Accurate Display Screen OCR
http://www.OCR4Screen.com
From: Mayayana on
| I thought about it some more and will probably switch to C# .NET
| instead. It looks like C# .NET can create COM components that VBScript
| (and other scripting languages) can use quite easily. As long as the
| Express Editions of C# .NET can do this it would seem to be a sufficient
| match for my needs.
|

You'll need the .Net runtime, though. And COM
is available through .Net via "interop", but is
not native. Also, even if a .Net component can
accomodate VBScript, you're talking about
a dependency of 70+ - 300+ MB, depending on
the version you use.

The .Net runtime has become so bloated that
many people have stopped at .Net 2005, the v. 2
runtime. That's about 70 MB and must be installed
on XP, but it's pre-installed on Vista+. V. 3 is
less commonly installed and weighs in at an
astonishing 300+ MB. Microsoft actually started
designing the .Net IDE to allow for using
v. 2, even in .Net 2010, because of that problem.

Also, .Net code is
decompilable. Or rather, it's JIT compiled. The
files produced are not native code. (They're not
real EXEs.) They can be reverse engineered.
That's a lot more private than your idea of using
WSCs, but still not protected if you're interested
in protecting proprietary code.

In a nutshell, .Net is optimizied for server-side,
"web apps" -- not for Windows desktop software.
COM is a Windows technology. It underlies the
Windows shell.

VB is probably the best thing for COM libraries.
(Not VB.Net) VB was designed for COM. It's
data types are COM data types. (Last I heard .Net
couldn't handle a variant type, which is what VBS
needs, but that may have changed by now.) Next
best would probably be C++, but from what I've
seen C++ seems to have a rather clunky
implementation of COM. Pre-.Net Delphi might
also be worth a look if, as you seem to imply,
you have no particular preference in languages.

If you decide to go with .Net there are groups where
you could get better info. than you'll get here:

microsoft.public.dotnet.general
microsoft.public.dotnet.framework.interop

(As noted in the other thread, those groups are now
probably "gone" but they should still be active and
should be available through most NNTP servers other
than Microsoft's. I know that's the case with the VB.Net
group.)