LIBRISTO
LIBROAMANTO
povinné
Staňte sa súčasťou komunity milovníkov kníh z celého sveta a získajte hromadu výhod. Založiť účet zdarma
0
Doprava zadarmo s Packetou nad 59.99 €
Kuriér DPD 2.99 Zberné miesto GLS 2.49 SPS 3.99 SPS Parcel Shop 2.99 Packeta kurýr 3.99 Pošta 3.99 Zberné miesto DPD 2.99 Kuriér GLS 3.99 Packeta 2.99

Doprava zdarma pre objednávky nad 59,99 € s Packetou a SPS Boxmi.

Metaprogramming in OCaml

A Practical Guide to PPX Extensions, AST Transformations, and Code Generation

Jazyk AngličtinaAngličtina
Kniha Brožovaná
Kniha Metaprogramming in OCaml Edward M. Monday
Libristo kód: 50608228
Nakladateľstvo Independently published, november 2025
Ever find yourself writing the same to_string function for every new record type you create? You add... Celý popis
? points 53 b
21.76
Skladom u dodávateľa Odosielame za 9-15 dní

30 dní na vrátenie tovaru

Ever find yourself writing the same to_string function for every new record type you create? You add a new field to your type, but you forget to update your printer, and suddenly your debug logs are incomplete. It's a frustrating and needless source of bugs.

What if you could just... not?

What if you could "teach" the OCaml compiler how to print your types for you? Imagine just adding one line, [@@deriving print], and having a perfect, up-to-date printer function generated automatically. What if you could invent your own syntax, like [%html< div >...< /div >], and have it transformed into safe, type-checked function calls?

This isn't magic. This is metaprogramming, and this book will show you exactly how to do it.

What's inside

This is a project-based guide, and I will walk you through everything, with no code left out. You will learn:

  • The Foundation: What the Abstract Syntax Tree (AST) is and how to "see" your OCaml code just like the compiler does.
  • The Toolbox: How to use the ppxlib library, including the Ast_mapper to find and change code, and the Ast_builder to generate new code from scratch.
  • Your First PPX: We build a simple [@hello] attribute to learn the complete setup, from dune files to implementation.
  • Project 1: The Deriver: We will build a complete, professional-grade [@@deriving print] PPX from start to finish. You'll write a tool that can automatically generate "pretty-printers" for both record and variant types.
  • Project 2: The DSL: We will create a [%html ...] extension node. You'll build your own safe, embedded Domain-Specific Language (DSL) that transforms HTML-like syntax into secure OCaml function calls.
  • The Polish: How to write robust PPX extensions that provide clear, helpful error messages to your users.
  • The Pro Tools: A guide to testing, debugging, and deploying your new PPX to the OPAM repository for everyone to use.
Who it's meant for

This book is written for the intermediate OCaml programmer.

If you are comfortable with OCaml's syntax, types, and build system, but you want to unlock a new level of power, this book is for you. It's for anyone who wants to build more powerful libraries, create safer APIs, or simply automate the boring parts of programming.

Don't just use OCaml. It's time to extend it.

Stop writing repetitive code and start building the tools that write it for you. This guide provides the knowledge and the code to do it safely and effectively.

Get your copy today and learn to make the OCaml compiler work for you.

Herečka & Polyglotka
EWA KASP pre
Prehrať video
Ewa Kasp
Libristo má najväčší výber cudzojazyčnej literatúry. Preto si knihy kupujem tu.

Informácie o knihe

Celý názov Metaprogramming in OCaml
Jazyk Angličtina
Väzba Kniha - Brožovaná
Dátum vydania 2025
Počet strán 232
EAN 9798274869225
Libristo kód 50608228
Nakladateľstvo Independently published
Váha 378
Rozmery 170 x 244 x 12
Darujte túto knihu ešte dnes
Je to jednoduché
1 Pridajte knihu do košíka a vyberte možnosť doručiť ako darček 2 Obratom Vám zašleme poukaz 3 Knihu zašleme na adresu obdarovaného

Prihlásenie

Prihláste sa k svojmu účtu. Ešte nemáte Libristo účet? Vytvorte si ho teraz!

 
povinné
povinné

Nemáte účet? Získajte výhody Libristo účtu!

Vďaka Libristo účtu budete mať všetko pod kontrolou.

Vytvoriť Libristo účet
Knižný radca Libroamiko
Ahoj, som Libroamiko, môžem pomôcť?