Source-code compatibility: Difference between revisions

Content deleted Content added
No edit summary
Arachinid (talk | contribs)
replaced w10 with w11
 
(13 intermediate revisions by 12 users not shown)
Line 1:
{{Short description|When a program must be compiled/interpreted before another computer can run it}}
{{Unreferenced|date=March 2007}}
{{Use dmy dates|date=August 2020}}
'''Source-code compatibility''' (source-compatible) means that a program can run on [[central processing unit|computercomputers]]s (or [[operating systemssystem]]s), independently of [[binary-code compatibility]] and that the [[source code]] is needed for [[Software portability|portability]].<ref name="Baron Higbie 1992" />
 
The source code must be [[compiler|compiled]] before running, unless the computer used has an [[Interpreter (computing)|interpreter]] for the language at hand.<ref name="Data Processing Digest 1980" /> The term is also used for [[assembly language]] compatibility, where the source is a [[human-readable]] form of [[machine code]] that must be converted into numerical (i.e. executable) machine code by an [[Assembly language#Assembler|assembler]]. This is different from [[binary-code compatibility]], where no recompilation (or assembly) is needed.<ref name="Stern Monti Bachmann 1998" />
 
Source compatibility is a major issue in the developing of computer programs. For example, most [[Unix]] systems are source-compatible, as long as one uses only standard [[library (computing)|libraries]]. [[Microsoft Windows]] systems are source-compatible across one major family (the [[Windows NT]] family, from [[Windows NT 3.1|NT 3.1]] through [[Windows 8.111]], or the family that includes [[Windows 95]], [[Windows 98]], and [[Windows Me]]), with partial source compatibility between the two families.
 
== See also ==
It can be programmatically tricky to determine whether one is executing atop a Windows or UNIX environment. A simple-minded trick can often be resorted to, however. It is exemplified by the following Perl expression:
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''-d "C:" && ! -d "./C:"'''
 
This expression determines whether a directory called '''C:''' exists and--if it does--verifies that it is '''not''' a subdirectory called "'''C:'''" deliberately created by some wag for the sole purpose of defeating the check. Since, of course, one occasionally encounters a Windows system that does not feature a '''C:''' drive, the expression can be generalized thus:
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''join "", map { -d $_ && ! -d "./$_" } map { chr( $_ ) . ':' } ord( 'A' ) .. ord( 'Z' )'''
 
The inner '''map''' returns the set '''"A" .. "Z"'''; the middle '''map''' converts this to the set '''"A:" .. "Z:"'''; and the outer map applies the logical conjunct to each member of the colon-embellished set, the results of those 26 logical evaluations being concatenated by the '''join'''. The resultant expression will be blank if and only if none of the 26 drives tested for was found to exist; otherwise, it will be a valid number belonging to the set { 1, 11, 111, ..., 11111111111111111111111111 }.
 
which actually applies the preceding logical test to the complete set '''A:''' through '''Z:''' of possible drives. Each test that succeeds returns a "1" while each that fails returns the empty string. Thus, if one or more of the drives exists, the return value will be a nonzero number, albeit possibly as large as 11111111111111111111111111.
 
 
==See also==
* [[Binary compatibility]]
* [[Backward compatibility]]
* [[Source upgrade]]
 
== References ==
{{reflist|refs=
<ref name="Baron Higbie 1992">{{cite book
| last1 = Baron
| first1 = R.J.
| last2 = Higbie
| first2 = L.
| title = Computer Architecture
| publisher = Addison-Wesley Publishing Company
| series = Addison-Wesley series in electrical and computer engineering
| year = 1992
| isbn = 978-0-201-50923-6
| url = https://books.google.com/books?id=CNdQAAAAMAAJ
| access-date = 9 May 2018
| page = 106
}}</ref>
<ref name="Data Processing Digest 1980">{{cite book
| title = Data Processing Digest
| publisher = Data Processing Digest, Incorporated
| issue = v. 26–27
| year = 1980
| url = https://books.google.com/books?id=KaVIAAAAYAAJ
| access-date = 9 May 2018
| page = 21
}}</ref>
<ref name="Stern Monti Bachmann 1998">{{cite book
| last1 = Stern
| first1 = M.
| last2 = Monti
| first2 = G.
| last3 = Bachmann
| first3 = V.
| title = NT Enterprise Network Design
| publisher = Sybex, Network Press
| year = 1998
| isbn = 978-0-7821-2156-8
| url = https://books.google.com/books?id=Ixuh0wTZ4GwC
| language = et
| access-date = 9 May 2018
| page = 17
}}</ref>
}}
 
{{DEFAULTSORT:Source Code Compatibility}}
[[Category:Backward compatibility]]
[[Category:Source code]]
 
 
{{Compu-prog-stub}}