Live data from Hacker News

A pure JavaScript implementation of Git for Node and browsers

github.com

171–180 of 203 posts

Re: A pure JavaScript implementation of Git for Node and browsers

#171

Earlier quoted context omitted.

It depends what you call “readable” I guess, if you think it as : “I can have a glance at this code and feel comfortable”, then obviously C is more readable than Rust, because Rust has a quite a few specific syntaxes that will feel alien to anyone not accustomed. But I'm not sure this metric is relevant. And on the other hand, if you call “readable” the ability of someone knowing the language to get on board of an ex…

Which information in particular is missing from the C type system in your opinion?

For better or worse, Rust has a lot more built into its type system, including semantics for type safe generics and safe memory management. This makes it harder to write a correct Rust program, but also it makes it harder to write an _incorrect_ Rust program.

Re: A pure JavaScript implementation of Git for Node and browsers

#172

Earlier quoted context omitted.

I think the point is less that Rust runs everywhere that C runs, and more that there doesn't exist an environment that can run Rust and not run C (which is not true for Javascript)

Can you clarify this point? To me it would seem with Rust being able to target WASM/ASM.js that you could indeed target all the same environments JS does.

Emscripten means that's not a distinguishing feature from C or C++.

Re: A pure JavaScript implementation of Git for Node and browsers

#173
I've been using this library for a few months and want to give props to wmhilton who's been incredibly responsive with the couple of issues I've encountered.

The thing I like the most is that the API matches very closely to git's CLI, so if you know git, you know isomorphic-git.

I gave other libraries a try before settling on this one (spent a whole daying playing around with the optios). IIRC I decided to use isomorphic-git because the alternatives were either abandoned or simply broken.

Re: A pure JavaScript implementation of Git for Node and browsers

#174

Earlier quoted context omitted.

It depends what you call “readable” I guess, if you think it as : “I can have a glance at this code and feel comfortable”, then obviously C is more readable than Rust, because Rust has a quite a few specific syntaxes that will feel alien to anyone not accustomed. But I'm not sure this metric is relevant. And on the other hand, if you call “readable” the ability of someone knowing the language to get on board of an ex…

Which information in particular is missing from the C type system in your opinion?

The two major important improvements Rust type system brings are :

- the ownership of your object (who is in charge of free-ing it) and the lifetime of the pointers that targets this object. (the whole ownership system & the borrow-checker)

- is some data-structure thread-safe. (the Send and Sync traits)

With those, you can take any Rust code and play with it without having to ask existential questions. Your code will never segfault or exhibit a strange intermittent bug ones you add multi-threading.

Less important but still really convenient on a daily basis:

- will this function mutate the value I give it. (&mut pointers)

- has this variable already been consumed, which means I should not touch it anymore (affine type)

Re: A pure JavaScript implementation of Git for Node and browsers

#175

Earlier quoted context omitted.

It depends what you call “readable” I guess, if you think it as : “I can have a glance at this code and feel comfortable”, then obviously C is more readable than Rust, because Rust has a quite a few specific syntaxes that will feel alien to anyone not accustomed. But I'm not sure this metric is relevant. And on the other hand, if you call “readable” the ability of someone knowing the language to get on board of an ex…

> then Rust wins easily because the type system gives you all the information you need straight in front of you The trait system can actually make following execution a bit harder (just like runtime polymorphism in C++), because you have to find the allocation to know the concrete type of what you're looking at. C is much clearer from this point of view (but more limited for the same reasons).

Cough!, void pointer, cough!

Traits are used to express generality, when you need it. If you don't need to be generic over your input, you don't need traits. And when you need it, Rust makes it more explicit than C (and also more performant because it's statically dispatched by default).

Re: A pure JavaScript implementation of Git for Node and browsers

#176
post #10

I think it's interesting how there's two phenomena that seem to be related to me that get posted here and seem to get treated with different responses. One the one hand, we have software originally written in C/C++ being rewritten in Rust (not often, sometimes just conceptualized), and there's often a real push back by some people about how it's a waste and not useful. On the other, we have software rewritten in Java…

we have wasm now. why is anybody writing anything in javascript ever nowadays? some form of religious self chastisement?

Because we have to support IE 11.

Re: A pure JavaScript implementation of Git for Node and browsers

#177
post #168

Earlier quoted context omitted.

Do you have real examples of that? I hear people say this happens more than it happens; I’ve only seen it maybe twice ever.

I havent made any bookmarks about that but I recall such things appearing here time to time, in threads and as posts. (Edit: there are nearly 4.5k issues with their title containing rewrite rust on github: https://github.com/search?p=2&q=rewrite+rust&type=Issues )

Well, from just the repo language panel in the left, it looks like the vast majority of those are issues including those words on rust codebases.

Re: A pure JavaScript implementation of Git for Node and browsers

#178
post #134
post #129

Earlier quoted context omitted.

This should be expected. Rust isn't a new machine: It's the same old dumb machine, with some extra manoeuvres that make things "safe" (except when you say "unsafe"). It's not even remotely interesting to anyone who isn't troubled frequently enough by those things that need more safety. JavaScript on the other hand, is a new machine: It's the most widely distributed networked machine we have, and it's amazing for that…

I do not think that javascript as a language has much advantages for learning than, let's say Lua or Python. However, the fact that it is linked to HTML and DOM make it very easy to have immediate feedback without installing any tooling or IDEs. But then, modern JavaScript is quite different from what one can learn just by using the devtools. I think that once one starts to use more advanced js tooling, things get qu…

You're making a mistake of putting a box around "JavaScript the Language" -- even admitting a concession of "HTML and DOM" you miss the point: Lua and Python do not have billions of devices able to download and run their applications. Python and Lua don't have that by a long shot.

Re: A pure JavaScript implementation of Git for Node and browsers

#179
post #130
post #129

Earlier quoted context omitted.

This should be expected. Rust isn't a new machine: It's the same old dumb machine, with some extra manoeuvres that make things "safe" (except when you say "unsafe"). It's not even remotely interesting to anyone who isn't troubled frequently enough by those things that need more safety. JavaScript on the other hand, is a new machine: It's the most widely distributed networked machine we have, and it's amazing for that…

I don't get your point at all? Rust works on the web too.

Rust works on the web by converting it to JavaScript.

Re: A pure JavaScript implementation of Git for Node and browsers

#180
post #138
post #129

Earlier quoted context omitted.

This should be expected. Rust isn't a new machine: It's the same old dumb machine, with some extra manoeuvres that make things "safe" (except when you say "unsafe"). It's not even remotely interesting to anyone who isn't troubled frequently enough by those things that need more safety. JavaScript on the other hand, is a new machine: It's the most widely distributed networked machine we have, and it's amazing for that…

>"runs" on such a wide variety of terminals including [...] space satellites, and so on." There are satellites running javascript?

Yes! JavaScript is also running in the space station!
Post reply on HN