HACKER Q&A
📣 khaledh

Are there any languages for programming-in-the-large?


Almost every programming language in existence today focuses on programming-in-the-small: types, classes, functions, control flow, etc. This is OK for putting together small programs. But when it comes to designing large, complex systems, it's really up to the programmer/team to define the design out-of-band (docs, diagrams, conventions, etc) and then use the programming language to implement the design.

Are there programming languages that help with the high-level design of programs? Concepts in such a language could be: system, subsystem, component, composite, constraint, plugin, interface/protocol, data flow, storage, async process, etc. Note that this is not about distributed system design; all the above elements could be in the same process.

Another important aspect is help with defining a meta-model of a system. A program meta-model fills some gaps between the language model and the actual domain model of the program. For example, a meta-model of a front-end UI library could define the concept of unidirectional data flow, which enforces data flow in one direction.


  👤 nostrademons Accepted Answer ✓
C++, Java, Go, Ada, Erlang. These are all designed explicitly for programming-in-the-large.

I think the reason you still see classes and modules as the top-level abstraction in programming-in-the-large languages is because people have found that having hierarchically composable uniform abstractions is a more effective approach for large-scale system design than creating specialized concepts for system, subsystem, component, etc. An interface in Java might be a first-class function, or it might be the entry point to a distributed system running on 10,000 machines with 15 million lines of code. But the key point is that by representing that as an interface, all the other hundreds of services that the system might interact with can be treated in a uniform way in the language, and can also be treated uniformly with in-memory, in-process systems like hash tables and function calls. This is an incredibly powerful feature.

There's a lot of debate in the language design community over which abstractions are fundamental, which is why you get different languages. But personally, I think you're fine with a.) functions b.) structs (classes when you combine them with functions, and then from there, types, storage, components, composites, subsystems, systems) c.) interfaces (protocols, plugins) and d.) annotations (constraints, async, and marking the special cases of all of these fundamental concepts.). That's really all you need.


👤 clarkdale
I don't think anything exists that could totally satisfy your constraint because your concept is hyper abstract.

That said, I would recommend looking into AWS CloudFormation, AWS CDK, and Terraform.


👤 spindle
Smalltalk is meant to be the thing you're looking for. Alan Kay's given talks about this. Whether it actually works well in this respect, I don't know.

👤 eaa
No, there aren't.

I have seen one example thought. But it was closed source in-house SW.

Maybe LabVIEW is close to this idea.

There are also interesting research projects on this topic, like Ptolemy. Or eTrice.

There were a few attempts to achieve this goal in the past, but all those companies have been eventually bought by IBM and now they sell their monster-tool for huge amount of money, so it's irrelevant in practice.


👤 kiwih
It sounds like you might be interested in checking out IEC 61499 Function Blocks - this is a new -ish automation programming standard / domain specific language. It allows for concepts as you are describing them, with communication blocks, basic blocks, composite blocks, etc, deployed to resources and systems.

👤 m33k44
Prolog, Mercury[0]? :)

[0] https://mercurylang.org


👤 rramadass
In addition to the other suggestions mentioned in this thread, see also the Eiffel language - https://en.wikipedia.org/wiki/Eiffel_(programming_language)