5 ms·
I don't understand languages like Ruby and Perl and their supposed emphasis on "human design." My sense of what a human designed language would be is a lot more
by vincent-toups 7y ago
I don't understand languages like Ruby and Perl and their supposed emphasis on "human design." My sense of what a human designed language would be is a lot more like Scheme: extremely simple, fundamental abstractions which, when composed, enable a variety of different strategies for solving problems.
Ruby, in contrast, seems like an absurdly complicated concatenation of weird features and strange syntax. When I look at Ruby my eyes glaze over with all the unnecessary syntactic doodads and peculiar abstractions. Why anyone would want to complicate their lives with all that silliness is beyond me.
And yet Scheme languishes and Ruby, for a time, anyway, burned brightly. I'm clearly the weird one.
- wolfgke 7y ago> I don't understand languages like Ruby and Perl and their supposed emphasis on "human design." [...] Ruby, in contrast, seems like an absurdly complicated concatenation of weird features and strange syntax. Sounds like a human (natural) language to me ...
- cambalache 7y agoI had the same thought. "Simple" does not mean "easy" and "for humans" does not have to mean simple.
- hashmal 7y agoI can only recommend the "Simple Made Easy" talk by Rich Hickey. I suppose it can be said that Scheme is very simple but hard for many, while Ruby is very complex but easy for many.
- mapgrep 7y agoI think Rails fits what Hickey says about easy complexity very well. Ruby not at all - I find it very much not “braided together” compared to other programming languages. It’s still object oriented, and Hickey’s talk is largely directed at showing how bare maps and immutability and functional style and so forth in Clojure are better than what he calls the “petty parochialisms” of class hierarchies. But among OO non Clojure languages I’d argue Ruby is among the closest to th ideals he espouses in that talk.
- chongli 7y agoNow I love Scheme but I would argue the exact opposite for the same reasons you listed. Scheme (Lisp, actually) is so simple and so cohesive that it feels like it was given to humanity by an advanced alien race. Languages like Perl, on the other hand, feel right at home with the English language. There’s a deep history of all these different things from many different places that have been bolted on over the years. It’s incredible that we can say anything at all, let alone write amazing works in it.
- 0x445442 7y agoBut once you learn the alien language you can understand all written forms in that language. When you speak of Perl, which dialect of Perl are you speaking of? I'm not singling out Perl here as I see the same issue in varying degrees with most general purpose languages.
- mapgrep 7y ago>Ruby, in contrast, seems like an absurdly complicated concatenation of weird features and strange syntax My experience is the precise opposite. Ruby seems more consistent and straightforward than any other non lisp language I’ve used. Ubiquitous blocks and “everything is an object” gets you very far. Compare nested list comprehensions in python to chained map/select calls in Ruby: lesson for lesson in [school.Lesson(downloaded) for downloaded in api.downloads()] if want(lesson)] vs api.downloads.map{|download| School.Lesson.new(download)}.select{|lesson| want(lesson)} Or compare the many varied required ways to do something with an array in python vs Ruby: len(array) “;”.join(array) array.append(x) Vs array.length array.join(“;”) array.append(x) Genuinely confused what you refer to with “unnecessary syntactic doodads.” Examples?
- 0x445442 7y agoYou answered your own question with your qualifier... "Ruby seems more consistent and straightforward than any other non lisp language I’ve used."
- mapgrep 7y agoIf OP just meant ruby is syntactically complex compared to lisp, there’s really no arguing with that! :-) it just applies to so many languages — any non lisp — and seems an odd thing to single out Ruby for. (Perl, on the other hand...)
- hartator 7y agoHe has replied with actual code samples. Which is valuable.
- vincent-toups 7y agoBoth sets of code samples look silly to me. In scheme all this syntactic nonsense would just be function calls and lambdas.
- tomc1985 7y agoBeauty really is in the eye of the beholder, because I agree fully with parents' statements. Then again I write Ruby for a living...
- dragonwriter 7y ago> My sense of what a human designed language would be is a lot more like Scheme: extremely simple, fundamental abstractions which, when composed, enable a variety of different strategies for solving problems. “Human design” isn't “human designed” but “designed for humans”, and, more specifically, “deidned for the way human brains naturally work” rather than “deidgned for ivory-tower ideal of how brains should work” > Ruby, in contrast, seems like an absurdly complicated concatenation of weird features and strange syntax And, in that respect, is a lot like natural languages, which are quite often complex analytically/descriptively, with near-duplicate features, leveraging implication, etc., etc., etc.
- hinkley 7y agoAs someone who studied the game of Go for a bit, simple rules can be deceptive. You can get whole bookshelves of books about things with rules that are too simple. “The Rules” that matter become the patterns that the simple rules allow or imply, and all the nuances of when one is better than another.
- int_19h 7y ago> My sense of what a human designed language would be is a lot more like Scheme: extremely simple, fundamental abstractions which, when composed, enable a variety of different strategies for solving problems. Consider the natural human languages- they're far from being straightforward uniform compositions of extremely simple abstractions. They have weird syntax, and a lot of redundancy. Now, some of it is historical legacy, but not all. The language doesn't just have to be easy to analyse semantically - it also has to be easy to parse. And while parsing identical nested brackets is easy for a machine, humans prefer more variety for their pattern matching inputs.
- mirchibajji 7y agoMy impression is that human languages are more expressive - There is more than one way to do it. # For a bank, if ($authorised) { allow_entry(); } # vs. a shop: allow_entry() unless $person->is_smelly(); The language lends itself to how you may normally say it in English, emphasizing the common case. That isn't to say all the syntactic noise is justified, but I guess one's noise is other's attempt at being more expressive.