pikt

所属分类:collect
开发工具:kotlin
文件大小:0KB
下载次数:0
上传日期:2023-07-20 19:49:27
上 传 者sh-1993
说明:  基于图像的诗歌编程语言。,
(Image-based poetic programming language.,)

文件列表:
CONTRIBUTING.md (3015, 2023-12-03)
LICENSE (32509, 2023-12-03)
core/ (0, 2023-12-03)
core/pom.xml (3559, 2023-12-03)
core/src/ (0, 2023-12-03)
core/src/main/ (0, 2023-12-03)
core/src/main/kotlin/ (0, 2023-12-03)
core/src/main/kotlin/eu/ (0, 2023-12-03)
core/src/main/kotlin/eu/iamgio/ (0, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/ (0, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/GlobalSettings.kt (738, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/Pikt.kt (6157, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/ (0, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/CliCommandsUtils.kt (2204, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/Command.kt (755, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/Commands.kt (1834, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/ (0, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/CreateSchemeCommand.kt (1440, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/DownloadCompilerCommand.kt (1146, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/ExportSchemeCommand.kt (1381, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/HelpCommand.kt (3174, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/PixelLoggerCommand.kt (1064, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/SettingsCommands.kt (1017, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/StringConvertCommand.kt (2255, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/WelcomeCommand.kt (1178, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ (0, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ChainOutputCommand.kt (607, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ColorSwapCommand.kt (1132, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/CompactCommand.kt (1177, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/DecompactCommand.kt (802, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ImageOutputCommand.kt (695, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ImageProcessingCommands.kt (2194, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/MaskCommand.kt (1353, 2023-12-03)
core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/RecolorizeCommand.kt (1636, 2023-12-03)
... ...

Banner Banner
Download


> _Ah a language to code by while listening to Pink Floyd_ - a guy from Reddit > _This looks like it belongs on the list of those things I totally want to do if I ever become immortal_ - another guy from Reddit ---
Pikt is a pixel-based, dynamically typed, Turing complete esoteric programming language able to generate fast and lightweight programs out of **aesthetically pleasant image sources**. Indeed, Pikt's most interesting feature is **flexibility**: every keyword, statement, function and operator is linked to one - or more - color, easily customizable via [color schemes](https://github.com/iamgio/pikt/blob/master/core/src/main/resources/colors.properties).


Video

Pikt compiles executables via the Kotlin compiler, therefore compilation for both JVM and native* targets is available, along with runtime interpretation. > Want to create your first Pikt program? **Check out the [wiki](https://github.com/iamgio/pikt/blob/master/https://github.com/iAmGio/pikt/wiki)**!


Fibonacci
A high-performance Fibonacci sequence algorithm.

Prime numbers
A prime numbers algorithm.

FizzBuzz
A FizzBuzz algorithm.

Insertion sort
An insertion sort algorithm.

Reverser
A string reverser.

Tree
A tree that prints "A tree!".

These examples take advantage of [custom color schemes](https://github.com/iamgio/pikt/blob/master/core/src/test/resources/schemes). Click on the examples for a breakdown/explanation.
> **[How does Pikt work?](https://github.com/iamgio/pikt/blob/master/https://github.com/iAmGio/pikt/wiki/How-does-Pikt-work%3F)**
## Table of contents - [Properties](https://github.com/iamgio/pikt/blob/master/#properties) - [Settings arguments](https://github.com/iamgio/pikt/blob/master/#properties) - [Command arguments](https://github.com/iamgio/pikt/blob/master/#command-arguments) - [Building](https://github.com/iamgio/pikt/blob/master/#building) - [Roadmap](https://github.com/iamgio/pikt/blob/master/#roadmap) ## Properties The following properties define parameters needed by Pikt to run. Syntax: `java -Dproperty=value -jar pikt.jar -arguments`. - `-Dsource` source image file; - `-Doutput` output name without extension. Defaults to the value of `source` if not specified; - `-Dcolors` path to the `.properties` color scheme without extension. Default values will be used if not specified (not recommended); - `-Dtargets` compilation targets divided by a comma. Only `jvm` is supported, while `windows`, `osx` and `linux` compilation is currently disabled. - `-Dlib` path to JAR libraries, including the bundled `stdlib.jar` file, divided by a comma. If not specified, points by default to `./libraries/stdlib.jar`; - `-Djvmcompiler` path to the Kotlin/JVM (`kotlinc`) executable compiler. Required if `target` contains `jvm` or if `-interpret` is used; - `-Dproject` optional path to a [project info](https://github.com/iamgio/pikt/blob/master/https://github.com/iAmGio/pikt/wiki/Project-info-file) YAML configuration. - `-Dtask` optional [task](https://github.com/iamgio/pikt/blob/master/(https://github.com/iAmGio/pikt/wiki/Project-info-file)) name (defined within a project info configuration) to be executed. ## Settings arguments The following arguments enable settings that affect Pikt's behavior. - `-interpret` runs the generated code via the JVM compiler; - `-printoutput` displays the generated Kotlin code; - `-nocompile` prevents the generation of any executable file; - `-pixelinfo` adds information about pixel coordinates to the output code as comments; - `-imgoutput=path` sets the output file for image-generating commands (see below). If not specified, defaults to the source image path followed by a suffix; - `-chainoutput` enables output chaining for image-generating commands: the output of a command becomes the input for the next one. It requires `-imgoutput` to be set. - `-pl[=type]` sets the active pixel logger type. A pixel logger is responsible for printing pixels on screen, for example in case of compile-time errors. Available types: `none`, `16`, `256`, `rgb`, `box`. If `type` is not specified, `256` is used.
Click to see more... - `none`: pixel logging is disabled (default). none - `16`: each pixel is a square whose color is approximated to the closest ANSI 16 color. 16 - `256`: each pixel is a square whose color is approximated to the closest ANSI 8-bit (256) color. 256 - `rgb`: each pixel is a square with its RGB color. Not all terminals support this. rgb - `box`: each pixel is an ASCII box with its hex code inside. box
## Command arguments The following arguments execute tasks and exit when completed. These are handy shortcuts that replace several manual actions, such as image transformations, while being unrelated to code generation and compilation. - `-downloadcompiler=type[,version]` downloads the zipped Kotlin compiler for the given platform (`jvm`, `windows`, `macos`, `linux`). `version` defaults to `1.9.21`. - `-createscheme` creates a new [color scheme](https://github.com/iamgio/pikt/blob/master/core/src/main/resources/colors.properties) with default values. It automatically appends library colors too, e.g. the [stdlib scheme](https://github.com/iamgio/pikt/blob/master/stdlib/src/main/resources/colors.properties), loaded from `-Dlib`; - `-exportscheme` generates a useful color palette image out of the given color scheme; - `-recolorize[=method]` creates a copy of the source image (that relies on the default scheme) and adapts it to a custom scheme (specified by `-Dcolors`). `method` defines the way properties with more than one color are handled; it can be either `first` (default), `last` or `random`; - `-standardize` creates a copy of the source image (that relies on a custom scheme) and adapts it to the default scheme; - `-compact[=size]` creates a compacted copy of the source image with no whitespaces between pixels. If `size` is not specified, it will try to create a square-ish image. `size` can be defined via `w?h?`, where both `w`and `h` are optional (in case one is missing, it will be calculated the same way as before) (e.g. `w10h5`, `w10`, `h5`); - `-decompact` creates a decompacted copy of the source image with one statement per line; - `-standardecompact` runs `-standardize` + `-decompact`; - `-colorswap=` swaps colors from the source image. `swaps` is defined as `from1:to1,from2:to2,...` where `from` and `to` are hexadecimal colors; - `-mask=path` creates a masked copy of the source image, loading the mask image from `path`; - `-strconvert[=string]` converts a string into a sequence of RGB (grayscale) values supported by Pikt and prints them out. If `string` is not specified, input is read from stdin. _See [Hello world!](https://github.com/iamgio/pikt/blob/master/https://github.com/iAmGio/pikt/wiki/Hello-world) for further information._ For instance, `-strconvert="Hello Pikt!"` prints: ``` RGB: 72 101 108 108 111 32 80 105 107 116 33 H e l l o P i k t ! ``` - `-welcome` runs `-createscheme`, `-exportscheme` (both on `colors`), `-downloadcompiler=jvm` and creates a ready-to-use Hello World source. Its output is already zipped in the downloadable archive; - `-help` shows these commands. More in-depth information about image transformation commands can be found [here](https://github.com/iamgio/pikt/blob/master/https://github.com/iAmGio/pikt/wiki/Image-transformation-commands). ## Building The [downloadable archive](https://github.com/iamgio/pikt/blob/master/#begin) is already built off the latest GitHub commit. If you wish to build it yourself from source simply run `mvn clean install`. > **Tip:** setting your run configuration to execute `mvn clean install -pl stdlib -am` compiles the standard library before launching Pikt, in case you need to make frequent updates to it. If you are using IntelliJ IDEA consider importing configuration templates from the [runConfigurations](https://github.com/iamgio/pikt/blob/master/runConfigurations) folder. ## Roadmap **Code** - [x] Variables - [ ] Constants - [x] Function calls (both as part of expressions and standalone) - [x] Function definition - [x] If / else / if else - [x] Lambdas (code blocks) - [x] Operators (equality, logical and arithmetic) - [x] Loops - [x] For-each - [x] Indexed for (for-each + `range` function) - [x] While - [ ] Try/catch - [x] Structs - [x] [Standard library](https://github.com/iamgio/pikt/blob/master/stdlib) (work in progress, see [CONTRIBUTING](https://github.com/iamgio/pikt/blob/master/CONTRIBUTING.md) for contribution guidelines) - [x] External libraries support (following certain standards, wiki in progress) **Generation** - [x] Compilation (JVM ~~and Native~~*) - [x] Interpretation (JVM) - [x] Error handling - [ ] Runtime information _* Native support is limited due to the lack of Kotlin/Native libraries and is being temporarily discontinued. Bringing it back is planned in the long term._

近期下载者

相关文件


收藏者