Re: Poll : Are you interested seeing Qi as embedded language in lisp?



On Jan 21, 2:19 am, David Golden <david.gol...@xxxxxxxxxxxxx> wrote:
Mark Tarver wrote:
I confess I'm puzzled. If you want to use CL with Qi on tap then just
LOAD the following into Qi.

(DEFUN lisp ()
(PROG ()
LOOP
(FORMAT T "~%> ")
(PPRINT (EVAL (READ)))
(GO LOOP)))

Then type (lisp) from Qi and you're in the Lisp top level with easy
access to all of Qi.

I don't quite get Slobodan's objection so far either, but I'm not sure
that addresses things. I _think_ it _might_ be about the core image
dump Qi installation does. But I think that is ultimately an optional,
not necessary step, in using Qi?* It makes Qi easier/faster to use is
all? (Being linux-based, I do wish you [Mark] had used slightly
different filenames and line endings, but I doubt those are the issues
either, and they don't actually block linux-compat :-) )

(i) using Qi without a custom image dump:

Qi already includes an example of loading and starting Qi in a
non-image-based fashion for allegro - run_fasl_allegro.txt, I don't see
why it wouldn't work on SBCL and other lisp implementations. In fact,
it basically does seem to work fine - I just did it (but I only
checked trivial stuff. And SLIME doesn't really know anything about the
Qi REPL of course - now there's a project for someone more motivated
than me :-)) - just do a

(MAKE-PACKAGE "qi")
(LOAD "Qi 9.1.txt")
(COMPILE-FILE "Qi 9.1.txt")

- now you've got a compiled Qi fasl. Exit SBCL.
When you want to use Qi, enter SBCL and do like it says in
run_fasl_allegro.txt (with the obvious version-dependent substitution)
to load the Qi fasl and start the Qi REPL**

* I don't think it's a good idea to do smalltalk-style image-based
development in lisp (hey, or smalltalk really.), but that's NOT what
Qi's doing, it's just using the common enough image dump strategy as an
optimisation for fast startup and to make Qi look "standalone".

** There is the license-agreement jiggery-pokery too, but it is GPL
anyway, not some dubious click-through EULA, and even so you do
explicitly "agree" to the license (with the setq) in the allegro script.

(ii) packaging:

Now, Qi doesn't have an asdf system definition, but it's a somewhat
different language implemented on top of lisp like Maxima (though
obviously very close to the underlying lisp), not just another lisp
library. That said, I expect it could still be bundled up as an asdf
and asdf-installable system - but (a) the Qi implementation itself is
currently in a single file anyway, you just compile and load it and (b)
what's a user going to do? asdf load the system, which loads that one
file, and just immediately enter the qi repl?. So asdf packaging is of
dubious benefit, unless Slobodan is imagining someone writing
applications in Lisp/Qi and wanting to manage compilation with asdf and
declare package dependencies for asdf-installation...
It seems that I failed to explain my thoughts clearly. I want to
program in lisp and just use some Qi functionality when I need it. The
nice comparation is with embedded prolog , like AllegroProlog, or
Paipprolog. If I need some functionality that would be elegantly
implemented in Qi I would use only that, the rest of my programming
will e in lisp . The current system is quite the opposit. It's
something like you code in C++ but you could switch to assembly if you
really want to.
Consider a fallowing example:
father(john,sam).
father(sam,nick).

grandfather(Grandson, Grandfather) :-
father(Grandson,Father),
father(Father,Grandfather).
In embedded prolog (allegro prolog syntax)
;;; This could be typed into standard lisp repl , or saved into
standard .lisp file
(<-- (father john sam))
(<- (father sam nick))
(<-- (grandfather ?grandson ?grandfather)
(father ?grandson ?father)
(father ?father ?grandfather))

Now I could use the functionality of grandfather into my common lisp
code. Takes Bills post about better example http://bc.tech.coop/blog/040919.html
I don't want Qi as image , I want it to be a plain embedded language
as library.

The license seems to be an issue, currently GPL is fine since Qi is
only the compiler, but in my proposition Qi is a yet another library
in the lisp image, so it would GPLize all the other code.

Seems that proposition open a can of worms and there's not much
interest in using Qi this way, so thanks everybody for your answers
I'll look elsewhere and I won't annoy Mark anymore :) .

cheers
Slobodan


.



Relevant Pages

  • Re: ASDF question
    ... ASDF verifies that everything's up to date and compiled ... I think this is one reason why Lisp appeals to me so. ... controlled by JCL to compile, run, and print. ... Emacs + SLIME feels like heaven to me now. ...
    (comp.lang.lisp)
  • Re: Poll : Are you interested seeing Qi as embedded language in lisp?
    ... Mark Tarver wrote: ... LOAD the following into Qi. ... Then type (lisp) from Qi and you're in the Lisp top level with easy ... Now, Qi doesn't have an asdf system definition, but it's a somewhat ...
    (comp.lang.lisp)
  • Re: fasl and lisp image
    ... fundamental difference between the lisp image and the set of .fasl ... need anything more than a remembered set of fasl to load (both ... When I work with a Lisp machine, ... When I later restart the Lisp, ...
    (comp.lang.lisp)
  • Re: Module Loading in Lisp - Newbie question
    ... of an import in Lisp. ... Load them with LOAD ... there are "de facto" standard "defsystem" libraries which allow you to specify that a collection of files - e.g. that make up an application or library - is a system that can be compiled/loaded together, and name the dependencies between them. ... ASDF and MK-DEFSYSTEM are portable and widely used, and there may be others available/bundled with whatever Lisp you're using. ...
    (comp.lang.lisp)
  • Re: DBMS and lisp, etc.
    ... boundaries in your system even if your crude backing store does not actually ... to toss out a real benefit of the DBMS and design around it at this point. ... structure and the simply "print" to save it, and then "read" to load it. ... you may want to look into some implementation specific bits of your Lisp, ...
    (comp.lang.lisp)