Coder Social home page Coder Social logo

Comments (4)

gitttt avatar gitttt commented on September 15, 2024

I would be interested. In the best case, we would work together with @almostearthling and @ubarkai . What are your plans @almostearthling and @ubarkai ?

from pyclips.

almostearthling avatar almostearthling commented on September 15, 2024

I think that PyCLIPS is somewhat outdated, both in terms of style and build process. Its code is delicate and prone to errors (such as memory leaks) that are quite hard to identify: sometimes such errors may even depend on CLIPS itself, and the original authors often fix them in subsequent versions of the shell and library. Unfortunately it happens sometimes that these subsequent versions introduce small quirks that undermine backwards compatibility. Because of this I'd be glad if a different approach were taken, especially if more pythonic and less depending on the exact CLIPS API. And I'd be glad to contribute as much as I can: part of the code I wrote (for instance the module map) can be used to machine-write part of the scaffolding structure of the new module - as long as the goal is to write a module that wraps the C interface of CLIPS. Some of the ideas I had for PyCLIPS 2.0 - such as removing the redundant "current environment" interface - could also be implemented in a new module rewritten from scratch.

from pyclips.

gitttt avatar gitttt commented on September 15, 2024

@noxdafox how complete are your bindings? What are current or inherent limitations?
How easy can they be adapted to new clips versions?

from pyclips.

noxdafox avatar noxdafox commented on September 15, 2024

clipspy aims to be a pythonic 1to1 mapping of CLIPS C APIs.

For example, the following CLIPS C code.

templatePtr = EnvFindDeftemplate(environment, "example");
newFact = EnvCreateFact(environment, templatePtr);

theValue.type = INTEGER;
theValue.value = EnvAddLong(environment, 3);
EnvPutFactSlot(environment, newFact, "x", &theValue);

EnvAssert(environment, newFact);

Translates to clipspy like:

template = environment.find_template('example')
fact = template.new_fact()

fact['x'] = 3

fact.assertit()  # assert is a reserved word in Python

The reason for this choice was simple, I wanted to keep the design minimalistic and to leverage as much as possible the excellent Advanced Programming Guide documentation.

With this in mind, I would say that 85-90% of the CLIPS 6.30 APIs are available in clipspy. I left behind few functions and methods which seemed useless to me. All the core features are implemented and tested: environments, facts, classes, routers, functions, globals, modules and the agenda.

clipspy is also used as backend library to implement the CLIPS jupiter notebook which I've been using for quite a while in place of the old CLIPS console.

In regards of the limitations, the most important ones are documented and are a result of the limits of the C APIs. CLIPS 6.32 fixes several of them which I reported to the engine author and I believe CLIPS 6.40 brings some significant improvement in that direction.

I plan to start migrating to CLIPS 6.40 not too far in the future. It will require a significant amount of time as the new version changed the APIs quite a lot (few changes were driven by the development of clipspy). Nevertheless, as CLIPS 6.40 does not bring any improvement for the end user, I don't think is such an urgent task.

from pyclips.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.