Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What are A and B? Are they expressions over integers, floats, or strings?

I would simply try translating them to JavaScript / Lua and use v8 / LuaJIT (LuaJIT is probably much smaller and easier to embed)

And just do

    eval('A || (B && C)')
Or there is probably a way to store the parsed and compiled representation.

v8 and LuaJIT are slower than C/C++ in general, but for that specific simple case, they are likely about the same speed, or within a factor of 2.

And WAY easier to implement and deploy!



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: