# making of a language

## Recommended Posts

dkx187    100
I am currently making a language with xml but sometimes I wan't to make commands in other languages.Is there any way I could do this?If you know a web page I could visit then please link. Thank you

##### Share on other sites
rip-off    10979
Why XML? It is terribly verbose for such a task.

If by "make commands in other languages" you mean use types or functions defined by other languages, then it is possible. How is pretty much up to you, after all you are writing the language.

##### Share on other sites
ToohrVyk    1596
You can do this pretty easily. For instance, I could do like XSLT does and use:
<xsl:value-of select="php:frobnicate(@content)"/>
This calls the "frobnicate" PHP function.

Of course, the hard part is getting your compiler or interpreter to actually handle this. For instance, when running XSLT from PHP, you can register PHP functions to be run from XSLT. In the general case, you can use any technique available to the interpreter (or compiler target) for calling external functions.

But there are so many possible interpreters or compiler targets that I'm not going to give you a complete list of how to do it, nor will you find a complete list online. However, if you told us your interpreter technology or compiler target technology, we would be able to help.