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 0 Comments
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

Calling Lisp Functions from Xojo

Written by on April 17, 2022 in LISP, Programming, Xojo with 0 Comments
Calling Lisp Functions from Xojo

A few days ago, I purchased Xojo Pro commercial license. In case you haven’t heard about the product, Xojo is a popular cross-platform development tool targeting Desktop, Web and iOS (Android is expected in the near future). It supports an Object-Oriented Basic language. It has been around for over 25 years and has been steadily gaining […]

Continue Reading

Rust Trait vs. C++ Abstract Class

Written by on April 3, 2022 in C++, Programming, Rust with 0 Comments
Rust Trait vs. C++ Abstract Class

Traits in Rust are an amazing feature and contribute significantly to the expressive power of the language. For someone coming to Rust with a C++ background (like me), Traits appear to be quite similar to Abstract Classes in C++. Although they are similar, Traits have certain characteristics that set them apart. In this article, I […]

Continue Reading

Book Review: Introducing Blockchain with Lisp

Written by on March 19, 2022 in Book Review, LISP, Programming with 0 Comments
Book Review: Introducing Blockchain with Lisp

Title: Introducing Blockchain with Lisp: Implement and Extend Blockchains with the Racket Language Author: Boro Sitnikovski Publisher: Apress Year: 2021 Blockchains are a hot topic these days and interestingly, I am getting involved in a project that uses Blockchain. Languages such as C++, Java, Go and Node.js are commonly used in such projects, so when […]

Continue Reading

Lazy Parameter Evaluation in D Language

Written by on March 6, 2022 in D Language, Programming with 0 Comments
Lazy Parameter Evaluation in D Language

Languages such as C/C++ and Java follow an “eager” argument evaluation approach, where function arguments are evaluated before the function is entered. Of course, there are idioms and tricks that one can use to force “lazy” evaluation. The primary benefit of “lazy” parameter evaluation is that the parameter is evaluated only when it is used and […]

Continue Reading

Selective Unit Testing in D Language

Written by on February 23, 2022 in D Language, Programming with 0 Comments
Selective Unit Testing in D Language

In the last article, I briefly explained how D language has built-in support for performing unit tests. I feel this is an advantage over many current languages.  What if we want to run only a subset of unit tests? Although it is a good idea to run the unit tests every time there is a […]

Continue Reading

Top