~andreyorst

Moscow

https://andreyorst.gitlab.io/

I love Lisp and text editors!


#191 Prefixed string support 3 months ago

Comment by ~andreyorst on ~technomancy/fennel

#183 [Fennel Proto REPL] assert-repl doesn't use REPL window 4 months ago

Comment by ~andreyorst on ~technomancy/fennel

REPORTED RESOLVED IMPLEMENTED

#188 <eof> expected near '[' 4 months ago

Ticket created by ~andreyorst on ~technomancy/fennel

I was messing around with implementing records that are faster to access than plain tables, and fund an instance of illegal code generation:

(macro defrecord
  [name ...]
  {:fnl/arglist [name & fields]}
  `(macros
    ,(faccumulate [res {(tostring name) `(fn [,...] [,...])}
                   i 1 (select :# ...)]
       (doto res
         (tset (.. (tostring name) "/" (tostring (select i ...)))
               `(fn [this#] (list '. this# ,i)))))))

(defrecord Foo a b c)
(Foo/a (Foo :a :b :c))

This generates the following message when compiled:

Compile error: /var/home/alist/.local/bin/fennel:1002: [string "return {"a", "b", "c"}[1]"]:1: <eof> expected near '['

I think the code should instead be return ({"a", "b", "c"})[1] as it's the correct way to index literal tables.

#185 [fennel-mode] flymake support 5 months ago

Comment by ~andreyorst on ~technomancy/fennel

#185 [fennel-mode] flymake support 6 months ago

Comment by ~andreyorst on ~technomancy/fennel

Yes, language servers do provide this, and while I think it's good that they do it I'm, personally, not a big fan of the LSP tech. Fennel-ls is a project not under the umbrella of the Fennel project, and its life cycle is hard to predict. The Fennel compiler is probably going to live as long as the Fennel itself, so getting info from it is more stable in the long run.

And unlike many other languages, where language servers are either promoted by the language developers themselves or popularized by the community, I think that fennel-ls isn't as widespread. I know a lot of people using Fennel, but only a few use fennel-ls. Fennel compiler on the other hand is accessible by everyone.

I don't oppose the language server way but simply want to provide an additional way of error checking.

#185 [fennel-mode] flymake support 6 months ago

~andreyorst assigned ~andreyorst to #185 on ~technomancy/fennel

#185 [fennel-mode] flymake support 6 months ago

Ticket created by ~andreyorst on ~technomancy/fennel

I'd like to add flymake support to the fennel-mode package.

Currently, I'm just using the compiler, however, it seems that it doesn't have any warnings, only compile error and parse error messages. Also, it stops after the first error, which is OK for a compiler, but for a linter, we'd want to see more errors.

I've also thought about using the linter.fnl plugin to provide more info on various things, however right now it seems to also fail on the first thing, instead of reporting them all. Additionally, it seems that it also has no warnings, only errors.

I've pushed the flymake branch to the fennel-mode package, feel free to try it.

#183 [Fennel Proto REPL] assert-repl doesn't use REPL window 7 months ago

Comment by ~andreyorst on ~technomancy/fennel

#183 [Fennel Proto REPL] assert-repl doesn't use REPL window 7 months ago

enhancement added by ~andreyorst on ~technomancy/fennel

#183 [Fennel Proto REPL] assert-repl doesn't use REPL window 7 months ago

~andreyorst assigned ~andreyorst to #183 on ~technomancy/fennel