-
New language using C
I'm another C newbie who came across a statement in a book about C programming. In a chapter dealing with strings, the author said that a new computer language could be written using C. Nothing new there. Except he was implying it could all be done with string manipulation. I presume this new language would still be sent to a C compiler.
Can anyone here expand on this possibility?
-
Huh? What do you mean by "all done by string manipulation"? Of course you need string manipulation to parse the code but that's not everything of course.
Look at perl, I assume perl is written in C. I also think that C# is written in C but I don't know. Mono sure is. Oh know wait, I think C# was written in C# itself or something like this. ;) The world of compilers is full of wonders...
-
I agree with Spark. The author is probably only talking about the "Code Parsing", which is a must for any compiler. But this is not all to the development of a new language.
-
>a new computer language could be written using C.
I guess he meant that C can be used to write compilers and interpreters. C can be used to write compilers and interpreters for existing and new language. Note that both designing a language and writing a compiler or interpreter are quite complex things.
When creating software, you usually write code into a textfile which you pass to the compiler. A textfile can be seen as a collection of strings, so in that way the author of your book is correct. But it is too simple to say that writing compilers is just manipulating strings.