Comments (8)
@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.
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.
Interesting that Python is six times slower than Rust REPL on this task which is strange.
from metta-examples.
This issue somewhat relates to one I've just created as well trueagi-io/hyperon-experimental#638
from metta-examples.
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.
@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.
What do you think about adding differently typed == operator?
from metta-examples.
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)
- Missing explanations on how to run Child AI HOT 1
- in child_ai.py hard to understand the curiosity_behavior function
- Canonical way to process and/or present complex expressions with nested subexpressions HOT 4
- Question regarding types and their understanding HOT 3
- Question regarding performance hacks HOT 6
- Recursion with multiple matches HOT 3
- Case as replacement for cond HOT 7
- Could (if) return True instead of its content? HOT 5
- How to emulate lambda calculus? HOT 17
- What is the canonical way to write queries to knowledge graph HOT 44
- Biomedical knowledge graphs: Examples, resources, a shared representation, and how to encode it in MeTTa HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metta-examples.