by RL_Quine · 6y ago · 0 comments
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.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.
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
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
Javascript is an absolute joke of a language.It's not a full node implementation yet, but will be there soon!
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.