5 ms·
A database implemented in JS; very encouraging. I guess performance and robustness were not a priority.
by budabudimir 6y ago
A database implemented in JS; very encouraging. I guess performance and robustness were not a priority.
- markhenderson 6y agoWell, I imagine you'll be happy to know that some of us have begun IPFS implementation in Rust: https://github.com/ipfs-rust/rust-ipfs https://github.com/ipfs-rust/rust-ipfs
- budabudimir 6y agoDefinitely a much better choice
- haadcode 6y agoCan you elaborate why you think Rust is a better choice?
- budabudimir 6y agoI would have said that for any statically typed language. It simply leads to more robust software because compiler rejects large set of incorrect programs that would otherwise end up in production. Your test coverage has to be much larger just to verify that your program is sane on the most basic level. Rusts compiler is even stricter than most. Not to mention resilience to change, JS is simply a blunder
- haadcode 6y ago> I guess performance and robustness were not a priority. You'd be surprised how well JS does on both fronts, in addition to being able to run across platforms :)
- brabel 6y agoPerformance-wise, JS is not too bad when you have lots of IO going on, as in this case... but robustness? You gotta be kidding! JS is the poster child of a language does NOT have robustness as one of its attributes. Just about every single one of its design decisions makes robustness difficult.
- wayneftw 6y agoYou should check your definition. Define robust: 1. Strong and healthy; vigorous - (of a process, system, organization, etc.) able to withstand or overcome adverse conditions. JS is the most robust language we have according to the main definition, however you measure it. What other language is as alive as JS right now? What other language has as much programmer attention? JS is also easily robust according to the noted sub-definition. What other language would survive the web? The web, an environment that could easily be described as "very adverse"... What other language is ready to run in a browser where it will be dynamically and continuously mixed with modules from many different sources, without breaking? JS was built for this. What other popular language is so easily runnable cross platform? What other popular language lets you program with both OOP and functional paradigms while also being as popular as JS? What other popular language lets you monkey patch things to fit a piece of code into any situtation? Robust means all of these things to me. What does robust mean to you and what is your example of the most robust programming language? You didn't say... None of these fit the bill: Python, Ruby, C, C++, Golang, Rust, C#.
- brabel 6y agoYou are arguing for the sake of arguing. OP said JS is not a good choice when performance and robustness is important... any programmer knows exactly what they mean, but I will spell it out for you as you clearly do not get it: if you're going to write a DB, you want it to be performant (run fast) and robust (does not fail or lose data, or get into a corrupt state easily). JS is absolutely not the first choice when performance is very important, but I concede it can run fast enough for some kinds of a applications... but would a DB written in JS be robust? The answer by anyone who knows anything about programming languages has to be a big NO! Any language that has a dynamic & weak type system, and where monkey patching is not only allowed but used widely, cannot make a claim to leading to robust software. I would argue that languages focusing on correctness are the ones that would have a good claim at producing more robust software. As you've asked, I would say that Rust, Ada, Haskell fit the bill... but even languages that focus on keeping simplicity and boring uniformity at scale, like Go and Java, could still make such claim (and lots of software written in them can be described as robust) a lot more than JS, which offers basically 0 features focused on correctness beyond the bare minimum.
- haadcode 6y agoThere's also a Go implementation at https://github.com/berty/go-orbit-db https://github.com/berty/go-orbit-db