Fl4m3Ph03n1x

Fl4m3Ph03n1x

Background

I am studying the concept of Plugin Architecture and part of this task involves finding examples of this within the Elixir community.

My first attempt at searching for this resulted in finding this post by @mudasobwa

While the article differentiates between different types of plugins, it does not offer examples and sample projects in Elixir for analysis and contemplation (still great job by him, go and read his blog !).

Research

So in my search for clear implementations of the Plugin Architecture in Elixir, I though about Plug.

The problem here, is that I find no sources whatsoever specifying if Plug (despite the similar name) indeed follows the Plugin architecture or not. To my knowledge, Plug follows the tenets of the Middleware architecture instead:

Objective

So I was hoping someone could help me find clear examples of Plugin architecture projects using Elixir.

For some context, some clear examples of this are Vim, Eclipse and Minecraft (Clean Coder Blog)

Showing Posts 1 to 6

venkatd

venkatd

This doesn’t 100% answer your question but I believe it’s common for the Protocols feature in Elixir to support a sort of plugin architecture.

For example:

  • Jason lets you implement the Jason.Encoder protocol to decide how structs in your own app serialize to JSON
  • In Livebook there is the Kino.Render protocol which allows you to decide how custom data types render inside of Livebook.

The key here is that these libraries do not decide in advance all of the different implementations. By exposing the protocol, they allow others to extend in a “plugin style” with other implementations.

stevensonmt

stevensonmt

Does the middleware approach of Tesla fit your question?

mudasobwa

mudasobwa

Creator of Cure

There might be different examples of what we call plugin. In my humble opinion, we might simply call anything that is allowed by the library author to extend the library functionality the plugin.

Backends

Supporting different backends via custom implementations might be treated as “Plugins architecture example”

  • broadway allows plugins to handle different sources
  • rambla which is kinda supplemental to Broadway (it publishes to different destinations in the same sense as Broadway reads from) shows the example of configuration-managed plugin architecture where different publish targets might be configured based on the “channel name” so that publishing to the “channel” would result in publishing to all the configured destinations
  • telemetria allows transparent switching between actual backends (telemetry, open_telemetry, Logger, etc.)

Middlewares

Yep, Plug is the best example.

Also: Req.

Plugins per se

The very example of a plugin per se might be hard to find in Elixir sources because “plugin” is something adding the functionality not only unknown to the library/framework author, but also unexpected by them; plugins are usually made for standalone applications, specifically for editors/IDEs and such. Elixir code, even despite being a framework, is usually narrowed to some domain and therefore the pure plugin support is kinda “unpure.”

Fl4m3Ph03n1x

Fl4m3Ph03n1x OP

Alright, this explanation is just what I needed. Thanks !

D4no0

D4no0

One more thing that I also wanted to mention. Since elixir doesn’t provide sandboxing, using something like luerl goes a long way in ensuring relative safety of the code that is being run.

Obiviously this goes beyond elixir only, as you will write those scripts in lua, but this is more how a pure plugin would look like if you don’t trust the source.

cevado

cevado

i’m not sure if a “plugin architecture” is something that you’d apply to a library/package, at least by reading the article it seems to apply to a full application that can have it’s behavior extended through configuration. No enduser would deploy an app and change the plug pipeline, or a broadway config, or a tesla client setup.

but the two apps that come to my mind that might fit a “plugin architecture” is bonfire and astarte…

— All posts loaded —

Where Next? Top

Trending in Discussions Top

cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
achempion
I’ve been using Emacs as my main code editor for more than a two years. It’s a custom build version although I’ve tried doom emacs and sp...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
jtormey
Lately I’ve been thinking about how to organize components as a LiveView application grows. One of the pain points I’ve found (for myself...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
georgeguimaraes
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews