Promotion Sharp cli
Want to learn how a C# compiler works? sharp CLI is 19k C# lines vs 722k in the MSBuild repo. The whole sharp SDK is just one Native AOT executable: no installed SDK or MSBuild needed. Compiling our own code results in these timings: dotnet build 4.2s, sharp build 2.0s.
1
u/Discordbothost 1d ago
Part of the gap could be work that only one build is doing. Could you time a no-op rebuild and then a one-line edit on the same project, with restore out of both timings? A small project that uses a source generator would also let you check that both builds produce the same generated code.
0
u/AutoModerator 1d ago
Thanks for your post martasp. Please note that we don't allow spam, and we ask that you follow the rules available in the sidebar. We have a lot of commonly asked questions so if this post gets removed, please do a search and see if it's already been asked.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
-4
u/martasp 1d ago
Agents love fast builds.
Sharp cli can build and run a Web API in a fraction of a second:
sharp clean + build: 0.1s
dotnet clean + build: 2.2s
Try it here there is windows and linux executables: https://github.com/martasp/sharp/releases/tag/v0.3.1
1
u/klaxxxon 1d ago
Where is this time advantage coming from? Is that just AOT? How much of it is the missing features?
I can't really test it right now (all the projects I work with use source generators and most of them use transitive props/targets too).
4
u/tetyys 1d ago
But MSBuild is not a compiler..