Bug 2098398 - Review Request: picolisp - a pragmatic programming language , tiny footprint LISP interpreter [NEEDINFO]
Summary: Review Request: picolisp - a pragmatic programming language , tiny footprint ...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Benson Muite
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: FE-NEEDSPONSOR
TreeView+ depends on / blocked
 
Reported: 2022-06-18 21:56 UTC by Jason Vas Dias
Modified: 2023-12-07 16:47 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:
benson_muite: fedora-review?
jason.vas.dias: needinfo?


Attachments (Terms of Use)
latest source rpm building under FC-38 now (1.05 MB, application/x-rpm)
2023-12-06 19:19 UTC, Jason Vas Dias
no flags Details
RPM spec file for picolisp, as in SRPM (6.14 KB, text/plain)
2023-12-06 19:35 UTC, Jason Vas Dias
no flags Details
generated base.ll from an FC-38 x86_64, which is all that is necessary to build bootstrap ../bin/picolisp (329.32 KB, application/x-xz)
2023-12-06 22:19 UTC, Jason Vas Dias
no flags Details

Description Jason Vas Dias 2022-06-18 21:56:44 UTC
Spec URL: https://raw.githubusercontent.com/JVDptt/picolisp-rpm-spec/main/picolisp.spec
SRPM URL: https://github.com/JVDptt/picolisp-rpm-spec/blob/main/picolisp-22.6.17-1.fc36.src.rpm
Description:  picolisp - a pragmatic programming language , tiny footprint LISP interpreter - see: https://picolisp.com
Fedora Account System Username:jvd66

Comment 1 Jason Vas Dias 2022-06-18 22:16:14 UTC
Please consider including Alexander Burger's excellent picolisp 
small footprint LISP interpreter: https://picolisp.com -
into Fedora.

I have written a pure "Shared-Library-Only" build of picolisp,
which I use in both a working bash-builtin and in an Apache Module -
I'd like to make these open source, available to any EPEL / Fedora
or Ubuntu user, but picolisp has not as yet been delivered to
Red Hat RPM users to my knowledge. It IS in Ubuntu / Debian
and Android Termux.

It is very powerful, succinct, clear, well documented - see:

   http://rosettacode.org/wiki/Category:PicoLisp

Do ask the author if it is OK : abu

I think it would be fine with him, he already
gave permission to Debian / Ubuntu ; I doubt
he'd want to be bothered with Fedora Package Management, though -

I am happy to maintain the PicoLisp package for Fedora / EPEL, 
keeping it up to date with Alex's latest release once a week or so.
                          
PicoLisp has a "less is more" programming philosophy:                                                                                                                                                                                                                                                  "Perfection is attained                                                                                                                                                                                                                                                               
 not when there is nothing left to add                                                                                                                                                                                                                               
 but when there is nothing left to take away.
"                                                                                                                                                                                                                                                                       (Antoine de Saint-Exupéry).

I have found it to be ultra robust and reliable, and efficient,
when used correctly, when used incorrectly it core-dumps, or, if lucky,
can '(throw ...) an error condition / exception that can
be caught with (try (catch ...) (finally ...) (prog ...))).

The documentation is excellent, available from the REPL,
or as HTML (shipped in RPM as /usr/share/picolisp/doc) :
 https://picolisp.com/wiki/?Documentation .

Please give Fedora / RHEL users the benefits of PicoLisp,
enjoyed by Debian / Ubuntu / Android Termux users!

Comment 2 Jason Vas Dias 2022-06-19 15:06:00 UTC
Self-Review Issue #1:
  Oops :
  $  rpm -qp --requires picolisp-22.6.17-1.fc36.x86_64.rpm 
  ...
  /data/data/com.termux/files/home/pil21/pil
  ...

Yes, the distro does include an optional PilBox Android Application,
which can be built, if requisite Android Tools are installed,
but the host Linux distro in no-way depends on this - it is
just one of many optional extras, that users can optionally
build, in the distro.

This was picked up by RPM's autoreqprov because:
  $ grep -RI '/data/data/com.termux/files/home/pil21/pil' .
  ./bin/pty:#!/data/data/com.termux/files/home/pil21/pil

./bin/pty is ONLY used on the Android Platform by PilBox .

I need to exclude this file somehow from the autoreqprov
generator ...

Comment 3 Jason Vas Dias 2022-06-19 22:53:15 UTC
OK, .spec file now updated to exclude that problematic AutoReqProv.

Also updated .spec file to provide support for the '--with auto_download' option,
to enable download of the latest pil21.tgz before building of it commences, and
to determine the RPM version number dynamically from it.

There is an archive of the SRPM, the spec file, the RPM produced, and the build log,
from a '--with auto_download' build, at:

https://drive.google.com/drive/folders/169COH6WSItF614WWpoGbrgFdpUyB2JLr?usp=sharing

Comment 4 Package Review 2023-06-20 00:45:24 UTC
This is an automatic check from review-stats script.

This review request ticket hasn't been updated for some time. We're sorry
it is taking so long. If you're still interested in packaging this software
into Fedora repositories, please respond to this comment clearing the
NEEDINFO flag.

You may want to update the specfile and the src.rpm to the latest version
available and to propose a review swap on Fedora devel mailing list to increase
chances to have your package reviewed. If this is your first package and you
need a sponsor, you may want to post some informal reviews. Read more at
https://fedoraproject.org/wiki/How_to_get_sponsored_into_the_packager_group.

Without any reply, this request will shortly be considered abandoned
and will be closed.
Thank you for your patience.

Comment 5 Jason Vas Dias 2023-12-06 19:19:41 UTC
Created attachment 2002941 [details]
latest source rpm building under FC-38 now

Please review & consider including picolisp in Fedora .
The above picolisp.spec includes my most minimal patch
to the original source to also produce a 'picolisp.so'
shared library, and provide a 
  'const char* lisp_eval(const char*) // free() non-null returns'
"C" entry point, entirely optionally, enabled with the
  '--with picolisp_dso' rpmbuild option,
which enables expressions like : 
  " const char *result = lisp_eval("(+ 2 2)");
    printf("%s\n", result); free(result);
  "
  to print "4".

Comment 6 Jason Vas Dias 2023-12-06 19:30:25 UTC
I'd always recommend building with the rpmbuild '--with auto_download' option, 
which enables downloading https://software-lab.de/pil21.tgz , where Alex's latest source is regularly updated -
the build from .spec with rpmbuild ALWAYS runs the test : 
   $ ./pil$_just_built @lib/test.l -bye +
which MUST succeed for the RPM build to succeed .
I've never seen use of auto_download break a build yet !

Comment 7 Jason Vas Dias 2023-12-06 19:35:41 UTC
Created attachment 2002942 [details]
RPM spec file for picolisp, as in SRPM

Comment 9 Jason Vas Dias 2023-12-06 19:58:41 UTC
How do I obtain a sponsor for this - maybe R.Dieter, sbcl package maintainer ? 
Perhaps you could contact him & ask ?

Please, Fedora Package Maintainer, consider adding picolisp to Fedora !
Debian / Ubuntu / Termux / BSD has had pil / picolisp for years !
It is a tiny, highly efficient, robust & pragmatic programming language
and pure LISP interpreter, a super-shell, with some very advanced
Prolog-Like and Database and HTML/HTTP processing features .

'pil' is what I use mainly nowadays in preference to bash / perl / python scripts,
'sbcl' is what I'd use for larger more modular 'compilation oriented' projects, in preference
to Java / Scala,
but I'd use both primarily as users of C/C++ libraries I develop and load with 'dlopen(3)'
into running pil or sbcl images, or in the case of 'pil', as a loadable DSO built-in named '𝞴' which 
uses dlopen(3) to load /usr/share/picolisp/bin/picolisp.so, and then calls 'lisp_eval' ,
handler of picolisp expressions , and prints the result as a string, as a bash (Bourne Again Shell)
built-in loadable shared object (DSO).
 Both have excellent FFI (foreign function interface) facilities.


See : https://rosettacode.org/wiki/Category:PicoLisp#:~:

Comment 10 Jason Vas Dias 2023-12-06 21:09:48 UTC
Note to maintainers / reviewers - if you do not have any 'pil' / 'picolisp' command in your $PATH when 
building for the first time, you are Bootstrapping . 
In that case, IFF a 32-bit Java 1.8 environment is in $PATH (and possibly also $LD_LIBRARY_PATH), then
you can cd to the 'src32' directory and run make, that will build the 32-bit Java PicoLisp Simulator,
that CAN be used to provide the 'picolisp' command necessary to build the (ONLY!) 64-bit picolisp for
the first time. 

But really, I'd recommend downloading the Ubuntu picolisp binary and building a libc it will link against,
then running that, or getting a Fedora-38 built binary from me. Nothing else will suffice to 
build picolisp other than picolisp, it is its own Assembler / runner of 'opt', the LLVM Code Generator ...
You can also build the old pre LLVM/Clang version of pil as a bootstrap picolisp, which is built
also by running picolisp as an X86_64 Assembler generator, but that also requires at least the
32-bit simulator to be in $PATH in order to bootstrap.

Comment 11 Jason Vas Dias 2023-12-06 21:31:41 UTC
Here is what the build does : 

    ../pil   lib/llvm.l main.l -bye > base.ll
    mv base.map ../lib/map
    opt -O3   -opaque-pointers -o base.bc base.ll
    clang -O3 -w -fPIC -c -o lib.bc -D_OS='"Linux"' -D_CPU='"x86_64"' `pkg-config --cflags libffi` -emit-llvm lib.c
    llvm-link -o picolisp.bc base.bc lib.bc
    mkdir -p ../bin ../lib
    llc picolisp.bc -relocation-model=pic -o picolisp.s
    clang picolisp.s -o ../bin/picolisp -rdynamic -lc -lutil -lm -ldl -lreadline -lffi
    strip ../bin/picolisp

But ../bin/picolisp is referenced by ../pil, to produce 'base.ll' in the first step ; 

I believe 'base.ll' left over from previous build and with earlier timestamp could also be shippped, 
then if this was a Bootstrap build, (no picolisp found), then that pre-generated base.ll could be
used to produce a non-generated build of picolisp , skipping a most important build step for build
customization, and expecting a Debian / Ubuntu libc.
So ../bin/picolisp  must exist, be the 32-bit simulator runner script, or be an SSH script that SSHes 
to an instance of Ubuntu running picolisp and which mounts the same build directory using NFS,
 eg. an Ubuntu VM, but 'picolisp' must be found in $PATH before building from generated base.ll will work.

Comment 12 Jason Vas Dias 2023-12-06 21:52:47 UTC
I should probably ship a 'base.prev.ll.xz' file in the SRPM, which would be from a Fedora-38 x86_64 build, not
from a Ubuntu / Debian build at least , that would enable a bootstrap ../bin/picolisp to be used only for 
generating a new initial base.ll to be initially built , ie. running from 'opt -O3' line above where base.ll
is initially base.prev.l, then once that ../bin/picolisp is produced, running that to produce a new base.ll .

Comment 13 Jason Vas Dias 2023-12-06 22:19:08 UTC
Created attachment 2002975 [details]
generated base.ll from an FC-38 x86_64, which is all that is necessary to build bootstrap ../bin/picolisp

Comment 14 Benson Muite 2023-12-07 16:47:20 UTC
Initial comments:
a) Get your package to build in copr and possibly also koji
b) Auto download should not be used,  need to check each release. Fedora builds do not have internet access
to ensure integrity of what is built.
c) Try to do a few informal reviews, it helps learn about the packaging process and makes it easier for
a sponsor to see you have acquired skills necessary to package. You might also consider doing a few
updates of other packages you are interested in, for example sbcl.


Note You need to log in before you can comment on or make changes to this bug.