-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
Travis fails to build because the minimum requirement for nbind is Clang 3.6 (it seems that Travis is currently running Clang 3.3). My own local version is Clang 3.9, so 3.6 seems like a reasonable expectation. |
Wow extremely cool. If you want to tweak the Travis config go for it. |
d7ce2f0
to
d246a62
Compare
20 builds later, I've finally found the right settings 😁 I haven't been able to make Travis test the emscripten version - it would require to compile llvm from its sources, which is less than stellar on Travis and its max timeout. It should theoretically work just as well as the native build, anyway. |
Ping @nathansobo ? If this PR is good enough to be merged, I can start working on converting |
I plan to take a deeper look at this next week. Upon further thought, I need to learn more about |
That's fair, let me know. The lead nbind developer was also extremely helpful, usually answering in a few hours, so maybe they can help us if we have an issue with nbind later on. |
@arcanis Can you do some benchmarking of this relative to master? |
Hm, I think I did something wrong: my branch takes 12s to execute the tests with the native version, but only 4s with the emscripten version (vs 3s for the master version). Optimization flags seem to be correctly set, that's weird. I've added a |
@as-cii has kindly accepted my request to dig into your benchmark and make sense of why @arcanis I'm still pretty ignorant in this area, but I presume the alternative to using |
Awesome, thanks. For the record, I've also opened an issue on nbind's repository about the slowdown: charto/nbind#45 There's a few leads that I need to investigate. As far as I see it, porting a C++ codebase has a few disadvantages over a pure C library that a library such as nbind could help alleviate:
All in all, nbind seems a bit experimental right now, but I find it quite promising. The issues I have seem to be entirely due to the implementation and, as such, fixeable. That being said, I'm not totally sold on using the same codebase on both native and browser versions. It can be done, but it will take a bit of time to get it right. Let me know if it helps. |
After chatting with @as-cii @maxbrunsfeld some more this morning, we have some more thoughts to share and a proposal for moving forward. First of all, running Atom in the browser is something we're definitely interested in over the long term, and we'd like to facilitate your efforts on this front. However, browser support isn't on our immediate roadmap, and so while we want to enable progress on this, we also want to be careful to minimize the potential for disruption of the development or user experience of the existing Electron use case. We would be more comfortable merging something that is more additive in nature. We think we should keep the existing bindings in place for the Node use case and just use We're happy to run tests for the browser-based bindings as part of our build and make a best effort to maintain them, but we want to minimize impact on the proven Node-based solution beyond that. Based on your comments, we also have the following long term concerns about the browser based APIs.
|
Yep, I totally understand. I might try this week-end to make an alternate PR to switch to embind - I don't think it should be too hard.
Quite frankly, my use case for this feature is quite limited - I only need it to implement a web playground for my terminal UI library. Nothing too fancy, and both memory usage and performances are far less important for me than just being able to actually run the code in the browser (hence why I suggested using the JS reference implementation in browser environments in the first place, until a better solution is found). |
Just a small comment to keep you updated: I haven't yet found enough time to open a new PR with embind, and honestly I'm not sure I'll be able to find it in the next few weeks, between the holidays and my relocation. In the meantime, if someone wants to try working on it, feel free to ask if you have any question about emscripten! |
By the way, I also found the following issue which might be of interest on the embind project : |
I haven't yet had the chance to write a new embind implementation of |
Closing this PR in favor of atom/superstring#7 |
Related issue: atom/text-buffer#183
This PR change the build toolchain in order to use nbind instead of nan. By doing this, we can now compile an asm.js-compatible build, that can then be used as fallback when native compilation isn't possible. The main use case is using this package on regular web browsers, which in turn allow to run dependent packages such as
text-buffer
inside web browsers.