How to make any declarative syntax work?

Discussions on everything related to the software, electronic, and mechanical components of information systems and instruments.

How to make any declarative syntax work?

Postby Terry on March 17th, 2018, 7:08 am 

Suppose I am a programming language designer and I want to create a language that specifies what to do using the declarative syntax with worrying how to do under the hood. What then is being done to translate the what statements to the how statements that actually carry out the procedures for accomplishing the tasks? Is it all done by the compiler or interpreter to convert from declarative to imperative intermediate language or direct machine code? Is it a simple mapping from what to how? How is it actually done? Is there a general principle for doing that? More specifically, how is SQL statement which is a declarative syntax actually work under the hood? Is there any intermediate language involved or it is directly translated to imperative machine code to carry out procedures?
Terry
Member
 
Posts: 444
Joined: 01 Sep 2008


Re: How to make any declarative syntax work?

Postby Terry on March 22nd, 2018, 8:50 am 

I would like to take the example of SQL which is actually based on relational algebra.
http://www.databasteknik.se/webbkursen/relalg-lecture/

Do we need an intermediate representation for doing the relational algebra?
How was the guy who created SQL translate the declarative statement to the binary representation that run in CPU?
How about the table representation that returned as a result? It seems there is a series of representational transform involved, better described as a representation cascade that I have never came cross any books talking about it and no one seems to question it seriously.
Terry
Member
 
Posts: 444
Joined: 01 Sep 2008



Return to Computers

Who is online

Users browsing this forum: No registered users and 4 guests