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 7815945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:41:16+00:00 2026-06-02T05:41:16+00:00

Off late I’d been hearing that applications written in different languages can call each

  • 0

Off late I’d been hearing that applications written in different languages can call each other’s functions/subroutines. Now, till recently I felt that was very natural – since all, yes all – that’s what I thought then, silly me! – languages are compiled into machine code and that should be same for all the languages. Only some time back did I realise that even languages compiled in ‘higher machine code’ – IL, byte code etc. can interact with each other, the applications actually. I tried to find the answer a lot of times, but failed – no answer satisfied me – either they assumed I knew a lot about compilers, or something that I totally didn’t agree with, and other stuff…Please explain in an easy to understand way how this works out. Especially how languages compiled into ‘pure’ machine code have different something called ‘calling conventions’ is what is making me clutch my hair.

  • 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-02T05:41:19+00:00Added an answer on June 2, 2026 at 5:41 am

    This is actually a very broad topic. Languages compiled to machine code can often call each others’ routines, though usually not without effort; e.g., C++ code can call C routines when properly declared:

    // declare the C function foo so it can be called by C++ code
    extern "C" {
        void foo(int, char *);
    }
    

    This is about as simple as it gets, because C++ was explicitly designed for compatibility with C (it includes support for calling C++ routines from C as well).

    Calling conventions indeed complicate the picture in that C routines compiled by one compiler might not be callable from C compiled by another compiler, unless they share a common calling convention. For example, one compiler might compile

    foo(i, j);
    

    to (pseudo-assembly)

    PUSH the value of i on the stack
    PUSH the value of j on the stack
    JUMP into foo
    

    while another might push the values of i and j in reverse order, or place them in registers. If foo was compiled by a compiler following another convention, it might try to fetch its arguments off the stack in the wrong order, leading to unpredictable behavior (consider yourself lucky if it crashes immediately).

    Some compilers support various calling conventions for this purpose. The Wikipedia article introduces calling conventions; for more details, consult your compiler’s documentation.

    Finally, mixing bytecode-compiled or interpreted languages and lower-level ones in the same address space is still more complicated. High-level language implementations commonly come with their own set of conventions to extend them with lower-level (C or C++) code. E.g., Java has JNI and JNA.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, I'm working on an app that's written such that some of your
I have been using themes for a while, and off late when I was
Ive been working with the iOS sensors a bit off late and i wanted
Off late I have been dumping relatively large tables using SSMS. The usual way
I have been working on Java off late, couldn't figure out what this (String...
First off, let me start off that I am not a .net developer. The
I'm coding in Python and I really like Notepad++. However, off late when I
So this is from the late 90s ... http://www.cs.princeton.edu/~prc/SingingSynth.html Why hasn't this taken off?
First off, I read all of the suggested questions that sounded halfway relevant and
First off, I realize most of this can also be done using ItemTemplates. If

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.