News for hackers. Stuff that matters.
Re:Ask HN: Uncommon Web Languages? by quechimba on Monday November 07, 2022 @04:22PM (#33512667)
I'm making a VDOM framework in Ruby. It runs on the server and streams DOM patches to the browser. Components are written in Haml and stylesheets are scoped to components. There is hot reloading too.

I haven't made any public releases yet and I'm not sure if the project is mature enough to receive any attention so I'm not posting a link at this point

Example of a simple component:

    %div Hello
State and callbacks:

    :ruby
      Button = import("./Button")

      def self.get_initial_state(initial_count: 0, **props) = {
        count: 0
      }

      def handle_click(event)
        update do |state|
          { count: state[:count] + 1 }
        end
      end
    %div
      %p
        Count: #{state[:count]}
      %Button(onclick=handle_click)
        Increment
And it's async so if you want to make a component that shows the current time:

    :ruby
      def mount
        loop do
          update(time: Time.now.to_s)
          sleep 0.5
        end
      end
    %p Current time: #{state[:time]}
Re:Ask HN: Uncommon Web Languages? by ilrwbwrkhv on Tuesday November 08, 2022 @12:54PM (#33521968)
Looks super cool.
Re:Ask HN: Uncommon Web Languages? by evnix on Wednesday November 09, 2022 @11:45AM (#33534199)
similar to livewire in PHP/Laravel and Phoenix liveview, We definitely need more of these as it makes absolutely no sense to bring in the JS bloat for a few forms and drawing a few rectangles and this is 99% of the web apps out there.