What's the status of the new scheme on TeXmacs? Also, what is the status of the new release?

Sorry if this has already been posted elsewhere, but I was curious about what is currently being worked, as the current release of TeXmacs is almost a year old. Is there a new version planned soon? If so, what new features can we look forward to?

Additionally, are there still discussions about alternative scheme implementations to Guile 1.8 (e.g. Guile 3, Chez Scheme, S7, etc.)? What I’m finding seems to be quite old, including the guile3 branch that’s available on github. Any updates on that front?

Thanks!

One of the features that Joris seems to have been working on is speech input. It’s been a bit quiet since then, so there’s no indication when this may appear.

For other Scheme implementations, have a look at Mogan, a fork of TeXmacs (https://codeberg.org/XmacsLabs/mogan). It is using S7 Scheme.

1 Like

There are still discussions but no resolution as far as I understand. I think it is important to resolve this and get TeXmacs into the official repositories of Debian exempli gratia but seen from my point of view which is outside the development team there is no progress there.

Thanks @jeroen , I have tried Mogan, looks like an interesting project. To be honest, I was hoping that TeXmacs would go in a different direction, e.g. Guile 3 or Chez, instead of S7. Is S7 even active anymore?
The main website seems to be dead.

1 Like

There is some support for Guile 3 already. @mgubi has done a lot of work on this, see his notes here.

As far as I understand, TeXmacs uses very little features from the Scheme implementation, so being actively developed may not be that important to the project.

Portability is what is holding back Guile 3. There seem to be problems compiling it on Windows, which is an important use case for TeXmacs.

1 Like

If we ever do another Jolly Coder meeting this is a discussion topic in my opinion. Also I think educative for programming concepts.

2 Likes

The other problem I have with Mogan is that some of the text on the UI looks uncomfortably small depending on which computer and/or monitor I use. I think it might have to do with High DPI settings or something like that, but I have not been able to fix it. (third row of text in the image below)

Screenshot%202023-03-22%20133409

S7 is actively developed and works perfectly, as far as I can see. It can even compile to wasm while this is not possible with the other schemes. Chez is difficult to embed nicely since TeXmacs retains a lot of Scheme values and the garbage collector move them around creating havoc. I’ve started a port but then realized the problem. This would need more serious investigation. Also: it is not clear that Chez will be actually faster than S7 or Guile 1.8 due to the way we use Scheme: we inject a lot of code which has to be compiled or interpreted online, so any compiler will be slower than a good interpreter (this is the same problem you have in browsers with Javascript, you cannot compile everything unless you want to be very slow in everything which is short lived). Guile 3 is actually used in interpreted mode in TeXmacs, and the only advantage it has wrt. to Guile 2 is that the interpreted run as fast as in Guile1.8… So for the moment the only way out is to embed in TeXmacs Guile 1.8 or let S7 do its fine job. The scheme in TeXmacs is quite peculiar…

2 Likes

Do you have a link to the current S7 source code and documentation?

https://ccrma.stanford.edu/software/snd/snd/s7.html
https://cm-gitlab.stanford.edu/bil/s7

I looked for this earlier today and the site was down for me as well, but it’s up again.

1 Like

Oh cool! It was down for a couple of days for me, so I just assumed it is a dead project.

Thanks for the link.

I remember you talking about a bug when using S7 in TeXmacs. Do I remember well?

There is a small patch to be applied to the source code in order to remove a slowness problem. As far as I can see the patch does not generates bugs, but the main developer didn’t wanted to include it in the main release, which is fine for us. If I find that the patch is not safe we will find another solution, but for the moment I think we can live with it. It is not related to a bug, just that the way TeXmacs use scheme does not play well with some implementation details of S7.

I’ve updated the wip_s7 branch of TeXmacs on github a couple of months ago, so one can use it instead of Mogan, if one does not like the latter.

1 Like

Thanks for the explanation.
If I were @vdhoeven :wink:

  • either include the S7 or the Guile 1.8 code with TeXmacs
  • put back into Debian and Ubuntu repositories

He is already working (well Lisa is :)) towards integrating Guile 1.8, at least for Android, as far as I can see: https://github.com/lizabelos/texmacs-android

2 Likes

Just curious: Would it be a major undertaking to make TeXmacs take advantage of compiled scheme rather than interpreted?

I’m thinking of emacs as an example. It was strictly interpreted lisp, but they added native compilation (jit) and that made things considerably faster. The editor is able to take advantage of pre-compiled functions (some are still interpreted). Although from what I understand, a much larger portion of emacs is written in lisp as opposed to TeXmacs which is mostly C++. Is that the source of the difficulty?

The real problem is that scheme implementations are not very fast to compile. TeXmacs C++ code create scheme snippets on the fly essentially every time there is some input (e.g. from the keyboard). These snippets have to be parsed and eventually compiled before running, but this is really not worthwhile since they will only run once. Some caching is done but you cannot cache much because many things can change. So at the end compilation does not buy much in general. Again: this is the same problem you have in browsers. If you want JIT you just need a very rough but fast JIT compiler and this is not what usually the scheme implementation do. It should be said that we do not have performance problems from Scheme. Actually TeXmacs is quite usable even when compiled to web assembly. So I do not see reason to spend much energy in this direction, we have more interesting things to develop. And S7 is a very fast and daily maintained scheme, see the benchmarks here: https://ecraven.github.io/r7rs-benchmarks/ Also: S7 compiled to webassembly, while a more complex scheme (e.g. Chez or Guile) would no the easy to port, I guess.

1 Like

For ChezScheme, the problem is that for other arch, we have to spare time to make it work.

GNU TeXmacs on S7 Scheme works on loongarch. Recently, I bought a PC using Loongarch CPU (3A5000) and just tested Mogan on Loongarch, it works fine.

Please submit a bug report to Github/Gitee/Codeburg.

Github is blocking the Russian coders, that’s why mogan is hosted on the above three platforms.