Add langs Cherrycake and Insitux

This commit is contained in:
Ingy döt Net 2023-07-18 13:56:46 -07:00
parent 633b36288a
commit 9817d9b99b
36 changed files with 132 additions and 0 deletions

View File

@ -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

View File

@ -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.

View File

@ -0,0 +1,2 @@
---
from: http://rosettacode.org/wiki/Category:Cherrycake

1
Lang/Cherrycake/FizzBuzz Symbolic link
View File

@ -0,0 +1 @@
../../Task/FizzBuzz/Cherrycake

View File

@ -0,0 +1 @@
../../Task/Literals-Integer/Cherrycake

3
Lang/Insitux/00-LANG.txt Normal file
View File

@ -0,0 +1,3 @@
{{stub}}{{language|Insitux
|site=https://insitux.github.io}}
{{language programming paradigm|functional}}

View File

@ -0,0 +1,2 @@
---
from: http://rosettacode.org/wiki/Category:Insitux

1
Lang/Insitux/A+B Symbolic link
View File

@ -0,0 +1 @@
../../Task/A+B/Insitux

View File

@ -0,0 +1 @@
../../Task/Apply-a-callback-to-an-array/Insitux

View File

@ -0,0 +1 @@
../../Task/Array-concatenation/Insitux

1
Lang/Insitux/Array-length Symbolic link
View File

@ -0,0 +1 @@
../../Task/Array-length/Insitux

1
Lang/Insitux/Arrays Symbolic link
View File

@ -0,0 +1 @@
../../Task/Arrays/Insitux

View File

@ -0,0 +1 @@
../../Task/Associative-array-Creation/Insitux

1
Lang/Insitux/Deepcopy Symbolic link
View File

@ -0,0 +1 @@
../../Task/Deepcopy/Insitux

View File

@ -0,0 +1 @@
../../Task/Determine-if-a-string-is-numeric/Insitux

1
Lang/Insitux/Filter Symbolic link
View File

@ -0,0 +1 @@
../../Task/Filter/Insitux

View File

@ -0,0 +1 @@
../../Task/Hello-world-Text/Insitux

View File

@ -0,0 +1,2 @@
(+ (to-num (prompt "Enter first number: "))
(to-num (prompt "Enter second number: ")))

View File

@ -0,0 +1,2 @@
; apply a named function
(map inc [1 2 3 4])

View File

@ -0,0 +1,2 @@
; apply a parameterised closure
(map (fn x (+ x 1)) [1 2 3 4])

View File

@ -0,0 +1,2 @@
; apply a non-parameterised closure
(map #(+ % 1) [1 2 3 4])

View File

@ -0,0 +1,2 @@
; apply an explicit partial closure
(map @(+ 1) [1 2 3 4])

View File

@ -0,0 +1,2 @@
; apply an implicit partial closure
(map (+ 1) [1 2 3 4])

View File

@ -0,0 +1 @@
(into [1 2 3] [4 5 6])

View File

@ -0,0 +1 @@
(.. vec [1 2 3] [4 5 6])

View File

@ -0,0 +1 @@
(len ['apple' 'orange'])

View File

@ -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]

View File

@ -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
}

View File

@ -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

View File

@ -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}

View File

@ -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]]

View File

@ -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

View File

@ -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]

View File

@ -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();
}

View File

@ -0,0 +1 @@
(print "Hello, world!")

View File

@ -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)