DEV Community

miheer vaidya
miheer vaidya

Posted on

Human perspective in language design

Background

I was listening to cppcast episode 201 and there was a discussion about _ not being used for pattern matching proposal because Google Mock uses it and technically _ is not reserved keyword in c++ in local scopes. I was wondering, how does c++ committee weighs in good for developers vs being constitutionally right.

Good for developers

I think monoglot developers are hard to come by these days, because I don't believe there is one true general purpose language excellent enough to do all jobs. In adsp the podcast episode 4 One of the Bryce's mentors says one needs to know 3 languages, I think it was c++, python and javascript. For me it's c++, python and typescript. My argument for these three languages is:

  1. Language to do quick prototyping: python
  2. Language to do high performance work: c/c++/cuda
  3. Language to dabble in web developement: typescript

Given that polyglot development is essential these days, it makes sense to have similar syntax for similar concepts (language structures and core algorithms and data structures). Imagine having different regex syntaxes for accomplishing same thing. Conor Hoekstra frequently complains about how some of the algorithms in c++ are named unintuitively.

I wonder:

  1. Of course, it's not entirely possible to give up on backwards compatibility and hence embracing syntax of other language for all cases, what tread-off is consider for human perspective.

  2. What tools are available to language designers to figure out if proposed syntax for a new feature conflicts with existing syntax of another (pre-existing) feature?

  3. Consider a bnf grammar:

A => B C D
Enter fullscreen mode Exit fullscreen mode

consider B and D are new syntactic constructs and A and C are legacy constructs, will we be open to assign new semantic meaning to C given presence of B and D for good for developers? In this case C being _?

Oldest comments (0)