Install
IDE
- Search 'sric-language' in vscode marketplace, install it.
- Configure sricHome to point to the sric directory (the parent directory of bin).
After configuring, restart VSCode. If features such as Go to Definition, Auto Completion, and Outline View are available, it means the configuration was successful. If you recompile the Sric source code, you need to close VSCode first.
Hello World
-
Create an empty folder as the workspace
-
Create a file named main.sric with the following content:
import cstd::*;
fun main(): Int {
printf("Hello World\n");
return 0;
}
- Create a module.scm file with the following content:
name = hello
summary = hello
outType = exe
version = 1.0
depends = sric 1.0, cstd 1.0
srcDirs = ./
- Build
sric module.scm -fmake
build debug mode:
sric module.scm -fmake -debug
- Run
After compilation, the console will print the output file path. Run it with quotes. For example:
'C:\Users\xxx\fmakeRepo\msvc\test-1.0-debug\bin\test'
Build by fmake
The build process without -fmake solely outputs C++ code (under "sric/output").
sric hello.scm
Then compile it separately by manually running fmake:
fan fmake output/hello.fmake -debug
Debug
Debugging the generated C++ code is supported via IDE project generation.
fan fmake output/hello.fmake -debug -G
The generated project files are located in the build folder under the parent directory.