Skip to main content

Curl is an open-source programming language built on Python technology

Project description

Curl Programming Language

Curl is an open-source programming language built on Python technology, designed to be simple and expressive. Every statement uses a keyword{...}\ style, and blocks are opened with - and closed with --\.

Requirements

  • Python 3.7+
  • Node.js (optional — only needed for otherCoding{"JavaScript", ...} blocks)

Installation

From PyPI (recommended):

pip install curl-programming-lang

To upgrade:

pip install --upgrade curl-programming-lang

From source:

git clone https://github.com/gautamritvik/Curl-Programming.git
cd Curl-Programming
pip install -e .

Running the Curl terminal (REPL)

curlang

Running a Curl program

curlang [YOUR-FILE].curl

CLI flags

curlang --version    show version
curlang --license    show license
curlang --credits    show credits
curlang --help       show help

Syntax Reference

Print — pcType

Outputs text to the console. Supports string concatenation with +.

pcType{"Hello, World!"}\
pcType{"Hello, " + var{name} + "!"}\

Input — pcAsk

Prompts the user for input. The result is accessed anywhere with input{ans}.

pcAsk{"What is your name? >>"}\
pcType{"You said: " + input{ans}}\

Variables — var

Assign a value with var{name, value}\. Reference it later with var{name}.

var{name, "Ritvik"}\
pcType{var{name}}\

Variables can hold strings, numbers, or lists.


Lists — list

Create a list with items separated by ;. Typically assigned to a variable.

var{colors, list{"red"; "green"; "blue"}}\
pcType{var{colors}}\

Functions — createFunc / func

Define a function with createFunc{name}- and close it with --\. Call it with func{name}\.

createFunc{greet}-
    pcType{"Hello from greet!"}\
--\

func{greet}\

Conditionals — if / elif / else

Simple if:

if{var{score} >= 90, then}-
    pcType{"Grade: A"}\
--\

If / else:

if{var{score} >= 90, then}-
    pcType{"Grade: A"}\
else:
    pcType{"Grade: B or below"}\
--\

If / elif / else:

if{var{score} >= 90, then}-
    pcType{"Grade: A"}\
elif{var{score} >= 80, then}-
    pcType{"Grade: B"}\
else:
    pcType{"Grade: C or below"}\
--\

For if+elif chains without an else, close with --\--\.

Supported comparison operators: == != < > <= >=


Embedded code blocks — otherCoding

Run a block of code written in another language. The closing }\ must be on its own line.

otherCoding{"Python",

x = 10
print("x =", x)

}\

Supported languages:

Language Status
Python Fully supported
JavaScript / Node.js Supported (requires Node.js)
Java, C, C++ Not supported at runtime

Import — import

Import a Python package and give it a nickname.

import{"math", m}\

AI — pcAI

pcAI is a built-in AI module — no import required. It supports conversation history, system prompts, and an interactive chat mode.

Configure it with environment variables:

Variable Default Description
CURL_AI_KEY or OPENAI_API_KEY (none) Your API key
CURL_AI_BASE_URL https://api.openai.com/v1 API base URL
CURL_AI_MODEL gpt-4o-mini Model name

Works with OpenAI, OpenRouter, Ollama, or any OpenAI-compatible API.

Ask a question:

var{reply, pcAI.ask{"What is the capital of France?"}}\
pcType{var{reply}}\

Set a persona (system prompt):

pcAI.context{"You are a friendly pirate who answers in rhymes."}\
var{reply, pcAI.ask{"What is 2 + 2?"}}\
pcType{var{reply}}\

Interactive chat loop (type exit to quit):

pcAI.chat{""}\

Other methods:

var{s, pcAI.summarize{"some long text"}}\
var{a, pcAI.analyze{"some data"}}\
var{mood, pcAI.sentiment{"I love this!"}}\
var{t, pcAI.translate{"Bonjour — translate to English"}}\
pcAI.reset{""}\

Conversation history is kept across pcAI.ask calls and auto-compacts when it gets long.


Symbols

Symbol Meaning
\ End of a statement
- Start of a block
--\ End of a block
{} Argument container
"" String / text data
; Separator inside lists
, Separator between parameters
== Equals
!= Not equals
= Assignment
+ Concatenation / addition
- Subtraction
* Multiplication
/ Division

Example program

var{name, "Ritvik"}\
pcType{"Hello, " + var{name} + "!"}\

var{score, 95}\
if{var{score} >= 90, then}-
    pcType{"You got an A!"}\
else:
    pcType{"Keep trying!"}\
--\

createFunc{sayBye}-
    pcType{"Goodbye, " + var{name} + "!"}\
--\

func{sayBye}\

Example AI program

pcAI.context{"You are a helpful tutor."}\
var{answer, pcAI.ask{"Explain what a variable is in one sentence."}}\
pcType{var{answer}}\

License

This project is licensed under the Apache License 2.0 (OSI-approved). See the full license at: https://github.com/gautamritvik/Curl-Programming/blob/main/LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

curl_programming_lang-1.4.4.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

curl_programming_lang-1.4.4-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file curl_programming_lang-1.4.4.tar.gz.

File metadata

  • Download URL: curl_programming_lang-1.4.4.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for curl_programming_lang-1.4.4.tar.gz
Algorithm Hash digest
SHA256 8007140fc1c8bc8dd5ceec5dcefc5fcf0bf1dfb8e2fc692c87e2cb17ee1e3443
MD5 07a7feebe7b2904f7abda31d239da4a2
BLAKE2b-256 2e13660a118329c853fa038b1e6f306a19a4d6bbebb77ec1a57d803ba059fa2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for curl_programming_lang-1.4.4.tar.gz:

Publisher: publish.yml on gautamritvik/Curl-Programming

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file curl_programming_lang-1.4.4-py3-none-any.whl.

File metadata

File hashes

Hashes for curl_programming_lang-1.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 36185429b6df271cae39a03bca39851fe122a0b32b2b2105d0ca35aa1c30901d
MD5 b75a2769b8d25ce0ff7c350ab77d9c0a
BLAKE2b-256 a7bc05306f23fd14d4fa80d18abaaa62bccc917dbd860b5953ac900394094d13

See more details on using hashes here.

Provenance

The following attestation bundles were made for curl_programming_lang-1.4.4-py3-none-any.whl:

Publisher: publish.yml on gautamritvik/Curl-Programming

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page