dstockdale

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

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

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

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…

Where Next?

Popular in Questions Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

Other popular topics Top

AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement