Python,lua which plug-in scripting language is suitable for drawing software?

Source: Internet
Author: User
Tags lua

Reply content:

Lua, because:
    1. Lua is much easier to program than Python, which means that it's easier to do extensions and embed programming, that is, to do things with the interpreter, Lua's cross-language programming model is very easy to use, data interactions are through stacks, and Python is much more complex, as Python and C + + Mixed programming experts, I am most proficient in the reference counting processing to also check the document, open your eyes carefully watch several times.
    2. Lua's interpreter is a data structure, you can create a lot in a process, and is completely isolated from each other, which greatly simplifies the problem of concurrency, error handling, and the Python interpreter is global, using Python, this part of the thing to say goodbye to parallel, because Into the Python interpreter there is serialization, if there is an error, it is more difficult to reliably recover (Lua as long as the protection of the resources involved, the interpreter destroyed the reconstruction of a good)
    3. Lua is more efficient than Python, and if the API-compatible Luajit is better (not one of the scripting language implementations), a plugin for drawing software, which may be an important consideration
In fact, the advantage of Adobe Photoshop as a scripting python for Lua is that the library is rich. Its language expression can play 80 points, the basic qualified, to the ecosystem to drag the situation is not serious, but the language itself with today's standards do not look great.

The advantage of Lua is that the language itself is simple (except for keyword): coroutine, and better closure optimization. The disadvantage is cubby less. It is not a disadvantage to scripting,lua the existing C code. If you write a drawing software with C++/QT, and then find a script to do plug-ins to improve the flexibility and extensibility of the software, it is necessary that Lua is better than Python

If you're using PYTHON/PYQT to write drawing software and then use C + + to optimize for high-performance parts, it's bound to be Python python better than Lua.
Many professional and open source image processing software are scripted in Python.
which plug-in scripting language is Python and Lua suitable for drawing software?
Depends on what you expect to achieve in your scripting language.

If you just want to make it as a Ui/project profile: Cmake:given the chance to does the language over, we would has spent some time looking for a NIC E embedded language that already existed. "Lua" is the best fit that might has worked.

If you're just going to encapsulate the C + + API and let the user do the function customization in the domain you specify, then choose Lua

Someone mentions Adobe Photoshop Lightroom , from the introduction, in fact, Lightroom did nothing but the above two things. Yes, Lua is very popular in the game industry, and the game industry is doing the second kind of things with Lua.

However, if you want your users to customize their plugins in this scripting language, if your users are likely to come from all walks of life, if you want to give your users enough latitude to plug in, then Lua is not a good choice. Out of the programmer's circle, the LUA community is not big, and what you need is a programming language that can easily interface with other domain, like python.

the scripting language of Maya is to use Python, more play than Lightroom.

Today, CommonJS Spec Wiki Might be a better choice than Python (node. JS is an implementation of COMMONJS), for reasons:
    1. JavaScript has a rich third-party library that covers fields that don't lose python
    2. V8/node Encapsulation of C + + interfaces is easier
    3. JavaScript has a simpler syntax than Python and is similar to LUA
    4. You can also write the UI in HTML
    5. Performance is an order of magnitude better than Python, close to Luajit (although I think as a plugin language, performance is not really a problem at all)
But not without a price: integrating the node. js into the desktop app with simple integration of an interpreter, the difficulty is not an order of magnitude. Interested can refer to Node-webkit GitHub or Atom Shell. GitHub


non-profit related: Former Autodesk programmer, now engaged in the gaming industry. A considerable number of professional three-dimensional software and synthetic software scripts, as well as the VFX company's pipeline tools, the basic choice of Python, this is not casually nonsense, yes, it is indeed based. Do not believe search search. Image processing, Python's global Lock (GIL) is enough to make a decision to choose Lua. This problem is like what language is the best language, can only say which proficiency with that one LUA, light. Please search: Adobe Photoshop Lightroom
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.