Programming

std::expected<>

Written by on May 13, 2023 in C++, Programming with 0 Comments
std::expected<>

I had written about std::optional<> in an earlier article. C++23 introduces std::expected<> as an interesting extension to std::optional<>. Whereas std::optional<> contains a value or none at all, std::expected<> contains a value or an error code associated with it. This gives better control to the caller in terms of handling the outcome of the function call. […]

Continue Reading

Defer Statement in V Language

Written by on April 20, 2023 in Programming, Vlang with 0 Comments
Defer Statement in V Language

The defer statement in Vlang causes code to be executed when the enclosing function returns. This feature is inspired by Golang, but is slightly more flexible since it allows any block of code to be associated with defer instead of just a function call. defer is used primarily to handle “clean up” logic, such as […]

Continue Reading

Building V Language DLL

Written by on April 2, 2023 in Programming, Vlang with 0 Comments
Building V Language DLL

The relatively new V Programming Language (Vlang) boasts of some interesting features such as “fast compilation” and runtime performance “as fast as C”, at the same time being a “simple language”. As I normally do with other languages that I learn and use, I decided to see how easy it is to build a shared […]

Continue Reading

Building a Xojo App to Interact with OpenAI API

Written by on March 16, 2023 in Programming, Xojo with 1 Comment
Building a Xojo App to Interact with OpenAI API

A few weeks ago I registered with OpenAI to access its services through API and created a secret Key for my use. I then decided to build a simple application to try out the “Chat” and “Completion” models. Since I have several tools at my disposal (RAD Studio, LispWorks, Allegro CommonLisp, Visual Studio, and Xojo), […]

Continue Reading

Julia: Defining Functions Dynamically

Written by on March 5, 2023 in Julia, Programming with 0 Comments
Julia: Defining Functions Dynamically

One of the widely discussed features of Julia is its support for metaprogramming. This feature makes it possible to generate and inspect the code at runtime. In essence, metaprogramming blurs the distinction between code and data. When used carefully, it can contribute to good code. Of course, Julia is not the only or the first […]

Continue Reading

Calling External DLL Functions from Julia

Written by on February 16, 2023 in Julia, LISP, Programming with 0 Comments
Calling External DLL Functions from Julia

Julia supports calling external functions, especially those written in “C” language. As Julia documentation says, such calls do not involve any “boilerplate” code and hence are efficient. In today’s article, I am going to show how to call functions defined in a DLL (Windows 64 bit). Instead of using direct “C” functions, I will discuss […]

Continue Reading

Book Review: Adventures in Rule-Based Programming – A CLIPS Tutorial

Written by on January 11, 2023 in Knowledge Representation, Programming with 0 Comments
Book Review: Adventures in Rule-Based Programming – A CLIPS Tutorial

Title: Adventures in Rule-Based Programming – A CLIPS Tutorial Author: Gary Riley Publisher: Secret Society Software, LLC Year: 2022 In an earlier article, I had talked about the relevance of Rule-based systems today. In that article I had also listed a few Rule engines that are popular and widely used. One of them is CLIPS, […]

Continue Reading

Std::tie

Written by on December 25, 2022 in C++, Programming with 0 Comments
Std::tie

std::tuple is a widely used abstraction in C++ and has been around since C++11. It is a generalization of std::pair. std::tie is convenient when we want to create a tuple of lvalue references to existing variables. It is a function template commonly used to unpack a tuple into individual objects. In the above example, we […]

Continue Reading

Are Rule-Based Systems Still Relevant Today?

Written by on December 8, 2022 in Knowledge Representation, Programming with 1 Comment
Are Rule-Based Systems Still Relevant Today?

Before Machine Learning came into the mainstream, Rule-based systems were being used actively to solve complex decision making problems. In fact, Rule engines were considered to be an exotic component of Artificial Intelligence and the systems built using these rule engines were called Expert Systems. I still remember learning to use OPS5 a few decades […]

Continue Reading

Using Julia from Mathematica

Written by on November 24, 2022 in Julia, Mathematica, Programming with 0 Comments
Using Julia from Mathematica

In an earlier article, I had shown how it is possible to interact with Mathematica from Julia. In today’s article, I will share the details of how to interact with Julia from within Mathematica. Why would somebody want to execute Julia code inside Mathematica? Although Mathematica is a great symbolic computing environment offering thousands of […]

Continue Reading

Top