Programming

Why Learn C++

Written by on November 7, 2022 in C++, Programming with 0 Comments

This is the third and the last article in the series “Why Learn Language-XYZ?”. I talked about Prolog and Lisp earlier. The present article is on C++. Once you have gained reasonable proficiency with Prolog and Lisp, you are ready to learn C++! In my view, C++ is a complex language and requires sufficient maturity […]

Continue Reading

Why Learn Lisp?

Written by on October 20, 2022 in LISP, Programming with 1 Comment

In the last article, I had shared my views on why programmers should learn Prolog, preferably as the first language. What language should one learn next? I strongly pitch for Lisp, to be precise, “Common Lisp”. Lisp happens to be the second oldest (1958) programming language, only after Fortran (1957)! Initially there were several dialects […]

Continue Reading

Why Learn Prolog?

Written by on October 6, 2022 in Programming, Prolog with 2 Comments

There are several programming languages in use today and a simple google search will throw up interesting recommendations of a subset of these languages to learn, usually based on popularity ranking. As is expected, the popularity of a programming language varies over time and hence a language that was in demand a few years ago […]

Continue Reading

std::array vs. std::vector

Written by on August 9, 2022 in C++, Programming with 0 Comments
std::array vs. std::vector

One of the common questions when starting to study the container abstractions in C++20 is “Should I use std::array or std::vector?”. The correct answer is “use what is best suited for the current situation”. That is not good enough, obviously. In this short article, I will try to answer this question based on the intrinsic nature […]

Continue Reading

Understanding std::span

Written by on July 27, 2022 in C++, Programming with 0 Comments
Understanding std::span

Introduced in C++20, std::span is a light-weight abstraction that provides a convenient view into a collection of contiguous elements. Note that it is not enough for the elements to be logically contiguous, but they must be contiguous in memory too. Thus, span will work with C-style arrays, C++ vectors and arrays. It will obviously not work with […]

Continue Reading

C++20 [[no_unique_address]] Attribute

Written by on June 26, 2022 in C++, Programming with 0 Comments
C++20 [[no_unique_address]] Attribute

The [[no_unique_address]] attribute was introduced in C++20 to give a compiler the freedom to optimise memory allocation of a struct/class when it contains a subobject that does not have any members. The other requirement is that the subobject should not be a static member of the enclosing struct/class. Let us start with the basics first. […]

Continue Reading

Definite Clause Grammars in Lisp – Part 4

Written by on June 12, 2022 in LISP, Natural Language Processing, Programming, Prolog with 0 Comments
Definite Clause Grammars in Lisp – Part 4

In a series of articles written earlier, I had shown how it is possible to model Definite Clause Grammars (DCG) in LispWorks Lisp (Enterprise Edition). We use defgrammar in Common Prolog (available as part of KnowledgeWorks package) to define our grammar rules. Here is a toy English grammar represented using defgrammar: This corresponds to the following Prolog […]

Continue Reading

Setting Up Function Hooks in Lisp

Written by on May 29, 2022 in LISP, Programming with 0 Comments
Setting Up Function Hooks in Lisp

Lisp is known to be a highly dynamic language, where functions are first-class objects. It is possible to define and undefine functions on the fly as well as attach hooks to existing functions. These are in addition to the ability to pass functions as parameters to other functions and returning a function as the result of […]

Continue Reading

Students Assessment Advisor in Prolog

Written by on May 15, 2022 in Programming, Prolog with 0 Comments
Students Assessment Advisor in Prolog

A close relative of mine teaches Maths to school students in different Grades. During a casual chat some time ago, he mentioned that he was trying to adopt an automated approach to selecting assignment problems based on each student’s performance so far. Obviously, there are many ways in which this can be done, but he […]

Continue Reading

Using DLL Functions in Rust

Written by on May 4, 2022 in C++, Programming, Rust with 1 Comment
Using DLL Functions in Rust

When you program in Rust, especially in a non-trivial project, there is a good chance that you will need to call “external” functions (usually, C/C++) that are available in a DLL (we are talking about the Windows platform here). It could be because you wish to re-use some code that you have earlier written in […]

Continue Reading

Top