Earlier quoted context omitted.
Yeah, if I remember correctly it's indeed a thing in latest versions of .NET Core;
This looks like a pretty cool demonstration of what we're talking about: https://www.strathweb.com/2019/01/collectible-assemblies-in-... See the section titled: Collecting a dynamically emitted assembly
How Microsoft rewrote its C# compiler in C# and made it open source (2017)
41–50 of 136 posts
Re: How Microsoft rewrote its C# compiler in C# and made it open source (2017)
#42Earlier quoted context omitted.
Personally speaking, I'd love to, but I'd then have to figure out how to make them work with an IDE. I'm very tired of waiting for record classes to show up and I could have written a (to be clear: inferior ) set of stuff around regular classes that magics one into "everything is readonly and we autogenerate a `copy` method", much like Kotlin does for its data classes...but my IDE isn't gonna understand it unless I d…
I have a code-gen for records and discriminated unions [1] (as well as other useful features). It will generate a record-type at build-time (which includes the background build process in VS). All that's needed is a [Record] or [Union] attribute: [1] https://github.com/louthy/language-ext/wiki/Code-generation
Re: How Microsoft rewrote its C# compiler in C# and made it open source (2017)
#43I find amusing how microsoft moved from the closed source referent in the industry into such an open source player. Right now even allows to hook some of their tools and platforms to its competing platforms and tools.
Their intent is still entirely market share. We need to be vigilant on how they get there. History has taught us a lot of lessons we seem to have forgotten because shiny and new layer of marketing. There is still a massive cultural and technical impedance mismatch.
Re: How Microsoft rewrote its C# compiler in C# and made it open source (2017)
#44Or imagine syntax reformatting but purely locally. Or semantically aware git diffs that can actually compare the underlying parse trees instead of just raw text. There's so much cool stuff you can do. I wish every language had a parser like this.
Re: How Microsoft rewrote its C# compiler in C# and made it open source (2017)
#45Earlier quoted context omitted.
At some point I wrote a barebones scripting system using roslyn for a project of mine. At runtime I got a piece of code compiled to a DLL in memory and then executed this DLL; Worked well; But at that time there was no support for destroying AppDomains or something, don't remember the exact name. Still pretty fun; But yeah, there's no real complete documentation anywhere; And the DLL hell was real. Dozens of DLL's ju…
Maybe Assembly unloading, in which case if you wanted to swap out new dlls in memory you'd have to tear down the process and restart it. Definitely not sexy. That being said: I think Assembly Unloading is a thing now (and AppDomains don't exist in .NET Core last I heard).
It's a feature that's been around since .NET 1.1 and I used to use heavily 10+ years ago.
https://docs.microsoft.com/en-us/dotnet/api/system.appdomain...
Re: How Microsoft rewrote its C# compiler in C# and made it open source (2017)
#46Earlier quoted context omitted.
At some point I wrote a barebones scripting system using roslyn for a project of mine. At runtime I got a piece of code compiled to a DLL in memory and then executed this DLL; Worked well; But at that time there was no support for destroying AppDomains or something, don't remember the exact name. Still pretty fun; But yeah, there's no real complete documentation anywhere; And the DLL hell was real. Dozens of DLL's ju…
Roslyn is very powerful, but it is still pretty cumbersome. At one point I spent quite a while trying to get a game scripting system akin to the way that Lua is commonly used working, and I just couldn't get it working fast enough to be viable. I essentially wanted to have a core C# engine that provided services, and then have it call an initialization function and a gameloop function that were defined in designated…
Re: How Microsoft rewrote its C# compiler in C# and made it open source (2017)
#47Roslyn's parser and syntax tree is pretty amazing. You can recreate the precise source text from the parse tree up to whitespace. This sort of "bijective parsing" is truly incredible and probably one of the cooler innovations I've seen in parsing technology. I can see a bunch of really interesting ideas that you could do with bijective parsing. For instance, imagine Rails style boilerplate generation but done at a se…
Re: How Microsoft rewrote its C# compiler in C# and made it open source (2017)
#48I find amusing how microsoft moved from the closed source referent in the industry into such an open source player. Right now even allows to hook some of their tools and platforms to its competing platforms and tools.
Re: How Microsoft rewrote its C# compiler in C# and made it open source (2017)
#49Re: How Microsoft rewrote its C# compiler in C# and made it open source (2017)
#50I blame this directly on the immutable AST. While a nice concept in theory, it causes too many allocations, and is cumbersome to work with.
I predict another rewrite in 2 or 3 years.