All Projects → discus-lang → salt

discus-lang / salt

Licence: other
The compilation target that functional programmers always wanted.

Programming Languages

haskell
3896 projects
Makefile
30231 projects

Projects that are alternatives of or similar to salt

CSpydr
A static typed low-level compiled programming language inspired by Rust and C
Stars: ✭ 17 (-72.58%)
Mutual labels:  low-level, compilation
Lambda
Fun with λ calculus!
Stars: ✭ 65 (+4.84%)
Mutual labels:  functional, lambda-calculus
lambda-zero
A minimalist pure lazy functional programming language
Stars: ✭ 65 (+4.84%)
Mutual labels:  functional, lambda-calculus
make
The Ultimate Makefile to compile all your C, C++, Assembly and Fortran projects
Stars: ✭ 41 (-33.87%)
Mutual labels:  compilation
hermes-js
Universal action dispatcher for JavaScript apps
Stars: ✭ 15 (-75.81%)
Mutual labels:  functional
PackageProject.cmake
🏛️ Help other developers use your project. A CMake script for packaging C/C++ projects for simple project installation while employing best-practices for maximum compatibility.
Stars: ✭ 48 (-22.58%)
Mutual labels:  target
Latte-lang
100% Java compatibility and Functional Programming.
Stars: ✭ 128 (+106.45%)
Mutual labels:  functional
deptoolkit
The Toolkit API, app, and browser extension. Start preserving now.
Stars: ✭ 40 (-35.48%)
Mutual labels:  functional
ramda
🦋Practical functional Go
Stars: ✭ 14 (-77.42%)
Mutual labels:  functional
LambdaCalculusPlayground
An Android app that provides a visual interface for creating and evaluating lambda calculus expressions
Stars: ✭ 16 (-74.19%)
Mutual labels:  lambda-calculus
vector
A PHP functional programming library.
Stars: ✭ 19 (-69.35%)
Mutual labels:  functional
dry-transformer
Data transformation toolkit
Stars: ✭ 59 (-4.84%)
Mutual labels:  functional
lambda
lambda calculus interpreter
Stars: ✭ 23 (-62.9%)
Mutual labels:  lambda-calculus
react-functional-select
Micro-sized & micro-optimized select component for React.js
Stars: ✭ 165 (+166.13%)
Mutual labels:  functional
sqlconstruct
Functional approach to query database using SQLAlchemy
Stars: ✭ 22 (-64.52%)
Mutual labels:  functional
vec-la-fp
↗️ A tiny (functional) 2d linear algebra library
Stars: ✭ 21 (-66.13%)
Mutual labels:  functional
hookuspocus
hooks for all the functions!
Stars: ✭ 60 (-3.23%)
Mutual labels:  functional
RingBuffer
Classic ringbuffer with optional Stream interface
Stars: ✭ 53 (-14.52%)
Mutual labels:  low-level
linqjs
Perform queries on collections in the manner of C#s System.Linq in JavaScript
Stars: ✭ 14 (-77.42%)
Mutual labels:  functional
HIGH-TO-LOW
in this repository you will find codes in C and their equivalence in MIPS Assembly
Stars: ✭ 20 (-67.74%)
Mutual labels:  low-level

Salt Intermediate Language Build Status

Salt is what you get when you leave C out in the sun for too long.

Salt is the compilation target that functional programmers always wanted.

Salt is a System-F variant intended as an intermediate language between higher level languages and an abstract assembly language (LLVM). Hand written code can also be used to implement runtime systems. The Disco Discus Compiler uses an earlier version of Salt (v1), and its runtime system is written in it. This current repo contains a newer version of Salt (v2) which is being split out into its own project. Salt v1 has a working LLVM backend, but the one for v2 in this repo is still a work in progress.

Example

We have some small "Hello World" type examples and test cases, but no larger programs yet. See the demo and syntax directories in this repo. The syntax looks like:

term reverse @[a: #Data] [xx: #List a]: #List a
 = case #list'case @a xx of
        { nil  [] → [list a|]
        ; cons [x: a, xs: #List a]
           → append @a [reverse @a xs, #list'one @a x] }

test eval reverse
 = reverse @#Nat [list #Nat| 10, 12, 13, 14]

The @[a: #Data] indicates a type parameter, and @a in the body is a type argument. Names starting with # are primitive constructors and operators. Test cases can be defined inline with the code and evaluated within the IDE (via the Language Server). The Salt syntax supports standard unicode symbols for punctuation, but there are also plain ASCII alternatives.

Features

The new version of the language includes:

  • A System-F substrate with distinct namespaces for types and terms.
  • Mixed named and de Bruijn index representation for variables.
  • Functions work on vectors of argument and return values, as described in Types are Calling Conventions. Arity information is expressed directly in the types of functions, instead of needing to be maintained as separate meta-data.
  • A coeffect system using box and run casts, as described in Capabilities and Coeffects. This system is also part of the Discus language.
  • Structural record and variant types.

Status

  • The current implementation includes a parser, type checker, big step interpreter, and server for the Language Server Protocol (LSP).
  • The language server produces parser and type checker diagnostics, and allows test cases to be run interactively using the interpeter.
  • The LLVM code generator itself has not yet been ported across from DDC. This will happen next.

Support

The salt executable includes a server that speaks Language Server Protocol. You should be able to get this working with your favourite editor or IDE. Matching Visual Studio Code extension and color themes are available here:

Documentation

The doc directory in this repo contains further documentation.

More Information

Salt is part of the Discus project, so ask questions on the discus mailing list.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].