#Binary_code_compatibility is when systems can run the same #executable, typically #machine_code for a general-purpose computer.
#Source_code_compatibility on the other hand, is when recompilation or interpretation is necessary.
#executable code causes a computer to perform indicated tasks according to encoded instructions as opposed to a data file that must be parsed by a program to be meaningful.
In some contexts a file containing bytecode or scripting language instructions may also be considered executable.
#machine_code means either the assembly code or its binary sequence translation.
#Source_code_compatibility on the other hand, is when recompilation or interpretation is necessary.
#executable code causes a computer to perform indicated tasks according to encoded instructions as opposed to a data file that must be parsed by a program to be meaningful.
In some contexts a file containing bytecode or scripting language instructions may also be considered executable.
#machine_code means either the assembly code or its binary sequence translation.
#language #Haskell
Haskell
First appeared: 1990
Features:
• Purely #functional
• Statically and strongly typed (#Static_typing, #Strong_typing)
• #Type_inferring
• Lazy (#Lazy_evaluation)
• #pattern_matching
• #list_comprehension
• Type classes and type polymorphism (#type_class)
• Concurrent (#concurrency)
• Monads
Monads
Monads are a general framework that can model different kinds of computation, including error handling, nondeterminism, parsing and software transactional memory. Monads are defined as ordinary datatypes, but Haskell provides some syntactic sugar for their use.
Glasgow Haskell Compiler
GHC or Glasgow Haskell Compiler is the most commonly-used Haskell compiler and the main implementation of Haskell. It is open source and provides a cross-platform environment for writing and testing. It supports numerous extensions, libraries, and optimisations that streamline the process of generating and executing code. GHC itself is written in Haskell (#Bootstrapping); but the runtime system which is essential to run programs is written in C and C--.
Front end: (lexer, parser and typechecker)
Preserves as much information about the source as possible until after type inference is complete, to provide clear error messages to users. After type checking, the code is desugared (#syntactic_sugar) into a typed, intermediate language known as "Core".
Simplifier or "middle end":
- is where most of the optimizations are performed as a series of source-to-source transformations in Core code.
Back end:
Transforms Core code into an internal representation of C--. The C-- code can then take one of three routes: it is either printed as C code for compilation with GCC, converted directly into native machine code, or converted to LLVM virtual machine code for compilation with LLVM. In all three cases, the resultant native code is finally linked against the GHC runtime system to produce an executable.
C--
C-- is a #C like programming language, designed to be generated by compilers for very high-level languages rather than written by human programmers. Unlike many other intermediate languages, its representation is plain #ASCII text, not bytecode or another binary format.
C-- is a "portable #assembly language", designed to ease the task of implementing a compiler which produces high quality #machine_code. This is done by having the compiler generate C-- code, delegating the harder work of low-level code generation and optimisation to a C-- compiler.
The C-- type system is deliberately designed to reflect constraints imposed by hardware rather than conventions imposed by higher-level languages. In C-- a value stored in a register or memory may have only one type: bit vector. However, bit vector is a polymorphic type and may come in several widths, e.g., bits8, bits32, or bits64. In addition to the bit-vector type C-- also provides a Boolean type bool, which can be computed by expressions and used for control flow but cannot be stored in a register or in memory. As in an assembly language, any higher type discipline, such as distinctions between signed, unsigned, float, and pointer, is imposed by the C-- operators or other syntactic constructs in the language.
Haskell
First appeared: 1990
Features:
• Purely #functional
• Statically and strongly typed (#Static_typing, #Strong_typing)
• #Type_inferring
• Lazy (#Lazy_evaluation)
• #pattern_matching
• #list_comprehension
• Type classes and type polymorphism (#type_class)
• Concurrent (#concurrency)
• Monads
Monads
Monads are a general framework that can model different kinds of computation, including error handling, nondeterminism, parsing and software transactional memory. Monads are defined as ordinary datatypes, but Haskell provides some syntactic sugar for their use.
Glasgow Haskell Compiler
GHC or Glasgow Haskell Compiler is the most commonly-used Haskell compiler and the main implementation of Haskell. It is open source and provides a cross-platform environment for writing and testing. It supports numerous extensions, libraries, and optimisations that streamline the process of generating and executing code. GHC itself is written in Haskell (#Bootstrapping); but the runtime system which is essential to run programs is written in C and C--.
Front end: (lexer, parser and typechecker)
Preserves as much information about the source as possible until after type inference is complete, to provide clear error messages to users. After type checking, the code is desugared (#syntactic_sugar) into a typed, intermediate language known as "Core".
Simplifier or "middle end":
- is where most of the optimizations are performed as a series of source-to-source transformations in Core code.
Back end:
Transforms Core code into an internal representation of C--. The C-- code can then take one of three routes: it is either printed as C code for compilation with GCC, converted directly into native machine code, or converted to LLVM virtual machine code for compilation with LLVM. In all three cases, the resultant native code is finally linked against the GHC runtime system to produce an executable.
C--
C-- is a #C like programming language, designed to be generated by compilers for very high-level languages rather than written by human programmers. Unlike many other intermediate languages, its representation is plain #ASCII text, not bytecode or another binary format.
C-- is a "portable #assembly language", designed to ease the task of implementing a compiler which produces high quality #machine_code. This is done by having the compiler generate C-- code, delegating the harder work of low-level code generation and optimisation to a C-- compiler.
The C-- type system is deliberately designed to reflect constraints imposed by hardware rather than conventions imposed by higher-level languages. In C-- a value stored in a register or memory may have only one type: bit vector. However, bit vector is a polymorphic type and may come in several widths, e.g., bits8, bits32, or bits64. In addition to the bit-vector type C-- also provides a Boolean type bool, which can be computed by expressions and used for control flow but cannot be stored in a register or in memory. As in an assembly language, any higher type discipline, such as distinctions between signed, unsigned, float, and pointer, is imposed by the C-- operators or other syntactic constructs in the language.