A Lisp Programmer Living in Python-Land: The Hy Programming Language
Minimum price
Suggested price

A Lisp Programmer Living in Python-Land: The Hy Programming Language

About the Book

Github repository update: December 2020: all examples are also provided in Python (the book only covers the Hy language versions of the examples).

Updated July 31, 2020: I corrected several typos, added more descriptive text, fixed a possible installation problem for the NLP coreference example, and did some rework on the semantic web material (knowledge Graphs).

Updated   June 7,   2020: I   added two chapters on using the   Bing Search APIs and on  my Knowledge Graph Navigator project. Several other minor changes.

While this is a book on the Hy Lisp language,

In addition to being a tutorial and cookbook on using the Hy language, longer examples explore a variety of different applications and tools. The current structure of the book is:

  • Introduction to the Hy Language
  • Why use Lisp? Advantages of bottom up development using macros and closures
  • Relational databases
  • Web app development
  • Web scraping
  • Using the Bing search APIs
  • Accessing semantic web and linked data sources like Wikipedia, DBpedia, and Wikidata
  • Automatically constructing Knowledge Graphs from text documents, semantic web and linked data
  • Deep Learning (predictive model from spreadsheet data and a LSTM-based English text language model)
  • Natural Language Processing (NLP) using Deep Learning
  • Creating Knowledge Graphs from text data
  • Hy language implementation of the author's Knowledge Graph Navigator project

About the Author

Mark Watson
Mark Watson

Mark Watson a consultant specializing in deep learning, machine learning, knowledge graphs, and general artificial intelligence software development. He uses Python, Common Lisp, Java, Clojure, Haskell, and Ruby for development.

He is the author of 23 published books on Artificial Intelligence, Deep Learning, Java, Ruby, Machine Learning, Common LISP, Clojure, JavaScript, Semantic Web, NLP, C++, Linux, and Scheme.

Mark's consulting customer list includes: Google, Capital One, Olive AI, CompassLabs, Disney, Sitescout.com, Embed.ly, and Webmind Corporation.

web site:  https://markwatson.com/

Table of Contents

  • Preface
    • Setting Up Your Development Environment
    • What is Lisp Programming Style?
    • Hy is Python, But With a Lisp Syntax
    • How This Book Reflects My Views on Artificial Intelligence and the Future of Society and Technology
    • About the Book Cover
    • A Request from the Author
    • Acknowledgements
  • Introduction to the Hy Language
    • We Will Often Use the Contributed let Macro in Book Example Code
    • Using Python Libraries
    • Global vs. Local Variables
    • Using Python Code in Hy Programs
    • Using Hy Libraries in Python Programs
    • Replacing the Python slice (cut) Notation with the Hy Functional Form
    • Iterating Through a List With Index of Each Element
    • Formatted Output
    • Importing Libraries from Different Directories on Your Laptop
    • Using Closures
    • Hy Looks Like Clojure: How Similar Are They?
    • Plotting Data Using the Numpy and the Matplotlib Libraries
    • Bonus Points: Configuration for macOS and ITerm2 for Generating Plots Inline in a Hy REPL and Shell
  • Why Lisp?
    • I Hated the Waterfall Method in the 1970s but Learned to Love a Bottom-Up Programming Style
    • First Introduction to Lisp
    • Commercial Product Development and Deployment Using Lisp
    • Hy Macros Let You Extend the Hy Language in Your Programs
    • Performing Bottom Up Development Inside a REPL is a Lifestyle Choice
  • Writing Web Applications
    • Getting Started With Flask: Using Python Decorators in Hy
    • Using Jinja2 Templates To Generate HTML
    • Handling HTTP Sessions and Cookies
    • Deploying Hy Language Flask Apps to Google Cloud Platform AppEngine
    • Deploying Hy Language Flask Apps to the Heroku Platform
    • Wrap-up
  • Responsible Web Scraping
    • Using the Python BeautifulSoup Library in the Hy Language
    • Getting HTML Links from the DemocracyNow.org News Web Site
    • Getting Summaries of Front Page from the NPR.org News Web Site
  • Using the Microsoft Bing Search APIs
    • Getting an Access Key for Microsoft Bing Search APIs
    • Example Search Script
    • Wrap-up
  • Deep Learning
    • Simple Multi-layer Perceptron Neural Networks
    • Deep Learning
    • Using Keras and TensorFlow to Model The Wisconsin Cancer Data Set
    • Using a LSTM Recurrent Neural Network to Generate English Text Similar to the Philosopher Nietzsche’s writing
  • Natural Language Processing
    • Exploring the spaCy Library
    • Implementing a HyNLP Wrapper for the Python spaCy Library
    • Coreference (Anaphora Resolution)
    • Wrap-up
  • Datastores
    • Sqlite
    • PostgreSQL
    • RDF Data Using the “rdflib” Library
    • Wrap-up
  • Linked Data and the Semantic Web
    • Understanding the Resource Description Framework (RDF)
    • Resource Namespaces Provided in rdflib
    • Understanding the SPARQL Query Language
    • Wrapping the Python rdflib Library
  • Knowledge Graph Creator
    • Recommended Industrial Use of Knowledge Graphs
    • Design of KGCreator Application
    • Problems with using Literal Values in RDF
    • Revisiting This Example Using URIs Instead of Literal Values
    • Wrap-up
  • Knowledge Graph Navigator
    • Review of NLP Utilities Used in Application
    • Developing Low-Level Caching SPARQL Utilities
    • Utilities to Colorize SPARQL and Generated Output
    • Text Utilities for Queries and Results
    • Finishing the Main Function for KGN
    • Wrap-up
  • Book Wrap-up

Authors have earned$9,882,857writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub