One Flat Ib A general-purpose programming language by Nick Montfort, 2005-11-13 ========== = MANUAL = ========== One Flat (also referred to as "Ib") is a programmming language in which any computer program can be written. Programs in One Flat consist of a series of "I" characters (indicating "one", or a tally mark) followed by a newline. The compiler is forgiving: the final newline may be omitted, even though valid text files always are supposed to end with a newline. Also, in deference to tradition, "1" may be used instead of "I", but the compiler will omit a warning each time "1" is used. No other character, including the lowercase "i", will be understood. A source file indicates a unary number. This number is converted by the compiler (oneflat.py) into an executable binary file. For example, if the source code is: IIIIIIIIIIIIIIIII A one-byte binary file will be written with "\x11" (decimal 17) as the single byte in it. If the source code consists of exactly 258 "I" characters, the binary file that is written will have "\x01" as its first byte and "\x02" as its second. To the extent that platforms do different things with the same binary files, a compiled One Flat program may run differently on different systems, or may not run at all. If no output file is specified during compilation using the "-o" option, "a.out" will be used. A decompiler (deone.py) is also provided. Compiler usage: oneflat source.one [-o executable] oneflat -v Decompiler usage: deone executable source.one =========== = LICENSE = =========== Copyright (c) 2005 Nick Montfort Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.