News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
Tcc - Lua
Author Message
jpjacobs
Member
***


Posts: 113
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #1
Tcc - Lua

Hi, since the exam-period is usually the period where anything is interesting, here another blurb.

I was thinking about the biggest disadvantage of interpreted languages like Lua is the speed. So I wrote a little test to compare a C routine passed from within Lua to tcc and have it run directly, and the same routine implemented in Lua directly.

It turns out that the tcc version is a whopping 16 times faster than the Lua version, so maybe it's of some use to people who need to write fast code for some tasks.
Another good thing about Tcc is that it should compile for all 3 platforms supported by MurgaLua (disclaimer: not tested myself), and it's really small (installed size on debian 446k).

Anyway, the simple testscript I used is here.
Hope it's of some use to anyone!

Greetz,
Jan-Pieter



Attached File(s)
.lua File  tcctest.lua (Size: 592 bytes / Downloads: 5)
01-15-2009 11:36 PM
Find all posts by this user Quote this message in a reply
jyf1987
Member
***


Posts: 58
Group: Registered
Joined: Jun 2008
Status: Offline
Reputation: 0
Post: #2
RE: Tcc - Lua

i am interesting of tcc too,but when i meet some problem and i sent mail to the dev-maillist,they tell me they just treat it as a toy,and hope i choose gcc as a offical compiler


Cheers
jyf
01-16-2009 11:56 PM
Find all posts by this user Quote this message in a reply
jpjacobs
Member
***


Posts: 113
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #3
RE: Tcc - Lua

That's a real pitty, because such a small c compiler, even with it limitations compared to its big brother gcc, is really interesting I think...

01-16-2009 11:59 PM
Find all posts by this user Quote this message in a reply
jyf1987
Member
***


Posts: 58
Group: Registered
Joined: Jun 2008
Status: Offline
Reputation: 0
Post: #4
RE: Tcc - Lua

yes,i think tcc is an very helpful tool for me,because i have no more requests.as lua was written by clean C,maybe tcc is a good tool for writting addons for lua interpreter


Cheers
jyf
01-17-2009 04:30 PM
Find all posts by this user Quote this message in a reply
znarf
Junior Member
**


Posts: 34
Group: Registered
Joined: Jun 2007
Status: Offline
Reputation: 0
Post: #5
RE: Tcc - Lua

I'm also a big fan of tcc and even use it sometimes productively at work for small tasks - I'm not aware of an alternative if you need a working portable compiler on a memory stick.
If your main concern is execution speed, did you already have a look at luaJIT? In the one case I tried it, it gave me a performance boost of a factor 7. Then the difference to tcc executables (which are not very optimized machine code) is not that large any more, and to my mind the advantage of staying within one language (think about debugging!) in most cases clearly outweighs the gain in speed.

01-23-2009 06:42 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: