I am thinking more and more about how inconvinient it is to have so many different data structures, such as lists, vectors, sets, objects and hash tables.
Some computer scientists are really proud that they can take an algorithmic language and implement various different structures with different complexities. I am not one of them.
Although Scheme is described as an algorithmic language, it is actually a common ground for various experiments with programming. The Structure and Interpretation of Computer Programs provides various variations on the way the code can be interpreted, including lazy evaluation, nondeterministic computation and logic programming. There's also a popular example of declarative programming language known as Structured Query Language, whose purpose is to abstract from various data structures and provide an uniform interface for accessing them with common operations.
However, SQL isn't the thing done right. It requires a database designer to be cautious with the way she chooses particular data structures that would be accessed in an optimal way. This in turn requires to know a priori how the data structures are going to be used, so the database designer needs to be tightly coupled with an application programmer.
The right thing would be to have a tool that would analyse the way the data structures are accessed, and generate an optimal representation for the target system (which will most likely be a von Neumann machine). For instance -- in case of a LISP program -- if a list is going to be accessed using the list-ref procedure, and in many cases it would be optimal to represent it using a vector. On the other hand, if a program uses assoc-ref with a given data structure, perhaps it would be best to represent it as a hash-table. Obviously, partial evaluation should be applied wherever possible, so in many cases data structure access can be completely avoided.
In order to generate optimal code, we'd need some nice machine that would represent the von Neumann model. Perhaps JVM would be a good option.
More details to follow.
Some computer scientists are really proud that they can take an algorithmic language and implement various different structures with different complexities. I am not one of them.
Although Scheme is described as an algorithmic language, it is actually a common ground for various experiments with programming. The Structure and Interpretation of Computer Programs provides various variations on the way the code can be interpreted, including lazy evaluation, nondeterministic computation and logic programming. There's also a popular example of declarative programming language known as Structured Query Language, whose purpose is to abstract from various data structures and provide an uniform interface for accessing them with common operations.
However, SQL isn't the thing done right. It requires a database designer to be cautious with the way she chooses particular data structures that would be accessed in an optimal way. This in turn requires to know a priori how the data structures are going to be used, so the database designer needs to be tightly coupled with an application programmer.
The right thing would be to have a tool that would analyse the way the data structures are accessed, and generate an optimal representation for the target system (which will most likely be a von Neumann machine). For instance -- in case of a LISP program -- if a list is going to be accessed using the list-ref procedure, and in many cases it would be optimal to represent it using a vector. On the other hand, if a program uses assoc-ref with a given data structure, perhaps it would be best to represent it as a hash-table. Obviously, partial evaluation should be applied wherever possible, so in many cases data structure access can be completely avoided.
In order to generate optimal code, we'd need some nice machine that would represent the von Neumann model. Perhaps JVM would be a good option.
More details to follow.