More things abour ruby.
Recently I’m trying to fix some issues with bundler
.
setup a development environment
No interactive debuggers. finally there is “byebug”.
But it still lacks semantic highlighting.
“Pry” can’t do debugging! Also it’s only working on msys shell.
Neovim have ruby-lsp which is created by shopify, but when open multiple instances, there are performeance issues.
Free ruby threads are shown in Windows process manager, which consumes about 15% of the CPU. sometimes they are hard to kill.
So I cannot use it.
Annoying linter
Rubocop
is worse than mypy
. Why I cannot use multiple lines for indent? why there is no extra newline at file end?
disallowing single quote ‘w’ is hate to programmer. Look C and python.
After all there warnings, it failed to find my program’s basic errors.
Mysterious testing framework
RSpec
.
Ruby is a good language. But this just created its own grammar. It even has it’s own DSL! that means you cannot debug failed test cases.
Looking into source code I only find regular expressions. I don’t know how describe
is implemented. But it exists ten years ago.
https://github.com/rspec/rspec-core/commit/5443fa859bc1912f9c1fcb377d3da51354c2a11c
RubyGems
I installed RubyGems
dev version, and it’s been set default. And I cannot uninstalled even I installed another default version.
Now there are two defaults 😂. Finally I decide to reinstalling ruby.
Also I cannot uninstall the bundler extension. Even reinstalling ruby didn’t help.
Eventually I find it has data directory on ~/.bundle
(Thank you, WizTree). after deleting the extension stored in it there are still errors.
After another long debugging I find it has a index
file. very bad name.
It’s a yaml
file to store configuration, including extensions.
Current conclusion
Well, ruby is an old language. Certainly there will be old codes.
I admire it’s core design.
But the overall environment has established, and the bad aspects are hard to change.
Just speak about basic things:
- install cache. There are many new tools, such as bun, deno, uv, all implemented this.
- virtual environment. I even want to create a standalone tool for it. Just
install
,activate
,load
is enough. (I even has thought about its namerpm
, meaninga simple Ruby Package Manager
. I don’t want compatibility with RedHat.)
The bad package manager causing a need for containers such as docker. Discourse has exclusively use of it. A single image is about 5GB. That wastes so much space.
The most expensive thing in the cloud is storage.
Well, there are still more to say, but let’s ends here for now.