3 ms·
They've somehow managed to make the two least optimal choices of language possible. The full node daemon, hsd, is written in Javascript. A non type safe l
by RL_Quine 7y ago
They've somehow managed to make the two least optimal choices of language possible.
The full node daemon, hsd, is written in Javascript.
A non type safe language with poor package management for consensus critical code.
We also have a light client, hnsd, which is written in C
A non memory safe and error prone language for client code people would run on their systems as root.
- lifty 7y agoI hope more implementations will become available. It’s a decent start, since the C based light client doesn’t expose any services.
- RL_Quine 7y agoYou can't say that a C daemon interacting with a network has no attack surface, especially as the thing runs as root. It promiscuously makes outgoing TCP connections to an unauthenticated P2P network, so given enough time you'll eventually interact with an attacker if there is one.
- pinhead26 7y agoWell at least you don't have to worry about package management, all the dependencies are built by the organization either from scratch or with vendored code. Re: JavaScript, you should take a look at the code in repo, it's excellent. There is a such thing as great Javascript code and bcoin/hsd are prime examples.
- heartbeats 7y agoBetter the cannot open shared object file: No such file or directory you know than the left-pad you don't.
- RL_Quine 7y agoI'm very aware of bcoin. https://npm.anvaka.com/#/view/2d/bcoin https://npm.anvaka.com/#/view/2d/bcoin Many steps of indirection away we find things like this include. https://github.com/juliangruber/isarray/blob/master/index.js https://github.com/juliangruber/isarray/blob/master/index.js module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; Javascript is an absolute joke of a language.
- judge2020 7y agoDon't forget https://github.com/sindresorhus/number-is-nan/blob/master/index.js https://github.com/sindresorhus/number-is-nan/blob/master/in...
- chirss 7y agoFor real, it can't even work with regular expressions decently.
- Ajedi32 7y agoI don't really see the problem. On any remotely modern version of Node that's just a noop. On ancient versions of Node its a very useful polyfill.
- skilgarriff 7y agoWe have a Rust implementation in the works: https://github.com/UrkelLabs/rsd https://github.com/UrkelLabs/rsd It's not a full node implementation yet, but will be there soon!
- deleted 7y ago[deleted]