Ask HN: Language for Rules Engine
I have an idea for a niche component to be used in the education market. It would require writing a rules engine, but the rules would have to be dynamic because power users would be able to change them. I have no experience writing a rules engine so I'm wondering if there is a de facto standard language used for this scenario?
5 comments
[ 4.0 ms ] story [ 24.1 ms ] threadThe reason I would chose a Lisp is due to the ability to rapidly write a DSL, so you can build a tailored language for the rules engine further you can rapidly build variants for industry specific verticals, that conform to the jargon of that industry.
My secondary choices would be many of the scripting languages with JavaScript being the top second choice. JavaScript is a good candidate because it is simple to pick up and has a lot of material geared towards the non-programmer.
For me personally I would shy away from any languadge that enforces OO, not because I think OO is bad, I am actually a proponent of OO for certain cases, but rather because OO brings a lot of baggage with it that creates barriers for individuals that are not programming as a primary job role.
Finally, the idea of Rules engines have been great on paper, the promise of turning the power of decision trees over to business annalist but the reality has not been so favorably to rules engines. Most of the time the responsibility of actually writing the rules is pushed right back to the programmer. So the big thing you have to ask yourself is how is my idea different. I am not trying to be the rotten apple in your pie. I just want to highlight that the promise of rules engines has thus far been marred with failure. Which tells me that more people need to innovate in that space. I would just advise you to really question how you are going to deal with that reality. I think utilizing a Lisp is one of the keys to a proper DSL strategy and I think the lack of good DSL's is where rules engines have failed, hence my recommendation.
I was far too vague with my question. I did not mean a general purpose rules engine as in the middleware piece. What I'm thinking about is better described as a rules based system, but far more complex than anything I've written in the past. Just to add complexity, a few domain experts will have the ability to modify and implement rules.
My inclination is towards a language with a small syntactic footprint and not a lot of tribute towards system stuff like memory management. So I was leaning towards Clojure but JS is a great thought. Other languages I wondered about were Prolog and Scala.
I'm doing it as a learning exercise, an attempt at keeping my skills from rusting, and because my day job is boring. If it can be monetized, that's a bonus.
http://clipsrules.sourceforge.net/