Наука и технология в современном миреМирзаева Ширин Нодировна, Тахиров Чингиз Аъзамович +22026
Swift Proto Parser: A Framework for Native Tools for Protocol Buffers Kish Aleksei Senior Software Engineer / Technical Owner at Semrush Spain, Barcelona
PAGE NO. - · Swift Proto Parser: A · Framework for Native · Tools for Protocol Buffers · Kish Aleksei
The American Journal of Applied sciences · 07 · 84-91 · 2025
Аннотация
This article presents the development of a OPEN ACCESS native Swift library that parses .proto files—commonly SUBMITED 16 January 2025 used in Protocol Buffers (Protobuf)—without relying on ACCEPTED 12 February 2025 the external protoc tool. It addresses a critical gap in PUBLISHED 11 March 2025 VOLUME Vol.07 Issue03 2025 Swift’s ecosystem by enabling direct, run-time access to Protobuf schemas. Drawing on the theoretical CITATION foundations of lexical analysis, the paper outlines how Kish Aleksei. (2025). swift proto parser: a framework for native tools for the library’s lexer and parser transform raw .proto input protocol buffers. The American Journal of Applied Sciences, 7(03),13–19. into descriptor structures amenable to dynamic https://doi.org/10.37547/tajas/Volume07Issue03-03 serialization and integration with SwiftProtoReflect. The proposed approach substantially reduces dependency COPYRIGHT on external code generation and simplifies tasks such as © 2025 Original content from this work may be used under the terms documentation generation, code formatting, linting, of the creative commons attributes 4.0 License. and IDE-based tooling. Experimental evidence and test results show that the library can reliably handle core Protobuf features, including nested messages, enums, services, and custom options, thereby laying the groundwork for a fully Swift-based workflow in gRPC and Protocol Buffers development. Keywords: Swift, Protocol Buffers, lexical analysis, parsing, dynamic serialization, gRPC, reflection, .proto files. Introduction: Modern distributed systems and microservice architectures increasingly adopt the gRPC protocol based on Protocol Buffers (Protobuf) for high- performance data serialization [2]. However, until recently, the Swift language lacked fully native tools for flexible and dynamic interaction with Protobuf messages. Developers had to rely on protoc and associated utilities, complicating project compilation and deployment [5]. This issue is particularly critical in environments with frequent service specification updates, where each .proto file modification necessitates code generation and application recompilation [3]. The problem becomes even more pronounced when The American Journal of Applied Sciences 13 https://www.theamericanjournals.com/index.php/tajas The American Journal of Applied Sciences dynamic serialization and deserialization are required The objective of this study is to develop and without statically generated classes—such as in cases demonstrate Swift Proto Parser, a native Swift library where the set of Protobuf messages may change providing a complete pipeline for the lexical and dynamically. The SwiftProtoReflect project addresses syntactic analysis of .proto files. Based on the resulting some of the challenges related to dynamic access to abstract syntax tree (AST) or descriptors, dynamic Protobuf metadata, but achieving full functionality interaction with messages and services can be achieved requires a native lexer and parser for .proto files in using SwiftProtoReflect or other tools. Swift [4]. The absence of such tooling generates both The hypothesis states that implementing a Protocol scientific and practical interest in the lexical [6] and Buffers parser—including both lexer and syntax syntactic analysis of .proto files within the Swift analyzer—natively in Swift will eliminate reliance on ecosystem. protoc, thereby increasing the flexibility of gRPC service Existing research confirms gRPC's potential for low- development in Swift projects, accelerating integration latency interservice communication and efficient data of changes, and simplifying tooling (at the level of IDEs, serialization [7]. However, these studies typically do linters, and refactoring utilities). not focus on Swift-specific challenges, where dynamic message reflection remains limited [2]. In our previous 1. Theoretical aspects of lexical analysis and working works [3, 4], we introduced the SwiftProtoReflect with Protobuf in Swift library to enable dynamic serialization in Swift, thereby demonstrating the potential for runtime interaction Lexical analysis, also known as tokenization, is the first with Protobuf data. These contributions provided a stage in transforming the source text of any formal solid foundation and inspired further innovations. specification or program code into a machine-readable Building on that groundwork, the tool presented in this representation [1]. It involves breaking a stream of paper extends our earlier efforts by incorporating characters into lexemes, each classified and converted lexical and syntactic parsing of .proto files, thereby into a token of a specific type, such as an identifier, broadening the scope of Protobuf handling in Swift. keyword, operator, or literal. The resulting set of tokens is later interpreted by a syntax parser, which relies on a From a theoretical perspective, significant context-free grammar. In classical compilers and contribu
Доказательный фрагмент
«This article presents the development of a OPEN ACCESS native Swift library that parses .proto files—commonly SUBMITED 16 January 2025 used in Protocol Buffers (Protobuf)—without relying on ACCEPTED 12 February 2025 t…»
Образец извлечения
Демо-превьюThis article presents the development of a OPEN ACCESS native Swift library that parses .proto files—commonly SUBMITED 16 January 2025 used in Protocol Buffers (Protobuf)—without relying on ACCEPTED 12 February 2025 t… Полный текст публикации CiteX не хранит — доступ к первоисточнику открывается по DOI согласно лицензии издателя и выбранному плану.
- Цитирований
- 0
- Тип
- Журнал
- Страна
- Узбекистан
- Ключевые слова
- Swift, Protocol Buffers, lexical analysis, dynamic serialization, parsing
Смежные источники
Магистерские диссертацииРахмонов Сардорбек Рахимжон ўғли2016
Журнал вестник врачаЖ Бекназаров, Ё Нурматов +12022
The American Journal of Applied sciencesAbdumalikov Abdulatif Abdumalikovich, Khakimov Nazar Khakimovich2020