technetium
所属分类:编程语言基础
开发工具:Rust
文件大小:0KB
下载次数:0
上传日期:2023-01-20 23:43:55
上 传 者:
sh-1993
说明: 锝编程语言
(The Technetium Programming Language)
文件列表:
.nojekyll (0, 2022-11-24)
Cargo.lock (38133, 2022-11-24)
Cargo.toml (1205, 2022-11-24)
build_docs.sh (297, 2022-11-24)
changelog (62, 2022-11-24)
contributing (10380, 2022-11-24)
coverage.sh (574, 2022-11-24)
crates/ (0, 2022-11-24)
crates/compile/ (0, 2022-11-24)
crates/compile/Cargo.lock (27978, 2022-11-24)
crates/compile/Cargo.toml (509, 2022-11-24)
crates/compile/build.rs (75, 2022-11-24)
crates/compile/src/ (0, 2022-11-24)
crates/compile/src/ast.rs (22012, 2022-11-24)
crates/compile/src/error.rs (1036, 2022-11-24)
crates/compile/src/lib.rs (29794, 2022-11-24)
crates/compile/src/script.lalrpop (14160, 2022-11-24)
crates/core/ (0, 2022-11-24)
crates/core/logging.rs (766, 2022-11-24)
crates/core/main.rs (10218, 2022-11-24)
crates/lexer/ (0, 2022-11-24)
crates/lexer/Cargo.toml (198, 2022-11-24)
crates/lexer/src/ (0, 2022-11-24)
crates/lexer/src/error.rs (5801, 2022-11-24)
crates/lexer/src/lib.rs (23477, 2022-11-24)
crates/mlrefcell/ (0, 2022-11-24)
crates/mlrefcell/Cargo.lock (366, 2022-11-24)
crates/mlrefcell/Cargo.toml (150, 2022-11-24)
crates/mlrefcell/src/ (0, 2022-11-24)
crates/mlrefcell/src/lib.rs (5832, 2022-11-24)
crates/runtime/ (0, 2022-11-24)
crates/runtime/Cargo.lock (27978, 2022-11-24)
crates/runtime/Cargo.toml (549, 2022-11-24)
... ...
# Technetium
![Rust](https://github.com/Torrencem/technetium/workflows/Rust/badge.svg?event=push)
_technetium_ (or _tech_) is a scripting language with easy access to the shell.
[Documentation can be found here](https://matthewtorrence.com/technetium/)
## Installation
To install, setup cargo and rust, and then use the command ``cargo install --path .`` in the main directory to install the ``tech`` binary. You can also copy the ``scripts/tcmake`` script into your path to be able to use the ``tcmake`` command (relies on ``tech``).
## Examples
### Creating some files
```coffeescript
for letter in ['A', 'B', 'C', 'D'] {
name = ("file_" + letter).escape()
println(~"Creating file {name}")
$ echo "{name}" > {name}.txt
}
```
### Creating an index of files in the current directory
```coffeescript
# Run "ls" on the command line, blocking, and get the standard output
files = sh("ls").stdout()
for line in files.lines() { # For each line in the string
# Append the line to index.txt
$ echo {line} >> index.txt
}
```
### Complicated Environment Capturing
```coffeescript
func create_counter() {
value = 1
# Return an anonymous function that increments and returns "value"
return \() -> value++
}
c1 = create_counter()
println(c1()) # 1
c2 = create_counter()
println(c1()) # 2
println(c2()) # 1
println(c1()) # 3
```
### Countdown timer
```coffeescript
# Read the first command line argument as an integer
count = int(args()[0])
while count {
# Print a message and return to the beginning
# of the line with a carriage return
printr(~"{count--}s remaining ")
# Wait for 1 second
$ sleep 1
}
println()
```
### Sync Files Between Two Directories
```coffeescript
for file in stale(["dir_A/**/*"]) {
# Find the path to the file within dir_A
relative_path = strip_path_prefix(canonicalize(file), canonicalize("dir_A"))
# Copy this file into dir_B
$ cp {file} dir_B/{relative_path}
}
```
近期下载者:
相关文件:
收藏者: