BAndysc / AvaloniaVisualBasic6

A recreation of the classic Visual Basic 6 IDE and language in C# with Avalonia
https://bandysc.github.io/AvaloniaVisualBasic6/
MIT License
862 stars 48 forks source link

Compilation #1

Open furesoft opened 4 days ago

furesoft commented 4 days ago

Hi there,

i love your idea and I wanna join. I could make a compiler that translates vb6 to msil. But is this wanted?

BAndysc commented 4 days ago

Hello, the response to this project exceeded my wildest expectations! I have coded an interpreter, which covers only a small subset of the language as that was the fastest way to get started. Having a proper compilation would be much nicer. Tho if we were to add a compiler, I am not sure if it wouldn't be even better to try to compile it to native code. The GUI "runtime" is a c# project, but it is compatible with NativeAOT, so we can get a native executable there, so if we could compile VB6 to assembly, it would work nicely together.

The ANTLR4 grammar I used is a good starting point for any further work on this. In the past I wrote a simple compiler in C#, but now I would rather target LLVM IR to make sure many different platforms are supported.

What is your stand on targeting MSIL vs LLVM IR?

furesoft commented 4 days ago

msil is portable. and the llvm wrappers are not idomatic csharp. so its harder to use it.

I think using DistiIL to build the assembly

BAndysc commented 3 days ago

msil/dotnet is portable, I mentioned native code as the original VB6 was also able to produce native code.

But this is a project made for fun, if you want to work on a proper compiler to IL, I am more than happy to have it integrated in this project!

Feel free to contact me on discord: bandysc