Live data from Hacker News

Building GitHub with Ruby on Rails

github.blog

261–270 of 332 posts

Re: Building GitHub with Ruby on Rails

#261

Earlier quoted context omitted.

Please say more. What's your setup?

Sorbet exists, but it’s worse than what Python offers, which is dramatically worse than what TypeScript did to JS.

Have you used tapioca with it? Apart from some edge cases, it makes it very smooth to use once you learn it.

Re: Building GitHub with Ruby on Rails

#262

GitHub running off the main branch is fascinating, and initially sounds mad, but makes so much sense. Assuming they have very high test coverage, running against mainline Rails isn't really any different to having the fork they had before, but they have more influence on future development. It must also be a massive boon for the Rails ecosystem to have such a large property running off the head. Doesn't anyone know o…

Shopify also runs off main, with a bigger codebase and more devs, and employs some Ruby core/Rails core devs too. It is the right choice IMO. Once you decide on your main framework as a big company, you should invest as much as you can in it and its community, it will pay off in the long term.

https://shopify.engineering/shopify-monolith

Re: Building GitHub with Ruby on Rails

#263

Earlier quoted context omitted.

You MUST have an insane amount of test coverage to trust something like this to Ruby. I'm new to Ruby, with 13 yoe as a SW engineer. Personally, I find it a very hard language to master. Writing tests often feels like I'm settings variables left and right without seeing them being used in the current context. But that then happens to be part of the let() way in rspec. Now you might say: why use rspec? I inherited thi…

I’m a long time Ruby and Rails developer. I know how the magic works from reading source code. A lot of stuff uses method_missing and define_method. There’s also instance_eval, which is used to create DSLs like rspec. Once you know what they do, stuff makes a lot more sense.

define_method is so weird. Breaks searching through source code.

Re: Building GitHub with Ruby on Rails

#265
post #234

Earlier quoted context omitted.

Please say more. What's your setup?

RBS ( https://github.com/ruby/rbs ) + Sorbet ( https://sorbet.org ) in Ruby 3!

It’s… not ready for prime time. I’m optimistic that it can get there but right now the tooling is quite immature and the type system flexibility is not there for such a dynamic language as ruby.

Re: Building GitHub with Ruby on Rails

#266
I've been using Codeberg, which uses Forgejo which is written in Go and is fast and light.

Fantastic that GitHub has managed to wrangle so many lines of code in a language I don't care very much for, but my Samsung A53's browser is snappier without it :)

Edit: to be fair, GitHub's has a hamburger menu that morphs to an X that I dearly miss. JK :P

Re: Building GitHub with Ruby on Rails

#267
post #3

I absolutely love Rails. I'll always remember back in 2010 catching the train to Waterloo station in London and seeing a huge sign overlooking the train tracks that read something like "We Need Rails Developers". Rails was such a huge part of my professional career. Now, 13 years later and I'm deep in the JavaScript ecosystem and have been for 8 years. The most exciting thing to come out of this ecosystem recently is…

I started my professional career with Rails 8 years ago and deeply miss aspects of it. It uses lines of code so efficiently, letting you go from zero to product with outrageous speed. Everything is a solved problem. Ruby as a language is so expressive, so beautifully ergonomic, so easy to read. It's such a joy. But the view layer has not aged well. After years of working with a focus on React and TypeScript, I can't…

Have you use the whole Hotwire suite? It's much better than just Stimulus. Componentizing your views will also make it more modern.

Re: Building GitHub with Ruby on Rails

#268

Github is one of the few webapps where I can feel daily that the framework used isn't enough. So many things get out of sync/not up to date, which are fixed by refreshing the page.

I think it's a tradeoff - rails makes live frontend updating challenging because you need to maintain a separate system to manage that, especially when you have a large app. JS frameworks have this built in, but their backend is lacking compared to rails IMO

GitHub could've used Hotwire [0] but instead they decided to grow a buggy immature in-house solution.

[0]: https://hotwired.dev/

Re: Building GitHub with Ruby on Rails

#269

GitHub running off the main branch is fascinating, and initially sounds mad, but makes so much sense. Assuming they have very high test coverage, running against mainline Rails isn't really any different to having the fork they had before, but they have more influence on future development. It must also be a massive boon for the Rails ecosystem to have such a large property running off the head. Doesn't anyone know o…

You MUST have an insane amount of test coverage to trust something like this to Ruby. I'm new to Ruby, with 13 yoe as a SW engineer. Personally, I find it a very hard language to master. Writing tests often feels like I'm settings variables left and right without seeing them being used in the current context. But that then happens to be part of the let() way in rspec. Now you might say: why use rspec? I inherited thi…

Metaprogramming in ruby is not magic. It is fairly simple, but if you come from a language where metaprogramming is difficult or not possible it can seem like magic.

Good metaprogramming levels up a language's power in the same way going from a hammer to a nail gun levels up your building power.

Creating a DSL in ruby is mostly just creating well named class methods, often that take blocks, and calling them without parens. Sprinkle in a little `method_missing` overrides and a few `define_methods` and that's it.

I don't know why people seem to actively avoid learning it, but a day of study, and stepping through a few "magic" methods with a debugger should reveal how simple and non-mysterious it is. And also how useful it is.

Re: Building GitHub with Ruby on Rails

#270
post #199

And as I have said before but worth repeating again, Rails is perhaps the only open source framework that is being battle tested in development at scale. It may not be the fastest ( or in fact quite slow ), but I dont think you could find similar testing being done and Deployed at the scale of Github on any other framework. I wonder if Eileen Uchitelle will bring this practice to Shopify as well? Edit: It seems [1] S…

> It may not be the fastest ( or in fact quite slow )

Web is not CPU bound, it's memory and network bound. Rails can run huge traffic perfectly fine if you know how to code for performance (e.g. caches, async with Kafka etc.) Ruby had also pretty significant speed improvements in the last years.

Post reply on HN