https://github.com/maxbarsukov/capricc-io
π₯ Extremely minimalistic Io-like language
https://github.com/maxbarsukov/capricc-io
homoiconic interpreter io-lang programming-language prototype ruby-interpreter
Last synced: 2 months ago
JSON representation
π₯ Extremely minimalistic Io-like language
- Host: GitHub
- URL: https://github.com/maxbarsukov/capricc-io
- Owner: maxbarsukov
- License: mit
- Created: 2022-01-04T17:29:42.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-04T20:17:11.000Z (over 3 years ago)
- Last Synced: 2024-04-23T23:47:09.008Z (about 1 year ago)
- Topics: homoiconic, interpreter, io-lang, programming-language, prototype, ruby-interpreter
- Language: Ruby
- Homepage: https://rubygems.org/gems/capricc-io
- Size: 24.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Capricc-Io
[](https://github.com/maxbarsukov/capricc-io/actions/workflows/main.yml)
[](https://codecov.io/gh/maxbarsukov/capricc-io)

***Capricc-Io*** is a tiny interpreted *prototyped-based* **homoiconic** and dynamic typing language with ***Io-like messages***.
- **Everything** is an **object** in *Capricc-Io*;
- Program is just a **series of messages**;
- Objects donβt have classes, but **prototypes**, their parent objects;
- Messages are the only data type and also parsing representation β ***homoiconicity***;In [lib/capriccio/stdlib](https://github.com/maxbarsukov/capricc-io/tree/master/lib/capriccio/stdlib) you can see how you can define an **if** statement or **booleans** behavior directly in *Capric-Io*;
## Installation
$ gem install capricc-io
## Usage
Run REPL:
```bash
capio
```or run file:
```bash
capio your_code.cio
```## Examples of code
Prototypes & OOP:
```python
# commentset("person", Object clone)
person set("name", "Max")
person name print
# => Maxperson set("say_name", def(
arguments print
# =>eval_arg(0) print
# => hello...self name print
# => Max
))person say_name("hello...")
```Conditions:
```python
if(true,
"condition is true" print,
"nope" print
)
# => condition is trueif(false,
"nope" print,
"condition is false" print
)
# => condition is false
```Booleans:
```python
"yo" or("hi") print
# => yonil or("hi") print
# => hi"yo" and("hi") print
# => hi1 and(2 or(3)) print
# => 2
```## Building
### Pre-reqs
To build and run this app locally you will need a few things:
- Install [Ruby](https://www.ruby-lang.org/en/) *(tested on **2.6**)*;
### Getting start
- Clone the repository
```bash
git clone --depth=1 https://github.com/maxbarsukov/capricc-io.git
```
- **Install dependencies**
```bash
cd capricc-io
bundle install
```
- **Run**
```bash
./bin/capriccio input.cio
# or
./bin/capriccio
````
- **RSpec**
```bash
bundle exec rspec
```
- **Rubocop**
```bash
bundle exec rubocop
```## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/maxbarsukov/capricc-io. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/maxbarsukov/capricc-io/blob/master/CODE_OF_CONDUCT.md).
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## Code of Conduct
Everyone interacting in the Capricc-Io project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/maxbarsukov/capricc-io/blob/master/CODE_OF_CONDUCT.md).