Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Claude Code now reads AGENTS.md if there is no Claude.md(claude.com ↗)
    133comments
  2. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    184comments
  3. Saving another 100TB of RAM(cloudflare.com ↗)
    33comments
  4. Cloudflare Quick Tunnels(cloudflare.com ↗)
    218comments
  5. Xcode 27.1 Beta Release Notes(developer.apple.com ↗)
    58comments
  6. Cache-to-Cache: Direct Semantic Communication Between LLMs (2025)(arxiv.org ↗)
    11comments
  7. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    44comments
  8. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    71comments
  9. How to Write with an LLM(sockpuppet.org ↗)
    241comments
  10. US troop deaths during Iran war exceed Pentagon count by at least four(reuters.com ↗)
    15comments
  11. OpenJev(openjev.com ↗)
    237comments
  12. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    35comments
  13. The Implications of Linguistic Illegibility for LLM Security(arxiv.org ↗)
    17comments
  14. Two parallel neural ectoderm progenitors contribute to the developing brain(newscientist.com ↗)
    51comments
  15. Cyclomatic Complexity in C#(ndepend.com ↗)
    9comments
  16. From Geometry to Algebra and Back Again: 4000 Years of Papers (2023) [video](youtube.com ↗)
    discuss
  17. C++26: Trivial infinite loops are no longer undefined behaviour(sandordargo.com ↗)
    167comments
  18. Minimal Phone 2(minimalcompany.com ↗)
    146comments
  19. How SpaceX streamlined the Raptor engine(construction-physics.com ↗)
    24comments
  20. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    12comments
  21. Size-Specialized Memory Allocation(go.dev ↗)
    3comments
  22. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    89comments
  23. I vibed a proof of Conway's conjecture(overreacted.io ↗)
    174comments
  24. A search-and-inference database from scratch in pure Zig(antfly.io ↗)
    16comments
  25. Korea raises data breach fines to 10% of revenue(koreajoongangdaily.com ↗)
    71comments
  26. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  27. Mathematicians Build Long-Awaited Graph Sandwich(quantamagazine.org ↗)
    15comments
  28. US Military had close call after using AI for hallucinated intelligence report(cnn.com ↗)
    280comments
  29. Border agents can search cellphones without a warrant or reasonable suspicion(lawandcrime.com ↗)
    135comments
  30. North Korean nuclear test sets off years of earthquakes(science.org ↗)
    148comments

Neovim Configuration and Plugins in Fennel Lisp

82 pointsby 6y agooli.me.uk
19 comments
6y agoHN ↗

Well I know what I'm wasting next weekend on now.

6y agoHN ↗

Glad I could be of assistance :D (sorry in advance for any time lost to Lisp fun times)

6y agoHN ↗

Fennel is a Lisp that transpiles to Lua.

One of Neovim's goals is to make Lua a first-class citizen. Eventually, it will be possible to replace your init.vim with an init.lua. Making an init script in Fennel sounds like a great way to bring Emacs ideas to Vim, like how Emacs' evil-mode brought Vim ideas to Emacs.

Recently, Neovim got an official client for the Language Server Protocol merged into master. All the example configurations[0] are written in Lua.

[0]: https://github.com/neovim/nvim-lsp

6y agoHN ↗

For some time, I happen to use a machine with very very meh CPU performance. Turns out, popular scripting languages are slow, except for Lua. (And maybe also Perl, didn't check yet.) I thought that JS has fast start-up, but some Lua scripts of mine that do file IO are finished in less time than Node's ‘hello world’.

I now wish people used Lua everywhere instead of JS, Python or Ruby. Some are doing desktop programming in JS, for personal productivity software, like Alfred alternatives Zazu and Cerebro. Eeeeh nah, productivity software needs to be fast. Would be lots better to do that in Lua. And it's certainly a better idea for editor plugins than using Python.

Fennel transpiles code to Lua so fast that it's feasible for scripting, even on my machine.

I believe also that Lua might be able to do true parallelism, via libraries. (Haven't tried yet, though.)

6y agoHN ↗

I build Lua programs in prod. I use fennel or moonscript as the frontend, and everything runs on openresty (cli tools using resty and servers using the full stack).

Parallelism is enabled by a data flow architecture on top on nginx workers (compare TPL Dataflow in C# or Intel TBB in C++).

Concurrency is enabled using coroutines (nginx threads). It's virtually impossible to write blocking code and that's without any async or other bs in sight.

It's really fcking fast. Like, some parts of the overall arch are rust, but in the real, io bound world there's virtually no speed difference. Of course safety is good. But you get types and other neat zero cost abstractions for Lua using Haxe.

This Dataflow architecture also benefits from openresty built in concurrency safe queues, maps etc with atomic commit and cross worker access. Everything feels so damn effortless. I didn't have to do any work on making it scale. Just tweak the number of workers knob and boom, almost linear benefit. That's for rust and Lua, both awesome at parallelism in this case.

Anyway, even though I never write pure Lua, I still think it should have won against python (man did we try, even riding that ML wave).

I'm in love, but me is not many.

6y agoHN ↗

What sort of queueing mechanism do you use? I’ve bee trying to get into OpenResty but there are few documented examples of that kind of thing, and anything that does Dataflow is interesting to me.

6y agoHN ↗

I have been using guile on my rock pi to do multithreaded things (using guile fibers, which works over pthreads). It is not a big project, only an IRC bot. Heavily over-engineered with the goal of being able to process more IRC messages from more sources than anyone will ever need. It isnt usable yet, but it can handle all traffic a raspberry pi 4 can deliver which is close to 60 mB/s spread over 100 simulated channels. Currently each channel bot just tried to find the largest integer posted , so there are no IO bottlenecks.

Startup is instant once compiled, and compilation usually takes less than 0.5s depending on how much I changed.

6y agoHN ↗

Interesting to see. The Vim people at work are constantly harrasing us two Emacs users, claiming that lisp is old and silly, and that vimscript is good. Maybe change is acoming.

6y agoHN ↗

That sounds really strange to me. Even amongst major vim users and proponents I have never heard anyone say vimscript is good.

Maybe I don't get out enough.

6y agoHN ↗

Vimscript is good for setting simple configurations, but bad for large/complex software.

The Neovim team found that Lua seems to do both pretty well and has a fast implementation (LuaJIT), so they're trying to get Lua to be Neovim's primary extension language. Python and Javascript also seem to be popular languages for Neovim extensions.

6y agoHN ↗

In the official vote for Vim features, the top one was ‘stop extending Vimscript and improve Python integration instead’.

6y agoHN ↗

I'm a vim user, and the most attractive thing about emacs is that I don't have to write vs. I mean it really is that bad. Plus you have org mode, ivy, company, magit, and flycheck. There's plenty to be jealous about. Although you should be jealous that we have ALE and modal editing is far superior to the emacs defaults.

6y agoHN ↗

I'm the author, I've been in love with Lisp for years now (I'm a recovering JavaScript programmer) but refuse to leave Vim, Vim Script is absolutely awful for anything more than simple option setting in my opinion. Hence this massive detour into writing a plugin / library / framework to allow me to write better plugins.

I just wanted best of all worlds: My favourite editor with my favourite syntax without sacrificing any performance. If anything, my dotfiles should be faster now since there's less VimL which is damn slow to execute. I haven't benchmarked it though.

The Clojure world in Vim is getting better and better too thanks to various projects. My attempt at that is https://github.com/Olical/conjure

We also have really good s-expression editing plugins! Come on in, the water is full of parens :D

6y agoHN ↗

Standard Vim has support for Lua bindings. Does anyone know of a reason this wouldn't be applicable there as well?

6y agoHN ↗

Oh does it? Nice! I am a 100% Neovim user so I focus on that but if this works in Vim 8+ with minimal changes I'm totally open to pull requests to support / document it!

6y agoHN ↗

If I can find some time, maybe I will take a pass at it.

6y agoHN ↗

This is why I don't use neovim. VimScript is god awful (emacs lisp is also a pretty bad lisp imo), but this is just adding additional layers of complexity for no measurable gain in value. If I wanted to transpile to an equally bad scripting language and talk over RPC I'd just go become a front end developer (those web devs are out of control). I just want vim to start quickly, not crash, and generally get out of my way. Vimscript is good enough for any sort of scripting/plugins I want/need and I know it's going to just work.

6y agoHN ↗

This is why I don't use neovim ... this is just adding additional layers of complexity for no measurable gain in value

It's a plugin. It is not shipped with Neovim.

I just want vim to start quickly, not crash, and generally get out of my way

That's a very low bar, which indicates you definitely aren't Neovim's target audience. If you're happy with Vim, carry on.