A git implementation in pure JavaScript
github.com
github.com
If history has a lesson, most of this will not be wildly successful, because the js environment is not suitable for the task to be an actual practical solution.
Sure there are some issues with js, eg binary support in browser is painful, and it is slow, but Java started off slow and lacking features too. It is improving.
Is now a good time to work on things like this? Why not. Especially if they feed into language and API improvements.
Not sure. Lots of people reimplemented lots of stuff for Java, but it turns out Java was only successful in the sweet spot for it (networked server side language); it never replaced C/C++ in any meaningful way.
I expect the same with JavaScript, it will flourish in its niche (in particular as it has a monopoly as the in-browser-language), but it won't replace established languages on their respective home turf.
Maybe "replace" is a bad word though. Java complimented C/C++, creating a whole new market.
Essentially Java replaced C++ in most of the enterprise programming market.
I beg to differ. By using a custom look and feel or rendering your own UI using Java2D, it is entirely possible to make attractive software in Java.
I also neglected to mention that people are making attractive apps using Java on Android.
However there is great benefit to this young language when a popular utility can be implemented to highlight the weakness of a particular runtime implementation, or even the underlying language.
Git/Hg clients touch network io, file io, and rudimentary hashing in the normal execution path. So it makes for a good subject.
There's more than one way to do it.
There's tons more to do :)
Yes, there were a few issues with js-deflate, but once I figured out exactly what zlib was and what js-deflate does it fell into place. I also had to patch it to support returning the length of the compressed data read, otherwise there was no way to know how much of the stream it had consumed.
I was particularly interested in different storage methods for git repositories in-browser -- like localStorage, or (for fun) writing the git data to a canvas, extracting it as a PNG, and uploading it to a static file server which would then send it back as a "cache forever" image; you could then extract all the data back out of the PNG by writing it to a canvas and running through the image data. Also fun: writing a backend that relies on Github's raw object API [1] Or, on the server, running a SQLite backend for repo data. The possibilities are endless :)
Did you consider just compiling the C implementation into JavaScript? If so, I'm curious why you didn't go that route.
Any application that can be written in JavaScript, will eventually be written in JavaScript.
http://www.codinghorror.com/blog/2007/07/the-principle-of-le...
That said, viewing a git repo in a web browser by querying the repo over HTTP directly is pretty damn cool.
By asking, he might learn something, especially if the reason turns out to be one he had not thought of.
Perhaps in this particular case the questioner WAS trying to be rude, but that's not relevant to my reply to hvs. Note hvs said he could not understand why this question is asked on HN. He was talking about people in general who ask "why", not this particular questioner.
I'm astonished that anyone would be surprised that on HN, of all places, that people would be curious about why someone is doing something. One of the defining characters of hackers is curiosity.