-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET 5 future support ? #199
Comments
That's definitely on the to-do list. The tricky thing is, .NET 5 is an evolution of .NET Core, and it's missing a handful of things that the Boo compiler relies on; to get it to work requires rearchitecting both the system for reading external assemblies and the system for outputting the finished compilation product. |
Did you ever thought about re-implementing compiler as Boo-to-C# transpiler ? It will be something akin of what CoffeeScript is to JS then, with MUCH less headache involved in doing... like... anything. |
I have, but a lot of things wouldn't work, particularly the metaprogramming. Macros and attributes might work OK, assuming they don't try and do anything with the type system, but meta methods are processed in the middle of |
So, it's all about Reflection and dynamic analysis, right ? |
I was thinking about using Roslyn as a backend for the Boo compiler. The Parser is replaceable (Used by both VB and C#). The rest of the Roslyn compiler pipeline needs to be modified slightly for metamethods and macros. There would be a list of benefits going this route:
Cons:
|
@popcatalin81 That would be nice, and maybe not as huge as you might think. If we could get past the ResolveExpressions compilation stage as-is, all of the metaprogramming would be finished at that point. (Assuming that you're not using a custom compiler pipeline that messes around with stuff at a later point, or doing various tricks to attach Before that point, it would be entirely infeasible. It would completely break metaprogramming, which is strongly tied to the design of the existing Boo AST. The Roslyn AST is very, very different in many ways, and metaprogramming is such an integral part of Boo that this wouldn't be just "a compiler rewrite"; at that point it becomes a whole new language. |
This could certainly be a good starting point. An quite possibly the best option to implement this.
Yes, they are rather different currently in implementation. But the Roslyn Ast can be used for sytnax rewriting See http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp/Syntax/CSharpSyntaxRewriter.cs which is used by refactorings currently, but could potentially be used by a macro system as well. (In the end they accomplish very similar things).
The core aspects of Rolsyn and Boo AST are sufficiently similar to be interchangeable in my opinion. There are Boo specific concepts for which a Roslyn based boo compiler will have to extent the Roslyn AST in the same way VB and C# extend the "Core" AST with specific tokens, which are then onverted to more general Roslyn tokens quite early in the pipeline. Boo could take a similar approach. http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp/Syntax/SyntaxKind.cs |
I got a very different impression, porting the Roslyn code for async/await to Boo:
|
Roslyn AST Nodex are made to be replaced not mutated directly. This adds safety to the AST mutation operations. Example where a property declaration is changed to autoproperty and the field declaration is removed. Very different models to operate on the AST that's true and the Macro system will definitely need to be rewritten to account for this, which makes porting to Roslyn AST quite allot harder.
Yes a bit of a mismatch here.
Boo does not need to implement the lock statement, the async rewriter handles try catch blocks as well, so boo lock macro will still work fine with async rewriter. |
Hi guys, any update on this? .NET 5 is the future... ;-) |
Why Do you not use Ne ? It is support dotnet core. see my experiments https://github.com/altbodhi/NugetNemerleCore |
https://devblogs.microsoft.com/dotnet/introducing-net-5/ - so, it happens.
Any plans to start updating compiler for upcoming Core/Framework merge, since 5.0 will probably become a standard very soon ?
The text was updated successfully, but these errors were encountered: