Welcome to the Woma Programming Language!¶
The reference implementation of the Woma programming language compiler. There is also a genus of Python called Aspidites, latin for shield-bearer, that is this project’s namesake.
Installing¶
$ pip install Aspidites
$ docker pull ghcr.io/rjdbcm/aspidites:latest
$ gh repo clone rjdbcm/Aspidites && pip install ./Aspidites
Running¶
Pretty straightforward just use:
$ aspidites -h
$ docker run -v $PWD:/workdir rjdbcm/aspidites:latest -h
$ aspidites -h
Paradigms¶
This means Woma uses a simple predicate logic to create well-constrained types. This is currently implemented using AndreaCensi/contracts. More info on refinement type systems:
“Refinement types enrich a language’s type system with logical predicates that circumscribe the set of values described by the type, thereby providing software developers a tunable knob with which to inform the type system about what invariants and correctness properties should be checked on their code. In this article, we distill the ideas developed in the substantial literature on refinement types into a unified tutorial that explains the key ingredients of modern refinement type systems. In particular, we show how to implement a refinement type checker via a progression of languages that incrementally add features to the language or type system.”
Reference: Jhala, R. and Vazou, N., 2020. Refinement Types: A Tutorial. arXiv preprint arXiv:2010.07763. Read More
Compiler and testing directives as pragmas that are used inline in woma, this is similar to how pragmas are used in Ada. Read More
Functions are first class citizens in woma. More info on functional programming:
“In 1989 when functional programming was still considered a niche topic, Hughes wrote a visionary paper arguing convincingly ‘why functional programming matters’. More than two decades have passed. Has functional programming really mattered? Our answer is a resounding ‘Yes!’. Functional programming is now at the forefront of a new generation of programming technologies, and enjoying increasing popularity and influence. In this paper, we review the impact of functional programming, focusing on how it has changed the way we may construct programs, the way we may verify programs, and fundamentally the way we may think about programs.”
Reference: Zhenjiang Hu, John Hughes, Meng Wang, How functional programming mattered, National Science Review, Volume 2, Issue 3, September 2015, Pages 349–370, Read More
Constraint satisfaction is core to woma, should constraints not be satisfied for a given function nullity is returned rather than raising an exception. More about constraint programming:
“A discrete optimization problem can be given a declarative or procedural formulation, and both have their advantages. A declarative formulation simply states the constraints and objective function. It allows one to describe what sort of solution one seeks without the distraction of algorithmic details. A procedural formulation specifies how to search for a solution, and it therefore allows one to take advantage of insight into the problem in order to direct the search. The ideal, of course, would be to have the best of both worlds, and this is the goal of constraint programming.”
Reference: Alexander Bockmayr, John N. Hooker, Constraint programming, May 2003, Read More
Motivation¶
Words should be for the programmer and the data model not built-in language features.
A programmers focus should be on the logic of the program not trying to remember methods and namespaces.
The off-sides rule is sufficient to delineate scope, but should be limited in it’s ability to nest.
Goals¶
Ultra-smooth runtime exception handling with useful warnings.
Demonic non-determinism, favors non-termination and type-negotiation (constraint satisfaction).
Terseness that uses symbolic operations in order to make code both concise *and* readable.
Great for writing high-integrity code that works natively with CPython.
Usable for general purpose *or* scientific computing.
Table of Contents¶
- 1. Examples
- 2. Compiler Usage
- 3. Known Limitations
- 4. Woma In Depth
- 5. Built-in Functions
- 5.1. Arithmetic Functions
- 5.2. Iterator Functions
- 5.3. Higher Order Functions
- 5.4. Matching Patterns
- 5.4.1. Capture(pattern, name=``str``)
- 5.4.2. Strict(pattern)
- 5.4.3. OneOf(*pattern)
- 5.4.4. AllOf(*pattern)
- 5.4.5. Not(pattern)
- 5.4.6. Each(pattern [, at_least=]
- 5.4.7. EachItem(key_pattern, value_pattern)
- 5.4.8. Some(pattern)
- 5.4.9. Length(length)
- 5.4.10. Contains(item)
- 5.4.11. Regex(regex_pattern, bind_groups = True -> bool)
- 5.4.12. Check(predicate)
- 5.4.13. InstanceOf(*types)
- 5.4.14. SubclassOf(*types)
- 5.4.15. Transformed(function, pattern)
- 5.4.16. At(path, pattern)
- 5.5. Pragmas
- 5.6. Bolt-on Functions
- 5.7. Wrapped Python Built-ins
- 6. Troubleshooting
- 7. API Documentation
- 8. Information for Developers