C* is a block-based programming language where commands are written in quotes. Inspired by HolyC by Terry Davis.
curl -sSL https://raw.githubusercontent.com/insanityvrr-dot/cstar/main/install.sh | bashDownload install.bat from the Releases page,
then right-click > Run as Administrator. It will build C* and add it to your PATH.
Linux:
git clone https://github.com/insanityvrr-dot/cstar.git
cd cstar
makeWindows (requires MinGW-w64 in PATH):
git clone https://github.com/insanityvrr-dot/cstar.git
cd cstar
build.batStarcommandv1 <file.star> # Run a .star file
Starcommandv1 -e "print Hi" # Execute inline
Starcommandv1 -i # Interactive REPL
Starcommandv1 -l <file.star> # Show tokens
Starcommandv1 -p <file.star> # Show AST
Starcommandv1 -v # Version
Starcommandv1 -h # Help{
"print Hello World"
"echo This is a shell command"
}
Each command is a quoted string that performs one action:
{
"print Hello World"
"echo Current user"
"ls -la"
}
Multiple commands on one line separated by commas:
{
"print Hello", "print World"
"echo First", "echo Second"
}
After a command, indent for sub-commands or parameters:
{
"print Hello"
("print This is a sub-command")
}
Double indent in parentheses for time, color, or sub-commands:
{
"print Starting..."
("await-(1s)")
"print Done!"
}
Wait for specified duration:
{
"print Starting..."
"await-(1s)"
"print 1 second later"
"await-(500ms)"
"print 500 milliseconds later"
"await-(2m)"
"print 2 minutes later"
}
{
"set x = 10"
"set name = C* Language"
"print Value: {x}"
"print Name: {name}"
}
Execute system commands directly:
{
"shell pwd"
"shell whoami"
"shell ls -la"
"shell uname -a"
}
print <text>- Print to consoleawait-<duration>- Wait (1s, 500ms, 2m, 1h)set <name> = <value>- Set variableshell <command>- Execute shell commandtype <value>- Get typelen <value>- Get length
{
"set name = World"
"print Hello, {name}!"
}
{
"set x = 10"
"if x > 5"
("print x is large")
"else"
("print x is small")
"while x > 0"
("print {x}")
("set x = x - 1")
}
{
"func greet(name)"
("print Hello, {name}!")
"greet(World)"
}
{
"class Person"
("init(name) { this.name = name }")
("greet() { return \"Hi, I am {this.name}\" }")
"set p = Person(Alice)"
"print {p.greet()}"
}
See the examples/ directory:
hello.star- Hello Worldtiming.star- Delay/timing featuresshell.star- Shell commandsvariables.star- Variable usagefib.star- Fibonacci sequencecalculator.star- Calculatorclasses.star- Object-oriented programmingaudio.star- Play audio via shell
C* programs use the .star file extension.
- A C++17 compiler (g++ recommended)
- Linux, macOS, or Windows (MinGW-w64)
C* Language - Version 1.0.0 (Starcommandv1)