I'm looking for a scripting engine to embed in a C program. Here's what I'm looking for in it:

  • FOSS (doesn't matter whether it's a copyleft or pushover license)
  • C interop (though I expect every scripting engine to support this, so this doesn't really narrow it down)
  • Lightweight (not hundreds of MB)
  • Portable (at a minimum, should build on 64-bit Windows, Mac, and Linux systems without needing to jump through any crazy hoops)
  • Good support for a functional programming paradigm
  • Strongly and statically typed, ideally with a Haskell/ML-style type system
  • Bonus: It would be nice if it were pure like Haskell or PureScript

Lua's type system is basically nonexistent (every non-primitive type is an array/map hybrid called a "table"), so it's out. GHC is a gigantic monstrosity (hundreds of MB), so it's out too.

| improve this question | | | | |
  • 1
    Would JavaScript + TypeScript work? I'm just not sure about C interop. – dwjohnston Jan 2 at 6:34
  • What about Julia? (Never done it) – knb Jan 2 at 10:41
  • @dwjohnston That seems like it might be an okay language (even though JS sure has its warts...) but which engine fits the bill? Neither SpiderMonkey nor V8 seem exactly lightweight. – Joseph Sible-Reinstate Monica Jan 5 at 23:58
  • Not strongly typed, but TCL is another contender in the Lua class. – jrw32982 supports Monica Jan 7 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.