PitchHut logo
A Programming Language Designed for Large Language Models
Pitch

The programming languages we use were designed for humans. What if we designed programming languages for LLMs?

Description

SPELL is an innovative programming language specifically crafted for artificial intelligence applications, particularly suited for large language models (LLMs). Unlike traditional programming languages, SPELL employs a dataflow paradigm where computations are expressed as a graph of explicit dependencies—eliminating hidden state and enabling a clear representation of logic.

Key Features

  • Explicit Dependencies: Each node within the system explicitly declares its inputs, promoting clarity and maintainability.
  • Explicit Types: Every value is accompanied by a type annotation, ensuring that types are defined rather than inferred, which enhances safety and predictability.
  • Structured Format: Utilizing JSON as its syntax, SPELL aligns closely with the structure of data typically used in LLM training, simplifying integration and understanding.

Current Status

This project is in the Pre-Alpha (v0.1) phase, offering a minimal proof-of-concept that showcases the essential dataflow architecture. Many features are still under development, including an extended operation set, file input/output, network operations, string manipulation, custom function definitions, and error recovery.

Usage Example

To illustrate the functionality of SPELL, consider the following JSON representation of a simple dataflow operation:

{
  "data": {
    "op": "Const",
    "value": { "literal": [1, 2, 3, 4, 5], "type": "Array<Number>" },
    "returns": "Array<Number>"
  },
  "sum": {
    "op": "Reduce",
    "list": { "ref": "data", "type": "Array<Number>" },
    "apply_op": { "literal": "Add", "type": "String" },
    "initial": { "literal": 0, "type": "Number" },
    "acc_arg": { "literal": "a", "type": "String" },
    "item_arg": { "literal": "b", "type": "String" },
    "returns": "Number"
  },
  "result": {
    "op": "Print",
    "in": { "ref": "sum", "type": "Number" },
    "returns": "Number"
  }
}

This example showcases how each node specifies its operation, inputs, and output types.

Operations Available

The following operations are currently implemented and suitable for various data transformation tasks:

  • Const: Definitions of constant values.
  • Add, Sub, Mul, Div: Mathematical operations.
  • Eq, Gt, Lt: Comparison operations that return boolean values.
  • Map, Filter, Reduce: Functional operations for list transformations.
  • Len: Retrieves the length of a list.
  • Print: Outputs values to the console.

Explore Further

Complete program examples can be found in the examples/ directory, including applications such as sales data analysis and statistics calculations.

Why Choose SPELL?

Traditional programming languages cater to human authors who reason sequentially and internally track state. However, large language models operate through pattern completion, making SPELL a more fitting abstraction for their mechanisms. Its architecture provides a seamless and efficient way to develop AI-centric solutions.

0 comments

No comments yet.

Sign in to be the first to comment.