weixin_41568196
撒拉嘿哟木头
采纳率40%
2009-11-11 16:38

Lisp 是 c + + 应用程序[关闭]中的脚本语言

已采纳

Hey, I've been looking at the possibility of adding a scripting language into my framework and I heard about Lisp and thought I would give it a go. Is there a VM for Lisp like Lua and Python or am I in the wrong mindset. I found CLISP here, http://clisp.cons.org/, but am not sure if this is what I am looking for.

Can anyone point me in the right direction?

转载于:https://stackoverflow.com/questions/1716456/lisp-as-a-scripting-language-in-a-c-app

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

9条回答

  • csdnceshi53 Lotus@ 12年前

    CLISP is just one implementation of Common Lisp. It's a very good implementation, and it does have some support for being embedded in other (C-based) programs, but that's not its focus and it's GPLed, which may or may not be a deal-breaker for you.

    You might be interested in checking out ECL. This implementation is specifically designed to be embedded (indeed, the "E" stands for "Embeddable"!), and has numerous features that might be useful to you, including the ability to compile Common Lisp programs to C (as well as providing byte-code compilation and an interpreter).

    点赞 4 评论 复制链接分享
  • csdnceshi74 7*4 12年前

    A Lisp is a good choice for an embedded language. Many people believe Lisp is hard but the syntax is relatively light, especially for non-programmers. There is essentially the prefix notation and that's it. Precedence rules are always unambiguous. Function names and variable names can be the same. You're pretty much free to use any characters you like for fun and var names.

    With Lisp you can bend the syntax to your liking; the users do not have to learn common lisp. It is easy to extend and to provide, simpler facilities, such as expressing business rules or extracting data from files.

    I guess my point is that the power and complexity of say Common Lisp, enables the provision of simple, domain specific constructs to the end user. Many other embedded languages will mean those users learning the intricacies of that language.

    点赞 10 评论 复制链接分享
  • csdnceshi67 bug^君 12年前

    Googling a little bit: Common Lisp as an Extension language

    But keep in mind that Common Lisp wasn't designed from the ground up to be an extension language, unlike Lua or Guile.

    A general advice: try to use an extension language that really makes the work of writing them easier, and remember that mastering Lisp so you can be really productive with it can take quite long (and there are not many people around that can stand so many parens xD).

    点赞 10 评论 复制链接分享
  • csdnceshi67 bug^君 9年前

    Since it is not a Lisp, Fuzuli has a syntax similar to Lisp. It is easy to integrate it to C++ applications. The official site is http://www.fuzuliproject.org

    Another one is newLISP at http://www.newlisp.org/ and it is also not a Lisp but very close to Lisp.

    点赞 8 评论 复制链接分享
  • csdnceshi65 larry*wei 12年前

    Chicken Scheme is another option for embedding. See here for details of the embeddable api.

    点赞 2 评论 复制链接分享
  • csdnceshi75 衫裤跑路 12年前

    Try Embeddable Common Lisp (ECL).

    http://ecls.sourceforge.net/

    It's targeted at embedding and you get only the parts of Common Lisp linked that your scripting language needs.

    点赞 1 评论 复制链接分享
  • weixin_41568110 七度&光 12年前

    There are a couple of easy options.

    GUILE is the GNU extension language. It is an embeddable Scheme (dialect of LISP). GPL (naturally).

    TinyScheme is a very small, very simple interpreter-based implementation of Scheme. It was successfully used by a malware company to do all kinds of nasty things. It is available in source form, I don't recall under what license(s).

    点赞 1 评论 复制链接分享
  • csdnceshi53 Lotus@ 12年前

    Unless you need the whole of Lisp, you may want to settle rather on a Scheme implementation like Guile which is meant to be incorporated into another program.

    点赞 1 评论 复制链接分享
  • csdnceshi65 larry*wei 12年前

    Lisp is a family of languages.

    Common Lisp is an ANSI standard that is huge. Think C++ huge. Don't use it as a script language.

    Unless you are targeting fairly hardcore programmers, Lisp as a scripting language is going to be...er....not well taking. Probably. Lua is likely a better bet as a script language.

    That said, a Lisp is fine(technically) for implementing a scripting language.

    点赞 评论 复制链接分享