~andreyorst

Moscow

https://andreyorst.gitlab.io/

I love Lisp and text editors!

Recent activity

I'm taking a break from Fennel 17 days ago

From Andrey Listopadov to ~technomancy/fennel

Hello everyone!

I'm sorry to say it, but I decided to take a break from Fennel.  There
are a few reasons for that unrelated to the language or the community.
I'm archiving all of my Fennel code on GitLab for now, if you're
interested in picking up any of my projects, please feel free to do so.

I'll still maintain the fennel-proto-repl for now, as it is used in
other editors, and the Emacs support for it, but I doubt that I will get
any active use of it any time soon, so it's entering a "maintenance
mode".  Sorry to let everyone down.

I'm at a point in my life when I have to reevaluate my priorities.  That

Re: 'wcollect' macro (was: [Proposal] while-let) 27 days ago

From Andrey Listopadov to ~technomancy/fennel

Jan 25, 2024 13:31:51 Rudolf Adamkovič <salutis@me.com>:

> WDYT?
>
> Here, 'wcollect' fills a gap in the existing conceptual space, as per
>
>> when I think about the features that #fennel has, I often think about
>> how some features introduce a new area in conceptual space, while
>> others simply fill in gaps that are already present from existing
>> features

Every day we stray further away from Common Lisp's loop.

--

Re: [Proposal] while-let 2 months ago

From Andrey Listopadov to ~technomancy/fennel

Dec 3, 2023 22:28:09 Phil Hagelberg <phil@hagelb.org>:

> Andrey <andreyorst@gmail.com> writes:
>
>> Consider:
>>
>> (do
>>   (var not-done true)
>>   (while not-done
>>     (let [smth (something)]
>>       (if smth
>>         (set not-done false)
>>         (do (work smth)
>>             (with smth))))))

Re: Proposal: implicit iterators 3 months ago

From Andrey Listopadov to ~technomancy/fennel

Nov 20, 2023 06:10:33 Phil Hagelberg <phil@hagelb.org>:

> Most calls to `icollect` call `ipairs` on a table, bind the second 
> value
> from the iterator, and ignore the first value; in other words, they map
> a body over a sequence. In this case, we can tighten up the notation 
> and
> accept just a table to be iterated over:
>
>     ;; this:
>     (icollect [_ x (ipairs tbl)] (make-extra x))
>     ;; could become this:
>     (icollect (ipairs tbl) (make-extra $))
>

[Proposal] while-let 3 months ago

From Andrey to ~technomancy/fennel

It's a really useful idiom, and given that Fennel has the while loop,
while-let is super useful to use with it.

Consider:

(do
  (var not-done true)
  (while not-done
    (let [smth (something)]
      (if smth
        (set not-done false)
        (do (work smth)
            (with smth))))))

Re: [fennel/patches/.build.yml] build failed 4 months ago

From Andrey Listopadov to ~technomancy/fennel

"builds.sr.ht" <builds@sr.ht> writes:

> fennel/patches/.build.yml: FAILED in 42s
>
> [try to use existing ___repl___ set methods when firing assert-repl][0] from [Andrey Listopadov][1]
>
> [0]: https://lists.sr.ht/~technomancy/fennel/patches/45959
> [1]: andreyorst@gmail.com
>
> ✗ #1080566 FAILED fennel/patches/.build.yml https://builds.sr.ht/~technomancy/job/1080566

The test failing is the assert-repl test

[PATCH fennel] try to use existing ___repl___ set methods when firing assert-repl 4 months ago

From Andrey Listopadov to ~technomancy/fennel

This ensures that if the program has ___repl___ set up, it will use
the expected logic from these methods. Otherwise it just evaluates to
nil and uses the default ones.
---
 src/fennel/macros.fnl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/fennel/macros.fnl b/src/fennel/macros.fnl
index 6feef41..1d97701 100644
--- a/src/fennel/macros.fnl
+++ b/src/fennel/macros.fnl
@@ -405,7 +405,10 @@
  `(let [condition# ,condition
         message# (or ,message "assertion failed, entering repl.")]
[message trimmed]

Re: Generalizing macros 5 months ago

From Andrey to ~technomancy/fennel

>Well, have you taken a look at fennel-ls? If you compare the quality of
>the static analysis from fennel-ls vs the Clojure language server, the
>Fennel one is dramatically better despite being much less code. This is
>only possible because it can do static analysis on the expanded code,
>whereas the Clojure just gives up at the first sight of a 3rd-party macro.

I wonder if this is because Fennel compiler is much easier to embed and use?
I haven't seen any public statements that clojure-lsp doesn't expand macros
due to security concerns. I suppose, Clojure macros are way harder to expand
if done manually, and it was too hard or cumbersome to rmbed the whole 
compiler for this sole job. Anyhow, I think clojure-lsp solution to this is fine, and
fennel-ls solution is also fine.

>> In fenneldoc I do the sandboxing mainly so the scripts to minimize

Re: Generalizing macros 5 months ago

From Andrey to ~technomancy/fennel

>Sorry, I don't think this is easy! This sounds really difficult, because
>"what's in the module" will frequently depend on modules which will not load
>in the compiler sandbox.

Honestly, I never fully understood why we do sandboxing of the compiler
in the first place.  It, however, limits interesting things that can be done with
macros, like conditional based on environment variable for example.

In fenneldoc I do the sandboxing mainly so the scripts to minimize effects, but
a lot of libraries may need to escape sandbox to test the documentation, so I provide
a setting for that. Though I think I'll drop the sandboxing in future release entirely.

>> ```fennel
>> (fn public-foo [] :ok)

Re: match pattern destructuring with variables 5 months ago

From Andrey to ~technomancy/fennel

On September 6, 2023 4:49:45 AM GMT+03:00, Mike Mogenson <michael.mogenson@gmail.com> wrote:
>Thanks. I didn't know Lua compares tables by hash instead of value.
>Now Fennel's behavior makes sense.
>
>I wonder if it would be possible to construct a new list or table
>within a match branch. Unfortunately the following example does not
>work:
>
>(let [pattern [1]]
>  (match [1]
>    [(unpack pattern)] :matched-unpacked-list
>    _ :no-match)) ;; -> Compile error: can't nest multi-value destructuring

Do not forget that match is a macro, and macros don't know anything about