Giter Site home page Giter Site logo

Comments (14)

objeck avatar objeck commented on June 12, 2024

Is this for source and libraries? I feel libraries need their existing flags (i.e. native) for consistent performance.

from objeck-lang.

objeck avatar objeck commented on June 12, 2024

I will look into this for the next release. This is more of a runtime vs. compiler issue. The compiler may link libraries that use the native keyword. If so, the JIT compiler must be disabled within the VM. I am also concerned with overall performance.

from objeck-lang.

 avatar commented on June 12, 2024

I will look into this for the next release. This is more of a runtime vs. compiler issue. The compiler may link libraries that use the native keyword. If so, the JIT compiler must be disabled within the VM. I am also concerned with overall performance.

Don't think too much. It's source-level and only affects the source files being compiled. There is nothing to do with the runtime. When I proposed this, I didn't think you would think that far. My opinion is that everything should be JIT-ed. The keyword native sounds redundant to me. I am afraid to tell this straight to you. I only want my usage of Objeck to be easier, but I don't want to clash with you, so I made this suggestion.

from objeck-lang.

objeck avatar objeck commented on June 12, 2024

No impact on the source programmer's source code. The idea is to empower the programmer to let them decide to want they want JIT compiled in their code. On the otherhand, JIT compiling everything is efficient.

from objeck-lang.

 avatar commented on June 12, 2024

No impact on the source programmer's source code. The idea is to empower the programmer to let them decide to want they want JIT compiled in their code. On the otherhand, JIT compiling everything is efficient.

I don't get this idea. We disagreed with each other again. Btw, this suggestion is about a compiler switch, not about forcing JIT by default with no options to customize. It's just a shortcut to make the programmer's life easier so he doesn't have to write native everywhere. His ability to customize everything is not affected, just don't use the compiler switch.

from objeck-lang.

objeck avatar objeck commented on June 12, 2024

So, the programmer should not use the native keyword. What am I missing? Are you asking for a compiler switch to override the programmer's use of the keyword native? This is not about disagreement, as I am trying to understand your request.

from objeck-lang.

 avatar commented on June 12, 2024

So, the programmer should not use the native keyword. What am I missing? Are you asking for a compiler switch to disable the programmer's use of the keyword native?

Regardless of the source code use native or not, a compiler switch will force native so everything be JIT-ed (this issue, #387). My main usage for this is that I don't have to write native everywhere. Issue #388 is the reverse of this, as it will force everything to be not JIT-ed.

from objeck-lang.

objeck avatar objeck commented on June 12, 2024

Thanks, I will look into it. However, performance may suffer. Not all code needs to be JIT compiled. The compiler optimizes all code, rather JIT compiler or not. At runtime, the JIT compiler flag is honored.

Do you have metrics, programs, or data that you can share for testing?

from objeck-lang.

 avatar commented on June 12, 2024

Thanks, I will look into it. However, performance may suffer. Not all code needs to be JIT compiled. The compiler optimizes all code, rather JIT compiler or not. At runtime, the JIT compiler flag is honored.

Now it's me who struggles to understand what you are talking about. OK. I don't expect it to be that complicated. I'm not a professional programmer, and I tend to think the simple way. Java and C# offer no such control. I think they let the VM decide whether to JIT or not. Everything is fine. Why is it too complicated with Objeck?

from objeck-lang.

objeck avatar objeck commented on June 12, 2024

JIT comping all methods/functions has a runtime hit which is not justified in most cases. It is justified if the methods/functions are computationally intensive and are called multiple times within the code.

Simple calls like getters/setters are optimized to avoid function/method calls, and more aggressive inlining is done after that.

Please send me a code sample so that I can test and benchmark your request. Implementing your request is easy, but I worry about side effects.

Refer: https://en.wikipedia.org/wiki/Just-in-time_compilation

from objeck-lang.

 avatar commented on June 12, 2024

Please close this issue and remove it from the roadmap. I don't need this feature anymore. Thank you.

from objeck-lang.

objeck avatar objeck commented on June 12, 2024

Okay, thank you for the feedback.

For reference, this is the optimization pipeline.

Optimizations in list order:

  1. Jump optimizations
  2. Constant folding
  3. Getter/Setting inlining
  4. Dead store removal
  5. Constant propagation
  6. Method inlining
  7. Strength reduction
  8. Instruction optimization

Additionally, at runtime, bytecode may be translated to machine code at the programmer's request.

from objeck-lang.

 avatar commented on June 12, 2024

Additionally, at runtime, bytecode may be translated to machine code at the programmer's request.

Isn't this AOT?

from objeck-lang.

objeck avatar objeck commented on June 12, 2024

Additionally, at runtime, bytecode may be translated to machine code at the programmer's request.

Isn't this AOT?

No, that is compiling bytecode into machine code before runtime vs. at runtime.

from objeck-lang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.