Skip to content

Commit 836a007

Browse files
committed
Improve wordings
1 parent 4ff1aef commit 836a007

File tree

4 files changed

+36
-37
lines changed

4 files changed

+36
-37
lines changed

docs/std/db/pg.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ let users = pg.query("SELECT * FROM users WHERE age > $1", 18);
150150

151151
// Iterate through results
152152
for user in users {
153-
println(user.name);
153+
print(user.name);
154154
}
155155
```
156156

@@ -189,7 +189,7 @@ let users = pg.query_as(User, "SELECT * FROM users WHERE active = true");
189189

190190
// Access typed properties
191191
for user in users {
192-
println(`${user.name} <${user.email}>`);
192+
print(`${user.name} <${user.email}>`);
193193
}
194194
```
195195

docs/std/http.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ use std.http;
2525
// Simple GET request
2626
let response = http.get("https://api.example.com/users");
2727
if (response.ok) {
28-
println(response.json);
28+
print(response.json);
2929
} else {
30-
println(`Error: ${response.status} ${response.statusText}`);
30+
print(`Error: ${response.status} ${response.statusText}`);
3131
}
3232

3333
// GET request with headers
@@ -63,9 +63,9 @@ let response = http.post(
6363
);
6464

6565
if (response.ok) {
66-
println(`User created with ID: ${response.json.id}`);
66+
print(`User created with ID: ${response.json.id}`);
6767
} else {
68-
println(`Error: ${response.status} ${response.statusText}`);
68+
print(`Error: ${response.status} ${response.statusText}`);
6969
}
7070
```
7171

@@ -95,9 +95,9 @@ let response = http.put(
9595
);
9696

9797
if (response.ok) {
98-
println("User updated successfully");
98+
print("User updated successfully");
9999
} else {
100-
println(`Error: ${response.status} ${response.statusText}`);
100+
print(`Error: ${response.status} ${response.statusText}`);
101101
}
102102
```
103103

@@ -124,9 +124,9 @@ let response = http.delete(
124124
);
125125

126126
if (response.ok) {
127-
println("User deleted successfully");
127+
print("User deleted successfully");
128128
} else {
129-
println(`Error: ${response.status} ${response.statusText}`);
129+
print(`Error: ${response.status} ${response.statusText}`);
130130
}
131131
```
132132

@@ -156,9 +156,9 @@ let response = http.patch(
156156
);
157157

158158
if (response.ok) {
159-
println("User partially updated successfully");
159+
print("User partially updated successfully");
160160
} else {
161-
println(`Error: ${response.status} ${response.statusText}`);
161+
print(`Error: ${response.status} ${response.statusText}`);
162162
}
163163
```
164164

@@ -180,10 +180,10 @@ use std.http;
180180
let response = http.head("https://api.example.com/users/123");
181181

182182
if (response.ok) {
183-
println("Resource exists");
184-
println(`Last-Modified: ${response.headers["last-modified"]}`);
183+
print("Resource exists");
184+
print(`Last-Modified: ${response.headers["last-modified"]}`);
185185
} else {
186-
println("Resource not found");
186+
print("Resource not found");
187187
}
188188
```
189189

@@ -199,10 +199,10 @@ if (response.ok) {
199199
// Access parsed JSON directly
200200
let items = response.json.items;
201201
for (item in items) {
202-
println(`${item.id}: ${item.name}`);
202+
print(`${item.id}: ${item.name}`);
203203
}
204204
} else {
205-
println(`Failed to fetch data: ${response.status}`);
205+
print(`Failed to fetch data: ${response.status}`);
206206
}
207207
```
208208

@@ -233,7 +233,7 @@ fn authenticated_request(url, method, body = nil) {
233233

234234
// Use the function
235235
let user_data = authenticated_request("https://api.example.com/me", "GET");
236-
println(user_data.json);
236+
print(user_data.json);
237237
```
238238

239239
## Submitting Form Data
@@ -251,8 +251,8 @@ let response = http.post(
251251
);
252252
253253
if (response.ok) {
254-
println("Form submitted successfully");
254+
print("Form submitted successfully");
255255
} else {
256-
println(`Form submission failed: ${response.text}`);
256+
print(`Form submission failed: ${response.text}`);
257257
}
258258
```

docs/std/serde.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Parses a JSON string and converts it into an AIScript value.
2020
```rust
2121
use std.serde;
2222

23-
let json = '{"name": "John", "age": 30}';
23+
let json = "{\"name\": \"John\", \"age\": 30}";
2424
let data = serde.from_str(json);
2525
print(data.name); // Outputs: John
2626
```

theme/components/Landingpage/features.yaml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ai:
22
- 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.
44
codeDemos:
55
- code: |
66
// Simple prompt usage
@@ -17,7 +17,7 @@ ai:
1717
print(detailed_answer);
1818
filename: prompt.ai
1919
- 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.
2121
codeDemos:
2222
- code: |
2323
// Define an AI function for sentiment analysis
@@ -33,8 +33,7 @@ ai:
3333
filename: ai_function.ai
3434
- title: Agent
3535
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.
3837
codeDemos:
3938
- code: |
4039
let player1_move = nil;
@@ -119,7 +118,7 @@ ai:
119118
120119
web:
121120
- 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.
123122
codeDemos:
124123
- code: |
125124
get /repo {
@@ -171,7 +170,7 @@ web:
171170
}
172171
filename: delete.ai
173172
- 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.
175174
codeDemos:
176175
- code: |
177176
post /api/user {
@@ -220,7 +219,7 @@ web:
220219
User created successfully
221220
filename: curl
222221
- 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.
224223
codeDemos:
225224
- code: |
226225
post /api/chat {
@@ -237,7 +236,7 @@ web:
237236
- img: /toucan.png
238237
filename: openapi.png
239238
- 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.
241240
codeDemos:
242241
- code: |
243242
// JWT auth
@@ -317,7 +316,7 @@ web:
317316
318317
language:
319318
- 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.
321320
codeDemos:
322321
- code: |
323322
enum Status {
@@ -345,7 +344,7 @@ language:
345344
print([Status::Active]); // expect: 1
346345
filename: evaluate_enum.ai
347346
- 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.
349348
codeDemos:
350349
- code: |
351350
// Lambda capturing variables from outer scope
@@ -379,7 +378,7 @@ language:
379378
// expect: 99
380379
filename: implicit_return.ai
381380
- 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.
383382
codeDemos:
384383
- code: |
385384
let add_one = |x| x + 1;
@@ -433,7 +432,7 @@ language:
433432
print(result); // expect: [8, 12]
434433
filename: compose.ai
435434
- 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.
437436
codeDemos:
438437
- code: |
439438
// Every enum or class ends with ! is an error type
@@ -514,7 +513,7 @@ language:
514513
print(v); // expect: 999
515514
filename: default_value.ai
516515
- 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.
518517
codeDemos:
519518
- code: |
520519
class Person {
@@ -577,7 +576,7 @@ language:
577576
578577
std-library:
579578
- 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.
581580
codeDemos:
582581
- code: |
583582
// Import postgres module from std library
@@ -634,7 +633,7 @@ std-library:
634633
url = "your-redis-url"
635634
filename: project.toml
636635
- 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.
638637
codeDemos:
639638
- code: |
640639
use std.serde;
@@ -672,7 +671,7 @@ std-library:
672671
let response = http.post("https://api.example.com/users", headers, json_body);
673672
filename: http.ai
674673
- 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.
676675
codeDemos:
677676
- code: |
678677
// String manipulation

0 commit comments

Comments
 (0)