Category:Wren: Difference between revisions
Now using internal links to modules and added a note about importing them. |
Added link to Wren-iterate module. |
||
Line 67: | Line 67: | ||
| 41 || [[:Category:Wren-iterate|iterate]] || || 42 || [[:Category:Wren-money|money]] |
| 41 || [[:Category:Wren-iterate|iterate]] || || 42 || [[:Category:Wren-money|money]] |
||
|- |
|- |
||
| 43 || [[:Category:Wren-vector|vector]] || || || |
| 43 || [[:Category:Wren-vector|vector]] || || 44 || [[:Category:Wren-ordered|ordered]] |
||
|} |
|} |
||
<br> |
<br> |
Revision as of 10:22, 26 April 2023
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.
Following the migration to Miraheze, RC now uses Pygments (rather than GeSHi) for syntax highlighting and I have written a lexer for Wren which is included in version 2.14.0. However, at the time of writing (January 2023), RC is still using version 2.11.2 and it is not known when this will be updated to the latest version.
In the meantime 'ecmascript', which we currently use for the 'lang' attribute, is supported by virtue of a GeSHi mapping to the 'javascript' lexer and highlights all Wren 0.4.0 keywords except: is, construct and foreign. I suggest we continue to use that until the Wren lexer is available after which we can use the latter for new tasks and when updating existing tasks. A major effort would be needed to update all existing tasks straightaway given that there are almost 1,600 of them as at January 2023.
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:
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 |
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