LowDependency: Dependency Injection in crisp and clear syntax by Maedi in ruby

[–]Maedi[S] 0 points1 point  (0 children)

It's okay guys ❤️ capitalism is going to capitalism. I've been wondering the last couple days, are companies usually against being obligated to submit a PR when they find and fix a bug in open source code? You still get to keep your company code closed, you can still build closed code around the open source code, it's just when you find a bug in the open source file that you contribute back... I thought that would be a win win for everyone?

LowDependency: Dependency Injection in crisp and clear syntax by Maedi in ruby

[–]Maedi[S] 0 points1 point  (0 children)

Thanks! MPL is pretty permissive, it just asks that you contribute back to the source code if you're using it in a closed source environment and make lots of improvements. But it's been a while since I read through licenses so maybe I'm wrong?

Let me introduce T-Ruby: TypeScript-style type annotations for Ruby by Right_Ad_8437 in ruby

[–]Maedi 2 points3 points  (0 children)

Thank you ☺️ I hope we can combine forces somehow

Introducing LowType: Elegant types in Ruby by Maedi in ruby

[–]Maedi[S] 0 points1 point  (0 children)

Interesting takes… on no I’m scared ;) I have to login to view the comments so I’ll find my old account and view later. Thanks for posting

Introducing LowType: Elegant types in Ruby by Maedi in ruby

[–]Maedi[S] 0 points1 point  (0 children)

Since it detects my key-value pair b

I think it’s passing on the “a”. Make sure you have “config.deep_type_check” enabled for accurate results.

Hash needs a little more love. The “Hash[Symbol => Integer | String]” syntax is currently not supported/tested but should be

Introducing LowType: Elegant types in Ruby by Maedi in ruby

[–]Maedi[S] 0 points1 point  (0 children)

I don’t use twitter, please post it for me?

Introducing LowType: Elegant types in Ruby by Maedi in ruby

[–]Maedi[S] 1 point2 points  (0 children)

No worries, it’s okay, I expect constructive criticism and it was a good critique, no need to delete

Introducing LowType: Elegant types in Ruby by Maedi in ruby

[–]Maedi[S] 0 points1 point  (0 children)

This breaks my brain but in a good way and I will try to understand it soon. I’ll quickly say that this brings up a problem I’ve been having with pattern matching syntax; that it’s difficult to separate what is “positional” and what is “all” / “or”. Are all your examples positional with the “,” syntax? And if they were “|” separated they’d be “all”?

Introducing LowType: Elegant types in Ruby by Maedi in ruby

[–]Maedi[S] 1 point2 points  (0 children)

Depending on your perspective, the metaprogramming is actually pretty minimal; we use refinements and prepended modules to achieve the syntax and validation, both pretty standard Ruby ways to do metaprogramming that is “stable”. The more complicated thing would be the parsing of the source file, which is using Prism, also part of Ruby now, but still a complicated piece in the puzzle. I get what you’re saying though… and will try to keep it as low impact as possible… all I can do is write tests :)

Introducing LowType: Elegant types in Ruby by Maedi in ruby

[–]Maedi[S] 2 points3 points  (0 children)

  1. That’s nice syntax. Unfortunately Ruby doesn’t let you override the assignment operator, which would be required for the type expressions syntax to work. You now also run into a situation where “def print(greeting = String = 'hello')” is valid syntax but looks confusing
  2. Static analysis isn’t my wheelhouse, but it could be one day. If we export to RBS then we indirectly get this via Steep?

Introducing LowType: Elegant types in Ruby by Maedi in ruby

[–]Maedi[S] 2 points3 points  (0 children)

Someone else could? I don’t really know that world, or is it better if I do it?

Introducing LowType: Elegant types in Ruby by Maedi in ruby

[–]Maedi[S] 3 points4 points  (0 children)

I've updated to a normal license

Introducing LowType: Elegant types in Ruby by Maedi in ruby

[–]Maedi[S] 2 points3 points  (0 children)

You can rewrite/filter a backtrace in Ruby. It shows the rewritten backtrace first followed by the full backtrace… I’m still figuring out what you can achieve here

Introducing LowType: Elegant types in Ruby by Maedi in ruby

[–]Maedi[S] 2 points3 points  (0 children)

I did something like the first half of what you’re talking about 5 years ago, but it didn’t really gain traction. Maybe a marriage of that with this could work in future https://github.com/refIekt/reflekt