# In a declarative language, specifically in the context of modelling, can we make a clear distinction between code and data?

For declarative languages, specifically (but not limited to) in the field of modelling, it's not obvious to me whether code can be considered to be separate from data. This line of reasoning may only apply to non-turing complete languages such as NeuroML.

Say for instance I had a very domain specific declarative language which I used to described the positions of planets and their velocities, and I described a system of three orbiting bodies:

``````satellite planet_earth,moon,sun {

planet_earth.position = [6,0,0]

planet_earth.velocity = [0,23,-32]

planet_earth.mass = 1e3

moon.position = [6,0,0.0001]

moon.velocity = [0,0,3]

moon.mass = 1e2

sun.position = [0,0,0]

sun.velocity = [0,0,0]

sun.mass = 1e12 }
``````

This language could be passed to a simulator which then simulated the motion of the planets.

From one perspective this is code - It is describing initial conditions and consequently within the constraints of the language a sequence of steps for a computer to run. From another perspective it is 'data' - it is a description of a physical system.

Is this concept (is something code or data) something which has been studied much? I've looked into it

• You've looked into it, and? I'm curious what you've found. Sharing your research helps us all, as well as ensuring we don't post what you already know. To be certain this is an interesting question so I'm curious what you stumbled upon when you looked into it. Aug 29, 2013 at 1:00
• Positions and velocities change with time. An orbit and trajectory (a function from time to position and velocity) is a bit better, but still wouldn't allow you to model stellar collisions. What are the invariants in your model? Aug 29, 2013 at 3:10
• This is just hard-coded constants. Nothing to see here, move along. Aug 29, 2013 at 7:26

``````std::vector<std::string> names = { "Smith", "Miller", "Watson" };