Re: Migrating from UFFI to CFFI

Victor <[email protected]> Thu, 10 Oct 2013 11:51:20 +0300
Newsgroups gmane.lisp.clsql.general
Message-ID <op.w4qdjuqb4lizsz@vanyakin-nb>
On Wed, 09 Oct 2013 17:57:44 +0300, Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> wrote:

> On Oct 9, 2013, at 6:49 AM, Victor <[email protected]> wrote:
>>> However, I still believe it would be preferable to avoid piling up
>>> redundand compatibility layers and replace UFFI with CFFI completely.
>>>
>>> Are there any such plans or ongoing projects?
>
> I am not aware of any. I created UFFI for CLSQL.

Hi Kevin,

thanks a lot for your great work!

> If there was an issue with the FFI for CLSQL that I needed to fix, I'd work on modifying UFFI.

I duplicate my response to the mailing list because others might
be interested in the problems I had.

There were basically two issues with UFFI/CLSQL that I had.

The first problem is that SBCL crashed to ldb prompt unless the
compiled UFFI binaries from the
.cache/commmon-lisp/sbcl-1.1.12/... directory were removed before
running sbcl with software that depends on CLSQL.  This problem
somehow got solved by now. I suspect that it was caused by leftover
binaries generated on previous versions of SBCL.

The second problem is that on ClozureCL v1.9 CLSQL-SQLITE3 corrupts
unicode strings when they are read and stored to the database.

Setting uffi:*default-foreign-encoding* to :utf-8 solves the "read"
part but strings are still corrupted when stored to the database.

Since the first problem is now gone (at least I hope so) the only
remaining problem is with proper foreign encodings that will not
corrupt UTF-8 strings.

Thanks,
Victor