Language: English 切换至中文
Kalang is a static type-safe language base on jvm with flexible syntax.
- Powerful scripting mode
- Auto type
- Dependency manager integration
- Static type-safe
- Flexible syntax
- Compatible with other jvm-based languages like java,groovy and so on.
wget -O kalang-compiler-1.10.0.tar http://search.maven.org/remotecontent?filepath=site/kason/kalang/kalang-compiler/1.10.0/kalang-compiler-1.10.0.tar
tar -xvf kalang-compiler-1.10.0.tar
ln -s `pwd`/kalang-compiler-1.10.0/bin/kalangc /usr/local/bin/kalangc
ln -s `pwd`/kalang-compiler-1.10.0/bin/kalangsh /usr/local/bin/kalangsh
ln -s `pwd`/kalang-compiler-1.10.0/bin/kalangeditor /usr/local/bin/kalangeditor
- Download the latest binary distribution:http://search.maven.org/remotecontent?filepath=site/kason/kalang/kalang-compiler/1.10.0/kalang-compiler-1.10.0.zip
- Unzip the downloaded zip file
- Add the absolute path of the
bin
directory to thePATH
environment variable
Linux:
- Use
#!/usr/bin/env kalangsh
as the first line of your kalang script file. - Use
chmod +x
to make the file executable.
Windows:
Run the following commands in Command Prompt(cmd.exe)
assoc .kls=KalangScript
ftype KalangScript=kalangsh.bat "%1" %*
Created the file named hello.kls
with the follow content:
println("Hello,world!");
Then run in the terminal:
kalangsh hello.kls
See Syntax
kalangsh YOUR_SCRIPT_FILE YOUR_SCRIPT_ARGUMENTS
kalangc SOURCE_FILE
For example:kalangc Helloworld.kl
would compile Helloworld.kl
in the current directory.
kalangsh --help
kalangc --help
kalangeditor --help
You can declare you dependencies in kalang scripts.Kalang shell will resolve the dependencies and download the related files automatically when executing.
For example:
#repository http://maven.aliyun.com/nexus/content/groups/public/
#dependency site.kason:color-console:1.0.0
import site.kason.colorconsole.ColorConsole;
var console = ColorConsole.getDefault();
console.info("Hello,world!");
Requirements:
- jdk8
Clone the source,and run
./gradlew build
- dbutil - database utilities
- ksh - script helpers
- fhc - A http client library with fluent api
- kailer - a mailer
- color-console - make output in console colorful
#IDE/Editor plugin support
- Intellij Idea : intellij-kalang
- Visual Studio Code : kalang-support-for-vscode (only syntax highlighting)
- NetBeans : kalang-nb-support
MIT
please visit http://kalang.kason.site for more information.