Giter VIP home page Giter VIP logo

Comments (3)

lukego avatar lukego commented on June 3, 2024

Supporting bitwise operators like << >> & | would be great!

There has been some past discussion on the LuaJIT repo over at LuaJIT/LuaJIT#63.

Mike wrote that "the main implementation cost [is] modifying all of the vm_*.dasc files." This would not be a challenge anymore after we have ported the VM to C (#199) because then it would only be one C source file to update.

So perhaps we can revisit this issue once the VM port is done and then look at the best way to support these new operators (which may or may not have the same semantics as Lua 5.3 as per LuaJIT/LuaJIT#63.)

from raptorjit.

tst2005 avatar tst2005 commented on June 3, 2024

Is it planned to have a partial control on the lexer/parser at runtime ?
For now RaptorJIT is like Lua/LuaJIT, working on a fixed lexer/parser (managed in the C source) modification can be only made at the compilation time.
We have something like macro? or a way to add new operator ?
It is just a question to jump outside of the basic need to run lua 5.3 code.
For sample, I dreams to add a custom != MACRO for the ~= operator ! ;-)

We can also transform foo << bar to bit.lshift(foo, bar) with MACRO ? it should be a way to produce change to support new feature with thirdparty (lua module) code.

I'd like to know your opinion about MACRO processing and non static grammar parser...

from raptorjit.

lukego avatar lukego commented on June 3, 2024

@tst2005 You are welcome to experiment with preprocessing and/or metaprogramming features on a branch and make that available for other people to merge :)

The nearest example that I can think of is DynASM. This is a preprocessor written in Lua coupled with a runtime library. Mike Pall did the original targeting C but @capr made a Lua version in LuaPower that lets you write inline assembler. The main limitation in LuaJIT/RaptorJIT seems to be not having a directive to preserve line numbers in the source file through preprocessing. It's a major pain when Lua errors use line numbers that don't match the source file.

This could justify a simple change to the RaptorJIT lexer to "hint" what the line number is in terms of the source file. On the other hand @CapsAdmin is working on a dynamic assembler that's like DynASM but without a preprocessor and I suspect this would make a better approach with no magic syntax. (The preprocessor is mostly there to make code generation fast but that's because DynASM was designed as a JIT backend rather than a macro-assembler.)

from raptorjit.

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.