2013年12月10日星期二

translator or compiler?

If I made a programming language that produces C code and then get another compiler to compile the C code, would that be a actual programming language?

to be a language system,there should also be a set of runtime libs(primtive types in the language-implentment lvl and stdlib level,3rd party libs) there except the language infrastructures (the translator or the compiler,the interpter).

vala is such a example,which build upon only a translator to a c runtime (the gobj system,and the translator itself can be called a compiler here)

————————————–…

in fact,from the well known compiler theory books,you may find out that:

1,in a functionable language system,it essentially made up of 2 parts:the translator as the frontend and the interpter as the backend.the compiler just translator the sourcecode form to the dest form, it is only a translator,and the interpter is the executor,the language system feeds with it the dest form codes.the interpter is only the executor (the interpter part in a vm,or just a common pure c runtime to the hosting os,passing the execute duty to the os as a passer) there commonly exists two ways.

way1:in a vm,the compiler and the interpter dynamicly interact with eachother,this result that:the source unit and the binary unit could be eachother.

above is called “interpter languge system”

way2:in a c runtime,the compiler and the interpter obeys “one first ,then another” rule,the compiler never get any information from runtime information (rtti)

above is called “compiler language system”

in fact you can see that,both ways has both “compile,interpter” produres.

way more..

————————————–…

let us back again to disscuss vala,valac(the compiler,also the translator) translate the .vala sources to c code.(c then be compiled to the objs).then the os take over to execute on the final obj logic in traditinal ways.no vm,just a pure c runtime to the hosting os.

and many gnome desktop runtime apis were supported. as 3rd party libs for the vala language.

--------------------

answer author works currently now for http://www.prettytailor.com, you can contact with him through prettysalon1310@yahoo.com , dont forget stop by the site to take a random view,there are many things listed like below:

Image

( http://www.prettytailor.com/princess-wedding-dresses-s71216/ )

Image

(  http://www.prettytailor.com/vintage-wedding-dresses-s71214/  )

没有评论:

发表评论