Pure is a
- Purely functional programming language that
- Transpiles to Node.js code (of the CommonJS dialect)
- Intended for backend developers who wish to create type-safe and elegant server applications
We hope that Pure will be able to target the following use cases:
- 🧩 Plug & Play - write a Pure module, transpile it, use its functions from within your regular Node.js modules/programs.
- 🌩️ Cloud Functions - you can incorporate Pure modules into your existing codebase - that's great! Why not use Pure to substitute some of your GCP or AWS Lambda endpoints?
- 🚀 Microservices - well... If you can write a Pure Cloud Function... Why not a Pure Microservice? After all, microservices are just cloud functions with some custom setup around them.
NOTE: This relies on the stack
build tool.
You may use the installation script:
source <(curl -s https://raw.githubusercontent.com/prog-lang/purist/main/install.sh)
Or execute these commands manually (the script does the same as the following code snippet):
git clone [email protected]:prog-lang/purist.git
cd purist
stack install
During installation, stack
builds an executable and copies it over into some
folder on your system where it thinks global executables should be located. That
folder is baked into stack
and is usually something like $HOME/.local/bin/
on UNIX systems and probably something similar on Windows.
Therefore, uninstalling is extremely straightforward:
rm $(which purist)
The following command will transpile someModule.pure
into someModule.js
.
purist c < someModule.pure > someModule.js
NOTE: Executing purist
with no arguments displays the help message. Use
it to get acquainted with its capabilities.
🚧 CAUTION: ACTIVE CONSTRUCTION SITE 🚧
All great projects started somewhere and Pure isn't an exception to this rule. We are working hard to give you a tool you can be excited about.
- Parser
- Module (AST)
- Type Checker with Inference
- Transpiler $\to$ Node.js
- Transpiler
$\to$ Go
Our vision is simple: we want backend development to feel like a game.
With a strict but flexible type system and a powerful set of dev tools, all you have to do is use compiler hints to make the puzzle pieces fit together. If you ever touched Elm or Haskell, you will know what I'm on about.
- Duet - a subset of Haskell aimed at aiding teachers teach Haskell
- PureScript - a strongly-typed language that compiles to JavaScript
- Parsec tutorial and some conveniences like haskelDef and GenTokenParser
- Typing Haskell in Haskell - a renovated version of the legendary paper
- Typing Haskell in Haskell PDF - the original paper (PDF)
- Warnings for pattern matching - pattern matching algorithms (PDF)
- fby19 - Hindley-Milner inference tutorial (GitHub)
- Programming Languages: Application and Interpretation - chapter 15: Checking Program Invariants Statically: Types
If you wish to help out, please reach out via my personal email.