Move over JavaScript: Back-end languages are coming to the front-end
github.com
github.com
I feel like too many developers never venture out past javascript and it shows. different languages highlight different ways of approaching and solving problems and I look forward to how that will play out.
Or am I thinking of this incorrectly? This is the first time I've investigated a solution of this type.
It’s a shame we didn’t make better use of our time solving the problem before the JS posers did their horrors by pretending that the solution was to take front end languages and code the backend.
Ecto (the ORM in Phoenix) seems like it should have all the parts for automatic migration generation but it's just the last little step missing.
Please don't create accounts to break HN's rules with.
I do like a lot Livewire, Hotwire, Unpoly, HTMX, etc... but using these tools (or any backend language compiled to wasm, etc,etc) as a way to try to avoid JavaScript is never going to work and will only cause pain and terrible applications.
Even with those HTML first technologies (which I like a lot) you need to learn to accept JavaScript is just another tool and one that you will definitely need to learn and use to make anything decent.
It is great to have a framework such as livewire that when you click a button to "load more" will render the new items in the backend and just swap out a placeholder and done. No JavaScript, no API, etc. Amazing.
It is just *terrible*, flaky, unresponsive, overkill and absurd to reach for the backend to re render a bunch of html because you needed to toggle a class or hide a box.
Use the right tool for the job.
I'm really tired of backend developers hating on JavaScript the same I'm tired of JavaScript developers hating on PHP, etc, etc.
Different tools. Different tasks. Let's not try to be purists and "JavaScript all the things" or "I'm not touching JavaScript because it sucks".
This is a strawman. I never claimed one should use Liveview for all web work. I'm just saying people _want_ to do web stuff with languages other than javaScript. javaScript is only "the right tool" in the sense that it's the only one that's native to the browser. If they substituted javaScript with any of the other popular general purpose languages no one would be any worse off for it (not factoring in the ecosystem built around it). javaScript doesn't have any features that make it better suited for the web than other general purpose languages. It's _only_ real advantage is that years ago a decision was made to create and use JS (edit: ..in the browser) and we've all been stuck with it since.
This is what I'm talking about. This is not going to happen any time soon. And all attempts to do this only lead to more confusion. It is easier to just learn it and help making it better. The language improved a lot over the last few years so I don't see why replacing an entire ecosystem, browser implementation, libraries, writing transpilers, etc, etc, etc can be any better than just learning to love it as the tool it is.
And let's say in some parallel universe it could be replaced. What is it going to be replaced with? Go? Python? Rust? Everyone has a different opinion so there is no agreement possible. And having any and every language available in the browser is just a wild dream.
So, yes, JavaScript is not perfect. And probably there are a ton of better languages but trying to avoid it and write everything in Go/Clojure/Python/Whatever is ridiculous. That won't happen any time soon. Not using JavaScript is just self inflicting limitations oneself.
[1]: https://fengari.io/