LIBRISTO
LIBROAMANTO
obvezno
Postanite del skupnosti ljubiteljev knjig z vsega sveta in uživajte v številnih ugodnostih. Ustvarite brezplačen račun
0
Brezplačna dostava Zásilkovna nad 69.99 €
Zbirna točka GLS 4.49 Zbirna točka DPD 2.99 Kurirska služba GLS 5.49 Kurir DPD 3.49 Kurirska služba 3.49 Zbirno mesto 3.49 Zbirno mesto 3.49 Dostava preko Pošte Slovenije 3.49

Brezplačna dostava za naročila nad 69.99 € na paketomatih Pošte Slovenije.

Metaprogramming in OCaml

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

Jezik AngleščinaAngleščina
Knjiga Mehka
Knjiga Metaprogramming in OCaml Edward M. Monday
Koda Libristo: 50608228
Založba Independently published, november 2025
Ever find yourself writing the same to_string function for every new record type you create? You add... Celoten opis
? points 53 b
21.77
Na zalogi pri dobavitelju Odposlali bomo v 9-15 dneh

30 dni za vračilo blaga

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.

Igralka & Poliglotka
EWA KASP za
Predvajaj video
Ewa Kasp
Libristo ima največjo izbiro tujejezične literature. Zato svoje knjige kupujem tukaj.

O knjigi

Polni naslov Metaprogramming in OCaml
Jezik Angleščina
Vezava Knjiga - Mehka
Datum izida 2025
Število strani 232
EAN 9798274869225
Koda Libristo 50608228
Teža 378
Mere 170 x 244 x 12
Podarite to knjigo še danes
To je povsem preprosto
1 Dodajte knjigo v košarico in izberite dostavo kot darilo 2 V zameno vam bomo poslali kupon 3 Knjiga bo dostavljena na naslov obdarovanca

Prijava

Prijavite se v svoj račun. Še nimate računa Libristo? Ustvarite ga zdaj!

 
obvezno
obvezno

Še nimate računa? Izkoristite prednosti računa Libristo!

Z računom Libristo boste imeli vedno vse pod nadzorom.

Ustvarite račun Libristo