Source code
Dan Tobias (Talk | contribs) (→Text-based source code formats: Made consistent with programming languages page) |
Dan Tobias (Talk | contribs) (→Text-based source code formats) |
||
Line 18: | Line 18: | ||
* [[Assembly language]]: .asm, .s | * [[Assembly language]]: .asm, .s | ||
+ | * [[BASIC]]: .bas -- Some BASICs are stored in plain text, others are tokenized as noted above | ||
* [[Bourne shell script]]: .sh | * [[Bourne shell script]]: .sh | ||
* [[C]]: .c, .cc, .h | * [[C]]: .c, .cc, .h |
Revision as of 00:15, 4 January 2013
Source code is the program code of a programming language as stored in a computer's memory or in a file or other storage medium (programs have been stored on cassettes, punched cards, and many other media). Except in interpreted languages (like BASIC) which execute the program directly from the source, source code needs to be compiled or assembled into executables in the target machine code (possibly passing through intermediate stages of object code needing to be linked or code in some intermediary language that is in turn compiled, assembled or interpreted).
Most of the time, program source code is stored as plain text (in a character encoding), so it can be viewed or edited in any text viewer or editor, though programmer-oriented development environments offer enhanced features such as language-specific syntax highlighting and integrated access to compilers. However, there are also some specialized source code formats that do not use plain text, instead doing some sort of tokenization to the keywords and syntactic elements of the language. This was more common on early computers that had much more limited memory, disk space, and bandwidth than the present ones.
Non-text-based source code formats
- APL workspace: .apl, .atf, .dws, .dxf
- Tokenized BASIC: .bas
Text-based source code formats
The language can usually be identified by the file extension.
- Assembly language: .asm, .s
- BASIC: .bas -- Some BASICs are stored in plain text, others are tokenized as noted above
- Bourne shell script: .sh
- C: .c, .cc, .h
- C++: .cpp, .cxx
- C#: .cs
- Java : .j, .jav, .java
- JavaScript: .js
- Matlab: .m
- Music Macro Language: .mmi
- Pascal: .pas
- PCL: .pcl -- DEC TOPS-20 Programmable Command Language
- Pixilang: .pixi
- Perl: .pl, .pm
- PHP: .php
- Python: .py, .pyc, .pyo, .pyd