user1360099
user1360099

Reputation: 35

Common code can be used in C and Javascript

For the project, i will recieve data from the server(May be JSON/XML), and there are two individual client application which will process the data to do the similar things. One application will be a web based and the logic will write in JavaScipt, One is about C application. The logic for how to process the data is the same, Is there any way to write the common code using some method can be reused between them.

Upvotes: 2

Views: 83

Answers (1)

Greg Hewgill
Greg Hewgill

Reputation: 993085

There exist Javascript implementations that can be called from C code. Using such an implementation, you could write a substantial portion of your code in Javascript, and interface it with C.

One such implementation is QtScript. Qt requires C++, but you can link C and C++ code together easily enough.

Upvotes: 2

Related Questions