Is concept design relevant or appropriate for programming language design?

Language design has become more accessible, with more and better tools than were previously available.*

  • What place does concept design have in language design?
  • What language concepts should be in the Concept catalog?

[* LEX, YACC, GCC & a copy of the dragon book]

Jonathan Aldrich at CMU has done some really nice work on this, and has included concept design in his PL classes. Slides here show really nice example of using concepts to split a PL concept (untyped dynamic semantics) into two more independent concepts using the principle of specificity. In these slides, he also mentions dependences, which get a whole chapter in the book (but appeared more briefly in the draft that Jonathan’s comments are based on). There’s also an assignment about applying concept design to PL here.

Thanks to Josh Pollock for bringing these to my attention!

2 Likes

I’m not a PL designer, so I’m making all this up, but as a programmer, it looks to me like the problem of language design comes down to concepts. There are style choices and implementation choices, but if I want to design a language, there is a lot of prior art for type systems. And if want to use a well-understood model for my language’s type system, it can be specified and implemented pretty reliably, as long as the rest of my design decisions are congruent.

C , C++, Zig have some over-lapping concepts and some unique concepts. You can specify a lot of Zig by saying “do X just like C” and re-using concepts directly as re-implementable, re-mixable specifications.

I’ve been learning about the Standard ML module-system-thing where you write functors. Amazing. It’s rich with concepts, like functors, and a few days ago it was a good exercise for me to think about designing language, and if I started with category theory, then I have a whole new concept to provide generic functions, how does that change the inclusion of all the normal programming language concepts I’m used to using?

If I wanted to design my own APL, then I could do an inventory of all of the languages out there in the APL family. There are going to be lots of complicated operators and rules. Maybe I want a restricted set of operations for my small APL. If I understand all of the concepts in the source languages, then I can specify them clearly and combine the concepts I want to create my language.

In APL, the Train concept serves the purpose of function composition, there state is the functions inside of the train, the actions are some rules for resolving function calls and parameters, and the operational principle is that you can send a single input to multiple functions and then combine the output.

So now “Train” can be one of the concepts in my language or not. I can try translating this concept to different types of syntaxes. I can try fitting it alongside other types of concepts. I believe I can carry that concept into any reasonable context and say to a coding agent “let’s add trains to the language” and the concept can be well understood and implemented.

A domain-specific language is a great tool for de-composing a domain into it’s concepts, so I think a programming language is a tool for expressing programming concepts.


EDIT:

A better set of example concepts is probably: map, filter, accumulate.

1 Like

It’d be a great project to try and formalized programming language concepts. I agree that there seems to be a great opportunity to do this, because there’s lots of work on formal semantics but I don’t know of any work that tries to disentangle concepts and define them independently (although I haven’t kept up much with language semantics, so maybe someone has done this?). It seems possible that composing concepts in PL design will require a new composition mechanism, although it would be interesting to see how far syncs would go (and what the actions that you synchronize would be).