Skip to content

SP-Lang language designยค

Propertiesยค

Compiled or interpreted

SP-Lang is both:

๐Ÿ“œ Declarativeยค

Most computer languages are imperative. This means that most of the code goes towards explaining to the computer how to execute some task. SP-Lang, on the other hand, is declarative. The maker describes โ€œwhatโ€ they want their logic to do, not exactly โ€œhowโ€ or โ€œwhenโ€ it is to be done. Then the compiler will figure out how to do it. This allows the compiler to heavily optimize by deferring work until needed, pre-fetching and reusing cached data, etc.

๐Ÿ”— Functionalยค

SP-Lang favors pure functions without side effects. This results in logic, which is easier to understand and gives the compiler the most freedom to optimize.

๐Ÿ”€ Statelessยค

There is no state to modify, and therefore are no variables, just constants. You pass data through various expressions to build the final result.

๐Ÿ” Strongly typedยค

The types of all the values are known at compile time. This allows for the early detection of errors and reinforce optimizations.

๐Ÿ’ก Type inferenceยค

Types are derived from their use without being declared. For example, setting a variable to a number results in that variable's type being established as a number. This further reduces a complexity for a maker without any performance sacrifice known from interpreted languages.

For advanced users who require more control over the type system, the SP-Lang provide mechanisms to explicitly specify types or interact with the type system when necessary. This flexibility allows advanced users to fine-tune their code for maximum performance and reliability, while still benefiting from the convenience of type inference.

๐ŸŽ“Turing completenessยค

SP-Lang is designed to be Turing complete.