[Mono-list] [mono-vb] [Mono-dev] Visual Basic upgrade.

Rolf Bjarne rolfbasura at ya.com
Thu Aug 17 06:51:30 EDT 2006


Hello,

The vbnc compiler is currently emitting 2.0 assemblies, and regarding the
two issues for it to emit 1.0/1.1 assemblies the first one is the easiest
(the only feature that would have to be disabled is generics, VB8 does not
support directly nullable types like C# - and if you disable generics
you'll also disable nullable types since they are also generic). The rest
of the new features in VB8 are just compiler features and are perfectly
compatible with 1.0/1.1 assemblies.

The second issue is that since the compiler can only run on the 2.0
runtime it can only generate 2.0 assemblies with Reflection.Emit.
Another way of emitting the code would have to be found in order
to emit 1.0 assemblies (like Cecil for instance). This is something I have
wished to do for a long time, but I do not know if Cecil is mature enough  
to
emit assemblies and it would require a partial rewrite of the compiler
(mostly deletion though, I think about 10-15% of the code could be just
deleted due to the amount of code I wrote to work around the problems
with Reflection.Emit)

Rolf

> Hello,
>
>> Will the new compiler allow targeting of both 1.0 & 2.0 profile ? What I
>> mean to say is, will there be something like vbnc/gbnc (bad name, I  
>> know) or
>> a command line switch to specify whether to emit an assembly that  
>> references
>> the 1.0 (1.1) or 2.0 system assemblies (and allow/disallows 2.0  
>> constructs
>> such as generics, nullable types, ...) ?
>>
>> Sorry if this was answered before...
>
> There are two issues here: whether the compiler can be manually lowered
> to only accept VB.NET 7 syntax only and whether the compiler produces
> executables that reference the 1.1 profile assemblies.
>
> The first could be done, but considering that there is a lot of work
> that will probably need to go into it, having a "lowered" mode is
> probably not the best use of time (although Rolf, the compiler author
> might have a different opinion).
>
> The assemblies generated currently are 2.0 assemblies, this is a side of
> effect of how reflection works (if you reference corlib, it references
> the compiler corlib, which in the new compiler case happens to be 2.0).
>
> I do not think that the compiler can work on the 1.0 profile, which
> means that unless we come up with some gross hack, this is a compiler
> that will only work to link against the 2.0 profile.
>
> Finally, the runtime is a different beast as its main purpose is to run
> existing code, the runtime will probably have to be compiled on Windows,
> or we will have to do some PE-level hacks to the resulting executable.
>
> Miguel
> _______________________________________________
> Mono-vb mailing list
> Mono-vb at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-vb
>
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.1/421 - Release Date: 16/08/2006



More information about the Mono-list mailing list