Comments (6)
As far as I know Wiebe's intentions, a big part of FlashMQ's design philosophy is to have a minimal set of dependencies; another is to do one thing and to do it well. In my opinion, built-in Lua support would add needless complexity and an extra dependency. Though the latter could be configurable at compile-time, that in itself creates more packaging choices and difficulties.
The best approach for those wishing to work with Lua (or any other scripting language for that matter) would be to write a plugin (in C++) that adds support for that language. FlashMQ's plugin ABI is stable, and, since there's not much you can't do with a plugin within FlashMQ's plugin architecture, implementing scripting support shouldn't be hugely difficult.
However … another cornerstone of FlashMQ is performance, and I would venture that in most cases it would be unwise to surrender some of that performance to the drag imposed by an interpreted language.
Then there is the matter of type safety. FlashMQ is written in strongly-typed C++ to make it as fault-free as possible. A quick Google reveals that there are a number of competing approaches to make Lua more strongly type than the baseline language.
All in all, I can't speak for Wiebe, but I think that adding Lua suport to FlashMQ itself would be a mistake. As for a plugin that adds Lua support: I think it can work fine, but would strongly advice to invest that energy in becoming a bit more comfortable in C++. Who doesn't want a non-scripting language on their CV after all?
from flashmq.
May I ask, @penguinol, if you have some specific plugin functionality in mind to make you wish you could implent it in Lua?
I'm asking because there are plans for a bunch of example C++ plugins, so that it will be less daunting for novice C++ programmers to build on these examples for most trivial needs, and it will be good to have some concrete needs and wishes in the back of our heads when creating these examples.
from flashmq.
I'm a C++ programmer, but i don't think everything must be implemented in C++.
A external lua scripting plugin is fine. With lua, we can implement auth with http\reids\sql in less than 100 lines of lua code and no need to worry about dependencies, make file, compiler and so on.
This can make flashmq out of box and easier to use. Not only for C++ programmers, but also for ops and other programmers.
I don't really worry about the performance of lua, something like openresty also works fine. The cost of redis/http/sql query is much higher than lua. If users do care about the performance, they should write c++ plugins, otherwise, lua is enough.
A lua plugin with sql\redis\http\json support can fit most of needs.
from flashmq.
@bigsmoke said it. A plugin for Lua may be good idea just to have, however:
With lua, we can implement auth with http\reids\sql in less than 100 lines of lua code and no need to worry about dependencies, make file, compiler and so on.
This can make flashmq out of box and easier to use. Not only for C++ programmers, but also for ops and other programmers.
I don't really worry about the performance of lua, something like openresty also works fine. The cost of redis/http/sql query is much higher than lua.
I suspect the way this will be implemented would be a blocking/synchronous call. An SQL query can take a few milliseconds easily, which is an eternity in FlashMQ time. You may as well then use other brokers that do support Lua.
For HTTP calls, there is an example plugin for async libcurl to avoid blocking calls, and I suspect that will be impossible to implement with Lua. Or, at least write as technical debt from the start (quick to set up, inflexible/limited later).
from flashmq.
@halfgaar , I think you can close this issue?
from flashmq.
@halfgaar , I think you can close this issue?
After some consideration, I agree. I'm all for people developing a lua plugin, but as a core feature, I have to conclude that it's not the most logical feature. FlashMQ's fast, fully async model is too easily undermined with lua.
from flashmq.
Related Issues (20)
- `flashmq` its command-line options are not documented in its man page HOT 1
- Several protocol violations or bugs in FlashMQ HOT 5
- Another protocol violations or bugs in FlashMQ HOT 28
- Feature request: Allow skipping tests that require a network connection HOT 2
- Is there a maximum number of retained messages? HOT 14
- Build of 1.7.2 fails with gcc 13.1.1 HOT 1
- Check if retained message has the same contents don't resend it
- If you connect to the broker with a Last Will and Testament (LWT) and correct username, the LWT is published even if the password is wrong. HOT 2
- docker hub image for flashmq HOT 1
- Huge amount of rentained messages and restarting HOT 1
- Topic prefix stripping in server-to-server connections HOT 21
- keepalive interval vs paho-mqtt HOT 9
- FlashMQ keeps disconnecting the same socket?
- Last Will not working correctly? HOT 6
- Install on Raspberry Pi HOT 21
- Add armhf and arm64 builds to the apt repo for Raspberry Pi OS HOT 10
- Deal with empty user names some way HOT 1
- FlashMQ randomly dropping incoming SSL connections HOT 6
- Running multiple testcases should not leak file descriptors HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flashmq.