Chapter 2. Parsing a Number

This is a chapter fromCreating a compiler with Raku In the following two chapters, we will temporary leave the compiler created in the previous chapter, and will be working on a separate helper project, a calculator. It is an interesting thing on its own, and we will explore it on an isolated example. In the … Continue reading “Chapter 2. Parsing a Number”

Chapter 1. Creating a Simple Interpreter

This is a chapter fromCreating a compiler with Raku Let’s start exploring the power or Raku’s grammars and regexes from a simple interpreter program that parses and executes the following tiny program. I will call this language Lingua. my x;x = 42;say x; You should not experience any problems with understanding what this code means, as … Continue reading “Chapter 1. Creating a Simple Interpreter”

My books on GitHub

Before the GitHub 02/02/2020 Archive program, I uploaded all my books published by DeepText to github.com/ash/books. I hope it will be frozen and archived for the future generations :-D. It’s all in PDFs currently and can be downloaded freely. The Perl 6 Deep Dive cannot be in the open repository, as it was published by … Continue reading “My books on GitHub”

🦋 Calling C++ and Fortran functions from Raku using the NativeCall interface

Some time ago, I published an article about using NativeCall in Raku to call functions written in C. Today, let’s see how you can call simple functions written in C++ or in Fortran. There will be three examples for both languages: A function printing a message A function returning a number A function taking an … Continue reading “🦋 Calling C++ and Fortran functions from Raku using the NativeCall interface”

Implementing a stack-based language in Raku

I assume there is no need to tell what a stack is, and a stack-based programming is something that uses the stack to perform all the operation. The program flow in such a language resembles a reversed Polish notation, when you first list the operands, and then the operation: 40 2 + There are a … Continue reading “Implementing a stack-based language in Raku”

Factor at a Glance — A Language a Day, Advent Calendar 2019 Day 24/24

About this ‘A Language a Day’ Advent Calendar 2019 Welcome to Day 24 of this year’s A Language a Day Advent Calendar. Today’s topic is introduction to the Factor programming language. Table of Contents Facts about the languageInstalling and running FactorStackVariablesDefining wordsObject-oriented programmingGet more Facts about the language Some facts about the Factor programming language: A … Continue reading “Factor at a Glance — A Language a Day, Advent Calendar 2019 Day 24/24”

Io at a Glance — A Language a Day, Advent Calendar 2019 Day 23/24

About this ‘A Language a Day’ Advent Calendar 2019 Welcome to Day 23 of this year’s A Language a Day Advent Calendar. Today’s topic is introduction to the Io programming language. Table of Contents Facts about the languageInstalling and running IoVariablesFunctionsObjectsInheritanceConcurrencyGet more Facts about the language Prototype-based, object oriented Dynamically typed A homoiconic language Appeared in … Continue reading “Io at a Glance — A Language a Day, Advent Calendar 2019 Day 23/24”

Zig at a Glance — A Language a Day, Advent Calendar 2019 Day 22/24

About this ‘A Language a Day’ Advent Calendar 2019 Welcome to Day 22 of this year’s A Language a Day Advent Calendar. Today’s topic is introduction to the Zig programming language. Table of Contents Facts about the languageInstalling and running ZigVariables and constantsFunctionsCompile-time evaluationCatching errorsStructsGet more Facts about the language Some facts about the Zig programming … Continue reading “Zig at a Glance — A Language a Day, Advent Calendar 2019 Day 22/24”

D at a Glance — A Language a Day, Advent Calendar 2019 Day 21/24

About this ‘A Language a Day’ Advent Calendar 2019 Welcome to Day 21 of this year’s A Language a Day Advent Calendar. Today’s topic is introduction to the D programming language. Table of Contents Facts about the languageInstalling and running DVariablesFunctionsA word on functional programmingUnicode supportClassesConcurrencyMessagesGet more Facts about the language Some facts about the D … Continue reading “D at a Glance — A Language a Day, Advent Calendar 2019 Day 21/24”

Mercury at a Glance — A Language a Day, Advent Calendar 2019 Day 20/24

About this ‘A Language a Day’ Advent Calendar 2019 Welcome to Day 20 of this year’s A Language a Day Advent Calendar. Today’s topic is introduction to the Mercury programming language. Table of Contents Facts about the languageInstalling and running MercuryWhat all those :- and . are aboutVariablesFunctions and predicatesWhat unification isGet more Facts about the … Continue reading “Mercury at a Glance — A Language a Day, Advent Calendar 2019 Day 20/24”