Category:Wren: Difference between revisions

Deleted paragraph about updating S/H which has now been completed.
(Added link to Wren-maputil module.)
(Deleted paragraph about updating S/H which has now been completed.)
 
(18 intermediate revisions by the same user not shown)
Line 15:
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 [https://github.com/wren-lang/wren-cli/releases here].
 
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:
Line 23 ⟶ 21:
! No. !! Module name !! !! No. !! Module name
|-
| 1 || [https[://rosettacode.org/wiki/Category:Wren-fmt |fmt]] || || 2 || [https[://rosettacode.org/wiki/Category:Wren-str |str]]
|-
| 3 || [https[://rosettacode.org/wiki/Category:Wren-sort |sort]] || || 4 || [https[://rosettacode.org/wiki/Category:Wren-math |math]]
|-
| 5 || [https[://rosettacode.org/wiki/Category:Wren-trait |trait]] || || 6 || [https[://rosettacode.org/wiki/Category:Wren-seq |seq]]
|-
| 7 || [https[://rosettacode.org/wiki/Category:Wren-date |date]] || || 8 || [https[://rosettacode.org/wiki/Category:Wren-rat |rat]]
|-
| 9 || [https[://rosettacode.org/wiki/Category:Wren-pattern |pattern]] || || 10 || [https[://rosettacode.org/wiki/Category:Wren-big |big]]
|-
| 11 || [https[://rosettacode.org/wiki/Category:Wren-upc |upc]] || || 12 || [https[://rosettacode.org/wiki/Category:Wren-matrix |matrix]]
|-
| 13 || [https[://rosettacode.org/wiki/Category:Wren-set |set]] || || 14 || [https[://rosettacode.org/wiki/Category:Wren-llist |llist]]
|-
| 15 || [https[://rosettacode.org/wiki/Category:Wren-queue |queue]] || || 16 || [https[://rosettacode.org/wiki/Category:Wren-complex |complex]]
|-
| 17 || [https[://rosettacode.org/wiki/Category:Wren-dynamic |dynamic]] || || 18 || [https[://rosettacode.org/wiki/Category:Wren-ioutil |ioutil]]
|-
| 19 || [https[://rosettacode.org/wiki/Category:Wren-long |long]] || || 20 || [https[://rosettacode.org/wiki/Category:Wren-crypto |crypto]]
|-
| 21 || [https[://rosettacode.org/wiki/Category:Wren-sound |sound]] || || 22 || [https[://rosettacode.org/wiki/Category:Wren-polygon |polygon]]
|-
| 23 || [https[://rosettacode.org/wiki/Category:Wren-srandom |srandom]] || || 24 || [https[://rosettacode.org/wiki/Category:Wren-lsystem |lsystem]]
|-
| 25 || [https[://rosettacode.org/wiki/Category:Wren-turtle |turtle]] || || 26 || [https[://rosettacode.org/wiki/Category:Wren-ellipse |ellipse]]
|-
| 27 || [https[://rosettacode.org/wiki/Category:Wren-check |check]] || || 28 || [https[://rosettacode.org/wiki/Category:Wren-array |array]]
|-
| 29 || [https[://rosettacode.org/wiki/Category:Wren-gmp |gmp]] || || 30 || [https[://rosettacode.org/wiki/Category:Wren-ecm |ecm]]
|-
| 31 || [https[://rosettacode.org/wiki/Category:Wren-sql |sql]] || || 32 || [https[://rosettacode.org/wiki/Category:Wren-event |event]]
|-
| 33 || [https[://rosettacode.org/wiki/Category:Wren-i64 |i64]] || || 34 || [https[://rosettacode.org/wiki/Category:Wren-perm |perm]]
|-
| 35 || [https[://rosettacode.org/wiki/Category:Wren-linear |linear]] || || 36 || [https[://rosettacode.org/wiki/Category:Wren-regex |regex]]
|-
| 37 || [https[://rosettacode.org/wiki/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>
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.
 
Line 71 ⟶ 81:
! No. !! Module name !! !! No. !! Module name
|-
| 1 || [https[://rosettacode.org/wiki/Category:DOME |DOME]] || || 2 || [https[://rosettacode.org/wiki/Category:Raylib-wren |Raylib-wren]]
|-
| 3 || [https[://rosettacode.org/wiki/Category:SpiderWren |SpiderWren]] || || 4 || [https[://rosettacode.org/wiki/Category:Wren-assert |Wren-assert]]
|-
| 5 || [https[://rosettacode.org/wiki/Category:Wren-json |Wren-json]] || || 6 || [https[://rosettacode.org/wiki/Category:Wren-test |Wren-test]]
|-
| 7 || [https[://rosettacode.org/wiki/Category:WrenGo |WrenGo]] || || 8 || [[:Category:Wren-xsequence|Wren-xsequence]]
[https://rosettacode.org/wiki/Category:Wren-xsequence Wren-xsequence]
|}
<br>
For further information and licensing requirements, please consult their individual pages.
 
==Todo==
* [[Tasks not implemented in Wren]]
9,476

edits