You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/getting-started/introduction.md
+21-19Lines changed: 21 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,33 +1,35 @@
1
1
# Introduction
2
2
3
-
AIScript is a combination of interpreter programming language and web framework both written in Rust dedicated to help people build AI applications effortlessly. The language syntax learn from Python, JavaScript and Rust, combine its good parts and designed to be easy to learn and use.
3
+
AIScript is a unique combination of interpreter programming language and web framework, both written in Rust, designed to help developers build AI applications effortlessly. The language syntax draws inspiration from Python, JavaScript, and Rust, combining their strengths to create something that's intuitive, powerful, and easy to use.
4
4
5
5
:::warning
6
-
`AIScript` is in early development, please do not use it in production yet.
6
+
`AIScript` is in early development. Please do not use it in production yet.
7
7
:::
8
8
9
9
## Programming Language
10
10
11
-
As a programming language, AIScript write it interpreter from scratch.
11
+
As a programming language, AIScript is built with a custom interpreter from the ground up:
12
12
13
-
-Function is the firstclass citizen and object oriented programming paradigm
14
-
-Builtin AI primitive, including prompt, ai function, and agent
15
-
- Dynamic typing with limited static type checking
16
-
-Buitlin data validation like Python's [Pydantic](https://docs.pydantic.dev/latest/)
17
-
- Simple and elegant error handling, inspired from Rust, Golang and Zig
18
-
- Rich standard library backed by Rust's standard library and ecosystems underneath
19
-
-Garbage collection
13
+
-Functions are first-class citizens with support for object-oriented programming paradigms
14
+
-Built-in AI primitives, including prompt, AI functions, and agent capabilities
15
+
- Dynamic typing system with targeted static type checking for improved safety
16
+
-Built-in data validation similar to Python's [Pydantic](https://docs.pydantic.dev/latest/)
17
+
- Simple yet powerful error handling, inspired by Rust, Go, and Zig
18
+
- Rich standard library leveraging Rust's ecosystem underneath
19
+
-Automatic garbage collection for memory management
20
20
21
21
## Web Framework
22
22
23
-
- Elegant and intuitive route DSL
24
-
- Auto params validation
25
-
- Auto generate OpenAPI schema and docs
26
-
- Backed by Rust's best practices, use [axum](https://github.com/tokio-rs/axum) and [sqlx](https://github.com/launchbadge/sqlx) underneath,
27
-
- Rust's axum performance but with Python's flask-like syntax
28
-
- Buitlin database modules ([`std.db.pg`](/std/db/pg) and [`std.db.redis`](/std/db/redis))
29
-
- Buitlin auth and social login
30
-
- Battery-included features with simple configuration to enable them
23
+
AIScript isn't just a language—it's a complete web development solution:
24
+
25
+
- Elegant and intuitive route DSL for defining endpoints
26
+
- Automatic parameter validation with clear error messages
27
+
- Automatic OpenAPI schema and documentation generation
28
+
- Built on Rust's best practices, using [axum](https://github.com/tokio-rs/axum) and [sqlx](https://github.com/launchbadge/sqlx) under the hood
29
+
- Combines Rust's axum performance with Python's Flask-like simplicity
30
+
- Built-in database modules ([`std.db.pg`](/std/db/pg) and [`std.db.redis`](/std/db/redis))
31
+
- Built-in authentication and social login capabilities
32
+
- Battery-included features easily enabled through simple configuration
31
33
32
34
## How AIScript works
33
35
@@ -74,6 +76,6 @@ $ curl http://localhost:8000?question=What is the capital of France?
74
76
}
75
77
```
76
78
77
-
You can open [http://localhost:8080/redoc](http://localhost:8080/redoc) to see the API docs.
79
+
You can open [http://localhost:8080/redoc](http://localhost:8080/redoc) to see the automatically generated API documentation.
AIScript is my experimental project to explore a new way to build web application in AI era. It isn't an oh-another-language built by a guy who just want to learn how to write an interpreter. My ambient is bigger than that.
5
+
AIScript is an experimental project exploring a new approach to building web applications in the AI era. This isn't just anotherlanguage created by someone learning interpreter design—my ambition is much greater.
6
6
7
-
Not matter what language you use to build web API, you need a web framework. These web framework essentially does the same thing. They all parse HTTP requests, execute SQL queries, and response the result with JSON or render HTML templates. Some framework can do more, validating request params, generate OpenAPI spec, etc. However, different framworks from different languages have totally different develope experience to build an web app. When you switch from one to another, you can't escape to learn the syntax and docs again. That why I want to adopt an brand-new intuitive apporach combine language with web framework to bring the modern experience to build web apps.
7
+
Regardless of which language you use to build web APIs, you need a web framework. These frameworks essentially perform the same functions: parsing HTTP requests, executing database queries, and returning results as JSON or rendered HTML. Some frameworks offer additional features like request validation or OpenAPI spec generation. However, frameworks across different languages provide vastly different development experiences. Switching between them inevitably requires learning new syntax and documentation. That's why I wanted to create an intuitive approach that combines language with web framework to deliver a modern experience for building web applications.
8
8
9
-
## Intuitive first
9
+

10
10
11
-
What I want is write a code like this to run a web API with single command, no need to learn a new web framework, no need to struggle choose which framework to use, no need to install the dependencies to run. Just run `aiscript serve`.
11
+
## Intuitive First
12
+
13
+
My vision is to write code that runs a web API with a single command—no need to learn a new framework, struggle with choosing which one to use, or install dependencies to run it. Just execute `aiscript serve` and you're up and running.
12
14
13
15
<Tabs>
14
16
<Tablabel="route.ai">
@@ -45,11 +47,11 @@ $ curl -X GET http://localhost:8080/guess?n=999
45
47
</Tab>
46
48
</Tabs>
47
49
48
-
Here are just a small poart of cool ideas come to my brain. I always seek for it if someone already built it. But I cannot find one, so I decided to build one.
50
+
This is just a small part of the ideas that have come to mind. I've searched to see if someone has already built something similar, but finding nothing, I decided to build it myself.
49
51
50
-
## Out-of-box first
52
+
## Out-of-box First
51
53
52
-
When build a web app, almost the rest besides the core business logic is the same. How can I support JWT authentication? How to integrate Google or GitHub login? How to query database or validate data? For those reraly changed standard, I wish it built into the language or framework, give me an out-of-box experience.
54
+
When building a web app, most components beyond the core business logic are standard across projects. How do you implement JWT authentication? How do you integrate Google or GitHub login? How do you query databases or validate data? For these rarely changing standards, I believe they should be built directly into the language or framework, providing an out-of-box experience.
53
55
54
56
<Tabs>
55
57
<Tablabel="jwt_auth.ai">
@@ -146,17 +148,15 @@ scopes = ["email"]
146
148
</Tab>
147
149
</Tabs>
148
150
149
-
## AI first
150
-
151
-
People we'll ask:
151
+
## AI First
152
152
153
-
:::info
154
-
"Do we really need a new programming language in the age AI can write code for us?".
153
+
:::info People often ask
154
+
"Do we really need a new programming language in an age when AI can write code for us?".
155
155
:::
156
156
157
-
In my own opionion, I think yes, at least for web application.
157
+
In my opinion, for web applications at least, the answer is yes.
158
158
159
-
In the one hand, most of mainstream language designed two-decades ago, `prompt`, `agent`isn't a primitive features in the language, it is in AIScript. Your don't need to install a package to call LLM API or orchestrate multiple agents.
159
+
Most mainstream languages were designed decades ago—features like `prompt` and `agent`aren't primitives in these languages, but they are in AIScript. You don't need to install packages to call LLM APIs or orchestrate multiple agents.
160
160
161
161
<Tabs>
162
162
<Tablabel="prompt.ai">
@@ -201,32 +201,32 @@ api_key = "YOUR_API_KEY"
201
201
</Tab>
202
202
</Tabs>
203
203
204
-
In the other hands, many features is out-of-box and batter-included in the standard library. It's helpful for AI code generation.
204
+
Additionally, AIScript includes many out-of-box features in its standard library, which is particularly helpful for AI code generation.
205
205
206
-
:::info Thought on AI code generation era
206
+
:::info Thoughts on the AI Code Generation Era
207
207
208
-
#### Building web app is not that easy
208
+
#### Building Web Apps Is Not That Easy
209
209
210
-
- Solid coding experience is required, from programming languages to web frameworks and libraries. You need a lot of hands-on experience to build software with confidence.
210
+
- Solid coding experience is still required, from programming languages to web frameworks and libraries. You need substantial hands-on experience to build software with confidence.
211
211
212
-
- Even though AI code generation is pretty helpful, you still need expertise in coding if you're not going to build a toy project.
212
+
- Even with AI code generation, you still need expertise if you're building anything beyond a toy project.
213
213
214
-
- Finishing the code is just the beginning; deploying, observability, security, there are a bunch of things waiting for you. AI is not that helpful for these right now.
214
+
- Finishing the code is just the beginning; deployment, observability, and security present additional challenges that current AI tools don't fully address.
215
215
216
216
#### Code Generation: Just the Tip of the Iceberg
217
217
218
-
- For any serious piece of software that makes it to production, 80% or more of the cost is in the phase after initial development. That's the phase called Day-2 operations.
218
+
- For any serious production software, 80% or more of the cost comes after initial development—in what's called "Day-2 operations."
219
219
220
220
- Day-2 operations present the biggest challenges.
221
221
222
-
-Can Cursor and WindSurf solve the deployment problem, make the whole Day-2 easy and effortless? No, I don't think so, neither can Devin.
222
+
-Tools like Cursor, WindSurf, or even Devin can't fully solve deployment problems or make Day-2 operations effortless.
223
223
224
224
:::
225
225
226
226
227
-
## Best practice first
227
+
## Best Practice First
228
228
229
-
I hope I don't need to learn serveral methods to compare and figure out which one is the best practice. What I hope I only need one solution which is the best practice, free myself from such a choose struggeling.
229
+
Developers shouldn't need to learn several approaches to the same problem just to determine which is best. Ideally, there should be one solution representing best practices, freeing you from decision paralysis.
230
230
231
-
AIScript choose Rust's best practice of web developement, and encapsulate those best practices into the language and framework.
231
+
AIScript adopts Rust's web development best practices and encapsulates them directly into the language and framework, letting you focus on what matters most—your application's unique value.
0 commit comments