6 ms·
I actually appreciate domain-specific programming languages. It's fine (for me) that JS is the native front-end language. It's fine that Rust targets systems an
by jvanderbot 5y ago
I actually appreciate domain-specific programming languages. It's fine (for me) that JS is the native front-end language. It's fine that Rust targets systems and embedded. I love that Python is a middle ground, and really great backends are built on it. I'm great with C being a really low level language that forces me to think about the machine.
Taking "I'm productive in it so it is great" to an extreme, we end up seeing precisely the kind of domain crossover TFA hints at. Somehow, since Rust is cool, it should be the future of web / in-browser[1]. Somehow, since JS is popular and easy to use, it should be on the james web space telescope[2]. Somehow, since browsers are well accepted, node.js is a reasonable benchmark for embedded systems performance [3]
GTFO with that. That is how we get language bloat and the many overlapping frameworks that creep into the language and make it unrecognizable. I'm looking at you, Tokio and D3.
1. https://leerob.io/blog/rust https://leerob.io/blog/rust
2. https://old.reddit.com/r/programming/comments/bglvey/the_9bn_james_webb_space_telescope_will_run/ https://old.reddit.com/r/programming/comments/bglvey/the_9bn...
3. https://jaycarlson.net/embedded-linux/ https://jaycarlson.net/embedded-linux/
- samhw 5y ago> Somehow, since browsers are well accepted, node.js is a reasonable benchmark for embedded systems performance [3] NodeJS relies on V8, which is perhaps the world's most highly optimised interpreter (/JIT compiler/runner), and a spectacular piece of software. The v8.dev blog alone is fantastic reading for anyone who works on compilers, as I do. I don't like the 'dev' tendency in the programming community, to just hack stuff together and say "well, it works!", but I'm also not impressed by people trashing any high-level languages just because it's a meme they heard. V8 is phenomenally performant and is a hard benchmark to beat for anyone and anything, even at the compiled end of the spectrum. (Yes, it's beaten by C/C++/Rust/Go, but it's not to be sneered at, at all.) I'm struggling to equal it with the highly optimised Python JIT-assisted interpreter I'm writing for my work - even after relaxing the ABI and writing sophisticated instruction-set-specific optimisations. (And I'm writing it in Rust, just to score at least one point off the cargo-cult bingo card.)
- jvanderbot 5y agoThat is impressive, and not unexpected given the (likely) billions of dollars of investment in things like nodejs. I did not mean to disparage it in itself just because it was developed for a particular domain. However, if "An embedded system uses the internet to communicate" has become synonymous with "It runs linux and uses web services and nodejs" then that would be a perfect example of contorting the application to match the technology that more programmers are most productive with.
- samhw 5y ago> I did not mean to disparage it just because it was developed for a particular domain. Fair enough, that's all I was saying. I'd agree with you that the increased use of Node everywhere to build applications, with tools like Electron, is an utterly stultifying trend. It's fantastic for I/O-heavy 'server'-type code, and for using JS as an at least surprisingly performant interpreted language, but it's disappointing to see it replacing languages like Swift or C++ in computation-heavy systems programming - or domains which should be the preserve of systems programmers. > However, if "An embedded system uses the internet to communicate" has become synonymous with "It runs linux and uses web services and nodejs" then that would be a perfect example of contorting the application to match the technology that more programmers are most productive with. I absolutely agree. No quibble with you there! I'm a fan of using the best tool for the job. And, much as it's a meme, I absolutely adore Rust for lots of systems programming applications. PS: If what you love about Rust is its safety even more than its speed, then I'd recommend looking into Ada, which could be called the precursor of Rust. It has none of Rust's modern trendiness, but it's a mindblowing accomplishment in TypeScript/Haskell-grade type expressivity (with Rust-grade safety) while still retaining I-believe-greater-than-Rust speed.
- KwisaksHaderach 5y agoIt's fantastic for I/O-heavy 'server'-type code I have found nodejs frustrating for CRUD APIs, the is 'fantastic for heavy I/O' while true ends up guiding you to complex microservices(or trying to use a external services for everything) because you don't want to slow down the event loop as you add more and more cpu processing to your app.
- mrtksn 5y agoJavaScript itself is very powerful in its own domain(the DOM interactions in the browser) but most of the bloat comes from developers wanting to write JS in different way than originally designed. 20 years of JS frameworks and at the end of the day all they do is arranging HTML boxes through slightly different code. But why so many frameworks for the exact same output? It usually comes down to code management and making the code writing closer to the mental models of the problem they intend to solve. I find it very unproductive to try to force JS to fit in every domain possible because there are already very mature languages who were designed with that domain in mind. That said, JavaScript has the power of being able to run everywhere which gives it unique advantage in actually learning and running the code written in JS. I don't have a conclusion for this. I know JS and feels great to be able to run it everywhere, especially quick and dirty solutions are almost as nice as working with PHP. However, it easily frustrates me when trying to do something better than quick and dirty and start appreciating the domain specific toolsets. I guess the moral of the story is that JS is great but let's not try to solve every problem with it.
- everforward 5y ago> JavaScript itself is very powerful in its own domain(the DOM interactions in the browser) Imo, most of this benefit comes from being effectively the only way to interact with the DOM up until WASM (and I think I read that WASM still calls out to JS for DOM manipulation). If Python had a way to manipulate the DOM via shared libraries or something, I'd wager there would be equally powerful Python libraries (ignoring security concerns). Or phrased differently, I don't think anything about the design of Javascript is uniquely well suited to manipulating DOMs, it just has a monopoly on manipulating the DOM. > most of the bloat comes from developers wanting to write JS in different way than originally designed I think a big part of this is that Javascript has become a much more integral part of websites than it was originally intended to be. My impression is that it was designed to add a little bit of interactivity, not for people to ship a nearly blank HTML file and then fill in the entire page using Javascript. That's not to say it's a bad idea, I just don't think it was designed for that and we have some warts and a lot of changes to allow us to implement that modern paradigm. I strongly suspect some form of parallelism would have been included if we had known what modern frameworks would look like.
- marcos100 5y agoTokio as in the rust Tokio runtime? You think that, because of tokio, rust became more bloated? Why? I know rust, but I haven't used async apart from their tutorial, so I'm really curious about what are your thoughts about it.