lua-users home
lua-l archive

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


Thank you for the work, it looks quite useful.

> local P = {}
> P[1] = winapi.spawn 'lua slow.lua'
> P[1] = winapi.spawn 'lua slow.lua'
> winapi.wait_for_processes(P,true)
>
> (This was only slightly slower than running one, so clearly my i3 is
> effectively a two-processor machine)

Even with single processor computers it may take the same time,
because there is only one process handle in the P table :-)


> One criticism is that it's just ASCII, but I wanted to ask advice
> about the best way to proceed. One approach is to work internally with
> widechar strings, but assume that all Lua strings are UTF-8. If this
> seems the best way forward, I'm happy to implement it.

I very much like the idea of using UTF-8 inside Lua strings, and
wchar_t string on the C side.
This is how my latest programs deal with file names on Windows. But it
is also difficult to force the usage of UTF-8 throughout the
application.
For example, LuaFilesystem module and standard io.open function expect
ANSI encoding.
A good trade-off rule would be: if a string is a valid UTF-8 string,
assume it is UTF-8; otherwise assume it is encoded in the current
locale.

Patrick Rapin