#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.
#language #Pharo
Pharo
First appeared: 2008
Features:
• live programming
• purely object-oriented
• dynamically typed
• reflective
• inspired by #Smalltalk
• single inheritance between classes
• traits: groups of methods
Pharo
First appeared: 2008
Features:
• live programming
• purely object-oriented
• dynamically typed
• reflective
• inspired by #Smalltalk
• single inheritance between classes
• traits: groups of methods
#language #D
D
- is a system programming language first appeared in 2001. Though it originated as a re-engineering of C++, D is a distinct language, having redesigned some core C++ features while also taking inspiration from other languages, notably Java, Python, Ruby, C#, and Eiffel.
D attempts to combine the performance and safety of compiled languages with the expressive power of modern dynamic languages. Idiomatic D code is commonly as fast as equivalent C++ code, while being shorter and memory-safe. Type inference, automatic memory management and syntactic sugar for common types allow faster development, while bounds checking, design by contract features and a concurrency-aware type system help reduce the occurrence of bugs.
Paradigms: #imperative, #object_oriented, #metaprogramming, #functional and #concurrent (actor model)
Comparison with C
Despite their difference, D has been constrained in its design by the rule that any code that is legal in both C and D should behave in the same way.
Comparison with C++
Things D gained before C++:
• closures
• anonymous functions
• compile time function execution
Things D adds:
• design by contract
• unit testing
• true modules
• garbage collection
• first class arrays
• associative arrays
• dynamic arrays
• array slicing
• nested functions
• lazy evaluation
• built-in support for documentation comments, allowing automatic documentation generation
Things D replaces:
• multiple inheritance is replaced by Java-style single inheritance with interfaces and mixins.
• template syntax is re-engineered
Things they have in common:
• D's declaration, statement and expression syntax closely matches that of C++.
• D retains C++'s ability to perform low-level coding and to add inline assembler. The inline assembler typifies the differences between D and application languages like Java and C#. An inline assembler lets programmers enter machine-specific assembly code within standard D code, a method often used by system programmers to access the low-level features of the processor needed to run programs that interface directly with the underlying hardware, such as operating systems and device drivers.
Docs: https://dlang.org/spec/spec.html
D
- is a system programming language first appeared in 2001. Though it originated as a re-engineering of C++, D is a distinct language, having redesigned some core C++ features while also taking inspiration from other languages, notably Java, Python, Ruby, C#, and Eiffel.
D attempts to combine the performance and safety of compiled languages with the expressive power of modern dynamic languages. Idiomatic D code is commonly as fast as equivalent C++ code, while being shorter and memory-safe. Type inference, automatic memory management and syntactic sugar for common types allow faster development, while bounds checking, design by contract features and a concurrency-aware type system help reduce the occurrence of bugs.
Paradigms: #imperative, #object_oriented, #metaprogramming, #functional and #concurrent (actor model)
Comparison with C
Despite their difference, D has been constrained in its design by the rule that any code that is legal in both C and D should behave in the same way.
Comparison with C++
Things D gained before C++:
• closures
• anonymous functions
• compile time function execution
Things D adds:
• design by contract
• unit testing
• true modules
• garbage collection
• first class arrays
• associative arrays
• dynamic arrays
• array slicing
• nested functions
• lazy evaluation
• built-in support for documentation comments, allowing automatic documentation generation
Things D replaces:
• multiple inheritance is replaced by Java-style single inheritance with interfaces and mixins.
• template syntax is re-engineered
Things they have in common:
• D's declaration, statement and expression syntax closely matches that of C++.
• D retains C++'s ability to perform low-level coding and to add inline assembler. The inline assembler typifies the differences between D and application languages like Java and C#. An inline assembler lets programmers enter machine-specific assembly code within standard D code, a method often used by system programmers to access the low-level features of the processor needed to run programs that interface directly with the underlying hardware, such as operating systems and device drivers.
Docs: https://dlang.org/spec/spec.html
#language #R
R
- is a programming language and software environment for statistical computing and graphics. The language is widely used among statisticians and data miners for developing statistical software and data analysis. Polls, data mining surveys and studies of scholarly literature databases, show substantial increases in popularity in recent years.
Paradigms: #object_oriented, #imperative
First appeared: 1993
Influenced by: #Lisp, S, Scheme
Influenced: #Julia
#TIOBE rank: 18 (as of 2018)
Source code for the R software environment is written primarily in #C, #Fortran and R itself. The project was conceived in 1992, with an initial version released in 1995 and a stable beta version in 2000.
Syntax
• Assignment
The generally preferred assignment operator is an arrow made from two characters
• Vectors
The scalar data type was never a data structure of R; instead, a scalar is represented as a vector with length one. Data structures include vectors, matrices, arrays, data frames (similar to tables in a relational database) and lists.
Features:
• supports matrix arithmetic
• supports regression analysis, time-series analysis, spatial analysis
• has generic functions (which act differently depending on the classes of arguments passed to them i.e. dispatch the function/method specific to that class of object; e.g.
• arrays are stored in column-major order
RStudio
The most commonly used graphical integrated development environment for R is RStudio. It is written in Java, C++ (the Qt framework for its GUI) and JavaScript. Work on RStudio started around December 2010, and the first public beta version was officially announced in February 2011. Version 1.0 was released on 1 November 2016.
www.rstudio.com
R
- is a programming language and software environment for statistical computing and graphics. The language is widely used among statisticians and data miners for developing statistical software and data analysis. Polls, data mining surveys and studies of scholarly literature databases, show substantial increases in popularity in recent years.
Paradigms: #object_oriented, #imperative
First appeared: 1993
Influenced by: #Lisp, S, Scheme
Influenced: #Julia
#TIOBE rank: 18 (as of 2018)
Source code for the R software environment is written primarily in #C, #Fortran and R itself. The project was conceived in 1992, with an initial version released in 1995 and a stable beta version in 2000.
Syntax
• Assignment
The generally preferred assignment operator is an arrow made from two characters
<-, although = can usually be used instead.• Vectors
> x <- 1:6 # Create vector.• Functions
> y <- x^2 # Create vector by formula.
> print(y) # Print the vector’s contents.
[1] 1 4 9 16 25 36
f <- function(x, y) {
z <- 3 * x + 4 * y
return(z)
}
SemanticsThe scalar data type was never a data structure of R; instead, a scalar is represented as a vector with length one. Data structures include vectors, matrices, arrays, data frames (similar to tables in a relational database) and lists.
Features:
• supports matrix arithmetic
• supports regression analysis, time-series analysis, spatial analysis
• has generic functions (which act differently depending on the classes of arguments passed to them i.e. dispatch the function/method specific to that class of object; e.g.
print)• arrays are stored in column-major order
RStudio
The most commonly used graphical integrated development environment for R is RStudio. It is written in Java, C++ (the Qt framework for its GUI) and JavaScript. Work on RStudio started around December 2010, and the first public beta version was officially announced in February 2011. Version 1.0 was released on 1 November 2016.
www.rstudio.com