Building your own computer language

Just code it

If you wanted to build your own computer language, but didn’t know how to start or thought you didn’t have time and skills to do this, then look no harder then the Crafting Interpreters book by Bob Nystrom on building a computer language from scratch. That’s it from the very beginning to the full fledged object oriented stuff.

Where do I find it?

Just visit this web page where Bob has a free of charge web book, still in the process of writing, were you can start to build you own language. You can call it BestLangEver or even something like Jabba, etc. The book is very detailed and explains thing in a clear and easy to understand manner. Thanks to the book I was able to understand how a Mark-and-Sweep garbage collector works and can be quite easily implemented. Bob has done a great work of bringing the art of language design to the masses.

What are you waiting for?

Start reading.

 

Read as if you edit. Editing Imbalanced Classification with Python

Reading can be hard, but rewarding

I like to read books. They provide me with the opportunity to discover new worlds and learn new things. Unlike other sources, e.g. YouTube tutorials, which I find a little bit distracting, books don’t seduce you to click on them, instead they lay on a flat surface and don’t care. In addition, it’s quite hard to jump from a book to a book in haphazard way reading them in parallel physically. But when you find an interesting book, say a novel, it can draw you attention and hold you captive until you finish reading it. And there are books that are interesting and at the same time require from a reader a certain amount of concentration and work that needs to be done to get the most out of reading a book.

I call such a reading a workout. It’s similar to physical exercises, that can be unpleasant at times, but it has a reward of deeper understanding and grasp of concepts. It also resembles editing a book, call it testing, even alpha testing if you have a software background. By reading a book, as if you edit it, and as such need to pay attention to details and working on it from A to Z, you are bound to better understand the information that the book tries to convey. 

Read as if you edit

With the recent wave of high interest in Machine and Deep Learning there are a lot of books published on the subject to satisfy hungry readers. The books are ranging from popular explanations for a general audience to technical books, that teach readers how to apply Machine Learning to day to day practical applications. Machine Learning Mastery web site provides a number of such books, that are written with a hands on experience first approach. This makes the books perfect candidates for the Read as if you edit approach, since it is the best way to get actual practical experience in Machine Learning by actually applying examples from each chapter in these books. For readers, who aren’t familiar with Machine Learning Mastery books, all of them (books) are structured  in a similar way, where each chapter has just enough theory to get you started using practical code samples.

It is possible to only read through the books, without running a single code sample having a feeling of understanding how things work and being happy with yourself. The issue is, this approach brings almost zero value and provides you with no real experience. Instead, think of yourself as an editor or a tester, who was tasked with finding mistakes, omissions, unclear explanations or wrong code samples. Doing this will help you get the most out of  the book since it forces you to actually run the code, play with it by adjusting it. It also helps you to get better understanding of the material by cross-referencing unclear points by searching on the internet or in other books. 

Don’t you think that read as if you edit approach is only applicable to Machine Learning books. I find it also useful in reading books on mathematics, physics and engineering. Actually, it can be applied to any source of written information, only then it becomes a critical reading approach, where you don’t blindly trust what you read, but instead analyze it and verify the information.

So how was it editing Imbalance Classification with Python book?

I very much liked editing this recent book, since it had enough theory, math and new machine learning concepts to get me excited to work with the book from start to finish. The book has about 450 pages of actual content and it took me about three hours a day for nine days to finish it. I can’t say that it was smooth and easy. The content, at least for me, required cross-checking it with other sources. The code samples required, not once, a need to reference Python libraries documentation and quick dives into sources about imbalanced classification, statistics and information theory.

All in all, reading this from A to Z made me realize the importance of knowing that the data could be imbalanced, as in case of anomaly detection, and one cannot train a model assuming an equal distribution between positive and negative classes, since such a model will tend to classify incorrectly in practice.

 

Math is in the air

Start this year the right way

New year’s time is usually a time to make some new year’s resolutions. I won’t do it and instead this year for me at least will be solely focused on applied mathematics. Math topics interest  me for a long time. But I never took it seriously to invest quality time into studying advanced math topics with enough detail. This year will be different. The plan is to start from some quite general books on math that try to approach the topic in an engaging way like Measurement book by Paul Lockhart and slowly transitioning to more technical books for applied mathematics like Elements of Applied Mathematics by Zeldovich and Myskis and  Nonlinear Dynamics and Chaos by Steven H. Strogatz.

A little bit about the books

Why these three books you may wonder? Actually, there are four books I want to focus on. What is so specially about these books is the fact that they do not simply talk about one specific field in math with a very narrow focus on the subject, but like Donald Knuth’s The Art Of Computer Programming volumes approach the subject in a more general way without being fearful to delve in fields of physics, engineering, biology etc.

To summarize the books are:

measurement

Measurement by Paul Lockhart which tries to show math as an engaging activity that resembles arts, such as music, painting where there is a place for creativity,  a joy of new discoveries or a pain of being stuck trying to get a solution.

 

 

 

 

2020-01-01 16_03_56-Elements Of Applied Mathematics _ YA. B. Zeldovich, A. D. Myskis _ Free DownloadElements of Applied Mathematics by Zeldovich and Myskis which is an old book, but it’s still relevant today, at least in many parts of it, as it was back in 1972. As authors themselves put in the foreword of the book

So our advice is: read our book and study it. But even if there is not time enough to make a deep study, then merely read it it like a novel, and it may be just the thing you will need for solving some difficult problem.

 

 

math_arnoldMathematical Understanding of Nature: Essays on Amazing Physical Phenomena and Their Understanding by Mathematicians by Vladimir Arnold. This book is a collection of applied math problems  that were drawn from various fields such as physics, engineering etc.

Note: If you’re capable of reading in Russian then this book is available in full for free here.

 

 

nonlinear-dynamics-and-chaosAnd finally there is the voluminous  Nonlinear Dynamics and Chaos by Steven H. Strogatz that makes me feel better by having hundreds of differential quotations.

Note: The older edition of this book is available for free, for example, here.

A unique feature of the book is its emphasis on applications. These include mechanical vibrations, lasers, biological rhythms, superconducting circuits, insect outbreaks, chemical oscillators, genetic control systems, chaotic waterwheels, and even a technique for using chaos to send secret messages.

 

Now is the best time to start

This paragraph is dedicated to myself and possibly you. Remember that now is the best time to start doing what you wanted, but postponed ad infinitum. So start by taking small steps to big results later. Or at least to having satisfaction from solving some non-trivial tasks and applying a new skill to real life problems.