Hoping to make it transpile to C code and self-compiling the compiler. The first version of the compiler might be written in Kotlin.
Trovo il termine "Arte Funzionale" più appropriato rispetto ad arte generativa poiché l'obbiettivo dell'arte funzionale è costruire una funzione che prende uno o più parametri e produce un risultato. Se il risultato è lo stesso per degli stessi parametri (prendiamo in prestito il concetto di funzione pura dalla programmazione) si può considerare l'insieme dei possibili risultati.
Si perde il concetto di opera d'arte in questo genere di arte. Non esiste più una singola rappresentazione visiva associata ad un lavoro (contro come è sempre stato). L'opera è tutti i possibili lavori producibili dalla funzione.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| typedef enum { crocchette, scatolette, tonno } Cibo; | |
| typedef struct { | |
| int id; | |
| int age; | |
| float weight; | |
| Cibo food_type; | |
| } Gatto; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const otherwise = () => true; | |
| const cases = (value, branches) => { | |
| for (let i = 0; i < branches.length; i += 2) { | |
| const predicate = branches[i]; | |
| const action = branches[i + 1]; | |
| if (predicate(value)) { | |
| return action(); |