@@ -6,11 +6,11 @@ h1. Final Chapter: Ruby's future
6
6
7
7
h2. Issues to be addressed
8
8
9
- @ ruby@ isn't 'completely finished' software. It's still being developed,
9
+ ` ruby` isn't 'completely finished' software. It's still being developed,
10
10
there are still a lot of issues. Firstly, we want to try removing
11
11
inherent problems in the current interpreter.
12
12
13
- The order of the topics is mostly in the same order as the chapters of
13
+ The order of the topics is mostly in the same order as the chapters of
14
14
this book.
15
15
16
16
@@ -43,41 +43,41 @@ there might be the necessity to consider Incremental GC.
43
43
44
44
h3. Implementation of parser
45
45
46
- As we saw in Part 2, the implementation of @ ruby@ parser has already utilized
47
- @ yacc@ 's ability to almost its limit, thus I can't think it can endure further
46
+ As we saw in Part 2, the implementation of ` ruby` parser has already utilized
47
+ ` yacc` 's ability to almost its limit, thus I can't think it can endure further
48
48
expansions. It's all right if there's nothing planned to expand,
49
49
but a big name "keyword argument" is planned next
50
50
and it's sad if we could not express another demanded grammar because of the
51
- limitation of @ yacc@ .
51
+ limitation of ` yacc` .
52
52
53
53
54
54
h3. Reuse of parser
55
55
56
- Ruby's parser is very complex. In particular, dealing with around @ lex_state@
56
+ Ruby's parser is very complex. In particular, dealing with around ` lex_state`
57
57
seriously is very hard. Due to this, embedding a Ruby program or creating a
58
58
program to deal with a Ruby program itself is quite difficult.
59
59
60
- For example, I'm developing a tool named @ racc@ ,
61
- which is prefixed with R because it is a Ruby-version @ yacc@ .
62
- With @ racc@ , the syntax of grammar files are almost the same as @ yacc@
60
+ For example, I'm developing a tool named ` racc` ,
61
+ which is prefixed with R because it is a Ruby-version ` yacc` .
62
+ With ` racc` , the syntax of grammar files are almost the same as ` yacc`
63
63
but we can write actions in Ruby.
64
64
To do so, it could not determine the end of an action without parsing Ruby code
65
65
properly, but "properly" is very difficult. Since there's no other choice,
66
66
currently I've compromised at the level that it can parse "almost all".
67
67
68
68
As another example which requires analyzing Ruby program,
69
- I can enumerate some tools like @ indent@ and @ lint@ ,
69
+ I can enumerate some tools like ` indent` and ` lint` ,
70
70
but creating such tool also requires a lot efforts.
71
71
It would be desperate if it is something complex like a refactoring tool.
72
72
73
73
Then, what can we do? If we can't recreate the same thing,
74
- what if @ ruby@ 's original parser can be used as a component?
74
+ what if ` ruby` 's original parser can be used as a component?
75
75
In other words, making the parser itself a library.
76
76
This is a feature we want by all means.
77
77
78
- However, what becomes problem here is, as long as @ yacc@ is used,
78
+ However, what becomes problem here is, as long as ` yacc` is used,
79
79
we cannot make parser reentrant.
80
- It means, say, we cannot call @ yyparse()@ recursively,
80
+ It means, say, we cannot call ` yyparse()` recursively,
81
81
and we cannot call it from multiple threads.
82
82
Therefore, it should be implemented in the way of not returning control to Ruby
83
83
while parsing.
@@ -86,33 +86,33 @@ while parsing.
86
86
87
87
h3. Hiding Code
88
88
89
- With current @ ruby@ , it does not work without the source code of the program to
89
+ With current ` ruby` , it does not work without the source code of the program to
90
90
run. Thus, people who don't want others to read their source code might have
91
91
trouble.
92
92
93
93
94
94
h3. Interpretor Object
95
95
96
- Currently each process cannot have multiple @ ruby@ interpretors,
96
+ Currently each process cannot have multiple ` ruby` interpretors,
97
97
this was discussed in Chapter 13.
98
98
If having multiple interpretors is practically possible, it seems better,
99
99
but is it possible to implement such thing?
100
100
101
101
102
102
h3. The structure of evaluator
103
103
104
- Current @ eval.c@ is, above all, too complex.
104
+ Current ` eval.c` is, above all, too complex.
105
105
Embedding Ruby's stack frames to machine stack could occasionally become the
106
- source of trouble, using @ setjmp() longjmp()@ aggressively makes it less easy to
106
+ source of trouble, using ` setjmp() longjmp()` aggressively makes it less easy to
107
107
understand and slows down its speed.
108
- Particularly with RISC machine, which has many registers, using @ setjmp()@
109
- aggressively can easily cause slowing down because @ setjmp()@ set aside all
108
+ Particularly with RISC machine, which has many registers, using ` setjmp()`
109
+ aggressively can easily cause slowing down because ` setjmp()` set aside all
110
110
things in registers.
111
111
112
112
113
113
h3. The performance of evaluator
114
114
115
- @ ruby@ is already enough fast for ordinary use.
115
+ ` ruby` is already enough fast for ordinary use.
116
116
But aside from it, regarding a language processor,
117
117
definitely the faster is the better.
118
118
To achieve better performance, in other words to optimize,
@@ -136,17 +136,17 @@ So I profiled.
136
136
137
137
This is a profile when running some application but
138
138
this is approximately the profile of a general Ruby program.
139
- @ rb_eval()@ appeared in the overwhelming percentage being at the top,
139
+ ` rb_eval()` appeared in the overwhelming percentage being at the top,
140
140
after that, in addition to functions of GC, evaluator core,
141
141
functions that are specific to the program are mixed.
142
142
For example, in the case of this application,
143
- it takes a lot of time for regular expression match (@ ruby_re_match@ ).
143
+ it takes a lot of time for regular expression match (` ruby_re_match` ).
144
144
145
145
However, even if we understood this, the question is how to improve it.
146
- To think simply, it can be archived by making @ rb_eval()@ faster.
147
- That said, but as for @ ruby@ core, there are almost not any room which can be
148
- easily optimized. For instance, apparently "tail recursive -> @ goto@ conversion"
149
- used in the place of @ NODE_IF@ and others has already applied almost all
146
+ To think simply, it can be archived by making ` rb_eval()` faster.
147
+ That said, but as for ` ruby` core, there are almost not any room which can be
148
+ easily optimized. For instance, apparently "tail recursive -> ` goto` conversion"
149
+ used in the place of ` NODE_IF` and others has already applied almost all
150
150
possible places it can be applied.
151
151
In other words, without changing the way of thinking fundamentally,
152
152
there's no room to improve.
@@ -156,7 +156,7 @@ h3. The implementation of thread
156
156
157
157
This was also discussed in Chapter 19. There are really a lot of issues about
158
158
the implementation of the current ruby's thread. Particularly, it cannot mix
159
- with native threads so badly. The two great advantages of @ ruby@ 's thread,
159
+ with native threads so badly. The two great advantages of ` ruby` 's thread,
160
160
(1) high portability (2) the same behavior everywhere,
161
161
are definitely incomparable, but probably that implementation is something we
162
162
cannot continue to use eternally, isn't it?
0 commit comments