11+++
22title = " Getting Started"
3- weight = 1
3+ weight = 0
44+++
55
66## Requirements
@@ -10,107 +10,30 @@ weight = 1
1010
1111## Quick Start
1212
13- Scaffold a new project:
13+ Create a fresh project and drop into the REPL :
1414
1515``` bash
1616composer create-project --stability dev phel-lang/cli-skeleton example-app
1717cd example-app
1818composer repl
1919```
2020
21- > For web projects: [ web-skeleton] ( https://github.com/phel-lang/web-skeleton )
22-
23- ### Use the standalone PHAR
24-
25- Prefer to try Phel without installing Composer dependencies? Download the
26- pre-built [ ` phel.phar ` ] ( https://github.com/phel-lang/phel-lang/releases ) from the
27- latest GitHub release:
28-
29- ``` bash
30- curl -L https://github.com/phel-lang/phel-lang/releases/latest/download/phel.phar -o phel.phar
31- php phel.phar --version
32- ```
33-
34- You can execute the same commands as the Composer-installed binary. For example:
35-
36- ``` bash
37- php phel.phar repl
38- php phel.phar run src/main.phel
39- php phel.phar test --filter foo
40- ```
41-
42- ## Manual Setup
43-
44- ``` bash
45- mkdir hello-world && cd hello-world
46- composer init
47- composer require phel-lang/phel-lang
48- mkdir src
49- ```
50-
51- Optional config (` phel-config.php ` ):
52-
53- ``` php
54- <?php
55- return (new \Phel\Config\PhelConfig())
56- ->setSrcDirs(['src']);
57- ```
58-
59- Sample Phel file (` src/main.phel ` ):
60-
61- ``` phel
62- (ns hello-world\main)
63- (println "Hello, World!")
64- ```
65-
66- ## Run Code
67-
68- ** From CLI:**
69-
70- ``` bash
71- vendor/bin/phel run src/main.phel
72- ```
73-
74- ** With PHP Server:**
75-
76- ``` php
77- <?php
78- require __DIR__ . '/../vendor/autoload.php';
79- \Phel\Phel::run(__DIR__ . '/../', 'hello-world\\main');
80- ```
81-
82- ``` bash
83- php -S localhost:8000 ./src/index.php
84- ```
85-
86- > <svg xmlns =" http://www.w3.org/2000/svg " viewBox =" 0 0 24 24 " fill =" none " stroke =" currentColor " stroke-width =" 2 " stroke-linecap =" round " stroke-linejoin =" round " style =" width : 16px ; height : 16px ; display : inline-block ; vertical-align : middle ; margin-right : 4px ;" ><path d =" M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71 " ></path ><path d =" M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71 " ></path ></svg > [ More on running code] ( /documentation/cli-commands#run-a-script )
87-
88- ## REPL
89-
90- ``` bash
91- vendor/bin/phel repl
92- ```
93-
94- Try:
21+ Inside the REPL try:
9522
9623``` phel
9724(def name "World")
9825(println "Hello" name)
9926```
10027
101- > <svg xmlns =" http://www.w3.org/2000/svg " viewBox =" 0 0 24 24 " fill =" none " stroke =" currentColor " stroke-width =" 2 " stroke-linecap =" round " stroke-linejoin =" round " style =" width : 16px ; height : 16px ; display : inline-block ; vertical-align : middle ; margin-right : 4px ;" ><path d =" M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71 " ></path ><path d =" M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71 " ></path ></svg > [ More on REPL] ( /documentation/repl )
102-
103- ## Testing
28+ Exit the REPL with ` Ctrl+D ` and run the default script:
10429
10530``` bash
106- vendor/bin/phel test --filter foo
31+ vendor/bin/phel run src/main.phel
10732```
10833
109- > <svg xmlns =" http://www.w3.org/2000/svg " viewBox =" 0 0 24 24 " fill =" none " stroke =" currentColor " stroke-width =" 2 " stroke-linecap =" round " stroke-linejoin =" round " style =" width : 16px ; height : 16px ; display : inline-block ; vertical-align : middle ; margin-right : 4px ;" ><path d =" M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71 " ></path ><path d =" M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71 " ></path ></svg > [ More on testing] ( /documentation/testing )
110-
111- ## Editor Support
34+ ## Where to go next
11235
113- - [ PhpStorm ] ( https://github.com/phel-lang/phel-intellij-plugin )
114- - [ VSCode ] ( https://github.com/phel-lang/phel-vs-code-extension )
115- - [ Emacs ] ( https://codeberg.org/mmontone/interactive-lang-tools )
116- - [ Vim ] ( https://github.com/danirod/phel.vim )
36+ - Set up Phel another way? See [ Installation ] ( /documentation/installation ) .
37+ - Dive into the CLI workflow: [ CLI Commands ] ( /documentation/cli-commands ) .
38+ - Explore the REPL deeper: [ REPL guide ] ( /documentation/repl ) .
39+ - Learn the core language features: [ Basic Types ] ( /documentation/basic-types ) .
0 commit comments