9 ms·
Strange takeaway in the title. Mine are: - He regrets introducing threads. He now prefers other parallelism/concurrency paradigms and is possibly looking into
by pdimitar 7y ago
Strange takeaway in the title.
Mine are:
- He regrets introducing threads. He now prefers other parallelism/concurrency paradigms and is possibly looking into introducing them in Ruby 3 (that part wasn't clear in the interview).
- He regrets adding global variables.
- He regrets not focusing on immutability primitives earlier.
- He and the maintainers team look at Python, JavaScript and Elixir for inspiration.
- He seems a bit disappointed that Ruby is mostly used for web development only and would be happy if it was used in research and AI.
- He regrets not investing even a little effort in static typing earlier but is now working on an optional typing system where you choose to describe types in a separate file. (Reminds me of C/C++ and OCaml header files.)
I hope I’m not subconsciously emulating a sensationalistic journalist here but it doesn’t seem he’s very pleased with the current state of affairs. A lot of changes, indeed inspired from other languages, seem to be on their way to Ruby 3.
---
I’m pretty indifferent to Ruby these days. I’ve worked 6 years with Rails to a moderate financial success back then but the problems were obvious almost from the start: too much magic and implied behaviour, too much global stuff changing below your feet, way too slow DB layer (it’s known that your DB will respond in 2ms and ActiveRecord will proceed to waste 100+ ms on serialisation before and after), managing bigger projects becomes huge pain, and a number of others.
People just keep buying the promise of “but you get to make an MVP really quickly!”. Yeah well, but I want to maintain it past that stage too.
Where I was doing with this is: Ruby is a very okay language and is very nice for sketching. It's readable, has libraries for a ton of stuff, and performs alright (especially without Rails). But I never found good use of it outside of small projects. Any serious business work becomes very painful to maintain and stay on top of for bigger projects. I’m aware there are practices that make it possible (Basecamp is a huge inspiration!) but I personally found them only half-working.
YMMV, of course.
- norswap 7y agoGood points. Personally, it's a bit puzzling to me why the ML community ran with Python and why there isn't a popular alternative for Ruby. It's very capable in terms of making DSLs. My hunch is that the number-crunching libraries were better in Python (numpy etc).
- pdimitar 7y agoI spoke with several data scientists and students in the last 2 years and the consensus was basically two central points: 1. NumPy is really fast and has a lot of features. Even if they don't need all of them they feel more at ease knowing that they can use them should the need arise. 2. Python is very familiar to them, their professors know it, they know it, it's easy to teach to new people in the team so everybody just goes with the flow. As much as I think the bigger IT area is in a desperate need of innovation... I can actually agree with those two points. Tinkering should be left to us the programmers and sysadmins. Everybody else has a job to do and they cannot and won't spend a lot of time evaluating all tech possibilities. That's okay. It's our job to tempt them with something irresistible. :)
- Gravityloss 7y agoBut those are reasons that are valid afterwards. Why weren't the good numerical libraries developed for Ruby? Maybe the watershed moment was when MIT switched from Scheme to Python? I don't know.
- pdimitar 7y agoReally good question. And I have no clue. But I believe (can't prove) that you are correct on the outset: some big org switched, then a lot of people went like "oh well, Org X can't be wrong", and the rest is history.
- simtel20 7y agoThis isn't how I remember it. I remember that prior to the scientific python stack, you had to pay for Matlab or mathmatica licenses. The scientific python stack meant that for essentially free, you no longer had to justify licenses at any financial or educational institutions. You could just load up your code and run it against your data. In academia this meant that every student could do their homework on their desktop or laptop (if they were motivated). Even in financial companies, the decision was often made to limit the number of licenses - and in most cases they weren't used to actually run production jobs. Quants had to translate their work to another language with the help of their developers. With the scientific python stack you entered a new world with unlimited seats, you could at least try to run the same experimental/exploratory code with minimal changes in a production environment, etc. So in short it didn't need some tentpole user/customer/exemplar. In almost any situation it was free and it started making money as soon as it was downloaded installed and run.
- draw_down 7y agoI didn’t really work in Ruby during those times, but I do today. I like it, I find it a very “plain” language to work in. I mean plain in the beneficial sense, Ruby makes it easy to write boring code. It has too many bells and whistles, such as all the OOP doodads, but I try to avoid those and just write functions. I don’t really find it magical, though if I spent much time working in Rails I probably would. But, there is Ruby without Rails. I recommend it, in fact.
- pdimitar 7y agoAs you yourself found out, writing in Rails is very different. You can go crazy with all the things happening without your knowledge. I liked the productivity that Rails gave me back then but it very often felt like that the expertise you get is the result of a series of traumas (a lot of "Why the hell did this thing change 0.5 secs later?! I didn't tell it to do that!"). I worked on 3 smaller projects with Sinatra and Sequel and it was worlds better. Commercially speaking though, there aren't many Ruby job offers that don't require Rails. I still occasionally use Ruby when I don't trust bash/zsh with a slightly more complex automation flow but outside of that I find no uses for it. Elixir and Rust do it all for me these days. I know I am getting biased and I am not fighting it. I need to get jobs done and at certain point always searching for a new tool gets very unproductive, not to mention stressful and soul-draining.
- cutler 7y agoHow do Elixir or Rust help you with front-end/UI? It seems you would need at least Javascript and maybe more if you're going to produce mobile apps.
- pdimitar 7y agoElixir has LiveView, which can eliminate 90% of your JS by simply offloading frontend computations to the backend and utilising WebSockets streams to do it. It's pretty neat. Rust, AFAIK, doesn't. But you are right of course, if you want to cover the full-stack then JS is mandatory.
- 7y ago
- matheusmoreira 7y agoRuby could use a proper module system as well. Ruby's require evaluates Ruby code and changes global interpreter state. Python's modules are so much better. Javascript's require is so simple: a function that returns a module object.
- jeltz 7y agoAs someone who codes in Ruby daily this is my by far biggest issue. Ruby's performance is pretty good (I do not use Rails or ActiveRecord) and while the state of concurrency is not ideal it is not really an issue in practice for me, but the lack of a proper module system forces me to invent unnecessarily long and convoluted names.
- vidarh 7y agoThat would be a very jarring change. Ruby class definitions are executed to define a class. There is no way to statically define a class in Ruby. This is frequently used. E.g lots of Ruby libraries add class methods that are executed during the definition of a class to mutate it during definition. This is Ruby's alternative to macros. As such, you'd gut large parts of the language if you stopped evaluating code on require.
- pdimitar 7y agoYep, but that's a post factum worry. It's not an inherent trait of being a dynamic language that automatically surfaces during its development. Ruby's creator(s) simply chose to do it like that and now, of course, it's too late to do any sort of revolutionary changes. Hi btw! Just now noticed it's you. :) Was thinking to write you an e-mail very soon. Which one do you prefer?
- vidarh 7y agoYes, of course it could have been done differently from the start, but as you say it's now impossible to change. Though my Ruby compiler project (that seems like it will take the rest of my life at this point...) would have been far easier if it was more static. That said, I think it's less of a problem in practice - most code does things that can be fairly easily statically determined and/or that isn't actually doing anything particularly nefarious to other classes. A lot of the worst abuses that are possible with Ruby are also things I've never seen done intentionally in the wild other than as examples, and where deprecating and explicitly breaking them wouldn't do any harm. > Hi btw! Just now noticed it's you. :) Was thinking to write you an e-mail very soon. Which one do you prefer? Sure :) Same old e-mails (also on my HN profile page).
- deleted 7y ago[deleted]
- blondin 7y ago> It's readable... when you start to learn a new programming language, you look up what people are doing. ruby let programmers write incomprehensible and unfriendly code. my experience is that it has been a huge turn off for beginners. there was a rush to make popular websites in the rails era, but that ended quickly. as another example, cpp used to be a cool language to read and write in. they even taught it as first programming language. since then, they added some crazy stuff that made the language very unfriendly when put in the hands of some people. it is now very beginner unfriendly. the syntax of python will remain a great inspiration for readability if they don't make the same mistakes. it always amazes me to see people from all levels read python the first time and get it.
- pdimitar 7y ago> there was a rush to make popular websites in the rails era, but that ended quickly. I so much want to agree with you here but I can't. 99% of all business people I've ever met are all about "Alright! We got the perfect idea! Let's have the first iteration done next week!" -- has been the sad reality of most of my bootstrapping conversations. Even if they aren't a young-ish enthusiastic bunch they still are going to go to whoever promises them the fastest delivered MVP. IMO to this day Rails is a big winner in the MVP area -- although I will immediately agree that nowadays there are no small amount of other technologies that can give you a pretty good-looking and well-working MVP (mostly in JS land I think). But a lot of business people just managed to memorise that Rails is the way to go for MVPs. Their mind isn't easily changed. Now those several whom I talked with in the last 1-2 year were like "yeah yeah, you techies always chase the newest thing" -- and sadly they are often correct. So the hope of breaking free from Rails' "monopoly" on making MVPs looks pretty slim lately, to me at least. I fully understand the business people's desire for things not to change often. But they vastly overestimate the viability of most of the tech out there. Or maybe it suits their bias. No clue.
- bitbang 7y ago>the syntax of python will remain a great inspiration for readability if they don't make the same mistakes. it always amazes me to see people from all levels read python the first time and get it. Oh please. I like python and use it a lot, but it's readability can be awful. Constructs like 'delimiter_string'.join( list_var ) may have logic behind them, but the readability for someone accustomed to OOP paradigms is backasswards. Comprehensions are quite powerful, but ironically they're nearly incomprehensible. Lambdas are a sad sad attempt at closures/anonymous functions. There are many conventions in python made early on that have not aged well in regards to readability.
- ksec 7y agoMost of what you mentioned seems to be fixed by Crystal. That said I am not sure when Crystal becomes production ready or 1.0. Not saying Crystal will be the silver bullet, as it will take at least one or two years writing a large codebase with it before we can make any decent judgement.
- pdimitar 7y ago> That said I am not sure when Crystal becomes production ready or 1.0. I don't doubt a lot of newer tech solves many lingering problems that are still present in older tech but that's the crux of the issue right there in your comment: We work for money and we have to get stuff done in acceptable amounts of time. And our bosses want us to write with technologies they can hire for, in case we get fired or killed by a bus. I can't speak for everyone but now, at 39, I already have a bit of a fatigue and burnout when it comes to trying new languages. I just want to sit down and fix a problem (or create a feature) without having to sift through a forest of competing tech for days or even weeks. Please note that I am not berating Crystal in any way. I know absolutely nothing about it. I am simply unwilling to invest in learning my (I think) 9th language. Elixir and Rust do me pretty perfectly lately and this is going to be the case for a while.
- specialist 7y ago"...too much magic and implied behaviour..." This is why I opted out of Ruby. Feels too much like macros and C++ templates. I just don't want to be that smart. I keep going back to Bill Joy's goal of enabling working both in the big and in the small at the same time. Mid 90s, Java was logical step from C-ish towards Scheme-ish and Simula-ish (SmallTalk, Self). I could focus more on design and less on wrestling the compiler. Much progress since then, in Java and elsewhere. But I wish language (and stack) designers also removed features. Cull deprecated stuff. More generalizations. Fewer primitives. Fewer classes. Etc.
- pdimitar 7y ago> This is why I opted out of Ruby. That was probably ~80% of why I opted out as well (the rest ~20% are mutability and bad parallelism story). > Feels too much like macros and C++ templates. I just don't want to be that smart. I don't even view it as being smart. It's more like a specialised area of expertise that you need to grind through in order to be productive, and even when you're an expert it's still error-prone. Turns out though, a lot of other tech doesn't require that so, like you, I moved there. > I keep going back to Bill Joy's goal of enabling working both in the big and in the small at the same time. Admirable goal. I try to do the same but it's not an easy thing to achieve. What language would you recommend in this area? > I could focus more on design and less on wrestling the compiler. Depends what you mean. I am very okay to fight with Rust's compiler because that way I know I won't have dangling pointers or references and will not inadvertently try to modify the same piece of data from multiple threads. I am also very okay with fighting with OCaml's compiler because I often found myself not thinking properly about the types of my code. But in C and C++, yeah, there the fight is kind of just "please compile and leave me alone" and it's not that much of "it's compiled, therefore you get guarantees X and Y". > But I wish language (and stack) designers also removed features. Cull deprecated stuff. More generalizations. Fewer primitives. Fewer classes. Etc. Absolutely! I wish more language designers/maintainers had the courage to do this. They also don't have to do it in a breaking way; they can just extract the deprecated (and removed) functionality into an optional dependency that people can use if they are so hell-bent on not using the officially sanctioned way from version X.Y and on. But I guess even that would catch many people by surprise and provoke negative reactions so it's probably a very strong reason on why it isn't being done. So what's left? A linter that's invoked like this: `idiomatic-rust --check --strict`? I guess that's the only way out for now.
- aikah 7y ago> - He seems a bit disappointed that Ruby is mostly used for web development only and would be happy if it was used in research and AI. Flowstone ( http://www.dsprobotics.com/flowstone.html http://www.dsprobotics.com/flowstone.html ) uses Ruby for scripting, so there is a bit more to Ruby than webdev.
- Pxtl 7y ago> He regrets not focusing on immutability primitives earlier. Hah, I think every business-first (as opposed to academic-first) language had this problem. Immutables are easy to implement in every OOP language but the if standard library isn't aware of them out-of-the-box you're SOL.
- pdimitar 7y agoNever tried to make a programming language myself but what you say is interesting. I wonder if this mentality (mutable-first) can be changed at least in universities?
- TulliusCicero 7y ago> is now working on an optional typing system where you choose to describe types in a separate file. (Reminds me of C/C++ and OCaml header files.) My experience using C/C++ is limited, but this always feel felt rather cumbersome to me.
- pdimitar 7y agoIn C/C++ it definitely is. But it sounds Matz wants to do it similarly (but not exactly) like in OCaml, where the "interface" file only describes all public modules and functions and their typing signatures, which serves the purpose of (a) limiting access to the users of your modules/functions to only those you want to expose and (b) help the compiler's typing system. Do note that in OCaml explicit typing is rarely needed. The compiler is quite amazing at inferring the data types of your functions. In Ruby though, it seems the typing definitions will be the front and center of those suggested interface/header files.
- irjustin 7y agoThe global variables is generally mitigated by RoR but that leads right into one of his primary regrets that it's not used for something other than Web. I'm sad to hear that he's sad about that because to me I love Ruby/Rails for the web. It's just too strong for getting off the ground for me to ignore. The community has solved so many problems that allow me to focus on business/user issues. Not having static typing is that double edge sword. I personally wish it had it now as well having been with Ruby for 5+ years seriously. I've played with Sorbet, but in the Rails world, it's just too weak to be useful. Too many exceptions/untyped definitions to allow everything to play nice. It's the standard problem of trying to make an un-typed project => typed. With all his gripes, the frameworks he laid down -> human readable + everyone be nice to each other has been incredible. The 1st one is controllable, but the 2nd relies solely on other people carrying it forward. Issues, forums, meet ups, conferences. It's not perfect by any stretch, still lots of issues, but it's incredible to see that the community does try and is relatively successful at it.
- pdimitar 7y agoEven though I moved on from Rails ~3 years ago I am not spiteful of it -- I just came to realise it's just not for me. I am really glad the community is still going strong. IMO Rails -- and Ruby by extension -- are going through its first really mature phases: a critical look inward and trying to solve problems that the initial enthusiastic wave of adopters haven't found crippling... but many people after them did. That's a good phenomena and I like it. And I am one of those people thinking that Ruby and Rails both benefited and suffered a lot from the huge popularity burst that they got. Now is a good time to start making positive changes and to make the language (and the ecosystem) more long-term sustainable and I am glad that Matz is thinking about it.
- swat535 7y ago> But I never found good use of it outside of small projects. Any serious business work becomes very painful to maintain and stay on top of for bigger projects. It's the ultimate irony reading statement like these, when ruby powers some of the largest web applications on the web today and handling millions of users and requests. Github, Gitlab, Shopify, Stripe, AirBnb, Crunchbase, Dribbble, Kickstarter, .. etc I'm not sure how many more are needed for this meme to die. Is ruby perfect? absolutely not, but to neither is any other language. You will always have to tweak things regardless of the tool you chose, because scaling is difficult.
- pdimitar 7y ago> You will always have to tweak things regardless of the tool you chose, because scaling is difficult. With some technologies, like Erlang/Elixir, scaling is almost effortless though. Only the deployment platforms with very strict boundaries like Heroku make it pretty much impossible to shard and distribute load. With most VPS-es you just share one file between them, introduce a well-setup VPC, and you're done, your servers are distributing load and you spent like an afternoon on it. Additionally, with very fast languages like Go and Rust (even Elixir but only on I/O bound projects, which is like most of them?) you delay your scaling measures that far in the future that most apps never even need to grow beyond one app server and one DB server, and the team never actually even thinks about scaling at all. Because let's face it, most apps will never exceed 500x - 5000x reqs/sec. A well-made Phoenix web app or API gateway easily achieves 500 reqs/sec even on a Raspberry Pi 4. I used Rails for 6 years and deployed it on Heroku, company-rolled Dokku setups, AWS EC2, DigitalOcean droplets and GCP -- usually servers in the range of $25 - $100 per month (I usually work for small or medium-small businesses). I hated that beyond 10-20 reqs/sec we had to start beefing up the server or add others. It's just how Rails (or rather, ActiveRecord) is: very inefficient, optimised for human productivity, and to hell with machine resources. Many business still like it though and that's cool with me. They don't mind a mean response time of 300ms with the minority of responses (95-th percentile) going to 2500+ ms. > Github, Gitlab, Shopify, Stripe, AirBnb, Crunchbase, Dribbble, Kickstarter, .. etc I wish for that meme to die. Bigger players using it means absolutely nothing except that they have the budget to keep working with Rails even after it showed its warts (hard to maintain when the project grows and big hosting costs being the top 2). Smaller players like Basecamp have very stringent policies on how to work with it. I've seen local companies utilise similar techniques mostly successfully. More power to them. I know it can be made to work with the right management techniques. Half-related: do remember that Facebook preferred to make a PHP runtime and maintain it, as opposed to actually train programmers to use another backend language. > I'm not sure how many more are needed for this meme to die. You might call it a meme. I call it "I tried for years and eventually got frustrated and moved on". Nothing against Ruby or even Rails. But they make me think of scalability much, much earlier compared to a "slow" dynamic language like Elixir (even though it maintains predictable lag even under very heavy load... and its Phoenix framework mean response time in identical setups as the Rails projects is between 5ms to 30ms). Let's not even introduce Go or Rust web apps in this picture. If made well (although that takes much more effort than Rails or Phoenix so for me their human productivity tradeoffs aren't worth it!) they can easily serve anywhere from 5_000x to 30_000x reqs/sec on the cheap business VPS-es ($25 - $100 a month). In all fairness, those had to use a bit more expensive DB servers though ($250+) because the cheaper DB servers couldn't keep up with the demand.
- DarkWiiPlayer 7y ago> But I never found good use of it outside of small projects. Any serious business work becomes very painful to maintain and stay on top of for bigger projects. That statement reminds me a lot of the conclusion I came to on a reddit post[1] a while ago, where I compared Rubys fibers¹ to Luas coroutines, more specifically, how many of them could viably be used concurrently: > Conclusion: Ruby is awesome; just don't use it for anything serious. ¹ Note that after Ruby 2.7 was recently released with a supposedly improved coroutine implementation, I repeated the benchmark and did see a slight improvement in execution time (no change in the maximum number of coroutines), but it was still orders of magnitude slower than even the PUC Rio implementation of Lua. [1] https://www.reddit.com/r/lua/comments/cgqfch/lua_coroutines_vs_ruby_fibers_benchmark/ https://www.reddit.com/r/lua/comments/cgqfch/lua_coroutines_...
- pdimitar 7y ago> Conclusion: Ruby is awesome; just don't use it for anything serious. LOL! Funnily put. This did offend some in this here mini thread but I indeed gradually -- with business and personal usage -- came to that conclusion by myself. Nowadays I am pretty hopelessly hooked to Elixir. Parallelism and concurrency basically solved, extremely fast for a dynamic language, FP, compile-time macros (so basically code generation without the boilerplate source code), several very solid and customisable frameworks (web/API/GraphQL, DB data mapper), predictable lag even under extreme load, and I am just in love. Now only thing left is Rust to emulate the BEAM's runtime. :) If we were to have a vote for a language with which you replace a slightly more complex bash/zsh scripts however, I'd vote for Ruby. It's very terse, it's fast enough (without Rails I mean) and it mostly reads well. Or I dunno, maybe Tcl/Tk or OCaml.
- federalemployee 7y ago> too much magic and implied behaviour I think you may be confusing RoR with just Ruby. Rails is its own beast.
- pdimitar 7y agoI didn't confuse anything. I specifically mentioned Rails before listing those drawbacks you quoted.