Slashdot Mirror


Building Intelligent, Rule-Based Applications?

Donald Hughes asks: "What are good approaches for building intelligent, rule-based applications? In particular, I typically build ASP.Net applications. I came across P#, which translates Prolog into C#. I also came across NxBRE, which touts itself as the first open-source rules engine for the .Net platform. Currently, the intelligence in my applications consist of data stored in the database, which is either processed in T-SQL or in a C# class using linear conditional logic. This approach works fine to a point, after which the complexity of the if/then statements becomes extremely difficult to manage. This is especially problematic when returning to a project after several months of not looking at it, or when someone needs to be introduced to it for the first time. Does anyone have some helpful advice?"

2 of 57 comments (clear)

  1. Re:just start refactoring by Enonu · · Score: 2, Insightful

    Yes. Re-invent the wheel. A wheel that weakly does something specialized languages do extremely well. Let me go get that hammer to do the welding while we're at it.

  2. Re:just start refactoring by Derleth · · Score: 2, Insightful
    Yes. Re-invent the wheel. A wheel that weakly does something specialized languages do extremely well. Let me go get that hammer to do the welding while we're at it.

    You're exactly right: Most languages have very weak support for that kind of dynamic, introspective, functional programming. It would be ugly in C, for example, and impossible in Fortran. (In theory, everything is possible in every Turing-equivalent language. But eventually you blow out all your tendons and have to be put in a madhouse.) You should always fit the language to the strategy.

    Except when that would be even more painful. Calling system APIs from Lisp, for example, is getting a hell of a lot better on most systems from most Lisps, but there are systems where it's even more of a pain of the ass than coding up data-driven code in C. Perl and Ruby and Python have taken off because they've made it possible to use a moderately pleasant language without screaming in agony every time you need to touch an API, but very few of the specialized languages are that obliging on most systems.

    So by all means advocate the right language for the job, but remember that the job may be more complex than you think.

    --
    How can you use my intestines as a gift? -Actual Hong Kong subtitle.