-
Notifications
You must be signed in to change notification settings - Fork 317
Demo page minor update #709
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
Conversation
|
Anecdotally, Fable on Chrome seems to be 2x as fast as Firefox, and 4x as fast as Edge. Not sure why. It's still at least a magnitude slower than BuckleScript, but hopefully some performance tuning can help. |
|
Wow, I got it working! Awesome work, @ncave! 👏 🎉 💃 I'll upload it to the web (without any link from the main page yet) so people can give it a try before polishing it and making it official. About the AST, you're right, the typed objects cannot be passed to Babel directly. I'll try to modify the Babel AST to use On performance, we can try to play with webworkers to see if this gives us a boost. I'm also concerned about the time to download the binaries when the REPL is hosted online. The innerworkings of FCS remain very mysterious to me, and most of my knowledge comes from a couple of tutorials and trial-and-error, but from my experience the biggest bottleneck is the warm up time to parse a project with a fresh BTW, what's the difference between the FSharpChecker and the InteractiveChecker? |
|
@alfonsogarciacaro The InteractiveChecker is a quickly hacked together trimmed-down POC version of the FSharpChecker and FsiInteractiveChecker, with all the good parts removed (incremental build, file system, project support, etc.), so it's only single file parsing left. All the heavy initialization is happening in the InteractiveChecker constructor, so there may be some room for improvement if we don't create it every time and instead keep it around. |
|
@alfonsogarciacaro As you've already seen, the demo page is just a copy of the babel try it out page, with a really minor plug at the bottom to load the metadata, and in the middle to call the Fable compiler, for the purpose of a quick demo. I'm not really sure if the demo page is the best foundation for a good live playground page, there may be better ones out there, but I'll leave that decision to you. I'm sure the community will contribute to make it a great page, if there is a branch for it. |
|
@alfonsogarciacaro There seems to be some difference in the babel processing in the demo page, can't figure out if it is an issue with the deserialization of the Babel AST, or something else: If you compile this simple statement: Same AST, with Demo page, will compile to: |
|
Ah, damn! I forgot about that. The emit expressions are actually resolved by a custom Babel plugin, so this needs to be added to the demo page too. I'll send you a link when I'm home, but you can also easily find them in src/typescript/fable-compiler I also found some issues debugging the compiler with a bit more complex code, I'll try to push the fixes later. |
|
@ncave Great! I'm building on your amazing job and it seems little by little we're getting there ;)
You can see these changes in my latest commit. There are still some issues and for sure a lot of room for improvement. We can use the Chrome dev tools to find the bottlenecks. This will probably also help the dotnet version :) |
|
|
@ncave Wow, that was fast. I updated it, thanks! However, after updating Fable to FCS 10.0.1 I'm getting the following error when trying to compile a script: I need to solve this (if you've any hint, please tell me), but for now I just edited the Fable.Client.Browser.fsproj so using scripts as project files is not necessary. Please let me know what you think. |
|
@alfonsogarciacaro I wonder what that problem is. Do you have an explicit mscorlib reference on that command line? |
|
@dsyme @alfonsogarciacaro Yes, it seems to be about script references, so perhaps there is an issue there with fcs 10.01. It was working fine with 9.01, before this commit. We don't have a script test for this in FCS (well, we actually do, I added one in PR 654 but that's not merged yet, perhaps I can redo it to just have the test). |
|
@dsyme Yes, it's as @ncave says. The problem happened after updating FCS to 10.0.1. It occurs when calling Wild guess: FCS is resolving the core assemblies with the full .NET framework but for FSharp.Core it takes the one referenced by the calling assembly which in this case is the netstandard version (latest Fable is a netcore app). |
|
@ncave Ah ok. Do you know what we need to fix that failing test? I'm not at all sure. |
|
@ncave @alfonsogarciacaro Perhaps you need to set |
|
Thanks for the tip @dsyme, that may do the trick. Unfortunately I cannot test it, because the exposed method in FSharpChecker doesn't let you set |
@alfonsogarciacaro Thanks, fixing U2 serialization worked. Babel AST can't be used directly so serialization/deserialization is still needed, but it works great now. I've reduced the dependencies back to the original set as that's all that's needed for most scripts, but more can be added if need be.