source code this article is about the software concept for the film see source code for source coding see data compression simple clanguage source code example a procedural programming language the resulting program prints hello world on the computer screen this first known hello world snippet from the seminal book the c programming language originates from brian kernighan in the bell laboratories in 1974 program execution general concepts code translation compiler compiletime optimizing compiler intermediate representation ir execution runtime system runtime executable interpreter virtual machine types of code source code object code bytecode machine code microcode compilation strategies justintime jit tracing justintime aheadoftime aot transcompilation recompilation notable runtimes android runtime art common language runtime clr mono crt0 hhvm java virtual machine jvm objectivec v8 nodejs pypy zend engine notable compilers toolchains gnu compiler collection gcc llvm clang vte in computing source code is any collection of code possibly with comments written using a humanreadable programming language usually as plain text the source code of a program is specially designed to facilitate the work of computer programmers who specify the actions to be performed by a computer mostly by writing source code the source code is often transformed by an assembler or compiler into binary machine code understood by the computer the machine code might then be stored for execution at a later time alternatively source code may be interpreted and thus immediately executed most application software is distributed in a form that includes only executable files if the source code were included it would be useful to a user programmer or a system administrator any of whom might wish to study or modify the program definitions the linux information project defines source code as source code also referred to as source or code is the version of software as it is originally written ie typed into a computer by a human in plain text ie human readable alphanumeric characters the notion of source code may also be taken more broadly to include machine code and notations in graphical languages neither of which are textual in nature an example from an article presented on the annual ieee conference and on source code analysis and manipulation for the purpose of clarity source code is taken to mean any fully executable description of a software system it is therefore so construed as to include machine code very high level languages and executable graphical representations of systems often there are several steps of program translation or minification between the original source code typed by a human and an executable program while some like the fsf argue that an intermediate file is not real source code and does not count as source code others find it convenient to refer to each intermediate file as the source code for the next steps history the earliest programs for storedprogram computers were entered in binary through the front panel switches of the computer this firstgeneration programming language had no distinction between source code and machine code when ibm first offered software to work with its machine the source code was provided at no additional charge at that time the cost of developing and supporting software was included in the price of the hardware for decades ibm distributed source code with its software product licenses after 1999 most early computer magazines published source code as typein programs occasionally the entire source code to a large program is published as a hardback book such as computers and typesetting vol b tex the program by donald knuth pgp source code and internals by philip zimmermann pc speedscript by randy thompson and cos the realtime kernel by jean labrosse organization the source code which constitutes a program is usually held in one or more text files stored on a computers hard disk usually these files are carefully arranged into a directory tree known as a source tree source code can also be stored in a database as is common for stored procedures or elsewhere a more complex java source code example written in objectoriented programming style it demonstrates boilerplate code with prologue comments indicated in red inline comments indicated in green and program statements indicated in blue the source code for a particular piece of software may be contained in a single file or many files though the practice is uncommon a programs source code can be written in different programming languages for example a program written primarily in the c programming language might have portions written in assembly language for optimization purposes it is also possible for some components of a piece of software to be written and compiled separately in an arbitrary programming language and later integrated into the software using a technique called library linking in some languages such as java this can be done at run time each class is compiled into a separate file that is linked by the interpreter at runtime yet another method is to make the main program an interpreter for a programming language either designed specifically for the application in question or generalpurpose and then write the bulk of the actual user functionality as macros or other forms of addins in this language an approach taken for example by the gnu emacs text editor the code base of a computer programming project is the larger collection of all the source code of all the computer programs which make up the project it has become common practice to maintain code bases in version control systems moderately complex software customarily requires the compilation or assembly of several sometimes dozens or maybe even hundreds of different source code files in these cases instructions for compilations such as a makefile are included with the source code these describe the programming relationships among the source code files and contain information about how they are to be compiled the revision control system is another tool frequently used by developers for source code maintenance purposes source code is primarily used as input to the process that produces an executable program ie it is compiled or interpreted it is also used as a method of communicating algorithms between people eg code snippets in books computer programmers often find it helpful to review existing source code to learn about programming techniques porting software to other computer platforms is usually prohibitively difficult without source code without the source code for a particular piece of software portability is generally computationally expensive possible porting options include binary translation and emulation of the original platform decompilation of an executable program can be used to generate source code either in assembly code or in a highlevel language programmers frequently adapt source code from one piece of software to use in other projects a concept known as software reusability legal aspects see also history of free and opensource software the situation varies worldwide but in the united states before 1974 software and its source code was not copyrightable and therefore always public domain software in 1974 the us commission on new technological uses of copyrighted works contu decided that computer programs to the extent that they embody an authors original creation are proper subject matter of copyright in 1983 in the united states court case apple v franklin it was ruled that the same applied to object code and that the copyright act gave computer programs the copyright status of literary works in 1999 in the united states court case bernstein v united states it was further ruled that source code could be considered a constitutionally protected form of free speech proponents of free speech argued that because source code conveys information to programmers is written in a language and can be used to share humor and other artistic pursuits it is a protected form of communication licensing software license copyright notice example copyright licensed under the apache license version 20 the license you may not use this file except in compliance with the license you may obtain a copy of the license at httpwwwapacheorglicenseslicense20 unless required by applicable law or agreed to in writing software distributed under the license is distributed on an as is basis without warranties or conditions of any kind either express or implied see the license for the specific language governing permissions and limitations under the license an author of a nontrivial work like software the author has the right and possibility to grant customers and users of his software some of his exclusive rights in form of software licensing software and its accompanying source code can be associated with several licensing paradigms the most important distinction is open source vs proprietary software this is done by including a copyright notice that declares licensing terms if no notice is found then the default of all rights reserved is implied generally speaking software is open source if the source code is free to use distribute modify and study and proprietary if the source code is kept secret or is privately owned and restricted one of the first software licenses to be published and to explicitly grant these freedoms was the gnu general public license in 1989 the bsd license is another early example from 1990 for proprietary software the provisions of the various copyright laws trade secrecy and patents are used to keep the source code closed additionally many pieces of retail software come with an enduser license agreement eula which typically prohibits decompilation reverse engineering analysis modification or circumventing of copy protection types of source code protectionbeyond traditional compilation to object codeinclude code encryption code obfuscation or code morphing quality software quality the way a program is written can have important consequences for its maintainers coding conventions which stress readability and some languagespecific conventions are aimed at the maintenance of the software source code which involves debugging and updating other priorities such as the speed of the programs execution or the ability to compile the program for multiple architectures often make code readability a less important consideration since code quality generally depends on its purpose bytecode code as data coding conventions computer code legacy code machine code markup language obfuscated code object code opensource software package package management system programming language source code repository syntax highlighting visual programming language source code a 2011 science fiction movie vew04 using a decompiler for realworld source recovery m van emmerik and t waddington the working conference on reverse engineering delft netherlands 912 november 2004 extended version of the paper look up codeor source code in wiktionary the free dictionary wikimedia commons has media related to source code source code definition by the linux information project linfo obligatory accreditation system for it security products metafiltercom 22 september 2008 will introduce rules requiring foreign firms to disclose secret information about digital household appliances and other products from may next year the yomiuri shimbun said citing unnamed sources if a company refuses to disclose information china would ban it from exporting the product to the chinese market or producing or selling it in china the paper said same program written in multiple languages javascript obfuscator authority control bnf cb15918046v data gnd 44882099 lccn sh90003519 sudoc 12859683x 