guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guile can't find a chinese named file


From: Linas Vepstas
Subject: Re: guile can't find a chinese named file
Date: Tue, 14 Feb 2017 14:10:19 -0600

On Mon, Jan 30, 2017 at 1:27 PM, David Kastrup <address@hidden> wrote:
> Marko Rauhamaa <address@hidden> writes:
>> David Kastrup <address@hidden>:
>>> Marko Rauhamaa <address@hidden> writes:
>>>> Guile's mistake was to move to Unicode strings in the operating system
>>>> interface.
>>>
>>> Emacs uses an UTF-8 based encoding internally [...]
>>
>> C uses 8-bit characters. That is a model worth emulating.
>
> That's Guile-1.8.  Guile-2 uses either Latin-1 or UCS-32 in its string
> internals, either Latin-1 or UTF-8 in its string API, and UTF-8 in its
> string port internals.

Which seems to be a bad decision. I've got strings, 10MBytes long, holding
chinese in UTF8, and guile converts these internally, to UCS-32 which is a
complete and total waste of CPU time. WTF.  It then has to  convert them
back to UTF8 before passing them to my C++ code that actually does stuff
with them.

All I get for this design decision is poor performance, and endless
complaints from boehm-gc:
"GC Warning: Repeated allocation of very large block (appr. size 3944448):
        May lead to memory leak and poor performance."

Its just not very friendly.

Although I am complaining, I do have vague plans on submitting patches to
fix this; I've read through the guile source, and can see where the code
does this.  Reading the code, it's written in a
late-night-not-thinking-clearly coding style, and should be relatively easy
to fix.

--linas


reply via email to

[Prev in Thread] Current Thread [Next in Thread]