JSR223 or default?

Hello guys…

What are you using for rules? The stock language or the js232 language?

Jsr223 rules (pun intended)
If you have some experience in js or python and you like efficient, flexible code with good performance, you should definitely go for jsr223 Javascript or Jython:

I’m using the Rules DSL and Jython… at least until my migration to jsr223 Jython is complete. You can use both simultaneously. Whichever you chose, you’ll need to learn some coding skills. The benefit to jsr223 is that you’ll be able to use them outside of OH.

Okay… meaning if you use the JSR223 you can combine it with other systems outside OH? But would that language then be preferable for all scripts - or just mix it with what makes sense?

Cool… I have little experience in Python, so could be i should go for that… - i’ll take a look on the example :slight_smile:

No… I meant that you will need to learn Xtend for use in the Rules DSL, but it is a dead language. Instead, you could learn, JavaScript, Jython, Groovy, etc. for use with JSR223, and there are many other applications for using that knowledge. If you’re interested in learning Python, then Jythin sounds like a good choice for you.

Okay… i’ve made some scripts with the Xtend - but think it’s a strange language for handling conversions and stuff like that… Also it can’t be used to much else…
Here i think the Python approach could be awesome, since it’s something that can be used for much more later on…

There isn’t any C++ or C# approach for it?

If you are a developer or want to learn to become one and are relatively self reliant when figuring this sort of thing out I’d recommend JSR223.

If you are not and want to come up to speed more quickly or having more support on the forum is important then Rules DSL is an OK choice.

If your Rules will be relatively simple, then the Experimental Rules Engine might be worth a look. The code part is written in JavaScript so it isn’t using an obscure language.

I use Rules DSL mainly so I stay current and can help users on this forum with trouble there. I started to look into JSR223/Jython awhile back but found the docs to be too sparse for me to quickly figure out how to do some basic things so I gave up. It wasn’t worth my time. Scott and others are starting to become more active on this forum helping people with JSR223 so maybe it will become closer to a first class citizen in OH land.

Someone once tried to get JRuby and one other language working (I think) with OH but there were some fundamental incompatibilities. So not all JVM languages are supportable in JSR223 in OH.

Okay… That’s very good arguments… I personllay would like to learn doing some kind of code - normally i program PLC’s and robots for the industrial sector, here we use something that looks like the old Pascal language…
However, it would be awesome to get the skills for a “PC language” like Python or something… the Xtend language can’t be used to anything else than this - this could the make the Python approach usefull later for me i think :slight_smile: