Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8792281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:57:29+00:00 2026-06-13T22:57:29+00:00

I am learning C++ now and I have heard a lot about embedded scripting

  • 0

I am learning C++ now and I have heard a lot about embedded scripting languages. I imagined it completely different.

I thought I would write all of my performance heavy functions in C++ and call them out of a scripting language such as Lua or Python.

But it seems it is the other way around. -> Write functions in Lua/Python and call them in C code.

What is the advantage of embedding a language in C++ instead of writing an API in C++ and calling those functions in another language?

Example:

// function in c++
int expensiveFunction(){
  return 1;
}

Then in Python I would call this function and I would have the performance from C++ but can make changes at runtime thanks to Python’s runtime interpreter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:57:29+00:00Added an answer on June 13, 2026 at 10:57 pm

    Actually, a lot of game engines like to build interfaces to the engine by embedding Lua or Python. There are advantages to this:

    • Non-programmers can interface with the engine.
    • You do not need to recompile for minor script changes.
    • Errors in the script might not crash the entire system.

    C++ is quite useful as a backend for projects that want the flexability of scripting languages, but want the performance of C++. I have not heard of projects that use C++ as a frontend, with a scripting language as the backend.

    API Style

    We use this style in my company’s software. We expose an API through a Windows DLL that can be called by most languages fairly easily. We specifically support VB and VBA. This is great when the backend is from outside the script maker’s control. However, it is hard to debug issues that arise from the script maker’s perspective.

    Advantages

    • Strong decoupling
    • Accessible from different languages

    Disadvantages

    • Hard to debug 2 processes

    Embedded Style

    The software actually embeds the script interpreter into the software. This way you can expose features as if they were native functions. In this style, the script makers and the backend programmers typically are in the same company. It can also be used by traditional software to allow others to extend the functionality of the application. If they share source code, you can debug problems arising from scripts in a much easier manner. The application also takes care of when and how to launch your scripts. However, in order to support additional languages, the application developer has to embed other interpreters.

    Advantages

    • Stronger coupling
    • Easier to debug one process

    Disadvantages

    • Only accessible through the approved language
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been learning wpf for about a week now.. and i have a basic
I'm learning scheme and until now have been using guile. I'm really just learning
I have committed to learning C now, I'm good with Python/PHP/Bash but I've decided
I'm just learning MVC3 now and this is really confusing me. I have a
I have been learning python for some time now. While starting this learning python
I have been learning Scala for the past couple of months and now I
I have been learning Python2.7 for a little bit now. I'm using Windows 7
i have done some learning on struts based on one project that i got.Now
I am learning ASP.NET MVC now a days and I have found that most
I have been learning Python for a while, and now I'd like to learn

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.