Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    x4z3a
    @x4z3a:matrix.org
    [m]
    First. Thanks for Feedback.
    $ cat ~/.roswell/config sly.version 0 git init.default 0 test emacs.type 0 sly slime.version 0 2021.12.30 sbcl.version 0 2.2.0 setup.time 0 3850736711 sbcl-bin.version 0 2.2.0 default.lisp 0 sbcl
    x4z3a
    @x4z3a:matrix.org
    [m]
    I have emacs running as a server. I dont get how I can start working on a project that uses qlot.
    When I open a lisp file it start the repl. but how can I verify if it started with qlot / ros / or the sbcl in the path?
    by the way I am using doom emacs which came with sly preconfigured. Now I am trying to optimize it.
    x4z3a
    @x4z3a:matrix.org
    [m]
    If I understand you correctly you start a dedicated emacs instance from terminal in the qlot enabled project directory via
    ´´´
    qlot exec ros emacs
    ´´´
    Alexander Artemenko
    @svetlyak40wt

    Correct.

    When you exec something under the Qlot, everything it does, it sets a few environment variables. You can check them like that:

    $ env | sort > before
    $ qlot exec env | sort > after
    $ diff -u before after
    
    > CL_SOURCE_REGISTRY=/Users/art/projects/lisp/ultralisp/:/Users/art/.roswell/local-projects/fukamachi/qlot/
    > QUICKLISP_HOME=/Users/art/projects/lisp/ultralisp/.qlot/
    > ROS_OPTS=(("program""(:eval\"(ros:asdf)\")(:eval\"(ros:quicklisp)\")(:load\"/Users/art/.roswell/init.lisp\")")("uname-m""arm64")("uname""darwin")("asdf""3.3.5.3")("patchdir""/opt/homebrew/Cellar/roswell/21.10.14.111/etc/roswell/patch/")("lispdir""/opt/homebrew/Cellar/roswell/21.10.14.111/etc/roswell/")("verbose""0")("homedir""/Users/art/.roswell/")("wargv0""/opt/homebrew/bin/ros")("argv0""ros")("quicklisp""/Users/art/.roswell/lisp/quicklisp/")("impl""sbcl-bin/2.2.2")("script""\"/Users/art/.roswell/bin/qlot\"\"exec\"\"env\"")("lisp""sbcl-bin")("*lisp""sbcl-bin")("sbcl.version""2.2.4")("ecl.version""21.2.1")("sly.version""git")("asdf.version""3.3.5.3")("emacs.type""sly")("slime.version""2021.08.07")("setup.time""3860863890")("sbcl-bin.version""2.2.2")("default.lisp""sbcl"))
    > SBCL_HOME=/Users/art/.roswell/impls/arm64/darwin/sbcl-bin/2.2.2/lib/sbcl

    So, to start Lisp image correctly from your preconfigured Doom Emacs, you need to:

    • be in a directory where qlfile is
    • to tell SLY to run correct Lisp as qlot exec ros. As example of such configuration, look at this piece of my config, but you'll need to prepend ros with qlot exec.

    I think this will help in your case.

    1 reply
    x4z3a
    @x4z3a:matrix.org
    [m]
    did you ever look at this piece of qlot-sly config?
      (setq sly-lisp-implementations
            `((sbcl ("sbcl") :coding-system utf-8-unix)
              (ccl ("ccl") :coding-system utf-8-unix)
              (ecl ("ecl") :coding-system utf-8-unix)
              (roswell ("ros" "-Q" "-l" ,ros-config "run"))
              (qlot ("qlot" "exec" "ros" "-l" ,ros-config "run" "-S" ".")
                    :coding-system utf-8-unix)))
    
      (defun qlot-sly ()
        "Start a sly repl using qlot at the projects root"
        (interactive)
        (let ((dir (cdr (project-current))))
          (if (cd dir)
              (sly 'qlot)
            (error (format "Failed to cd to %s" dir)))))
    in which case would you use which of the lisp-implementations through M-x sly?
    what if a project doesnt have qlot? in this case you started it M-x sly?
    x4z3a
    @x4z3a:matrix.org
    [m]
    and what is totally confussing is how asdf and the lisp files of a program should be loaded.
    When a repl started and i am in project root (usually with subfolders src/ ) Do I have to load the asd-file then in the repl? or load it via ros .... from terminal?
    There seem to be so many different ways and its hard to see what the best practice is.
    This vid from (Gavinok) shows how to run sly https://www.youtube.com/watch?v=0DLdQ6yb7h8&t=324s but he runs code only from scratch buffer.
    x4z3a
    @x4z3a:matrix.org
    [m]

    so this project e.g. https://github.com/gregcman/sucle
    How would start working on it from emacs after cloning it to a local directory?
    the install.md says to load it from quicklisp inside the emacs sly repl but this would not load the local git-clone version but download a version into

    ~/.cache/common-lisp/sbcl-2.2.0-linux-x64/home/mpf/.roswell/lisp/quicklisp/dists/quicklisp/software/sucle-20200427-git
    
    ~/.roswell/lisp/quicklisp/dists/quicklisp/software/sucle-20200427-git

    but i want to work (via emacs sly) on my local clone in

    ~/build/lisp/sucle

    I guess the workflow would be to load some intial file in ~/build/lisp/sucle from emcas sly repl that loads the rest of the dependencies and then start testing the application and edit code in files and use sly-compile to send modifications to the repl?

    x4z3a
    @x4z3a:matrix.org
    [m]

    back to qlot experiment. I used one of your projects for it.

    ~/build/lisp/cl-static-resources$ qlot exec ros emacs
    #in emacs then I open file 
    ~/build/lisp/cl-static-resources/app.lisp
    #which starts a repl.

    now I can start working edit any file in the project and have changes compiled into the running cl-image send through the emacs sly reply with established slynk connect ?

    x4z3a
    @x4z3a:matrix.org
    [m]
    CL-USER> (asdf:load-asd "app.asd")
    #<DEFINE-OP>
    #<ASDF/PLAN:SEQUENTIAL-PLAN #x3020013ACF8D>
    CL-USER> (asdf:make "app")
    
    Process sly-pty-1-1 killed
    ; Lisp connection closed unexpectedly: connection broken by remote peer
    ; --------------------------------------------------------
    Was this wrong on my side?
    Why?
    Do I have to restart emacs now? ~/build/lisp/cl-static-resources$ qlot exec ros emacs or what is the right why to go from here?
    Alexander Artemenko
    @svetlyak40wt
    Usually asdf:make dumps an image and exits. That is why it closed the connection.
    It is better to make a separate script for building the binary for distribution.

    Another thing.

    Usually, I'm creating the REPL manually, by calling M-x sly after the Emacs start.

    x4z3a
    @x4z3a:matrix.org
    [m]
    ok
    Alexander Artemenko
    @svetlyak40wt
    When starting emacs using qlot exec ros emacs, you don't have to load app.asd if it is in the current directory, because qlot already set up asdf to see these asd files. You can do (ql:quickload :app) or (asdf:load-system :app) if all dependencies are available locally.
    x4z3a
    @x4z3a:matrix.org
    [m]
    aahh!
    sometimes there is no asd-file in the project root but in a subfolder src/ shoudl i start qlot exec ros emacs there and create the qlfile there? E.g. https://github.com/gregcman/sucle/tree/master/src
    Thanks for replying and being patient so far!
    Alexander Artemenko
    @svetlyak40wt
    Sucle's repository stores all asd files in subdirectories. To make they work for you do the following:
    cd sucle
    # make an empty environment
    touch qlfile
    qlot install
    # start emacs telling lisp also see asd files in subdirectories.
    # Pay attention, double slash tells to search asd files in subdirectories too.
    CL_SOURCE_REGISTRY=`pwd`// qlot exec ros emacs
    # when emacs will start
    M-x sly
    (ql:quickload :sucle)
    1 reply
    Actually, you might configure ASDF from the REPL. But I prefer this way because it is easier to remember.
    x4z3a
    @x4z3a:matrix.org
    [m]
    quickload will install all dependencies in the "central " directory then or will it automatically know they should go to .qlot/ ?
    Alexander Artemenko
    @svetlyak40wt
    Another useful command is (ql:where-is-system :sucle) it shows a path from where ASDF has loaded the system (or will load it).

    quickload will install all dependencies in the "central " directory then or will it automatically know they should go to .qlot/ ?

    If you've started emacs via qlot exec …, then yes, quicklisp client will download everything into the .qlot. That is why I like it. This is useful when you are having many projects with different versions of dependencies.

    1 reply
    x4z3a
    @x4z3a:matrix.org
    [m]
    exactly. This is the flow I am used to from phython otherwise its to dependent on the os configuration.
    x4z3a
    @x4z3a:matrix.org
    [m]
    also what confused me with the qlot exec ros emacs flow was that i run emacs as daemon and
    then it could only work if I would do all those settings ( qlot and CL_SOURCE_REGISTRY )from the sly repl before I can quickload sucle.
    But your flow is easy and i can live with having a second emacs running for now.
    x4z3a
    @x4z3a:matrix.org
    [m]
    sucle.asd contains all the dependencies but after (ql:quickload sucle) they havent been installed into
    $ ll .qlot/local-projects/
    total 16
    drwxrwxr-x 2 mpf mpf 4096 Jul  3 19:37 ./
    drwxrwxr-x 6 mpf mpf 4096 Jul  3 19:34 ../
    -rw-rw-r-- 1 mpf mpf    0 Jul  3 19:37 system-index.txt
    Do I have to add them manually to the qlfile first ? and run qlot install again?
    x4z3a
    @x4z3a:matrix.org
    [m]

    M-x getenv CL_SOURCE_REGISTRY gives

    /home/mpf/build/lisp/sucle/:
    /home/mpf/build/lisp/sucle//:
    /home/mpf/.roswell/lisp/quicklisp/dists/quicklisp/software/qlot-20220331-git/

    M-x getenv QUCKLISP_HOME gives

    /home/mpf/build/lisp/sucle/.qlot/

    So that should be right

    x4z3a
    @x4z3a:matrix.org
    [m]
    found it . The packages are stored in .qlot/dists/quicklisp/software/
    x4z3a
    @x4z3a:matrix.org
    [m]
    what is actually this 40ants/team about?
    Alexander Artemenko
    @svetlyak40wt
    found it . The packages are stored
    That is because Quicklisp's local-projects dir is for systems cloned manually.

    what is actually this 40ants/team about?

    I just hope to find a few people to make some projects/products together and to use Common Lisp as our main language in the dev stack.

    2 replies
    Alexander Artemenko
    @svetlyak40wt

    also what confused me with the qlot exec ros emacs flow was that i run emacs as daemon and

    Actually, you might start lisp from the repl and to connect to this repl from different lisps from the single Emacs instance.

    For doing this, you might start lisp manually, like:

    qlot exec ros run
    (ql:quickload :slynk)
    (slynk:create-server :dont-close t :port 4005)

    Or you might to build a binary which will start slynk:

    qlot exec ros build app.ros

    Usually I'm doing this when deploying service to production. Here is my current pet-project where I'm using this approach: https://github.com/40ants/cloud-analyzer

    2 replies
    This way you can connect to any lisp program, even to a production instance on remote machine on in the Kubernetes cluster.
    K1D77A
    @k1d77a:scyldings.com
    [m]
    Or both
    K1D77A
    @k1d77a:scyldings.com
    [m]
    Sounds good to me
    I wish to keep using Lisp as my primary language 😎
    Alexander Artemenko
    @svetlyak40wt
    Me too. Me too.
    K1D77A
    @k1d77a:scyldings.com
    [m]
    Lisp businesses 🤔
    What to make, what to make
    I would like one of my current projects that I'm working on within a community of mine to take off enough that I could get in another CL dev
    that would be sweet 😎
    x4z3a
    @x4z3a:matrix.org
    [m]
    That sounds like my wet dreams, too.🤷‍♂️