Native Shell
Native Shell은 모든 플랫폼의 앱 안에서 만들어지는 AI UI입니다
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기A small, mostly standard Forth in the browser: compiled words, return stack, DO/LOOP, BEGIN/WHILE, CREATE DOES>, live stack view. Zero dependencies.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗A small Forth that runs in the browser, close to the standard. Colon definitions are compiled, there's a real return stack and proper control flow, and the terminal shows the data stack live. There are no dependencies and no build step.
Live demo: https://cstroie.github.io/forth/
2 3 + . \ 5
: square ( n -- n*n ) dup * ;
7 square . \ 49
: countdown ( n -- ) begin dup . 1- dup 0= until drop ;
5 countdown \ 5 4 3 2 1
Type help for an overview, words to list every word, and see name to show a definition. The Examples panel loads ready-made programs:
CREATE … DOES> arraysmsCASE and KEY<# #>| Area | Words |
|---|---|
| Stack | dup drop swap over rot -rot nip tuck pick roll ?dup 2dup 2drop 2swap 2over depth clear >r r> r@ |
| Arithmetic | + - * / mod /mod */ negate abs min max 1+ 1- 2* 2/ and or xor invert lshift rshift random |
| Comparison | = <> < > <= >= 0= 0<> 0< 0> u< within true false |
| Output | . u. .r .s ? emit cr space spaces type ." .( page / cls, decimal hex binary |
| Control | if else then, do ?do loop +loop i j leave unloop, begin until again, begin while repeat, case of endof endcase, recurse exit |
| Defining | : ; variable constant value to create allot , c, does> ' ['] execute literal char [char] |
| Memory | @ ! +! c@ c! 2@ 2! here cells cell+ chars char+ 2variable 2constant |
| Compiler | immediate postpone [ ] literal compile, marker forget |
| Formatting | <# # #s hold sign #>, s>d d. |
| Input and time | key key? accept ms |
| Floating point | f+ f- f* f/ f** fnegate fabs fsqrt fsin fcos ftan fatan fexp fln flog floor fround fmin fmax, fdup fdrop fswap fover frot fdepth, s>f f>s f= f< f0= f0< f. f.s pi f@ f! fvariable fconstant |
| Strings and comments | ." text", s" text", ( comment ), \ comment |
| Tools | words see help cold |
| Storage | save name, load name, files, delete name |
How it behaves:
true is -1. / and mod round toward negative infinity (floored division).1.5, 2e0) is a float.base. A prefix overrides it: $FF is hex, #10 decimal, %101 binary, and 'a' is a character code.ABORT does. The message points at the word that failed, for example 2 3 >>>foo<<<.key waits for a keystroke, accept reads a typed line, and ms pauses without freezing the page.Tab completes word names. ↑/↓ scroll through history. Esc or Ctrl+C interrupts a runaway word: the interpreter runs in time slices, so begin again can't freeze the page.cold starts from scratch.The page is a Progressive Web App. Your browser offers to install it (on a phone, use Add to Home Screen). After the first visit it also works offline: a service worker (sw.js) caches the app and refreshes it in the background, so updates appear on the next visit.
forth.js holds the interpreter: outer interpreter, compiler, inner interpreter and the built-in words. It doesn't touch the DOM, so it can run in Node:
const { Forth } = require('./forth.js');
const storage = { get: () => null, set: () => true, remove() {}, keys: () => [] };
const f = new Forth(text => process.stdout.write(text), storage);
f.enter(': sq dup * ; 12 sq .');
f.runSlice(); // prints "144 ok"
index.html holds the terminal user interface.
node --test
The tests run the interpreter core under Node (version 18 or later) with no dependencies. GitHub Actions runs them on every push.
This started as a fork of eatonphil/jsforth (2013–2015), a micro-Forth Phil Eaton wrote for a programming-languages course. Version 2 is a complete rewrite. The original passed words around as strings and re-interpreted them; this version compiles definitions into code, runs them on an inner interpreter, and uses standard Forth behaviour throughout.
Programs saved with the old save command can still be loaded with load.
MIT. Original © Phil Eaton, rewrite © Costin Stroie.