@@ -6,52 +6,58 @@ how do you write the canonical Hello World app? This example assumes the
6
6
``bash `` shell is used. You may need to adjust for your local shell. ::
7
7
8
8
$ export PATH=/opt/opendylan/bin:$PATH
9
- $ make- dylan-app hello-world
9
+ $ dylan new application --simple hello-world
10
10
$ cd hello-world
11
- $ dylan-compiler - build hello-world.lid
11
+ $ dylan build --all
12
12
...lots of output...
13
13
$ _build/bin/hello-world
14
14
Hello, world!
15
15
16
- Ta da! Now a quick review of the steps with a little bit of
17
- explanation.
16
+ Ta da! Now a quick review of the steps with a little bit of explanation.
18
17
19
- First you must set ``PATH `` so that `` make- dylan-app ` ` and
20
- `` dylan-compiler `` will be found. ``./_build/bin `` is where
21
- dylan-compiler puts the executables it builds.
18
+ First you must set ``PATH `` so that the :program: ` dylan ` and
19
+ :program: ` dylan-compiler ` commands will be found. ``./_build/bin `` is where
20
+ :program: ` dylan-compiler ` puts the executables it builds.
22
21
23
22
.. note :: Some of these differ on Windows, so please be sure
24
23
to read :doc: `windows ` if you are on Windows.
25
24
:class: alert alert-block alert-warning
26
25
27
- ``make-dylan-app `` creates a directory with the same name as the
28
- project, and four files:
26
+ ``dylan new application --simple hello-world `` creates a directory named
27
+ "hello-world", and several files. The ``--simple `` flag says to skip generating
28
+ a test suite library.
29
29
30
- 1. `` hello-world.lid `` -- This says what other files are part of the project.
31
- The order in which the files are listed here determines the order in which
32
- the code in them is executed .
30
+ 1. :file: ` hello-world.lid ` lists the files in the project. The order in which
31
+ the files are listed here determines the order in which the code in them is
32
+ loaded. The library definition file should always be first .
33
33
34
- 2. `` library.dylan `` contains the library and module definitions. These can be
35
- extended as your project grows more complex .
34
+ 2. :file: ` library.dylan ` contains the library and module definitions. These
35
+ can be extended as your project grows in complexity .
36
36
37
- 3. ``hello-world.dylan `` contains the main program. Note that the last
38
- top-level definition is a call to the main function, which may have any
39
- name; there is no predefined "main" function that is automatically called.
37
+ 3. :file: `hello-world.dylan ` contains the main program code.
40
38
41
- 4. ``registry/<platform>/hello-world `` is a "registry file", which contains the
42
- path to the ``hello-world.lid `` file.
39
+ 4. The :file: `registry ` directory is how :program: `dylan-compiler ` locates each
40
+ used library. When using the :program: `dylan ` tool, this directory is
41
+ generated for you. See :doc: `source-registries ` for details on the registry
42
+ format.
43
43
44
- The first time you build ``hello-world `` it builds all used libraries, all the
45
- way down to the ``dylan `` library itself. Subsequent compiles only need to
44
+ 5. :file: `dylan-package.json ` describes the new "hello-world" package. This is
45
+ where you can specify dependencies, the package location, etc. See the
46
+ `dylan-tool documentation
47
+ <https://docs.opendylan.org/packages/dylan-tool/documentation/source/index.html> `_
48
+ for more on this. Note that the existence of this file turns the
49
+ "hello-world" directory into a :program: `dylan ` workspace.
50
+
51
+ The first time you build ``hello-world `` all used libraries are built, all the
52
+ way down to the ``dylan `` library itself. Subsequent builds only need to
46
53
recompile ``hello-world `` itself and are therefore much faster.
47
54
48
- ``dylan-compiler `` has a batch mode and an interactive mode. The `` -build ` `
49
- option says to build the project in batch mode. When you pass a ".lid" file to
50
- the compiler it builds the library described by that file. In the next section
51
- you'll see that you can also pass the name of the project (without ".lid") and
52
- it will use "registries" to find the project sources .
55
+ .. note :: Don't confuse the ``dylan`` library with the :program:`dylan `
56
+ executable program. The `` dylan `` library contains the core Dylan
57
+ language features that are not implemented inside the compiler. The
58
+ `` dylan `` program is a tool to help manager Dylan projects and is
59
+ created from a library called `` dylan-tool `` .
53
60
54
- The compiler places its output in the ``_build `` directory in the
55
- current working directory. This includes the libraries and executables
56
- that it builds. You can run the executable as noted above from this
57
- location.
61
+ The compiler places its output in the ``_build `` directory in the current
62
+ working directory. This includes the libraries and executables that it builds.
63
+ You can run the executable from this location, as noted above.
0 commit comments