並び順

ブックマーク数

期間指定

  • から
  • まで

81 - 120 件 / 133件

新着順 人気順

parserの検索結果81 - 120 件 / 133件

  • JSON Parser 100% From Scratch in Haskell (only 111 lines)

    Twitch: https://www.twitch.tv/tsoding GitHub Repo: https://github.com/tsoding/haskell-json My Haskell Setup: https://www.youtube.com/watch?v=5p2Aq3bRuL0 Unusual video this time. This is a slightly edited recording of my Twitch stream. Initially I planned to make a regular video on this topic, but quickly realized that it's just way too much material for a single regular 10 minutes video. So I dec

      JSON Parser 100% From Scratch in Haskell (only 111 lines)
    • GitHub - parcel-bundler/lightningcss: An extremely fast CSS parser, transformer, bundler, and minifier written in Rust.

      Extremely fast – Parsing and minifying large files is completed in milliseconds, often with significantly smaller output than other tools. See benchmarks below. Typed property values – many other CSS parsers treat property values as an untyped series of tokens. This means that each transformer that wants to do something with these values must interpret them itself, leading to duplicate work and in

        GitHub - parcel-bundler/lightningcss: An extremely fast CSS parser, transformer, bundler, and minifier written in Rust.
      • How to write a linter using tree-sitter in an hour

        This article was discussed on Hacker News. This is a continuation of my last post on how to write a tree-sitter grammar in an afternoon. Building on the grammar we wrote, now we’re going to write a linter for Imp, and it’s even easier! The final result clocks in less than 60 SLOC and can be found here. Recall that tree-sitter is an incremental parser generator. That is, you give it a description o

        • Write a JavaScript Parser in Rust | Write a JavaScript Parser in Rust

          Write a JavaScript Parser in RustRust、JavaScript、そしてパーサーはすべて学びにくいものですが、これら3つを組み合わせて Rust で JavaScript のパーサーを書くという挑戦をしてみましょう! このサイトは、Rustやパーサーを学びたい方 oxc, swc or Biome などへの貢献を考えている方への助けとなります。 ガイドでは、Rust で JavaScript パーサーを書くための基本的なトピックを網羅します。チュートリアルでは、いくつかのトピックをより詳しく説明します。

          • Ruby: parser gemで未解決の定数を検出する(翻訳)|TechRacho by BPS株式会社

            概要 元サイトの許諾を得て翻訳・公開いたします。 英語記事: Tracking down not resolving constants in Ruby with parser | Arkency Blog 原文公開日: 2023/03/02 原著者: Piotr Jurewicz サイト: Arkency Blog 日本語タイトルは内容に即したものにしました。 最近の私たちは、とあるRubyアプリで古くなったスタックをアップグレードする作業に従事しています。このアプリケーションはRuby 2.4で動いていました。使われていないgemを50個も削除し、セキュリティアップデートをかけ、非推奨警告を消し去って、いよいよRuby本体をアップグレードするときが来たと判断しました。 しかし、本当のお話はここから始まるのです。古いRubyの内部に興味のない方も、ぜひこのままお読みください。本記事の最後

              Ruby: parser gemで未解決の定数を検出する(翻訳)|TechRacho by BPS株式会社
            • GitHub - humanwhocodes/momoa: A JSON parser, tokenizer, traverser, and printer.

              You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                GitHub - humanwhocodes/momoa: A JSON parser, tokenizer, traverser, and printer.
              • Parsing Protobuf at 2+GB/s: How I Learned To Love Tail Calls in C

                An exciting feature just landed in the main branch of the Clang compiler. Using the [[clang::musttail]] or __attribute__((musttail)) statement attributes, you can now get guaranteed tail calls in C, C++, and Objective-C. While tail calls are usually associated with a functional programming style, I am interested in them purely for performance reasons. It turns out that in some cases we can use tai

                • Prattパーサであらゆる演算子をパースする

                  PrattパーサをParsing mixfix operatorsの分類と組み合わせてあらゆる種類の演算子(含mixfix)をパースできるようなパーサへと育てていきます. 配列アクセスやif_then_else,括弧といった複雑な演算子がPrattパーサという統一的な方法でパースされます. 全文無料公開です.

                    Prattパーサであらゆる演算子をパースする
                  • This is why you should never use parser combinators and PEG

                    Let me tell you why you should (nearly) never use PEG (parsing expression grammars). Nearly everything I will say applies to parser combinators (parsec in Haskell, nom in Rust), too. So, don't use PEG. Use CFGs (context-free grammars) instead. They are more natural. I feel that CFGs more naturally represent how we think. Thus when you have some language in your head and you try to write it down as

                      This is why you should never use parser combinators and PEG
                    • HTMLパーサーの設計・実装ノート (1) 字句解析

                      ふと思いつきでHTMLパーサーを書いているので、どのようなことを考えながら実装したかの記録を残します。 (1) 字句解析 (2) 構文解析 おことわり 偏ったこだわりや早すぎる最適化もあるかもしれませんが、あくまで趣味で書いているものなのでご理解ください。そういったもののなかにも、他の人の発想のヒントになるものも含まれると考えています。 途中の試行錯誤のサイクルを省いて結論だけを紹介している箇所もあります。ご了承ください。 ソースコードは https://github.com/qnighy/htstream に上げていますが、現在のところ完成度はそれほど高くありません。ドキュメントもほぼありませんがご了承ください。 HTMLについて HTMLの管轄をめぐっては紆余曲折がありましたが、現在はWebブラウザベンダーを中心とする標準化団体であるWHATWGが制定するHTML StandardがH

                        HTMLパーサーの設計・実装ノート (1) 字句解析
                      • Ruby: 2024年までのPrismパーサーの長い歴史を振り返る(翻訳)|TechRacho by BPS株式会社

                        概要 CC BY-NC-SA 4.0 Deedに基づいて翻訳・公開いたします。 英語記事: Prism in 2024 | Rails at Scale 原文公開日: 2024/04/16 原著者: Kevin Newton CC BY-NC-SA 4.0 Deed | 表示 - 非営利 - 継承 4.0 国際 | Creative Commons 日本語タイトルは内容に即したものにしました。 syntax treeは「構文ツリー」と訳しています。lexerは英ママとしています。 Ruby 3.3.0では、Prismと呼ばれる新しい標準ライブラリがCRubyに追加されました。PrismはRuby言語を解析するパーサーであり、Cライブラリ版(CRubyでもオプションで利用可能)とRubyライブラリ版(Ruby gemとして利用可能)の両方が公開されています。Prismプロジェクトは多くの開発

                          Ruby: 2024年までのPrismパーサーの長い歴史を振り返る(翻訳)|TechRacho by BPS株式会社
                        • The simdjson library

                          Parsing gigabytes of JSON per second JSON is everywhere on the Internet. Servers spend a lot of time parsing it. The simdjson library uses commonly available SIMD instructions and microparallel algorithms to break speed records. Browse the API The simdjson library on GitHub Highlights Fast: Over 4x faster than RapidJSON and 25x faster than JSON for Modern C++. Easy: First-class, easy to use and ca

                          • Lezer

                            The Lezer Parser System The problem of parsing structured text has resisted one-size-fits all solutions for over 60 years. Lezer isn't such a solution either, but it is a very decent parser generator, especially well suited for use in code editors. Lezer (the Dutch word for reader, pronounced like “laser”) provides a parser generator that outputs JavaScript modules, which can be loaded to parse co

                            • Ruby に >>> 演算子を実装して遊ぶ

                              私は Ruby ビギナーなんですが、最近ちょっとしたきっかけがあって、Ruby に興味津々です。 そこで、Ruby(MRI)をちょっとだけ改造して遊んでみました。 Ruby に貢献!みたいな良い話ではなくて、自分の手元の Ruby に対してあんまり意味のない改造を施して、楽しいね! っていう類の話です。 ちなみに C 言語はほとんど書いたことありません。 どう遊ぶか 私はパーサーがちょっとだけ好きなので、パーサーを触ってみたいと思いました。 パーサーを触るような改造をするなら、新しい構文を追加してみるのがてっとり早そうです。その中でも二項演算子なら簡単なのではないかと考えました。 ということで、(私が日頃から書いている)JavaScript にあって Ruby にはない演算子として、>>> 演算子を実装してみることにしました。 >>> 演算子は、符号なし右シフト演算子というやつで、Java

                                Ruby に >>> 演算子を実装して遊ぶ
                              • 文脈依存 PEG による Haskell パーサ

                                前に PEG パーサジェネレータライブラリ ptera を作っているという話をしたが,今回はその第二弾.ptera で Haskell2010 の文法パーサを例に追加してみたんだが,その過程で色々あったのでその備忘録. 結論から言うと,ptera に前回から以下の拡張を加えた. 先読みを強化し,もうちょっとちゃんと機能するように 文脈依存でパースができるようにした 後は,Template Haskell で文法書けるようにしたりもしたが,まあそれはいいでしょ. Haskell2010 と ptera ptera でひとまず Template Haskell で文法が書けるフロントエンド部分作った後,Haskell 2010 ぐらいパースできないと使い物にならないなあと言う感じで Haskell の example project 書いてみたんだが,ここで色々つまづいてしまった.主に今回説明

                                  文脈依存 PEG による Haskell パーサ
                                • Field Report: RubyKaigi

                                  That’s a wrap! RubyKaigi 2023 has now concluded! Please enjoy this reverse-chronological summary of many of the highlights of what turned out to be a terrific conference! Follow future coverage by subscribing to our newsletter. Thanks! 💚 May 13, 2023 It’s already Day 3 somehow! It’s been awesome to see everyone and witness so many impressive, informative, and inspiring presentations so far. The s

                                    Field Report: RubyKaigi
                                  • GitHub - yui-knk/lr-parser-101

                                    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                      GitHub - yui-knk/lr-parser-101
                                    • Parser generators vs. handwritten parsers: surveying major language implementations in 2021 | notes.eatonphil.com

                                      Parser generators vs. handwritten parsers: surveying major language implementations in 2021 Developers often think parser generators are the sole legit way to build programming language frontends, possibly because compiler courses in university teach lex/yacc variants. But do any modern programming languages actually use parser generators anymore? To find out, this post presents a non-definitive s

                                      • Applicative parsing | Notes on Computing

                                        Parser combinators are sets of functions for building parsers in a composable fashion. Haskell’s Parsec library and OCaml’s Angstrom are two examples. Both of these libraries expose monadic interfaces for describing context-sensitive grammars. This post looks at implementing a more restricted parsing library, structured around applicative functors rather than monads. What could justify giving up o

                                        • GitHub - Marwes/combine: A parser combinator library for Rust

                                          extern crate combine; use combine::{many1, Parser, sep_by}; use combine::parser::char::{letter, space}; // Construct a parser that parses *many* (and at least *1) *letter*s let word = many1(letter()); // Construct a parser that parses many *word*s where each word is *separated by* a (white)*space* let mut parser = sep_by(word, space()) // Combine can collect into any type implementing `Default + E

                                            GitHub - Marwes/combine: A parser combinator library for Rust
                                          • Find Bugs Without Writing Tests

                                            Homepage Meet The Next Member of Your Team! PHPStan finds bugs in your code without writing tests. It's open-source and free. Find bugs before they reach production PHPStan scans your whole codebase and looks for both obvious & tricky bugs. Even in those rarely executed if statements that certainly aren't covered by tests. You can run it on your machine and in CI to prevent those bugs ever reachin

                                              Find Bugs Without Writing Tests
                                            • Challenging LR Parsing

                                              This post is a direct response to Which Parsing Approach?. If you haven’t read that article, do it now — it is the best short survey of the lay of the land of modern parsing techniques. I agree with conclusion — LR parsing is the way to go if you want to do parsing “properly”. I reasoned the same a couple of years ago: Modern Parser Generator. However, and here’s the catch, rust-analyzer uses a ha

                                              • Similar Posts

                                                Open-Source SQL ParsersRajat Venkatesh — 10/1/2021 — 3 Min Read Parsing SQL queries provide superpowers for monitoring data health. This post elaborates on how to get started with parsing SQL for data observability. The query history of a data warehouse is a rich source of information to analyze data usage within your organization. Assessing query history can track many aspects of data observabili

                                                  Similar Posts
                                                • I made JSON.parse() 2x faster

                                                  Part of my job is to make JavaScript things go fast. Speed is a feature, and when working in an interpreted language, squeezing every last bit of performance can be the difference between a great product and unusable garbage. Anyway, how cool would it be to make JavaScript itself go faster? I’m not a C++ programmer, but that didn’t stop me before, so I thought I’d give it a try anyway! The objecti

                                                    I made JSON.parse() 2x faster
                                                  • GitHub - ruby-syntax-tree/syntax_tree: Interact with the Ruby syntax tree

                                                    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                                      GitHub - ruby-syntax-tree/syntax_tree: Interact with the Ruby syntax tree
                                                    • 型付きRubyでパーサを書く(前編) - ローファイ日記

                                                      K-Ruby という鹿児島のRubyコミュニティの忘年LT大会でRBSを使ってみた話をします。オンラインですが、九州盛り上げていきましょう! k-ruby.connpass.com それはそれとしてRBSというものに今回ちゃんと触れるので、触れた記録を雑にでも残していこうと思い、ブログを書きます。どれくらい後学のためになるのかならないのかわかりませんが、触ってみたライブな感想をなるべく残しておくのは意味があるでしょう、と。 @yoshikouki さんには「RailsにRBSを入れる方法を教えてください!」って言われてて、俺にRailsの話を聞くのか... って思ったんですけど、 まあその辺の面白そうなトピックは @yoshikouki さんのために取っておこうと思うので、僕はもうちょっと簡単なプログラム、そう、 プログラミング言語のパーサ をRubyで、型付きで書こうと思いました。 最初

                                                        型付きRubyでパーサを書く(前編) - ローファイ日記
                                                      • Parsing With Haskell (Part 1): Lexing With Alex

                                                        This is the first of the two parts of our Parsing with Haskell series. Looking for the second part instead? You can find it here. This two-part tutorial will look into two tools often used together by Haskellers to parse programs: Alex and Happy. We’ll use them to parse a small programming language from scratch. Both Alex and Happy are industrial-strength tools powerful enough to parse even Haskel

                                                          Parsing With Haskell (Part 1): Lexing With Alex
                                                        • The "return a command" trick

                                                          This post illustrates a trick that I’ve taught a few times to minimize the “change surface” of a Haskell program. By “change surface” I mean the number of places Haskell code needs to be updated when adding a new feature. The motivation I’ll motivate the trick through the following example code for a simple REPL: import Control.Applicative ((<|>)) import Data.Void (Void) import Text.Megaparsec (Pa

                                                          • Functional Parsing - Computerphile

                                                            Functional or Combinator Parsing explained by Professor Graham Hutton. Professor Hutton's Functional Parsing Library: http://bit.ly/C_FunctParsLib https://www.facebook.com/computerphile https://twitter.com/computer_phile This video was filmed and edited by Sean Riley. Computer Science at the University of Nottingham: https://bit.ly/nottscomputer Computerphile is a sister project

                                                              Functional Parsing - Computerphile
                                                            • ptera 式 PEG パーサ生成法

                                                              最近 PEG パーサジェネレータライブラリを作っているんだが,一旦区切りがついたので忘れないうちに備忘録をまとめておく. さて,PEG は曖昧さが存在しない言語を定義する為の文法だ.基本的には文法自体は結構単純で書きやすい.構文解析も単純ではある.ただ,愚直に構文解析すると入力の長さに対して指数時間かかってしまうため,取り扱いが少し難しい.ただ,入力の長さ分のメモリを用意することで,解析時間を入力の長さに対して線形時間にする packrat parsing という手法が提案され,最近では PEG をプログラミング言語の文法の定義方法として採用する言語も増えているようだ. PEG の魅力はなんといっても曖昧さを排除できる点と,文法程度を簡潔にできる点だろう.ただ,あまりいい感じのパーサ生成ライブラリがない場合も多い.Haskell にもあんまりいい感じのがなかった.なので今回は,PEG の勉

                                                                ptera 式 PEG パーサ生成法
                                                              • GitHub - asciidwango/parser_book: アスキードワンゴで出版予定の構文解析本に関するリポジトリ

                                                                You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                                                  GitHub - asciidwango/parser_book: アスキードワンゴで出版予定の構文解析本に関するリポジトリ
                                                                • "Writing a PEG parser for fun and profit" - Guido van Rossum (North Bay Python 2019)

                                                                  Parsing Expression Grammars (PEGs) are a relatively new formalism for describing grammars suitable for automatically generating efficient parsers. I've become interested in using a PEG-generated parser as an alternative to CPython's nearly 30 year old "pgen" parser generator. This poses some interesting problems. I've also come up with a neat way of visualizing the parsing process, which is helpfu

                                                                    "Writing a PEG parser for fun and profit" - Guido van Rossum (North Bay Python 2019)
                                                                  • GitHub - meriyah/meriyah: A 100% compliant, self-hosted javascript parser - https://meriyah.github.io/meriyah

                                                                    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                                                      GitHub - meriyah/meriyah: A 100% compliant, self-hosted javascript parser - https://meriyah.github.io/meriyah
                                                                    • Fun with IP address parsing · blog.dave.tf

                                                                      In my quest to write a fast IPv4+6 parser, I wrote a slow-but-I-think-correct parser, to use as a base of comparison. In doing so, I discovered more cursed IP address representations that I was previously unaware of. Let’s explore together! We start out simple, with IPv4 and IPv6 in what I’ll call their “canonical form”: 192.168.0.1 and 1:2:3:4:5:6:7:8. Various specs call these “dotted quad” (more

                                                                      • Rust で Nested Comment に対応したパーサーを書く - 進捗置き場というわけでもない場所

                                                                        この記事は TSG Advent Calendar 2021 の 18 日目の記事です。 この記事を執筆しているのは年末ですが (本当)、年内は Advent なので (大嘘) セーフです (大嘘)。 寝ていたら新年になっていました。議論の余地なくアウトです。 目次 目次 三行で要約 はじめに 前提知識 パーサーとレキサー レキサー/パーサージェネレーターについて Nested Comment とは Nested Comment の問題点 Rust のパーサージェネレーター事情 plex と LALRPOP 実装 作っていく言語 前準備 Nested Comment に対応したレキサーを作る LALRPOP でパーサーを作る パーサーを呼び出す まとめ 三行で要約 Rust で Nested Comment に対応した言語処理系を書くときには plex と lalrpop を組み合わせると

                                                                          Rust で Nested Comment に対応したパーサーを書く - 進捗置き場というわけでもない場所
                                                                        • RubyでXPath 1.0 パーサを実装した - Qiita

                                                                          この記事はドワンゴ Advent Calendar 2020 16日目の記事です。アドベントカレンダーが好きすぎて、これに加えて最終日も書かせていただきます。急拵えなので内容は薄いですが、興味があればお付き合いください。 はじめに この記事で紹介するXPath 1.0パーサは、ドワンゴ Advent Calendar 2020 最終日にて紹介予定のHTMLパーサである「gammo」向けに開発したものである。 最終日の内容はHTMLパーサに特化したものとなるため、この記事ではgammoが構築したDOMツリーをtraverseするための仕組みとして、XPath 1.0を実装した話を紹介する。 XPath 1.0は1999年に勧告されたXSLT 1.0と同時に公表されたもので、現在の最新バージョンである3.1と比較すると非常に機能が少ないシンプルな仕様となっている。 XPath 1.0を選択した

                                                                            RubyでXPath 1.0 パーサを実装した - Qiita
                                                                          • GitHub - taichi-ishitani/rupkl: Pkl parser for Ruby

                                                                            require 'rupkl' pkl = <<~'PKL' // From: // https://pkl-lang.org/main/current/language-tutorial/01_basic_config.html name = "Pkl: Configure your Systems in New Ways" attendants = 100 isInteractive = true amountLearned = 13.37 PKL RuPkl.load(pkl) # => # {:name=>"Pkl:Configure your Systems in New Ways", # :attendants=>100, # :isInteractive=>true, # :amountLearned=>13.37} File.open('sample.pkl', 'w')

                                                                              GitHub - taichi-ishitani/rupkl: Pkl parser for Ruby
                                                                            • Visualizing Packrat Parsing

                                                                              January 10, 2021 Ohm is an open-source parsing toolkit for JavaScript which Alex Warth and I have been working on since 2014. You can use it to parse custom file formats or quickly build parsers, interpreters, and compilers for programming languages. This article is not about Ohm itself, but about the Ohm visualizer, which I designed and built in 2015 while working on Alex’s team at CDG.1 Later, t

                                                                              • Parsing in Python: all the tools and libraries you can use

                                                                                The tomassetti.me website has changed: it is now part of strumenta.com. You will continue to find all the news with the usual quality, but in a new layout. This is an article similar to a previous one we wrote: Parsing in Java, so the introduction is the same. Skip to chapter 3 if you have already read it. If you need to parse a language, or document, from Python there are fundamentally three ways

                                                                                  Parsing in Python: all the tools and libraries you can use
                                                                                • LR parser 101を完走した - ゲームリンクスの徒然なる日常

                                                                                  はじめに yui-knk/lr-parser-101 というRaccを使って電卓を実装しつつ、パーサージェネレーターを利用したパーサーの作り方を学ぶチュートリアルを完走した時の覚書です。 僕個人のパーサー周りの経験としては 拡張BNF記法がちょっと読み書きできる 元々parse.yに興味があり、たまにリファクタリングのパッチを投げている Rubyソースコード完全解説 や Rubyのしくみ などを読んでRubyのパーサー周りのある程度の知識はある という感じです。 なので、どちらかというと全くの初心者という感じでもないところからの覚書になります。 LR parser 101とは? Bison Killerこと yui-knk さんが書かれた電卓を実装するチュートリアルです。 github.com Raccというパーサージェネレーターを使いつつ、パーサーの作り方を学ぶファーストステップとして非

                                                                                    LR parser 101を完走した - ゲームリンクスの徒然なる日常

                                                                                  新着記事