algebra-driven-design
sorbet
Our great sponsors
algebra-driven-design | sorbet | |
---|---|---|
11 | 53 | |
126 | 3,517 | |
- | 0.5% | |
4.3 | 9.9 | |
5 months ago | 7 days ago | |
Haskell | Ruby | |
BSD 3-clause "New" or "Revised" License | Apache License 2.0 |
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.
algebra-driven-design
-
Does anyone use formal methods to validate the behaviour of programs/software at their job?
I would like to do this more. At the moment I don't do formal verification. However, I often borrow methodology from the excellent book Algebra-Driven Design (text available on GitHub but support the author if you find it useful!) when designing systems. This means I define algebraic data types to describe the program and the laws that relate the different types, and use that to guide implementation in a language that doesn't support ADTs.
- Best books for Haskell
-
Do you feel static types have "won the war", so to speak?
Their approach might be to express their business logic as a carefully selected collection of types and laws, as described in Algebra-Driven Design (the full text is available on GitHub, please support the author if you find it useful though). I recommend this book to everyone because, even if you don't use this approach to design your programs, it's an excellent way to think about problems and better understand the problem space.
-
Does anybody know a simple algorithm for generating unit tests given a function's code?
This reminds me of QuickSpec (different from QuickCheck) in Haskell. It takes Haskell code and finds the Mathematical laws that the code supports. It does this using a sort of smart random search. I learned about this as part of the Algebra Driven Design book.
sorbet
- Почему я программирую на Ruby
-
Bringing more sweetness to ruby with sorbet types 🍦
First let's introduce the tool: Sorbet is a gem developed by Stripe that aims to bring type notation syntax and type checking support for the Ruby ecosystem by utilizing the "Gradual typing" philosophy, it also provide type generation from YARD comments via the tapioca gem, allowing to grow alongside the already built Ruby codebase.
-
An Introduction to Metaprogramming in Ruby
We have hundreds of thousands of lines of ruby code spanning many services / monoliths. Even now I find it somewhat annoying to open a controller / component that is basically an empty class def but somehow executes a bunch of complex stuff via mixins, monkey patches etc, and you have to figure out how.
We are turning to https://sorbet.org/ to reign in the madness. I'm keen to know if others are doing the same, and how they are finding it (pros and cons)
- A few words on Ruby's type annotations state
-
Is Ruby on Rails still in demand?I see very few companies using it.Is it used in big tech companies like Google,Amazon,Facebook,Microsoft?
According to https://sorbet.org/ , the vast majority of code at Stripe is written in ruby.
- Building GitHub with Ruby on Rails
-
RJIT a New JIT for Ruby
> I guess what I'm asking is: do you see a future where there is more explicit control afforded to people who want to pick their own tradeoffs without resorting to writing everything performance-sensitive in extensions written in C/Rust/whatever?
An approach exists already in the present, and it's Stripe's Sorbet AOT compiler (https://github.com/sorbet/sorbet/tree/master/compiler).
-
Has Ruby actually increased the speed significantly?
That's incorrect. You may be thinking of Stripe, and AFAICT it's not very actively developed anymore: https://github.com/sorbet/sorbet/commits/master/compiler
- Ask HN: What is the most pleasant, uncomplicated full stack to start with?
-
Can text editors detect undefined variables in Ruby?
Sorbet can do this, as long as you have type signatures for your code. Given Ruby's highly dynamic nature that's where tools like Tapioca come in to generate these, for example for Active Record models where instance methods are generated based on the database schema. But the moment when something returns T.untyped you're back where you were before - it helps but isn't perfect.
What are some alternatives?
solargraph - A Ruby language server.
vscode-solargraph - A Visual Studio Code extension for Solargraph.
rbs - Type Signature for Ruby
rubocop - A Ruby static code analyzer and formatter, based on the community Ruby style guide.
noclip.website - A digital museum of video game levels
tapioca - The swiss army knife of RBI generation
content - The content behind MDN Web Docs
TypeScript - TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
crystal - The Crystal Programming Language
steep - Static type checker for Ruby
stripe-ruby - Ruby library for the Stripe API.
learn-you-a-haskell - “Learn You a Haskell for Great Good!” by Miran Lipovača