Results 1 to 14 of 14

Thread: Change the source code of the .Net4.8 framework from C# to VB.NET

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Change the source code of the .Net4.8 framework from C# to VB.NET

    Lately, I've been reading the source code for .NET4.8 core libs (mscorelib.dll and system.dll, system.core.dll), which are written in C#. For a long-time user of VB6, it is much easier to read VB.NET code than C# code. If there is a version of .NET4.8 core libs developed with VB.NET, it can greatly reduce the time VB6ers spend reading the source code. So, I'm wondering if anyone has replaced C# with VB.NET and successfully compiled the .NET 4.8 core libs. Thanks!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    I can't imagine anyone willing to waste their time doing that. I suggest that you install Instant VB and, unless you want to pay for the full version, convert the code one method at a time as you need it.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    Quote Originally Posted by jmcilhinney View Post
    I can't imagine anyone willing to waste their time doing that. I suggest that you install Instant VB and, unless you want to pay for the full version, convert the code one method at a time as you need it.
    I know there's little chance of finding my answer, but sometimes I still hope for a miracle.

    Also, I've used Instant VB and it's great. But, obviously, it can't translate some complex C# code into VB.NET, much less the entire mscorelib project into VB.NET

  4. #4
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    You could always try something like https://github.com/dnSpyEx to reverse engineer the compiled assemblies into vb.net, no idea how useful the reverse engineered code would be without comments etc.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    Quote Originally Posted by PlausiblyDamp View Post
    You could always try something like https://github.com/dnSpyEx to reverse engineer the compiled assemblies into vb.net, no idea how useful the reverse engineered code would be without comments etc.
    Very valuable information, I'll take the time to give dnSpyEx a try. Thank you very much, PlausiblyDamp.

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    Quote Originally Posted by SearchingDataOnly View Post
    So, I'm wondering if anyone has replaced C# with VB.NET and successfully compiled the .NET 4.8 core libs. Thanks!
    Nobody is going to do that, and if somebody does, you should RUN!!! Since they'd clearly be insane.

    Just think of the potential issues that would create. You start with code that is working and well tested, and then what? If you pass it all through a converter, then what you end up with is code that probably converted fairly well, unless the converter is buggy. It's a HUGE amount of code, potentially, so you've gone from working and well tested code to a conversion of that, which you hope is a good conversion, and which you can't then test as thoroughly as the original code. The best you can say about that is that converting from C# to VB.NET is a relatively simple and well understood operation, so it is quite likely that the conversion was reliable.

    At that point, you have a snapshot of the code at the time when you did the conversion. If a patch were to update something...well, would you even know?

    So, while it might not take unreasonably amount of time to do that conversion, there are two potential issues with doing that, and the only benefit is so that you don't have to read C#. Does that benefit outweigh the potential costs? Probably not. After all, if you found the converted code, are you certain it's a conversion of the latest patched version, or are you looking at code that might be subtly different from what is actually being run?
    My usual boring signature: Nothing

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    What you said makes sense. But what you overlook is that .NET4.8 development is frozen, so its code is relatively stable (no major changes). In addition, VB.NET can't translate C# code 100% accurately, which in itself shows that .NET's technical route to bundle multiple languages together is wrong.

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    Quote Originally Posted by SearchingDataOnly View Post
    which in itself shows that .NET's technical route to bundle multiple languages together is wrong.
    It shows no such thing.

  9. #9
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    Yeah, I'm not sure how you get there. They are very similar, but not identical. However, VS has long had several different languages, so those get bundled. Also, since both C# and VB produce .NET IL, they are quite compatible. When you are creating IL, which only then gets turned into machine language, it really doesn't matter which language you write the original code in. As long as there is some compiler that turns the source into .NET IL, the syntax of the source could be C#, VB, C, Python, Java, Rockstar, or anything else. Sure, they won't all be able to create ALL possible IL, but every one of them could be turned into IL, and the IL will then be turned into machine language using the same compiler. How you get to the IL will have it's quirks. How you go from IL to machine language will all be the same.

    At that point, why NOT bundle them all together? The goal is the IL, the languages are just different starting points of different paths that lead to that goal. There isn't any good reason to put them in different IDEs. What possible good would that do?
    My usual boring signature: Nothing

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    The relationship between VB.NET and C# is different from that of other languages. VB.NET and C# belong to two expressions of the same language, and when C# cannot be converted to VB.NET with 100% accuracy, it shows that Microsoft's original strategy was a failure. It's like the U.S. Air Force piled all its features on the F35, and now the situation proves that this is an extremely bad design.
    Last edited by SearchingDataOnly; Nov 13th, 2022 at 11:21 PM.

  11. #11
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    Quote Originally Posted by SearchingDataOnly View Post
    The relationship between VB.NET and C# is different from that of other languages. VB.NET and C# belong to two expressions of the same language
    That is an utter crock. VB.NET is based on a long history of BASIC and Visual Basic, while C# is based on a long history of C/C++ and Java. They are two distinct language families. If you want to claim that they are somehow the same language because they both get compiled to CIL then you have to also accept that C++/CLR and F# are also the same language. There was even a version of Delphi that compiled to CIL too, so that must also be the same language. Nonsense, of course. You're just making things up to fit a narrative. There are arguments to be made against the .NET platform but this isn't one of them.

  12. #12

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    Quote Originally Posted by jmcilhinney View Post
    VB.NET is based on a long history of BASIC and Visual Basic
    Obviously, you know very little about VB.NET and Visual Basic. VB.NET and C# are like brothers. VB.NET and VisualBasic are like children with the same name, but from two completely different families, they are not even cousins, but the same name.
    Last edited by SearchingDataOnly; Nov 14th, 2022 at 06:16 AM.

  13. #13
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,621

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    the two languages, at the beginning, were basically identical, in that they all had equivalent functions, methods, variables to each other. This is why the online converters were able to swap back and forth. However, that was merely at the beginning. They have completely different dev teams and there are now many differences that simply don't translate between them anymore. You would have to rewrite many functions from scratch.

    As for them "being the same language", looking at the linking file and claiming they are the same is about as accurate as saying vb6 and c++ were the same language since they both used the same compiler and linker in visual studio. They ALL end up as machine code so they are all the same right?
    My light show youtube page (it's made the news) www.youtube.com/@artnet2twinkly
    Contact me on the socials www.facebook.com/lordorwell

  14. #14
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: Change the source code of the .Net4.8 framework from C# to VB.NET

    Quote Originally Posted by SearchingDataOnly View Post
    Obviously, you know very little about VB.NET and Visual Basic. VB.NET and C# are like brothers. VB.NET and VisualBasic are like children with the same name, but from two completely different families, they are not even cousins, but the same name.
    I mostly agree with Sir Orwell, except that they started somewhat different, converged by 2010, then started diverging again.

    Still, they are not nearly so similar. The groups within MS were quite separate. The intention was that there could be a variety of different languages that all ended up with IL. The intention was also that there would be a variety of compilers that took the IL and created code that ran on different platforms, because .NET was intended as a competitor to the 'write once run everywhere' promise that Java had back in the late 90s. What actually happened was different from that, but we can't be using hindsight, we need to see it from the point of view of the time when it was created.

    I've heard stories of that creation at family gatherings from one of the people who called some of the meetings and headed up at least a portion of one of the projects. There was a whole lot more guessing and a whole lot less certainty, at the time, than the narrative that people tell these days.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width