Closed
Description
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
.
Metadata
Metadata
Assignees
Labels
No labels