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).
the example of Java, is that you need to install it to run files
– proXy
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).
– Maniero