Is there a gem that allows us to write Ruby code in Rails with indentation the way Haml and CoffeeScript do for html and javascript respectively?
Google always ends up with Lazibi but that project has been dead for 5 years.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The problem with adopting a Python-style syntax for Ruby is that Python’s syntax crucially depends on the distinction between statements and expressions. For example, a lambda can only contain expressions not statements (or to put it another way: a lambda’s body must consist of a single statement). Ruby, however, doesn’t have statements, it only has expressions.
This means that adopting a Python-style syntax for Ruby (or any other Ruby-like language) is impossible. Tony Arcieri tried it with Reia, for example, but he had to revert his decision, precisely because of the fact that Reia, like Ruby, doesn’t have statements.
A Haskell-like or F#-like syntax would probably work much better, but nobody has implemented it yet.