Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove make-dylan-app, document dylan-tool #1474

Merged
merged 2 commits into from
Apr 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions BUILDING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ back-end.
Building
--------

To build ``dylan-compiler``, ``make-dylan-app``, and several tools::
To build :program:`dylan-compiler` and several tools::

export PATH=$(dirname $(which dylan-compiler)):$PATH
./autogen.sh
Expand Down Expand Up @@ -98,11 +98,11 @@ can point it in the right direction by using ``--with-gc``::

./configure --prefix=/opt/opendylan-current --with-gc=/path/to/boehm

By default, this will build a fully bootstrapped compiler with the
first generation in ``Bootstrap.1/bin/dylan-compiler``, the second
generation in ``Bootstrap.2/bin/dylan-compiler``, and the third in
``Bootstrap.3/bin/dylan-compiler``. The third generation will then be
installed as ``/opt/opendylan-current/bin/dylan-compiler``.
By default, this will build a fully bootstrapped compiler with the first
generation in :file:`Bootstrap.1/bin/dylan-compiler`, the second generation in
:file:`Bootstrap.2/bin/dylan-compiler`, and the third in
:file:`Bootstrap.3/bin/dylan-compiler`. The third generation will then be
installed as :file:`/opt/opendylan-current/bin/dylan-compiler`.

Running Tests
-------------
Expand All @@ -113,7 +113,10 @@ complete::
make check

This runs the tests for the core language implementation as well as for many
bundled libraries.
bundled libraries. You may also want to run the
``dfmc-environment-test-suite``, with ::

make check-environment

Windows
=======
Expand All @@ -135,7 +138,7 @@ Windows

* Please keep in mind that paths with whitespaces are not well supported.

* cd into build\\windows and run::
* cd into :file:`build\\windows` and run::

build-release.bat <target-dir> /sources <git-checkout>\sources /internal

Expand All @@ -147,7 +150,7 @@ IDE in <target-dir>.
* Get NSIS from http://nsis.sf.net and the HTML help workshop (from
Microsoft, to generate the chm).

* Go to packages\\win32-nsis, read Build.txt and follow the
instructions. Make sure you are using the same command shell as
used for building Open Dylan (to retain environment variables).
* Go to :file:`packages\\win32-nsis`, read :file:`Build.txt` and follow the
instructions. Make sure you are using the same command shell as used for
building Open Dylan (to retain environment variables).

2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ cli2:
BOOTSTRAP_3_ROOT = $(abs_builddir)/Bootstrap.3

BOOTSTRAP_3_LIBRARIES = \
dylan-compiler dylan-environment parser-compiler dswank make-dylan-app
dylan-compiler dylan-environment parser-compiler dswank
BOOTSTRAP_3_STATICS = \
dylan-tool

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Verify that the downloaded version is working correctly by building a
hello-world binary:

```
make-dylan-app hello-world
dylan new application --simple hello-world
cd hello-world
dylan-compiler -build hello-world
dylan build --all
_build/bin/hello-world
```

Expand Down
15 changes: 8 additions & 7 deletions build/windows/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ SIMPLE_DAYTIME_CLIENT_SOURCE = $(NETWORK_EXAMPLES_SOURCE)\simple-daytime-client
SIMPLE_DAYTIME_CLIENT_INSTALL_DIRECTORY = $(NETWORK_EXAMPLES_INSTALL_DIRECTORY)\simple-daytime-client
SIMPLE_DAYTIME_SERVER_SOURCE = $(NETWORK_EXAMPLES_SOURCE)\simple-daytime-server
SIMPLE_DAYTIME_SERVER_INSTALL_DIRECTORY = $(NETWORK_EXAMPLES_INSTALL_DIRECTORY)\simple-daytime-server
MAKE_DYLAN_APP_SOURCE = $(APP_DIRECTORY)\make-dylan-app
DYLAN_TOOL_SOURCE = $(APP_DIRECTORY)\dylan-tool

#
# CORBA projects
Expand Down Expand Up @@ -381,7 +381,7 @@ PARSER_COMPILER = $(INSTALL_BIN_DIRECTORY)\parser-compiler.exe
TESTWORKS_REPORT = $(INSTALL_BIN_DIRECTORY)\testworks-report.exe
WIN32_ENVIRONMENT = $(INSTALL_BIN_DIRECTORY)\win32-environment.exe
WITH_SPLASH_SCREEN = $(INSTALL_BIN_DIRECTORY)\with-splash-screen.exe
MAKE_DYLAN_APP = $(INSTALL_BIN_DIRECTORY)\make-dylan-app.exe
DYLAN_TOOL_APP = $(INSTALL_BIN_DIRECTORY)\dylan-tool-app.exe

BIG_INTEGERS_DLL = $(RUNTIME_PREFIX)bigint
CHANNELS_DLL = $(RUNTIME_PREFIX)chnnls
Expand Down Expand Up @@ -754,7 +754,7 @@ devel-dbg-ui: $(DEVEL_DBG_UI)
dll-wrap: $(DLL_WRAP)
parser-compiler: $(PARSER_COMPILER)
testworks-report: $(TESTWORKS_REPORT)
make-dylan-app: $(MAKE_DYLAN_APP)
dylan-tool-app: $(DYLAN_TOOL_APP)

project-manager-libraries: tools-interface user-projects
core-compiler-libraries: file-source-records release-info dood binary-manager coff-manager binary-builder coff-builder build-system parser-run-time dfmc-management dfmc-browser-support project-manager-libraries dfmc-debug-back-end
Expand Down Expand Up @@ -1073,7 +1073,7 @@ rel-environment: dylan-environment win32-environment with-splash-screen
libraries: user-libraries win32-libraries duim ole-libraries duim-ole database-libraries network dylan-orb naming-client midi
example-projects: console-example-projects duim-example-projects win32-example-projects ole-example-projects duim-ole-example-projects network-example-projects corba-example-projects
install-examples: install-examples-css install-console-examples install-duim-examples install-win32-examples install-basic-doc-examples install-templates install-database-examples install-ole-examples install-duim-ole-examples install-network-examples install-corba-examples install-enhanced-doc-examples install-midi-examples
tools: install-wdbgdylan dll-wrap dylan-playground gui-dylan-playground create-id console-scepter naming-service remote-debugger testworks-libraries debugger parser-compiler make-dylan-app
tools: install-wdbgdylan dll-wrap dylan-playground gui-dylan-playground create-id console-scepter naming-service remote-debugger testworks-libraries debugger parser-compiler dylan-tool-app
release: release-info dylan-compiler-with-tools compiler environment rel-environment libraries tools install-runtime-dlls install-examples

reinstall-examples:
Expand Down Expand Up @@ -2000,13 +2000,14 @@ $(TESTWORKS_REPORT):
$(ENSURE_SOURCES) testworks-report $(TESTWORKS_REPORT_SOURCE)
$(BUILD_APPLICATION) testworks-report

$(MAKE_DYLAN_APP):
$(DYLAN_TOOL_APP):
$(ENSURE_RUNTIME_LIBRARY) $(COMMON_DYLAN_DLL) common-dylan
$(ENSURE_RUNTIME_LIBRARY) $(IO_DLL) io
$(ENSURE_RUNTIME_LIBRARY) $(SYSTEM_DLL) system
$(ENSURE_RUNTIME_LIBRARY) $(STRINGS_DLL) strings
$(ENSURE_SOURCES) make-dylan-app $(MAKE_DYLAN_APP_SOURCE)
$(BUILD_APPLICATION) make-dylan-app
$(ENSURE_SOURCES) dylan-tool $(DYLAN_TOOL_SOURCE)
$(BUILD_APPLICATION) dylan-tool-app
$(COPY) $(DYLAN_TOOL_APP) $(INSTALL_BIN_DIRECTORY)\dylan.exe

# Test Suites

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ you put dylan-mode. ::
Setting ``OPEN_DYLAN_USER_REGISTRIES`` is important because that's how
DIME finds your projects.

For this tutorial let's use a "dime-test" project created with
``make-dylan-app``. See the section :doc:`hello-world` to create the
For this tutorial let's use a "dime-test" project created with the
:program:`dylan` tool. See the section :doc:`hello-world` to create the
project, and also make sure you have a registry entry for it. See
:doc:`source-registries` if you're not sure how to set that up.

Expand All @@ -37,7 +37,7 @@ project, and also make sure you have a registry entry for it. See
$ export PATH=/opt/opendylan/bin:$PATH
$ cd ...dir containing registry...
$ echo abstract://dylan/dime-test/dime-test.lid > registry/generic/dime-test
$ make-dylan-app dime-test
$ dylan new application --simple dime-test
$ cd dime-test
$ emacs dime-test.dylan
M-x dime <Enter>
Expand Down
66 changes: 36 additions & 30 deletions documentation/getting-started-cli/source/hello-world.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,58 @@ how do you write the canonical Hello World app? This example assumes the
``bash`` shell is used. You may need to adjust for your local shell. ::

$ export PATH=/opt/opendylan/bin:$PATH
$ make-dylan-app hello-world
$ dylan new application --simple hello-world
$ cd hello-world
$ dylan-compiler -build hello-world.lid
$ dylan build --all
...lots of output...
$ _build/bin/hello-world
Hello, world!

Ta da! Now a quick review of the steps with a little bit of
explanation.
Ta da! Now a quick review of the steps with a little bit of explanation.

First you must set ``PATH`` so that ``make-dylan-app`` and
``dylan-compiler`` will be found. ``./_build/bin`` is where
dylan-compiler puts the executables it builds.
First you must set ``PATH`` so that the :program:`dylan` and
:program:`dylan-compiler` commands will be found. ``./_build/bin`` is where
:program:`dylan-compiler` puts the executables it builds.

.. note:: Some of these differ on Windows, so please be sure
to read :doc:`windows` if you are on Windows.
:class: alert alert-block alert-warning

``make-dylan-app`` creates a directory with the same name as the
project, and four files:
``dylan new application --simple hello-world`` creates a directory named
"hello-world", and several files. The ``--simple`` flag says to skip generating
a test suite library.

1. ``hello-world.lid`` -- This says what other files are part of the project.
The order in which the files are listed here determines the order in which
the code in them is executed.
1. :file:`hello-world.lid` lists the files in the project. The order in which
the files are listed here determines the order in which the code in them is
loaded. The library definition file should always be first.

2. ``library.dylan`` contains the library and module definitions. These can be
extended as your project grows more complex.
2. :file:`library.dylan` contains the library and module definitions. These
can be extended as your project grows in complexity.

3. ``hello-world.dylan`` contains the main program. Note that the last
top-level definition is a call to the main function, which may have any
name; there is no predefined "main" function that is automatically called.
3. :file:`hello-world.dylan` contains the main program code.

4. ``registry/<platform>/hello-world`` is a "registry file", which contains the
path to the ``hello-world.lid`` file.
4. The :file:`registry` directory is how :program:`dylan-compiler` locates each
used library. When using the :program:`dylan` tool, this directory is
generated for you. See :doc:`source-registries` for details on the registry
format.

The first time you build ``hello-world`` it builds all used libraries, all the
way down to the ``dylan`` library itself. Subsequent compiles only need to
5. :file:`dylan-package.json` describes the new "hello-world" package. This is
where you can specify dependencies, the package location, etc. See the
`dylan-tool documentation
<https://docs.opendylan.org/packages/dylan-tool/documentation/source/index.html>`_
for more on this. Note that the existence of this file turns the
"hello-world" directory into a :program:`dylan` workspace.

The first time you build ``hello-world`` all used libraries are built, all the
way down to the ``dylan`` library itself. Subsequent builds only need to
recompile ``hello-world`` itself and are therefore much faster.

``dylan-compiler`` has a batch mode and an interactive mode. The ``-build``
option says to build the project in batch mode. When you pass a ".lid" file to
the compiler it builds the library described by that file. In the next section
you'll see that you can also pass the name of the project (without ".lid") and
it will use "registries" to find the project sources.
.. note:: Don't confuse the ``dylan`` library with the :program:`dylan`
executable program. The ``dylan`` library contains the core Dylan
language features that are not implemented inside the compiler. The
``dylan`` program is a tool to help manager Dylan projects and is
created from a library called ``dylan-tool``.

The compiler places its output in the ``_build`` directory in the
current working directory. This includes the libraries and executables
that it builds. You can run the executable as noted above from this
location.
The compiler places its output in the ``_build`` directory in the current
working directory. This includes the libraries and executables that it builds.
You can run the executable from this location, as noted above.
4 changes: 2 additions & 2 deletions documentation/getting-started-cli/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ the Open Dylan IDE
<https://opendylan.org/documentation/getting-started-ide/>`_.

The compiler executable is called ``dylan-compiler``. There is a helper
application called ``make-dylan-app``, which can be used to generate some
application called :program:`dylan`, which can be used to generate some
boilerplate for a new project, and finally there's ``DIME`` and ``dswank``, a
pair of tools for interactive development in Emacs. This document describes
these tools.
Expand All @@ -21,7 +21,7 @@ these tools.
copyright
hello-world
source-registries
adding-new-libraries
managing-dependencies
quick-tips
dylan-compiler
dylan-environment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
Adding New Libraries
====================
Managing Dependencies
=====================

.. note:: There is a new package system and ``dylan`` tool packaged with the
Open Dylan release which provides an alternative to using Git
submodules. It automatically downloads dependencies, creates registry
files for you, and uses Semantic Versioning to specify
dependencies. See the `dylan-tool`_ docs for more information.
We recommend managing inter-library dependencies by use of the Dylan package
manager and the :program:`dylan` tool. When using the :program:`dylan` tool
dependencies are added to the "dylan-package.json" file in your project. Each
dependency includes a `semantic version <https://semver.org>`_ and `dependency
resolution
<https://docs.opendylan.org/packages/dylan-tool/documentation/source/pacman.html#dependency-resolution>`_
is done with "minimal version selection". See the `dylan-tool`_ documentation
for details.

The second way to manage dependencies is to use Git submodules. The remainder
of this document explains how to do that.

Adding a Git Submodule
----------------------

One way of handling inter-library dependencies is to use git submodules. This
allows you to specify a precise version that you rely upon, but assumes that
we're all using git.
Git submodules allow you to specify a precise version that you rely upon, but
they assume that everyone is using Git.

We tend to keep all git submodules in a top level directory
We tend to keep all Git submodules in a top level directory
within the repository named ``ext``. To add a new submodule::

git submodule add <repository URL> ext/<name>
Expand Down Expand Up @@ -64,8 +69,9 @@ that you're using.
Transitive Dependencies
-----------------------

The Dylan compiler won't find transitive dependencies, so you
will need to create registry entries for them as well.
The Dylan compiler won't find transitive dependencies automatically (unless you
are using `dylan-tool`_), so you will need to create registry entries for them
as well.

Sometimes, you will want to create git submodules for them as
well, but other times you can just reference them from the
Expand All @@ -74,8 +80,6 @@ version that was pulled in with the existing submodule.
As an example, if you pull in the HTTP library, it has
a number of submodules, so you don't need to pull each
of those in directly, but can reference them through
the ``ext/http/`` directory. (Note in this case that
the ``http`` library uses a non-standard name for the
directory holding its submodules.)
the ``ext/http/`` directory.

.. _dylan-tool: https://docs.opendylan.org/packages/dylan-tool/documentation/source/index.html
Loading