Category:Wren: Difference between revisions
Added link to Wren-gmp module. |
m Clarification |
||
(33 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
It is under development on [https://github.com/wren-lang/wren GitHub] and is fully documented [http://wren.io/ here]. |
It is under development on [https://github.com/wren-lang/wren GitHub] and is fully documented [http://wren.io/ here]. |
||
The CLI tool (Wren CLI) has its own repository and is the main focus of examples written for RC. |
|||
Version 0.3.0 was released in June 2020 and the CLI tool (Wren CLI) was then split off into its own repository. It is now available as a pre-built standalone executable and is the main focus of examples written for RC. Unfortunately, its embedded VM suffers from a stack corruption bug which often manifests itself in recursive code. This bug was fixed in September 2020 and, rather than use the pre-built executable, I would recommend that RC users build Wren CLI themselves using the latest VM code pending the release of version 0.4.0. From April 2021, the latest build already includes Wren 0.4.0 features and the official release will follow soon. |
|||
The latest version 0.4.0 is available as a pre-built standalone executable for 64-bit Linux, MacOS and Windows and can be downloaded from [https://github.com/wren-lang/wren-cli/releases here]. |
|||
⚫ | As a language mainly designed for embedding, Wren's standard library is (of necessity) quite small and I ([[User:PureFox|PureFox]]) have therefore decided to create some additional modules to assist with writing Rosetta Code tasks so the same code does not have to be written or copy/pasted time and time again thereby bloating a task's script code unnecessarily. The ones written so far are listed below: |
||
In common with several other 'newer' languages (Rust, Kotlin, Julia, Swift, Phix etc.) Wren doesn't have its own syntax highlighting on Rosetta Code as GeSHi support hasn't been updated for a long time and may never be. However, I've found by experimentation that, if ''ecmascript'' is used in the ''lang'' tag, then this will highlight all of Wren's keywords except ''construct'' and ''foreign'' and is probably the best we can do in the circumstances. |
|||
⚫ | As a language mainly designed for embedding, Wren's standard library is (of necessity) quite small and I have therefore decided to create some additional modules to assist with writing Rosetta Code tasks so the same code does not have to be written or copy/pasted time and time again thereby bloating a task's script code unnecessarily. The ones written so far are listed below: |
||
{| class="wikitable" |
{| class="wikitable" |
||
! No. !! Module name !! !! No. !! Module name |
! No. !! Module name !! !! No. !! Module name |
||
|- |
|- |
||
| 1 || [ |
| 1 || [[:Category:Wren-fmt|fmt]] || || 2 || [[:Category:Wren-str|str]] |
||
|- |
|- |
||
| 3 || [ |
| 3 || [[:Category:Wren-sort|sort]] || || 4 || [[:Category:Wren-math|math]] |
||
|- |
|- |
||
| 5 || [ |
| 5 || [[:Category:Wren-trait|trait]] || || 6 || [[:Category:Wren-seq|seq]] |
||
|- |
|- |
||
| 7 || [ |
| 7 || [[:Category:Wren-date|date]] || || 8 || [[:Category:Wren-rat|rat]] |
||
|- |
|- |
||
| 9 || [ |
| 9 || [[:Category:Wren-pattern|pattern]] || || 10 || [[:Category:Wren-big|big]] |
||
|- |
|- |
||
| 11 || [ |
| 11 || [[:Category:Wren-upc|upc]] || || 12 || [[:Category:Wren-matrix|matrix]] |
||
|- |
|- |
||
| 13 || [ |
| 13 || [[:Category:Wren-set|set]] || || 14 || [[:Category:Wren-llist|llist]] |
||
|- |
|- |
||
| 15 || [ |
| 15 || [[:Category:Wren-queue|queue]] || || 16 || [[:Category:Wren-complex|complex]] |
||
|- |
|- |
||
| 17 || [ |
| 17 || [[:Category:Wren-dynamic|dynamic]] || || 18 || [[:Category:Wren-ioutil|ioutil]] |
||
|- |
|- |
||
| 19 || [ |
| 19 || [[:Category:Wren-long|long]] || || 20 || [[:Category:Wren-crypto|crypto]] |
||
|- |
|- |
||
| 21 || [ |
| 21 || [[:Category:Wren-sound|sound]] || || 22 || [[:Category:Wren-polygon|polygon]] |
||
|- |
|- |
||
| 23 || [ |
| 23 || [[:Category:Wren-srandom|srandom]] || || 24 || [[:Category:Wren-lsystem|lsystem]] |
||
|- |
|- |
||
| 25 || [ |
| 25 || [[:Category:Wren-turtle|turtle]] || || 26 || [[:Category:Wren-ellipse|ellipse]] |
||
|- |
|- |
||
| 27 || [ |
| 27 || [[:Category:Wren-check|check]] || || 28 || [[:Category:Wren-array|array]] |
||
|- |
|- |
||
| 29 || [ |
| 29 || [[:Category:Wren-gmp|gmp]] || || 30 || [[:Category:Wren-ecm|ecm]] |
||
|- |
|||
| 31 || [[:Category:Wren-sql|sql]] || || 32 || [[:Category:Wren-event|event]] |
|||
|- |
|||
| 33 || [[:Category:Wren-i64|i64]] || || 34 || [[:Category:Wren-perm|perm]] |
|||
|- |
|||
| 35 || [[:Category:Wren-linear|linear]] || || 36 || [[:Category:Wren-regex|regex]] |
|||
|- |
|||
| 37 || [[:Category:Wren-maputil|maputil]] || || 38 || [[:Category:Wren-plot|plot]] |
|||
|- |
|||
| 39 || [[:Category:Wren-debug|debug]] || || 40 || [[:Category:Wren-table|table]] |
|||
|- |
|||
| 41 || [[:Category:Wren-iterate|iterate]] || || 42 || [[:Category:Wren-money|money]] |
|||
|- |
|||
| 43 || [[:Category:Wren-vector|vector]] || || 44 || [[:Category:Wren-ordered|ordered]] |
|||
|- |
|||
| 45 || [[:Category:Wren-psieve|psieve]] || || || |
|||
|} |
|} |
||
<br> |
<br> |
||
To use a class or classes from a module (say ''fmt''), you need to import them into your script with Wren code such as the following. To use more than one class separate their names with commas: |
|||
<syntaxhighlight lang="wren">import "./fmt" for Conv, Fmt</syntaxhighlight> |
|||
These modules are subject to the same license as any other code submitted to Rosetta Code though contributors' user pages should be checked to see whether more permissive terms are available. If anyone wishes to add further modules, please do so using a similar model and append them to the list. |
These modules are subject to the same license as any other code submitted to Rosetta Code though contributors' user pages should be checked to see whether more permissive terms are available. If anyone wishes to add further modules, please do so using a similar model and append them to the list. |
||
Please note that when creating a category for a new module its name should be prefixed with 'Wren-' as in 'Wren-fmt' and the library header for a task which uses the module should therefore use this name. Modules will normally have generic names and this convention allows Rosetta Code users to easily distinguish Wren modules from similarly named modules/libraries written for other languages. |
Please note that when creating a category for a new module its name should be prefixed with 'Wren-' as in 'Wren-fmt' and the library header for a task which uses the module should therefore use this name. Modules will normally have generic names and this convention allows Rosetta Code users to easily distinguish Wren modules from similarly named modules/libraries written for other languages. |
||
There are also a number of third-party modules available for Wren of which the following have been used to write solutions for Rosetta Code tasks: |
|||
{| class="wikitable" |
|||
! No. !! Module name !! !! No. !! Module name |
|||
|- |
|||
| 1 || [[:Category:DOME|DOME]] || || 2 || [[:Category:Raylib-wren|Raylib-wren]] |
|||
|- |
|||
| 3 || [[:Category:SpiderWren|SpiderWren]] || || 4 || [[:Category:Wren-assert|Wren-assert]] |
|||
|- |
|||
| 5 || [[:Category:Wren-json|Wren-json]] || || 6 || [[:Category:Wren-test|Wren-test]] |
|||
|- |
|||
| 7 || [[:Category:WrenGo|WrenGo]] || || 8 || [[:Category:Wren-xsequence|Wren-xsequence]] |
|||
|} |
|||
<br> |
|||
For further information and licensing requirements, please consult their individual pages. |
|||
==Todo== |
|||
* [[Tasks not implemented in Wren]] |
Latest revision as of 10:34, 29 May 2024
![Language](http://static.miraheze.org/rosettacodewiki/thumb/2/27/Rcode-button-language-crushed.png/64px-Rcode-button-language-crushed.png)
This programming language may be used to instruct a computer to perform a task.
Official website |
---|
Execution method: | Interpreted |
---|---|
Garbage collected: | Yes |
Type safety: | Safe |
Type strength: | Strong |
Type expression: | Implicit |
Type checking: | Dynamic |
See Also: |
|
Wren is a lightweight, object-oriented programming language designed to be an easily-embeddable scripting language.
It is under development on GitHub and is fully documented here.
The CLI tool (Wren CLI) has its own repository and is the main focus of examples written for RC. The latest version 0.4.0 is available as a pre-built standalone executable for 64-bit Linux, MacOS and Windows and can be downloaded from here.
As a language mainly designed for embedding, Wren's standard library is (of necessity) quite small and I (PureFox) have therefore decided to create some additional modules to assist with writing Rosetta Code tasks so the same code does not have to be written or copy/pasted time and time again thereby bloating a task's script code unnecessarily. The ones written so far are listed below:
No. | Module name | No. | Module name | |
---|---|---|---|---|
1 | fmt | 2 | str | |
3 | sort | 4 | math | |
5 | trait | 6 | seq | |
7 | date | 8 | rat | |
9 | pattern | 10 | big | |
11 | upc | 12 | matrix | |
13 | set | 14 | llist | |
15 | queue | 16 | complex | |
17 | dynamic | 18 | ioutil | |
19 | long | 20 | crypto | |
21 | sound | 22 | polygon | |
23 | srandom | 24 | lsystem | |
25 | turtle | 26 | ellipse | |
27 | check | 28 | array | |
29 | gmp | 30 | ecm | |
31 | sql | 32 | event | |
33 | i64 | 34 | perm | |
35 | linear | 36 | regex | |
37 | maputil | 38 | plot | |
39 | debug | 40 | table | |
41 | iterate | 42 | money | |
43 | vector | 44 | ordered | |
45 | psieve |
To use a class or classes from a module (say fmt), you need to import them into your script with Wren code such as the following. To use more than one class separate their names with commas:
import "./fmt" for Conv, Fmt
These modules are subject to the same license as any other code submitted to Rosetta Code though contributors' user pages should be checked to see whether more permissive terms are available. If anyone wishes to add further modules, please do so using a similar model and append them to the list.
Please note that when creating a category for a new module its name should be prefixed with 'Wren-' as in 'Wren-fmt' and the library header for a task which uses the module should therefore use this name. Modules will normally have generic names and this convention allows Rosetta Code users to easily distinguish Wren modules from similarly named modules/libraries written for other languages.
There are also a number of third-party modules available for Wren of which the following have been used to write solutions for Rosetta Code tasks:
No. | Module name | No. | Module name | |
---|---|---|---|---|
1 | DOME | 2 | Raylib-wren | |
3 | SpiderWren | 4 | Wren-assert | |
5 | Wren-json | 6 | Wren-test | |
7 | WrenGo | 8 | Wren-xsequence |
For further information and licensing requirements, please consult their individual pages.
Todo
Pages in category "Wren"
The following 200 pages are in this category, out of 1,680 total.
(previous page) (next page)E
- Earliest difference between prime gaps
- Eban numbers
- Echo server
- Eertree
- Egyptian division
- Eisenstein primes
- EKG sequence convergence
- Element-wise operations
- Elementary cellular automaton
- Elementary cellular automaton/Infinite length
- Elementary cellular automaton/Random number generator
- Elevator simulation
- Elliptic curve arithmetic
- Elliptic Curve Digital Signature Algorithm
- Emirp primes
- Empty directory
- Empty program
- Empty string
- Enforced immutability
- Engel expansion
- English cardinal anagrams
- Entropy
- Entropy/Narcissist
- Enumerations
- Environment variables
- Equal prime and composite sums
- Equilibrium index
- Erdös-Selfridge categorization of primes
- Erdős-Nicolas numbers
- Erdős-primes
- Erdős–Woods numbers
- Esthetic numbers
- Ethiopian multiplication
- Euclid-Mullin sequence
- Euclidean rhythm
- Euler method
- Euler's constant 0.5772...
- Euler's identity
- Euler's sum of powers conjecture
- Evaluate binomial coefficients
- Even numbers which cannot be expressed as the sum of two twin primes
- Even or odd
- Events
- Evolutionary algorithm
- Exactly three adjacent 3 in lists
- Exceptions
- Exceptions/Catch an exception thrown in a nested call
- Executable library
- Execute a Markov algorithm
- Execute a system command
- Execute Brain****
- Execute Computer/Zero
- Execute CopyPasta Language
- Execute HQ9+
- Execute SNUSP
- Exponential digital sums
- Exponentiation operator
- Exponentiation order
- Exponentiation with infix operators in (or operating on) the base
- Extend your language
- Extended Straddling Checkerboard
- Extensible prime generator
- External sort
- Extra primes
- Extract file extension
- Extreme floating point values
- Extreme primes
F
- Faces from a mesh
- Factor-perfect numbers
- Factorial
- Factorial base numbers indexing permutations of a collection
- Factorial primes
- Factorions
- Factorize string into Lyndon words
- Factors of a Mersenne number
- Factors of an integer
- Fairshare between two and more
- Farey sequence
- Fast Fourier transform
- FASTA format
- Faulhaber's formula
- Faulhaber's triangle
- Feigenbaum constant calculation
- Fermat numbers
- Fermat pseudoprimes
- Fibonacci heap
- Fibonacci matrix-exponentiation
- Fibonacci n-step number sequences
- Fibonacci sequence
- Fibonacci word
- Fibonacci word/fractal
- File extension is in extensions list
- File input/output
- File modification time
- File size
- File size distribution
- Filter
- Find adjacent primes which differ by a square integer
- Find Chess960 starting position identifier
- Find common directory path
- Find duplicate files
- Find first and last set bit of a long integer
- Find first missing positive
- Find if a point is within a triangle
- Find largest left truncatable prime in a given base
- Find limit of recursion
- Find minimum number of coins that make a given value
- Find palindromic numbers in both binary and ternary bases
- Find prime n such that reversed n is also prime
- Find prime numbers of the form n*n*n+2
- Find square difference
- Find squares n where n+1 is prime
- Find the intersection of a line with a plane
- Find the intersection of two lines
- Find the last Sunday of each month
- Find the missing permutation
- Find URI in text
- Find words which contain the most consonants
- Find words which contains all the vowels
- Find words which contains more than 3 e vowels
- Find words whose first and last three letters are equal
- Find words with alternating vowels and consonants
- Finite state machine
- First 9 prime Fibonacci number
- First class environments
- First perfect square in base n with n unique digits
- First power of 2 that has leading decimal digits of 12
- First-class functions
- First-class functions/Use numbers analogously
- Five weekends
- Fivenum
- Fixed length records
- FizzBuzz
- Flatten a list
- Flipping bits game
- Flow-control structures
- Floyd's triangle
- Floyd-Warshall algorithm
- Forbidden numbers
- Forest fire
- Fork
- Formal power series
- Formatted numeric output
- Fortunate numbers
- Forward difference
- Four bit adder
- Four is magic
- Four is the number of letters in the ...
- Four sides of square
- Fractal tree
- Fraction reduction
- Fractran
- Free polyominoes enumeration
- French Republican calendar
- Frobenius numbers
- FTP
- Function composition
- Function definition
- Function frequency
- Function prototype
- Functional coverage tree
- Fusc sequence
G
- Galton box animation
- Gamma function
- Gapful numbers
- Gauss-Jordan matrix inversion
- Gaussian elimination
- Gaussian primes
- General FizzBuzz
- Generalised floating point addition
- Generalised floating point multiplication
- Generate Chess960 starting position
- Generate lower case ASCII alphabet
- Generate random chess position
- Generate random numbers without repeating a value
- Generator/Exponential
- Generic swap
- Geohash
- Geometric algebra
- Get system command output
- Getting the number of decimal places
- Giuga numbers
- Globally replace text in several files
- Go Fish
- Goldbach's comet
- Golden ratio/Convergence
- Goodstein Sequence
- Gotchas
- Gradient descent
- Graph colouring
- Gray code
- Grayscale image
- Greatest common divisor
- Greatest element of a list
- Greatest prime dividing the n-th cubefree number
- Greatest subsequential sum
- Greed
- Greedy algorithm for Egyptian fractions
- Greyscale bars/Display
- GSTrans string conversion