Git Product home page Git Product logo

Comments (8)

vsbogd avatar vsbogd commented on September 17, 2024 1

@vsbogd is the issue caused by argument of car-atom being evaluated?

It is not evaluated in this context. If you see it is evaluated in log the reason is == has type (-> $t $t Bool).

from metta-examples.

noskill avatar noskill commented on September 17, 2024

adding types doesn't change the performance

(: List (-> $t Type))
(: Nil (List $t))
(: Cons (-> $t (List $t) (List $t)))

; convert (a b c) to (Cons a (Cons b (Cons c Nil)))
(: makelist (-> Atom (List $t)))

from metta-examples.

vsbogd avatar vsbogd commented on September 17, 2024

Interesting that Python is six times slower than Rust REPL on this task which is strange.

from metta-examples.

ngeiswei avatar ngeiswei commented on September 17, 2024

This issue somewhat relates to one I've just created as well trueagi-io/hyperon-experimental#638

from metta-examples.

vsbogd avatar vsbogd commented on September 17, 2024

From the code logic perspective nothing is wrong here. Although I recommend adding types as @noskill suggested in #42 (comment).

It is a performance issue. So I would suggest closing it as a duplicate of trueagi-io/hyperon-experimental#638

from metta-examples.

noskill avatar noskill commented on September 17, 2024

@vsbogd is the issue caused by argument of car-atom being evaluated? If so why it gets evaluated? I remember you told me that built-in metta types are not evaluated

from metta-examples.

noskill avatar noskill commented on September 17, 2024

What do you think about adding differently typed == operator?

from metta-examples.

noskill avatar noskill commented on September 17, 2024

works faster, but not much

(: same (-> Atom Atom Bool))

(= (same $X $Y) False)
(= (same $X $X) True)

(= (makelist $x)
    (if (same () $x) Nil (let $_cdr (cdr-atom $x)
                                (Cons (car-atom $x) (makelist $_cdr)))
                   )
)

from metta-examples.

Related Issues (12)

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.