4 ms·
> In my OSS and blogging activities, I am mostly focused on the same concepts: Ruby intuitions and lucid code...the main question is always “how the language le
by uticus 3y ago
> In my OSS and blogging activities, I am mostly focused on the same concepts: Ruby intuitions and lucid code...the main question is always “how the language leads us to express this in the clearest way possible.”
Unfortunately this article itself needs some editing. I stuck through to the end, but it was not enjoyably lucid.
> I honestly tried to perform it alongside the reader: since the early drafts of the article, my expectations were that I’d come up with some coherent idea about a possible Ruby typing syntax. My attempt resulted in a deeper understanding of the level of design complexity making it hardly achievable.
Plus one for trying it out, I guess. The temptation is there, because Ruby is so flexible. "It works so well for DSLs, maybe it can be expanded to include typing!" The trouble is, the added syntax rules to support typing will never stay in the sweet spot between "enough in the foreground to assist coding" and "enough in the background to not distract from the coding flow." You either live without it, as in Ruby, or learn to mentally parse over it, as in other languages with the Func(String s, Int i) syntax.
For myself, I'm fine with the typing being in a separate .rbs file. Especially if my IDE supports it well.
- lloeki 3y ago> For myself, I'm fine with the typing being in a separate .rbs file We type[0] by having one separate .rbs file per .rb file. Works really well with an editor's vertical splits: type outline on one side, code on the other. That, or use something like vim-projectionist[1]. We have a static typing guide for contributors[2], and I'm also accreting common errors and issues behind the scenes to produce a 'rbs+steep by example' to ease folks in. [0]: (WIP: there's a huge codebase to type, but we're progressively getting there) https://github.com/DataDog/dd-trace-rb/tree/master/sig https://github.com/DataDog/dd-trace-rb/tree/master/sig [1]: https://github.com/tpope/vim-projectionist https://github.com/tpope/vim-projectionist [2]: https://github.com/DataDog/dd-trace-rb/blob/master/docs/StaticTypingGuide.md https://github.com/DataDog/dd-trace-rb/blob/master/docs/Stat...
- nine_k 3y ago> this article itself needs some editing. Possibly! But likely the reason is this: > I am writing this on my phone, in a barrack that houses some 200+ of my brothers-in-arms in the Ukrainian army’s training camp; I use short periods of rest between training, mostly at night and on Sundays. I won't expect a lot of text-polishing opportunities in conditions like that. I'd be grateful for any coherent and insightful output, like the article.
- anon84873628 3y agoWell the author did caveat that he wrote the post in between military training in Ukraine, so I'm willing to give a pass on the copyediting.