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: README.md
+77-2Lines changed: 77 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,82 @@ Start the interactive TechScript prompt to test out commands line-by-line:
53
53
tech repl
54
54
```
55
55
56
+
## Language Overview & Examples
57
+
58
+
TechScript (`.txs`) reads like English and supports modern features out of the box.
59
+
60
+
```python
61
+
# Variables
62
+
name ="Alice"
63
+
age =30
64
+
const PI=3.14159
65
+
66
+
# Output & Input
67
+
say "Hello!"
68
+
say f"Name: {name}, Age: {age}"
69
+
answer = ask "What's your name? "
70
+
71
+
# Control flow
72
+
if age >=18:
73
+
say "Adult"
74
+
elif age >=13:
75
+
say "Teen"
76
+
else:
77
+
say "Child"
78
+
79
+
# Loops
80
+
for i in1..=10:
81
+
say i
82
+
83
+
while age >0:
84
+
age -=1
85
+
86
+
# Functions
87
+
fn greet(name, greeting="Hello"):
88
+
say f"{greeting}, {name}!"
89
+
90
+
greet("Bob")
91
+
92
+
# Classes
93
+
classDog:
94
+
fn init(self, name):
95
+
self.name = name
96
+
fn speak(self):
97
+
say f"{self.name} says Woof!"
98
+
99
+
rex = Dog("Rex")
100
+
rex.speak()
101
+
102
+
# Pipe operator (functional style)
103
+
"hello world"|> upper |> say
104
+
105
+
# List methods
106
+
[1, 2, 3].map((x) => x *2).filter((x) => x >3)
107
+
108
+
# Error handling
109
+
try:
110
+
throw "something went wrong"
111
+
catch err:
112
+
say err
113
+
```
114
+
56
115
## Documentation & Learning
57
116
58
-
-**[Language Documentation](docs/)**: Explore the `docs/` folder for a deep dive into the language features, standard library, and architecture.
59
-
-**[Examples](examples/)**: Check out the `examples/` directory for ready-to-use snippets demonstrating loops, functions, variables, and more basics to get you started quickly!
117
+
-**[Language Specification](docs/TECHSCRIPT_SPEC.md)**: Complete language spec with EBNF grammar.
118
+
-**[200 Keyword Reference](docs/TECHSCRIPT_REFERENCE.md)**: All keywords, functions, and methods.
119
+
-**[User Guide](docs/TECHSCRIPT_GUIDE.md)**: Beginner-friendly getting started guide.
120
+
-**[Example Programs](docs/TECHSCRIPT_EXAMPLES.md)**: 15 complete example programs.
121
+
-**[Build Guide (Lexer/Parser)](docs/TECHSCRIPT_BUILD.md)**: How the interpreter works internally.
122
+
-**[Build Guide (Interpreter)](docs/TECHSCRIPT_BUILD_2.md)**: Evaluator, CLI, REPL, and packaging details.
123
+
124
+
You can find ready-to-use `.txs` files in the **[examples/](examples/)** directory!
125
+
126
+
## License
127
+
128
+
TechScript is released under the MIT License. See [LICENSE](LICENSE) for details.
129
+
130
+
---
131
+
132
+
<palign="center">
133
+
<strong>Made with 🐉 by the TechScript Team</strong>
0 commit comments