-
Notifications
You must be signed in to change notification settings - Fork 89
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
C++ for production web development? #17
Comments
Hi @rygo6,
asm-dom is a minimal virtual dom that can be easily used to build a framework, just like snabbdom. It would be interesting to develop something similar to react, class components with lifecycle and so on. Here is a simple example of that. |
@mbasso, I like this project too! Very upset this isn't in GitHub trending :( About "complex mechanisms". You can just create a lot of plugins for asm-dom and we will be able to use them like usual c++ libraries. Some example names
And so on. And we will be able to use it like this: #include <asm-dom-plugin-state> |
Sorry for not responding to this for so long. Went on a bit of detour in my personal life and projects. But started looking at this again. I agree with the approach of keeping this repo as simple as possible. How do you think we would deal with pulling together all the different modular pieces of a large project? Could we rely on NPM for modular pieces? Can you distribute C++ through NPM? I read through some more of your cpp code, and also some of snabdom. I realize I am actually kind of naive on all the thinking behind the design of a virtual dom. I was curious, did you by chance base this implementation off of a description of virtual dom in a book, or article, somewhere which I could also read to get a better understanding of the thinking behind it? |
Do you think most of the foundation is available such that a framework (like React) could be written in C++? Or is there more JavaScript integration that's needed? |
Don't worry 😄 We all have our personal life
At the moment asm-dom needs both C++ and JS imports to work properly... I'm planning to remove the last ones in order to improve the public API and have only C++ files. However, at the moment I'm not able to identify the right package manager, indeed, I'm not sure about the decision to use NPM...
I based the implementation of asm-dom on snabbdom simply reading thorugh the source code... I've also read the implementation of preact, which is a really performant virtual dom with the same APIs of React, and inferno that is also interesting too. preact uses a DOM recycler and inferno uses bitwise operations to speed up the critical path, as asm-dom does.
I'm not an expert of the internals of React but I know that the core module and the one to interact with the DOM are well separated. The second is just a renderer of the first one that I think it could be easily written in C++. We should try to confirm it but I suppose it's possible. |
In terms of managing modules, I personally never saw what was so terrible with git modules. The only big issue I see is that it doesn't automatically clone all dependencies for a module. But honestly thats one of the things I kind of hate about npm, you add a module to draw a bar graph, then it adds 50 more modules to node_modules. Maybe manually having to git submodule add each depdency would make people conciencious of what their dependencies are. But maybe it could warrant an expansion to git? Perhaps 'Git Dependencies". A repo would have have an extra .gitdepedencies file that would list all the dependencies for the repo. Once it clones a repo from .gitdependencies, it would check for .gitdependencies in that repo and do the same. But it would clone all repos in .gitdependencies under a single folder in the root, in a single "dependencies" directory that would be akin to node_modules. |
On the subject of my last post. have you guys seen this? Looks to be the exactly perfectly alternative to npm that would work well for something like this. |
Some more reading, this seems more popular: |
Cool, sounds good. At the moment I'm modifying a little bit the internals of asm-dom (and a few public api, but something really small) in order to continue with the multithreading smoothly... I'll open a "Work in progress" PR one of these days. |
I found this after much googling for the possibility of making a website entirely with C++ and webassembly. So far it's quite impressive, everything I have seen so far I would have done the same way. I am trying understand it a bit more. I am really interested in pushing to create a full C++ tooling to do production web apps, hopefully being a complete alternative to react and node.
This project seems to be the only thing I've seen so far that has taken seemingly a correct step in that direction. So I am curious to almost like brainstorm on this. Where do you see asm-dom going? Are you hopeful for comprehensive C++ web tooling? Is such a thing plausible or ideal? What missing components do you think are necessary?
The text was updated successfully, but these errors were encountered: