[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] tcc as jit-compiler
From: |
Basile Starynkevitch |
Subject: |
Re: [Tinycc-devel] tcc as jit-compiler |
Date: |
Mon, 20 Oct 2014 15:15:50 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Oct 20, 2014 at 02:24:38PM +0200, address@hidden wrote:
> hi all,
> I would try to play with tcc as jit compiler
> in a program working with win32 gui
> and implementing a scripting language.
>
> Something like a microscopic emacs,
> where elisp functions are replaced by C compiled code.
> tcc should compile and (most important) re-compile user-functions
> in a quite large number and number of times.
> (Probably C code coompiled by tcc will be the translation of an hl
> script lang).
>
I know nothing about windows, not much about TCC (which I sometimes use, but
not much since it seems unable to compile GCC on Linux/x86-64 these days),
but I am sometimes contributing to GCC http://gcc.gnu.org/ and I am the
main developer of MELT http://gcc-melt.org/ which
is a domain specific language to extend & customize the GCC compiler. MELT code
is
translated to C (actually a bit of C++ today) at runtime then dlopen-ed.
I am not sure that you right in wanting to use tinycc for JIT-ing purposes.
The point is that generating C code is probably not easier than
using some JIT library like LibJit http://www.gnu.org/software/libjit/,
GNU lightning, or LLVM.
Of course, generating C code has its advantages too: it can be well compiled
by complex C compilers (like GCC or Clang), which Tinycc is not.
My point is : if you wish to emit JIT machine code, just use some JIT library.
If you want to generate C code, there are cases where you want it to be compiled
with strong optimizations, and then TinyCC is not the right compiler.
Cheers.
--
Basile Starynkevitch http://starynkevitch.net/Basile/
France