From 9817d9b99b7d2cffd291841e04af07aadd64c8d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingy=20d=C3=B6t=20Net?= Date: Tue, 18 Jul 2023 13:56:46 -0700 Subject: [PATCH] Add langs Cherrycake and Insitux --- Conf/lang.yaml | 2 ++ Lang/Cherrycake/00-LANG.txt | 3 +++ Lang/Cherrycake/00-META.yaml | 2 ++ Lang/Cherrycake/FizzBuzz | 1 + Lang/Cherrycake/Literals-Integer | 1 + Lang/Insitux/00-LANG.txt | 3 +++ Lang/Insitux/00-META.yaml | 2 ++ Lang/Insitux/A+B | 1 + Lang/Insitux/Apply-a-callback-to-an-array | 1 + Lang/Insitux/Array-concatenation | 1 + Lang/Insitux/Array-length | 1 + Lang/Insitux/Arrays | 1 + Lang/Insitux/Associative-array-Creation | 1 + Lang/Insitux/Deepcopy | 1 + Lang/Insitux/Determine-if-a-string-is-numeric | 1 + Lang/Insitux/Filter | 1 + Lang/Insitux/Hello-world-Text | 1 + Task/A+B/Insitux/a+b.insitux | 2 ++ .../apply-a-callback-to-an-array-1.insitux | 2 ++ .../apply-a-callback-to-an-array-2.insitux | 2 ++ .../apply-a-callback-to-an-array-3.insitux | 2 ++ .../apply-a-callback-to-an-array-4.insitux | 2 ++ .../apply-a-callback-to-an-array-5.insitux | 2 ++ .../Insitux/array-concatenation-1.insitux | 1 + .../Insitux/array-concatenation-2.insitux | 1 + .../Array-length/Insitux/array-length.insitux | 1 + Task/Arrays/Insitux/arrays.insitux | 20 +++++++++++++++++++ .../associative-array-creation-1.insitux | 7 +++++++ .../associative-array-creation-2.insitux | 3 +++ .../associative-array-creation-3.insitux | 3 +++ Task/Deepcopy/Insitux/deepcopy.insitux | 11 ++++++++++ .../determine-if-a-string-is-numeric.insitux | 17 ++++++++++++++++ Task/Filter/Insitux/filter.insitux | 8 ++++++++ Task/FizzBuzz/Cherrycake/fizzbuzz.cherrycake | 20 +++++++++++++++++++ .../Insitux/hello-world-text.insitux | 1 + .../Cherrycake/literals-integer.cherrycake | 3 +++ 36 files changed, 132 insertions(+) create mode 100644 Lang/Cherrycake/00-LANG.txt create mode 100644 Lang/Cherrycake/00-META.yaml create mode 120000 Lang/Cherrycake/FizzBuzz create mode 120000 Lang/Cherrycake/Literals-Integer create mode 100644 Lang/Insitux/00-LANG.txt create mode 100644 Lang/Insitux/00-META.yaml create mode 120000 Lang/Insitux/A+B create mode 120000 Lang/Insitux/Apply-a-callback-to-an-array create mode 120000 Lang/Insitux/Array-concatenation create mode 120000 Lang/Insitux/Array-length create mode 120000 Lang/Insitux/Arrays create mode 120000 Lang/Insitux/Associative-array-Creation create mode 120000 Lang/Insitux/Deepcopy create mode 120000 Lang/Insitux/Determine-if-a-string-is-numeric create mode 120000 Lang/Insitux/Filter create mode 120000 Lang/Insitux/Hello-world-Text create mode 100644 Task/A+B/Insitux/a+b.insitux create mode 100644 Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-1.insitux create mode 100644 Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-2.insitux create mode 100644 Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-3.insitux create mode 100644 Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-4.insitux create mode 100644 Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-5.insitux create mode 100644 Task/Array-concatenation/Insitux/array-concatenation-1.insitux create mode 100644 Task/Array-concatenation/Insitux/array-concatenation-2.insitux create mode 100644 Task/Array-length/Insitux/array-length.insitux create mode 100644 Task/Arrays/Insitux/arrays.insitux create mode 100644 Task/Associative-array-Creation/Insitux/associative-array-creation-1.insitux create mode 100644 Task/Associative-array-Creation/Insitux/associative-array-creation-2.insitux create mode 100644 Task/Associative-array-Creation/Insitux/associative-array-creation-3.insitux create mode 100644 Task/Deepcopy/Insitux/deepcopy.insitux create mode 100644 Task/Determine-if-a-string-is-numeric/Insitux/determine-if-a-string-is-numeric.insitux create mode 100644 Task/Filter/Insitux/filter.insitux create mode 100644 Task/FizzBuzz/Cherrycake/fizzbuzz.cherrycake create mode 100644 Task/Hello-world-Text/Insitux/hello-world-text.insitux create mode 100644 Task/Literals-Integer/Cherrycake/literals-integer.cherrycake diff --git a/Conf/lang.yaml b/Conf/lang.yaml index 556c3865f2..27a023d46c 100644 --- a/Conf/lang.yaml +++ b/Conf/lang.yaml @@ -142,6 +142,7 @@ Ceylon: .ceylon CFEngine: .cfengine Chapel: .chapel Chef: .chef +Cherrycake: .cherrycake Chipmunk Basic: .basic CHR: .chr ChucK: .chuck @@ -350,6 +351,7 @@ Inform 6: '.inf' Inform 7: '.inf' Informix 4GL: .4gl Inko: .inko +Insitux: .insitux Integer BASIC: .basic Intercal: .ical Io: .io diff --git a/Lang/Cherrycake/00-LANG.txt b/Lang/Cherrycake/00-LANG.txt new file mode 100644 index 0000000000..e6fa9465bd --- /dev/null +++ b/Lang/Cherrycake/00-LANG.txt @@ -0,0 +1,3 @@ +{{stub}}{{language|Cherrycake}} + +Cherrycake is a powerful language designed by [https://irishman.cloud Irishman Cloud, Inc.] and standardized by [https://fairfieldprogramming.org The Fairfield Programming Association] with the aim of simplifying the process of building web servers. With a built-in Object-Relational Mapping (ORM), Cherrycake eliminates the need for developers to manually manage database operations, allowing for seamless interaction with horizontally-scaling databases. Cherrycake leverages Ahead-of-Time (AOT) compilation, enabling improved performance and optimizations. \ No newline at end of file diff --git a/Lang/Cherrycake/00-META.yaml b/Lang/Cherrycake/00-META.yaml new file mode 100644 index 0000000000..7466ff1cf2 --- /dev/null +++ b/Lang/Cherrycake/00-META.yaml @@ -0,0 +1,2 @@ +--- +from: http://rosettacode.org/wiki/Category:Cherrycake diff --git a/Lang/Cherrycake/FizzBuzz b/Lang/Cherrycake/FizzBuzz new file mode 120000 index 0000000000..23576ef5a2 --- /dev/null +++ b/Lang/Cherrycake/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Cherrycake \ No newline at end of file diff --git a/Lang/Cherrycake/Literals-Integer b/Lang/Cherrycake/Literals-Integer new file mode 120000 index 0000000000..691bf27426 --- /dev/null +++ b/Lang/Cherrycake/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/Cherrycake \ No newline at end of file diff --git a/Lang/Insitux/00-LANG.txt b/Lang/Insitux/00-LANG.txt new file mode 100644 index 0000000000..d688ce93c7 --- /dev/null +++ b/Lang/Insitux/00-LANG.txt @@ -0,0 +1,3 @@ +{{stub}}{{language|Insitux +|site=https://insitux.github.io}} +{{language programming paradigm|functional}} \ No newline at end of file diff --git a/Lang/Insitux/00-META.yaml b/Lang/Insitux/00-META.yaml new file mode 100644 index 0000000000..d8eee78c60 --- /dev/null +++ b/Lang/Insitux/00-META.yaml @@ -0,0 +1,2 @@ +--- +from: http://rosettacode.org/wiki/Category:Insitux diff --git a/Lang/Insitux/A+B b/Lang/Insitux/A+B new file mode 120000 index 0000000000..3af75d48d3 --- /dev/null +++ b/Lang/Insitux/A+B @@ -0,0 +1 @@ +../../Task/A+B/Insitux \ No newline at end of file diff --git a/Lang/Insitux/Apply-a-callback-to-an-array b/Lang/Insitux/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..db7053fc62 --- /dev/null +++ b/Lang/Insitux/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Insitux \ No newline at end of file diff --git a/Lang/Insitux/Array-concatenation b/Lang/Insitux/Array-concatenation new file mode 120000 index 0000000000..a369cbf173 --- /dev/null +++ b/Lang/Insitux/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Insitux \ No newline at end of file diff --git a/Lang/Insitux/Array-length b/Lang/Insitux/Array-length new file mode 120000 index 0000000000..304f118889 --- /dev/null +++ b/Lang/Insitux/Array-length @@ -0,0 +1 @@ +../../Task/Array-length/Insitux \ No newline at end of file diff --git a/Lang/Insitux/Arrays b/Lang/Insitux/Arrays new file mode 120000 index 0000000000..5248b0c419 --- /dev/null +++ b/Lang/Insitux/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Insitux \ No newline at end of file diff --git a/Lang/Insitux/Associative-array-Creation b/Lang/Insitux/Associative-array-Creation new file mode 120000 index 0000000000..d3a0fa1c2a --- /dev/null +++ b/Lang/Insitux/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Insitux \ No newline at end of file diff --git a/Lang/Insitux/Deepcopy b/Lang/Insitux/Deepcopy new file mode 120000 index 0000000000..7f2b64d45e --- /dev/null +++ b/Lang/Insitux/Deepcopy @@ -0,0 +1 @@ +../../Task/Deepcopy/Insitux \ No newline at end of file diff --git a/Lang/Insitux/Determine-if-a-string-is-numeric b/Lang/Insitux/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..2d1b8ee5b4 --- /dev/null +++ b/Lang/Insitux/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Insitux \ No newline at end of file diff --git a/Lang/Insitux/Filter b/Lang/Insitux/Filter new file mode 120000 index 0000000000..57af3071f5 --- /dev/null +++ b/Lang/Insitux/Filter @@ -0,0 +1 @@ +../../Task/Filter/Insitux \ No newline at end of file diff --git a/Lang/Insitux/Hello-world-Text b/Lang/Insitux/Hello-world-Text new file mode 120000 index 0000000000..b23e6b05be --- /dev/null +++ b/Lang/Insitux/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Insitux \ No newline at end of file diff --git a/Task/A+B/Insitux/a+b.insitux b/Task/A+B/Insitux/a+b.insitux new file mode 100644 index 0000000000..c34aaa0b98 --- /dev/null +++ b/Task/A+B/Insitux/a+b.insitux @@ -0,0 +1,2 @@ +(+ (to-num (prompt "Enter first number: ")) + (to-num (prompt "Enter second number: "))) diff --git a/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-1.insitux b/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-1.insitux new file mode 100644 index 0000000000..afbaba2fda --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-1.insitux @@ -0,0 +1,2 @@ +; apply a named function +(map inc [1 2 3 4]) diff --git a/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-2.insitux b/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-2.insitux new file mode 100644 index 0000000000..41fa852b28 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-2.insitux @@ -0,0 +1,2 @@ +; apply a parameterised closure +(map (fn x (+ x 1)) [1 2 3 4]) diff --git a/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-3.insitux b/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-3.insitux new file mode 100644 index 0000000000..c0e80caa73 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-3.insitux @@ -0,0 +1,2 @@ +; apply a non-parameterised closure +(map #(+ % 1) [1 2 3 4]) diff --git a/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-4.insitux b/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-4.insitux new file mode 100644 index 0000000000..585c345e11 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-4.insitux @@ -0,0 +1,2 @@ +; apply an explicit partial closure +(map @(+ 1) [1 2 3 4]) diff --git a/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-5.insitux b/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-5.insitux new file mode 100644 index 0000000000..6c0ae345c6 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Insitux/apply-a-callback-to-an-array-5.insitux @@ -0,0 +1,2 @@ +; apply an implicit partial closure +(map (+ 1) [1 2 3 4]) diff --git a/Task/Array-concatenation/Insitux/array-concatenation-1.insitux b/Task/Array-concatenation/Insitux/array-concatenation-1.insitux new file mode 100644 index 0000000000..724722093d --- /dev/null +++ b/Task/Array-concatenation/Insitux/array-concatenation-1.insitux @@ -0,0 +1 @@ +(into [1 2 3] [4 5 6]) diff --git a/Task/Array-concatenation/Insitux/array-concatenation-2.insitux b/Task/Array-concatenation/Insitux/array-concatenation-2.insitux new file mode 100644 index 0000000000..cc2e16cb66 --- /dev/null +++ b/Task/Array-concatenation/Insitux/array-concatenation-2.insitux @@ -0,0 +1 @@ +(.. vec [1 2 3] [4 5 6]) diff --git a/Task/Array-length/Insitux/array-length.insitux b/Task/Array-length/Insitux/array-length.insitux new file mode 100644 index 0000000000..3903efe3e4 --- /dev/null +++ b/Task/Array-length/Insitux/array-length.insitux @@ -0,0 +1 @@ +(len ['apple' 'orange']) diff --git a/Task/Arrays/Insitux/arrays.insitux b/Task/Arrays/Insitux/arrays.insitux new file mode 100644 index 0000000000..6ae68dd00b --- /dev/null +++ b/Task/Arrays/Insitux/arrays.insitux @@ -0,0 +1,20 @@ +> (var my-list [1 2 3 4 5]) ;syntactic sugar +[1 2 3 4 5] + +> (var my-list (vec 1 2 3 4 5)) +[1 2 3 4 5] + +> my-list +[1 2 3 4 5] + +> (3 my-list) ;fourth element +4 + +> (-1 my-list) ;last element +5 + +> (append my-list 100) +[1 2 3 4 5 100] + +> my-list ;variables are immutable so my-list cannot be changed without being redefined +[1 2 3 4 5] diff --git a/Task/Associative-array-Creation/Insitux/associative-array-creation-1.insitux b/Task/Associative-array-Creation/Insitux/associative-array-creation-1.insitux new file mode 100644 index 0000000000..490220ca0f --- /dev/null +++ b/Task/Associative-array-Creation/Insitux/associative-array-creation-1.insitux @@ -0,0 +1,7 @@ +{ + :a "value" ;keyword key, string value + :b 123 ;keyword key, number value + 456 [1 2 3] ;number key, vector value + [5 6 7] :b ;vector key, keyword value + {:a 1} {:b 2} ;dictionary key, dictionary value +} diff --git a/Task/Associative-array-Creation/Insitux/associative-array-creation-2.insitux b/Task/Associative-array-Creation/Insitux/associative-array-creation-2.insitux new file mode 100644 index 0000000000..2111ca23a5 --- /dev/null +++ b/Task/Associative-array-Creation/Insitux/associative-array-creation-2.insitux @@ -0,0 +1,3 @@ +;use dictionary as function for lookup; commas for readability, treated as white-space +> ({:a 1, :b 2, :c 3} :b) +2 diff --git a/Task/Associative-array-Creation/Insitux/associative-array-creation-3.insitux b/Task/Associative-array-Creation/Insitux/associative-array-creation-3.insitux new file mode 100644 index 0000000000..7b5e2f8a03 --- /dev/null +++ b/Task/Associative-array-Creation/Insitux/associative-array-creation-3.insitux @@ -0,0 +1,3 @@ +;extend existing dictionary by using it as a function with two arguments +> ({:a 1, :b 2, :c 3} :b 3) +{:a 1, :b 3, :c 3} diff --git a/Task/Deepcopy/Insitux/deepcopy.insitux b/Task/Deepcopy/Insitux/deepcopy.insitux new file mode 100644 index 0000000000..50abb7ee23 --- /dev/null +++ b/Task/Deepcopy/Insitux/deepcopy.insitux @@ -0,0 +1,11 @@ +> (var x [1 2 [3 4]]) +[1 2 [3 4]] + +> (var y x) +[1 2 [3 4]] + +> (var x "something else") +something else + +> y +[1 2 [3 4]] diff --git a/Task/Determine-if-a-string-is-numeric/Insitux/determine-if-a-string-is-numeric.insitux b/Task/Determine-if-a-string-is-numeric/Insitux/determine-if-a-string-is-numeric.insitux new file mode 100644 index 0000000000..5fa6108cc6 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Insitux/determine-if-a-string-is-numeric.insitux @@ -0,0 +1,17 @@ +> (var numeric? (comp to-num bool)) +(comp to-num bool) + +> (numeric? "123") +true + +> (numeric? "0x25") +true + +> (numeric? "0b0101") +true + +> (numeric? "hello") +false + +> (numeric? "123x456") +false diff --git a/Task/Filter/Insitux/filter.insitux b/Task/Filter/Insitux/filter.insitux new file mode 100644 index 0000000000..21b3fcd35e --- /dev/null +++ b/Task/Filter/Insitux/filter.insitux @@ -0,0 +1,8 @@ +> (filter even? [0 1 2 3 4]) +[0 2 4] + +> (var x [0 1 2 3 4]) +[0 1 2 3 4] + +> (var! x (filter even?)) ;replaces variable x by applying implicit closure +[0 2 4] diff --git a/Task/FizzBuzz/Cherrycake/fizzbuzz.cherrycake b/Task/FizzBuzz/Cherrycake/fizzbuzz.cherrycake new file mode 100644 index 0000000000..f40c93d980 --- /dev/null +++ b/Task/FizzBuzz/Cherrycake/fizzbuzz.cherrycake @@ -0,0 +1,20 @@ +# Route with custom number of iterations +cached get ~/:n { + + # Get the Number of Iterations from the URL Params + int n = req.params.n || 100 + + # Loop through each iteration + for (i in range(n)) { + + if (i % 2 == 0 && i % 3 == 0) { res.write("FizzBuzz\n") continue } + if (i % 2 == 0) { res.write("Fizz\n"); continue; } + if (i % 3 == 0) { res.write("Buzz\n"); continue; } + res.write(i + "\n"); + + } + + # Close the connection + res.end(); + +} diff --git a/Task/Hello-world-Text/Insitux/hello-world-text.insitux b/Task/Hello-world-Text/Insitux/hello-world-text.insitux new file mode 100644 index 0000000000..7a8ecc850e --- /dev/null +++ b/Task/Hello-world-Text/Insitux/hello-world-text.insitux @@ -0,0 +1 @@ +(print "Hello, world!") diff --git a/Task/Literals-Integer/Cherrycake/literals-integer.cherrycake b/Task/Literals-Integer/Cherrycake/literals-integer.cherrycake new file mode 100644 index 0000000000..620381e349 --- /dev/null +++ b/Task/Literals-Integer/Cherrycake/literals-integer.cherrycake @@ -0,0 +1,3 @@ +515142 # Interpretted as an integer, 515142 +0b10111011 # Interpretted as a binary integer, 10111011 (187) +0x0AB3 # Interpretted as a binary integer, 0AB3 (2739)