Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 May, 2013, 04:40:52 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: It is possible to convert lua to c, and vice versa! -  (Read 907 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
njaddison
LV4 Regular (Next: 200)
****
Offline Offline

Gender: Male
Last Login: 15 May, 2013, 02:46:53
Date Registered: 08 November, 2011, 03:56:20
Location: South Carolina(USA)
Posts: 153


Topic starter
Total Post Ratings: -5

View Profile
« on: 04 January, 2012, 01:52:59 »
0

I was surfing the internet, and I found a lua to c converter, and a c to lua converter. It would be possible to convert standard lua scripts to c, so we can run them with ndless, but we would need to create a c to lua converter. This would be awesome because we would be able to play c games without ndless because of the nspire's 3.x lua capabilities.
-Nelson

« Last Edit: 04 January, 2012, 01:53:37 by njaddison » Logged


NerdTests.com says I'm a Highly Dorky Nerd God.  Click here to take the Nerd Test, get geeky images and jokes, and talk to others on the nerd forum!


epic7
Chopin!
LV11 Super Veteran (Next: 3000)
***********
Online Online

Gender: Male
Last Login: Today at 04:26:36
Date Registered: 22 October, 2011, 01:45:43
Location: Northeast US
Posts: 2162


Total Post Ratings: +118

View Profile
« Reply #1 on: 04 January, 2012, 01:56:03 »
0

Wouldn't it be slower in lua if C was converted?
Logged



Current Projects:
TitleLanguageProgressStatus
DrillMiner    C (ndless)   35%         Active
?     C (ndless)   0%        Unconfirmed

Spoiler for Programming languages I currently know:
Java (Learning in AP Comp Sci)
C (Specifically Ndless)
Unity JavaScript
LabView (For FIRST robotics)
z80 ASM (Just a little bit Tongue)
njaddison
LV4 Regular (Next: 200)
****
Offline Offline

Gender: Male
Last Login: 15 May, 2013, 02:46:53
Date Registered: 08 November, 2011, 03:56:20
Location: South Carolina(USA)
Posts: 153


Topic starter
Total Post Ratings: -5

View Profile
« Reply #2 on: 04 January, 2012, 02:00:53 »
0

Well, yeah. But it would originally be c, and I can be patient when using a lua script that was originally c.


« Last Edit: 04 January, 2012, 02:01:24 by njaddison » Logged


NerdTests.com says I'm a Highly Dorky Nerd God.  Click here to take the Nerd Test, get geeky images and jokes, and talk to others on the nerd forum!


cyanophycean314
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 03 May, 2013, 19:28:34
Date Registered: 07 December, 2011, 02:44:32
Location: Somewhere?
Posts: 363


Total Post Ratings: +42

View Profile
« Reply #3 on: 04 January, 2012, 02:38:27 »
+1

I think C being converted to Lua would have many problems. Speed would probably be an issue, but there are so many features that Lua could not support. I'm not too familiar with either C or Lua, but it seems this wouldn't work.

Secondly, njaddison. You should put that userbar into your signature. That way it's attached to every post, so you don't need to copy and paste it every post.
Logged

jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: Today at 04:03:04
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 600


Total Post Ratings: +10

View Profile
« Reply #4 on: 04 January, 2012, 02:47:26 »
0

you could probably run a lua script indirectly through ndless any way scince there is a lua interpreter, of course i could be wrong
Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
Art_of_camelot
The matrix has you.. ಠ_ಠ
Support Staff
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Yesterday at 22:58:04
Date Registered: 30 August, 2008, 04:55:55
Location: Dr. Light's Laboratory
Posts: 4385


Total Post Ratings: +149

View Profile WWW
« Reply #5 on: 04 January, 2012, 05:05:03 »
0

It also depends. Although the converter may work, it is a matter of how efficient the code it produces is. Also, what may be good design in one language may not be good coding practice in the other, thus producing overly bloated code. Just some things to keep in mind. Smiley
« Last Edit: 04 January, 2012, 05:05:27 by Art_of_camelot » Logged

Projects:
TBA! Coming to an 83+ near you!

NerdTests.com says I'm a Cool Nerd King.  Click here to take the Nerd Test, get nerdy images and jokes, and write on the nerd forum!


Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Yesterday at 19:51:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1178


Total Post Ratings: +158

View Profile WWW
« Reply #6 on: 04 January, 2012, 20:31:51 »
0

i'm afraid it won't work.. switching between languages is already hard to do manually, than how are you supposed to do it automatically?

it won't work by just replacing all the commands, you really need to dig into the syntax and structure to make it useable, and how're you supposed to do that?
Logged

Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 00:47:15
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #7 on: 04 January, 2012, 22:09:14 »
+1

Converting lua to C is pretty easy as Lua is programmed to be easily intergrated with C.
Converting C to Lua however is a much bigger task, because:
1. It has many different types of variables which are not available in Lua.
2. Most programs access specific stuff (screen, timers, etc) which you can not do from Lua.
3. If you can bypass these limitations, speed would be a very big issue. My logo interpreter just runs at ok speeds, but C is a billion times more complex.

So in short : C to Lua is not possible.
Of course, you can convert some programs manually, but thats another case Tongue
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.24 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.