Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There shall be only one! #31

Open
fare opened this issue Apr 2, 2016 · 43 comments
Open

There shall be only one! #31

fare opened this issue Apr 2, 2016 · 43 comments

Comments

@fare
Copy link
Collaborator

fare commented Apr 2, 2016

Is there any reason not to just replace optima with trivia, then? (Assuming the optima author is willing.)

@guicho271828
Copy link
Owner

I partially agree, however @m2ym doesnt seem willing it.
Optima is stable but the development has basically stopped. there are tons of issues (well, feature requests actually) that arent resolved yet.

https://github.com/m2ym/optima/issues

@guicho271828
Copy link
Owner

to do this, I might have to send a pullreq to the projects using optima to migrate to trivia.
is it worth it?

@fare
Copy link
Collaborator Author

fare commented May 18, 2016

grep optima ~/quicklisp/dists/quicklisp/systems.txt | wc -l
33

@guicho271828
Copy link
Owner

a kind of experiment. how the authors react?

@guicho271828
Copy link
Owner

it looks like it was a haste move. it has some error on clisp.

@guicho271828
Copy link
Owner

I should at least wait for the next release.

@m2ym
Copy link
Collaborator

m2ym commented May 20, 2016

I don't have much time to work on CL recently, and I am willing to integrate optima and trivia. What I can do, for example, is

  1. add a link to trivia in README.md
  2. make optima package just an alias for trivia package

@guicho271828 How do you think if we make an organization and a repository like "optima/optima" or "trivia/trivia" (please choose which you prefer) and work on the integration, as you are an author and a core developer?

@fare
Copy link
Collaborator Author

fare commented May 21, 2016

Wow. Congratulations to the two of you for advancing CL pattern-matching!

@m2ym congratulations for having created optima with such talent, then for retiring it with such grace after it did its thing.

@guicho271828 congratulations for furthering the state of CL pattern-matching.

Regarding names: do we want either trivia or optima to be the final name? Wouldn't, e.g. pattern-matching or match be a better name for THE library? I see that the name isn't claimed in cliki, and that http://cliki.net/pattern%20matching doesn't even list trivia yet. It would be nice to pick "THE" name before we ask everyone to switch over. And if possible to make it a stable meaningful name.

Whichever the name ends up being, it could be the name of the package, with trivia and/or optima as nicknames. Or trivia and/or optima could be separate packages that use uiop:define-package to :use-reexport the contents of "THE" real package.

@guicho271828
Copy link
Owner

If I merge them seriously, I first have to fix the problem of trivia on clisp and abcl. I havent seriously treated those implementations other than sbcl and ccl.

@m2ym
Copy link
Collaborator

m2ym commented May 21, 2016

@fare If we don't concern about name collision, match or pattern-matching would be nice.

@guicho271828 As I remember, optima is tested on sbcl, ccl, acl, abcl, clisp and ecl. I don't have much care about breaking backward compatibility on minor implementations, but I think It will be great if trivia can work on such implementations.

@guicho271828
Copy link
Owner

I spent a day for fixing bugs related to those obscure implementations. now it works.

@m2ym
Copy link
Collaborator

m2ym commented May 25, 2016

@guicho271828 Great! As the first step, I will put a link to trivia on optima's README.

@fare
Copy link
Collaborator Author

fare commented Jun 11, 2016

@guicho271828 what is the status of trivia with respect to readiness as a replacement for optima?

Do you have parity with all documented optima features?
Did you integrate all of optima's test cases in your test suite?
Do you run on all the platforms that optima officially supports?

@guicho271828
Copy link
Owner

  • Do you run on all the platforms that optima officially supports?
    • it runs on ECL, ABCL, CMUCL, CLISP, SBCL, CCL.
  • Do you have parity with all documented optima features?
    • mostly
    • handling of property pattern is fixed (in my opiniton).
      • the first argument to assoc, property patterns is evaluated, so the constants should be quoted
      • handling of improper alist/plist should signal error depending on the optimization setting (impl dependent, e.g. CCL signals type-error, SBCL does not care, but only under (safety 3) etc.)
    • trivia separates fail from the main package
    • trivia does not have when and unless, a rather obscure optima featrue
    • these differences are described in t/suite.lisp
  • Did you integrate all of optima's test cases in your test suite?
    • same as above

@fare
Copy link
Collaborator Author

fare commented Jun 12, 2016

Congrats for the successes.

I don't know if any current code uses it, but I remember using when or something equivalent in the days of fare-matcher. Sometimes it's important to guard against arbitrary predicates.

@guicho271828
Copy link
Owner

the odd thing re: when/unless is they are infix operators, which are hard to implement in trivia.
Actually guard in optima is functionally equivalent to when, so I don't think I will ever support them.

@fare
Copy link
Collaborator Author

fare commented Jun 13, 2016

Right, as long as the feature is available and documented that's fine.

@sionescu
Copy link

Any news on this ?

@guicho271828
Copy link
Owner

I don't know what is necessary on this...

@mdbergmann
Copy link
Contributor

the odd thing re: when/unless is they are infix operators, which are hard to implement in trivia.
Actually guard in optima is functionally equivalent to when, so I don't think I will ever support them.

What are the options for merging the two regarding this?

@guicho271828
Copy link
Owner

guicho271828 commented Jul 27, 2020

the internal designs are very different between the two and I don't think marching is possible. I don't think that infix when is an absolutely necessary feature either. Furthermore, the original author of Optima is no longer active in the common lisp community. Optima is not broken but is sort of in the dead end.

@mdbergmann
Copy link
Contributor

Then maybe it's best to let it be and have 'optima' and 'trivia', separately.
There would probably have been some synergies when both would merge. But if the merging costs are too high?

Projects that want to switch from optima to trivia can do so any time.
If trivia now supports the common CL implementations this be more or less a drop-in replacement.

@guicho271828
Copy link
Owner

If trivia now supports the common CL implementations this be more or less a drop-in replacement.

It is already so for a long time. I don't think anyone new will use optima now

@sionescu
Copy link

The problem is that there are lots of libraries that still use it, it's unmaintained and has lots of open bugs. It depends on eos which is also deprecated and doesn't compile on SBCL HEAD, and if I wanted to send a PR to switch Optima to Fiveam there would be nobody to merge it.

@fare
Copy link
Collaborator Author

fare commented Jul 27, 2020

$ grep optima ~/quicklisp/dists/quicklisp/systems.txt | wc -l
39

This is worse than when I did that in 2016 above. For the migration to happen, someone needs to send patches to all QL project users. And that's not me, I'm not an active CLer anymore.

@vindarel
Copy link

btw:

grep trivia ~/quicklisp/dists/quicklisp/systems.txt | wc -l
508

@mdbergmann
Copy link
Contributor

trivia does not have when and unless, a rather obscure optima featrue

So the imcompatibility is mainly due to this? when and unless not available as guards in trivia?

@fare
Copy link
Collaborator Author

fare commented Jul 28, 2020

I realized that, apart from the compatibility package fare-quasiquote-optima, three of the legacy optima-using contenders were mine: exscribe, inferior-shell, quux-hunchentoot. I did my part to make them use trivia instead, and pushed the results on github, but the real upstream is gitlab.common-lisp.net, to which I seem to have lost access recently with the latest g.c-l.n update.

3 down, a few to go.

@guicho271828
Copy link
Owner

@vindarel that is not quite accurate.

@guicho271828
Copy link
Owner

trivia does not have when and unless, a rather obscure optima featrue

So the imcompatibility is mainly due to this? when and unless not available as guards in trivia?

yes and I dont think it is one of the core features, hopefully no one is using it...

@sionescu
Copy link

@guicho271828 Xach said he could remove Optima from Quicklisp if Trivia could provide an optima.asd which is backwards-compatible. Then we can deal with the libraries that use when/unless.

@guicho271828
Copy link
Owner

@sionescu will consider that this weekend

@guicho271828
Copy link
Owner

Did my share for the dependencies. Another 3 down. None were breaking due to the change (tested locally).

guicho271828/cl-rrt@00c7ab2
guicho271828/inner-conditional@9d26263
guicho271828/eazy-process@1a7013b

#115 provides optima.asd and optima.ppcre.asd where optima.asd provides both optima and optima.extra packages.
I am testing the remaining libraries with my local copy.
These libs are the ones directly depending on optima and are beyond my direct control.
99c553c

@guicho271828
Copy link
Owner

Among the libraries listed in 99c553c , these libraries failed. I believe some are related to fare-quasiquote:

(("varjo.import" . #<SB-PCL:CLASS-NOT-FOUND-ERROR QUASIQUOTE-VECTOR-PATTERN {10016FC4C3}>)
 ("transparent-wrap" . #<SB-PCL:CLASS-NOT-FOUND-ERROR QUASIQUOTE-VECTOR-PATTERN {10019D85C3}>)
 ("inferior-shell" . #<SB-PCL:CLASS-NOT-FOUND-ERROR QUASIQUOTE-VECTOR-PATTERN {10019D85E3}>)
 ("fare-quasiquote-optima" . #<SB-PCL:CLASS-NOT-FOUND-ERROR QUASIQUOTE-VECTOR-PATTERN {10019D8603}>)
 ("erlang-term-optima" . #<PACKAGE-DOES-NOT-EXIST "The name ~S does not designate any package." {10019D8623}>)
 ("cl-vhdl-tests" . #<SB-PCL:CLASS-NOT-FOUND-ERROR QUASIQUOTE-VECTOR-PATTERN {10019D8663}>)
 ("cl-quil" . #<CFFI:LOAD-FOREIGN-LIBRARY-ERROR "Unable to load foreign library (~A).~%  ~A" {10019D8683}>))

@guicho271828
Copy link
Owner

(note: test script in https://github.com/guicho271828/trivia/blob/optima-compat/optima-compat/test.lisp )

So I guess @fare have the one last nail to drive into it

@guicho271828
Copy link
Owner

From optima's documentation, when/unless looks like this:

(match list ((list x) when (oddp x) x))
(match list ((list x) unless (evenp x) x))

In trivia this would be just parsed as (list x) pattern plus a body consisting of an undefined variable when, unused test (oddp x) and a reference x, thus it does not result in the compile error (SBCL may throw warnings though).

@guicho271828
Copy link
Owner

in the libraries tested above, I did not see the warnings. Therefore, when/unless are probably never used.

@guicho271828
Copy link
Owner

With this commit fare/fare-quasiquote#1 which redirects fare-quasiquote-optima to triva.quasiquote,
the failed libs reduced to two; likely cl-quil would still continue to work if I manage to find the foreign lib.

(("erlang-term-optima" . #<PACKAGE-DOES-NOT-EXIST "The name ~S does not designate any package." {101D8A4763}>)
 ("cl-quil" . #<CFFI:LOAD-FOREIGN-LIBRARY-ERROR "Unable to load foreign library (~A).~%  ~A" {10016698B3}>)) 

@fare
Copy link
Collaborator Author

fare commented Aug 1, 2020

Note that there is already a erlang-term-trivia in cl-erlang-term next to erlang-term-optima, so maybe just make it a redirection, or remove it?

@guicho271828
Copy link
Owner

Some library may be depending on cl-erlang-optima, but if there are none it can be removed. Is it your library?

@guicho271828
Copy link
Owner

I forgot that it was me who implemented the trivia port...

@fare
Copy link
Collaborator Author

fare commented Aug 2, 2020

The author of https://github.com/flambard/cl-erlang-term is @flambard.

@guicho271828
Copy link
Owner

pointing @quicklisp here (hope this notifies him)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants