alecci


Namealecci JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/citic/alecci
SummaryA compiler for the Alecci programming language
upload_time2025-10-23 05:53:36
maintainerNone
docs_urlNone
authorBryan Ulate
requires_python>=3.8
licenseNone
keywords compiler programming-language concurrency threading llvm
VCS
bugtrack_url
requirements llvmlite ply pytest
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Alecci Programming Language

A modern programming language with built-in concurrency support, compiled to native code via LLVM.

## Features

- ๐Ÿš€ **High Performance**: Compiles to optimized native code via LLVM
- ๐Ÿงต **Built-in Concurrency**: Native threading, mutexes, barriers, and semaphores
- ๐Ÿ”ง **Modern Syntax**: Clean, readable syntax with type inference
- ๐Ÿ›ก๏ธ **Memory Safety**: Variant types and safe array operations
- ๐Ÿ”„ **Sanitizer Support**: Built-in ThreadSanitizer for race conditions and AddressSanitizer for memory safety

## Quick Start

### Installation

```bash
pip install alecci --break-system-packages
```

**Note**: If the `alecci` command is not found after installation, you may need to add the user bin directory to your PATH:

```bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
```

Alternatively, you can run the compiler directly:
```bash
python3 -m alecci
```

### Your First Program

Create a file called `hello.ale`:

```alecci
procedure main(argc, argv)
    print("Hello, Alecci!")
end procedure
```

Compile and run:

```bash
alecci hello.ale -o hello
./hello
```

#### Sanitizer Options

- **Thread Sanitizer (default)**: Detects race conditions and threading issues
  ```bash
  alecci hello.ale -o hello  # TSan enabled by default
  ```

- **AddressSanitizer**: Detects memory errors like buffer overflows
  ```bash
  alecci hello.ale --use-asan -o hello
  ```

- **No Sanitizer**: Disable all sanitizers for maximum performance
  ```bash
  alecci hello.ale --no-tsan -o hello
  ```

### Threading Example

```alecci
procedure worker(thread_number as int)
    print `Worker {thread_number} is running`
end procedure

procedure main(argc, argv)
    shared const thread_count := 4
    
    mutable threads := create_threads(thread_count, worker)
    join_threads(threads)
    
    print("All workers completed!")
end procedure
```

## Language Features

### Variables and Types
```alecci
mutable x := 42          // Mutable integer
const message := "Hello" // Immutable string
mutable arr := array(10, 0) // Array of 10 zeros
```

### Functions
```alecci
function add(a as int, b as int) -> int
    return a + b
end function
```

### Concurrency
```alecci
shared mutable counter := 0
shared mutable mtx := mutex()

procedure increment()
    lock(mtx)
    counter := counter + 1
    unlock(mtx)
end procedure
```

## Installation from Source

If you want to build from source:

```bash
git clone https://github.com/yourusername/alecci.git
cd alecci
pip install -e . --break-system-packages
```

If needed, add the local bin directory to your PATH:
```bash
export PATH="$HOME/.local/bin:$PATH"
```

## Requirements

- Python 3.8+
- LLVM 14+ (for llvmlite)
- GCC or Clang (for linking)

## Documentation

- [Language Reference](docs/language-reference.md)
- [Concurrency Guide](docs/concurrency.md)
- [Examples](examples/)

## License

MIT License - see [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/citic/alecci",
    "name": "alecci",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "compiler programming-language concurrency threading llvm",
    "author": "Bryan Ulate",
    "author_email": "bryan.ulate@ucr.ac.cr",
    "download_url": "https://files.pythonhosted.org/packages/71/b6/635e2e6b01b4dc11af06da7fcafcb4fe08c89c1f7694acaf1a4dfbdaf5aa/alecci-1.1.0.tar.gz",
    "platform": null,
    "description": "# Alecci Programming Language\n\nA modern programming language with built-in concurrency support, compiled to native code via LLVM.\n\n## Features\n\n- \ud83d\ude80 **High Performance**: Compiles to optimized native code via LLVM\n- \ud83e\uddf5 **Built-in Concurrency**: Native threading, mutexes, barriers, and semaphores\n- \ud83d\udd27 **Modern Syntax**: Clean, readable syntax with type inference\n- \ud83d\udee1\ufe0f **Memory Safety**: Variant types and safe array operations\n- \ud83d\udd04 **Sanitizer Support**: Built-in ThreadSanitizer for race conditions and AddressSanitizer for memory safety\n\n## Quick Start\n\n### Installation\n\n```bash\npip install alecci --break-system-packages\n```\n\n**Note**: If the `alecci` command is not found after installation, you may need to add the user bin directory to your PATH:\n\n```bash\necho 'export PATH=\"$HOME/.local/bin:$PATH\"' >> ~/.bashrc\nsource ~/.bashrc\n```\n\nAlternatively, you can run the compiler directly:\n```bash\npython3 -m alecci\n```\n\n### Your First Program\n\nCreate a file called `hello.ale`:\n\n```alecci\nprocedure main(argc, argv)\n    print(\"Hello, Alecci!\")\nend procedure\n```\n\nCompile and run:\n\n```bash\nalecci hello.ale -o hello\n./hello\n```\n\n#### Sanitizer Options\n\n- **Thread Sanitizer (default)**: Detects race conditions and threading issues\n  ```bash\n  alecci hello.ale -o hello  # TSan enabled by default\n  ```\n\n- **AddressSanitizer**: Detects memory errors like buffer overflows\n  ```bash\n  alecci hello.ale --use-asan -o hello\n  ```\n\n- **No Sanitizer**: Disable all sanitizers for maximum performance\n  ```bash\n  alecci hello.ale --no-tsan -o hello\n  ```\n\n### Threading Example\n\n```alecci\nprocedure worker(thread_number as int)\n    print `Worker {thread_number} is running`\nend procedure\n\nprocedure main(argc, argv)\n    shared const thread_count := 4\n    \n    mutable threads := create_threads(thread_count, worker)\n    join_threads(threads)\n    \n    print(\"All workers completed!\")\nend procedure\n```\n\n## Language Features\n\n### Variables and Types\n```alecci\nmutable x := 42          // Mutable integer\nconst message := \"Hello\" // Immutable string\nmutable arr := array(10, 0) // Array of 10 zeros\n```\n\n### Functions\n```alecci\nfunction add(a as int, b as int) -> int\n    return a + b\nend function\n```\n\n### Concurrency\n```alecci\nshared mutable counter := 0\nshared mutable mtx := mutex()\n\nprocedure increment()\n    lock(mtx)\n    counter := counter + 1\n    unlock(mtx)\nend procedure\n```\n\n## Installation from Source\n\nIf you want to build from source:\n\n```bash\ngit clone https://github.com/yourusername/alecci.git\ncd alecci\npip install -e . --break-system-packages\n```\n\nIf needed, add the local bin directory to your PATH:\n```bash\nexport PATH=\"$HOME/.local/bin:$PATH\"\n```\n\n## Requirements\n\n- Python 3.8+\n- LLVM 14+ (for llvmlite)\n- GCC or Clang (for linking)\n\n## Documentation\n\n- [Language Reference](docs/language-reference.md)\n- [Concurrency Guide](docs/concurrency.md)\n- [Examples](examples/)\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A compiler for the Alecci programming language",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/citic/alecci"
    },
    "split_keywords": [
        "compiler",
        "programming-language",
        "concurrency",
        "threading",
        "llvm"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "291dbc903bd531791a7a83071d459346cde44c53f7050d78d26bfded1746a7a1",
                "md5": "6baaaf4a8c1167112fc1b2fc16ad17ea",
                "sha256": "f277e947f18ed7b17c7e6919c498a95e868bf9f419d9e2a1dcf524358ff168e1"
            },
            "downloads": -1,
            "filename": "alecci-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6baaaf4a8c1167112fc1b2fc16ad17ea",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 88212,
            "upload_time": "2025-10-23T05:53:34",
            "upload_time_iso_8601": "2025-10-23T05:53:34.803615Z",
            "url": "https://files.pythonhosted.org/packages/29/1d/bc903bd531791a7a83071d459346cde44c53f7050d78d26bfded1746a7a1/alecci-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "71b6635e2e6b01b4dc11af06da7fcafcb4fe08c89c1f7694acaf1a4dfbdaf5aa",
                "md5": "12f79c4cf52435e4c539e4daf10f6604",
                "sha256": "9be090f5f37b84e9f1316dbd857c0cc93113b278f17315088f0a49dec07c3cf1"
            },
            "downloads": -1,
            "filename": "alecci-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "12f79c4cf52435e4c539e4daf10f6604",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 95449,
            "upload_time": "2025-10-23T05:53:36",
            "upload_time_iso_8601": "2025-10-23T05:53:36.260868Z",
            "url": "https://files.pythonhosted.org/packages/71/b6/635e2e6b01b4dc11af06da7fcafcb4fe08c89c1f7694acaf1a4dfbdaf5aa/alecci-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-23 05:53:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "citic",
    "github_project": "alecci",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "llvmlite",
            "specs": [
                [
                    ">=",
                    "0.40.0"
                ]
            ]
        },
        {
            "name": "ply",
            "specs": [
                [
                    ">=",
                    "3.11"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    ">=",
                    "7.0.0"
                ]
            ]
        }
    ],
    "lcname": "alecci"
}
        
Elapsed time: 0.65722s