Project

General

Profile

ComparisonWithPygments » History » Version 1

Kornelius Kalnbach, 12/05/2010 02:55 AM

1 1 Kornelius Kalnbach
h1. Comparison with Pygments
2 1 Kornelius Kalnbach
3 1 Kornelius Kalnbach
h2. General sifferences
4 1 Kornelius Kalnbach
5 1 Kornelius Kalnbach
* CodeRay is a Ruby library, Pygments is written in Python.
6 1 Kornelius Kalnbach
* CodeRay supports 19 languages, while Pygments supports over 90.
7 1 Kornelius Kalnbach
* CodeRay has handwritten scanners. In Pygments, scanners are defined with a scanner DSL.
8 1 Kornelius Kalnbach
9 1 Kornelius Kalnbach
h2. Handwritten vs. DSL, Pro & Contra
10 1 Kornelius Kalnbach
11 1 Kornelius Kalnbach
The last two differences in the list above are very much related.
12 1 Kornelius Kalnbach
13 1 Kornelius Kalnbach
h3. Pro: handwritten scanners (CodeRay)
14 1 Kornelius Kalnbach
15 1 Kornelius Kalnbach
* faster
16 1 Kornelius Kalnbach
** lots of fine tuning is possible
17 1 Kornelius Kalnbach
** no overhead for DSL transformation and interpretation
18 1 Kornelius Kalnbach
* more flexible
19 1 Kornelius Kalnbach
20 1 Kornelius Kalnbach
h3. Pro: scanner definition (Pygments)
21 1 Kornelius Kalnbach
22 1 Kornelius Kalnbach
* easier to write, read, and maintain
23 1 Kornelius Kalnbach
** less code
24 1 Kornelius Kalnbach
* DSL interpreter can be optimized/changed independently
25 1 Kornelius Kalnbach
* porting scanners is easier
26 1 Kornelius Kalnbach
* use of higher-level features (like token groups) is simple
27 1 Kornelius Kalnbach
28 1 Kornelius Kalnbach
h2. Other differences