texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] TeXmacs & Webassembly


From: Massimiliano Gubinelli
Subject: Re: [Texmacs-dev] TeXmacs & Webassembly
Date: Sat, 29 Jan 2022 10:54:06 +0100

Hi Joris,

> On 28. Jan 2022, at 23:58, TeXmacs <texmacs@lix.polytechnique.fr> wrote:
> 
> Dear Max,
> 
> On Fri, Jan 28, 2022 at 06:36:26PM +0100, TeXmacs wrote:
>> Thanks, that is already far more usable indeed.  Next issues:
>>  - I noted that the keyboard shortcuts are somewhat problematic,
>>    since various modifier keys don't work.
>>    Also, ^ did not work on a French keyboard.
>>  - Similarly the contextual menus via the mouse don't work.
>>  - The mouse pointer changes in weird ways.

Yes. I still have to understand how the integration with the browser works. So 
far I haven't done anything particular for keyboard handling.


>>  - The status bar is vertically expanded on a large screen.

Noted.

>>  - Starting a plug-in makes TeXmacs freeze.  Maybe there is a way
>>    to somehow avoid or escape freezes of this kind.
> 

I'm unsure how to deal with plugins. I do not think we can support any, the 
sandboxing prevents to run apps on the machine. As first step I will just make 
sure that no plugin can be activated.

> A few more points:
> 
>  - I don't know how file handling works exactly, but it would be nice if
>    we were at least able to access files on the web.  Currently, we use
>    wget for doing that and this does not seem to work with WebAssembly.
>    But they probably provide some better way to do this?
> 

This should be possible but with restriction. As far as I understand a web page 
can only request pages from the same domain. This has to be investigated better.

Apriori webassmebly in the browser do not have access to any filesystem, for 
C/C++ programs there is a library layer which emulate standard Posix calls and 
a virtual in memory filesystem in which one can load data at startup and use it 
for read/write during program execution, but the written data cannot be 
persisted in any way automatically. One need to provide some mechanism. The 
browser allows webassembly programs to access to a database which, as far as I 
understand, can be persisted across section, so we will have to use it for 
preferences, etc... 

>  - Updating the extents of the window seems a bit buggy.
> 

Yes, I have some problems with redrawing which I do not undestand. In general 
how windowing is implemented in the Qt/Wasm backend is a bit unclear, some more 
study is needed on my side.

>  - For changing some user preferences, we have to reboot TeXmacs.
>    But this destroys the file system.  Is there some way to keep files
>    that we created for a subsequent run?  Also useful for caching purposes
>    by the way and the compilation process itself...
> 

As I said. I think there is a way to persist data in the browser, as with other 
intergation matters should be investigated more, but certainly is a mechanism 
different from the usual Unix filesystem support. Maybe we would need a TMFS 
layer which handle the appropriate conversion. 

>  - I get messages like "This webpage is using significant memory.
>    Closing it may improve the responsiveness of your Mac".
> 

Currently we are using too much resources, the program is quite large and has 
too much data (~70 MB of assembly and ~90MB of data) we would need to select 
the data we really want to download right away and maybe lazily download from a 
server the rest when requested. Also currently at startup I force the loading 
of all the lazy modules for debugging purpose, I will disable this so that we 
can start up faster.

Note also that we run in the main  browser thread for that tab so we can 
potentially block the thread, ideally we should split TeXmacs in at least two 
threads, a background one which do all our computations and a main thread which 
interacts with the browser and the plugins. It would be nice if the requests 
for resources we make (web pages, file loads) could be make asyncronous so that 
we do not block. I'm not sure it is like this right now.

>  - I also tested with Chrome and it works.
> 

Good to hear.


> Best wishes, --Joris
> 
> _______________________________________________
> Texmacs-dev mailing list
> Texmacs-dev@gnu.org
> https://lists.gnu.org/mailman/listinfo/texmacs-dev




reply via email to

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