Skip to content
Open
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
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM debian

SHELL ["/bin/bash", "-c"]

RUN apt-get update
RUN apt install -y git \
python3 \
python3-pytest \
fasm \
nodejs \
wabt
RUN ln -s /usr/bin/python3 /usr/bin/python

WORKDIR /
RUN mkdir cont
COPY . cont
WORKDIR cont
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ I just mixed beginning of that word and tried to come up with something, that so
# Quick Start
You can learn the language by using the ["Learn cont" manual](https://github.com/farkon00/cont/blob/master/learn-cont/00-learn-cont.md)

```bash
To use the language you need to install the following dependencies:
- python3
- pip
- fasm
- wabt(required only for the `wat64` target)
Also we recommend installing the following dependencies for testing purposes:
- nodejs

To setup directly on your machine:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is debian/ubuntu specific. For people on Arch, RHEL, nix,.etc it wont work hence the qualifier.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is debian/ubuntu specific. For people on Arch, RHEL, nix,.etc it wont work hence the qualifier.

Yes, but the comment right next to the apt command specifies to use your package manager and the only command, that changes depending on your distro, is that apt command. I think specifying it to be debian/ubuntu based specifically might confuse people, who might think the only supported option on other distros is to use the docker container.

```console
$ python3 -V
Python >=3.10

Expand All @@ -26,6 +35,38 @@ $ pytest test.py
$ python3 cont.py <source_code>.cn -r
```

Alternatively you may use the Dockerfile provided and work inside a container.

In the cont directory
```bash
docker build --tag cont .
```
Then
```bash
docker run -it cont /bin/bash
```
```console
cont $ docker run -it cont /bin/bash
bitchebis@6caa64b7c4b9:~/cont$ pytest test.py
=================================== test session starts ===================================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
rootdir: /home/bitchebis/cont
collected 40 items

test.py ........................................ [100%]

=================================== 40 passed in 2.52s ====================================
bitchebis@6caa64b7c4b9:~/cont$
```

If you want to mount your local filesystem to the container then:
```sh
LOCALDIR=~/code/cont
```
```sh
docker run --mount type=bind,source=$LOCALDIR,target=/code -it cont /bin/bash
Copy link
Owner

@farkon00 farkon00 May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way of mounting a local directory doesn't work in all cases, because of permission issues. We should find a better way to handle this.

```

# Examples
You can find more examples in `tests` or `examples` folders or
in the standard library source, which can be found in `std`.
Expand Down