← Back to context

Comment by librasteve

6 days ago

I fully accept that formalism is an important factor in programming language design. But all HLLs (well, even ASM) are a compromise between machine speak (https://youtu.be/CTjolEUj00g?si=79zMVRl0oMQo4Tby) and human speak. My case is that the current fashion is to draw the line at an overly simple level, and that there are ways to wrap the formalism in more natural constructs that trigger the parts of the brain that have evolved to hanle language (nouns, verbs, adverbs, prepositions and so on).

Here's a very simple, lexical declaration made more human friendly by use of the preposition `my` (or `our` if it is packaged scoped)...

  my $x = 42;

Have you looked at all the previous attempts?

Your example is not compelling I’m afraid but you should try building a language to see. Also read literate programming if you haven’t already.

How is that snippet any better than:

x := 42

Or

let x = 42

Or

x = 42

It seems like a regression from modern languages.

  • "my" is 33% shorter than "let"

    Example 1 and 3 are not declarations, so apples ↔ oranges

    • my $x = 42;

      let x = 42

      Well, when you add in the '$' and ';' tokens the "let" example is still shorter. Also as another person replied to you, those other two examples are declarations in other languages. So 0 for 3 there.