You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I gave a thought on how should we go about implementing this. Before writing my conclusion following points should be noted,
Implementing a Hash function is tricky for now in LLVM backend. In addition, using a pre-existing one written in C language sounds like a good choice for me.
Scaling for various combination of types is extremely tricky and unsafe in C. Our asr_to_llvm.cpp allows to scale very easily. We did this for lists and tuples in LLVM backend by generating only the types required by the user code.
In future I believe, we will be able to implement complicated hash functions in Python itself and then compile them via LPython.
So now my conclusion is,
Implement everything other than hash function in LLVM itself, like collision handling, accessing key-value pair, etc.
Implement hash function in C for now and call it from LLVM. In future once we will be able to write and compile hash function in Python itself then we will directly call it from LLVM and stop using the one defined in C runtime.
We should implement everything in dict so that drop in replacement of hash functions is possible.
Rest of the details, blockers I will try to figure out while actually implementing dict.
The text was updated successfully, but these errors were encountered:
Yes, I think that seems like a good plan forward. Let's start in LLVM/C, and then later as LPython becomes stronger, we can move some parts of it to LPython and compile to ASR and then call it from the LLVM backend.
I gave a thought on how should we go about implementing this. Before writing my conclusion following points should be noted,
asr_to_llvm.cpp
allows to scale very easily. We did this for lists and tuples in LLVM backend by generating only the types required by the user code.So now my conclusion is,
Rest of the details, blockers I will try to figure out while actually implementing
dict
.The text was updated successfully, but these errors were encountered: