Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xNaCly/Sophia
Lisp like embeddable scripting language.
https://github.com/xNaCly/Sophia
Last synced: 9 days ago
JSON representation
Lisp like embeddable scripting language.
- Host: GitHub
- URL: https://github.com/xNaCly/Sophia
- Owner: xNaCly
- Created: 2023-07-12T12:51:12.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-19T14:47:05.000Z (11 months ago)
- Last Synced: 2023-12-19T15:19:07.741Z (11 months ago)
- Language: Go
- Homepage: https://xnacly.github.io/Sophia/
- Size: 296 KB
- Stars: 20
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sophia
My take on a small lisp like embeddable programming language with go
interoperability.View the docs containing an overview, an in depth overview and a lot of
Examples [here](https://xnacly.github.io/Sophia/)```lisp
(let arr 1 2 3 4 5)(fun square [n] (* n n))
(map (square) arr) ;; [1 4 9 16 25](filter
(lambda [n]
(= (% n 2) 0)) arr) ;; [2 4](let person {
array: [1 2 3]
bank: {
institute: {
name: "western union"
}
}
})
(println person#["array"][0]) ;; 1
(println person#["bank"]["institute"]["name"]) ;; "western union"(let name "anon")
(println 'Hello {name}!')
```## Try
### Running
```bash
git clone https://github.com/xnacly/sophia
go build
```With a file:
```text
$ sophia ./examples/helloworld.phiaHello World!
```With an expression:
```
$ sophia -exp '(println "Hello World")'Hello World!
``````
$ echo '(println "Hello World")' | sophiaHello World!
```As a repl:
```
$ sophia██████ ▒█████ ██▓███ ██░ ██ ██▓ ▄▄▄
▒██ ▒ ▒██▒ ██▒▓██░ ██▒▓██░ ██▒▓██▒▒████▄
░ ▓██▄ ▒██░ ██▒▓██░ ██▓▒▒██▀▀██░▒██▒▒██ ▀█▄
▒ ██▒▒██ ██░▒██▄█▓▒ ▒░▓█ ░██ ░██░░██▄▄▄▄██
▒██████▒▒░ ████▓▒░▒██▒ ░ ░░▓█▒░██▓░██░ ▓█ ▓██▒
▒ ▒▓▒ ▒ ░░ ▒░▒░▒░ ▒▓▒░ ░ ░ ▒ ░░▒░▒░▓ ▒▒ ▓▒█░
░ ░▒ ░ ░ ░ ▒ ▒░ ░▒ ░ ▒ ░▒░ ░ ▒ ░ ▒ ▒▒ ░
░ ░ ░ ░ ░ ░ ▒ ░░ ░ ░░ ░ ▒ ░ ░ ▒
░ ░ ░ ░ ░ ░ ░ ░ ░Welcome to the Sophia programming language repl - press or to quit...
sophia> (let person { name: "user" })
= [user]
sophia> (println "Hello World," person#["name"] ":)")
Hello World, user :)
= []
sophia>
```