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.