[LLVMdev] Is LLVM appropriate for implementing a shell interpreter?

Mu Qiao qiaomuf at gmail.com
Thu Mar 24 06:31:08 PDT 2011


Hi devs,

We are implementing a library that interprets shell scripts so that
other programs could efficiently talk to bash. We'd like to hear your
advice on whether LLVM is appropriate for us. Here are our considerations:

In most cases our library will interpret each script just once. Our
current approach is using a manual implementation based on ANTLR and
C++, so actually we are executing the scripts while interpreting. If we
turn to LLVM, we need to first compile it into LLVM IR, then into native
code. Our guess is this may be slower than our current approach. Is that
true?

Anyway, we do have several scripts that need to be sourced and reused
while interpreting others. We guess this is where LLVM could help. LLVM
optimized code for those scripts should run faster than our manual
implementation. So the overall performance could be improved.

Could you please point out if we are wrong? Thanks.

-- 
Best wishes,
Mu Qiao
GnuPG fingerprint: 92B1 B0C4 8D14 F8C4 EFA5  3ACC 30B3 0DE4 17B1 57E9

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110324/2672b318/attachment.sig>


More information about the llvm-dev mailing list