Programming language that does not require prior installation

Asked

Viewed 753 times

-2

What languages could I simply create a program, send it to someone and they run it without having to install it? For example Java requires previously installed software to be able to run.

If no such language exists, then would it be possible to create a kind of 'auto-download'? For example, I send a file to someone, they open the file, download the necessary files, and then run the program? Would that be possible in some language?

I need it running on Linux and Windows.

  • the example of Java, is that you need to install it to run files

  • Did the answer solve your problem? Do you think you can accept it? If you don’t know how, check out the [tour] how to do it. This would help a lot to indicate that the solution was useful to you and help everyone understand that. You can also vote for anything on the entire site (when you have 15 points).

1 answer

8

Almost all compiled languages are exactly like this, you create the program, compile, generate an executable and can send it to the person.

Whether you will have to do an installation of this executable or not is something else. After all certain applications are complex, require an interaction with the operating system that can not only run a sent binary file. Also, even if you can do it this way, you may need some files, even if you don’t need to install them, don’t just send a simple file.

It is possible to generate a simple executable that does the installation for you in your own way. You can do this virtually in any language, with more or less facilities. In most cases it doesn’t pay, although I like this technique for certain applications. Some languages have something more or less ready for this.

The interpreted languages usually require an installed interpreter. One of them has an interpreter on virtually every computer (embedded in the browser), the Javascript.

Some compiled languages require a pre-installed execution environment, such as Java and C#. C# uses the . NET environment that almost every Windows has installed, thus running directly. But C# can already generate independent executable, even without the presence of . NET and running on platforms other than Windows. That goes for VB.NET also.

There are at least two languages I know that use a technique similar to the one quoted on C#. Moon (with some manual effort) and Harbour (Clipper already doing this) generate executables through a C compiler, and even having a virtual machine it is embedded in this executable.

I know some can generate executable optionally, Pyhton is an example. Up to the PHP can do something like this, although unusual and with unsatisfactory results until the moment of this reply. Javascript can also do this. Some dialects of interpreted languages can also do this. Ruby for example.

Among the compiled languages that can do this the most obvious are C and C++. Also Delphi and other dialects of Pascal, several dialects of BASIC. Objective C, D, Rust, Haskell, Ocaml and Go are other modern who do this. As far as I know Swift can also. I will avoid talking about all very unknown or that very few people use (legacies or super-niches).

  • Thank you for the answer, thorough by the way. What I want to do is a simple project. A kind of 'social network', but much more basic, and in the CMD style[A black screen, with blank writing], from which I send a file to the person, run it and then he can talk to me, the parts of the programming do not bother me, what bothers me is the language for it, which would be the best, I don’t want the person to have to pre-install something to be able to just talk, and, this project is just to motivate me to learn a specific language, since I’m undecided about it.

  • 6

    You can’t answer that. And it doesn’t matter either. You have to use what you know. But to be quite honest, when you ask this question, it is far from being able to start doing something that will work. And this is not how you learn to program.

  • 1

    @proxy bigown is right, your question just shows you still need to learn a lot before you go around programming. Programming everyone can do, but to make applications as it should be has a lot to say.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.