4 ms·
Just from looking at the hello world example, I don't like how "say" and "ask" are placed at the end. It would be much more readable to start with that.
by hanniabu 6y ago
Just from looking at the hello world example, I don't like how "say" and "ask" are placed at the end. It would be much more readable to start with that.
- senkora 6y agoThink of it like a unix pipe. That’s what they’re going for with the concatenative paradigm.
- creata 6y agoIt's a stack-oriented language, so postfix notation kind of comes with the territory.
- 0x264 6y agoIt's stack based. Written like RPN (Reverse Polish Notation).
- zumu 6y agoThey explain this in the tutorial, but anecdotally it reads really well if you speak a SOV language.
- tom_mellior 6y agoIt's unfortunate that people are downvoting you because "that's just how it is in stack-based languages". Maybe stack-based languages are indeed less readable than alternatives. Pointing this out should ideally encourage discussion rather than downvotes. The language's developers themselves seem to agree that postfix syntax isn't always best: The syntax for the type "list of characters" is "List<Char>", which is not postfix. Compare ML-family languages, where this would use postfix syntax, writing this type as "char list".
- caslon 6y agoPostfix is incredibly intuitive. It's much simpler to read than alternatives. Your proposal is wrong.
- creata 6y ago> Maybe stack-based languages are indeed less readable than alternatives. That may be the case, but taking a core language feature and commenting "I don't like it, change it" isn't a very effective way to encourage discussion, in my opinion.
- tom_mellior 6y agoIt's a form of feedback. Yes, it would have been better feedback if the author had also supplied an example of how they think this could be improved. But I don't believe that that should be required. Anyway, here's a rough idea. Introduce some special token, like : for example, and add a special syntax rule in the parser that "a: b" is parsed as if it had been written "b a". Then people who find it more readable can write say: "hello" while others can continue to write "hello" say and surely everyone would be happy!
- yiyus 6y agoI am quite sure that if I went to a thread discussing Go or Rust (for example), and I said something along the lines of: "I don't like this, it would be more readable if you did like Forth", I would get downvoted too. And rightly so. We can have discussions about the convenience or readability of different syntaxes, but if the arguments are going to be of the level of "I don't like it", then a downvote is a valid response.
- BiteCode_dev 6y agoAt first it was hard to read for me, but then I realized that in their design, the code always flowed from left to right, starting with the data you want to work on (or the data producer). So it's always: data => process => process => process. Left to right, no surprise, always the same thing first. I kinda like the idea, although it's weird to get used to due to unfamiliarity.