Skip to content

Commit f4d003e

Browse files
author
theindigamer
committedAug 14, 2017
Renames files and adds some stuff to the README.
* `README` now has some actual information instead of being full of nothingness. * Renaming according to `.b` convention as `.bf` is for Befunge which came earlier. * Comments out unnecessary dependencies on shexp etc. for now. * Adds Mandelbrot output file. * Makes small corrections to documentation.
1 parent dc8f607 commit f4d003e

16 files changed

+158
-26
lines changed
 

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
_build/
2+
b2piet.docdir
23
*.byte
34
*.native
45
*.png
56
*.ppm
67
src/metaJson_*
7-
bf2p-meta.json
8+
b2piet-meta.json
89
*.log
910
?piet

‎README.md

-1
This file was deleted.

‎_tags

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
<src/metaJson_*> : package(atdgen)
33
<src/utils.*>: package(camlimages.all_formats), package(integers), package(atdgen)
44
<src/printer.*>: package(camlimages.all_formats)
5-
<src/bf2piet.*>: package(cmdliner), package(camlimages.all_formats), package(atdgen), package(integers)
6-
<src/tests.*>: package(oUnit), package(qcheck), package(atdgen), package(integers), package(camlimages.all_formats), package(cmdliner), package(shexp.process), thread
5+
<src/b2piet.*>: package(cmdliner), package(camlimages.all_formats), package(atdgen), package(integers)
6+
<src/tests.*>: package(qcheck), package(atdgen), package(integers), package(camlimages.all_formats), package(cmdliner)

‎bf2piet.odocl ‎b2piet.odocl

File renamed without changes.

‎docs/README.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# b2piet: A Brainfuck to Piet transpiler
2+
3+
## What :open_mouth:
4+
5+
## Hi :smile:
6+
7+
Pick your favourite tagline:
8+
9+
> Fast, correct and beautiful - pick 3.
10+
11+
> Fucking drawings.
12+
13+
> Ultrapostmodern polyfunctional cybergraffiti.
14+
15+
> :arrow_forward::fu::computer::tractor::no_good::art::computer::rocket::metal:
16+
17+
## Build :cold_sweat:
18+
19+
### Pre-requisites
20+
21+
#### Platforms
22+
23+
The program has only been tested on Linux.
24+
Ideally, it should work on OS X as is.
25+
It will probably not work on Windows.
26+
27+
#### Dependencies
28+
29+
By default, `b2piet` will only be able to produce `.ppm` and `.bmp` images.
30+
For very large images, the file size will quickly become large if you use `.ppm`
31+
files.
32+
So it is strongly suggested that you install an external library to be able to
33+
save images as `.png` files. The appropriate dependency name can be found
34+
in the `camlimages`'s installation instructions [here][camlimages-install].
35+
36+
It is currently listed as `libpng`, which you can install through your
37+
distribution's package manager.
38+
You should install the Ocaml package `camlimages` (described below) _after_
39+
you've installed `libpng`.
40+
41+
You will need a working installation of Ocaml version
42+
`v : 4.03.0 ≤ v ≤ 4.04.2`.
43+
Versions outside this range may or may not work.
44+
Instructions for installing Ocaml can be found on [ocaml.org][ocaml].
45+
46+
Don't forget to double-check the installed version number before proceeding
47+
to install packages.
48+
49+
You should install the following dependencies using [OPAM][opam]
50+
(OPAM itself will be installed when you install Ocaml):
51+
52+
* `atdgen`
53+
* `batteries`
54+
* `camlimages`
55+
* `cmdliner`
56+
* `integers`
57+
* `ocamlfind`
58+
* `ocamlbuild`
59+
* `qcheck` (for tests)
60+
* `ppx_deriving` (latest version)
61+
* `merlin` (optional, latest version)
62+
63+
These can usually be installed as:
64+
65+
```
66+
# Install libpng using your package manager
67+
opam install atdgen batteries camlimages cmdliner integers ocamlfind ocamlbuild qcheck
68+
opam pin add ppx_deriving --dev-repo
69+
opam pin add merlin --dev-repo
70+
```
71+
72+
Lastly, you will need some version of `make` (e.g. `GNU make`) for ease of use.
73+
74+
[ocaml]: http://ocaml.org/
75+
[opam]: https://opam.ocaml.org/
76+
[camlimages-install]: https://bitbucket.org/camlspotter/camlimages/src/b18e82a3d840c458f5db3f33309dd2d6e97bef91/INSTALL.rst?at=default
77+
78+
## How :sunglasses:
79+
80+
## Thanks :clap:
81+
82+
Thanks to all the developers of our dependencies. Special thanks to authors of
83+
`cmdliner` and `qcheck` for having the best documentation :smile:.

‎design.md ‎docs/design.md

File renamed without changes.

‎ir-block.org ‎docs/ir-block.org

File renamed without changes.

‎layout.md ‎docs/layout.md

File renamed without changes.

‎makefile

+7-6
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,24 @@ metajsonml:
1111
atdgen -j -j-std src/metaJson.atd
1212

1313
bytecode: metajsonml
14-
ocamlbuild -use-ocamlfind src/bf2piet.byte
14+
ocamlbuild -use-ocamlfind src/b2piet.byte
1515

1616
native: metajsonml
17-
ocamlbuild -use-ocamlfind src/bf2piet.native
17+
ocamlbuild -use-ocamlfind src/b2piet.native
1818

1919
clean:
2020
rm -f src/metaJson_*
2121
ocamlbuild -clean
2222

23+
# Use native version as bytecode is *much* slower
2324
test: metajsonml
24-
ocamlbuild -use-ocamlfind src/tests.byte
25-
./tests.byte
25+
ocamlbuild -use-ocamlfind src/tests.native
26+
./tests.native
2627

2728
doc-default:
28-
ocamlbuild -use-ocamlfind bf2piet.docdir/index.html
29+
ocamlbuild -use-ocamlfind b2piet.docdir/index.html
2930

3031
copycss:
31-
cp style/style.css _build/bf2piet.docdir/
32+
cp style/style.css b2piet.docdir/
3233

3334
doc: doc-default copycss

‎out/mandelbrot.out

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDEGFFEEEEDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
2+
AAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDEEEFGIIGFFEEEDDDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBB
3+
AAAAAAAAAAAAABBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDEEEEFFFI KHGGGHGEDDDDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBB
4+
AAAAAAAAAAAABBBBBBBBBBCC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CCCCCCCCBBBBBBBBBBBBBBBBBBBBB
47+
AAAAAAAAAAAAABBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDEEEEFFFI KHGGGHGEDDDDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBB
48+
AAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDEEEFGIIGFFEEEDDDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBB

‎samples/adder.bf ‎samples/adder.b

File renamed without changes.

‎samples/hello.bf ‎samples/hello.b

File renamed without changes.

‎samples/homura.bf ‎samples/homura.b

File renamed without changes.

‎src/bf2piet.ml ‎src/b2piet.ml

+8-8
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,24 @@ let info =
8888
let man = [
8989
`S Manpage.s_examples;
9090
`P "Basic usage:";
91-
`Pre " \\$ ./bf2piet.byte \"+++++++++++++++++++++++++++++++++.\"";
91+
`Pre " \\$ ./b2piet.byte \"+++++++++++++++++++++++++++++++++.\"";
9292
`P "saves a Piet program to `a.png` that prints '!'.";
93-
`P "We can also use code from a `.bf` file:";
94-
`Pre " \\$ ./bf2piet.byte --input bf_samples/hello.bf --output hello.png";
93+
`P "We can also use code from a `.b` file:";
94+
`Pre " \\$ ./b2piet.byte --input samples/hello.b --output hello.png";
9595
`P "The default stack size of 8 is sufficient for small programs but \
9696
will give incorrect results for non-trivial ones. One should try out \
9797
different combinations manually. In the following case, we have \
9898
checked that a stack size of 18 is sufficient.";
99-
`Pre " \\$ ./bf2piet.byte --stack=18 --input bf_samples/homura.bf";
99+
`Pre " \\$ ./b2piet.byte --stack=18 --input samples/homura.b";
100100
`S Manpage.s_bugs;
101-
`P ("Please open an issue on https://github.com/theindigamer/bf-piet/ for \
101+
`P ("Please open an issue on https://github.com/theindigamer/b2piet/ for \
102102
any bugs, or if you need help with using this software. If you do \
103103
not have a Github account and do not wish to create one, please send \
104-
an email to `theindigamer15 AT gmail DOT com` with the bug report.");
104+
me an email (see below) with the bug report.");
105105
`S Manpage.s_authors;
106-
`P "theindigamer"
106+
`P "Varun Gandhi <theindigamer15 AT gmail DOT com>"
107107
]
108-
in Term.info "bf2piet" ~doc ~exits:Term.default_exits ~man
108+
in Term.info "b2piet" ~doc ~exits:Term.default_exits ~man
109109

110110
let get_stack_size ?(use_json = true) ?(stack_auto = true)
111111
?(stack_size = 8) ~str ~bfinstr meta =

‎src/tests.ml

+7-7
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ let full meta str =
5858
Painter.(paint (Fast fpl) Linear) ir_l |> Printer.save_picture "temp.ppm" 1;
5959
bfout_str
6060

61-
let pietevalstr () =
62-
Shexp_process.(eval(pipe (run "./npiet" ["temp.ppm"]) read_all))
61+
(* let pietevalstr () = *)
62+
(* Shexp_process.(eval(pipe (run "./npiet" ["temp.ppm"]) read_all)) *)
6363

6464
let sink f x y =
6565
let _ = f x y in
@@ -77,11 +77,11 @@ let domains_fit_correctly_t =
7777
~count:100 ~name:"Domains fit compactly."
7878
(make bfprog_gen) (domains_fit_correctly meta))
7979

80-
let full_t =
81-
let meta = Utils.MetaJson.get in
82-
QCheck.(Test.make
83-
~count:100 ~name:"End_to_end"
84-
(make bfprog_gen) (fun s -> (=) (pietevalstr ()) @@ full meta s))
80+
(* let full_t = *)
81+
(* let meta = Utils.MetaJson.get in *)
82+
(* QCheck.(Test.make *)
83+
(* ~count:100 ~name:"End_to_end" *)
84+
(* (make bfprog_gen) (fun s -> (=) (pietevalstr ()) @@ full meta s)) *)
8585

8686
let _ = QCheck_runner.set_verbose true
8787
let _ = QCheck_runner.run_tests_main [

‎src/utils.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ module MetaJson = struct
612612
| None -> h in
613613
String.fold_left go fnv_offset_basis s
614614

615-
let metafile = "bf2p-meta.json"
615+
let metafile = "b2piet-meta.json"
616616

617617
let filestr fname =
618618
if Sys.file_exists fname then

0 commit comments

Comments
 (0)
Please sign in to comment.