LISP

Using OpenAI from Allegro Common Lisp

Written by on January 20, 2025 in LISP, OpenAI, Programming with 0 Comments
Using OpenAI from Allegro Common Lisp

Allegro Common Lisp ver 11.0 introduced support for OpenAI LLMs. In this article, let us look at some of the functions for interacting with OpenAI. First we need to specify basic parameters such as the API key, LLM to use, Temperature, etc. I have defined a convenient function configure-openai to do this (full source is included […]

Continue Reading

Word Transformation Puzzle – Part 2: Implementation in Common Lisp

Written by on January 4, 2025 in LISP, Programming with 0 Comments
Word Transformation Puzzle – Part 2: Implementation in Common Lisp

In the last article I discussed an interesting word puzzle and showed how to solve it using Prolog. Here is the problem statement: “You are given two words of the same length. You have to transform the first word into the second word, by changing only one letter at a time. The additional constraint is that […]

Continue Reading

Multiobjective Optimization (MOO) in Lisp and Prolog

Written by on November 22, 2024 in C++, LISP, Programming, Prolog with 0 Comments
Multiobjective Optimization (MOO) in Lisp and Prolog

Recently I came across a nice article by Jose Crespo, where the author stresses that the future of programming revolves around the application of math concepts such as Functor, Monads, Folds, etc. In addition, he argues that familiarity with C/C++ is essential in this modern AI age. The author goes through a toy example that uses […]

Continue Reading

The Hy Programming Language

Written by on January 28, 2024 in Hy Language, LISP, Python with 0 Comments
The Hy Programming Language

In an earlier article I had explained how to execute Python code from within Common Lisp using “CLPython” package. In contrast to that approach, “Hy” is a Lisp-style language (not compatible with Common Lisp) that is embedded in Python and hence provides seamless interoperability with Python code. Installation is straightforward (it is usually a good idea to […]

Continue Reading

Generating Polynomials – Part 2

Written by on December 10, 2023 in LISP, Programming with 0 Comments
Generating Polynomials – Part 2

In my last article, I showed how we can use Prolog to generate univariate Polynomials. After I finished that article, I wanted to try Lisp for the same task. Prolog is “declarative”, whereas Lisp is primarily “functional” (it supports OOP as well), so the implementation will exhibit that difference. Here is the primary function generate-polynomial […]

Continue Reading

Simulating Python Zip in Lisp

Written by on September 4, 2023 in LISP, Programming, Python with 1 Comment
Simulating Python Zip in Lisp

The zip() function in Python is a convenient mechanism for iterating over multiple “iterables” in parallel. Looping over lists is a common scenario. Here is the output generated by the above code: Common Lisp does not have such a feature built into the language or as part of the standard library. Of course, we have […]

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

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

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

Top