Create applications and Luarocks

Hello.

  1. I know Solar2D is mainly a game engine, but I’ve seen on the site that it is used for mobile applications as well.
    In the example section of the site, there are many examples of games created with Solar2D, but I couldn’t find any examples of applications, can someone send some examples of applications built with Solar2D?
    I need to create an application that users can manage a telegram bot in it.
  2. How does luarocks work in Solar2D? Is it fully supported?
    Are there any instructions on how to use Luarocks inside Solar2D?
    I searched on the forum and the documentations but I couldn’t find anything.
    I’m aware that Solar2D has a version of Lua interpreter for itself and doesn’t use the main Lua interpreter and theoretically it might not work with Luarocks?

Thanks in advance.

  1. Yes, you can develop business and other non-game apps with Solar2D with ease. Regrettably, I don’t keep track of such apps, so I don’t have a list of apps or developers to link here.

  2. I’ve never tried LuaRocks with Solar2D nor have I ever had the need for it, but there should be no issues with using it to manage some modules for your projects. I might be missing something, but what sort of integration are you thinking of in terms of Solar2D and LuaRocks?

I’m not sure how Telegram bots are managed, but the answer is probably yes. If you can manage them via REST API, for instance, then it’ll be very easy. If they have only some language/platform specific API(s), then it’ll be more difficult.

1 Like

As XeduR mentioned, LuaRocks is nothing more than a package manager for Lua. I guess if you point LuaRocks to your file directory and only manage modules that are pure Lua they should work in Solar2d. I think it would be easier just to grab the files and include them in your project. As for other packages that have external dependencies most will not work as-is from LuaRocks

But I might be miss-understanding the question. So here is another answer to a different question. Solar2D doesn’t compile Lua into native apps. It has a specific version of Lua that it uses to run scripts. You can’t add any modules to that version with LuaRocks unless you are willing to modify the source code.

1 Like

Thanks for your explanations, now I have a better concept about starting to use Solar2D.
I was having doubts about creating non-game applications because I thought “Solar2D = game engine”.

“I don’t keep track of such apps, so I don’t have a list of apps or developers to link here.”

There are many examples of games developed by this engine on the site, it would be nice to have a list of non-game apps as well.
But thanks.

“what sort of integration are you thinking of in terms of Solar2D and LuaRocks?”

Not much I guess, In order for me to send some requests to telegram bot server, I needed to run some libraries.
Also I might need to connect to a server and use it’s redis database as well so I’m gonna need to use a library for that purpose too.
So I was wondering if Solar2D “natively” has a support for LuaRocks or not.

“If they have only some language/platform specific API(s), then it’ll be more difficult.”
Fortunately they don’t, you just have to send requests to a url and that’s it.

So you are saying that it is a normal thing that Solar2D doesn’t natively support LuaRocks?
I mean if it did support, it would have been more convenient to use other libraries inside your project.
But the manual way of grabbing modules’ files and putting them beside the actual project and then including them, doesn’t seem a bad idea, thanks for the hint.

Yeah, back in the day when Solar2D was starting out and when it was known as Corona, it was developed and marketed for both games and non-game apps, so pretty much all of the required functionality is there.

With games, most developers want to tell others about their games and they share about their creations here on the forums and on Discord, etc. but most business app developers don’t, so it’s harder to keep track of them.

And yeah, if you just need to send network requests to a URL, then that’s very straightforward, see: https://docs.coronalabs.com/api/library/network/request.html.