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 you can see how you can define an if statement or booleans behavior directly in Capric-Io;
$ gem install capricc-io
Run REPL:
capio
or run file:
capio your_code.cio
Prototypes & OOP:
# comment
set("person", Object clone)
person set("name", "Max")
person name print
# => Max
person set("say_name", def(
arguments print
# => <Message @name="hello...">
eval_arg(0) print
# => hello...
self name print
# => Max
))
person say_name("hello...")
Conditions:
if(true,
"condition is true" print,
"nope" print
)
# => condition is true
if(false,
"nope" print,
"condition is false" print
)
# => condition is false
Booleans:
"yo" or("hi") print
# => yo
nil or("hi") print
# => hi
"yo" and("hi") print
# => hi
1 and(2 or(3)) print
# => 2
To build and run this app locally you will need a few things:
- Install Ruby (tested on 2.6);
- Clone the repository
git clone --depth=1 https://github.com/maxbarsukov/capricc-io.git
- Install dependencies
cd capricc-io
bundle install
- Run
./bin/capriccio input.cio
# or
./bin/capriccio
- RSpec
bundle exec rspec
- Rubocop
bundle exec rubocop
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.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Capricc-Io project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.