Hacker News new | ask | show | jobs
by onebot 1492 days ago
How much did they spend to write this compiler? Also, I would say they spend at least 5 or more hours per weak writing tests to handle all edge cases for any new code they commit due to the language being dynamic? Also, what kind of community is there for a custom compiler as well as the non-standard high performance things like using CRuby. I think it is easy to assume developer productivity is increased--and I think it is for small/medium projects. But at this scale and complexity, my assumption is that they are likely spending more development resources to support the language in their high performance environment.
1 comments

Having a statically typed language doesn't mean you don't write tests.

Sure, there's a subset of tests you can avoid writing but you're still going to be writing a ton of tests with both language types. I also think this point gets blown out of proportion. For example I don't write a ton of boilerplate "what if I pass X type to Y variable" types of tests in Rails because I trust the database and Rails' validations. For example if I have a datetime field in a DB which is automatically defined as a datetime in Rails I'm not going to write a separate test for what happens if I pass in a string, integer, boolean, list, hash and so on. I'd write a test around making sure the date is within a specific range if I hooked up a validation rule to it to limit the range, but I'd write the same test with a statically typed language too.

Also, Stripe has a good write up[0] on how they use Sorbet to add type checking for Ruby and how they applied it to a multi-million line code base without disrupting developers too much. Basically a small team did most of the work, including writing the tool and migrating the code base. I haven't used it personally but it exists and can be used successfully at scale.

[0]: https://stripe.com/blog/sorbet-stripes-type-checker-for-ruby