Implementing a programming language

Started by cygnusX, June 09, 2008, 02:14:27 PM

Previous topic - Next topic

cygnusX

I'm not sure whether this is the right place for my question but i see many similar questions on this forum so i posted it here.So,if i want to create programming language(object oriented language with general purpose) what would be better choice for implementing it - assembler or using other high-level language?I mean,for example as far as i know Ruby use the C language,maybe i'm wrong i don't know but on the official Ruby website there is the source code that Ruby uses(functions,variable declaration and so on) and it's written in C.Is there some good reason for implementing my language with assembler language?Using assembler would be very complex task and ofcourse would be much harder/slower to implement my language with assembler than implement it with an existing high-level language,but with assembler you have full control on everything.So can anyone give me some advice?

tenkey

If you have to ask, then start with a high level language.

Building a language processor for an OOPL is a nontrivial task, so you will either need a lot of knowledge or experience, or have a lot of perseverance to build one in assembler.

If you are going to do it in assembly language, then it will be because you want to do it. You have the potential to outdo one written in a high level language, but no guarantee that you will. Control over the machine and speed of execution is secondary to being able to manage the code and ensure correctness. If you cannot manage the (large) assembly code, you will be forced to use a high level language.

There are many different ways to build a language processor regardless of whether you want to build a compiler or an interpreter (script engine). Factors include: how quickly you want to build one, how adaptable you want it to be, and the desired performance of the runtime code. If you need a garbage collector, that will be a further design item - there are many types of garbage collectors.

Not only will you be designing (choosing the features of) a language, you will be designing (choosing the features, algorithms, and architectures of) the language processor.

Whichever way you choose, good luck !
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8