3 ms·
> 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 atroc
by crabbone 3y ago
> 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...
- Joker_vD 3y agoCould 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.
- crabbone 3y agoWell... 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.
- pjmlp 3y agoSmalltalk grammar fits into a postcard. https://richardeng.medium.com/syntax-on-a-post-card-cb6d85fabf88 https://richardeng.medium.com/syntax-on-a-post-card-cb6d85fa...