Is there a particular reason for using exotic programming languages for the system?

I’m new to this SmartThings ecosystem and I really don’t understand why it insists on using so exotic programming languages. It looks like in the beginning many things required Groovy code. Now, there is Edge Drivers which require Lua code. I admit there are apparently people who love those languages but if we look at a table of language popularity Most Popular Programming Languages for 2021 (cleveroad.com) Groovy and Lua are not even near to those lists. I’m in the industry for decades. Yes, I can learn and use another language but I need a serious reason for that. I don’t see advantages in using Groovy or Lua. SmartThings seems to be a huge platform for home automation. Why don’t we use something more streamlined?

Lua has been used specifically for home automation systems for over 10 years for some particular technical reasons. So I think that choice is not a surprise.

https://www.bmc.com/blogs/lua-programming-language/

And remember that in the new architecture you only need to use LUA if you are writing your own device driver, which very few people will be doing.

If you want to write your own if/then code, a smartapp, you can write it in any language you want because you’re going to be hosting it yourself and then interacting with smartthings through the REST API. So if you want to code in Java, or C++, or even Swift, you certainly can for your smart app. Or you can just use MQTT with node red, which is popular right now.

Smartthings had a reputation for being easy to write custom device drivers in, which was true, but then you had to come back to the question of why were you having to write your own device drivers in the first place when they were using 2 well-established third-party protocols? And that was really because they had chosen to do only a pretty limited implementation of the third-party protocols. They didn’t even support central scenes through the menu UI.

Now if you like building your own hardware devices, yes, you’re going to have to learn LUA. But other than that, most people won’t need it. :sunglasses:

Groovy came from the original founding team of SmartThings, that team had expertise with the language and at the time it was much more popular than it is today.

If you were to look at lists of popular embedded or scripting languages then Lua would rank a much higher.

4 Likes

SIgh I have to concur…I am an ‘old, jaded’ IT developer who has survived C, C++, C#, Object Databases.

I managed to survive Groovy…

I don’t think it is just the languages being exotic, it’s more how robust/well supported they are (which is linked I guess)

I was incredibly excited to see Edge appear and jumped in.

I have just spent the last three days trying to get a working lua/luarocks installation…it is a total cluster f**k. Admittedly Windows is my main platform, However, I also tried on my RPi dev machine. Result Segmentation fault,

My next port of call is a fresh Rpi install . I hope this works.

Part of the problem is the lack of decent diverse online experiences/blogs. I guess Windows is not the platform of choice from these practitioners/open source dudes

This is such a waste of time and good will. Funny how Nodejs and javascript were a fraction of the effort

1 Like

Hah! New decision…I am going to try a Ubuntu VM…wish me luck…

1 Like

Ok …seems like a good decision…wasn’t exactly smooth but at least I’ve finished this step.

For what it is worth, based on my experiences I do not think using a windows environment for this is a good idea

1 Like

What I’m usually trying to do from the beginning is to “unite” different technologies, languages, etc. with something before diving deep into the details of “recommended” ways especially if the suggested technologies are not mainstream in the broad sense of that word. They might be kind of mainstream for the particular niche. I didn’t try to do anything with the Edge drivers yet but for the device schema and the smartapp hosted in AWS I took TypeScript which could be obvious solution to bring at least some sort of code validation. That worked pretty well. Even before doing that I found that there is TypeScript to Lua transpiler - TypeScriptToLua which I want to try when I get to the Edge driver part. I realize it might look as an extra complexity but I really would like to use at least one language to write different parts of the system. That is of course not related to linux vs windows development environment. I can only add that Windows worked well enough for writing smartapp in TypeScript and publishing it on AWS.

1 Like

Hi David - I’ve been using RPI for Edge development for several months and I find it works great. Be glad to help any way I can if you have any questions.

Many thanks for the offer. Now I’ve moved to Ubuntu it’s going well. I’m very excited about edge paradigm. I’ll know more in the next few days

2 Likes

@alex.49.98 interesting. I suspect that the typescript to Lua step might be problematic.

I am thinking / hoping that I can use a single Lua driver to ‘wrap’ my various JavaScript implemented devices. I may struggle a bit with different capabilities but I’m not sure yet

I am hoping that this will mean any complexity with my devices is confined to my nodejs ecosystem which is familiar to me and seems very robust and the Lua driver is basic and doesn’t need change

We will see.

Please let us know how your typescript journey goes