<bdo id='BFwLr'></bdo><ul id='BFwLr'></ul>

        <i id='BFwLr'><tr id='BFwLr'><dt id='BFwLr'><q id='BFwLr'><span id='BFwLr'><b id='BFwLr'><form id='BFwLr'><ins id='BFwLr'></ins><ul id='BFwLr'></ul><sub id='BFwLr'></sub></form><legend id='BFwLr'></legend><bdo id='BFwLr'><pre id='BFwLr'><center id='BFwLr'></center></pre></bdo></b><th id='BFwLr'></th></span></q></dt></tr></i><div id='BFwLr'><tfoot id='BFwLr'></tfoot><dl id='BFwLr'><fieldset id='BFwLr'></fieldset></dl></div>
      1. <small id='BFwLr'></small><noframes id='BFwLr'>

        <tfoot id='BFwLr'></tfoot>
      2. <legend id='BFwLr'><style id='BFwLr'><dir id='BFwLr'><q id='BFwLr'></q></dir></style></legend>

      3. JVM 会阻止尾调用优化吗?

        Does the JVM prevent tail call optimizations?(JVM 会阻止尾调用优化吗?)
      4. <tfoot id='6y9n5'></tfoot>
          <bdo id='6y9n5'></bdo><ul id='6y9n5'></ul>

            1. <i id='6y9n5'><tr id='6y9n5'><dt id='6y9n5'><q id='6y9n5'><span id='6y9n5'><b id='6y9n5'><form id='6y9n5'><ins id='6y9n5'></ins><ul id='6y9n5'></ul><sub id='6y9n5'></sub></form><legend id='6y9n5'></legend><bdo id='6y9n5'><pre id='6y9n5'><center id='6y9n5'></center></pre></bdo></b><th id='6y9n5'></th></span></q></dt></tr></i><div id='6y9n5'><tfoot id='6y9n5'></tfoot><dl id='6y9n5'><fieldset id='6y9n5'></fieldset></dl></div>

              <small id='6y9n5'></small><noframes id='6y9n5'>

                <tbody id='6y9n5'></tbody>
                • <legend id='6y9n5'><style id='6y9n5'><dir id='6y9n5'><q id='6y9n5'></q></dir></style></legend>
                  本文介绍了JVM 会阻止尾调用优化吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在这个问题上看到了这句话:构建 Web 服务的好的函数式语言是什么?

                  I saw this quote on the question: What is a good functional language on which to build a web service?

                  特别是 Scala 不支持尾调用消除,除非在自递归函数中,这限制了您可以执行的组合类型(这是 JVM 的基本限制).

                  Scala in particular doesn't support tail-call elimination except in self-recursive functions, which limits the kinds of composition you can do (this is a fundamental limitation of the JVM).

                  这是真的吗?如果是这样,那么造成这种基本限制的 JVM 是什么?

                  Is this true? If so, what is it about the JVM that creates this fundamental limitation?

                  推荐答案

                  这篇文章:递归还是迭代? 可能会有所帮助.

                  This post: Recursion or Iteration? might help.

                  简而言之,由于安全模型和需要始终提供可用的堆栈跟踪,尾调用优化很难在 JVM 中进行.这些要求理论上可以得到支持,但它可能需要一个新的字节码(参见 John Rose 的非正式提案).

                  In short, tail call optimization is hard to do in the JVM because of the security model and the need to always have a stack trace available. These requirements could in theory be supported, but it would probably require a new bytecode (see John Rose's informal proposal).

                  Sun bug #4726340 中也有更多讨论,评估(从 2002 年开始)在哪里结束:

                  There is also more discussion in Sun bug #4726340, where the evaluation (from 2002) ends:

                  我相信这仍然可以完成,但这不是一项小任务.

                  I believe this could be done nonetheless, but it is not a small task.

                  目前,达芬奇机器正在进行一些工作项目.尾调用子项目的状态列为proto 80%";它不太可能进入 Java 7,但我认为它很有可能进入 Java 8.

                  Currently, there is some work going on in the Da Vinci Machine project. The tail call subproject's status is listed as "proto 80%"; it is unlikely to make it into Java 7, but I think it has a very good chance at Java 8.

                  这篇关于JVM 会阻止尾调用优化吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Bytecode features not available in the Java language(Java 语言中不可用的字节码功能)
                  ClassCastException because of classloaders?(ClassCastException 因为类加载器?)
                  How can I add a Javaagent to a JVM without stopping the JVM?(如何在不停止 JVM 的情况下将 Javaagent 添加到 JVM?)
                  Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )(无法在 32 位 JVM 上加载 64 位 SWT 库(替换 SWT 文件))
                  Encourage the JVM to GC rather than grow the heap?(鼓励 JVM 进行 GC 而不是增加堆?)
                  Why a sawtooth shaped graph?(为什么是锯齿形图形?)
                  • <legend id='Pd4Tn'><style id='Pd4Tn'><dir id='Pd4Tn'><q id='Pd4Tn'></q></dir></style></legend>
                      <tbody id='Pd4Tn'></tbody>

                    1. <i id='Pd4Tn'><tr id='Pd4Tn'><dt id='Pd4Tn'><q id='Pd4Tn'><span id='Pd4Tn'><b id='Pd4Tn'><form id='Pd4Tn'><ins id='Pd4Tn'></ins><ul id='Pd4Tn'></ul><sub id='Pd4Tn'></sub></form><legend id='Pd4Tn'></legend><bdo id='Pd4Tn'><pre id='Pd4Tn'><center id='Pd4Tn'></center></pre></bdo></b><th id='Pd4Tn'></th></span></q></dt></tr></i><div id='Pd4Tn'><tfoot id='Pd4Tn'></tfoot><dl id='Pd4Tn'><fieldset id='Pd4Tn'></fieldset></dl></div>

                        <bdo id='Pd4Tn'></bdo><ul id='Pd4Tn'></ul>
                        <tfoot id='Pd4Tn'></tfoot>

                        <small id='Pd4Tn'></small><noframes id='Pd4Tn'>