Re: VB language extensions wishlist




"Pavel Minaev" <int19h@xxxxxxxxx> schrieb im Newsbeitrag
news:a2841ab5-27cd-46f7-baad-cfe61f1f4f57@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Feb 17, 12:45 pm, "Schmidt" <s...@xxxxxxxxx> wrote:

Targeting C++ is even easier in some respects...
Yes, if you plan, to emit only C++-Code, then it
is much easier, than to emit a PE-Binary directly.

In general, I would hope to have the generated C++ code
to actually be readable and concise, close to what a human
would've written in a similar case.
But if I understand you correctly, we will end up with "only"
a (compilable) C++-Project - debugging such a project
(break-points, etc.) would end up in looking at C++-
Code, right?

[FreeBasic as an alternative]
Does it support anything resembling OOP?
Writing a simple BASIC compiler is actually relatively
simple even when targeting assembly directly.
Hmm, I'd say 120,000 lines of already existing (and
tested + bugfixed) code as in the current FreeBasic-
Source-Tree is something, which is not all that simple
to rewrite again - why not use/adapt it to our needs.

The biggest challenges for a VB clone are its class/form
system, and the COM interop.
COM is (mainly) VTable-Handling using TypeLib-Defined
"Method-Headers". A language, which supports pointers
and calling functions from pointers should be suitable -
and FreeBasic supports that.

For these reasons also I'd be wary of extending code
written in another dialect of BASIC - does it have adequate
development tools, such as a decent IDE (autocompletion,
refactoring etc) with an integrated debugger? I've gotten rather
spoiled in that regard in the last few years, writing C++ and
especially C# code in VS2005/2008. :)
There are FreeBasic-IDEs - but they are of course not at the
same level, VisualStudio offers currently.

Yes, but as said - I'd not expect something to be finished
earlier than 2011 if it is *not* based on a FreeBasic-fork.

It depends on what is defined as "finished". If we're speaking of a
full package - compiler + all libs + IDE - then your date is about
right, but it's so regardless of the approach (proper IDE alone takes
a lot to polish). A fully compatible compiler able to use the existing
VB6 runtime is something I'd expect to get out much sooner, quite
possibly less than a year to a feature-complete beta.
I'd love to see that happen that fast, but what do you expect would
be the necessary environment for us, to compile a *.vbp?
Would we have to install the VC++-Express-Version or something
like that in a first step?

And we would have to write/include a COM-Typelib-parser -
something based on Jose Rocas stuff:
http://www.forum.it-berater.org/index.php?topic=420.msg1572

Parsing COM typelibs is easy, since COM itself has all the
APIs needed for that.
Yes, I know - I'm using Edanmos OleLib for that - what I
meant was, that the Tool in the link above already creates
the needed Basic-Files, which reflect the TypeLib-Defines
in PowerBasic-, respective FreeBasic-Style for direct usage
inside a wrapper.

And we would have to write our own TypeLib-
Compiler, if we plan to make our own "internal
Components" COM-compatible.

Generating typelibs is just as easy, and for the same reason.
Are you sure - I'm talking about emitting a *.tlb directly
from Basic-Code - you are probably talking about
creating a Midl-compileable *.idl-Textfile.

Anyway - would be glad, if you'd take a serious look
at what FreeBasic in its current incarnation has to offer.
In the Download there are also Win32-examples, including
COM-Interop-Demos, so the consuming of COM-
Objects should be very doable. Regarding the opposite
direction, compiling a COM-Dll using FreeBasic - I think
I could provide you with an example, if you really have
interest to take a closer look.

Would appreciate it, if we could end up with a true, machine-
code-emitting compiler, able to link BreakPoints to
Basic-Code.

Olaf


.



Relevant Pages

  • Re: VB language extensions wishlist
    ... Rolf Bjarne Kvinge wrote it mostly on its own - ... The compiler is selfhosting ... earlier than 2011 if it is *not* based on a FreeBasic-fork. ... Generating typelibs is just as easy, ...
    (microsoft.public.vb.general.discussion)
  • Re: VB language extensions wishlist
    ... compiler from scratch - or writing a PreCompiler, ... environment, which we would have to deploy then in addition. ... writing all that stuff (the compiler itself, a new Runtime-Lib, ... earlier than 2011 if it is *not* based on a FreeBasic-fork. ...
    (microsoft.public.vb.general.discussion)