[OT] MultiByteFileStream (was: Re: [Vm-dev] VM Maker: CMakeVMMaker-StasenkoIgor.104.mcz)

Levente Uzonyi leves at elte.hu
Tue May 17 11:50:05 UTC 2011


On Tue, 17 May 2011, Igor Stasenko wrote:

>
> On 16 May 2011 20:21, Levente Uzonyi <leves at elte.hu> wrote:
>>
>> On Mon, 16 May 2011, squeak-dev-noreply at lists.squeakfoundation.org wrote:
>>
>>>
>>> Igor Stasenko uploaded a new version of CMakeVMMaker to project VM Maker:
>>> http://www.squeaksource.com/VMMaker/CMakeVMMaker-StasenkoIgor.104.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: CMakeVMMaker-StasenkoIgor.104
>>> Author: StasenkoIgor
>>> Time: 16 May 2011, 10:33:56 am
>>> UUID: 68959e6f-18b1-304c-a3de-2b84a1f2c93b
>>> Ancestors: CMakeVMMaker-IgorStasenko.103
>>>
>>> workaround the MultiByteCrapStream, which converting line endings twice on
>>> windows.
>>
>> It's not crap, just broken.
>
> Well, i don't know better wording for seeing the mess in this
> implementation. It contains too much bells and whistles and therefore
> its very easy to break it.

Tests can greatly decrease the chance of breaking it.

>
> I don't understand why it patching the UTF8Converter and turns it into
> line-ending converter..
> as to me, UTF8Converter have nothing to do with line ends, and such
> abuse of text converters should be strictly prohibited.

The reason is performance, and the implementation is transparent. It also 
simplifies MultiByteFileStream.

>
>> I'll integrate the fix for it into Squeak soon.
>> If you're impatient you can fix it yourself, or use something else.
>>
>
> Well, i can't use something else, because its VMMaker which using
> CrLfFileStream for producing source files output.
> Maybe it worth to just use FileStream in binary mode and deal with
> line ends internally, to not leave chance for
> clever text streams to interfere.

CrLfFileStream is not used, since Squeak 3.x. References to it should be 
rewritten to use FileStream instead. Using binary mode to work around a 
bug is bad idea, fixing the bug is the way to go.

> But then again, it means time, which i haven't because i was focused
> on completely different problem.

I'll upload my fix to Squeak Trunk this week. Applying the changes to 
Pharo probably won't work out of the box, because IIRC some issues were 
solved differently in the past.


Levente

>
> -- 
> Best regards,
> Igor Stasenko AKA sig.
>


More information about the Vm-dev mailing list