Re: Third party compiler middle and back-end

"BartC" <bc@freeuk.com>
Fri, 22 Oct 2010 23:42:55 +0100

          From comp.compilers

Related articles
[13 earlier articles]
Re: Third party compiler middle and back-end gneuner2@comcast.net (George Neuner) (2010-10-17)
Re: Third party compiler middle and back-end gneuner2@comcast.net (George Neuner) (2010-10-18)
Re: Third party compiler middle and back-end cr88192@hotmail.com (BGB / cr88192) (2010-10-18)
Re: Third party compiler middle and back-end redbrain@gcc.gnu.org (Philip Herron) (2010-10-19)
Re: Third party compiler middle and back-end cr88192@hotmail.com (BGB / cr88192) (2010-10-19)
Re: Third party compiler middle and back-end gneuner2@comcast.net (George Neuner) (2010-10-22)
Re: Third party compiler middle and back-end bc@freeuk.com (BartC) (2010-10-22)
Re: Third party compiler middle and back-end bc@freeuk.com (BartC) (2010-10-23)
| List of all articles for this month |
From: "BartC" <bc@freeuk.com>
Newsgroups: comp.compilers
Date: Fri, 22 Oct 2010 23:42:55 +0100
Organization: A noiseless patient Spider
References: 10-10-010 10-10-024 10-10-025
Keywords: tools, code
Posted-Date: 22 Oct 2010 23:53:38 EDT

"Daniel Zazula" <danielzazula@gmail.com> wrote in message
> Thanks for all the suggestions.
> I didn't say this before but what I really want to do is test a
> concept language, in other words: I don't care how the compiler work
> as long as A) it works and B) it is easy to implement.


Probably you don't want to implement a full compiler then, which is a lot of
work (much of it fairly routine).


> Problem is that the language I have in mind is everything but simple:
> - There is no keywords, only predefined constants and objects.
> - There is only two type of commands: variable assignment and function
> calls
> - There is no constructs, conditional jumps, loops and declarations
> are done through function calls.
> - Also you can create types (classes in Java/C# terminology) at
> runtime.
> - types and functions are objects so you can pass them as arguments to
> a functions.
> - you can also create code blocks and passes them to a function (this
> is how if-else works for example).
>
> C static nature won't allow me to use it as an intermediary language,
> LLVM or GCC probably fall under the same category, I thinking about
> modifying a Javascript interpreter or using it as is throught the eval
> function. Maybe all this is too much for me to do alone, anyone here
> interested in this challenge?


The interpreter approach is one idea for getting started. Even then,
you don't need a proper interpreter: once you have your 'front end',
and the input program presumably represented in some sort of data
structure, then you can try and execute it by traversing this data
structure.


Then you might have some idea of how well it works, or not, and how
much faster it needs to be, if that's an issue.


From what you describe, it sounds like generating native code for this
language could be difficult. What does the language look like?


--
Bartc


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.