Live data from Hacker News

A git implementation in pure JavaScript

github.com

31–38 of 38 posts

Re: A git implementation in pure JavaScript

#31
post #19

The 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.

Feel free to use Gitteh, then: https://github.com/libgit2/node-gitteh.

There's more than one way to do it.

Re: A git implementation in pure JavaScript

#32
post #16

Earlier quoted context omitted.

this looks really cool. i was actually working along the same lines ( https://github.com/chrisdickinson/tempisfugit ) to get a pure JS git implementation, though now I'm a little disconcerted since your project looks so fully featured :) One question: I noticed that you got dakongai's js-deflate library working with git -- I had tons of problems with getting it to read deflated git objects (mostly, that it wouldn't d…

Nice! Looks like we've done a lot of the same stuff here. Does tempisfugit require filesystem git repos currently? 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.

Thanks -- yeah, at the moment it's tightly bound to node's 'fs' module, though I was planning on abstracting it so you could use 'FileData' in modern browsers. I've got the three ODB's implemented (and, I think, most of the types within) -- loose, packv1, and packv2. I've also found that the jxgcompressor seems to run faster than js-deflate -- you might check that out.

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 :)

[1]: http://develop.github.com/p/object.html

Re: A git implementation in pure JavaScript

#33
post #18

Earlier quoted context omitted.

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.

You're probably just playing the devil's advocate, but it's plainly obvious that the guy was just being rude. If he was actually interested in an "I can see so many reasons you'd make this" kind of way he wouldn't have been so curt.

I don't see that "why?" is curt. It is succinct.

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.

Re: A git implementation in pure JavaScript

#35
post #25
post #23

Earlier 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.

You can't write a good looking app

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.

Re: A git implementation in pure JavaScript

#36
post #11

OK, I was going to implement write support before posting it up here, but glad you guys like it. There's tons more to do :)

Cool project!

Did you consider just compiling the C implementation into JavaScript? If so, I'm curious why you didn't go that route.

Re: A git implementation in pure JavaScript

#37
post #25

Earlier 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.

You can't write a good looking app 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.

Normally I don't comment on meta issues like downvotes, but as someone who writes attractive Java software, could someone please explain why my comment addressing a common misconception is receiving multiple downvotes?

I also neglected to mention that people are making attractive apps using Java on Android.

Re: A git implementation in pure JavaScript

#38
post #24

Yet more evidence of Atwood's Law: 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...

One could consider this[1] as a full realization of Atwood's Law.

[1] http://bellard.org/jslinux/

Post reply on HN