Page 1 of 1

Writing applications with Lua?

Posted: Sun Oct 18, 2009 5:55 pm
by dcarrera
I've scanned through the developers guide and I could not find any information on how to build an application with Lua.

I don't want to write an application with C++. That's not my idea of a "web" application. I expect to write the app using HTML, CSS, JavaScript and some high-level server side language like Perl, PHP, Python or Ruby. In the case of Tonido, it seems like Lua would take the role of the server side language. I am happy to learn Lua in order to experiment with Tonido, but I do not want to learn C++. I like high level languages.

Are there plans to add some documentation for making Tonido apps with Lua as the server side language?

Re: Writing applications with Lua?

Posted: Sun Oct 18, 2009 7:07 pm
by madhan
I agree the documentation on Lua is a bit thin. Let me see if I can get something up.

Re: Writing applications with Lua?

Posted: Mon Oct 19, 2009 4:00 am
by dcarrera
Can you confirm that it is possible to write a Tonido app using just Lua + JavaScript?

Re: Writing applications with Lua?

Posted: Mon Oct 19, 2009 7:42 am
by dcarrera
Ok, I've been reading the Lua manual. It's actually very similar to JavaScript. Most of the difference seems to be a slightly different syntax. It should be easy to use Lua as a server side language if you already know JavaScript.

Re: Writing applications with Lua?

Posted: Mon Oct 19, 2009 9:06 am
by madhan
There needs to be C++ shell which gets the HTTP request and then invokes LUA.
Once that is in place, everything else can be in LUA.

Re: Writing applications with Lua?

Posted: Mon Oct 19, 2009 9:43 am
by dcarrera
Sounds good. I look forward to when the Lua documentation is available. In the developers guide, you could just re-copy section 3 ("your first Tonido app") and show how the same dummy application would be done with Lua. This could include the C++ shell so that a non-C++ developer can just copy it. So the developers guide could look like this:

1. Introduction.
2. Build System.
3. Writing your first Tonido Application (C++).
4. Writing your first Tonido Application (Lua).
5. Tonido Platform Overview.
6. Services and Messages Architecture.
...

This seems like the simplest way to get a reasonable amount of Lua documentation into the guide. What do you think? I don't know if you'll get a lot of developers from Lua. Maybe I'm just weird in that I'm not interested in C++ but I'm willing to use Lua.

Re: Writing applications with Lua?

Posted: Tue Dec 29, 2009 6:45 pm
by error
Hi,

Two questions:
1.- Is it not a contradiction to promote personal cloud and open source and at the same time choose Lua as the option to create application when Lua creators says things like this:
"Lua is not an open-source project, with code contributed by several people: all code is written by us"
"Lua is designed, implemented, and maintained by a team at PUC-Rio, the Pontifical Catholic University of Rio de Janeiro in Brazil"

2.- How this option (Lua) for create apps relate with Tonido mission:
"Empower customers in a connected world"

Thanks

Re: Writing applications with Lua?

Posted: Tue Dec 29, 2009 9:11 pm
by madhan
Interesting question. You obviously have looked at LUA more in depth than us.
1. Is it not a contradiction to promote personal cloud and open source and at the same time choose Lua as the option to create application when Lua creators says things like this:


LUA is licensed under MIT License which is a pretty liberal license.

Open source means several things, one is actual licensing of the code and the other is the way people interact to create the source. I think LUA fits (1) and maybe not (2). But still nothing really in LUA is anti-Open Source. You can still fork it, modify it, sell it etc and it is all free, which to me is what open source is. So I don't think that there is a contradiction here.

2.- How this option (Lua) for create apps relate with Tonido mission:
"Empower customers in a connected world"


Using Lua really doesn't empower customers, using Tonido does and that is our mission.

LUA is an easy way to get scripting support for devs and that is why we chose it.
If there is a better way I am sure we would consider it.

Re: Writing applications with Lua?

Posted: Wed Dec 30, 2009 11:58 am
by error
Open source means several things, one is actual licensing of the code and the other is the way people interact to create the source. I think LUA fits (1) and maybe not (2). But still nothing really in LUA is anti-Open Source. You can still fork it, modify it, sell it etc and it is all free, which to me is what open source is. So I don't think that there is a contradiction


Well, is true that open source mean to be able to take a source code and fork it, modify it and if you want, sell it, etc. But Lua left aside the fact that I could contribute with the development so everyone can take advantage of my code. That is, in my humble point of view, the most important thing in open source: that you can put your effort to solve a problem so my fellow developer in Tanzania, for example, does not need to redo a solution for the same problem, even though he/she could figure out a better one and then replace my code. That's the truly power of open source which is impossible to do with Lua. Which at the end means that every single Lua developer will eventually re invent the wheel.

But any way, I think Tonido is a very cool gadget, very useful and hope to have one very soon. Let's see if I can put some code in it.

Re: Writing applications with Lua?

Posted: Wed Dec 30, 2009 1:30 pm
by madhan
I look forward to your contributions.