Many of the words below are just mentioned, without much indication what they do. You can find out more by klicking on the word in the Web version of this document, by typing "help " in Gforth, or by clicking on the word in the word index.
This text mentions words that appear the first time in the documentation; some have been available earlier, but were not documented.
It is now documented which words are intended to be permanently supported, and which are not; see Stability Goals.
The text interpreter can recognize more things:
6k5, 23%); strings
("string"), xts ( `word), nts
( ``word), body addresses
(<word> <word+8>). See Literals
in source code;forth:and vs. assembler:and.v and d in the
following examples): ->v for to v;
+>v for +to v; 'v for
addr v; @>d for action-of d;
=>d for is d. See rec-to.${LANG}recs rec-name rec-local rec-scope rec-number .-is-dcell? rec-float rec-complex rec-string rec-to rec-dtick rec-tick rec-body rec-env rec-meta rec-forth rec-sequence: get-recs set-recs rec-none translate-name translate-cell translate-dcell translate-float translate-complex translate-string scan-translate-string translate-env translate-to rec-filter rec-forth-nt? translate: interpreting compiling postponing ?rec-foundIDE features:
locate browse).where nw bw ww).nt bt tt);edit g gg whereg);fancy-after-l xt-locate l n b before-locate after-locate ll short-where expand-where prepend-where unused-wordsMulti-Tasking on multiple cores or hardware threads:
newtask task newtask4 stacksize stacksize4 initiate execute-task kill-task kill stop stop-ns stop-dns thread-deadline halt sleep wake restart pause auser uallot up@ user' 's mutex lock unlock critical-section atomic!@ atomic+!@ atomic?!@ barrier
Message queues (similar to the actor model) provide a way to combine
communication with synchronization of the tasks:
send-event ?events event-loop
Cilk is useful for distributing work across tasks:
cores cilk-init spawn spawn1 spawn2 cilk-sync cilk-bye
New word header layout, and based on that:
set-does> set-compsem set->int set->comp set-name>string set-name>link;
using a code addres instead of an xt: set-execute; new code
addresses for that: dovalue: dodoes: doabicode:to etc.:
to-table: n/a to-class: >uvalue set-toset-optimizercompsem: intsem: opt:create-from reveal reveal! noname-fromset-does> etc. to a word defined earlier:
make-latest.hm immediate?Performance comparable to SwiftForth
Many of these words are still in Gforth 1.0, but they may be removed in the future.
Boolean flags: select
Arithmetic words:
umin umax/s /f u/ mods modf umod /mods /modf u/mod du/mod */s */f u*/ */mods */modf u*/mod ud/modstaged/-size /f-stage1m /f-stage2m modf-stage2m /modf-stage2m u/-stage1m u/-stage2m umod-stage2m u/mod-stage2m staged/-divisormux arshift dlshift drshift darshift >pow2 log2 pow2? ctz wrol wror lrol lror rol ror drol drorrnd random seed!f*+ s>f f>s fcopysign ftrunc v* faxpy infinity inf -infinity -inf nanStack Manipulation:
Memory access:
*aligned *align!@ +!@ cell- cell/ th th@ th!w@ w! l@ l! x@ x! xd@ xd!wbe wle lbe lle xbe xle xdbe xdlec>s w>s l>s x>s xd>sw, l, x, xd,/xwaligned walign laligned lalign xaligned xalignchar- float/ sfloat/ dfloat/Control flow
-[do u-[do array>mem mem+do mem-do i' delta-icase to loops:
next-case ?of contofcs-drop?exit execute-exitfast-throw exceptions ?errno-throw ?ior catch-nobt warning" warningsDefining words: avariable buffer: aconstant
forward .unresolvedavalue 2value fvalue +to addressable: addr.inline: ;inline[: ;]:is preserve wrap-xtwfield: lfield: xfield: extend-structurestack stack: stack> >stack >back back> +after -stack set-stack get-stackInput stream: string-parse
We have not done Gforth EC work since Gforth 0.7. We recommend using Gforth 0.7 for Gforth EC, but welcome bug or success reports for Gforth EC in our git head.
Texto de gforth.org tal como lo publicó, leído de su página y mostrado aquí con el formato de El Autómata. El original, en gforth.org · Volver a la noticia de El Autómata