Live data from Hacker News

Lotus, a web framework for Ruby

lucaguidi.com

121–130 of 143 posts

Re: Lotus, a web framework for Ruby

#121
post #91

I think it's great to see someone make a run at a more decoupled ruby web app approach. I hope it succeeds. In my experience working on Obvious ( http://obvious.retromocha.com ) it is hard to get Ruby developers behind decoupled architectures because the large majority aren't Ruby devs, they are Rails devs and Rails happens to be in Ruby. Also, the larger group of developers doesn't like the idea of an app being a gi…

I'm pretty sure they make a pill or something for that scorching case of hasheritis. ;) One problem I have with "decoupled" architectures is that the only way you can sensibly interop with everything from RDBMS to flat JSON files is if you treat the RDBMS as a flat file. For instance, the sample Twitter clone treats every available DB as a plain key-value store.

> One problem I have with "decoupled" architectures is that the only way you can sensibly interop with everything from RDBMS to flat JSON files is if you treat the RDBMS as a flat file.

The Repository pattern is what you're looking for.

Re: Lotus, a web framework for Ruby

#123

This is depressingly similar to what I was aiming for when I recently began work on: https://github.com/lean-framework/lean (I feel like this happens to me a lot.) Rails controllers are hard to test because actions aren't designed to be testable objects. ActiveRecord models become monolithic because there's no separation of instantiation, validation, persistence, or retrieval. I originally experimented with building…

I seem to recall, a while back the creator of RVM suffered a similarly disheartening setback when rbenv came out. RVM is still going strong. The community has not decided on lightweight frameworks. The choices you make won't be the same as lotus. You will no doubt attract a group of like-minded people who will be grateful for your contributions.

Re: Lotus, a web framework for Ruby

#124

Earlier quoted context omitted.

For a while, I thought Sinatra was taking that role? It might be interesting to think about what people are looking for that's neither Sinatra nor Rails, or why Sinatra didn't live up to what people were hoping (if people think that). Sometimes I think some of this is just utopian grass-is-greener thinking. While there are _many_ things I'd do differently in Rails if I had the choice (some but certainly not all of wh…

For any project worth talking about Sinatra is too skinny. Basically you have to hack your routing in about the same way you do with Node's Express, enumerating the bindings between routes and methods. Obviously there are clever ways to do it but you end up reimplementing the resourceful routes of Rails. Another problem is that you really want to use ActiveRecord to access the database. Anything else it too painful.…

I've built large projects with Sinatra. I've done the same with Rails, many times. The idea that you can't build something substantial with Sinatra is hogwash.

It is not a given that Active Record -- I presume you mean the pattern -- is necessary, but AR is available in Sequel, which is the usual choice of ORM when build with Sinatra. (In addition, Sequel has myriad additional benefits over Rails' ActiveRecord, particularly if you want to use raw SQL.)

Views in Sinatra are not much different to Rails, so whatever issue you have, I'm unclear what they are.

If you end up engineering a worse Rails then, as they say, you are doing it wrong.

As I mentioned, I use both, and you can achieve the same results with either. They are both, in effect, rack stacks these days; they simply have different conventions, one more opinionated than the other.

Re: Lotus, a web framework for Ruby

#125

Earlier quoted context omitted.

Sinatra, in my opinion, gets pretty hacked together after the initial `def get '/'; puts "Hello World"; end` Personally, I think Camping is the perfect fit for Ruby frameworks

It is very possible to organize a Sinatra project elegantly. It generally involves a combination of require_relative and Dir.glob().

Another way is to add a file, say init.rb, to a directory and require_relative that. It achieves the same thing, of course.

Re: Lotus, a web framework for Ruby

#126
post #110

By what I've seen I like the spirit of Lotus, but I sense a movement away from complete web frameworks to pure API back-ends with the emergence of great single page JS frameworks like Ember. One ruby one that I like is https://intridea.github.io/grape/ . One interesting node API framework I mean to try is http://loopback.io/ .

Yes, I also think that the future of backend development is micro services communicating over defined HTTP API endpoints or other message protocols. If you look closely, rendering presentation layer on the server side and then sending it to the client is a hack and we've been doing it for a long time. It's time for changes.

Single page web apps are broken for a lot of the most important purposes that the worlds largest and most important web-apps need to fulfill. For example how could Wikipedia function as a single page app since it wouldn't be consumable by screen readers and robots of various shapes and sizes ? That's just one example, but there are many. What about the semantic web ? microformats anyone ?

Google isn't the only search engine out there so the fact that you can use a crutch to let google crawl your site doesn't fix the problem.

https://en.wikipedia.org/wiki/Semantic_Web http://www.w3.org/standards/semanticweb/

Re: Lotus, a web framework for Ruby

#127

How many of this type of frameworks we had. Padrino was there to fix something but achieved nothing. It is better to focus on rails and fixing rails rather than start a framework for everything. Few doge years ago sinatra was faster than rails, today... not so obvious and still offering much smaller set of functionality.

Theres a bit of politics that get in the way of "fixing rails". Mainly, many things that others consider anti patterns, DHH and other maintainers are fine with.

Re: Lotus, a web framework for Ruby

#128
post #46

Earlier quoted context omitted.

>A complete web framework has client-side components that facilitate two-way communication to/from the server, data binding, HTML5 history state-based page/view swapping, etc. In other words, the type of stuff being addressed by Angular, etc. No. I can't possibly disagree with this any more strongly. I'm probably on the wrong side of history here, but Javascript absolutely should _not_ be a requirement for using a we…

I suspect that many sites simply do not have staff and/or resources capable of producing NoScript-friendly (degradable) work.

Producing NoScript-friendly work is, oddly, ridiculously easy. You write your "view" code for React.JS, and render this via node.js on the server, then have the client do exactly the same. You can pick up libraries - or write your own in half an hour - which implement the glue to talk to models from both the client and the server.

You shouldn't even need to write your business logic in node.js if it doesn't fit the language well, just write an RPC server in whatever language you prefer.

Re: Lotus, a web framework for Ruby

#129

Earlier quoted context omitted.

For a while, I thought Sinatra was taking that role? It might be interesting to think about what people are looking for that's neither Sinatra nor Rails, or why Sinatra didn't live up to what people were hoping (if people think that). Sometimes I think some of this is just utopian grass-is-greener thinking. While there are _many_ things I'd do differently in Rails if I had the choice (some but certainly not all of wh…

Rails is a pile of conventions. What I want isn't something more lightweight, it's something heavyweight with different conventions.

Try Padrino http://padrinorb.com

Re: Lotus, a web framework for Ruby

#130

Earlier quoted context omitted.

For a while, I thought Sinatra was taking that role? It might be interesting to think about what people are looking for that's neither Sinatra nor Rails, or why Sinatra didn't live up to what people were hoping (if people think that). Sometimes I think some of this is just utopian grass-is-greener thinking. While there are _many_ things I'd do differently in Rails if I had the choice (some but certainly not all of wh…

For any project worth talking about Sinatra is too skinny. Basically you have to hack your routing in about the same way you do with Node's Express, enumerating the bindings between routes and methods. Obviously there are clever ways to do it but you end up reimplementing the resourceful routes of Rails. Another problem is that you really want to use ActiveRecord to access the database. Anything else it too painful.…

One of the problems with always doing things the 'Rails Way' is that people start thinking there are no other ways. Plenty of people build significant apps with rich and engaging interfaces with much lighter frameworks than Sinatra even.
Post reply on HN