|
1 | 1 | ai: |
2 | 2 | - title: Prompt |
3 | | - description: "`prompt` is a keyword that allows you to interact with the AI model. It supports both simple and advanced syntax with customizable parameters." |
| 3 | + description: The `prompt` keyword allows direct interaction with AI models. It supports both simple string inputs and advanced configurations with model parameters like temperature and token limits, making AI interactions a first-class language feature. |
4 | 4 | codeDemos: |
5 | 5 | - code: | |
6 | 6 | // Simple prompt usage |
|
17 | 17 | print(detailed_answer); |
18 | 18 | filename: prompt.ai |
19 | 19 | - title: AI Function |
20 | | - description: "`ai fn` is a powerful keyword that allows you to define AI-powered functions with type safety and reusability." |
| 20 | + description: The `ai fn` keyword defines functions powered by AI models with full type safety and error handling. These functions seamlessly integrate AI capabilities into your application logic while maintaining the reliability of traditional functions. |
21 | 21 | codeDemos: |
22 | 22 | - code: | |
23 | 23 | // Define an AI function for sentiment analysis |
|
33 | 33 | filename: ai_function.ai |
34 | 34 | - title: Agent |
35 | 35 | description: | |
36 | | - `agent` is native concept of the language, use `agent` keyword to define the agent, specify the instructions, |
37 | | - declare the functions as the tools. The multi-agent orchestration is inspired by [OpenAI Swarm](https://github.com/openai/swarm). |
| 36 | + The `agent` keyword creates autonomous AI agents with specific instructions and tool functions. Inspired by [OpenAI Swarm](https://github.com/openai/swarm), AIScript's multi-agent orchestration allows complex AI systems to be defined directly in the language, enabling sophisticated AI workflows with minimal code. |
38 | 37 | codeDemos: |
39 | 38 | - code: | |
40 | 39 | let player1_move = nil; |
|
119 | 118 |
|
120 | 119 | web: |
121 | 120 | - title: Route DSL |
122 | | - description: "Define web routes with a simple and intuitive DSL that supports AI-powered endpoints and type-safe request/response handling." |
| 121 | + description: Define web routes with a simple, intuitive DSL that combines the clarity of RESTful design with AIScript's type system. Routes support AI-powered endpoints, path parameters, and comprehensive request validation without additional middleware. |
123 | 122 | codeDemos: |
124 | 123 | - code: | |
125 | 124 | get /repo { |
|
171 | 170 | } |
172 | 171 | filename: delete.ai |
173 | 172 | - title: Validator |
174 | | - description: "Built-in request validation with type checking and custom validation rules for secure API endpoints." |
| 173 | + description: Built-in request validation with automatic type checking and customizable validation rules. Validators integrate directly with route definitions to ensure API endpoints are secure and robust with minimal boilerplate. |
175 | 174 | codeDemos: |
176 | 175 | - code: | |
177 | 176 | post /api/user { |
|
220 | 219 | User created successfully |
221 | 220 | filename: curl |
222 | 221 | - title: OpenAPI |
223 | | - description: "Automatic OpenAPI documentation generation from your route definitions with full type information and examples." |
| 222 | + description: Automatic OpenAPI documentation generation from route definitions with zero configuration. Documentation includes complete type information, validation rules, and examples derived directly from your code. |
224 | 223 | codeDemos: |
225 | 224 | - code: | |
226 | 225 | post /api/chat { |
|
237 | 236 | - img: /toucan.png |
238 | 237 | filename: openapi.png |
239 | 238 | - title: Effortless Auth and Social Login |
240 | | - description: "Integrate social login providers with minimal configuration and type-safe authentication flows." |
| 239 | + description: Integrate authentication and social login providers with minimal configuration. AIScript's auth decorators handle complex security flows while maintaining type safety throughout the authentication process. |
241 | 240 | codeDemos: |
242 | 241 | - code: | |
243 | 242 | // JWT auth |
|
317 | 316 |
|
318 | 317 | language: |
319 | 318 | - title: Enum |
320 | | - description: "Enums in AIscript provide a way to define a type that can be one of several variants, with full type safety and pattern matching support." |
| 319 | + description: Enums in AIScript provide a type-safe way to define a set of named constants. With full pattern matching support and the ability to associate values with variants, enums help create more expressive and error-resistant code. |
321 | 320 | codeDemos: |
322 | 321 | - code: | |
323 | 322 | enum Status { |
@@ -345,7 +344,7 @@ language: |
345 | 344 | print([Status::Active]); // expect: 1 |
346 | 345 | filename: evaluate_enum.ai |
347 | 346 | - title: Lambda |
348 | | - description: "The lambda syntax allows for concise and expressive function definitions, capturing variables from the outer scope." |
| 347 | + description: Lambda expressions provide concise, flexible function definitions with automatic variable capture from the surrounding scope. AIScript's lambdas support both single-expression and block forms with implicit returns for maximum readability. |
349 | 348 | codeDemos: |
350 | 349 | - code: | |
351 | 350 | // Lambda capturing variables from outer scope |
@@ -379,7 +378,7 @@ language: |
379 | 378 | // expect: 99 |
380 | 379 | filename: implicit_return.ai |
381 | 380 | - title: Pipe Operator |
382 | | - description: "The pipe operator (|>) allows for clean and readable function chaining, making data transformation more intuitive." |
| 381 | + description: The pipe operator (|>) enables clean, readable function chaining for data transformation pipelines. By passing the result of one expression as the first argument to the next function, complex operations become more intuitive and maintainable. |
383 | 382 | codeDemos: |
384 | 383 | - code: | |
385 | 384 | let add_one = |x| x + 1; |
@@ -433,7 +432,7 @@ language: |
433 | 432 | print(result); // expect: [8, 12] |
434 | 433 | filename: compose.ai |
435 | 434 | - title: Error handling |
436 | | - description: "AIscript provides robust error handling with typed errors and elegant error propagation using the raise keyword." |
| 435 | + description: AIScript provides robust error handling with typed errors and elegant propagation mechanics. The raise keyword and the ? operator for error propagation enable type-safe error handling with minimal boilerplate, while error handlers provide flexible recovery options. |
437 | 436 | codeDemos: |
438 | 437 | - code: | |
439 | 438 | // Every enum or class ends with ! is an error type |
@@ -514,7 +513,7 @@ language: |
514 | 513 | print(v); // expect: 999 |
515 | 514 | filename: default_value.ai |
516 | 515 | - title: Class Literal and Validation |
517 | | - description: "AIscript provides robust error handling with typed errors and elegant error propagation using the raise keyword." |
| 516 | + description: AIScript classes combine type definitions with validation rules. Field validators ensure data integrity at runtime, while object literals provide a concise syntax for instantiation with smart defaults and property shorthand notation. |
518 | 517 | codeDemos: |
519 | 518 | - code: | |
520 | 519 | class Person { |
@@ -577,7 +576,7 @@ language: |
577 | 576 |
|
578 | 577 | std-library: |
579 | 578 | - title: Database |
580 | | - description: "Built-in database operations with type-safe queries and migrations support." |
| 579 | + description: Native database operations with type-safe queries and comprehensive drivers for PostgreSQL, SQLite, and Redis. The database modules support transactions, prepared statements, and result mapping to typed objects for type-safe data access. |
581 | 580 | codeDemos: |
582 | 581 | - code: | |
583 | 582 | // Import postgres module from std library |
@@ -634,7 +633,7 @@ std-library: |
634 | 633 | url = "your-redis-url" |
635 | 634 | filename: project.toml |
636 | 635 | - title: Std Library |
637 | | - description: "AIScript provides a wide range of standard library modules for common tasks." |
| 636 | + description: AIScript's standard library provides a comprehensive set of modules for common tasks including serialization, HTTP requests, file handling, cryptography, and more. Each module follows consistent patterns for predictable and reliable behavior. |
638 | 637 | codeDemos: |
639 | 638 | - code: | |
640 | 639 | use std.serde; |
@@ -672,7 +671,7 @@ std-library: |
672 | 671 | let response = http.post("https://api.example.com/users", headers, json_body); |
673 | 672 | filename: http.ai |
674 | 673 | - title: Builtin functions |
675 | | - description: "Rich set of built-in functions for common operations with consistent APIs and type safety." |
| 674 | + description: A rich set of built-in functions for string manipulation, array operations, mathematical calculations, and date handling. These functions integrate seamlessly with the language's type system to provide powerful operations with minimal code. |
676 | 675 | codeDemos: |
677 | 676 | - code: | |
678 | 677 | // String manipulation |
|
0 commit comments