dstockdale
Could Elixir ever support a good plugin system and wouldn't it be awesome if it did?
I had to search around for a CMS for a project recently. It was the first time I’ve had to do that in years but I was surprised that nothing seems to have changed in the past 10 years. Most of the search results were for PHP and there’s a good reason for that.
I’m not a fan of PHP but language bashing aside it has one fantastic thing going for it which is you can create plugin systems with little effort because everything is just run from top to bottom. You include a file somehow and it gets run with everything else. Wordpress etc just do this. It’s primitive but it works.
Of course, you could say this a bad thing because this could lead to some awful spaghetti code and security concerns (which is true) but I’d argue this “plugin-ability” lead to some really great movements on the web particularly open source projects.
Some nice things that “plugin-abilty” could give you
- More people can contribute in more ways
- More likely to lead to popular open source projects like CMS’s, forums, shopping carts
- Broader audience - not just corporations that understand software development
- Might make it more accessible for kids, hobbyists, and non-professionals plus get them interested in the language, which I think is nice
- Can lead to ecosystems like Market Places, App Stores, which can’t be bad either
I don’t think it’s possible to build something in Elixir that could do this right now. I might be wrong, but I can’t see how you could create a web interface that uploads something then recompiles that something into your app. Someone might correct me here though.
So I’m just putting it out there. Would it or could it ever be possible to do a real plugin system in Elixir?
Most Liked
tty
The idea of a certified module has been floating around for ages. Basically the runtime only loading a beam which has been certified/encrypted via a key. Might make a good research topic for a graduate project.
NobbZ
I don’t think so. It should be trivial to drop a compiled module to a known location and let the BEAM load that module.
And exactly this is the thing that makes the plugin system quasi-built-in, all you have to do is “simply” defining an interface for the plugin…
NobbZ
You do not get any sandboxes with about any other plugin system that relies on loading foreign code.
If you want a sandbox, there is nothing you can do except for evaluating the code on your own and not by the environment…
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









