https://github.com/solarisstudio/piccodescript
A simple functional scripting language created in java
https://github.com/solarisstudio/piccodescript
compiler functional functional-programming interpreter java jvm jvm-languages language script scripting-language
Last synced: 23 days ago
JSON representation
A simple functional scripting language created in java
- Host: GitHub
- URL: https://github.com/solarisstudio/piccodescript
- Owner: SolarisStudio
- License: mit
- Created: 2025-05-23T08:31:36.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-09-28T08:57:11.000Z (23 days ago)
- Last Synced: 2025-09-28T10:27:01.031Z (23 days ago)
- Topics: compiler, functional, functional-programming, interpreter, java, jvm, jvm-languages, language, script, scripting-language
- Language: Java
- Homepage: http://piccodescript.fly.dev/
- Size: 960 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PiccodeScript
> A simple interpreted, functional programming language.
[](https://github.com/Glimmr-Lang/PiccodeScript/actions/workflows/maven.yml)
## Why?
PiccodeScript started as a dsl for an image editor (Picasso Code) I was building, and overtime
I fell in love with the simple syntax and I wanted to make to its own project, possibly for
embedding in my java programs or for general scripting.## Installation
You can download binary releases from the Official website or visit the file server to find previous versions.
##### Latest
- [Official Release](http://piccodescript.fly.dev/)
##### Previous releases
- [Release Server](https://picasso-releases.fly.dev/piccodescript/)
## Build From Source
- Step 1 - Clone the repo.
```sh
$ git clone git@github.com:Glimmr-Lang/PiccodeScript.git
```- Step 2 - Enter inside the dir.
```sh
$ cd PiccodeScript
```- Step 3 - Run the build script.
```sh
$ ./all.sh
```## Documentation
- [Standard library reference](https://piccodescriptdocs.fly.dev/)# Example
###### Hello World
```js
import std.iomain :: () = IO::println("Hello, world")
```###### Factorial
```js
import std.iofact :: (x=1) =
when x {
is 0 -> 1
is 1 -> 1
else -> x * fact(x - 1)
}result := fact(5)
IO::println(result)
```## Embedding API
To use the language in your project simply add it your `pom.xml` file as a dependency:
```xml
jitpack.io
https://jitpack.io
com.github.Glimmr-Lang
PiccodeScript
Tag```
#### Note replace `Tag` with a release tag from the [releases](https://github.com/Glimmr-Lang/PiccodeScript/releases) page.and then add the following code to your solution:
```java
Compiler
.compile("zero :: () = 0")
.execute(null);
```If you want to get a list of AST nodes do this:
```java
Compiler.prepareGlobalScope();
List nodes = Compiler.parse(input);// Then you can execute them or do what you want
for (var expr: nodes) {
expr.execute();
}
```To add symbols to the current scope you can do the following:
```java
Context.top.putLocal("hello", new PiccodeString("Hello, world"));Compiler.compile("hello + 20"); // concate hello, world and 20
```## Inspired by
- [Lua](https://www.lua.org/) - The simplicity
- [Rust](https://www.rust-lang.org/) - The flexibility
- [SML](https://www.smlnj.org/sml.html) - Functional programming concepts
- [Java](https://www.java.com/en/) - Threading model