Nicd

Nicd

Phoenix project without macros, a tiny study

I made a little study because I’ve been thinking about what a Phoenix / Plug app would look like without any macros: Mikko Ahlroth / Feeniks · GitLab

It only has a start, Plug pipelines, a router, and a controller. It serves HTTP and parses params. Code reloader also works. It’s missing router helpers / verified routes (I think infeasible without macros), views (didn’t look at them yet), error pages, and channels / LV (I fear those would be really difficult but I didn’t look at them yet). Also it’s missing docblocks right now.

The aim was that you could take any part of this and replace it with a normal Phoenix version and it would work. But since Phoenix adds some stuff to Plug.Conn private parts, that doesn’t work completely now. I think I’ll still take a look at the template/view system and how I could call/compile them without macros while still maintaining the same performance characteristics.

And yes, I’m calling some functions at compile time to build the plugs, but let’s say I’m not using defmacro at least. :smiley:

This is not meant to be for real use, but maybe it’ll give some idea of what is happening under those macros, though the code is paraphrased

Most Liked

LostKobrakai

LostKobrakai

Egis

Egis

Fyi, link to repo is broken. Some weird character at the end of it (zero-width-space?).

Nicd

Nicd

I am aware of this function and would probably use it in Gleam. It runs all plug inits at runtime whereas Feeniks runs them at compile time like standard Plug.

Where Next?

Popular in Discussions Top

matthias_toepp
I’d love to hear what people think about Wisp, the new Gleam web framework started by Gleam’s primary creator Louis Pilfold. Gleam, alon...
New
vans163
So useless benchmarks aside, Its possible to write a webserver that can serve 300k requests per second (perhaps more with optimizations)....
New
andre1sk
A big advantage to Elixir is all the distributed goodness but for many applications running on multiple nodes having integrated Etcd, Zoo...
New
jeramyRR
This is an interesting article to read. Elixir’s performance, like usual, is excellent. However, it seems like the high CPU usage is co...
New
Fl4m3Ph03n1x
Background This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
ejpcmac
I have discovered Nix last month and I am currently on my way to migrating to it—both on macOS at home and the full NixOS distrubution at...
New
Qqwy
I would like to spark a discussion about the static access operator: .. For whom does not know: it is used in Elixir to access fields of...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

Other popular topics Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
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
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127089 1222
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement