Earlier quoted context omitted.
I've never understood why this question is asked on Hacker News. Can you really not imagine why someone would try to do this, even as just an intellectual exercise?
Perhaps he has sufficient imagination to come up with two or three possible reasons why someone might do this, and hence is asking so as to find out which is the actual reason. By asking, he might learn something, especially if the reason turns out to be one he had not thought of.
A git implementation in pure JavaScript
21–30 of 38 posts
Re: A git implementation in pure JavaScript
#22The node.js JavaScript surge reminds me a bit of the early days of Java, where everyone went to implement whatever existed in C/C++ for Java. Only that this time people stick a ".js" in the end instead of a "J" in the front. 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.
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.
Re: A git implementation in pure JavaScript
#23The node.js JavaScript surge reminds me a bit of the early days of Java, where everyone went to implement whatever existed in C/C++ for Java. Only that this time people stick a ".js" in the end instead of a "J" in the front. 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.
Surely if that bit of history says anything then this will be successful? There is a big incentive for languages to reimplement natively, for Java it was cross platform consistency and security, for js in the browser it is complete unavailability of a native code API. (for node.js I am not really convinced though). Sure there are some issues with js, eg binary support in browser is painful, and it is slow, but Java s…
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.
Re: A git implementation in pure JavaScript
#24Any application that can be written in JavaScript, will eventually be written in JavaScript.
http://www.codinghorror.com/blog/2007/07/the-principle-of-le...
Re: A git implementation in pure JavaScript
#25Earlier quoted context omitted.
Surely if that bit of history says anything then this will be successful? There is a big incentive for languages to reimplement natively, for Java it was cross platform consistency and security, for js in the browser it is complete unavailability of a native code API. (for node.js I am not really convinced though). Sure there are some issues with js, eg binary support in browser is painful, and it is slow, but Java s…
Surely if that bit of history says anything then this will be successful? 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 i…
Maybe "replace" is a bad word though. Java complimented C/C++, creating a whole new market.
Re: A git implementation in pure JavaScript
#26Earlier quoted context omitted.
Surely if that bit of history says anything then this will be successful? 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 i…
It did replace C/C++ in a meaningful way. I think there's probably more Java jobs out their than C/C++. Though C/C++ is still much better than Java in a lot of areas, no doubt. You can't write a good looking app, or get write a kernel. Maybe "replace" is a bad word though. Java complimented C/C++, creating a whole new market.
Re: A git implementation in pure JavaScript
#27Earlier quoted context omitted.
It did replace C/C++ in a meaningful way. I think there's probably more Java jobs out their than C/C++. Though C/C++ is still much better than Java in a lot of areas, no doubt. You can't write a good looking app, or get write a kernel. Maybe "replace" is a bad word though. Java complimented C/C++, creating a whole new market.
That's what I mean, Java didn't replace C++, it found its own market. Thus there is little point in porting everything (for appropriate values of everything) to Java (or JavaScript); you aren't gonna need it there.
Essentially Java replaced C++ in most of the enterprise programming market.
Re: A git implementation in pure JavaScript
#28Awesome, when this can do writing (presumably with an in-memory store for now), I think there will be some really interesting in-browser version control uses.
Re: A git implementation in pure JavaScript
#29I thought about doing an in-browser git implementation for enabling offline mode in a webapp. Doing things with git would make some really interesting sync scenarios possible. Looking at what was involved though, I think I'm glad I didn't go down this particular rabbit-hole.
Re: A git implementation in pure JavaScript
#30Earlier quoted context omitted.
I've never understood why this question is asked on Hacker News. Can you really not imagine why someone would try to do this, even as just an intellectual exercise?
Depends if porting code from one procedural language to another is an "intellectual exercise" (it usually isn't). Compare with the x86 emulator written in JS that we saw a few months back. That said, viewing a git repo in a web browser by querying the repo over HTTP directly is pretty damn cool.