@@ -6,11 +6,11 @@ h1. Final Chapter: Ruby's future
66
77h2. Issues to be addressed
88
9- @ ruby@ isn't 'completely finished' software. It's still being developed,
9+ ` ruby` isn't 'completely finished' software. It's still being developed,
1010there are still a lot of issues. Firstly, we want to try removing
1111inherent problems in the current interpreter.
1212
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
1414this book.
1515
1616
@@ -43,41 +43,41 @@ there might be the necessity to consider Incremental GC.
4343
4444h3. Implementation of parser
4545
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
4848expansions. It's all right if there's nothing planned to expand,
4949but a big name "keyword argument" is planned next
5050and it's sad if we could not express another demanded grammar because of the
51- limitation of @ yacc@ .
51+ limitation of ` yacc` .
5252
5353
5454h3. Reuse of parser
5555
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`
5757seriously is very hard. Due to this, embedding a Ruby program or creating a
5858program to deal with a Ruby program itself is quite difficult.
5959
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`
6363but we can write actions in Ruby.
6464To do so, it could not determine the end of an action without parsing Ruby code
6565properly, but "properly" is very difficult. Since there's no other choice,
6666currently I've compromised at the level that it can parse "almost all".
6767
6868As 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` ,
7070but creating such tool also requires a lot efforts.
7171It would be desperate if it is something complex like a refactoring tool.
7272
7373Then, 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?
7575In other words, making the parser itself a library.
7676This is a feature we want by all means.
7777
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,
7979we cannot make parser reentrant.
80- It means, say, we cannot call @ yyparse()@ recursively,
80+ It means, say, we cannot call ` yyparse()` recursively,
8181and we cannot call it from multiple threads.
8282Therefore, it should be implemented in the way of not returning control to Ruby
8383while parsing.
@@ -86,33 +86,33 @@ while parsing.
8686
8787h3. Hiding Code
8888
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
9090run. Thus, people who don't want others to read their source code might have
9191trouble.
9292
9393
9494h3. Interpretor Object
9595
96- Currently each process cannot have multiple @ ruby@ interpretors,
96+ Currently each process cannot have multiple ` ruby` interpretors,
9797this was discussed in Chapter 13.
9898If having multiple interpretors is practically possible, it seems better,
9999but is it possible to implement such thing?
100100
101101
102102h3. The structure of evaluator
103103
104- Current @ eval.c@ is, above all, too complex.
104+ Current ` eval.c` is, above all, too complex.
105105Embedding 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
107107understand 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
110110things in registers.
111111
112112
113113h3. The performance of evaluator
114114
115- @ ruby@ is already enough fast for ordinary use.
115+ ` ruby` is already enough fast for ordinary use.
116116But aside from it, regarding a language processor,
117117definitely the faster is the better.
118118To achieve better performance, in other words to optimize,
@@ -136,17 +136,17 @@ So I profiled.
136136
137137This is a profile when running some application but
138138this 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,
140140after that, in addition to functions of GC, evaluator core,
141141functions that are specific to the program are mixed.
142142For 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` ).
144144
145145However, 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
150150possible places it can be applied.
151151In other words, without changing the way of thinking fundamentally,
152152there's no room to improve.
@@ -156,7 +156,7 @@ h3. The implementation of thread
156156
157157This was also discussed in Chapter 19. There are really a lot of issues about
158158the 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,
160160(1) high portability (2) the same behavior everywhere,
161161are definitely incomparable, but probably that implementation is something we
162162cannot continue to use eternally, isn't it?
0 commit comments