Live data from Hacker News

TimL: Clojure-like Lisp dialect that runs on and compiles down to Vimscript

github.com

31–40 of 43 posts

Re: TimL: Clojure-like Lisp dialect that runs on and compiles down to Vimscript

#31

How difficult is it to write an "Emacs Lisp" interpreter in a foreign framwork like neovim? Wouldn't this basically convert any IDE into Emacs if the user wants it? I mean, I know elisp is not the most efficient of Lisp compilers but doing so for a new IDE opens the door for all available codes and plugins people have written for emacs throughout the years.

> Wouldn't this basically convert any IDE into Emacs if the user wants it?

Emacs Lisp is only part of the equation. You need the all of the programmability that implements 90% of Emacs in Lisp (all of the standard library functions, the display engine, etc).

Re: TimL: Clojure-like Lisp dialect that runs on and compiles down to Vimscript

#32
post #8

Any sufficiently complicated Vim configuration contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Emacs.

A few years ago I would have hated you for this comment but after switching to Emacs, this comment is actually spot on.

Re: TimL: Clojure-like Lisp dialect that runs on and compiles down to Vimscript

#34

Something similar: Fennel ( https://fennel-lang.org/ ) is a lisp that compiles into Lua, which neovim can use as plugins, so you can write neovim plugins in a lisp. Aniseed ( https://github.com/Olical/aniseed ) makes this really easy. Aniseed is also used by Conjure (Interactive development environment for neovim, used for evaluating Fennel code inside of neovim), which is also made by the same author. Really great p…

I've said this before but I think fennel is one of the most impressive languages around. Lua has a good reputation but I've used it professionally and find it one of the more practically painful languages to work in. Apparently fennel's author agrees, because fennel is laser-focused on correcting exactly its worst problems. AND/BUT one of fennel's impressive things is that it sticks rigidly to lua runtime semantics.…

The same author also wrote Janet, which is also a nice language from what I’ve played around with. Especially the idea of forgoing Regex entirely and going with PEGs, as well as having “defs” inside functions bind local variables instead of “let” (though let is also idiomatic), very interesting. Small languages like that give a very nice feeling of learning them in a single day.

Re: TimL: Clojure-like Lisp dialect that runs on and compiles down to Vimscript

#35
post #30

There are things I'll never understand. Why would anybody do this? Why Clojure and not Emacs Lisp?

Some people like Clojure syntax rather than S-expressions. Personally I don't get it, having arbitrary lists that require square instead of round brackets, arbitrary lists where pairs which belong together aren't grouped, and arbitrary lists where commas are interpreted as optional whitespace gives me a headache; but to each his own.

Clojure still uses S expressions, it just has more than just lists available. Square brackets don't make lists, they make vectors. Commas are always optional. I don't know what you mean by "arbitrary lists where pairs which belong together aren't grouped", but maybe you mean maps or sets, which are also not lists but a different data type.

  user=> (type [])
  clojure.lang.PersistentVector
  user=> (type '()) ; gotta quote the list
  clojure.lang.PersistentList$EmptyList
  user=> (type {})
  clojure.lang.PersistentArrayMap
  user=> (type #{})
  clojure.lang.PersistentHashSet

Different data types are used for different things. Vectors have more natural insertion behavior, so most people use them where that might happen.

  user=> (conj '(1) 2)
  (2 1)
  user=> (conj [1] 2)
  [1 2]

Re: TimL: Clojure-like Lisp dialect that runs on and compiles down to Vimscript

#36
post #29

Earlier quoted context omitted.

> slow There's quite a good chance that even the most complicated Neovim setup is faster than Emacs. Emacs lisp is notoriously slow, while Neovim uses LuaJIT, which is _very_ fast.

How do Neovim and Emacs startup times compare when using Emacs 28’s native compilation of elisp? Obviously hard to compare because they don’t run the same packages but would still be interesting to see ballpark figures of setups with roughly equivalent functionality.

Are these startup times even significant enough to actually be noticeable anyway?

Re: TimL: Clojure-like Lisp dialect that runs on and compiles down to Vimscript

#37
post #32
post #8

Any sufficiently complicated Vim configuration contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Emacs.

A few years ago I would have hated you for this comment but after switching to Emacs, this comment is actually spot on.

I don't like Emacs and still thought it was funny :)

Re: TimL: Clojure-like Lisp dialect that runs on and compiles down to Vimscript

#38

ELVM might be a related project, which takes C code and compiles to various languages, including VIM. https://github.com/shinh/elvm

Just in case you though VimL was too easy and want to add manual memory management in on top of it? ;)

Re: TimL: Clojure-like Lisp dialect that runs on and compiles down to Vimscript

#39
post #8

Any sufficiently complicated Vim configuration contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Emacs.

> slow There's quite a good chance that even the most complicated Neovim setup is faster than Emacs. Emacs lisp is notoriously slow, while Neovim uses LuaJIT, which is _very_ fast.

Emacs now has an optimizing native code emitting compiler for elisp. It's definitely not slow, but not as fast a luajit.

Not sure why performance matters in this case anyways though.

Re: TimL: Clojure-like Lisp dialect that runs on and compiles down to Vimscript

#40
post #29

Earlier quoted context omitted.

> slow There's quite a good chance that even the most complicated Neovim setup is faster than Emacs. Emacs lisp is notoriously slow, while Neovim uses LuaJIT, which is _very_ fast.

How do Neovim and Emacs startup times compare when using Emacs 28’s native compilation of elisp? Obviously hard to compare because they don’t run the same packages but would still be interesting to see ballpark figures of setups with roughly equivalent functionality.

Not favourably to Emacs.
Post reply on HN