From 99ba8c18fe0e3cac795071c22f40f9426d92b078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Teichgr=C3=A4ber?= Date: Sat, 21 Apr 2012 01:44:22 +0200 Subject: [PATCH] README: update to reflect changes for Go 1, cleanup --- README.markdown | 69 +++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 43 deletions(-) diff --git a/README.markdown b/README.markdown index 556f1a4..8f2bd2d 100644 --- a/README.markdown +++ b/README.markdown @@ -22,74 +22,59 @@ concatenating ten [Markdown syntax descriptions][syntax]. [syntax]: http://daringfireball.net/projects/markdown/syntax.text -In [December 2010][dec], the `8g` compiled Go version still was -around 3.5 times slower than the original C version. - - [dec]: https://github.com/knieriem/markdown/commit/b3f7b3 - -In the meantime Go compilers and runtime have been improved, -which reduced the factor down to around 2.5 for both `8g` and `6g` -for the unmodified sources. - -After some current changes to the peg/leg parser generator -the Markdown parser can take advantage of the *switch* optimization -now. This further reduced the execution time difference -to 1.9x for `6/8g`. +The C version is still around 1.9x faster than the Go version. ## Installation -Provided you have a recent copy of Go, and git is available, +Provided you have a copy of Go 1, and git is available, - goinstall github.com/knieriem/markdown + go get github.com/knieriem/markdown -should install the package into -`$GOROOT/src/pkg/github.com/knieriem/markdown`, and build -it. +should download and install the package according to +your GOPATH settings. See doc.go for an example how to use the package. To create the command line program *markdown,* run - cd $GOROOT/src/pkg/github.com/knieriem/markdown - gomake cmd + go build github.com/knieriem/markdown/cmd/markdown -the binary should then be available in subdirectory *cmd.* +the binary should then be available in the current directory. To run the Markdown 1.0.3 test suite, type - make mdtest + make test -This will download peg-markdown, in case you have `git` -available, build cmd/markdown, and run the test suite. +This will download peg-markdown, in case you have Mercurial +and the hg-git extension available, build cmd/markdown, and +run the test suite. -The test suite will fail on one test, for the same reason which +The test suite should fail on exactly one test – +*Ordered and unordered lists* –, for the same reason which applies to peg-markdown, because the grammar is the same. See the [original README][] for details. [original README]: https://github.com/jgm/peg-markdown/blob/master/README.markdown + ## Development -[`Goinstall`][Goinstall] is creating its own Makefiles to build -packages, based on the `.go` files found in the directory. -It would not know about `parser.leg.go`, which had to be built -by `leg` from the `parser.leg` grammar source file first. -Because of this, to make *markdown* installable using -`goinstall`, `parser.leg.go` has been added to the VCS. +There is not yet a way to create a Go source file like +`parser.leg.go` automatically from another file, `parser.leg`, +when building packages and commands using the Go tool. To make +*markdown* installable using `go get`, `parser.leg.go` has +been added to the VCS. -`Make` will update `parser.leg.go` using `leg`, which is part of -[knieriem/peg][] at github, if parser.leg has been changed. If -a copy of this package has not yet been downloaded -- i.e. no -directory `./peg` is present --, `make` will perform the -necessary steps automatically (run `make peg` to manually -download [knieriem/peg][]). +`Make parser` will update `parser.leg.go` using `leg`, which +is part of [knieriem/peg][] at github, if parser.leg has +been changed, or if the Go file is missing. If a copy of *peg* +is not yet present on your system, run -To update [knieriem/peg][] run `gomake update-peg`. This will -fetch available revisions from github, and remove the old -*leg* binary. + go get github.com/knieriem/peg + +Then `make parser` should succeed. -[goinstall]: http://golang.org/cmd/goinstall/ [knieriem/peg]: https://github.com/knieriem/peg @@ -115,8 +100,6 @@ As definition item markers both `:` and `~` can be used. * Implement tables -* Rename element key identifiers, so that they are not public - * Where appropriate, use more idiomatic Go code ## Subdirectory Index