Giter Site home page Giter Site logo

You did the same work as me about luajit.io HOT 7 CLOSED

kingluo avatar kingluo commented on July 30, 2024
You did the same work as me

from luajit.io.

Comments (7)

Wiladams avatar Wiladams commented on July 30, 2024

Trying to install and run on a linux machine with luajit 2.1
I just copied what's in the lib directory to /share/luajit2.1....
references to cdef don't seem to work properly.
What's the proper way to get this installed?

from luajit.io.

Wiladams avatar Wiladams commented on July 30, 2024

I put the resty and ljio into /usr/local/share/lua/5.1
and that seems to work

from luajit.io.

kingluo avatar kingluo commented on July 30, 2024

@xphh
In fact, it's completely different from your project except the "http" term.
The luajit.io aims at nginx & ngx_lua re-implementation, with below unique features (already done):

  • pure lua, no C codes inside (so no need to compile before running)
  • luajit-oriented, which means you could implement some performance critical code paths in C way. For example, I would not use string.* to parse the http url and headers because they could not be compiled by the jit compiler, slow pattern matching, and bring in a lot of temporary string values, which causes low performance
  • re-implement the whole nginx http core, including ssl, gzip, chunked output, last-modified, covering from the static file-served web server usage to restful WebService usage
  • nginx-way configuration and signal controlling, as http://nginx.org/en/docs/control.html
  • support all ngx_lua APIs, including dfa pattern matching, shared dictionary, etc, etc.
  • batteries included (e.g. luax, a simple template tool), it would be the PHP alternative in my plan, so it would be heavyweight but high performance io framework, Moreover, due to API compatibility, all lua-resty-* libraries could be reused directly, e.g. lua-resty-redis.

from luajit.io.

kingluo avatar kingluo commented on July 30, 2024

@Wiladams
No need to copy libs, just run it in place, see the updated README

from luajit.io.

Wiladams avatar Wiladams commented on July 30, 2024

I guess the advantage of running in place is that there's no 'install' hassles, and it keeps the luajit installation clean. I'll have to think if there's any negatives to just keeping it in a directory and doing all my work from there. I guess not.

@xphh, I looked at yours as well. It's Windows only right?

from luajit.io.

xphh avatar xphh commented on July 30, 2024

@kingluo Totally agree your words. What I mean is we did something for same purpose, but not the same way. luajit.io is more complete and complex as I thought, and what I have done is more lightweight and based on Lua itself (you can use it without luajit). The diffrence between them is, luajit.io does lots works on nginx & ngx_lua re-implementation. It's nice for ngx_lua developers. However, it's not my aim.

@Wiladams lnet works on Linux as well.

Additional Words: I read your comment again and think you maybe underestimate my project 'lnet'. lnet is not an httpserver only, but has more fetures as below:

  • An httpserver with restful HTTP services framework. Support cosocket (like ngx_lua).
  • Support static web pages: custom root directory, default pages, mime types, and etc.
  • Support dynamic web pages: Lua code embedded in html, very similar to PHP. Obviously it's what you want also.

The main diffrence between lnet and luajijt.io is that luajit.io is designed for insteading nginx and lnet has its own way. In my opinion, if you don't like nginx you just don't simulate it. Nginx is heavy and diffcult to configure,so I'd like use 'lnet' instead but not a fake nginx. Although ngx_lua is powerful, we deserve to have another simpler framework.

from luajit.io.

pygy avatar pygy commented on July 30, 2024

luajit-oriented, which means you could implement some performance critical code paths in C way. For example, I would not use string.* to parse the http url and headers because they could not be compiled by the jit compiler, slow pattern matching, and bring in a lot of temporary string values, which causes low performance

@kingluo have you looked at https://github.com/pygy/strung.lua?

string.find for plain strings and string.gsub are slower than native, but string.find with patterns and string.match/string.gmatch are often faster than their Lua C API couterparts in my experience.

from luajit.io.

Related Issues (5)

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.