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?
A pure JavaScript implementation of Git for Node and browsers
171–180 of 203 posts
Re: A pure JavaScript implementation of Git for Node and browsers
#172Earlier 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.
Re: A pure JavaScript implementation of Git for Node and browsers
#173The 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
#174Earlier 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 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
#175Earlier 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).
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
#176I 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?
Re: A pure JavaScript implementation of Git for Node and browsers
#177Earlier 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 )
Re: A pure JavaScript implementation of Git for Node and browsers
#178Earlier 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…
Re: A pure JavaScript implementation of Git for Node and browsers
#179Earlier 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.
Re: A pure JavaScript implementation of Git for Node and browsers
#180Earlier 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?