1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
# AtLang @
## Overview
**AtLang** is a work-in-progress (WIP) compiled, CIL-based language intended as a learning tool. It is **not recommended** for production scenarios.
Despite its simple syntax, AtLang can perform significant operations with a single method. For example, spinning up a static file HTTP server requires only a single command: `@startServer(...)`.
The compiler is developed in C# using .NET 9's IL assembly writing capabilities. A Visual Studio Code extension providing syntax highlighting is also [available](https://marketplace.visualstudio.com/items?itemName=richardsondev.atlang).
---
## Getting Started
1. **Build the Compiler**
Navigate to the `compiler/` directory and build the project:
```bash
dotnet build AtLangCompiler.csproj
```
2. **Move to the Output Directory**
After building, switch to the folder containing the compiled artifacts.
3. **Compile Your AtLang Program**
```bash
dotnet AtLangCompiler.dll your_program.at
```
4. **Run the Generated Program**
```bash
dotnet your_program.exe
```
---
## Features
1. **String Variable Assignment**
```plaintext
@GREETING = "Hello World"
```
2. **String Conditionals**
```plaintext
@if(@GREETING == "Hello World") {
@print("Hi")
} @else {
@print("Bye")
}
```
3. **String Concatenation**
```plaintext
@print(@GREETING + @GREETING)
```
4. **Environment Variable Reading**
```plaintext
@NAME = @getEnv(@USERNAME)
```
5. **Static Web Server**
```plaintext
@SERVER_ROOT_PATH = "./server_files"
@SERVER_PORT = "8081"
@startServer(@SERVER_ROOT_PATH, @SERVER_PORT)
```
6. **HTTP GET**
```plaintext
@IPURL = "https://ip.billywr.com/ip.txt"
@IP = @getWeb(@IPURL)
@IPTEXT = "Your IP is "
@print(@IPTEXT + @IP)
```
7. **HTTP POST**
```plaintext
@IPURL = "https://ip.billywr.com/ip.txt"
@POSTDATA = "[]"
@IP = @postWeb(@IPURL, @POSTDATA)
@IPTEXT = "POST response: "
@print(@IPTEXT + @IP)
```
---
## Examples
Explore the `./samples` folder for complete sample programs ready to compile and run.
---
## Roadmap
1. **Self-Contained EXE Generation**
2. **Asynchronous Operations**
3. **Enhanced VS Code Extension Features**
---
## License
This project is licensed under the [MIT License](./LICENSE), which grants permission for personal and commercial use, modification, distribution, and private use, with attribution. By using this software, you agree to the terms outlined in the license. For more details, please refer to the [LICENSE](./LICENSE) file.
---
## Contributing
Contributions are welcomed. Whether you're fixing a bug, adding a new feature, or improving documentation, your efforts make a difference.
### How to Contribute:
1. **Report Issues:** If you encounter a bug or have suggestions for improvement, please create an issue in the [GitHub repository](https://github.com/richardsondev/atlang/issues).
2. **Submit Pull Requests:** Fork the repository, make your changes, and submit a pull request for review. Be sure to follow any contribution guidelines outlined in the repository.
3. **Join Discussions:** Engage with other contributors and maintainers by participating in discussions in issues or pull requests.
### Guidelines:
- Ensure your code follows the project's style and testing guidelines.
- Include clear and concise commit messages to help maintainers understand your changes.
- Be respectful and collaborative in your interactions with others.
|