tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] llvm IR target


From: mobi phil
Subject: Re: [Tinycc-devel] llvm IR target
Date: Mon, 10 Mar 2014 13:14:03 +0100

Thomas,

wanted to keep low noise, thus did not disclose more details, but here it is:
I am experimenting with some language extensions, such as classes/objects, 
fibers, etc. For some parts of the could just use C++ but among other 
annoyances for me in C++ is that I do not have "official" access to the virtual 
function pointer table. The list is long. I call these extensions decorators.

One can think this as a macro and preprocessor replacement, where the 
replacement preprocessor is supposed to understand part of the syntax
context.

I tried to do all that with macros... but after really lot of work in hacking around with
macros like in boost preprocessor, I decided to stop fighting the wind mils. 
Though ended up in writing nice macros for class declaration/initalization, for method calling etc.
With macros, I could have stayed 100% C, but the price was too high.

So I am trying to add these decorators through minimum language extensions.
Like original C++ compilers, the code should translate into C.
For (pre)processing my extensions I need to build a C parser, though. Have two options
for the moment: hack tcc and/or write my own context-sensitive parser with ragel.
(I just started to know ragel. It seems that through fcall feature it is possible to write this parser).
The approach with ragel would allow me to preprocess the "decarated" code into C,
and compile with anything. By hacking tcc, I would have from the beginning a
fast compiler, but with less optimized code. And here could clang come into picture.



regards,
mobi phil

reply via email to

[Prev in Thread] Current Thread [Next in Thread]