comparison ibin/brachylog/Brachylog-master/README.md @ 11865:318de151d0ec draft

<b_jonas> python3 -cimport os,zipfile; os.chdir("ibin/brachylog"); zipfile.ZipFile("master.zip").extractall()
author HackEso <hackeso@esolangs.org>
date Tue, 16 Jul 2019 21:37:27 +0000
parents
children
comparison
equal deleted inserted replaced
11864:d054de7f80f2 11865:318de151d0ec
1 <p align="center"><a href="https://github.com/JCumin/Brachylog"><img src="https://github.com/JCumin/Brachylog/blob/master/misc/brachylog_logo.png" alt="Brachylog" width="600"/></a></p>
2
3 # What is it?
4
5 Brachylog is a declarative logic programming language much like Prolog. Brachylog is designed to be much terser than Prolog, while retaining some readability.
6
7 Currently in development.
8
9 Brachylog uses [SWI-Prolog](http://www.swi-prolog.org/) as Prolog engine.
10
11 ## How do I use this?
12
13 ### Documentation
14
15 Check out [Brachylog's Wiki](https://github.com/JCumin/Brachylog/wiki) if you want to learn how to write programs in this language.
16
17 You may want to watch this [**short video introduction to Brachylog**](https://www.youtube.com/watch?v=XYVhZ-MFcUs).
18
19 ### Try it online!
20
21 You can try out Brachylog on [Try it online!](https://tio.run/nexus/brachylog2), thanks to @DennisMitchell.
22
23 ### Brachylog language bar
24
25 [You can find here](https://abrudz.github.io/lb/brachylog) the Brachylog language bar which gives you access to all symbols used in Brachylog on any webpage (by clicking on the symbols or by inputing shortcuts), thanks to @abrudz.
26
27 ### The interpreter
28
29 Brachylog's interpreter is entirely written in Prolog. Therefore, installing [SWI-Prolog](http://www.swi-prolog.org/) (version 7 and up) is mandatory to use Brachylog (We do not guarantee that Brachylog's interpreter will be compatible with any other Prolog implementation).
30
31 To run Brachylog's interpreter, start SWI-Prolog's interpreter inside the `src` directory available in this repository, and consult the file `brachylog.pl` (`consult(brachylog).`). Alternatively, you can run the interpreter with:
32
33 $ swipl src/brachylog.pl
34
35 You can then run Brachylog programs using different predicates:
36
37 - `run_from_file(FileName, Input, Output)`: `FileName` is an atom (i.e. between single quotes `'`) representing the file containing your Brachylog code. For example: `run_from_file('code.brachylog',"Test Input",Z)`.
38
39 - `run_from_atom(Code, Input, Output)`: `Code` is an atom (i.e. between single quotes `'`) containing your Brachylog code. For example: `run_from_atom('∧"Hello, World!"w',_,_)`. Note that you will have to escape certain characters in `Code`.
40
41 - `run(Input, Output)`: This will run a Brachylog program that has already been transpiled to Prolog using either of the two previous predicates. More precisely, this will query `brachylog_main/2` in the file `compiled_brachylog.pl`.
42
43 The first two predicates will transpile your Brachylog program into Prolog, subsequently generating a file called `compiled_brachylog.pl` in the same directory that contains `brachylog.pl`. The three run predicates will then consult it and query `brachylog_main/3`.
44
45 Note that the first two run predicates also exist with either no `Output` argument, or with no `Input` nor `Output` argument, if necessary. For example, `run_from_file('code.brachylog')` is equivalent to `run_from_file('code.brachylog', _, _)`.
46
47
48 ### Contributors
49
50 - Julien Cumin - [@JCumin](https://github.com/JCumin)
51
52 - Markus Triska - [@triska](https://github.com/triska)
53
54 - ais523
55
56 - [@UnrelatedString](https://github.com/UnrelatedString)