Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
NotificationsYou must be signed in to change notification settings

mizchi/x-lang-proto

Repository files navigation

This is a prototyping language for considering languages for AI.

I plan to completely remake it. I'm not sure if this will be the repository.

An experimental programming language supporting multiple programming paradigms.

Installation

Build from Source

# Clone the repositorygit clone https://github.com/mizchi/x-lang-proto.gitcd x-lang-proto# Build and installcargo build --releasecargo install --path x-clicargo install --path x-compiler

Architecture

Core Crates

  • x-parser - Text to AST conversion with S-expression syntax
  • x-checker - Type checking and semantic analysis with effect system
  • x-compiler - Code generation for multiple targets
  • x-editor - Language service with direct AST manipulation for AI

Key Features

Advanced Type System

  • Effect System - Algebraic effects and handlers for controlled side effects
  • Type Inference - Automatic type deduction with constraints
  • Visibility Modifiers - Module privacy (pub,pub(crate), etc.)

Language Service & AI Integration

Thex-lang-editor crate provides a language service designed for AI integration:

use x_editor::{XLangEditor,EditOperation,AstQuery};letmut editor =XLangEditor::new(config);let session_id = editor.start_session(source_code)?;// Direct AST manipulationlet operation =EditOperation::insert(path, new_node);editor.apply_operation(session_id, operation)?;// Query AST structurelet query =AstQuery::find_by_type("FunctionDef");let results = editor.query_ast(session_id, query)?;

CLI Reference

# Compile source codex-lang compile input.x --target typescript --output dist/# Type check onlyx-lang check input.x# Parse and show ASTx-lang parse input.x --format json# Show available targetsx-lang targets# Create configuration filex-lang init-config --output x-lang.toml# Validate configurationx-lang validate-config x-lang.toml

Configuration

Createx-lang.toml for project settings:

[default]optimization_level =2debug_info =truesource_maps =true[targets.typescript]enabled =truemodule_system ="es2020"emit_types =truestrict =true[targets.wasm-component]enabled =truewith_wit =truegenerate_bindings =truewit_package ="my-component"

CLI Tools

x-lang (Compiler)

Main compiler tool for x-lang.

x-lang compile<file> --target<target> --output<dir>x-lang check<file>x-lang parse<file>x-lang targets

x (AST Editor)

AST manipulation tool.

x convert<input><output>x show<file>x query<file><query>x edit<file>x rename<file><old><new>

Development

Running Tests

cargotest

Building Documentation

cargo doc --open

Code Formatting

cargo fmt

Linting

cargo clippy

Roadmap

  • LSP Server - Full Language Server Protocol support
  • Package System - Module management and distribution
  • Debugger - Source-level debugging support
  • REPL - Interactive development environment
  • More Backends - LLVM, C, Go compilation targets
  • Async/Await - Built-in concurrency primitives
  • Macros - Compile-time code generation

Contributing

Contributions are welcome! We need help in the following areas:

  • Language Features - New syntax constructs, type system improvements
  • Backends - Additional compilation targets
  • Tooling - IDE plugins, debugger support
  • Documentation - Examples, tutorials, API docs

To submit a Pull Request:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Inspired by OCaml, Rust, and effect systems research
  • Built with Rust and the amazing Rust ecosystem
  • Thanks to all contributors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp