Re: Guile 3 and wip-elisp/Emacs

2021-10-20 Thread Christopher Allan Webber
Christine Lemmer-Webber  writes:

> Ludovic Courtès  writes:
>
>> Hello!
>>
>> Christine Lemmer-Webber  skribis:
>>
>>> I've pushed this as origin/wip-elisp-rebased.  I actually rebased it
>>> again, making some naming adjustments for myself and a couple of
>>> adjustments having talked to Robin.
>>>
>>> If nobody objects, I'd like to merge this into main.  Maintainers, if
>>> you have any objections, speak now or forever hold these commits!
>>
>> I haven’t looked at the branch, but I think it’s great to see it live
>> and it’s great if it can be merged!
>
> I just compiled the rebased version and will be playing with it little
> bits over the next few days to make sure it's reasonably good.

Well, *something* isn't ready to go:

scheme@(guile-user)> (+ 1 2)
$3 = 3
scheme@(guile-user)> ,L elisp
Happy hacking with Emacs Lisp!  To switch back, type `,L scheme'.
elisp@(guile-user)> (+ 1 2)
$4 = 3
elisp@(guile-user)> (cons 'foo '())
$25 = (foo)
elisp@(guile-user) [10]> 

Hoo, 10 levels deep!

>> Some things to pay attention to before merging to ‘main’, since it
>> corresponds to the current 3.0 stable branch:
>>
>>   • Make sure no backward incompatibilities are introduced in
>> preexisting modules;
>>
>>   • Make sure the ABI of libguile-3.0.so and that of public modules
>> is unchanged, or is changed compatibly;
>
> There are, I think, two commits that could use review, but I am NOT the
> right person to do this.
>
>   4e96211eb666751b8666beb918bf3108aa1c725b intern arbitrary constants
>   433fc448ddb018767906f8808203c9668c68cd83 multiple obarrays



Re: Guile 3 and wip-elisp/Emacs

2021-10-20 Thread Robin Templeton
"Dr. Arne Babenhauserheide"  writes:

> The workload to finish this is considerable, though: IIRC You’ll need to
> solve some deeper problems that prevent Guile Emacs from using
> byte-compiled files (that’s why it currently has a very high startup
> time).

To clarify, Guile-Emacs intentionally ditches the existing Emacs
bytecode compiler entirely (though it'd probably be possible to emulate
the bytecode interpreter to allow loading old '.elc' files). I haven't
followed Guile development closely enough to know whether these are
practical solutions, but my main ideas for improving startup speed were
to either add some form of AOT compilation to Guile, or to rely on
cached JIT-compiled code. IIRC Emacs now uses a portable dumper (rather
than the old system which dumped a running Emacs instance to an
executable), which seems analogous to the latter approach.

> That said, there is a guile-emacs package in guix, and Guile 3.0.7 is
> much faster than Guile 2.
>
> (please someone correct me if I’m wrong!)
>
> Best wishes,
> Arne

Regards,
Robin

-- 
 But speaking of programming, I was dreaming that I had some
coding problem and suddenly robin walked by, so I asked what the common
lisp way of solving it would be.




Re: Guile 3 and wip-elisp/Emacs

2021-10-20 Thread Robin Templeton
"Gregg Sangster"  writes:

> Hello Guile Hackers,
>
> I've rebased the wip-elisp branch on top of commit
> 449f50dd84a081aea16ef678e32bf37abe429ff6 (git describe:
> v3.0.4-64-g33232cb5c4).  It's published here:
>
> https://git.sr.ht/~g20r/guile

This is wonderful, thank you! (IIUC, Christine and Ricardo wrote
ChangeLog entries and did some rebasing, but I don't think it's been
fully rebased for some time, so this is a big step forward!)

N.B. The commit messages need minor rewording, so this will require
trivial changes before merging even if's otherwise perfect.

> There are two additional failed tests which appear to be new tests
> added since the last work on the wip-elisp branch.  Also, ./configure
> requires the --disable-jit option as the build fails otherwise.  I
> have not yet investigated any of these issues.

Christine noted some "questionable" compiler changes, where my changes
might conflict with Andy's, so this isn't surprising but it's useful to
have potential confirmation. The elisp changes were fairly simple, so it
shouldn't be too difficult to fix, if that is indeed the problem.

> I don't have much experience with Guile itself or the Guile codebase.
> The next commit has a conflict I was not able to resolve: that's why
> it's not rebased all the way up to the tip of main.  My next tasks are
> to get the current Guile Emacs running on this version of Guile
> followed by fixing the JIT build failure, rebasing this to the tip of
> main and rebasing Guile Emacs on a more recent Emacs (I believe it is
> currently v24.something).

Rebasing onto a somewhat newer Emacs should be pretty straightforword,
and certainly worthwhile on its on. However, rebasing onto emacs master
is a major task that'll probably take several person-months of fairly
tedious work...

> My question is if this is worthwhile work?  I don't have much time to
> spend on it but am happy to keep hacking away if there's still
> upstream interest.

>From my perspective, it certainly is! There is plenty of interest from
the Guile side AFAICT; the Emacs maintainers have been (understandably)
skeptical about the project in general, but if we can make it correct
*and* fast I think they'll be more interested, especially if Guile 3's
JIT outperforms emacs native-comp in practice.

Thanks,
Robin

-- 
 "Digital Imperialism: The Highest Stage of Computing Capitalism"
   -- the Lenin of Emacs




Re: Guile 3 and wip-elisp/Emacs

2021-10-20 Thread Gregg Sangster
Hi Ricardo,

On Thursday, October 14, 2021 13:34 EDT, Ricardo Wurmus  
wrote:
> I also had he same experience.  Guile Emacs would segfault very
> quickly.  That’s why I started a rebase on top of the nearest
> Emacs release, which is 25.2.  I had to abandon the rebase,
> because after about 45 commits it became too difficult for me to
> understand what exactly I had to do to resolve all these
> conflicts.  There are about 112 commits left to apply.
>
> If you think you could benefit from the work I already did I could
> upload the full git repo as it is, mid-rebase and all.

If you'd like to upload it, I think it would be a great reference.

I've taken the strategy of rebasing forwards along the master branch a few 
commits at a time.  So far I'm about a thousand commits ahead.  It's time 
consuming but the conflicts to resolve are smaller.  There are just more of 
them. :)

--
Gregg




Re: Guile 3 and wip-elisp/Emacs

2021-10-20 Thread Gregg Sangster
Hi Christine,

Thanks for looking at this!  I just noticed that my email address as the 
committer on 1ba3d7854cac0524f80d3c6113da770505c9eda9 is incorrect.  Before 
merging, can you please change it to gr...@thesangsters.ca?

On Tuesday, October 19, 2021 17:59 EDT, Christine Lemmer-Webber 
 wrote:

> I've pushed this as origin/wip-elisp-rebased.  I actually rebased it
> again, making some naming adjustments for myself and a couple of
> adjustments having talked to Robin.
>
> If nobody objects, I'd like to merge this into main.  Maintainers, if
> you have any objections, speak now or forever hold these commits!
>
> Christine Lemmer-Webber  writes:
>
> > This is awesome.
> >
> > So, what's stopping us from merging this into guile main now before it
> > bitrots again? :)
> >
> > "Gregg Sangster"  writes:
> >
> >> Hi Ricardo,
> >>
> >> Thanks,  your changes fixed a couple of the test errors I saw.
> >>
> >> On Monday, September 13, 2021 06:56 EDT, Ricardo Wurmus 
> >>  wrote:
> >>
> >>>
> >>> Hi Gregg,
> >>>
> >>> > I've rebased the wip-elisp branch on top of commit
> >>> > 449f50dd84a081aea16ef678e32bf37abe429ff6 (git describe:
> >>> > v3.0.4-64-g33232cb5c4).  It's published here:
> >>> >
> >>> > https://git.sr.ht/~g20r/guile
> >>>
> >>> FWIW I had also rebased wip-elisp in 2020:
> >>>
> >>> 
> >>> https://git.elephly.net/?p=software/guile.git;a=shortlog;h=refs/heads/wip-elisp
> >>>
> >>> --
> >>> Ricardo
> >>>
>