-
Notifications
You must be signed in to change notification settings - Fork 301
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
Added --fableLib arg #2274
Added --fableLib arg #2274
Conversation
Thanks @ncave! I wanted to ask you, what do you think could be the use cases of fable-compiler-js from now on? How should we present it in blog posts, etc? (Or whether we shouldn't.) Before the main advantage was it was easier to setup. Now on one hand it's even easier because there are less dependencies but on the other the dotnet fable tool provides a similar experience without the limitations (packages, type providers). I replaced fable-compiler-js with the new dotnet fable tool to compile build.fsx in this repo for dogfooding. I didn't do any proper benchmark but I've the feeling fable-compiler-js was actually faster to bootstrap. When compiling the test it's slower than dotnet fable, but it may happen that it works better for small workloads. Anyways, I need to update the repl so we can check the speed improvements. I guess I'll leave the dependencies out for now. |
@alfonsogarciacaro The use case is, as it always has been, that it is completely in JavaScript and doesn't need dotnet to run. Now that it doesn't need Babel anymore, it's very lean, almost no npm dependencies. I think Fable packages are supported, as they're compiled from source code. I haven't looked at type providers yet. Yes, it's about 2-3x slower than the (highly optimized) dotnet version when compiling big projects, but as you said it might start faster in smaller workloads. |
Thanks @ncave! Yes, supporting packages should be possible. Just, if I'm not mistaken, we're still missing the machinery to resolve the dependencies and get the location of the assemblies (that in turn point to the package BTW, I published the repl for Fable 3 here. Performance seems to be roughly the same. |
@alfonsogarciacaro Support for nuget packages was added a year ago in #1943, so it's available in Fable 2 as well. Thanks for publishing the new |
@alfonsogarciacaro Yes, Performance of some compiled code in Firefox seems worse, we probably need to look into that. In some cases it can be up to 6x slower, see the RayTracer sample. |
Oh my, I had absolutely forgotten about that PR 🤦 I need to try that out. Yes, let's publish an RC for fable-compiler-js (we can even consider renaming it to Firefox always lagging behind with the repl :/ I've compared the Fable 2 & 3 outputs for RayTracer and the main differences are JS classes and iteration. Fable 2 uses the |
@alfonsogarciacaro Yes, unfortunately it looks that way. Switching list iteration from |
Ok, I guess now the performance issue with composing BasicPatterns is fixes we could try to capture the for ... in pattern again and replace it with iterate. About the structs, maybe we could try to implement them as tuples. Hopefully we don't have the issues we had with records (reflection, comparison...). The only problem I can think of is when implementing an interface, but we could just forbid that or disable the optimization in that case. What do you think? BTW, in order to test this kind of things in the REPL I've implemented the following:
|
@alfonsogarciacaro It's not just about structs, perhaps any record or class type will perform badly in Firefox if compiled to classes. I've started doing some work in #2279 (based on your #2236) for erasing unions and records to named tuples. It's just an experiment to see if that improves performance or bundle sizes. It's still WIP and not fully functional yet in the sense that it's not passing all tests, but it's most of the way there. |
@alfonsogarciacaro Yes, I can confirm that for whatever reason |
--fableLib
arg infable-compiler-js