Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Compatibility of programming languages


  • Please log in to reply
4 replies to this topic

#1 kurisuto

kurisuto

  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:04:44 PM

Posted 31 August 2013 - 08:26 AM

Okay, this is a crappy title that shows I don't know what the heck I'm talking about. Here's my problem: I've recently started learning Python and being interested in programming in general, but I don't know how things work! I have a question that I couldn't find the answer to by googling a little, mostly because I don't know how to word it, so let me try.

What I meant in the title is that, idk for instance if you could make a program in Python for the iPad. Or say you have an .exe file on your PC: does the fact that it's an .exe tell you something about the language the program was written in? As far as the PC is concerned, what are the differences between programs written in different languages? I do get that Python is usually an interpreted language, but can the PC tell a compiled Python program from say a C++ one? And do you need all these languages to be "installed" one way or another on your machine in order to get the program to run, or are they, hm, universal or something? And to get back to one of my earlier questions, could you write programs in any language for say an iPad app, or are all languages not universal?

...yeah, like I said idk anything about programming. Basically what I wonder about is, while I do understand different programming languages obviously change things on the developer's side, idk how it's reflected on the side of the platform that runs the program.

BC AdBot (Login to Remove)

 


#2 Sirawit

Sirawit

    Bleepin' Brony


  • Malware Response Team
  • 4,158 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Thailand
  • Local time:09:44 PM

Posted 31 August 2013 - 09:37 AM

OK. The programming languages have its unique point, like Cobalt use for Bussiness, Fortran for Scientific, Python for iPad, etc. So this is point for having many languages out there.
 

Does the fact that it's an .exe tell you something about the language the program was written in?


As far as I know, no, programs written in format .exe can be written by many language like C++, Visual Basic, etc. But in some languages there will be noticable point in how it works or GUI.
 

And do you need all these languages to be "installed" one way or another on your machine in order to get the program to run, or are they, hm, universal or something?


If it is default extensions like .exe on windows, no you don't need to install anything, but if you want to run other things you have to install in another compiler/interpreter.
 

And to get back to one of my earlier questions, could you write programs in any language for say an iPad app, or are all languages not universal?


No. Not all programming lauguages are compatible with iPad or iOS. Example that works maybe :Ruby, Python, Lua, Scheme, Lisp, Smalltalk, C#, Haskell, ActionScript, JavaScript, Objective-C, C++, C. But the most preferable are C, C++ and Objective C.
If you want to read more click here and here.


If I don't reply back to you in 2 days, feel free to send me a PM.

 

“You’re lying… just like you were lying to me before. You have to hate me. I’ve been the worst daughter in the world… you should hate me.”

“But I don’t, Nyx. Because, Nyx, I’m your mother, and a mother will always love her daughter, no matter what.” -Past sins by Pen stroke.


#3 kurisuto

kurisuto
  • Topic Starter

  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:04:44 PM

Posted 31 August 2013 - 09:56 AM

Thank you for your answer!

 

Hm, then is there a way to know in what language a program was written in? I tried to look at the file properties of .exe files, but it says nothing of the language. Also, I know Python scripts are (at least usually) .py, but the vast majority of programs I download seem to be in .exe. Is there a reason why some programs have extensions that are specific to the language, and others have what seems to be generic extensions? Maybe it has something to do with interpreted/complied? Would a complied Python script have a different extension from interpreted ones?



#4 Sirawit

Sirawit

    Bleepin' Brony


  • Malware Response Team
  • 4,158 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Thailand
  • Local time:09:44 PM

Posted 31 August 2013 - 10:09 AM

Hm, then is there a way to know in what language a program was written in?

No, in fact, developer doesn't want you to know.
 

Is there a reason why some programs have extensions that are specific to the language, and others have what seems to be generic extensions? Maybe it has something to do with interpreted/complied? Would a complied Python script have a different extension from interpreted ones?

It is the implementation of the program, quotes from stackoverflow.

In a compiled implementation, the original program is translated into native machine instructions, which are executed directly by the hardware.

In an interpreted implementation, the original program is translated into something else. Another program, called "the interpreter", then examines "something else" and performs whatever actions are called for. Depending on the language and its implementation


Thank you.

If I don't reply back to you in 2 days, feel free to send me a PM.

 

“You’re lying… just like you were lying to me before. You have to hate me. I’ve been the worst daughter in the world… you should hate me.”

“But I don’t, Nyx. Because, Nyx, I’m your mother, and a mother will always love her daughter, no matter what.” -Past sins by Pen stroke.


#5 niemiro

niemiro

  • Members
  • 102 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:44 PM

Posted 02 September 2013 - 01:10 PM

Thank you for your answer!

 

Hm, then is there a way to know in what language a program was written in?

 

As Sirawit has said, no easy or guaranteed way. However, in almost all scenarios even a little skill in disassembly will tell you, should you wish to know (what I mean by this is that you don't need to be a grand master, or even very good. Just competant will do)

 

It would be unusual to be able to tell with absolute, 100% certainty, however, there are usually tell-tale signs. I mean, working out whether it's written in machine code or MSIL code as an example is a good start, and then so many other questions and branches.

 

As for telling something like C# or VB apart, if they are using any VB components then you can be reasonably confident that it it's more likely to be VB. But since C# projects can manually add them...


One of the very few people in the world who is truly enthused about Windows Update and how it works...

 

Yes, I'm a bit weird :P





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users