News for hackers. Stuff that matters.
Re:Ruby vs. Python comes down to the for loop (2021) by crabbone on Monday April 22, 2024 @05:59AM (#40112812)
> The upside is incredibly simple and consistent language grammar

I hope you don't mean Ruby (I haven't investigated Smalltalk grammar). Ruby grammar is atrocious due to string interpolation stuff. Nothing to do with handling loops or conditionals, but still... Ruby is not at all an example of a language with good grammar.

Unfortunately, it's surprisingly rare for popular languages to have good grammar. If you look at it from up close, there are lots and lots of really bad decisions in virtually any language in common use today. I think, this is just not a high-priority concern for most users, but still...

Re:Ruby vs. Python comes down to the for loop (2021) by Joker_vD on Monday April 22, 2024 @07:21AM (#40113244)
Could you perhaps write a blog post on what you consider bad decisions in a PL grammar? That'd be interesting to read, esp. for all the aspiring PL developers/makers here.
Re:Ruby vs. Python comes down to the for loop (2021) by crabbone on Monday April 22, 2024 @12:58PM (#40116259)
Well... I don't even have a blog.

But, I believe, size is a very good heuristic (i.e. the number of rules, the number of variables in rules, the number of branches in rules).

Another valuable metric to optimize is entropy. I.e. rules that look very similar aren't very good rules.

Expressiveness: how long does the program have to be to capture a useful concept.

Things like these obviously need a lot of counting and coming up with some kinds of constants, hopefully justified by experiments... That's a lot of work that will also require a lot of resources to do. But this is not to say that it is unknowable or that a programmer cannot develop an intuition which allows for rough assessment of language grammar.

So, I'm sorry, I don't have a good answer... I only offer one based on my intuition and limited experience of dealing with various language grammars.

Re:Ruby vs. Python comes down to the for loop (2021) by pjmlp on Monday April 22, 2024 @10:01AM (#40114476)