4 ms·
Looking at this rewrite I was wondering, but didn't find an answer in the project README: would emscripten successfully compile Git to js/wasm?
by ronjouch 8y ago
Looking at this rewrite I was wondering, but didn't find an answer in the project README: would emscripten successfully compile Git to js/wasm?
- viraptor 8y agoThere's still a bit of bash hiding in the git commands if I remember correctly. That wouldn't be trivial to compile.
- iguessthislldo 8y agoI was going to write: "Simple, we just make a bash compiler", but I realized this might have already been done and to my horror a quick google search confirmed this, or more technically a sh to C transpiler: http://www.linux-magazine.com/Online/Features/SHC-Shell-Compiler http://www.linux-magazine.com/Online/Features/SHC-Shell-Comp...
- mr_toad 8y agoGit has its claws deep in the file system. On the browser side, JS and wasm have very limited access to the file system. You’d need to somehow bridge that gap. (It looks like isomorphic-git is using indexdb, and not the file system). There’s probably other dependencies (ssh, http, an editor for commits) that need to be resolved to get expected functionality.
- jvilk 8y agoYou're right; when it is running in the browser, isomorphic-git does not have access to the operating system's file system. Instead, it uses BrowserFS [1], which emulates a file system abstraction on top of arbitrary storage backends. It supports IndexedDB, localStorage, and Dropbox, among others. (Disclaimer: I am the author of BrowserFS.) [1] https://github.com/jvilk/BrowserFS https://github.com/jvilk/BrowserFS