News for hackers. Stuff that matters.
Re:Benchmarking Ruby 2.6 to 3.2 by foxandmouse on Monday December 26, 2022 @11:03AM (#34138771)
I've only ever known Javascript/ Typescript. I've been thinking of picking up ruby to learn "practical" functional programming and maybe see what the infatuation with rails is, but I'm starting to think it might be more "valuable" to learn python.
Re:Benchmarking Ruby 2.6 to 3.2 by sodapopcan on Monday December 26, 2022 @11:24AM (#34139018)
I wouldn’t recommend python or ruby if you’re trying to learn more about functional programming… you may as well stick with JS in that case (imo, at least). I’d choose a language that has at least had native immutability. Something like Elixir/Erlang, OCaml, Clojure, or F#.
Re:Benchmarking Ruby 2.6 to 3.2 by skrtskrt on Monday December 26, 2022 @11:40AM (#34139221)
I’m seeing a pretty significant amount of Elixir job listings these days even in areas where you used to see all Ruby or Python
Re:Benchmarking Ruby 2.6 to 3.2 by sodapopcan on Monday December 26, 2022 @05:04PM (#34142402)
I've actually been having a tough time finding another job in Elixir. Sooooo many companies who use it are in crypto and I just have no interest.
Re:Benchmarking Ruby 2.6 to 3.2 by skrtskrt on Monday December 26, 2022 @11:06AM (#34138807)
Python and Ruby are both only really as functional as you choose to use them. You’ll see more imperative code in the wild for both, though the big data stuff in Python leans more functional.

Rails and Django are both still super popular from scanning job listings, so e-commerce employment wise they’re both great.

FastAPI is also growing a lot.

Big Data leans heavily Python

Re:Benchmarking Ruby 2.6 to 3.2 by freedomben on Monday December 26, 2022 @01:51PM (#34140548)
Purely my opinion after learning and professionally doing both Ruby and Python. If elegance and consistency in APIs matter, Ruby is by far the preference. Generally speaking (again from my own experience which should be taken with a grain of salt) the Ruby community tends to value readability/maintainability of code a lot higher, so working in the codebases is typically a lot more pleasant.

IIWM I'd go with Ruby hands down.

Re:Benchmarking Ruby 2.6 to 3.2 by satvikpendem on Monday December 26, 2022 @04:05PM (#34141868)
If you already know TypeScript, just use a functional approach to your programs, and/or use libraries like fp-ts and io-ts. Ruby is definitely not more FP based than TS.
Re:Benchmarking Ruby 2.6 to 3.2 by harshreality on Monday December 26, 2022 @07:52PM (#34143657)
Python would be the most popular option, but, for an OO language, Ruby feels clean and intuitive to me in a way that other languages, especially Python, don't. It has a performance cost, though. The languages' performance may be roughly equivalent, but Python has more native-code libraries for a lot of things. You don't see many ML projects in Ruby. :) There's crystal-lang, but that has a much smaller community behind it.

Julia, though, if you're looking for a language that isn't OO in addition to functional.