For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > July 2006 > Why does VB require a runtime library?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Why does VB require a runtime library?
pcnerd

2006-06-30, 9:55 pm

Why is it that VB requires a runtime library, but some other languages don't?
Some programming languages can create a truly standalone executable that
doesn't have to rely on external files to run. Why doesn't VB create a truly
standalone executable? The IDE creates an executable, but then a runtime
library must be distributed with it. Why?

Thank you.

David
Ralph

2006-06-30, 9:55 pm


"pcnerd" <pcnerd@discussions.microsoft.com> wrote in message
news:0EC660C3-8541-44EA-B15A-4A4BCD8AC4F5@microsoft.com...
> Why is it that VB requires a runtime library, but some other languages

don't?
> Some programming languages can create a truly standalone executable that
> doesn't have to rely on external files to run. Why doesn't VB create a

truly
> standalone executable? The IDE creates an executable, but then a runtime
> library must be distributed with it. Why?
>
> Thank you.
>
> David


The short answer is because MS never provided the ability to 'statically'
link the runtime libraries into a compiled VB application (or rather never
provided static runtime libraries that could be linked). Probably because
even creating a 'compiled' app came rather late to VB.

There is nothing inherent in VB that "requires" it to use a separate shared
Dll for its runtime, it just does.

hth
-ralph


MikeD

2006-06-30, 9:55 pm


"pcnerd" <pcnerd@discussions.microsoft.com> wrote in message
news:0EC660C3-8541-44EA-B15A-4A4BCD8AC4F5@microsoft.com...
> Why is it that VB requires a runtime library, but some other languages
> don't?
> Some programming languages can create a truly standalone executable that
> doesn't have to rely on external files to run. Why doesn't VB create a
> truly
> standalone executable? The IDE creates an executable, but then a runtime
> library must be distributed with it. Why?


The "core" VB statements, subs, and functions are contained in the runtime
library. Plus, the runtime handles most of the behind-the-scenes Windows
stuff, which is what makes writing apps with VB quicker and easier than most
other languages. You, the programmer, don't need to deal with all of that
because the runtime handles it. Just take a quick gander at some VC++ code
at what all you must write just to create a window (a form in VB terms), add
a few basic controls (say an edit control [a textbox] and a couple command
buttons) to it, and process a few messages for them. It all needs to be done
via code rather than visually. It's the runtime that exposes these as
objects, raises events for them, etc.

Static linking was a major request for VB over the years. MS never added
this to VB. If they had, we would have been able to create truly standalone
apps in VB (IOW, apps that didn't require a runtime). That was one thing
that made Delphi so appealing when it first came out. It was visual like
VB. It had "components" for things like command buttons. textboxes,
checkboxes, etc. And during compilation, it statically linked everything
into a single EXE (or whatever type of project you were creating with it).
Downside to Delphi was/is that it's based on Pascal. IMO, if Delphi had
been based on BASIC, it would have been much more competitive with VB.

However, it's more and more common (and has been for quite some time) for
ANY programming language to require dependency files. Even with VC++ you're
not going to get away from them except for the most simple of apps. And
let's not even go into .NET, which requires an entire (and huge) framework
(basically, a runtime but too large to be called a "runtime"). The .NET 2.0
Framework is 20+ MB. VB6's runtime isn't so bad compared to that, huh?

--
Mike
Microsoft MVP Visual Basic

Vincent Delporte

2006-07-01, 3:55 am

On Fri, 30 Jun 2006 23:19:10 -0400, "MikeD" <nobody@nowhere.edu>
wrote:
>However, it's more and more common (and has been for quite some time) for
>ANY programming language to require dependency files.


.... which is why web apps look more and more appealing :-)

>And let's not even go into .NET, which requires an entire (and huge) framework
>(basically, a runtime but too large to be called a "runtime"). The .NET 2.0
>Framework is 20+ MB. VB6's runtime isn't so bad compared to that, huh?


Actually, the VB run-time looks much better. At least, they were
backward-compatible (at least with major numbers). I can't believe
people jump into .Net while it's still under heavy development, and
require the user to download multiple version of that behemoth to be
able to run 1.0, 1.1, and 2.0 .Net apps.
Ken Halter

2006-07-01, 3:55 am

"pcnerd" <pcnerd@discussions.microsoft.com> wrote in message
news:0EC660C3-8541-44EA-B15A-4A4BCD8AC4F5@microsoft.com...
> Why is it that VB requires a runtime library, but some other languages
> don't?
> Some programming languages can create a truly standalone executable that
> doesn't have to rely on external files to run. Why doesn't VB create a
> truly
> standalone executable? The IDE creates an executable, but then a runtime
> library must be distributed with it. Why?
>
> Thank you.
>
> David


Adding to the pile here...

When it comes to Windows apps, there is no such thing as a "truly standalone
executable that doesn't have to rely on external files to run". The
difference is, they use the same dependencies Windows itself does so they
"seem" standalone. If you have some spare time and a spare hard drive,
format it, and without installing Windows, copy one of those "standalone"
apps to the empty hard drive, boot to dos from a floppy and try to run that
standalone app.

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
In Loving Memory - http://www.vbsight.com/Remembrance.htm


MikeD

2006-07-01, 7:55 am


"Vincent Delporte" <justask@acme.com> wrote in message
news:vg1ca2dnhagb5bc42uur6s7u6p94j79tto@
4ax.com...
> On Fri, 30 Jun 2006 23:19:10 -0400, "MikeD" <nobody@nowhere.edu>
> wrote:
>
> ... which is why web apps look more and more appealing :-)


I hope that's in jest.

>
>
> Actually, the VB run-time looks much better. At least, they were
> backward-compatible (at least with major numbers).


No they weren't. A VB5 app requires the VB5 runtime. It won't run against
the VB6 runtime.


--
Mike
Microsoft MVP Visual Basic

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com