5 ms·
Does anyone remember when the trend was towards expressivity in languages? At th time that meant dynamically typed languages like Ruby and Python. The pendulum
by andybak 4y ago
Does anyone remember when the trend was towards expressivity in languages? At th time that meant dynamically typed languages like Ruby and Python.
The pendulum has swung away from dynamic typing but are we sometimes sacrificing expressivity as a result?
I don't really know Rust but from what I've seen of it, it doesn't feel like a natural fit for the web - either front or back-end.
Maybe I'm missing something?
- KingOfCoders 4y agoAfter some years chasing exprssivity with Typescript and Scala, I now really enjoy the dumb simplicity of Go. I do think we'll see more simplicity (not Lisp-like) in the future.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- qtzaz 4y agoPersonally, I expected dynamic languages to ever match or at least get close to the performance of static languages. That seems that it will never happen, and there's a point where I can't afford that much hardware just to run a website. Think of Twitter abandoning RoR, etc.
- andybak 4y agoSeveral dynamic languages are faster than some static languages depending who you talk to. LuaJIT is famously fast and Javascript is no slouch
- bayesian_horse 4y agoBoth Python and Javascript are eating Rust's lunch in terms of popularity. And Typescript is just a typechecker, it's still a very dynamically typed language/runtime underneath. Especially with Rust you have to think way more about banalities of the data model you normally really don't care about in web development.
- TheRealDunkirk 4y agoYou are not missing anything. I think people are going crazy for strict static typing because they want to feel like they're on the front edge of progress. But I don't think it's _better_; I think it's just _different_. I got bogged down in with Java and Angular awhile back. The amount of boilerplate required to keep the front end and back end compilers in sync was treacherous. Also, I had to make exceptions for corner cases that wouldn't match up. So it was no benefit to me. Maybe if your application is large enough that it involves big teams on each side, you would need static typing to keep everyone straight. And I think this is a large part of the back-and-forth on this forum. We discuss things that vary based on problem context without realizing (or admitting) that the implementation is situational.
- jvanderbot 4y agoI disagree that you aren't missing "anything", there's no such thing as a free lunch. But I agree that _some_ of the uptick is because people are excited about being a "safe" and "rigorous" developer, but they get a nice package manager with Cargo that feels a lot like pip or npm. I get a question over and over from front end devs when I teach or mentor about being a "real" computer scientist and picking up c, Cpp, or rust, which is silly. Who do you think invented the dynamically typed languages, English majors?
- shrimp_emoji 4y ago>there's no such thing as a free lunch Yeah. The bill was paid when the language devs bothered to write a compiler, so that your runtime bugs become compiletime bugs and so you can understand what's happening when your program is bigger than a tiny script.
- wiz21c 4y agoI code alone and need performance for my project. I had choice beween C++ which I know a bit of; Go or Rust which I had to learn. Considering that I screw my mallocs and threads in C++ more often than not, I decided to check Rust. I am not disappointed: the safety helps a lot in getting my codebase free of many bugs (rust won't let me be lazy, I have to solve many bugs upfront). Sure the BC is madenning at times, but the support of the compiler allows me to not think too much about what I do and spend time on my business. Now, on my old PC, the compiler is super slow so I end up prototyping tricky stuff (like maths) in python and then I port it to rust when I feel it's ready. (my stuff is emulator: no DB, not much GUI but lots of performance, threading, etc.)
- ModernMech 4y agoIt makes more sense coming from the Rust side. For example, I can write a lightweight desktop app using the egui rust framework. But I can also compile that for the web, and run it in the browser. Basically for free, I just have to target wasm. This also means that if you architect your app right, you have have the front-end and back-end self contained in the same app, or split them over a network boundary. So let's say you are writing a 3d modeling app or something. You write the engine and the gui in rust, and you ship that binary to your users. You can then also, again basically for free, put a network between the gui and the rendering engine, then you can serve the gui to client browser, and handle the rendering on a server. The point is this is easy for the rust dev, so they don't need to be a JavaScript dev as well.
- krn 4y agoI believe that many people from Ruby on Rails and Django communities moved on to Clojure, Elixir, and Kotlin. Others chose between Rust and Go, if performance was the most important thing. The thing about dynamically typed languages and their expressiveness, is that you are sacrificing the ease of long-term maintenance for the ease of short-term prototyping. Personally, I am a big fan of Clojure as a tool for designing software, but I would prefer having to maintain a code base written in Rust.
- fulafel 4y agoEven the maintainability argument is suspect I think: Static type systems as commonly used are not very powerful compared with schema validation style approaches used in the dynamic languages world (eg malli or spec in Clojure world). Static types lose in expressiveness, flexibility of when & where they are enforced, and ability to pass around the data shape specifications as data. edit: and tangentially, the building and iterating lifecycle phase is of course usually the make-or-break bottleneck - maintenance phase sw engineering is comparatively a "happy problem".
- krn 4y agoThat's true, and Clojure (when used with metosin/malli) is probably the only reasonable alternative to statically typed programming languages in terms of long-term maintainability. Essentially, it's like two completely different reasoning models: inside-the-box (ALGOL / SQL), and outside-the-box (LISP / Datalog). The first model (ALGOL / SQL) is about designing for machines to better understand, and the second model (LISP / Datalog) is about designing for humans to better understand. I think that the main issue with dynamically typed programming languages is the lack of robust enforcement.
- kaba0 4y agoI believe it is a lost fight, but why have Rust and Go become a collocation?! It’s as faulty as C++ and JS.
- krn 4y ago
- rob74 4y ago"Compiled language" doesn't have to mean "much harder to read" though. I guess that's why many web devs like Go - it's a compiled language that feels more like a dynamic language because it tries to get the types out of the way as much as possible. Of course it doesn't have all the bells and whistles of Rust (now that generics were added, the next major complaint is nullability), but that's exactly what makes it easier to grok.
- nicoburns 4y ago> Maybe I'm missing something? IMO Rust is more expressive than most languages including languages like Python. Traits and enums are just... a joy to work with. It is also more constrictive in some ways, and a rust-like high-level language could do probably do better still (Swift/Kotlin/Elixir are close). There's also a tradeoff between expressivity and performance and correctness. The way I see Rust is you get maybe 75% of the expressivity, along with much better performance and correctness guarantees. I'd agree it's not a good fit for frontend, but IMO it's an excellent fit for backend.
- miniupuchaty 4y agoThat depends on what do you mean by expressive. I would call languages with more advanced type systems, like rust here, more expressive, as in allowing programmer to express his intention to both computer and other programmers clearer.