1

Question

Does there exist a DSL for describing data structures and their manipulation? I realize that a "normal" programming language describes data structures, but they also do a lot more (e.g. IO).

I'm curious what the smallest language is required to describe classic data structures like List, Tree, Set, Stack, Queue, Map, Graph, etc. and their operations like append, remove, get, add, remove, poll, offer, etc.

Motivation

I ask this question because I was trying to think of a way to specify a data structure at runtime.

For example, imagine there exists some service which allows its clients to allocate space for a data structure. This is done by enumerating the possible valid types that the data structure may be as well as the data structure's starting state. For the list case, it's possible states are the empty and non-empty lists, and the starting state would be the empty list.

Then, clients would specify valid operations, that would modify the state of the data structure. For example, define append, define remove, etc. My question appears here: how would a client communicate to the service a valid operation to be performed on the data structure? It would have to be written in some agreed upon formal language, the simplest DSL used for describing data structures and their operations.

geofflittle
  • 161
  • 2

0 Answers0