mastodon.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
The original server operated by the Mastodon gGmbH non-profit

Administered by:

Server stats:

335K
active users

#解析器

0 posts0 participants0 posts today
GripNews<p>🌖 珍妮特 PEG 模組運作原理<br />➤ 探索 Janet 語言中解析表達式文法的實作細節<br />✤ <a href="https://bakpakin.com/writing/how-janets-peg-works.html" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">bakpakin.com/writing/how-janet</span><span class="invisible">s-peg-works.html</span></a><br />本文深入探討了 Janet 程式語言中 PEG(Parsing Expression Grammars)模組的實作方式。作者受到 REBOL Parse 模組和 LPeg 的啟發,設計了一個基於 PEG 的文本和位元序列解析庫,並解釋了 PEG 相對於正規表達式的優勢,例如可讀性更強、易於捕捉錯誤位置等。文章詳細描述了 PEG 引擎的實作細節,從基本運算子到遞迴語法的支援,並提供範例程式碼演示瞭如何使用 PEG 解析 ISO 8601 日期格式。<br />+ 這篇文章寫得非常清楚,即使我對 PEG 不太熟悉,也能理解它的核心概念和優點。範例程式碼也很有幫助!<br />+ 瞭解 Janet 團隊是如何用如此簡潔的程式碼實現 PEG 引擎,真是令人印象深刻!這篇文章讓我對 Janet 這門語言更感興趣了。<br /><a href="https://mastodon.social/tags/%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88" class="mention hashtag" rel="tag">#<span>程式設計</span></a> <a href="https://mastodon.social/tags/%E8%A7%A3%E6%9E%90%E5%99%A8" class="mention hashtag" rel="tag">#<span>解析器</span></a> <a href="https://mastodon.social/tags/PEG" class="mention hashtag" rel="tag">#<span>PEG</span></a></p>
GripNews<p>🌘 解析器組合器勝過正規表達式<br />➤ 在Haskell中,程式碼的可靠性和可維護性比簡潔性更重要。<br />✤ <a href="https://entropicthoughts.com/parser-combinators-beat-regexes" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">entropicthoughts.com/parser-co</span><span class="invisible">mbinators-beat-regexes</span></a><br />這篇文章探討了在Haskell程式設計中,使用解析器組合器(parser combinators)相較於正規表達式(regexes)的優勢。作者以Advent of Code的題目為例,展示了正規表達式雖然在簡單情況下可用,但在處理更複雜的邏輯和需要維護狀態的情況下,容易出現隱藏的錯誤和效能問題。而解析器組合器雖然一開始寫法較繁瑣,但提供了更好的類型安全性、更清晰的錯誤訊息,並能更容易地適應程式需求變化,且在處理特定任務時,例如狀態管理,表現更出色。<br />+ 我一直覺得正規表達式很難寫debug,看完這篇文章後,更確信在Haskell中應該優先考慮解析器組合器了。<br />+ 這篇文章很好地解釋了為什麼Haskell社羣不常使用正規表達式,以及解析器組合器在處理複雜問題上的優勢。<br /><a href="https://mastodon.social/tags/Haskell" class="mention hashtag" rel="tag">#<span>Haskell</span></a> <a href="https://mastodon.social/tags/%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88" class="mention hashtag" rel="tag">#<span>程式設計</span></a> <a href="https://mastodon.social/tags/%E6%AD%A3%E8%A6%8F%E8%A1%A8%E9%81%94%E5%BC%8F" class="mention hashtag" rel="tag">#<span>正規表達式</span></a> <a href="https://mastodon.social/tags/%E8%A7%A3%E6%9E%90%E5%99%A8" class="mention hashtag" rel="tag">#<span>解析器</span></a></p>
卡拉今天看了什麼<p>Nobody Gets Fired for Picking JSON, but Maybe They Should? · mcyoung </p><blockquote><a href="https://mcyoung.xyz/2024/12/10/json-sucks/" rel="nofollow noopener" target="_blank">Link</a></blockquote>📌<span> Summary: <br>本文深入探討了JSON的設計及其所帶來的問題,強調即便JSON因其簡單性而廣受歡迎,但它的設計缺陷卻導致許多資料損壞的隱患。尤其是因為缺乏明確的模式來解析隨機JSON文件,許多常見的角落案例會導致數據損失。文章還指出,JSON在數字表示和解析上存在多樣性,使得不同的實現之間極度不相容,此外,難以處理特殊數字、無效的Unicode字符和字元串等問題也使得JSON難以修復。總的來說,雖然JSON是流行的選擇,然而作者建議使用如Protobuf等更強大的選擇來替代。<br><br></span>🎯<span> Key Points:<br>- JSON的基本概念與簡單性使其在REST API中非常流行,但其實際定義和實現複雜,缺乏統一的標準。<br>- 不同語言與實作中的解析器行為的差異導致JSON解析的不一致,尤其在數字處理上常導致數據損失。<br>- JSON不支持直接傳遞字節字串,常依賴於base64進行編碼,這會影響可讀性和帶來潛在的互操作問題。<br>- JSON在數據串流方面的支持有限,不易於實現實時數據處理。<br>- 雖然目前已經有其他格式(如BSON、Protobuf等)能解決JSON的上述問題,但許多仍面臨自己的挑戰。<br><br></span>🔖<span> Keywords: <br></span><a href="https://social.mikala.one/tags/JSON" rel="nofollow noopener" target="_blank">#JSON</a> <a href="https://social.mikala.one/tags/數據損失" rel="nofollow noopener" target="_blank">#數據損失</a> <a href="https://social.mikala.one/tags/解析器" rel="nofollow noopener" target="_blank">#解析器</a> <a href="https://social.mikala.one/tags/學習" rel="nofollow noopener" target="_blank">#學習</a> <a href="https://social.mikala.one/tags/Protobuf" rel="nofollow noopener" target="_blank">#Protobuf</a><p></p>
GripNews<p>🌘 TL;DR - 基於競技場的解析器<br />➤ Rust編寫的解析器實驗<br />✤ <a href="https://iliabylich.github.io/arena-based-parsers/" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">iliabylich.github.io/arena-bas</span><span class="invisible">ed-parsers/</span></a><br />這篇微書討論瞭解析器、記憶體配置和競技場。解析器用Rust編寫,解析Ruby代碼。作者描述的變更使過去的解析器速度從37MB/s提高到80MB/s(約2倍)。所有解析結果僅位於競技場,可將底層記憶體塊寫入磁盤,之後快速映射以獲取需要,因此AST緩存變得更為簡單。該段程式碼有些“實驗性”,在arena-fixes分支中可以找到。作者不會釋出它,建議若需要Ruby解析器可以試試prism(在crates.io有Rust綁定)。整個故事更像是一次實驗,看看這種工作是否值得。<br />+ 這篇文章說明瞭如何優化解析器,讓人對於記憶體配置和解析性能有了更深入的瞭解。<br />+ 真有趣,看來在解析器領域還有很多創新空間可以探索。<br /><a href="https://mastodon.social/tags/%E7%B7%A8%E7%A8%8B" class="mention hashtag" rel="tag">#<span>編程</span></a> <a href="https://mastodon.social/tags/%E8%A8%98%E6%86%B6%E9%AB%94%E9%85%8D%E7%BD%AE" class="mention hashtag" rel="tag">#<span>記憶體配置</span></a> <a href="https://mastodon.social/tags/%E8%A7%A3%E6%9E%90%E5%99%A8" class="mention hashtag" rel="tag">#<span>解析器</span></a></p>
GripNews<p>🌖 GitHub - mattwparas/steel: 用Rust實現的嵌入式Scheme解析器<br />➤ 嵌入式Scheme解析器的Rust倉庫<br />✤ <a href="https://github.com/mattwparas/steel" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="">github.com/mattwparas/steel</span><span class="invisible"></span></a><br />GitHub倉庫mattwparas/steel包含一個用Rust編寫的CLI解析器,可嵌入和擴展Scheme方言。它包含了一個強大的宏系統和字節碼虛擬機,並支持高階合約和內置的不可變數據結構。<br />+ 這個解析器似乎很強大,我對Rust的編程感興趣,應該試試它。<br />+ 我從來沒有使用過Scheme,但這個解析器看起來很有趣,也很有用。<br /><a href="https://mastodon.social/tags/%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88" class="mention hashtag" rel="tag">#<span>程式設計</span></a> <a href="https://mastodon.social/tags/Rust" class="mention hashtag" rel="tag">#<span>Rust</span></a> <a href="https://mastodon.social/tags/%E8%A7%A3%E6%9E%90%E5%99%A8" class="mention hashtag" rel="tag">#<span>解析器</span></a></p>
GripNews<p>🌗 GitHub - ohmjs/ohm:用於構建解析器、解釋器、編譯器等的庫和語言<br />➤ 使用ohmjs/ohm構建解析器、解釋器和編譯器的庫和語言<br />✤ <a href="https://github.com/ohmjs/ohm" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="">github.com/ohmjs/ohm</span><span class="invisible"></span></a><br />GitHub的ohmjs/ohm庫和語言可用於構建解析器、解釋器、編譯器等,並提供了JavaScript接口和線上編輯器。<br />+ 這個庫和語言似乎非常有用,可以幫助開發人員快速構建解析器和編譯器。<br />+ 我對這個庫和語言的線上編輯器很感興趣,它可以提供即時反饋和可視化,讓開發過程更加直觀。<br /><a href="https://mastodon.social/tags/GitHub" class="mention hashtag" rel="tag">#<span>GitHub</span></a> <a href="https://mastodon.social/tags/%E8%A7%A3%E6%9E%90%E5%99%A8" class="mention hashtag" rel="tag">#<span>解析器</span></a> <a href="https://mastodon.social/tags/%E8%A7%A3%E9%87%8B%E5%99%A8" class="mention hashtag" rel="tag">#<span>解釋器</span></a> <a href="https://mastodon.social/tags/%E7%B7%A8%E8%AD%AF%E5%99%A8" class="mention hashtag" rel="tag">#<span>編譯器</span></a></p>
GripNews<p>🌘 GitHub - marcobambini/sqlite-createtable-parser: 一個用於解析SQLite創建表SQL語句的解析器<br />➤ SQLite CREATE和ALTER TABLE解析器<br />✤ <a href="https://github.com/marcobambini/sqlite-createtable-parser" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">github.com/marcobambini/sqlite</span><span class="invisible">-createtable-parser</span></a><br />這是一個用於解析SQLite創建表和修改表SQL語句的解析器。它具有極高的解析速度,沒有內存拷貝開銷,並且具有非常簡單的API。它可以幫助提取表和列的完整信息,並且支持ALTER TABLE語句。<br />+ 這個解析器看起來非常有用,可以節省很多時間和精力。<br />+ 我對這個解析器的速度和簡單的API印象深刻,這對於處理SQLite表格非常方便。<br /><a href="https://mastodon.social/tags/SQLite" class="mention hashtag" rel="tag">#<span>SQLite</span></a> <a href="https://mastodon.social/tags/%E8%A7%A3%E6%9E%90%E5%99%A8" class="mention hashtag" rel="tag">#<span>解析器</span></a></p>
GripNews<p>🌕 重寫 Ruby 解析器<br />➤ Rails at Scale<br />✤ <a href="https://railsatscale.com//2023-06-12-rewriting-the-ruby-parser/" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">railsatscale.com//2023-06-12-r</span><span class="invisible">ewriting-the-ruby-parser/</span></a><br />Shopify 最近花了一年的時間編寫了一個新的 Ruby 解析器,稱為 YARP,可以解析 Shopify、GitHub、CRuby 和 rubygems.org 上下載量前 100 名的 gem 中的每個 Ruby 文件。這篇文章將介紹為什麼要進行這項工作,以及它是如何開發的。作者還介紹了現有 CRuby 解析器存在的問題,包括可維護性、錯誤容忍度、可移植性和性能。最後,作者提出了 YARP 的優點和未來發展方向。<br />+ 這篇文章很有趣,我從中學到了很多關於 Ruby 解析器的知識。<br />+ Shopify 的 YARP 真的很厲害,我期待看到它在未來的發展中扮演的角色。<br /><a href="https://mastodon.social/tags/Ruby" class="mention hashtag" rel="tag">#<span>Ruby</span></a> <a href="https://mastodon.social/tags/%E8%A7%A3%E6%9E%90%E5%99%A8" class="mention hashtag" rel="tag">#<span>解析器</span></a> <a href="https://mastodon.social/tags/CRuby" class="mention hashtag" rel="tag">#<span>CRuby</span></a> <a href="https://mastodon.social/tags/YARP" class="mention hashtag" rel="tag">#<span>YARP</span></a></p>
GripNews<p>🌘 Absinthe在大型Elixir應用中的應用 | AppSignal Blog<br />➤ 本文介紹了如何在大型Elixir應用中使用Absinthe進行自定義,包括定義解析器和避免N+1查詢等。<br />✤ <a href="https://blog.appsignal.com/2023/06/06/absinthe-for-large-elixir-applications.html" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">blog.appsignal.com/2023/06/06/</span><span class="invisible">absinthe-for-large-elixir-applications.html</span></a><br />本文介紹了如何在大型Elixir應用中使用Absinthe進行自定義,包括定義解析器和避免N+1查詢等。作者還介紹了如何使用Dataloader來提高數據加載效率。<br />+ Absinthe是一個非常強大的工具,可以幫助開發人員更輕鬆地構建GraphQL API。這篇文章提供了一些有用的技巧,可以幫助開發人員更好地使用Absinthe。<br />+ Dataloader是一個非常有用的工具,可以幫助開發人員提高數據加載效率。這篇文章提供了一些有用的示例,可以幫助開發人員更好地使用Dataloader。<br /><a href="https://mastodon.social/tags/Elixir" class="mention hashtag" rel="tag">#<span>Elixir</span></a> <a href="https://mastodon.social/tags/Absinthe" class="mention hashtag" rel="tag">#<span>Absinthe</span></a> <a href="https://mastodon.social/tags/GraphQL" class="mention hashtag" rel="tag">#<span>GraphQL</span></a> <a href="https://mastodon.social/tags/%E8%A7%A3%E6%9E%90%E5%99%A8" class="mention hashtag" rel="tag">#<span>解析器</span></a> <a href="https://mastodon.social/tags/N" class="mention hashtag" rel="tag">#<span>N</span></a>+1查詢 <a href="https://mastodon.social/tags/Dataloader" class="mention hashtag" rel="tag">#<span>Dataloader</span></a></p>