Hacker Dudes// alternate deck. same feed.
FEED ~12/h Δ0 ────:──── LINK ░ SIGNAL
95%
SPOOLED 0/45 CYCLE 61339.697.119.19
Jank – The native Clojure dialect with seamless C++ interopjank-lang.org
194pts/50 comments/4d/─
by giancarlostoro / hn> / « feed
▲▼ goldenshale02:02 hn>

I think repl driven development with access to native code could be a magic formula for agent engineering. No restarting, no re-compiling. Plus with persistent, immutable data structures you can iterate with many threads in parallel while maintaining sanity.

▲▼ s_Hogg04:47 hn>

The first thing that comes to mind with no restarts or recompiling is the mangled variables you get in Jupiter if you're mucking around trying to get a prototype going and forget which cells have been run. I can definitely see agents having a problem with that. I would just try to make compilation fast if possible

▲▼ kianN06:20 hn>

Immutability and stateless separate the nrepl from jupyter. Clojure is not strictly functional but it tends to be the most straightforward way to do most tasks in the language.

─ 4 more ─
▲▼ chr15m06:29 hn>

People who are already using LLMs to drive Clojure REPLs say it works well (see #ai-driven-development on the Clojure Slack). I don't think forgetting which cells have been run is a problem with the described set up.

─ 2 more ─
▲▼ jwr07:45 hn>

It is. I'm amazed at how quickly agents can work with my Clojure code base and try things out. They make great use of the REPL.

▲▼ tikotus08:07 hn>

Can it already reliably close parens? I was disappointed some time ago, but sounds like it's ready for a new go...?

─ 8 more ─
▲▼ bokchoi16:58 hn>

I dabble with clojure for some hobby projects. What's the preferred way of setting up the agent to use the repl these days? I had trouble getting the agent to use it in the past.

─ 2 more ─
▲▼ pjmlp07:57 hn>

Welcome to the previous AI Summer with Lisp and Prolog environments, :)

Pity that the new Summer got to ride an interpreted language, with bindings to native libraries instead.

▲▼ Capricorn248116:37 hn>
>no restarting, no re-compiling

Is this really a problem with agentic programming? I have done some pretty complex tasks with it and I never thought "this would go a lot faster if the compilation speeds weren't slow." Seems like the time Claude takes dwarfs any build time.

I am not working on 1M+ LOC codebases though, so I could see how slow compilation times could be a problem then, but I imagine the agentic part would also slow down.

▲▼ mike_ivanov16:45 hn>

Ask them what they prefer.

▲▼ iLemming19:40 hn>
>Is this really a problem with agentic programming?

State management is generally considered a difficult and complex problem. When you give a way for the agent (or a human programmer) to iterate on stuff without having to reset the state, without having to restart anything, without any (manifestly impractical) rituals, the programmer/agent stops guessing and starts empirically assessing the current state of things and reasoning about the problem space in a much tighter loop, procuring solutions that cost fewer tokens, time and effort.

Imagine building something like a Flappy Bird game, and having to recompile whenever you tweak a moving object's trajectory calculation. What would be simpler - having the programmer mess around with values live, or having to re-compile, restart, reset the state to that point, and check where things stand?

Programming with a Lisp REPL often feels like playing a video game. It's not just fun, it makes far better sense (in comparison)

─ 4 more ─
▲▼ alper09:34 hn>

Is this like Janet?

▲▼ fp6410:20 hn>

It's full Clojure, immutable and stuff, with full C++ interop and native compilation. Janet is strongly Clojure influenced but more of an embedded scripting language. I like both quite a bit.

▲▼ phillc7310:48 hn>

The beautiful thing about Janet is how lightweight and portable it is, no JVM.

I use Janet for all my agentic scripting. Python is forbidden in my harness. Janet scripts for everything. Love it.

─ 4 more ─
▲▼ delegate14:54 hn>

jank is Clojure, but instead of the JVM it embeds Clang and LLVM, so it can understand C++ headers directly and call C++ with no bindings. Other LLVM languages (Rust, Swift, Zig, etc) are reachable the usual way, through the C ABI.

From the TFA:

Templates, virtual functions, exceptions, overload resolution, and RAII all just work in jank. No boilerplate necessary. Just include your headers and go! jank can include any C++ source, link to any C or C++ library, and it uses the C++ type system. jank even compiles to C++!

▲▼ mike_ivanov16:46 hn>

More like Jolt

▲▼ e12e16:08 hn>

Wonder how this compares to clasp (common lisp c++ impl)?

▲▼ Jeaye17:36 hn>

Very different approach. I've commented on it here: https://news.ycombinator.com/item?id=50212578

▲▼ onlyrealcuzzo16:41 hn>

This is quite cool.

``` jank is C++ jank can include any C++ source, link to any C or C++ library, and it uses the C++ type system. jank even compiles to C++! ```

I'd recommend saying that it lowers to C++ earlier, as I imagine most people are interested in that aspect of how it works.

```jank is Clojure on top of C++``` -> `on top of` could mean many things. I'd recommend just saying it transpiles to C++. Then, the pros and cons that come from that flow naturally.

``` Use your favorite nREPL editor plugin. jank contains an LLVM-based JIT runtime to compile C++ code on the fly. ```

This is true for anything written in `jank`, right? But presumably not for your C++ dependencies? Like if you have `jank` code which depends on data managed in a different C++ library.

It would seem there are a lot of concurrency and parallelism implications to this. It would be nice if you spelled that out.

``` jank builds upon Clojure Keep your existing code; unlock the native world. ```

Are there any limits here? You might want to make that clear if not. Unless explicitly stated, my assumption is that it won't always work (and therefore is mostly irrelevant). Though, in this case, it might actually always work - so that would really be worth a few extra words!

▲▼ flavio8117:16 hn>

PSA: If you need a Lisp that talks to C++, Common Lisp has had seamless C++ interop in the few years thanks to the CLASP implementation. It should be fairly mature by now, I understand it was born to be used in serious projects.

▲▼ Jeaye17:34 hn>

CLasp is the OG Lisp/C++ combo, but its interop is nowhere near seamless. Last I checked, Clasp requires that functions, types, and values must be registered, from C++, before being accessible in Lisp. This requires you to build a bridge between these two worlds, in C++ code. That's a huge seam.

In jank, you just require the C++ headers, like you would in C++, and then you access whatever you want from them, like you would in C++. jank's type system is the C++ type system. jank also compiles to C++. jank includes a Clang-based JIT C++ compiler to make all of this possible.

▲▼ spauldo22:56 hn>

Clojure and Common Lisp are very different beasts.

▲▼ Jeaye17:45 hn>

Hey folks. I'm the jank creator.

jank is a full Clojure dialect with unprecedented C++ interop. Unlike the OG Lisp/C++ combo, Clasp, there is no bridge API necessary for registering C++ functions, types, or values. jank can seamlessly interop with any C++ by just including the headers. Interop includes template instantiations, overload resolution (implicit conversions, ADL, etc), exception throwing/catching, virtual function calls, and literally everything else.

jank _is C++_, since it compiles to C++ and uses the C++ type system. It ships with a Clang-powered JIT C++ compiler to make all of the REPL goodies work. jank also improves upon the C++ build ecosystem with Cargo-like tooling.

This means you can use jank to make C++ native applications, you can embed jank into your C++ applications, or you can even use jank to just write portable Clojure libraries that people use from other Clojure dialects.

We're still in alpha right now, so things are a bit unstable. We're targeting a more stable beta release in January. The best way you can help is to try jank out and report every friction point you have on Slack, Discord, or Github.

I've been working on jank for several years. It is not vibe-coded.

▲▼ pkphilip03:56 hn>

Thank you for your work

▲▼ Jeaye17:05 hn>

You're welcome! It's work I'm happy to do.

▲▼ hoppp22:18 hn>

I wish we had this a couple of years ago when I was super into clojure. Very nice stuff!