1.0.1 • Published 6 months ago

@myndscipt/qflow v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

QFLOW & QScript

A high-performance async framework with semantic intelligence for AI-driven development

QFLOW is a modern, high-performance framework for building async applications with predictable performance characteristics. QScript extends this foundation with a semantically-aware language design specifically optimized for AI-driven development.

Vision

The QFLOW ecosystem offers developers and AI assistants a unified approach to development that combines high-performance async primitives with semantic awareness:

  • QFLOW provides the optimized async runtime and core primitives
  • QScript builds on this foundation with semantic type relationships and AI-first design

Key Features

QFLOW Core Features

  • 🚀 Blazing Fast: Significantly outperforms native Promises (+29.9% overall)
  • 📊 Predictable Performance: Explicit synchronization points for precise control
  • 🔄 Reactive Programming: Built-in reactive event system
  • 🧩 Hybrid Programming Model: Multiple patterns for different use cases
  • 🛠️ Resource Management: First-class support for resource monitoring and control

QScript Extensions

  • 🧠 Semantic Thesaurus: AI-friendly type relationships and concept mapping
  • 📦 Versionless Dependencies: QSON system eliminates version management headaches
  • 🔍 Self-Healing Errors: Context-aware error messages with automated fixes
  • 📐 Standardized Structure: Consistent project organization for AI understanding
  • 🌉 Intelligent Bridges: Standardized connections between semantic domains

Performance

According to our benchmarks, QFLOW significantly outperforms native Promises:

OperationPerformance Improvement
Creating promises+12.2%
Chaining operations+58.1%
Parallel operations+52.1%
Overall+29.9%

Installation

# For now, install QFLOW core
npm install qflow

# QScript coming soon!

Quick Start

import { execute, Fast, QSYNC, QTask } from 'qflow';

// Pattern 1: Using execute() with Fast
function getData(id: string): Fast<Data> {
  return execute(() => {
    const result = fetchData(id).wait();
    return processData(result);
  });
}

// Pattern 2: Task-based with QSYNC
function processItem(item: Item): Fast<void> {
  const qsync = QSYNC.getInstance();
  
  const task: QTask<void> = {
    id: `process-${item.id}`,
    category: 'processing',
    name: `Process ${item.id}`,
    fn: () => validateAndSave(item)
  };

  return qsync.schedule(task);
}

// Pattern 3: Fast chaining
function updateRecord(id: string): Fast<Record> {
  return Fast.resolve(id)
    .then(fetchRecord)
    .then(updateFields)
    .then(saveRecord);
}

Documentation

For detailed documentation, see:

Examples

The examples directory contains various examples demonstrating QFLOW usage:

  • Basic Usage
  • Hybrid Patterns
  • Reactive Programming
  • Interactive Demo
  • Real-world Applications

Core Components

QFast

A high-performance alternative to JavaScript Promises with explicit synchronization points.

const data = fetchData().wait(); // Explicit synchronization point

QEvent

A powerful reactive event system for event-driven programming.

const userEvents = new QEvent<UserAction>();
userEvents.on(action => handleUserAction(action));
userEvents.emit({ type: 'login', userId: '123' });

const qevent = QEvent.getInstance();
qevent.on('user:login', (data) => handleLogin(data));
qevent.emit('user:login', { userId: '123' });

QSYNC

Task scheduling and synchronization system for coordinating asynchronous operations.

const task = qsync.createTask('data-processing', () => {
  return processLargeDataset();
});

qsync.schedule(task);

Database Adapters

Database abstraction layer with optimized async operations.

// Create a database connection
const db = new PostgreSQLAdapter({
  host: 'localhost',
  port: 5432,
  username: 'postgres',
  password: 'password',
  database: 'mydb'
});

// Connect and execute a query
db.connect().sync();
const users = db.query('SELECT * FROM users').sync();

Semantic Definitions

QSON System

Versionless dependency management for evolving libraries and frameworks.

semantic.define('neural.pathway', {
    concepts: ['connection', 'synapse', 'link'],
    related: ['neural.node', 'neural.network'],
    constraints: ['bidirectional', 'weighted']
});

AI-Friendly Error System

Context-aware error messages with self-healing capabilities.

// Instead of "Cannot read properties of undefined"

// QScript provides:

/ Error: Missing neural connection source Context: When creating a neural pathway, both source and target must be defined Suggestion: Check if the 'nodes' array is populated before accessing elements /

QFLOW

High-performance synchronization primitives for TypeScript.

Features

  • Fast synchronization primitives
  • Type-safe Promise alternatives
  • Performance optimizations
  • Database integrations

Usage

Initialize a QFLOW project with the command palette: Ctrl+Shift+P > QFLOW: Initialize Project

Examples

import { Fast, execute } from './core/QFast';

// Synchronous execution
function calculateResult(): Fast<number> {
  return execute(() => {
    // Your high-performance code here
    return 42;
  });
}

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

License

MIT

1.0.1

6 months ago

1.0.0

6 months ago