Koichi Sasada
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Ruby-dev office hour logs: 2021-2022 ## 2022/12/19 * Twitterがいろいろ揺れてる、人が抜けたり * Mastodon * Pawooいまいち * [ruby.social](https://ruby.social/) * RSS * Slackで読む * リアルタイムで見るアプリ増やしたくない問題 * Slack, Discord * Windows ARM版 * [unexpected ucrtbase.dll · Issue #308 · oneclick/rubyinstaller2](https://github.com/oneclick/rubyinstaller2/issues/308#issuecomment-1314533434) * vcpkg, MinGW, MSYS2 * 夢の壺を眺める * メモリー消費のプロファイリング * https://github.com/SamSaffron/memory_profiler * https://github.com/Shopify/heap-profiler * 稼働環境で今問題が起きているならScoutAPMとかに頼るのも手 ## 2022/12/12 * [Feature #19194: Add Regexp.linear\_time? - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/19194) * Verse * https://twitter.com/pmylund/status/1601305994851909632 * https://simon.peytonjones.org/assets/pdfs/verse-conf.pdf * 情報を記録に残す話 * https://obsidian.md/ * https://howm.osdn.jp/index-j.html * https://orgmode.org/ * Scrapbox, Notion, HackMD * パーサーの話 * [Ruby Parser開発日誌 (1) - かねこにっき](https://yui-knk.hatenablog.com/entry/2022/12/11/154502) * ソフトキーワード * Python がPEGパーサーを導入したのは match 文のためらしい * Ruby でも if とか class キーワード引数をいい感じに参照したい… * `(if)` とか? * https://github.com/dotnet/csharplang/issues/1237#issuecomment-356003069 * JavaScriptも async function 内でだけ await 可 * Multiple error wrapping * Python 3.11: ExceptionGroup * Go 1.20 (予定): errors.Join() ## 2022/12/05 * https://shugo.net/jit/20221205.html#p01 * https://bugs.ruby-lang.org/issues/19134 * https://bugs.ruby-lang.org/issues/19165 ## 2022/11/28 - パーサーの話 - 正規表現の最適化の話 - API つける - `Regexp.redos_safe?(string, flags)` - `Regexp.redos_safe?(regexp)` - `Regexp#redos_safe?` - `Regexp.new(string, flags).redos_safe?` * 正規表現に加える safe / danger flag * safe and danger(ほぼ全部につける) * safe → 最適化可能なら動く、最適化不可能なら例外 * つけない → 最適化可能なら動く、最適化不可能ならrubocopが怒るが動く * danger → 最適化可能なら動く、最適化不可能ならrubocopが怒らず動く * safe だけ(9割につける) * safe → 最適化可能なら動かす、最適化不可能なら例外 * つけない → 最適化可能なら動かす、最適化不可能なら動く(rubocopはsafeフラグを付けるよう強要、いやならrubocopのコメントで抑制する) * danger だけ(1割につける) * つけない → 最適化可能なら動く、最適化不可能なら警告(警告レベルは選択可能、デフォルトは警告出さない)(rubocopは知らん) * danger → 最適化可能なら動く、最適化不可能ならrubocopが怒らず動く * CGI gemの挙動が非互換になってしまった話 * https://github.com/ruby/cgi/pull/29 * https://github.com/google/rune * > Rune is a Python-inspired efficient systems programming language * https://github.com/google/rune/blob/main/doc/rune4python.md ruby -w ruby -Werror=redos ## 2022/11/21 ```ruby def foo(*) p binding.local_variable_get(:*) end foo 1, 2 # p binding.local_variable_get(:*) # ^^^^^^^^^^^^^^^^^^^ # from t.rb:3:in `foo' # from t.rb:6:in `<main>' ``` ## 2022/11/14 - https://twitter.com/mametter/status/1589782903420243968 - https://kateinoigakukun.github.io/jupyterlite-ruby-kernel/lab/index.html - Kevinによるパーサーの書き換えのプレビュー - 手書きパーサー - [Draft sketch of "external debug section" for feedback by KJTsanaktsidis · Pull Request #6706 · ruby/ruby](https://github.com/ruby/ruby/pull/6706) ## 2022/11/07 - [Feature #19104: Introduce the cache-based optimization for Regexp matching - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/19104) ## 2022/10/31 - [Feature #19083: Add \`node\_id\_for\_backtrace\_location\` to ast.c - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/19083) - [oss-fuzz/fuzz\_ruby\_gems.c at fab92b68efb74475091546e092e564fccbe44391 · google/oss-fuzz](https://github.com/google/oss-fuzz/blob/fab92b68efb74475091546e092e564fccbe44391/projects/ruby/fuzz_ruby_gems.c#L189-L247) - RWC - ハロウィン - https://www3.nhk.or.jp/news/html/20221030/k10013875051000.html - [Apple M1: \`rbenv install 3.1.2\` fails but installing ruby 3.1.2 from source succeeds · Issue #2073 · rbenv/ruby-build](https://github.com/rbenv/ruby-build/issues/2073#issuecomment-1296174109) ## 2022/10/24 - Ruby技術者認定試験が[10月からRuby 3に対応](https://www.ruby.or.jp/ja/news/20220712) - 電気代高騰 燃料調整費がえぐい - [Kaigi on Rails 2022](https://kaigionrails.org/2022/) - 今年はオンライン開催、参加無料 - PythonがGVL外す話 - Pythonはreference counting方式なのでカウントアップ・ダウンのたびにGVL獲得している - CRubyはmark & sweepでlazyだけどそれでもGVL外すのは大変なのにまじで? - Erlang - Rubinius - [Support nodes in \`spot\` by eileencodes · Pull Request #26 · ruby/error\_highlight](https://github.com/ruby/error_highlight/pull/26) - [Add \`node\_id\_for\_location\` function by eileencodes · Pull Request #6593 · ruby/ruby](https://github.com/ruby/ruby/pull/6593) - OCaml https://twitter.com/ulala_go/status/1584184947048214530 ## 2022/10/17 - async, Generatorなどの話 - ESのGenerator関数の中の無名関数内ではyieldできなくて不便 - Rubyのブロックはえらい - 複数のジョブを並行動作させて全部終わるのを待つ、というよくある処理 - `await Promise.all(promises)` ひとつこけると例外 - Rubyだと `threads.each(&:join)` とか - GAS(Apps Script)はライブラリが同期的なAPIばかりのところにエンジンがモダン化されてasync/awaitできるようになったけど、あまり活かしようがない - [GUNDAM FACTORY YOKOHAMA](https://gundam-factory.net/) - 建築物なので法令遵守で妥協もあったらしい - ロボットや戦隊ものは海外でも人気 - 暴太郎戦隊ドンブラザーズ - 「どんぶらこ」というオノマトペ - 「物が水の流れのままに浮きつ沈みつして、漂いゆくさまを表わす語。どんぶりこ。」(日本国語大辞典) - EuRuKo 2022終わった - 来年はリトアニア - 燃料費高騰でデータセンターのラック単価が上がる話 - AIによる自動生成でUGC系のサービスが大変になっていく - GitHub Sponsors - インボイス制度 ## 2022/10/10 (スポーツの日) ## 2022/10/03 - EuRuKo - Object Shapes - 物価高、USDが高い、TWDも高い - フリーランスきつそう - インボイスも始まる - Coverage: `:all` に `eval` も含めるの? - 脆弱性の基準 - HackerOneの(報奨金の)おかげで微妙なやつも脆弱性と主張する人が増えた - mrubyは[セキュリティポリシー](https://github.com/mruby/mruby/security/policy)を定めて、ゴネる人は減った - Data.define が定義するクラスには共通のスーパークラスがあった方がいい - Data でいいのでは (matz) - サブクラスに継承させるインスタンスメソッドは Data 自身がインスタンスを持たないのでいいが、特異メソッドは Data に対して呼べてしまうのでどうなのか (nobu) - Data.members とか - 後から生やすのはいまいちに思えるしドキュメントしづらい - Data に生やしておいて、抽象クラス Data に対しては何もしない(空を返すとか)でいい ## 2022/09/26 - @ruby-lang.org, GCP - debugger pre: "open chrome" - debuggerしてopen chromeをRubyのソースコードに埋め込む技 - VSCode + Docker + debug gemを動かしてみたログ - https://esa-pages.io/p/sharing/4060/posts/3081/6274af0ebb9b719de3c1.html - この時間帯だと高校生などは参加できないという話 - お便り歓迎します - プログラミング教育 - CやJavaから始める人が今もけっこういる - やはり周りの影響が大きい - RWC, Euruko, RubyConf - https://2022.rubyworld-conf.org/ja/ - https://rubyconf.org/ - https://2022.euruko.org/ - https://bugs.ruby-lang.org/issues/19015 - https://bugs.ruby-lang.org/issues/19021 - macOSにruby 2.6が入ったままの件 - システムで使っていて置き換えができていないからっぽい - パーサー書き換えの話 ## 2022/09/12 - RubyKaigi 2022終わった - 伊勢うどん食べ損ねた - お弁当気合い入ってた - 松阪牛 - 歳を取ると脂が😅 - すき焼きは正解だった - 会場広くておおむね快適 - 700人くらい来たけど大ホールは2000人収容 - ステージもめちゃくちゃ広い - 地元のお店も協力してくれた - バウチャーの協力店を募って回ってくれたスタッフ有能 - 次回は松本 - https://twitter.com/tmtms/status/1568842528174276608 - https://www.mpac.jp/guide/grand-hall/ - 前回のこばちえさん情報 - https://note.com/co_bachie/n/nd865a7c4eecd - https://note.com/co_bachie/n/n2ae046a854ba - 5/11-13 - ドーミーインなんか高い - 部屋数が116室なのでそんなに大きくないのかも https://www.hotespa.net/hotels/matsumoto/room/ - Committers vs. The World はファンミ - RubyWorld Conference 2022 - mameさんは非超絶技巧ネタ - プログラムはまだ出ていない - 松江にホテル増えた - [Feature #18949: Deprecate and remove replicate and dummy encodings - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/18949) - MacJapanese エンコーディングが動かないという報告 ## 2022/09/05 ## 2022/08/29 * [Bug #18784: \`FileUtils.rm\_f\` and \`FileUtils.rm\_rf\` should not mask exceptions - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/18784) * `it` 再び: https://bugs.ruby-lang.org/issues/18980 * `_2` あんまり使わないけどその有無で `_1` の意味が変わるという罠 * RSpecのitは必ず有引数 * ささださんがGoを使ってみた話 * echoサーバーはRubyでも性能に遜色なかった * 命名規則 ## 2022/08/22 * Ruby OMR * [Faster Ruby: Thoughts from the Outside — Matthew Gaudet](https://www.mgaudet.ca/technical/2022/8/9/faster-ruby-thoughts-from-the-outside) * ZSUPERの件 * [Bug #18729: Method#owner and UnboundMethod#owner are incorrect after using Module#public/protected/private - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/18729) * メソッドオブジェクトはその時点の実体へのポインタか、オーナーとメソッド名の組か * 前者と捉える人が多い ```ruby class C def foo :C end private def hoge :C_hgoe end end class D < C alias bar foo public :hoge end p D.instance_method(:foo).owner #=> C p D.instance_method(:bar).owner #=> D p D.new.method(:foo).owner #=> C p D.new.method(:bar).owner #=> D p D.new.method(:hoge).owner #=> C p D.instance_method(:hoge).owner #=> C # 3.1 ``` * メソッドテーブルと別にvisibilityテーブルがあるようなメンタルモデル * mrubyの実装 ## 2022/08/15 * Rubyのqsort実装の出所 * オリジナルの実装を提供してもらった * その採用前は stdlib.h の qsort(3) * ソートアルゴリズムいろいろ * Pythonで [TimSort](https://en.wikipedia.org/wiki/Timsort) が生まれて(2002)、Java, Android, V8, Swift, Rustに採用 * 作者の名前って珍しい (Tim Peters) * 安定なソート * Comb Sort 1991年に名前が付いたが発明はもっと早かった * Rubyもハッシュのキー順序を保存するくらいなんだから安定なソートが標準であるべき? * Ruby 2.7でArrayをキーにしたHashを引くときにArrayが変化しても同じvalueを引いてしまう事象に当たった * `ary.hash` をキーにしたら直ったので何かありそう * https://github.com/huginn/huginn/pull/3151/files * 時間取れたら追いかけます (knu) * お盆の過ごし方 * [Erg](https://erg-lang.github.io/) ([erg-lang/erg: A Python-compatible statically typed language](https://github.com/erg-lang/erg)) * Pythonにtranspileされる静的型付け言語 * Pythonで嫌なところがいろいろ直っている * Nat型とか物理学徒っぽい * ESのパイプ演算子(`|>`) * [tc39/proposal-pipeline-operator: A proposal for adding a useful pipe operator to JavaScript.](https://github.com/tc39/proposal-pipeline-operator) * [Expressions And Operators: Pipe](https://docs.hhvm.com/hack/expressions-and-operators/pipe) * Rubyでも一瞬入った * レシーバが特別な引数というRubyの世界観と、隣接するElixir等での異なる世界観がぶつかってしまう * プレイスホルダー案は採用したくない (matz) ## 2022/08/08 * コロナ、運動不足、尿道結石 * エンジニアの給与 * ユリウス暦とグレゴリオ暦 * [[DOC] New doc about Julian/Gregorian (#70) · ruby/ruby@1607c6d](https://github.com/ruby/ruby/commit/1607c6d2814cc4f71aa65bc273d745f28514e735) * Time から to_date すると暦の変換が入るので日付がずれる→しょうがないか * to_datetime との整合性 ## 2022/08/01 * RDocとRBSの連携をしたい * `$ rdoc sig/*.rbs` * https://github.com/ruby/rbs/pull/1048 * RBSに書かれたドキュメントをRDocに読んでくるプラグインができた * RBSにあるけどRDocにない概念をどうするか -- interface, type alias, generics * RBSとRDocのどちらに書くか * ユーザーが決める * そもそも連携とは何をやるのか * RubyソースコードにRDocとしてRBS相当の情報を埋め込む? * `callseq` に自然言語で書かれているが、複雑な型を厳密に書くのは大変なので * この方向も将来的に欲しい * ソースコードとドキュメントの近さがRDocの良さ * RBSにRDocを書けるようにする? * RDocからRBSを抽出する * 今やっているやつ ```rbs class Foo # @type method: (String) -> void def foo(x) end # RDocのコメント # @type (String) -> Integer def foo(x) x.to_i end end ``` ```ruby= # https://yardoc.org/features.html # Reverses the contents of a String or IO object. # # @param [String, #read] contents the contents to reverse # @return [String] the contents reversed lexically def reverse(contents) contents = contents.read if respond_to? :read contents.reverse end # https://rubydoc.info/gems/yard/file/docs/GettingStarted.md # Converts the object into textual markup given a specific format. # # @param format [Symbol] the format type, `:text` or `:html` # @return [String] the object converted into the expected format. def to_format(format = :html) # format the object end ``` ## 2022/07/25 * https://www.mikeperham.com/2022/07/14/modernizing-einhorn/ * ISUCON12 https://isucon.net/archives/56838122.html * Perlが5組!しかもそのうち一組が通過 * Perl 7 * https://www.perl.com/article/announcing-perl-7/ * https://perlzemi.com/blog/20210921094146.html * https://gigazine.net/news/20210303-hijacking-of-perl-com/ * [Carbon](https://github.com/carbon-language/carbon-lang) * Googleのプロジェクト https://twitter.com/rui314/status/1549597027792998403 * Rust や [Zig](https://ziglang.org/) と fn なのが同じで見分けが付きづらい * C23にはdeferが入る? * Rubyにもdeferがほしい話 * インデントが深くならない * 素朴にensureに後処理を並べると途中でこけたときに残りが実行されない問題 ```ruby def func 1.times do |n| p n end end def func |n| <- 1.times p n end def func |y| <- height.times |x| <- width.times p [x, y] end def func |f| <- open("foo") |g| <- open("bar") f.gets g.gets end def func open("foo") do |f| open("bar") do |g| f.gets end end end def func open1 open2 ensure close1 ensure close2 end def foo f = open ensure = f.close g = open ensure = g.close f.gets g.gets end def foo f = open DEFER{ f.close } g = open DEFER{ g.close } f.gets g.gets end def foo f = open END(f) {|f2| f2.close } # END(:def) {...} # END(:block) {...} g = open END { g.close } f.gets g.gets end ``` * ユースケース * open系はだいたいライブラリが後始末を用意しちゃうよね * Tempfileとかはいちいちブロックを作りたくない。そのときによくあるのが ensure で `f&.close` するみたいなやつ(途中でfが定義される)で、これはdeferのユースケースだろう * シェルスクリプトだと `trap finalize 0` とかよくやる * `trap(:RETURN) { ... }` でどうか * trap のセマンティクス的に複数回呼び出しで上書きされそう * Web3 * 税制の話 ## 2022/07/18 祝日のためお休み ## 2022/07/11 * PRのレビューコストとコミット権 * えいやでYARVを入れなければ今のRubyはなかった * ターミナル向けのエラーメッセージ(エスケープシーケンス付き)を(Rack等で加工して)ブラウザで表示したい話 * 使えるエスケープシーケンスを絞る * 下線、ボールド * 白黒以外の前景色 * エスケープシーケンスなしで意味が通らないことのないよう、あくまで補助的に使う * [Ruby Shield | Ruby Central](http://rubycentral.org/ruby-shield) * [width package - golang.org/x/text/width - Go Packages](https://pkg.go.dev/golang.org/x/text/width) が便利だった話 * [Go 言語による Unicode 半角/全角変換 | text.Baldanders.info](https://text.baldanders.info/golang/character-width-for-unicode/) * Rubyだと今もNKFを使わないと面倒 * 他の言語では? * [Transforms - ICU Documentation](https://unicode-org.github.io/icu/userguide/transforms/general/) ## 2022/07/04 * Ruby採用企業の時価総額 * https://toprubycompanies.info/ ## 2022/06/27 * [Thank you to our maintainers | The GitHub Blog](https://github.blog/2022-06-24-thank-you-to-our-maintainers/) * [Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/18878) * 東京周辺committer達のひさびさの会食 * Ruby30 * ドメインの移管トラブル… * どこならいいんだろう * CPUをたくさん使いたい人向けのVPSってないよね… * [Google Cloud 上で 100 兆桁の円周率を計算 | Google Cloud Blog](https://cloud.google.com/blog/ja/products/compute/calculating-100-trillion-digits-of-pi-on-google-cloud) * 新車を買うと納車は一年以上先 * 暑いので庭でプールしたい ## 2022/06/20 * RubyKaigiの応募が例年より少なかった話 * コロナ感染者数 * 後遺症がこわい * Python 3.11が速くなった * Rubyではだいぶ昔から当然のようにやっている最適化 * Pythonはぜんぜん最適化に取り組んで来なかったのはなぜ? * 本体の開発がGuidoの意向で保守的だった? * サイドプロジェクトではいろいろな取り組みがあったがどれも主流にならなかった * まだ伸びしろありそう * パスワード管理 * 1Password, LastPass, BitWarden, KeePass(XC) * 2要素認証の有効期限が短いサービスがめんどうすぎる * HackerOne... * 2要素認証なのにOTPも同じアプリ/サービスで発行してしまうことへの葛藤 * gcc 3.x はもう切っていいよね * gcc 4 (4.2.1)は一応GPL2最後のバージョンということで対応の需要があった * でもOpenBSDもClangに移行したのでもういいかも ## 2022/06/13 * Rails 6.1でRuby 3.1いける話 * どの辺から型を付けていくか * https://roda.jeremyevans.net/ * RubyKaigiの宿と現地の交通手段 * バスは有料とか1時間に1本とか * 糸柳さん元気かな * Atomの終焉 * Electronの産みの親(旧称: Atom Shell) * Emacsユーザが減っているのは人口の自然減? * 秀丸エディタがまだ現役で、買い切りなのに作者が食えているというのがすごい * Unicodeへの移行で当時のエディタがみんな遅くなった * 当時のUnicodeヘイトはすごかった * GCC12でいろんな警告が出る * structの最後のメンバーを `char a[0];` みたいにする可変長配列の定番テクニックで添え字の範囲エラーになる * レガシーメディア * フロッピーディスク * MO, iomega Zip * アメリカではCDよりレコードが売れている? * https://toyokeizai.net/articles/-/421787 * 職場の公用語英語化 * ベトナム支社 * 日本語を覚えてくれる * Vietnam == 越南 ## 2022/06/06 * 梅雨 * VSCode * Voicy https://voicy.jp/channel/2940 ## 2022/05/30 * [Bug #18729: Method#owner and UnboundMethod#owner are incorrect after using Module#public/protected/private - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/18729) * [Raise exception if the constant was not defined. by ioquatix · Pull Request #5949 · ruby/ruby](https://github.com/ruby/ruby/pull/5949) * [Make write atomic. by ioquatix · Pull Request #5419 · ruby/ruby](https://github.com/ruby/ruby/pull/5419) * https://twitter.com/atmfe/status/1530560340429512704 * [学力偏差値 - Wikipedia](https://ja.wikipedia.org/wiki/%E5%AD%A6%E5%8A%9B%E5%81%8F%E5%B7%AE%E5%80%A4#%E6%97%A5%E6%9C%AC%E3%81%AB%E3%81%8A%E3%81%91%E3%82%8B%E8%AA%95%E7%94%9F%E3%81%A8%E6%AD%B4%E5%8F%B2) ## 2022/05/23 * https://ti.to/rubykaigi/2022 * https://github.com/ruby/ruby/pull/5899 で doc/make_cheetsheet.md などが消えて、他に移動した情報もあるが、個別のテスト実行やカバレッジ取得などの消えただけのものもあるという話 * https://shopify.engineering/shopify-ruby-at-scale-research-investment * https://lloydy-investment.com/equity-canada/ * https://twitter.com/yukihiro_matz/status/1527633269256523776 ## 2022/05/16 * Salesforce * 中のエンジニアの存在感があまりない話 * Javaコミュニティ? * Slack その後? * Herokuもそんなにぱっとしない * TDの顧客に利用者が多い * GitHub Sponsorsは現状手数料取られない * これで海外から仕事を請けるみたいな形もできちゃう? * 雑所得だと経費積めないとか * 払う側の計上方法が面倒? * 円安 * 石油も上がって渡航費高 * 日本式の惣菜パンが売れている話 * 海外の寿司、ラーメン * https://yosushi.com/ * 味のないラーメン * タイ料理は食卓調味料クルアン・プルンで客が自分でカスタマイズするスタイル * Web広告が刺さらない話 * Rubyのマーケティング * Y Combinator投資先の多くがRubyを使っている * Rubyを採用している会社が時価総額の52%を占めている * https://charliereese.ca/y-combinator-top-50-software-startups/ ## 2022/05/09 * QRコード物語 * [中日新聞:自動車工場のガロア体 QRコードはどう動くか](https://static.chunichi.co.jp/chunichi/pages/feature/QR/galois_field_in_auto_factory.html) * 科学班が頑張ったのかな * asahi.comやnikkei.comがCMSや配信システムに自社でエンジニアリングリソースを投入しているのは有名だが、取材や記事作り、プレゼンテーションについては? * 選挙速報とかは各社頑張っているので、結局は関心やお金の総量で決まってしまうのかな * 教育とプログラミング * Dynabook構想は未だ実現していない * 手元の端末で手軽に物理シミュレーションするなど * ビジュアルプログラミングはちゃんと機能している * ここには式しか入れられない、みたいなことが目で見て分かる * [「PyScript」はJavaScriptのようにPythonコードをHTML内に記述して実行可能、Anacondaがオープンソースで公開 - Publickey](https://www.publickey1.jp/blog/22/pyscriptjavascriptpythonhtmlanaconda.html) * Semantic Webは死んだ? * CSS、意味と構造の分離 * ボールドはデザイナーの意図として最初からボールド * EPUB * Web3 * NFT * [合法的に他人にお金をあげる|えふしん|note](https://note.com/fshin2000/n/n6d2aabaec6fd) * スパチャでAMA的な配信イベントもありかも * 技術顧問ビジネス * KPIを立てるのはなかなか困難という話 * バーンダウンチャート、健全性指標、予測可能性 * Windows 11 * Insider Previewから上げようとしたらクリーンインストールを強いられて辛い ## 2022/05/02 * 子供の習い事、通学 * お茶の水の塾に通わせるようになったら送り迎えするのか?自分も近所の大学に入る? * https://www.ntv.co.jp/oyabaka/chart/ * ヘリコプターで福井から東京へ80分あまり、片道22,000円 * https://www3.nhk.or.jp/lnews/fukui/20220427/3050011071.html * USJやディズニーランドの混雑 * 円安なので値上がりする前にiPadを買った * 渡航中にコロナに罹患したときの隔離って実際どうなるのか * 個人で家庭教師を直接募集した話 * 英語教育 ## 2022/04/25 * io-nonblock を標準機能にしように対してむしろdeprecateしたいとまつもとさんが言ったら入れなくていいから消さないでの声 * [Canonical Ubuntu 22.04 LTS is released | Ubuntu](https://ubuntu.com/blog/ubuntu-22-04-lts-released) * Netflixの契約者が減少のニュース * [契約者数減少が報じられているNetflixが、『ボーン』や『アッホ夫婦』など複数のアニメーションプロジェクトを中止](https://jp.ign.com/netflix/59218/news/netflix) * Individual Contributorという職掌 * 我々みたいな人が各社にスペシャリストキャリアパスを作っていかないといけないが、評価制度とかを作るのにコミットすること自体はICのJDと違うという矛盾😅 * でもそれをやって自分の給料の天井を破っていかないと自分のポジションがないのでしょうがない * [人口1800人の姫島村で年商5億4000万円 瀬戸内海に浮かぶ島が“ITアイランド”に変貌(OBS大分放送) - Yahoo!ニュース](https://news.yahoo.co.jp/articles/04c82c5127bcb2834fdb98c8056637dc540e0aae) * Ruby開発がオフィス開設 * Goでの開発の話 * genericsはまだ制約が多い * カジュアルにgenerator (コード生成)を使う文化になっているので、あまり使いどころがないなという印象 * リフレクションもカジュアルに使われている * jsonやvalidator、ORMなどは構造体のフィールドのタグを使って指示 * 明示的な返り値チェックを徹底し、コンテキストや必要な情報は引き回すパラダイム * 例外機構・大域脱出冬の時代? * WASMもアセンブリレベルでスタックをすっとばすようなジャンプ機構は省かれている * system() は例外を出してほしい… * exception: true はあるが * コマンドが存在しないレベルのエラーは例外でいいけど、終了ステータスが非0で例外はそれでいい? * コマンドが存在しない場合も、シェルを通さない場合はErrno::ENOENTだがシェルを通す場合は終了ステータスが非0と異なる * シェルを通すかどうかはメタ文字の有無で決まるので分かりづらい * diff(1)などは差分の有無を終了ステータスで示すが、それを例外処理で拾うのはなんか違う感もある * Windowsだと存在しないコマンドでも例外が出てくれない? ```ruby p system("dirr") #ruby 3.2.0dev (2022-01-14T04:46:12Z gh-4636 c613d79f9b) [x64-mswin64_140] #nil ``` * Rakeの sh が望みの物かも * ブロックを渡すとステータスチェックがユーザに委ねられるが、渡さないとエラー時に例外発生 ## 2022/04/18 * [Rome Formatter](https://rome.tools/#formatter) * [JavaScript/TypeScriptの高速フォーマッター「Rome Formatter」リリース。Rust製でPrettierより約10倍高速と - Publickey](https://www.publickey1.jp/blog/22/javascripttypescriptrome_formatterrustprettier10.html) * 先週の話、そういえば [Deno - A modern runtime for JavaScript and TypeScript](https://deno.land/) もRustだった * ruby -a で `$F[n]` でなく `_1`, `_2`, ...でカラム値を取れるようにしたい * でも numbered parameters は `_2` があるかどうかで `_1` の意味が変わる仕様にしてしまったので使いづらい? * 複数引数でyieldすればいけそう ```ruby def foo; yield 1, 2, 3; end; foo { p _1 } #=> 1 ``` * ところで `_1` 意外と使ってる * `_2` はほとんど使わない * `-a` はPerl由来 * WASI portを出したらさっそくいろんな人が使ってくれてうれしい話 * [Ruby on Browser 1.0 リリース - ブログのおんがえし](https://ongaeshi.hatenablog.com/entry/rubyonbrowser-1.0.0) * だいぶ前からブラウザで動くんだけどね ([mame/emruby: emscripten'ed MRI](https://github.com/mame/emruby)) * マーケ大事 * [「Ruby」の生みの親 まつもとゆきひろ氏がクルーズ株式会社技術PR顧問に就任|CROOZのプレスリリース](https://prtimes.jp/main/html/rd/p/000000915.000006324.html) * Rubyは使ってない * Twitter * 検索精度問題 * [Twitter Blue](https://help.twitter.com/ja/using-twitter/twitter-blue) そろそろ日本にも? ## 2022/04/11 * 野球の話 * 佐々木朗希の完全試合 * 明後日リリース * 2.6 * 最近JavaScript周辺ツールにGoやRustが使われている流れの話 * https://esbuild.github.io/ (Go) * https://rome.tools/ ([Rome will be written in Rust 🦀](https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust)) * Rustは面倒なのにみんな使い始めててすごい話 * Cはコンパイラがあほなので介護の気持ちで書ける * NimはC++へのトランスパイラ方式 * Jujia * 立ち位置はRubyと同じインタプリタ * aptとかじゃなくて公式からダウンロード * なんでも [asdf](https://asdf-vm.com/) べんり * https://github.com/asdf-vm/asdf-ruby (ruby-build を使ってる) * https://github.com/rkyleg/asdf-julia (公式バイナリをダウンロードしてくれる) * aptの標準パッケージで済ませたい話 * Ubuntu LTS→LTSのジャンプは毎回つらい * Ubuntu 22.04になるとOpenSSLが3なので古いRubyはインストールできない ## 2022/04/04 * Wantedlyの `n年前、#<WorkingHistory:0x0000xxxxxxxxxxxx>で働きはじめました` メール * Object#to_s がインスタンス変数とか出す仕様じゃなくてよかったね * 数字のカンマ区切りの方法 * Ruby 2.6 EOL * コードネーム * DebianやmacOSのは脈絡なくてわかりづらい * TDはコードネーム禁止令出た * pixivの社内プロジェクト名はコーポレートカラーの青いもの * Java SE8 でコードネーム廃止したらしい * Cobalt Qubeってあったな * 戒名=洗礼名 * 現代日本の諱、マイナンバー カードはIMINA * Gmailで迷惑メールフィルタがたまに荒ぶる * heyとか順調なの? * Gmail, Sendgridなど寡占化が進む * メールもいずれ終わるのか * Twitterの広告 * 有料プラン日本にも来る? * Cookie警告日本でも出始めた * GitHubのissue勝手翻訳サイト * Googleとのいたちごっこ * [RubyのWebAssembly/WASIへの移植が実現、プレリリース版のバイナリ公開。RubyGemsにも対応 - Publickey](https://www.publickey1.jp/blog/22/rubywebassemblywasirubygems.html) ## 2022/03/28 * Timeout, ensure, defer * https://bugs.ruby-lang.org/issues/13923 ```ruby= def foo begin f1 = open f2 = open f3 = open # use f1, f2, f3 ensure f3.close ensure f2.close ensure f1.close end end ``` ```ruby= # Matz' idea def foo begin f1 = open f2 = open f3 = open # use f1, f2, f3 ensure f3.close f2.close f1.close end end #=> def foo begin f1 = open f2 = open f3 = open # use f1, f2, f3 ensure begin f3.close ensure begin f2.close ensure f1.close end end end end ``` * 行単位というのはちょっと厳しそう ```ruby= def foo f1 = open ensure do f1.close else XXX end f2 = open ensure do f2.close end f3 = open ensure do f3.close end # use f1, f2, f3 end #=> compiled to def foo f1 = open begin f2 = open begin f3 = open # use f1, f2, f3 ensure f3.close end ensure f2.close end ensure f1.close end ``` * 命令レベルあるいはASTレベルでこうコンパイルされる?→たぶん? ```ruby= def foo open do |f1| open do |f2| open do |f3| # use f1, f2, f3 end end end end def foo f1 <- open f2 <- open f3 <- open # use f1, f2, f3 end ``` ```ruby def bar 3.times do |x| 4.times do |y| p [x, y] end end end def bar x <- 3.times y <- 4.times p [x, y] end def product(ary1, ary2) Enumerator.new do |g| x <- ary1.each y <- ary2.each g << [x, y] end end product([1, 2], [3, 4]) #=> [[1, 3], [1, 4], [2, 3], [2, 4]] def product(ary1, ary2) Enumerator.new do |g| for x in ary1.each, y in ary2.each g << [x, y] end end end def product(ary1, ary2) g <- Enumerator.new x <- ary1.each y <- ary2.each g << [x, y] end def product(ary1, ary2) Enumerator.new do |g| g << [x, y] for x in ary1.each, y in ary2.each end end def product(ary1, ary2) Enumerator.new do |g| g << [x, y] for x in ary1.each for y in ary2.each end end def product(ary1, ary2) g << [x, y] for g in Enumerator.new \ for x in ary1.each \ for y in ary2.each end ``` * Tempfile.create, Dir.chdirや2つIOを開く場合など、入れ子の順番に意図がないときに平たく書きたい * Python の for/else が欲しい(Enumerable#find があるから多分要らない) ```ruby= ary.each do break end.if_no_break do # break されんかったときの話 end ``` ## 2022/03/21 春分の日につきお休み ## 2022/03/14 * 確定申告 * インフレ * Ruby 2.6のEOL迫る * 来年はRuby 2.7が…😱 * Bugs * https://bugs.ruby-lang.org/issues/18614 * https://bugs.ruby-lang.org/issues/18623 * Feature * https://bugs.ruby-lang.org/issues/18626 * チェックの主体はObjectで良いのか? * 事実上の型制約をソースに書くのはRubyには採用されないか * [ECMAScript proposal: Types as Comments](https://github.com/giltayar/proposal-types-as-comments) * https://www.publickey1.jp/blog/22/javascripttypes_as_commentsjavascripttc39.html * TS→JSのトランスパイル不要にしたい * JSDocコメントから型チェックするTSの機能をなくしたい * IO::Timeout * https://bugs.ruby-lang.org/issues/18630 * Matz is positive about this 👍 * Some concerns Matz will comment on the issue need to be addressed. ## 2022/03/07 * Worldle * 子供の好きな食べ物 * 物価上昇 * そば屋がかわいそう。蕎麦の実、小麦粉、エビ等々 * Rubyの話… * zverokが心配 * https://zverok.space/blog/2022-03-03-WAR.html * 航空便のロシア迂回ルート ## 2022/02/28 * Time.new で 2021-03-01 を作ろうとしたら 2021-02-30 という時刻が生成される (Ruby 3.1, master) * https://twitter.com/yhirano55/status/1498060619769335808 * https://ruby-jp.slack.com/archives/CLWSHA76V/p1646000383481869 * 調査中 * 原因判明 https://github.com/ruby/ruby/blob/1cb67905337100015c6845cdb4be2bc2133014ea/time.c#L1113 ```c const int8_t *days_in_month = days_in_month_of(result->tm_year + 1900); ``` 正しくは days_in_month_in() で、マクロ名が紛らわしかった。型チェックがない…。インライン関数なら救われた? * ウクライナ情勢 * Grammarly: https://www.wsj.com/livecoverage/russia-ukraine-latest-news/card/v4WMx83n6xIR9U6W0Pr2 * [Leaflet](https://leafletjs.com/): https://twitter.com/LeafletJS/status/1496051251393482765 * [Readdle](https://readdle.com/): https://readdle.com/ja/blog/readdle-on-ukraine * [MacPaw](https://macpaw.com/): https://twitter.com/MacPaw/status/1496767144553586689 ## 2022/02/21 * [Ruby 3.1 adds error highlighting gem | Saeloun Blog](https://blog.saeloun.com/2022/02/16/ruby-3.1-adds-error-highlighting) * [Include diagrams in your Markdown files with Mermaid | The GitHub Blog](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) * Graphviz, PlantUMLが超えられなかったキャズムを超える? * レイアウトヒントを与えても思ったように配置されないことが多い * この分野は最近けっこう動きがある * LucidchartとかあるところにGoogle純正の構成図ツールが発表された: [Google Cloud Developer Cheat Sheet](https://googlecloudcheatsheet.withgoogle.com/architecture) * VisioのWeb版が出た: [Web 用 Visio の概要](https://support.microsoft.com/ja-jp/office/web-%E7%94%A8-visio-%E3%81%AE%E6%A6%82%E8%A6%81-9ca66c90-04f1-42c8-8176-1687ffb35d46) * ruby -cについて * `echo 'break if false' | ruby -c` => `Syntax OK` だけど実行すると(breakは通らないのに) SyntaxError * 字句解析レベルだけチェックして意味は解析していない * →このままでよい by matz * Rubocopとのコラボ: https://github.com/rubocop/rubocop-rubycw * r7kamuraさんの[日記](https://r7kamura.com/articles/2022-02-18-diary) > 最近、Railsアップグレードの仕事をやっている中で、Deprecation Warningを出してAPIを変更をする際、RuboCopのCopも提供してくれるといいのに、つまり静的解析で検知したり自動変換したりする仕組みも一緒に提供してくれたらいいのに、と思うことが増えてきた。例えば、rubocop-rails_deprecation、みたいな名前でGemを提供するというのはどうか。 * コロナワクチン3回目 * ウクライナ情勢 * オフラインでカンファレンスに参加できるのはいつか * アメリカの寿司のレベルが上がっている話 ## 2022/02/14 * 東京の雪は肩透かし * ワクチン接種3回目 * 台東区 https://www.city.taito.lg.jp/kenkohukusi/kenkokikikanrieisei/kansensho/kansenshoyobo/c19vaccine/yoyaku/yoyakujoukyou.html * ローマ字のURLが潔い * 縦書き * バレンタインデー * なのに歯医者 * 医療費控除 10〜最大200万 * https://www.nta.go.jp/taxes/shiraberu/taxanswer/shotoku/1128.htm * Wordle * NY Times に大金で買われたのは夢がある * 日本の新聞社の将棋と同じような感じ * NFT * [空想のNFTと現実のNFT - by Daisuke Sasaki - メディアヌップ](https://sasakill.substack.com/p/imaginarynft-and-realnft) * Ruby 3.2 * YJITに期待 * しばらくは言語自体よりは体験の改善 * マクロ * LISPのリーダーマクロまで? * Rustでは後悔もあるらしい * アノテーション * Pythonのデコレータみたいな * `#[x:y]` のように * どうせ依存するならコメントじゃなくても ``` @[rbs: (Integer) -> Integer] def double n = n * 2 ``` * PythonのデコレータはRubyのメタプログラミングでできちゃうレベルなのであまりありがたくない? * PHPみたいにメソッドの属性として取れるものがいいのかな * `obj.:foo` を思いとどまった話 * Unicodeの開放 * 𝜆 (U+1D706 MATHEMATICAL ITALIC SMALL LAMDA) * `%w` ```ruby %w{ a b c } ``` で `b` を一時的にコメントアウトしたりできないものか * 行指向ではないからなあ * `%w{}x` * `%wx{}` のように2文字以上を解禁する? * `%time{}` とか出てきそう * open3を組み込みにしたい * IO.popen では足りない * Encodingの話 * UTF-8 + ASCII-8BIT ## 2022/02/07 * detailed_message https://bugs.ruby-lang.org/issues/18438 ```ruby begin raise "foo" rescue exc = $! end p exc.message #=> "foo" p exc.detailed_message #=> "foo (RuntimeError)" p exc.detailed_message(xxx: false) #=> "foo" p exc.full_message #=> "test.rb:2:foo (RuntimeError)\n\tfrom test.rb:2:<main>" p exc.detailed_message(highlight: true) #=> "\e[1mfoo\nbar\e[0m" p exc.full_message(highlight: true) #=> "\e[1mfoo\e[1m (\e[1;4mRuntimError\e[0m\e[1m)\e[0m\nbar\e[0m" p exc.detailed_message(highlight: false) # for Sentry p exc.detailed_message(highlight: false).sub(/\A(.*?)(?: \(\w+\))/) { $1 } # for Sentry p exc.detailed_message(highlight: false, exception_class_name: false) # "foo" raise # unhandled exception raise RuntimeError # RuntimeError (RuntimeError) p exc.message + exc.additional_message(highlight: false) # for Sentry ``` 1. このまま(気になるならSentry側に頼む) → これ、もし要望が強ければ2 2. `exception_class_name: false` みたいなキーワード引数を入れる 3. ` (RuntimeError)` の追加の責務を full_message に戻す 4. additional_message styleを今から試す → highlightの責務が分散するのでいまいち * https://github.com/Shopify/rfcs/blob/new-signing-mechanism/text/0000-introduce-a-new-signing-mechanism.md * https://bugs.ruby-lang.org/issues/18573 * Object に追加したくない * `Array#max` や `Array#min` のように最適化? * 最適化してうれしいほど使う? * 性能の話なのか、書き味の話なのか * pack は buffer: で既存の文字列への追加も可能 * テンプレートをレシーバにして String のメソッドはどうか * 名前の問題? そもそも不要? * printf のフォーマット文字列に pack template を混ぜる? * python だと string interpolation にも書式指定ができる * 個別に対応するのではなく `配列リテラル.メソッド` のようなパターンをまとめて対処できないか * Perl のように `pack(template, *args)` を追加する? * 書式と pack 対象の型は1対1対応しているので、`Base64.encode64` のように個別に用意する? ## 2022/01/31 * 開発者会議延長戦の感想戦(?) * Struct::Value の採用の反響 * 右代入の束縛先に何を許すか * ローカル変数だけからインスタンス変数などにも拡張するが、定数がダメという理由付けが難しい * Exception#detailed_message/full_message と文字修飾 ## 2022/01/24 * Google Apps for Domain無償版がついに終了へ * メーリングリストのメールでたくさん容量使ってた * 第14回フクオカRuby大賞 * まだオフィシャルリリースはなし? * f-ruby.com にちょっとドキッとする * 福岡空港のコードは FUK * はすみさんが大賞らしい * 訪問診療のSaaS * WASMサポートのマージへの反響が想像以上にでかい * [🎉 Happy 10th Birthday, Sidekiq! 🎂 | Mike Perham](https://www.mikeperham.com/2022/01/17/happy-10th-birthday-sidekiq/) * もう50になるのでメンテナーを引き継ぎたいとのこと * まつもとさんも還暦が近づくので…😇 * 80歳の現役プログラマー * 標準ライブラリなどの呼称 https://github.com/rurema/doctree/issues/2665 * built-in, bundled, standard, ... * [Zig Programming Language](https://ziglang.org/) * Cライク/Rustほどガチガチではない * CRubyをC以外に書き直していくとしたらどんなシナリオ? * アーキテクチャによるunaligned accessのペナルティー * unalignedな可能性のあるコードはコンパイラが頑張ってSIGBUSを回避 * RISC-Vマシンほしいね * 入手むずい ## 2022/01/17 * 年末年始 * 今年初回 * このZoomは笹田さんがいなくても開ける(はず)ので休みでも有志でやってOK * rbtree問題 * sorted_setが依存しているがRuby 3.2でビルドできない * https://github.com/ruby/ruby/commit/7c738ce5e649b82bdc1305d5c347e81886ee759a * 作者に連絡したが一週間ほど返事なし * ソースもGitHubなどにないので履歴が見られない、フィードバックの口がメールしかない、というのも問題 * RubyForge/RAAとpost GitHubの時代の壁、不幸な歴史 * 野良forkで rbtree2, rbtree3 などが生えている * google-cloud-ruby も rbtree に依存している * 以前Ruby 2.7で壊れたときにrbtree3への移行を提案したが、 互換性の問題が発覚、2021/1にrbtreeが突如リリースされたのでそのときはいったん中止した * https://github.com/googleapis/google-cloud-ruby/issues/8421 * この互換性問題を解消してから google-cloud-ruby には持って行こう * 互換性問題もあるので、乗っ取るよりは別に作って順次移行、が丸そう * 名前は? * rbtree[2-9] みたいなのは数字の意味が謎すぎるので避けたい… (@knu) * ordered_map とかでも。汎用のデータ構造として需要はあると思う @mrkn * 性能特性とかの話題は過去に出たので、赤黒木の名前は入っていた方がいいかも * 場所は? * とりあえずGitHubで (メンテナがGitLabとかがいいと強く言うなら考える) * 継続的メンテナンスに熱意のある人がいないなら github.com/ruby/ 以下もあり * [ユーザアカウントのリポジトリの所有権の継続性を管理する - GitHub Docs](https://docs.github.com/ja/account-and-profile/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories/maintaining-ownership-continuity-of-your-user-accounts-repositories) * OSSフリーライド問題、npmパッケージ乗っ取り問題 * OSSをやっていてよかったこと? ## 2021/12/27 * Ruby 3.1おつかれさまでした * Rails 7.0.0が descendants でこけるのでアップグレード待機 * Windowsでのlibffi * 火事に気を付けましょう * お墓の話、土葬・水葬ほぼできない問題 * 行政区画の境界 * 次の新機能 * namespaceのようなもの * static barrier * 有効にして以降はクラスの再オープン等を禁止 * [Float 3.0 is misparsed as integer 3 in workflow YAML · Issue #849 · actions/runner](https://github.com/actions/runner/issues/849) * GitHub Actionsで `ruby: 3.0` と書くと 3 と受け取られて3系最新の 3.1.0 が使われるので引用符が必要 * github.com/ruby 配下はだいたいやっているが、自分のプロジェクトでも確認がてら3.1を追加するついでにやろう * 夜はリリースパーティー ## 2021/12/20 * 3.1まで一週間を切った * subclasses と descendants * descendants は3.1には入れないでおく * Class でなく Module に欲しいという人がいる * [Bug #18373: Bundled gem (RBS, debug) extensions are not properly built - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/18373) * [Install gemspec even though no .rb and no .so by kateinoigakukun · Pull Request #5206 · ruby/ruby](https://github.com/ruby/ruby/pull/5206) * [Bug #18417: IO::Buffer problems - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/18417) * WeakMapの話 ## 2021/12/13 * Log4jの脆弱性 * https://piyolog.hatenadiary.jp/entry/2021/12/13/045541 * `require "objspace/trace"` したときのpの表示を拡張したい * 現状:Kernel#p を直接変えている * `ObjectSpace.p(obj) #=> "#{ obj.inspect } @ #{ allocation_path }:#{ allocation_line }"` * `p ObjectSpace.site(obj) #=> "#{ allocation_path }:#{ allocation_line }"` * `Kernel#p`にキーワード引数を与えたときの挙動 ```ruby a = 10; b = 20 p a:, b:; #=> {:a=>10, :b=>20} #=> proposal a: 10 b: 20 ``` * Class#subclasses と #descendants * 機能の重複感があるので前者を入れて後者は消す方向 * Q. descendants は使うの? * A. Rails/ActiveRecordにはSTI(Single Table Inheritance)という機構があってクラスが多段継承されるので、全modelクラスを取得する際に必要 * subclasses があればActiveSupportが descendants を効率よく実装できるのでOK * NEWSに足りないエントリを追加しましょう * https://bugs.ruby-lang.org/issues/18396 * 実はいけるんじゃない? * 3.1を出したら警告を出すようにしてやってみよう * パターンマッチの in 節ではすでにそうなってる ```ruby x = { a: 1 } case x in a: :ok end #=> :ok ``` endless range (`..`) でダメなのも同じ * 最後に高額の現金を使ったのは? * 家を買うときの仲介手数料 * 税金などのコンビニ払い * バイトの給料などは今も手渡しのところも * 車 * 免許持っていないコミッター結構多い * 合宿や保証には年齢制限 ## 2021/12/06 * 人出が多いねという話 * コミケ * 噴火 * 富士山の噴火史 * https://github.com/ruby/ruby/commit/8944009be7418614ce7d4077807ac2b60d4d5d85 以来、Rails consoleがWarning floodになっており、おそらくirbで修正が必要と思うのですが、これ以上手がかりがなく困ってます。https://gist.github.com/yahonda/8cbb81e193b10f7f1be7f6ffb2c738e5 (yahonda) * mame: すまんかった。deprecateする必要はなかったので変える * default gemとの同期がつらい * つらいね…… * `Time.new` 文字列1個を渡した場合の挙動が変わっちゃう * `Time.at` でやれば非互換がない * 開発者会議でやろう * 風邪が…… * このご時世で許されるものじゃないのでちゃんと治して * [zeitwerkで定数定義をちゃんと拾いたい](https://bugs.ruby-lang.org/issues/17881) * 割とめんどくさい問題 ## 2021/11/29 * Module#descendants/subclasses の性能要件、必要性(用途) * コロナ、入試シーズン、学区制の話 * 高校浪人がふつうな町 * [PHP 8.1 Released!](https://www.php.net/archive/2021.php#2021-11-25-1) * Fiber https://wiki.php.net/rfc/fibers * Enum https://www.php.net/manual/en/language.enumerations.php * First-class Callable Syntax: `$foo = foo(...);` でcallableとしてのfooが取れる * 型関連の改善いろいろ; readonly, intersection types, never return typeなど * error_highlight のバックスラッシュエスケープ問題 * 端末に垂れ流すリスクは? * https://security.stackexchange.com/questions/56307/can-cat-ing-a-file-be-a-potential-security-risk * 他の言語(処理系)は垂れ流しているし、いいんじゃない? ## 2021/11/22 * 休みを取って4連休にしている人が多そう * Cloudflare Workers * asyncにいろいろ取ってきたり送ったりして待ち合わせる処理をRuby/Railsで書きづらい * RailsのAPIバックエンドに、TypeScriptなどでBFFを書いてかぶせることが多い * Rails 7の目玉は? * Hotwire * これと心中する覚悟がいるかも * 管理画面が簡単に書けるとかなら * QueryLogs * https://github.com/rails/rails/pull/42240 * `Time.new(str)` * ISO 8601の名前空間、分けたくない… * strptime は? * Internet Time * 子の刻は 23時-1時 * 火星の一日は約24時間40分 * まつもとさんが明日で結婚30周年 真珠婚式 * ルビー婚は40周年 * https://ja.wikipedia.org/wiki/%E7%B5%90%E5%A9%9A%E8%A8%98%E5%BF%B5%E6%97%A5#%E8%A8%98%E5%BF%B5%E3%81%AE%E5%91%BC%E7%A7%B0 * https://en.wikipedia.org/wiki/Wedding_anniversary ## 2021/11/15 * BiDiにまつわる「脆弱性」の話題 * 言語以前にツールで対応が必要 * エンコーディングに応じて識別子に禁止するホワイトスペース類を拡張する? * キリル文字やギリシャ文字、装飾文字など見分けが付かない文字はいろいろある * イントネーション、方言の話 * https://ameblo.jp/kana-deruko/entry-10921208596.html * `def foo ...` でエラー * `;` で区切るとダメっぽい * `Classs.new { }` の中でもエラーになるっぽい * [AST Tooling](https://dev.to/baweaver/future-of-ruby-ast-tooling-9i1) ## 2021/11/08 * 5万円くらいのiPadが大活躍していてコスパいい * Pro高い * アメリカのスーパーには魚が少ない * 税金 * 日本の住民税高い * 所得税の予定納税 * インボイス制度(2023/10から) * Async Ruby * https://brunosutic.com/blog/async-ruby * matz: 数年前にsamuelにokを出した、そのうちマージされるかもね * ensureで非同期例外禁止? * Ctrl-Cが効かなくなるのはなあ…互換性も… vs. 「正しさ」 * bidi文字でソースコードのレビュアーをだます https://trojansource.codes/ * Russ Cox(golangの主要開発者)のご意見 https://research.swtch.com/trojan * GitHubはBiDi文字があると注意してくれる * e.g. https://github.com/tric/trick2013/blob/master/yoshi-taka/entry.rb * キーワード引数の bool_flag: nil は無指定(デフォルト値がtrueならtrue)と見るべきか、falsyだからfalseと見るべきか * JSだと undefined で無指定を表す ## 2021/11/01 - 今日は雑談回 - 11/11は中国で独身の日 - 選挙 - FacebookがMetaに - Nikola Tesla - 歯 - Ruby Biz Grand Prix - https://rubybiz.jp/cases.html?year=2021 - macOS Monterey - nobuはまだBig Surにも上げていない - 新500円硬貨流通開始 ## 2021/10/25 - 開発者会議延長戦 - [Feature #18254](https://bugs.ruby-lang.org/issues/18254): Add an `offset` parameter to String#unpack and String#unpack1 - matz: OK - [Feature #17795](https://bugs.ruby-lang.org/issues/17795): Around `Process.fork` callbacks API - matz: `fork!`, `_fork`, or `core_fork` - knu: Let's pick name that a normal user would never use. - matz: Let's go with `_fork`. - [Feature #17837](https://bugs.ruby-lang.org/issues/17837): Add support for Regexp timeouts - Timeouts require system calls and that slow down the Regexp engine. - Backtrack counter is a lightweight feature but does not guarantee time. - knu: How about starting to measure time when/after a certain amount of backtracks occur? (after 10,000 backtracks, for example) - Using a timer signal could be a good idea. - Make `each_cons {}` return self (currently nil) https://github.com/ruby/ruby/pull/1509 - matz, knu: OK - `Time.new(string)` - We want to leave `Time.parse` as it is and make a new method that is strict and controllable. Supporting the ISO 8601 format is so important we want to support it in the core. Also, being able to the Time#to_s format is a good addition. Other formats will remain supported by `Time.parse` - trapの第2引数 - Procを取れる - `"SYSTEM_DEFAULT"` と `"SIG_DFL"`/`"DEFAULT"` (Rubyのデフォルトハンドラー)は別 ## 2021/10/18 - カナヘビ - RubyConf締め切り - 英語の不安 - 一方ロシアでは日本語でしゃべってくれと言われて、翻訳してくれた - Intelのマニュアルを機械翻訳するバイト - リトルエンディアン、ビッグエンディアン(ネットワークバイトオーダー) - Intelの勝利 - ARMはアラインメント必要 - https://www.ruby2js.com/ - 連想配列のキー順序 - Three.js: [Remove d.s files](https://github.com/mrdoob/three.js/pull/21174) - TypeScriptの型定義が高度化してメンテナンス困難に - 先鋭化、教条主義化しがち - 型パズル大好きマンとライブラリを利用・開発したいマンが重なるのはまれなので、メンテナ不足時代が続くかも - ブラウザで使える言語の未来 - wasmがんばれ… ## 2021/10/11 - macOS 10.15 - Windows 11 - 10/5に正式リリースされてた - ハードウェア要件を満たしているのにエラーで上げられない - VS Code as the best SSH client ever - SSH先でいろいろやってる - https://bugs.ruby-lang.org/issues/18242 ```ruby 1 < 2 and a, b = 2, 1 # SyntaxError ``` nobu: やってみたらできたよ - ruby-talkがプログラミング以外の話題で荒らされているのでモデレート - 続くようなら閉じる? - ## 2021/10/04 * ruby-talkのポリシー/CoC * https://github.com/ruby/www.ruby-lang.org/pull/2690/files * https://github.com/ruby/www.ruby-lang.org/commit/66bbbcb9eaea3074dce4e15bf79373d45c3525de * https://github.com/ruby/www.ruby-lang.org/pull/2696 * RubyWorld Conference 2021 * https://2021.rubyworld-conf.org/ja/news/2021/10/keynote-speakers/ * 新将棋会館建設クラウドファンディング * Rubyも公益社団法人に… * 10/10は何の日 * デジタルの日 https://digital-days.digital.go.jp/ * バイナリの日?(は11/11) * 2000年までは体育の日だった * ハッピーフライデーは * これ以上祝日増やすの * 完全週休二日制とは * https://doda.jp/guide/lesson/037.html * キーワード引数分離 ```ruby= def foo(opt = {}) end foo(a: 1) ``` * YJIT は YARV JIT の略らしい * 国会 * リモートにならないのか * デジタル庁がんばれ ## 2021/09/27 * 感染状況落ち着いてる * 緊急事態宣言は解除されそう? * [Ruby Garbage Collection in Under Two Hours](https://flurly.com/p/ruby-garbage-collection) by Jemma Issroff: * $29。ニューヨークでラーメンを食べたと思えば * [ruby-jwt](https://github.com/jwt/ruby-jwt)に脆弱性につながりそうな問題点を見つけた(?)がどうすればいいか、という話 * 具体的な攻撃があるのではなく、利用者が勘違いして使いそうという類の問題であれば、普通に(オープンな場で)報告していいんじゃない? * いきなりPRよりはissueでコミュニケーションするといい * 英語はasakusa.rbとかで相談できる * [TenderJIT](https://github.com/tenderlove/tenderjit) * 2019年の暮れにスタートしてる。YJITの前身? * 配信用カメラの話 * ささださんがコンデジに変えたらセピア色に * mrknがんばってた * GraalVM, TruffleRubyの話 * TruffleRubyは独自にいろいろ入れてますって話 * [rubyでirbが起動する](https://bugs.ruby-lang.org/issues/17859#change-91920)とか (TTYのとき) * CRubyでもやる?(gorubyではやってる) * python もそうなってる * python -v でバージョンが出ず、代わりにうるさいREPLが起動する問題 * Oracle JDK * ShopifyがCRubyからTruffleRubyに切り替えるなんてこともある? * バージョン番号ポリシー * python を実行すると python3 か python-is-python3 を入れろと怒られる * Python 2.7系最後のバージョンは 2.7.18 (e?) * Python 4.0 はどうするの? Python3 4.0 * バージョンリテラル * perl5には qv() がある * Gem::Version はちょっと長い * でも汎用の形・名前で入れるとsemver派がうるさそう * Marshalのバージョン * バージョンを維持したまま、Hashのcompare_by_identityに対応させるべく隠しインスタンス変数を使うようにしようと思ったら、この属性はハッシュを作った後からセットするのでは遅かった… * bundle gem の雛形にRBSも入れよう ## 2021/09/20 * ギリシャ文字の書き方 (@knu) * 数学を趣味でやっていて、δを8に見間違えないように書こうと思って勉強 * 上の折り返しは角張ってOK * アルファベットそれぞれいろんな書き方があり幅広い * 伝統的なフォントとモダンなフォント * 山梨の実況中継 * ぶどうの話 * メソッドを取得する演算子 (`.:meth` で一時的に入ったやつ) * デバッガーとかの開発でニーズが出てくるかな? ## 2021/09/13 * 小学校のオンライン授業の話 * `{ x: }` が入った (https://bugs.ruby-lang.org/issues/14579) * `{ fork: }` で fork が呼べる * `{if:}[:if]` でローカル変数 if が読める * `str = "x"; { "#{str}": }` は書けない * `{ "key": }` のようにinterpolationがなくてもダメ * identifierは裸で書けるので括るのを許す理由はない * matz: 変数がないときメソッドが呼ばれるのはいいの? * RSpecなどは変数に見えるものがメソッドで提供されたりするし、attr_readerなどもある。利用者は変数かメソッドかを必ずしも区別していないので呼べるべき → issueにコメントしました * RubyKaigi Takeout 2021 * 25分発表+5分休憩のペースはどうでした? * 5分短いかなとも思った * 10分だと長くね?という去年の感想も * テンポ良かった、30分なのできりがいい * オンラインイベントなので会社に申請せずに仕事をしながら聴く人も多かった模様 * ライブ発表でのインターホンリスク * オンラインのよさ、オフラインのよさ * 海外からの参加者の反応も気になる * 時差問題、チャットの言語等 * 骨伝導ヘッドホンいい * マイクはいまいちだしトイレに行ったとき問題があるのでZoom等の入力は本体のマイクなどにした方がいい * 2022はオフラインイベントはできるのか…? ## 2021/09/06 * Hash#inspectのシンボルキーの表記 * YouTube, Twitterなどの収益化の話 * お年寄りとZoom * 専用端末 Lenovo とかが出してる * 8進数リテラル (`0` + 8進数) * 歴史的経緯で変えるのは厳しいか * C, C++, Perl, Java, ... * C# にはないらしい * Rust は `0o` プレフィクスのみ * 既存のコードで使われまくっている * chmod * `\033` (文字列中) * RubyKaigi Day 2に Committers vs. the World やります * https://rubykaigi.org/2021-takeout/presentations/rubylangorg.html * Python高速化 * [In Python, “Inline caching has been a huge success”](https://news.ycombinator.com/item?id=26063628) * https://docs.python.org/3.10/whatsnew/3.10.html#optimizations * YJIT, MIR * https://microsoftedge.github.io/edgevr/posts/Super-Duper-Secure-Mode/ * > roughly 45% of CVEs issued for V8 were related to the JIT engine. * > We find that disabling the JIT does not always have negative impacts. * require/load に代わるライブラリロード方法 (import?) * 名前空間 * パッケージ * 静的解析 ## 2021/08/30 * マクロは入れたくないがannotation機能は提供したい * private, public などはannotationへ * magic comment で? * 名前空間を汚さずにインポートする * loadのwrapperを指定できる機能 * 異能(INNO)vationプログラムの審査で忙しい話 * NoMethodError#args がキーワード引数に対応していない? * mrubyで実装していて発覚 * CRubyを見たら非対応(ハッシュ引数と区別が付かない) * バグとして直そう ```ruby= begin foo(k: 1) rescue Exception p Hash.ruby2_keywords_hash?($!.args.last) #=> actual: false, expected: true other_foo(*$!.args) end ``` * Exception#message に改行を含めたときの inspect の形式について * 改行をそのまま出すと didyoumean とかで紛らわしいのでエスケープしたい ```ruby= p StandardError.new("foo\nbar") #=> # #<StandardError: foo # bar> ``` ```ruby= begin; foo(); rescue Exception; p $!; end; nil #=> # #<NoMethodError: undefined method `foo' for main:Object # Did you mean? for> # #<NoMethodError: "undefined method `foo' for main:Object\nDid you mean? for"> # #<NoMethodError: undefined method `foo' for main:Object\nDid you mean? for> # #<NoMethodError: undefined method `foo' for main:Object...> ``` * 解決1. Exception#inspect の出力をエスケープするようにする * 解決2. did_you_mean 側で NameError#inspect に "Did you mean?" を挿入しないようにする * FYI: https://github.com/ruby/error_highlight/pull/10 * 開発中のirbのデモ * メニュー補完 👏 * くれぐれも補完処理でevalはしないように注意してください🙏 * 今はレシーバの評価で副作用がないことを厳密に見ている * irbは本番でも使いうるので、 `Model.where(超重いクエリ).to_sql` を実行しようとした途中でevalされると死ぬ ## 2021/08/23 * 健康の話題 * 胃カメラ、大腸カメラ * RubyKaigi録画提出締め切り * 翻訳の話 * method が手法と訳されていた * 中国語は1:1に直訳にしていてえらい * 日本語: オブジェクトのインスタンスメソッドを呼び出す。 * 中国語: 调用该对象的实例方法。(要確認) * オリ・パラ、甲子園、フジロック * 用語の話 * categoryの訳語の範疇の意味が変わっていく、等 * ラーメンの話 * Hashの省略記法がほしいという提案がまた来た * https://bugs.ruby-lang.org/issues/18124 * この提案はさておき、欲しい人は増えている * deconstructはパターンマッチで実現された * constructの方は、JSにあるからとかではなくてRubyにとってよいユースケースとメリットを提示すればチャンスあり? ## 2021/08/16 * Opal 1.2 * すごい * 何に使うんだろう * Opal Railsすごい * 大雨 * 島根大丈夫 * 北広島町、北広島市 * 府中市x2、伊達市x2 * MacRuby * macOSのruby * 2.6.3 * codespaces ## 2021/08/09 * 台風 * macOSの`df`コマンドがよくわからない * 空き容量があると思っていたらほとんどなくなっていた * APFSなのでボリュームごとに空き容量があるのではなく、共有なのでは * VirtualBoxのディスクイメージがスナップショット作成により肥大化してしまった * 削除にはコピー分の空き容量が必要 * オリンピックが終わってパラリンピックが8/24から * 道具や義足の進化 * `respond_to?` とダックタイピングについてまつもとさんに振ってみた * そもそもダックタイピングは `is_a?` `respond_to?` 含め分岐を推奨していない * プロトコルを満たす前提で呼んでしまうのがduckと見なすということ * Numeric (coerceアーキテクチャ)やExceptionはnominalだが、そこは諦めポイント * structuralなチェックは考えたことがある * あるメソッドセットをインターフェースとして、それに準拠している(それらのメソッド持っている)かどうかを判定する * 現実には… * Rubyにはオーバーロードがないので `is_a?` や `respond_to?` によるチェックがはびこってしまっている * 静的型チェックがない(発展途上)ので、みんなバリデーションを書いている * →それではパターンマッチ時代はどうか? * パターンマッチでメソッドの有無を判定できるようにするのはどうか? 例: `case object; in .read then object.read; else object.to_s; end` * 相性がいいのでいいと思う * ただ、メソッドセットを定義して名前を付ける、ANDパターンを導入するなどが必要になるだろう * アイデア・実装待ち ## 2021/08/02 * [Sorbet Compiler](https://sorbet.org/blog/2021/07/30/open-sourcing-sorbet-compiler) * オブジェクト指向で is-a 関係というとクラスの継承関係を言うが、Rubyの `is_a?` がクラス-インスタンス関係(継承を含む)をテストするメソッドなのはなぜ?という話題 * まつもとさんが勉強した1980年代はクラス-インスタンス関係を示していたような…? * CLOSなどクラスとインスタンスを区別しない(プロトタイプベースのような)世界もあったのでそこで分岐してしまった可能性も * そういえばPerl5の `@ISA` はスーパークラスを指定するものだった (ただし `$object->isa("Klass")` はクラス-インスタンス関係のチェック) * UMLなどはインスタンスを特に論じないので、クラス同士の関係を記述する用語として発達するのは自然か * 動的型付けでダックタイピングを推奨するRubyではクラス/モジュール同士の is-a 関係を見たいということ自体が少ないはず (Module#<=> には別名がないしあまり使われていない) * ruby-jp Slackからの話題。まつもとさんからも「新しい知見を得ました」とのことです! * まつもとさんもようやくワクチン予約できた * RBOOL()マクロ ## 2021/07/26 * 連休の話 * http://nmi.jp/2018-02-17-How-to-use-chrome_tracing の話 * `Thread#inspect` もうちょっとよくならんかという話 * オリンピックの話 * 家の話 * 歯の話 ## 2021/07/19 * オリンピック連休 * 学校の数学 * https://github.com/ruby/error_highlight/issues/9 * https://github.com/ruby/ruby/pull/4659 ## 2021/07/12 - Rubyのバージョンからパッチ番号を消したい - error_highlightがIRBで動くようにするにはどうしたら良いか - RubyVM::AST::Node#node_idってvcallとlvarで変わる? ## 2021/07/05 - 最近のアカデミックペーパーに面白い実装っぽい話がみつからない(by matz) - Stripe のコンパイラすごいっすね - Crystal どうすか - ECOOP の開催形態すごい - Timezone の話 - Copilot の話 - 妥当でないコードがざっくりわかる静的解析が必須の時代になるかも - ライセンスどうなるんだろう話 - http://ppl.jssst.or.jp/index.php?ss2021 を紹介するのにどこにポストしたらよいのか - 今はメーリングリストみたいなリーチとフォーカスのあるメディアが… - まつもとさんのTwitterで - 30万円相当 - ささださんがrustで仕事したいらしい ## 2021/06/28 - 下線で示すgemの名前 - https://bugs.ruby-lang.org/issues/17930 - bundled gemのテストをruby/rubyで実行するときに、特定の名前だけskipしたい - ワクチンを打った腕が痛い - Windows 11 ## 2021/06/21 - minitest - 下線で示すgemの名前 - Amazonプライムデーで何買う ## 2021/06/14 - エラー箇所を下線で示す - cjkwidthとかは面倒なのでまずは無視 - https://bugs.ruby-lang.org/issues/17930 - Ruby本体でメンテするのつらそう… - did_you_mean でやってみる例 https://github.com/ruby/did_you_mean/pull/151 - Rubyの実装や複数バージョンの対応大変そう - 下線・太字などを使おうとすると、現状だとエスケープされてしまう - フォーマッター差し替え機能を提供する? - digest の事例 https://github.com/ruby/digest/pull/21 - DigestにJRuby実装をマージしたい https://github.com/ruby/digest/pull/21 - knu: よさそう - Pythonでコンパイラオプションで劇的高速化した話 - Rubyでは効果なし - https://teslatequila.tesla.com/ ⚡🥃 - 西嶋さんが入手 - 元はエイプリルフールネタから - VagrantがRubyからGoへ - (他の)HashiCorp製品はぜんぶGoとHCL - パッケージにRubyを同梱する辛さ - RubyによるDSLの展望は? - rdbgのデモと相談 ## 2021/06/07 - 議事録なし… 話したトピックを思い出した人は追加してください - エラー表示にカラム位置を示したり下線を入れる話 ## 2021/05/31 - rdoc早くできないか? - Cのパース、Rubyのパース - Cのパーサーが特に遅い - Ruby含め、小さいファイルがたくさんあるとWindowsなどで遅さが顕著 - パースは進捗が出るが生成は進捗が出ずだんまりなのは待つ人の気持ち的によくないかも - Cメソッド定義をRubyに移していけば速くはなる - rdocは実装を読むときのヒントになっている - rdocを明示的に書かなくてもクラス・メソッド・定数定義等は拾われるので、処理しなくていいファイルというのはあまりないかも - [object_tracer](https://github.com/st0012/object_tracer) - 取り込むにはでかい - プロジェクトのGemfileに書かなくても、デバッグ用のgemを別途使いたい - ~/.rubyrc とか、自分用の Gemfile を持っておいて - $LOAD_PATH に自分用gemのパスが入った状態で bundle exec 相当ができれば良い - test/unit の話 ## 2021/05/24 - syslog は残したい? - rubyを入れてgemなど使わずsocketやsyslogを使ってシステムスクリプトを書く層もいるので、メンテナンスコストやセキュリティーリスクがない限りそっとしておきたい - debug - パスワード認証とかセキュリティについて中途半端にがんばると、逆に期待が高まってそこをつつかれそう。ほどほどでいいのでは - default gems - bundle exec時はアップデートがインストールされていても使われない - irbのデフォルトでカラーする挙動について - オフにはできる - 色を変えることは現状できない - [NO_COLOR運動](https://no-color.org/) - ターミナルの設定でやるのが局所的には最適 - GCPのターミナルなど、Webで出すターミナルはカスタマイズに限度がある - ターミナルでのダイアログやプログレスバーの話題 - [tty-progressbar](https://github.com/piotrmurach/tty-progressbar) がけっこうがちだった - ダイアログの出し方はpythonも参考になる ## 2021/05/17 * Integer#size とは * size が 5 とか 9 を返すことがある * (Bignum)オブジェクトのサイズではなく、整数の表現部分のみのサイズ * 実用的にはそんなに意味はない。`1.size` で `long` のサイズが分かります程度 * ちゃんとサイズを取りたければ `pack` の結果とか `RbConfig::CONFIG` を見よ * `require 'rbconfig/sizeof'` すると `RbConfig::SIZEOF` が定義され、いろいろなCの型のサイズがそれで取れる。 * VALUE のサイズはない * あってもいいが `uintptr_t` とか `void *` で * sizeof(_Bool) == 1 なんだねえ * 構造体だとパックされるの?されなさそう * そういえば構造体のcharメンバーのアクセスはアーキテクチャによってはatomicじゃないね * https://www.jpcert.or.jp/sc-rules/c-con32-c.html * なのでraceはビットフィールド関係なく存在する (C11でchar境界では安全になったらしい、そのために0幅のフィールドを挟むということもできるようになっている) * そういえば `object_id` は _符号付き_ 64ビット整数なのでPostgreSQLのbigintに収まってよかったー事案がありました * psych 4.0.0でloadがsafe_loadになってしまって発生した非互換 * https://github.com/ruby/psych/issues/490 * Symbolも読めない * 設定ファイルで使われている * それを読めるために unsafe_load にしてしまったら本末転倒 * もうSymbol DoSはないから許してもいいのでは * `y` を true と見なすなどのRuby拡張はあるし、SymbolもRuby拡張なので safe_load でも許したい * YAML 1.1 では `on` / `off` や `yes` / `no` もboolean扱いだったが、YAML 1.2 では `true` / `false` のみになった * psychもYAML 1.2準拠のはずだけどおそらく互換性のために古い表現も許している * psychには指定したクラスのインスタンス化は許すというオプションがある * Symbolは許しているようにも見えるが?→継続調査 * RubyGemsのgemに埋め込むspecで Gem::Requirement を埋め込んだりしているので要対応 * rdocのテストもこけている * ChangeLogとかアナウンスなしなのは厳しいのでいったんrevertもありでは ## 2021/05/10 * GW どうでした? * 島根県のコロナ状況 * REDoS の話 * 正規表現マッチにタイムアウトを設けたいという要望 * 試験実装では5%遅くなった * 5%の価値はないのでは * バックトラック回数で制限するという案も * いずれにしても、正規表現エンジンはかなり最適化されているのでちょっと分岐が増えるだけで大幅に性能は落ちがち * 信頼できない文字列をパターンとして使う際はre2を使うなどが一般的 * うっかりバックトラックしまくるパターンを書いてしまうことはよくある * 信頼できない文字列にマッチさせるとDoS成立 * JavaScript方面でも頻発している * https://github.com/advisories/GHSA-78cj-fxph-m83p * 定量的に複雑さを測る方法はあるか? * (信頼できる入力を元に)動的に生成したパターンがモンスターになることはある * そのケースは自覚的にタイムアウトを設定できそう * 多くの場合は何が引き起こすかわからない(gemの中など)ので、グローバル(スレッド単位など)で上限を設定できた方がいいのかも * たとえばRailsでリクエストが長時間掛かっていたら止める、などがしたい * Timeout.timeoutはどこで発火するかわからないのでRailsなどでは使いづらいという話 * たとえば重要なensureの処理中に発火するとまずい * 巨大な文字列に力業の正規表現をマッチさせる、みたいなことはよくあるのでデフォルトでタイムアウトされるのは困る * macos での release 版デバッグの話 * ruby/debug 出ました ## 2021/05/03 * `Array#to_h`に2.6からブロックを渡せるけど、2.5でも対応したい時、どう分岐するのが良いか * `[[1,2]].to_h{[3,4]}`のようにするとブロックを受け取るかどうかで結果が変わって良さそう * JRubyのRubyバージョン互換が難しい * 最新のJRubyはCRuby 2.5互換 * https://www.hostingadvice.com/blog/jruby-is-where-ruby-meets-the-jvm/ ## 2021/04/26 * [Ruby Weekly Issue 549: April 22, 2021](https://rubyweekly.com/issues/549) * 2.5 の EOL [Ruby 2.5.9 Released](https://www.ruby-lang.org/ja/news/2021/04/05/ruby-2-5-9-released/) * 緊急事態宣言 * FreeBSD で動かしている chkbuild での失敗の話 http://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20210426T003001Z.fail.html.gz * [4ca271909d51a692a97363f41d2372a108ef771a](https://github.com/ruby/ruby/commit/4ca271909d51a692a97363f41d2372a108ef771a) * [c647205c3eb1f17409a859149bb7d2ea38b43bed](https://github.com/ruby/ruby/commit/c647205c3eb1f17409a859149bb7d2ea38b43bed) * [How and when to use Ruby case statements](https://docs.knapsackpro.com/2021/how-and-when-to-use-ruby-case-statements) から https://knapsackpro.com/ の話 * CI環境や開発環境の話 * SurfaceなどのノートPCの話 ## 2021/04/19 * [Ruby Weekly Issue 548: April 15, 2021](https://rubyweekly.com/issues/548) * [Adobe PostScriptを発明、DTPに革命もたらしたチャールズ・ゲシキ氏逝去 - PC Watch](https://pc.watch.impress.co.jp/docs/news/1319433.html) * 昔のプリンタ事情 * 音声アシスタント * ホットクック * 果物や野菜 * endless def with `command_call` ([ruby-bugs#17398](https://bugs.ruby-lang.org/issues/17398)) ## 2021/04/12 * [Ruby Weekly Issue 547: April 8, 2021](https://rubyweekly.com/issues/547) * [Where Programming, Ops, AI, and the Cloud are Headed in 2021 – O’Reilly](https://www.oreilly.com/radar/where-programming-ops-ai-and-the-cloud-are-headed-in-2021/) * [Feature #17762: A simple way to trace object allocation - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/17762) * resolv-replace.rb * 2001年にジャンボパッチで入ってた * ローカルでのパッチ管理が難儀だった時代 * svk懐かしい Audrey Tang作 * forkをやめるべきか問題 * at_fork https://bugs.ruby-lang.org/issues/5446 * prepare, parentは安全そう * childは危険だけどそもそも生のforkが提供されている時点で危険なのでは * pthread_atfork を使うかどうか * ユースケースが曖昧? * 元提案はいちばんやりたかったこと(IOのクローズ)がclose on execがデフォルトになって実現されたので重要度は低くなったと言っている ## 2021/04/05 * https://rubyweekly.com/issues/546 * https://edgeguides.rubyonrails.org/active_record_encryption.html * RailsConf 2021 April 12-15 * April fool feature requests * [Proposal: Downward assignments](https://bugs.ruby-lang.org/issues/17768) * [Proposal: numeric coefficient syntax](https://bugs.ruby-lang.org/issues/17769) * https://docs.ruby-lang.org/ja/latest/method/Numeric/i/i.html ```ruby= 1.instance_eval { p i # => (0+1i) } ``` * 1i.i はできないのか (Complex#i) * private の逆でレシーバがないと呼べないメソッド * "python" * 変異株 * 犬 * 一般に小型犬の方が数年単位で長生き ## 2021/03/29 * Rails の話 * mimemagic騒動 https://hackmd.io/@mametter/mimemagic-info-ja * マイクの話 * まつもとさんがマイクを新調した * 光るマイク https://www.hyperxgaming.com/jp/microphone/quadcast-gaming-microphone * `p` 便利という話 * 構造化データを吐く機能 * Webアプリの実行環境では普通になっている * console.log()も構造化データを吐ける * PIDやsource locationみたいなものもメタデータで * ビューワーがほしい * やはりブラウザ? * ターミナルでもできたい * https://rubyweekly.com/issues/545 * crystal * 1.0が出ましたね * 本はないの * スエズ運河コンテナ船座礁 * distroless などの話 * https://blog.unasuke.com/2021/practical-distroless/ * https://blog.inductor.me/entry/alpine-not-recommended * https://qiita.com/yu_suke1994/items/e12bb942a15f770f772c ## 2021/03/22 * [Ruby Weekly Issue 544: March 18, 2021](https://rubyweekly.com/issues/544) * 冷蔵庫買い替えの話 * irb の最近の変更 ``` irb(main):001:0> "a\n" * 100 => "a\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\n" ``` * いろんな環境変数 ``` "LESSCLOSE"=>"/usr/bin/lesspipe %s %s", "LESSOPEN"=>"| /usr/bin/lesspipe %s", ``` * irb のデザインについて * ドキュメントの話 * [Dash](https://kapeli.com/dash)とかと連携したりしてドキュメントが簡単に見られるといいね * rdocで書かれたものは簡単にインストールできる * open dash://... でOK * 超便利だけど有償… * Windowsヘルプが広まったらよかったのに * 誰でも使える * GitHubにジャンプしてドキュメントの改善のPRを作れたり * るりまはバージョンを行き来できるのえらい * perldoc文化良い * まずざっくりした使い方が分かる * Cirrus CIを使いたい話 https://bugs.ruby-lang.org/issues/17720 * ユニークなアーキテクチャのCIは歓迎だけどお金や手間は出したくないよ * 手を動かしてくれるならぜひ ## 2021/03/15 * autoconf 2.70 の問題 * `autogen.sh` として config.guess などのダウンロードをしてから autoconf をするものを用意しておくのはどうか * config.guess をコミットしておくのが嫌なのはなぜ? * 花粉、シダキュア * 小学生も発症 5歳から服用可 毎月要通院, 月3,000円くらい * mruby 3.0 * 非互換で困っているユーザーの声 * make * extend * [Ruby Weekly Issue 543: March 11, 2021](https://rubyweekly.com/issues/543) ## 2021/03/08 * among us * 「シン・エヴァンゲリオン劇場版」の公開日 * Pockeさんをコミッタにする件(https://bugs.ruby-lang.org/issues/17641) * 祝日 * https://rubyweekly.com/issues/542 * standard gem * https://blog.testdouble.com/posts/2021-03-04-announcing-standard-ruby-1.0/ * 他言語でのコードフォーマッター * [PEP 8 -- Style Guide for Python Code | Python.org](https://www.python.org/dev/peps/pep-0008/) ```ruby # standardrb, hsbt, mame "foo" "foo#{1}bar" "foo\#{1}bar" "\"" or '"' %q{"'} # rubocop default, usa, ko1 'foo' "foo#{1}bar" 'foo#{1}bar' '"' # mrkn "foo" "foo#{1}bar" 'foo#{1}bar' '"' ``` ```ruby # standardrb 1.times { |n| p n } 1.times { |n| p n } 1.times do |n| p n end # hsbt, mame, mrkn 1.times {|n| p n } # ko1, usa 1.times{|n| p n} # nobu 1.times {|n| p n} ``` ```ruby # standardrb "foo#{expr}bar" # mame "foo#{ expr }bar" ``` ```ruby # standardrb foo .bar .baz # ko1, mame foo. bar. baz ``` * 範囲コメント ```ruby a = @ ... @ 1 # できるがキモイ a = <!-- ... --> 1 # 衝突するからダメ a = /* ... */ 1 a = %c{ ... } 1 ``` ``` -- comment ++ ``` ``` <<COMMENT ... COMMENT ``` * %記法 * `%r` は多用するが、`#` をエスケープするのがめんどくさい。`%r` と `%R` を用意しておかなかった失敗 * 今から `%R` を用意して移行を促せば? * さすがに無理じゃないかなあ * `%x` にも同じ問題が * 最近のRuby用エディタ * 秀丸 * vscode * vim * neovim * Emacs https://rails-hosting.com/2020/#os-editors-servers ![](https://i.imgur.com/OXRgpLs.png) https://www.pyblog.in/programming/top-10-code-editors-to-make-you-more-productive-in-2019/ ![](https://i.imgur.com/stys9KB.png) * デバッガー * https://github.com/BetterErrors/better_errors ## 2021/03/01 * among_us * https://rubyweekly.com/issues/541 * Ruby 28歳 * Singularity * 定年55歳だった * Matz が大金持ちになる方法 * naming rights を売る * JIT * mac M1 * 夏時間 * https://blog.n-z.jp/blog/2021-02-03-ruby-zlib-test-binary-mode-bug.html * Hotwire が Rails 7 に入る? * https://statisticsanddata.org/most-popular-backend-frameworks/ * Ruby を使っている大企業はどこかという話 * https://www.ideamotive.co/blog/best-ruby-on-rails-companies-websites ## 2021/02/22 * WEB+DB Press 発売 * 株価すごいなーBit coinすごいなーという話 * [Bug #17649: `defined?` invokes method once for each syntactic element around it - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/17649) 奇妙な defined? の話 * Mac でLL言語が標準で入らなくなりそうな話 * [Bundler: A more secure bundler: We fixed our source priorities.](https://bundler.io/blog/2021/02/15/a-more-secure-bundler-we-fixed-our-source-priorities.html) * HotWire の話 * 保育園の話 * 40こえた体の話 ## 2021/02/15 * [Ruby Weekly Issue 539: February 11, 2021](https://rubyweekly.com/issues/539) * matz: マイクロベンチマークなんとかしたい * グラントしたい * 島根県はコロナ患者数日0 * mruby / mmruby * https://www.yodobashi.com/product/100000001004020942/ * 池袋は埼玉 * いちごは水耕栽培できる * LoRa * https://japanese.engadget.com/spacex-143-satellite-launch-rideshare-073004119.html * https://zenn.dev/yoshoku/articles/c363aa0bb5b767 * Windows でのインストール * 最近買った本 ## 2021/02/08 * 確定申告やった? * Set 埋め込み * Hash inspect 結果 * いい加減 Symbol は `key: val` 表記しよう * https://dragonruby.itch.io/dragonruby-gtk * https://twitter.com/ArityWolf/status/1329508004736114688 * https://twitter.com/kfischer_okarin/status/1322391205817184261 * https://twitter.com/wndxlori/status/1353853910079959040 * https://twitter.com/amirrajan/status/1254907392657145857

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully