~andreyorst

Moscow

https://andreyorst.gitlab.io/

I love Lisp and text editors!

Recent activity

[ANN] deps.fnl - a new dependency manager for Fennel projects 3 days ago

From Andrey Listopadov to ~technomancy/fennel

Below is the text of the post in my blog, formatted for the mailing
list.  If you wish to read this with a slightly better formatting, you
can do so here:

https://andreyor.st/posts/2025-01-10-depsfnl-a-new-dependency-manager-for-fennel-projects/

------

I'd like to present a new project, aimed at one of the areas where the
Fennel ecosystem can be improved - project dependency management.

Other programming languages have tools to pull in, build, and load
external dependencies.  Java has Maven, Clojure has Leiningen and other

Re: [Proposal] Moving fennel-ls to become an official Fennel project 6 days ago

From Andrey Listopadov to ~technomancy/fennel

> I'd like to propose that we consider making fennel-ls an official
> Fennel project, by migrating the repository from ~xerool/fennel-ls to
> ~technomancy/fennel-ls. This would give it a more "official" status,
> similar to where `fnlfmt` is today.

Maybe fennel repo should become an "organization"? i.e. 
~fennel-lang/fennel-ls. I don't know if sourcehut allows that though, and 
what will happen to mirroring.

-- 
Andrey Listopadov

Re: Are we extending Emacs with Fennel yet? 24 days ago

From Andrey Listopadov to ~technomancy/fennel

Now I can call Emacs functions from Fennel!

;; Welcome to Fennel Proto REPL 1.0.0
;; Fennel version: 1.5.1-dev
;; Lua version: PUC Lua 5.4
>> (emacs-call.emacs-uptime)
"20 minutes, 59 seconds"

And variables too!

>> emacs-var.emacs-version
"31.0.50"

Re: Are we extending Emacs with Fennel yet? 27 days ago

From Andrey Listopadov to ~technomancy/fennel

Dec 16, 2024 08:42:12 Phil Hagelberg <phil@hagelb.org>:

> a while back I tried building a native module with a Lua VM and using 
> the FFI-type features to run Fennel code in the same process. Sometimes 
> it would work, but it would crash a LOT and bring down the whole 
> process, so I gave up on it.

Do you have a link to that? I vaguely remember you talking about this, 
yes, but can't find it anywhere.

Re: Are we extending Emacs with Fennel yet? 27 days ago

From Andrey Listopadov to ~technomancy/fennel

> The practicality of this is still in question though :D

Here I'm loading my Fennel port of a Clojure library clj-http into
Emacs, and calling it from Elisp, parsing the JSON response into alist:

(require-fennel io.gitlab.andreyorst.fnl-http.client :as client)

(client.get "http://httpbin.org/get" '((:as . :json)))

;; => (("headers" . (("Content-Length" . "198")
;;                   ("Access-Control-Allow-Credentials" . t)
;;                   ("Access-Control-Allow-Origin" . "*")
;;                   ("Content-Type" . "application/json")

Re: Are we extending Emacs with Fennel yet? 27 days ago

From Andrey Listopadov to ~technomancy/fennel

>> After watching EmacsConf I had a magnificent premonition that not only
>> we'll be able to run Guile inside Emacs, but Fennel as well!  Who
>> would have known that the latter is actually easy!  All we need is
>> this tiny macro...

As usual, a quick POC turned into a monstrosity :D

I've submitted it as a repository on my GitLab profile:

https://gitlab.com/andreyorst/require-fennel.el

If you're using recent-enough Emacs, you can install it with:

Are we extending Emacs with Fennel yet? 28 days ago

From Andrey Listopadov to ~technomancy/fennel

Hello everyone!

After watching EmacsConf I had a magnificent premonition that not only
we'll be able to run Guile inside Emacs, but Fennel as well!  Who
would have known that the latter is actually easy!  All we need is
this tiny macro:

(cl-defmacro require-fennel (module &key as (separator "."))
  (require 'ob-fennel)
  (defun require-fennel--fennel-to-elisp (value)
    "Convert Fennel value into Emacs Lisp value."
    (pcase value
      ((or "nil" "false") nil)
      ("true" t)

Re: Reverse domain packaging and identity problems a month ago

From Andrey Listopadov to ~technomancy/fennel

After a bit of refactoring, this script now acts as a wrapper around the
fennel script.  So it can be pretty much included in the launcher.fnl.

Here's how it looks when I launch deps in the fnl-http project on the
deps branch:

    $ deps --repl
    processing git repo: https://gitlab.com/andreyorst/async.fnl
    processing git repo: https://gitlab.com/andreyorst/json.fnl
    processing git repo: https://gitlab.com/andreyorst/reader.fnl
    processing git repo: https://gitlab.com/andreyorst/reader.fnl
    processing rock: luasocket
    Welcome to Fennel 1.5.1-dev on PUC Lua 5.4!

Re: Reverse domain packaging and identity problems a month ago

From Andrey Listopadov to ~technomancy/fennel

> This is not pushed anywhere yet, but I want to hear some thoughts and
> get feedback.  I'll set separate branches in these projects and push
> this later this week, so others could try it if necessary.

I've pushed a bit improved version of the script to:

https://gitlab.com/andreyorst/deps.fnl

Should be a bit more robust on Windows machines, and such.
Still, not extensively tested, but can be tried with my fnl-http project
on the deps branch:

https://gitlab.com/andreyorst/fnl-http/-/tree/deps

Re: Reverse domain packaging and identity problems a month ago

From Andrey Listopadov to ~technomancy/fennel

Phil Hagelberg <phil@hagelb.org> writes:

> [[PGP Signed Part:Undecided]]
> Andrey Listopadov <andreyorst@gmail.com> writes:
>
>> For some time I've been working on a library for making HTTP requests[1]
>> asynchronously from Fennel without relying on anything but luasocket.  I
>> have a library for asynchronous programming async.fnl[2] that implements
>> a channel-based workflow, and uses debug.sethook for scheduling.  I've
>> used this library in fnl-http, and faced a certain problem - how do I
>> bundle async.fnl in such a way that fnl-http can still be a single file
>> library for ease of use while making sure that users can still use
>> async.fnl without being affected by the bundled version?