https://github.com/hf/q
A simple programming language.
https://github.com/hf/q
Last synced: about 1 year ago
JSON representation
A simple programming language.
- Host: GitHub
- URL: https://github.com/hf/q
- Owner: hf
- License: mit
- Created: 2014-02-28T18:24:34.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-04-04T19:56:57.000Z (over 12 years ago)
- Last Synced: 2025-04-12T10:41:38.049Z (about 1 year ago)
- Language: Ruby
- Size: 152 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
Q - a simple programming language
/ Q Q Q Q
Q Q
Q Q Q Q Q
Q
Q
Install the gem from RubyGems:
$ gem install ql
Then you can use the small `q' runner to run your .q files:
$ q examples/factorial.q
Example syntax:
# assignment
a <: 10;
b <: 11;
# operations
a <: 3 + 5;
a <: a = b;
a <: a < b;
a <: b > a;
# functions
# @ refers to the current function
# every function returns @ by default
# unless you assign @ another value
factorial <: (n){
if [n < 2] then [@ <: 1] else [@ <: n * @(n - 1)];
};
tenth_factorial <: factorial(10);
This language is an experiment and parts of it were presented at
MKRUG (http://ruby.mk).
This software is licensed under the MIT/X11 license and is
Copyright (C) 2014 Stojan Dimitrovski. See LICENSE for more details.