Live data from Hacker News

Matestack – Reactive UIs in pure Ruby

matestack.io

51–60 of 120 posts

Re: Matestack – Reactive UIs in pure Ruby

#51
post #18

Earlier quoted context omitted.

> Ruby needs new blood infused into it. yes, I strongly agree with this, specially when talking about Web tech. I am programming in Ruby (and Rails) for over 12 years and I think I had the same feeling up until a couple of years ago that it become a stable system where I could move quickly and create new products but did not have so much newness. But now I see at least two things which makes me love even more this ec…

What's wrong with old and boring? I don't think all the "newness" coming out of Node/Deno is actually improving anyone's productivity.

Nothing is wrong with old and boring. I like it. This is why I am using Ruby on Rails for most of my projects and it is the default framework to prototype any new idea I have.

But I have to acknowledge that in some domains, some users expect the web app to behave in a specific way and adding some reactivity makes my life easier. This is why I prefer to use contained - and constrained - solutions (like Stimulus or Stimulus Reflex) which does not impose to change my .html.erb views to accommodate them.

Re: Matestack – Reactive UIs in pure Ruby

#52

Love the idea of it, even if it's not for me. Ruby needs new blood infused into it. I realized recently that Rails started losing its popularity because it just didn't quite keep up as the web evolved. Where the framework and its community resources (guides/tutorials) should have started promoting REST APIs and out-of-the-box no-friction compatibility with modern tooling like npm/webpack/react/whatever, instead it st…

MVC full page reload are fine with turbolinks and can deliver a better user experience (at least that’s what I get from my clients).

The issue for me is more philosophical: JS is still not acknowledged as part of the view, the mindset is still stuck at the separation of concerns = separation of technology era.

I’m not doing SPAs, but I’m not doing Web 1.0 pages either. I have views where tightly coupling JS is the sound choice, because well, the JS is really a part of that view (e.g. a data visualization). But for that Rails makes me juggle between two different apps for the same view (even worse with webpacker).

Re: Matestack – Reactive UIs in pure Ruby

#54
post #40

I don't know Matestack specifically but in general the problem of DSLs is that they can quickly turn into giant pain in the ass once you need to do something they aren't prepared for. And this has bitten me enough times already(ActiveAdmin, Thor,...). The other problem is that if you use this you only learn the specific DSL which isn't portable. But if you use and learn the basic technologies under it - HTML, CSS, an…

Core contributor here: I think you're right when talking about DSLs ONLY introdrucing a high level of abstraction. But Matestack's first layer only maps HTML tag rendering to Ruby method calls, which actually doesn't add any abstraction and thus gives you the same level of flexibility when implementing things. The advantage of doing things in pure Ruby (even without any abstraction layer) is simply that it's now possible to utilize Ruby's languange features to create clean and readable UI code within a proper Ruby class - which means you can use class inheritance and modules for UI code structuring. That could be a big thing if you're into writing Ruby code ;) On top of that Matestack offers components (used via a DSL) with a higher level of abstraction in order to hide implementation complexity of - for example - rerendering a specific part of the UI. The idea behind these components is to drastically reduce the amount of code and effort you have to invest in order to implement typical UI requirements. And yes it's true: When using these components you loose some flexibility on how exactly things will work but you gain development speed and productivity. If the components don't perform as desired, you simply create your own component in pure Ruby or pure Vue.js and do whatever you want - e.g. consuming a JSON API and perform client side rendering. Without this customization path I would totally agree with what you said here: "the problem of DSLs is that they can quickly turn into giant pain in the ass once you need to do something they aren't prepared for" Matestack tries to enable you to use components with high level of abstraction next to components with low level of abstraction next to your very own components... and they are all meant to live happily side by side :D

Re: Matestack – Reactive UIs in pure Ruby

#55
post #43

Earlier quoted context omitted.

I used Rails for a lot of projects starting ~10 years ago, but slowly gravitated towards a stack based on Sinatra (for a lean REST API), Middleman (static site generator), and webpack/react/etc - for mostly the reasons you describe. In hindsight, I can't blame Rails for the direction it took; JavaScript's path (the language itself, as well as the tools) has been extremely volatile in that time. Rails is opinionated,…

You can try out Turbolinks, the Rails equivalent for LiveView.

This is not exactly a great characterization of turbolinks. TL definitely is great and useful for blurring the lines between server rendered and SPA, but it isn't anything like liveview. For that you're looking for something more like Motion (https://github.com/Unabridged/motion). Disclaimer, maintainer, but the comparison is much closer.

Re: Matestack – Reactive UIs in pure Ruby

#56
Came here for the DSL hate, and was not disappointed.

Seems like isomorphic web development has warts no matter what language you choose.

I'd say that Ruby still has a place building APIs for new projects, but having done both advanced REST APIs and GraphQL with Ruby, it's starting to make its way even out of my top five for getting the job done.

The point has already been made, but if you're good at Ruby and you don't need to build something responsive, both plain Ruby and Rails have fine affordances for server side rendered views. There's still a lot of need for quick-and-dirty backoffice applications that don't need to delight the user. Of course, you get a lot more for free with Django's admin.

Re: Matestack – Reactive UIs in pure Ruby

#57
post #17

Earlier quoted context omitted.

I work for a Fortune 50 and my team’s product is JS frontend and backend. JS all the way down :)

Might just be my area then (Berlin) I hardly see job ads for JS on the backend.

Node is massive in London so, yes, your experience has an element of local bias.

Re: Matestack – Reactive UIs in pure Ruby

#58
post #17

Earlier quoted context omitted.

I work for a Fortune 50 and my team’s product is JS frontend and backend. JS all the way down :)

Might just be my area then (Berlin) I hardly see job ads for JS on the backend.

Wow we must be in separate Berlins because I see tons of JS backends. My impression is Javascript & Python are competing for most popular backend.

Re: Matestack – Reactive UIs in pure Ruby

#59
post #5
post #3

Earlier quoted context omitted.

I think it's more that the massive engineering effort that's gone into improving JS has leapfrogged it over languages like Python, Ruby & PHP in terms of performance and tooling. And since you're stuck with JS on the frontend there are some significant advantages to using it on the backend as well. I don't think any of the current JS frameworks are as comprehensive as Rails but it's clear where the momentum is.

Actually I'm not seeing many projects with a JavaScript backend. In my experience the number is one, and it was 2015. I mean, backends of projects I worked on or somebody offered to hire me to work on. It could be selection bias and yet they're asking me about Java, which I basically abandoned about 15 years ago, PHP, which I know since the beginning of it but only kind of toyed with, even C# which I can read as a fo…

That hardly sounds representative of the Node.js adoption curve. Could you elaborate on your typical client profile? Are you a solo freelancer, maybe attracting clients with legacy codebases? Location?

Re: Matestack – Reactive UIs in pure Ruby

#60
post #9
post #3

Earlier quoted context omitted.

I think it's more that the massive engineering effort that's gone into improving JS has leapfrogged it over languages like Python, Ruby & PHP in terms of performance and tooling. And since you're stuck with JS on the frontend there are some significant advantages to using it on the backend as well. I don't think any of the current JS frameworks are as comprehensive as Rails but it's clear where the momentum is.

> I think it's more that the massive engineering effort that's gone into improving JS has leapfrogged it over languages like Python, Ruby & PHP in terms of performance and tooling This is not true – PHP is still much faster when running on the server than NodeJS. JS has got much faster in the last 20 years, but in-browser execution has seen most of the speedup (as it's where most of the optimisation is focussed on).

PHP is fast but not as fast as Node. However, once you introduce something like Laravel into the mix performance tanks leaving it slower than Django and Rails according to Techempower benchmarks.
Post reply on HN