Skip to content

Commit fb77be1

Browse files
committed
Rewrote the installation section
1 parent 056e208 commit fb77be1

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

README.md

+17-21
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Table of Contents
66

77
* [math-compiler](#math-compiler)
88
* [Installation](#installation)
9-
* [Source Installation go <= 1.11](#source-installation-go---111)
10-
* [Source installation go >= 1.12](#source-installation-go---112)
119
* [Quick Overview](#quick-overview)
1210
* [About Our Output](#about-our-output)
1311
* [Test Cases](#test-cases)
@@ -17,6 +15,8 @@ Table of Contents
1715
* [Github Setup](#github-setup)
1816

1917

18+
19+
2020
# math-compiler
2121

2222
This project contains the simplest possible compiler, which converts mathematical operations into assembly language, allowing all the speed in your sums!
@@ -56,27 +56,24 @@ Some errors will be caught at run-time, as the generated code has support for:
5656
* For example this program is invalid `3 +`, because the addition operator requires two operands. (i.e. `3 4 +`)
5757

5858

59-
## Installation
60-
61-
There are two ways to install this project from source, which depend on the version of the [go](https://golang.org/) version you're using.
62-
63-
If you just need the binaries you can find them upon the [project release page](https://github.com/skx/math-compiler/releases).
64-
65-
66-
### Source Installation go <= 1.11
6759

68-
If you're using `go` before 1.11 then the following command should fetch/update the project and install it upon your system:
60+
## Installation
6961

70-
$ go get -u github.com/skx/math-compiler
62+
If you just need a binary you can find them upon the [project release page](https://github.com/skx/math-compiler/releases), however if you wish to build and install locally you can do that in either of the standard ways:
7163

72-
### Source installation go >= 1.12
64+
1. Install from the latest revision:
7365

74-
If you're using a more recent version of `go` (which is _highly_ recommended), you need to clone to a directory which is not present upon your `GOPATH`:
66+
```sh
67+
$ go install github.com/skx/math-compiler@master
68+
```
7569

76-
git clone https://github.com/skx/math-compiler
77-
cd math-compiler
78-
go install
70+
2. Or you can clone the source, and build from it:
7971

72+
```sh
73+
$ git clone https://github.com/skx/math-compiler
74+
$ cd math-compiler
75+
$ go install .
76+
```
8077

8178

8279

@@ -98,10 +95,9 @@ However I even simplified that, via the use of a "[Reverse Polish](https://en.wi
9895

9996

10097

101-
10298
## About Our Output
10399

104-
The output of `math-compiler` will typically be an assembly-language file, which then needs to be compiled before it may be executed.
100+
The output of `math-compiler` will be an assembly-language file, which then needs to be compiled before it may be executed.
105101

106102
Given our previous example of `2 + ( 4 * 54)` we can compile & execute that program like so:
107103

@@ -128,6 +124,7 @@ Or to compile __and__ execute directly:
128124
Result 12
129125

130126

127+
131128
## Test Cases
132129

133130
The codebase itself contains some simple test-cases, however these are not comprehensive as a large part of our operation is merely to populate a simple template-file, and it is hard to test that.
@@ -153,8 +150,6 @@ they produce the correct result.
153150
...
154151

155152

156-
157-
158153
### Debugging the generated programs
159154

160155
If you run the compiler with the `-debug` flag a breakpoint will be generated
@@ -215,6 +210,7 @@ Further documentation can be found in the `gdb` manual, which is worth reading
215210
if you've an interest in compilers, debuggers, and decompilers.
216211

217212

213+
218214
## Possible Expansion?
219215

220216
The obvious thing to improve in this compiler is to add support for more operations. At the moment support for the most obvious/common operations is present, but perhaps more functions could be added.

0 commit comments

Comments
 (0)