Skip to content

Latest commit

 

History

History
75 lines (59 loc) · 3.45 KB

FAQ.md

File metadata and controls

75 lines (59 loc) · 3.45 KB

What kind of language is Seedling (going to be)?

A functional concatenative language with algebraic types and effects. Execution control in Seedling is goal-directed.

All these features of the language are to help the human user to reason about the program in a structured way, avoiding the need to deal with spaghetti code.

What is a functional language?

A programming language in which functions are "first-class citizens", meaning that they can be passed, returned and manipulated (in case of functions composed, applied, etc.) just like any other data type.

What is a concatenative language?

A programming language in which composition is denoted by concatenation. It is a syntactic principle allowing small parts of the program to be self-sufficient. Examples of existing concatenative languages inspiring Seedling would be FORTH, Factor, PostScript and RPL.

What are algebraic types?

Types which are composed of other types using product-style (e.g. records) and sum-style (e.g. unions) operations.

What are algebraic effects?

In addition to their argument type and return type functions' type also includes a set of effects. Typical effects would be errors, I/O and resource use. Composition of functions results in the union of their effect sets being the effect set of the composed function. Effects can be removed (i.e. subtracted) from effects sets by explicit handling. Typical ways of handling effects are catching an error, performing the I/O operation or accounting for resource use. Another typical way of handling effects is ignoring them.

What is goal-directed execution?

Goal-directed execution is contrasted with boolean-directed execution. Conditional execution depends on whether or not functions succeed or more generally whether tasks achieve their goals and yield the expected result. All functions can succeed, therefore success is an implicit effect of all functions, which is typically ignored in single-threaded (one task) execution (though it can be handled for debugging purposes). Some functions can also fail, meaning that the goal of their computation cannot be achieved given their input. Failure is an explicit effect (called fail in Seedling) that backtracks the computation to wherever it is caught (catching is the only possible handling of a failure).

In concurrent execution, goals of computations can depend on the success of more than one task. Tasks can yield results that can be processed by other tasks. A task processing the result of another task that failed also fails.

Examples of languages with goal-directed execution control would be make, Icon and Prolog.

Human reasoning can also be demonstrated to be naturally goal-directed, making goal-directed execution easier to understand.