4 ms·
>We love Ruby's efficiency for writing code. Ruby's syntax is one of the worst parts of Ruby. [0] >We love C's efficiency for running code. Many other langua
by davexunit 11y ago
>We love Ruby's efficiency for writing code.
Ruby's syntax is one of the worst parts of Ruby. [0]
>We love C's efficiency for running code.
Many other languages have efficient native code compilers, too. I don't know why people assume this is only a C thing.
>We want the best of both worlds.
>We want the compiler to understand what we mean without having to specify types everywhere.
This is good. I much prefer dynamic languages to static ones. Though I don't know if Crystal supports the best parts of dynamic languages like runtime program modification AKA live coding.
>We want full OOP.
Single paradigm languages feel very restrictive to me. I like languages that support many paradigms because different parts of programs call for different programming techniques. OOP in particular is a paradigm that I feel forced to use more often than I feel it's the right technique for the task at hand.
[0] http://programmingisterrible.com/post/42432568185/how-to-parse-ruby http://programmingisterrible.com/post/42432568185/how-to-par...
- hellofunk 11y agoThe question is not whether the language has a native code compiler, as that rarely has a profound effect on the runtime speed of a language. Some native code languages are slower than VM and interpreted languages. And native code != native code. Objective-C and Swift both have native code compilers. But they are slower than C and C++ on the same platforms, for various reasons, such as: the runtime environment itself and how the runtime works, and, in the case of Swift, the organization of its LLVM code prior to final compilation.
- arnvald 11y ago> Many other languages have efficient native code compilers, too. I don't know why people assume this is only a C thing. I think it's just become very common to show C as the reference to show how fast are other programming languages, and everyone keeps it this way. > Ruby's syntax is one of the worst parts of Ruby. [0] For people who write the language, yes, it's incredibly hard to parse (and that blog post doesn't mention the new ambiguous things like keywords vs. hashes) Yet, for people who use Ruby, it's very convenient and easy to read.
- davexunit 11y agoI write Ruby for money, and I find it difficult to read and write in certain circumstances. Sometimes Ruby thinks the curly braces mean a hash, sometimes Ruby thinks they mean a lambda. The ambiguities in the syntax (wow, it's just like natural languages!) really drive me crazy. After learning a variety of programming languages, I think homoiconic syntax is the only type I actually like.
- rayiner 11y agoPeople used to find Perl convenient and easy to read too. > Similarly, distinguishing puts ([1]).map {|x| x+1} from puts([1]).map {|x| x+1} is handled by setting flags after skipping whitespace, and later checking these flags to emit an LPAREN or an LPAREN_ARG token. As well as semantic whitespace, flags are used for blocks, class definitions and method names too. What the actual fuck.
- matthewmacleod 11y agoWhat the actual fuck. That's not particularly unusual, is it?
- rayiner 11y agoSignificant whitespace, except to separate tokens, is unusual. Significant whitespace that is used for something other than delineating blocks is extremely unusual.
- rubyfan 11y ago>>We love Ruby's efficiency for writing code. >Ruby's syntax is one of the worst parts of Ruby. [0] Your reference is about parsing the syntax, I am certain the authors mean they want Ruby syntax from the coders perspective not from the parsers perspective.
- pathsjs 11y agoHumans have to parse the syntax as well...
- PeCaN 11y agoNearly all the syntax ambiguities I've had in Ruby were resolved by either adjusting some whitespace or adding parens, and neither make the code any more difficult to read. In my experience Ruby is easy enough for humans to parse (really nice in 95% of cases, weird in 4%, WTF IS HAPPENING in 1%).
- rubyfan 11y agoThat's not really the context for the reference. Also beauty is in the eye of the beholder. The Crystal authors aren't really debating the goodness of Ruby syntax... That they think it's good is kind of the precondition to Crystal existing.