How To Install R Programming Language In Windows 10

0 views
Skip to first unread message

Jessica Wilson

unread,
Aug 5, 2024, 12:15:22 PM8/5/24
to teusnoworan
Youdon't install a programming language. You install a compiler/interpreter and then just feed it text files containing your source code. The language is, therefore, just a standardized syntax that you learn and that the compiler/interpreter is programmed to "understand". In other words, the "source" of the language is not in some file/program installed on your machine but, rather, its "source" is in the language specification, the text files that you write, and the ability of the compiler/interpreter to "work" with said files. (For example, to work with C++ you have to install a compiler but you don't install C++. Or do you?)

However, it appears that some languages require to be installed. For instance, PHP documentation starts with a section titled "Installation and Configuration". Similarly, to install Python you have to first download it. Once you do, it shows up in your file system as an executable.


Compiler is just a sequence of binaries+src, same as any other software package. Take for example Clang or GCC or Rust. In your operating system, you download source and build it. Machine codes are generated for your particular Processing Unit architecture, be it CPU or GPU or specialized hardware.


Is the compiler worse when you simply never build it yourself? Yes, it will be worse, but in what terms? Most likely it will be bloated, i.e. have increased size and its compilation times will be bigger.


Also there is things outside of compiler. Having compiler on Linux means it will generate ELF binaries, so you need 'libelf'. And it requires you to obtain certain libraries first, namely 'libatomic', 'libgcc', 'libstdc++', 'mpfr', 'gmp', 'coreutils'. These libraries are making your 'environment' so you could possibly be able to build your next compiler iteration from previous (GCC in this case).


So strictly speaking, all languages require "installation" meaning user should build them from sources (Linux), or extract the codes required for their particular CPU from already existing binary (Microsoft). Or both, in some cases (Ubuntu and other binary-based linuxes).


Described above "source installation" may look complicated, but "binary installation" in fact is far more complicated for compilers, because you should check environment, check dependencies, check libraries, then check hardware, then extract binary parts, then recompile binary parts you cannot have the same (x86 vs x64) or simply ship numbers of different versions of same compiler for different architectures and architectural tricks like ELF/WINPE binary compatibility, 'setjmp' jumping conventions etc.


PS. Also not building your compiler from source hinders developers of hardware, like it was with x86 -> x86_64 architecture transition. Hardware developers are using their precious time not for actual improvement of raw power of your processor and new features, but for supporting old instruction sets and backward-compatibility of instruction sets, simply because software developers too slow to update their compilers. All of it creates huge 'lag' in the system of software-hardware cycle of development.


ActiveX controller - a deprecated framework that allows libraries to be ran both in the browser (Internet Explorer) and on the machine itself. But it turned out it was a big security issue and was turned off as a functionality from the browsers. Though still the easiest way to programmatically connect to MS Office programs and some OS stuff. COM objects are basically the same thing.


Batch files (executed by cmd.exe) - the default shell since Windows NT. Batch files have .bat or .cmd extensions (Windows batch files: .bat vs .cmd?). The 32bit versions of even the latest version of Windows still have the cmd.exe predecessor command.com, which has fewer capabilities than cmd.exe. Through RUNDLL32.exe batch files have some limited access to some built-in .dll libraries ( -rundll32-commands-list-windows-10-a.html). And through WMIC.exe they also have some limited access to the WMI classes. Batch files can become extremely powerful if you embed another language within - you can call C#, PowerShell, JScript and etc. languages from a .bat file.


WQL - as the WMIC was mentioned above, WMI classes support their own query language that can be used through the WMIC or the provided interfaces for the other languages. It is not complicated and can be useful.


WSH - Windows script host. Not EXACTLY its own language. Rather an engine that allows other languages to be registered to it. I.e. VBScript and JScript use WSH and are registered by default. There are implementations of Perl, Ruby, PHP, etc. using WSH. Though the languages installed by default are JScript and VBScript. BUT.. you can combine code of multiple languages registered to WSH in a Windows Script File (.wsf) ( _Script_File) and even call functions written in another language. WSH allows you to access ActiveX controllers and WMI classes. You cannot access DLL functions (at least not without third party binaries and dirty hacks).


HTML - of course if you create a .html file it will be opened by the default browser if double clicked. Though you can add JavaScript (and CSS) and do some useful stuff with it, you have no access to the file system of your machine (except for uploading files). And here comes HTA .. which is in the next point.


HTA - which should mean HTML application. The FASTEST way to create UI under Windows (though it is limited in capabilities). HTA files are handled by mshta.exe which is something like a special version of Internet Explorer which has access to the OS. You can call other executables, create files etc. Besides HTML it supports JavaScript and VBScript, though some of the WSH capabilities are not directly accessible (i.e. printing to the console is more verbose). You can use the tag "X-UA-Compatible" to switch to older versions of Internet Explorer/HTA, which have some functions turned off for security reasons or newer versions in order to access the newer versions of JavaScript. HTA has access to ActiveX and WMI.


C# - installed by default in Windows 7 and above. Though it does not include an IDE, but only a command line compiler under %SystemRoot%\Microsoft.NET\Framework\ . C# is the most powerful language from the .NET family and you can do everything that Windows offers with it. You have access to the DLLs (through pinvoke), ActiveX, WMI, .NET functions. You can create UI applications and etc.


JScript.NET - deprecated version of the .NET languages though the compiler is still there. Again, a superset of ECMAScript 1.4. It is convenient for short scripts though, as it does not require a main function. Ha access to ActiveX, WMI and .NET functions. Platform Invoke (i.e. access to the dll functions) is not implemented.


MSBUILD - part of .NET used to compile a whole project (described in an xml file) instead of a single file. The interesting part is that the latest versions have something called inline task in which you can use any of the .NET languages and also combine more than one language and call one inline task from another. UNLIKE the other .NET options, you don't need to compile the code - it will execute directly in-memory (i.e. will not create additional .exe file). Like WSH it is not EXACTLY its own language. Inline tasks are available with the latest versions of windows 10 though.


PowerShell - also based on .NET but it is its own thing. It is a command line shell (as the name suggests) and is much more powerful than cmd.exe. It us installed by default on Windows since Windows 8. The coolest part - Windows by default includes PowerShell ISE (Integrated Scripting Environment) - its own IDE! One more cool thing - PowerShell can call code written in C#, VB.NET or JScript.NET through TypeDefinition (not available in the earlier versions of PowerShell though). Has access to the .NET libraries, ActiveX objects, WMI. With the TypeDefinitions and C# you can access also some dll functions.


The only catch is that some languages' runtime libraries are quite big, so it's common for smaller programs not to include the entire language runtime and instead expects it to be preinstalled on the machine to keep its own download size small.


Ultimately it depends on what you wanted to do. If you wanted to just make simple scripts, probably .bat scripts will do just fine. If you wanted something simple and fast, then you can write native executable in C, otherwise if you want to do something a bit more complex and you're fine with the larger download size if you can keep your own program simple, or if you can later get admin to preinstall your preferred runtime on your target machines, then high level languages like Python or Ruby would be great options.


Although windows core is written in C and extended primarily with C# and C++ it doesn't actually come natively with a scripting environment for those languages. You would have to install IDE's that will definitely not be allowed by any corporate policy.The only language that comes with the os really is shell language, which isn't really a language but more like an object call sheet. You call objects, mostly small executables, and give them some parameters to perform certain actions on other objects. There are two. The simple shell often wrongly called dos which you can access with CMD.exe. Power shell is the second built in shell scripting environment with .net access that allows you to virtually write anything using any natively installed library in the system.I'd first have a look at powershell as it's very close to the native c and c# languages and comes with windows out of the box and can be extended to compile any script into executables.


Both shell environments can do quite a lot of things before needing administrator rights by using system objects that have already been given permission to execute their code. There will be a limit though which usually is encountered when you try to change system settings or meddle with files in system folders. The work around would be to keep everything in the user documents folder and don't try to meddle with system files or settings.

3a8082e126
Reply all
Reply to author
Forward
0 new messages