1
1
# OwnLang
2
2
3
3
[ ![ Build Status] ( https://travis-ci.org/aNNiMON/Own-Programming-Language-Tutorial.svg?branch=latest )] ( https://travis-ci.org/aNNiMON/Own-Programming-Language-Tutorial )
4
- [ ![ SonarCloud Status] ( https://sonarcloud.io/api/project_badges/measure?project=aNNiMON_Own-Programming-Language-Tutorial&metric=alert_status )] ( https://sonarcloud.io/dashboard?id=aNNiMON_Own-Programming-Language-Tutorial )
5
- [ ![ SonarCloud Quality Gate] ( https://sonarcloud.io/api/project_badges/measure?project=aNNiMON_Own-Programming-Language-Tutorial&metric=sqale_rating )] ( https://sonarcloud.io/dashboard/?id=aNNiMON_Own-Programming-Language-Tutorial )
4
+
5
+ OwnLang - dynamic functional programming language inspired by Scala and Python. Available for PC, Android and Java ME devices.
6
+
7
+ ## Installing
6
8
7
9
| Free | Pro | Desktop |
8
10
| :--: | :-: | :-----: |
9
- | [ ![ Free] ( https://developer.android.com/images/brand/en_generic_rgb_wo_45.png )] ( https://play.google.com/store/apps/details?id=com.annimon.ownlang.free ) | [ ![ Pro] ( https://developer.android.com/images/brand/en_generic_rgb_wo_45.png )] ( https://play.google.com/store/apps/details?id=com.annimon.ownlang ) | [ v1.3 .0] ( https://github.com/aNNiMON/Own-Programming-Language-Tutorial/releases/tag/v1.3 .0 )
11
+ | [ ![ Free] ( https://developer.android.com/images/brand/en_generic_rgb_wo_45.png )] ( https://play.google.com/store/apps/details?id=com.annimon.ownlang.free ) | [ ![ Pro] ( https://developer.android.com/images/brand/en_generic_rgb_wo_45.png )] ( https://play.google.com/store/apps/details?id=com.annimon.ownlang ) | [ v1.4 .0] ( https://github.com/aNNiMON/Own-Programming-Language-Tutorial/releases/tag/v1.4 .0 )
10
12
11
- OwnLang - dynamic functional programming language inspired by Scala and Python. Available for PC, Android and Java ME devices.
13
+ Also available as AUR package:
14
+
15
+ ```
16
+ yay -S ownlang
17
+ ```
12
18
13
19
## Key features
14
20
@@ -61,8 +67,7 @@ def fizzbuzz(limit = 100) {
61
67
Operate data in functional style.
62
68
63
69
``` scala
64
- use " std"
65
- use " functional"
70
+ use [" std" , " functional" ]
66
71
67
72
nums = [1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ]
68
73
nums = filter(nums, def (x) = x % 2 == 0 )
@@ -72,18 +77,21 @@ foreach(squares, ::echo)
72
77
// Sum of squares
73
78
sum = reduce(squares, 0 , def (x, y) = x + y)
74
79
println " Sum: " + sum
80
+ // Same using stream
81
+ println " Sum: " + stream(range(1 , 11 ))
82
+ .filter(def (x) = x % 2 == 0 )
83
+ .map(def (x) = x * x)
84
+ .reduce(0 , def (x, y) = x + y)
75
85
```
76
86
77
87
#### Operator overloading
78
88
79
89
Why not?
80
90
81
91
``` scala
82
- use " std"
83
- use " types"
84
- use " math"
92
+ use [" std" , " types" , " math" ]
85
93
86
- def `..` (a, b) = range(a, b - 1 )
94
+ def `..` (a, b) = range(a, b)
87
95
def `**` (a, b) = int(pow(a, b))
88
96
for y : 1 .. 10 {
89
97
println sprintf(" 2 ^ %d = %d" , y, 2 ** y)
@@ -130,8 +138,6 @@ def patch_callback(v) {
130
138
131
139
Build using Gradle ` ./gradlew dist `
132
140
133
- or Ant ` ant clean pack `
134
-
135
141
or take a look to [ latest release] ( https://github.com/aNNiMON/Own-Programming-Language-Tutorial/releases/latest ) for binaries.
136
142
137
143
0 commit comments