fast-ruby
contracts.ruby
Our great sponsors
fast-ruby | contracts.ruby | |
---|---|---|
4 | 5 | |
5,641 | 1,441 | |
0.2% | - | |
4.6 | 1.4 | |
4 months ago | about 1 year ago | |
Ruby | Ruby | |
- | BSD 2-clause "Simplified" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
fast-ruby
-
Sorry for this noobest question
In this perspective, maybe the compilation of approaches by Fast Ruby provides a similar point of entry.
-
Super readable String operations with `delete_prefix` and `delete_suffix`
Stylistically, chomp has a bit more of the whimsy that you might expect from Ruby, while delete_suffix is a nice mirroring of delete_prefix and more explicitly named. Both have similar performance benchmarks and are faster than sub.
-
Ruby 3.0.0 Released
If you’re interested in speed, check this repo: even among Ruby idioms there are big speed differences.
contracts.ruby
-
A few words on Ruby's type annotations state
I had written a code contracts library for Ruby about 10 years ago [1]. I stopped working on it, mainly because it only provided runtime type checking, and I wanted static type checking. Nowadays my main language is typescript. I miss ruby, but can't give up the static typing that typescript provides. I really wish Ruby had a type system with the same level of support. VSCode has phenomenal TS support, and there's a community adding types to projects [2]. This is something I'd like for Ruby also.
> An integral part of this informality is relying on Matz’s taste and intuition for everything that affects the language’s core.
I think a more defined process would mean a better future for Ruby and Ruby developers.
-
Why I Stopped Using Sorbet in All My Ruby Projects
Contracts gem can be a nice middle-ground. It has a fairly readably syntax and only checks method inputs and outputs at runtime. We use it to annotate important core methods, while leaving the rest type-free.
I’ve never liked working with sorbet. But I’ve been interested in projects like contracts.ruby which feel more suited for ruby due to their lightness.
-
Cells - Introduction
This gives me access to input values as long as I defined them via attr_reader. Oh what's the Contract XXX above attr_reader? They are from contracts.ruby and completely optional and won't be explained in this post. You can safely ignore those and maybe study that gem later.
What are some alternatives?
Rails style guide - A community-driven Ruby on Rails style guide
Ruby style guide - A community-driven Ruby coding style guide
RSpec style guide - RSpec Best Practices
Fundamental Ruby - :books: Fundamental programming with ruby examples and references. It covers threads, SOLID principles, design patterns, data structures, algorithms. Books for reading. Repo for website https://github.com/khusnetdinov/betterdocs
Best-Ruby - Ruby Tricks, Idiomatic Ruby, Refactoring and Best Practices
are-we-fast-yet - Are We Fast Yet? Comparing Language Implementations with Objects, Closures, and Arrays
Functional Ruby
PyCall.jl - Package to call Python functions from the Julia language