clojure

amano 2025-08-25T09:44:08.828249Z

The future directions I want clojure to take • Basilisp (clojure on python vm) • Cherry (clojure to es6 module compiler) • Clojure to WASM compiler after https://component-model.bytecodealliance.org/ is finished

p-himik 2025-08-25T10:24:22.005259Z

Not sure what you mean. Aren't at least the first two already being pursued?

raspasov 2025-08-25T10:54:36.339999Z

Are you planning to act on any of those, or is this just a generalized wish list? WASM seems to be one of the with the most significant upside, but also the biggest unknown; I don’t know too much about WASM. It appears to have a lot of micro-hype. Still, I would love anyone knowledgeable to chime in with the current state of affairs in terms of performance, quality of GC with WASM, or any other relevant viability issues.

amano 2025-08-25T11:22:25.521219Z

I want money, time, and attention backing basilisp, cherry, and clojure to wasm compiler. Clojure and clojurescript already have a lot of money and manpower backing them. Right now, basilisp and cherry aren't thriving. This is just my personal wish list.

seancorfield 2025-08-25T13:28:52.019019Z

#basilisp #cherry #clojure-wasm #wasm all exist so you can ask in each of those how/if they are funded and what can the community do to help grow the user base. GitHub sponsorship by more individuals might be a good starting point? I guess there's an element of #spam-reports too around these projects. Personally, I have zero interest in those three. I'm more interested in seeing uptake of Squint than Cherry (I'm probably more interested in Squint than ClojureScript, TBH). And Clojure on the JVM has proven very solid for me for fifteen years for backend work. I think Jank and Basilisp etc are fascinating projects but I'm not their target audience.

amano 2025-08-25T15:01:47.246119Z

Why squint?

seancorfield 2025-08-25T15:12:37.224669Z

Narrows the distance between cljs syntax and js semantics -- makes it easy to add "cljs" to an existing js codebase, We have a massive React.js codebase at work -- I'd love to write new components in cljs without having to deal with the cljs/js data structure impedance (and I've tried it -- it works very nicely). Full-on cljs is harder to integrate into existing js like that.

👍 1
💯 1
🙌 1
amano 2025-08-25T16:03:16.379399Z

So, squint is suitable for javascript-centric projects. Cherry is still experimental. ClojureScript is good(?) for new projects. I think I will go with ClojureScript for my new project. Clojure + ClojureScript(re-frame, ...). I think ClojureScript is fine as long as javascript is minimized. I can't wait for neither cherry nor the non-existing clojure webassembly compiler.

seancorfield 2025-08-25T16:06:03.622439Z

I'm curious what the appeal of basilisp is, given all the work done on clj-python, and scicloj stuff?

amano 2025-08-25T16:07:10.963619Z

clj-python has bugs for long-running processes. I'd rather use plain python directly at this point because basilisp isn't yet ready although it is usable inside python venv. clj-python is more suitable for data science rather than long-running production servers.

seancorfield 2025-08-25T16:11:00.301189Z

Given how rock solid and heavily optimized the JVM is for long-running production servers, especially with multi-threaded support, I can't see much value in using Python for that. I thought you were interested due to data science but apparently not.

amano 2025-08-25T16:11:22.815809Z

I mean a long-running python server. You can have that in JVM through clj-python, but clj-python has issues.

seancorfield 2025-08-25T16:11:37.369819Z

Right, but why I guess is what I'm asking?

seancorfield 2025-08-25T16:11:52.501959Z

Why Python instead of the JVM for such processes?

amano 2025-08-25T16:12:08.255539Z

LLM inference server. Python has monopoly on LLM and AI.

seancorfield 2025-08-25T16:12:52.150029Z

Hardly a monopoly but I will concede it is popular among some folks 🙂

amano 2025-08-25T16:13:07.342109Z

For production, python is the only option.

seancorfield 2025-08-25T16:13:44.163069Z

That is objectively just not true. Perhaps in your opinion or perhaps in your specific circumstances.

amano 2025-08-25T16:14:13.959599Z

I mean if you want to run LLM inference fast and cheaply, python is the top player. Other languages don't even come close.

amano 2025-08-25T16:15:00.090359Z

So, it makes sense to use python for just LLM and AI.

seancorfield 2025-08-25T16:15:12.657419Z

So I guess, for you, it would be worthwhile to contribute to Basilisp -- through code, documentation, or sponsorship?

amano 2025-08-25T16:15:29.481539Z

I have neither time nor money for now.

seancorfield 2025-08-25T16:16:16.340749Z

Well, the situation is not magically going to change, without folks stepping up -- and that has to come from the folks who are vested in the success of it, which it sounds like you are.

amano 2025-08-25T16:16:39.286489Z

If my online business becomes successful, then maybe I can sponsor basilisp.

👍 1
👍🏻 1
💰 1
Balen 2025-08-25T19:23:55.983889Z

Amano, that’s really not true at all. Run LLM inference “fast” and “cheap”? No way Python is the top player for performance. And it doesn’t make sense at all.

raspasov 2025-08-26T01:13:41.866079Z

I don’t know too much about that space, but a few years back, I did do a bit of ML, and, yes, Python is by far the most widely supported in terms of ease-of-use. That being said, it probably just calls to some C libraries, so it’s not unthinkable that it can go through the JVM or anything else (with a bit more custom effort). Just a quick Google search for “LLM inference server java”: https://github.com/tjake/Jlama cc @amano.kenji . Wonder what the downsides are, if any. I.e., can you run models trained in Python without hassle, etc?

raspasov 2025-08-26T01:15:29.320379Z

The LLM space seems so hot right now that I would think that even though Python is the vast majority, other languages might have decently big ecosystems there, even if they are just a few percent of the total “LLM dev tools” market.

phronmophobic 2025-08-26T03:42:40.999959Z

> clj-python is more suitable for data science rather than long-running production servers. > clj-python has bugs for long-running processes. I'd rather use plain python directly at this point because basilisp isn't yet ready although it is usable inside python venv. > clj-python is more suitable for data science rather than long-running production servers. I don't think these are fair assessments of libpython-clj. We've had a similar discussion on https://clojurians.zulipchat.com/#narrow/channel/151168-clojure/topic/I.20got.20burned.20by.20haskell.2E/near/509053374, but I think libpython-clj works great. If there are actual reproducible issues, I think they would be could be addressed.

✔️ 1
phronmophobic 2025-08-26T03:45:15.857059Z

For running inference on the JVM, there are a few options: • https://github.com/phronmophobic/llama.clj • onnx, https://scicloj.github.io/clojure-data-tutorials/projects/ml/onnx/onnx.html • libpython-clj • https://scicloj.github.io/noj/noj_book.ml_basic.html

raspasov 2025-08-26T04:21:38.979579Z

@seancorfield, for just a bit of Clojure(Script) “flavor” in an existing React.js codebase, you can definitely use ClojureScript without the immutable data structures. Still, I am not sure if the benefit is worth the squeeze for such a setup anyway. Essentially, it would primarily be for developer convenience at that point, given Lisp/paraedit. It would take a bit of “discipline” to avoid the Clojure data structures, but in theory it appears possible:

(->>
  #js[#js{:a 1} #js{:a 2} #js{:a 3}]
  (eduction
    (map (fn [obj] (.-a obj)))
    (map inc)
    (map str))
  (into-array))

;;=> #js ["2" "3" "4"]

amano 2025-08-26T04:27:03.101269Z

I actually looked into https://github.com/tjake/Jlama. It is not suitable for production. It doesn't support all the GPU optimizations supported by python LLM inference libraries. It is largely for CPU inference. Optimizations available on python are vastly more numerous than on other languages. Even C++ LLM inference libraries lose to python LLM inference libraries. Python LLM libraries call C or C++, but even big tech companies use python for LLM and AI because there is no alternative to python for production, yet.

👌 1
raspasov 2025-08-26T04:30:12.075499Z

When you say “python LLM inference”, is that a wrapper for some C/C++ library that actually runs the inference (genuinely curious - I don’t know)?

amano 2025-08-26T04:30:33.054779Z

Python LLM libraries embed their own C/C++ code. They don't depend on third party libraries. It's possible for a python library to carry C/C++/Rust code.

raspasov 2025-08-26T04:31:05.831649Z

Interesting, wonder how that works.

amano 2025-08-26T04:31:44.859319Z

The discussion is over. Python is the only option for the foreseeable future. JVM ecosystem is trying to catch up, but don't wait for them. The vast majority of AI engineers work with python only.

raspasov 2025-08-26T04:32:16.700479Z

From a pure technical perspective, what does “embed their own C/C++ code mean”. Does that mean that they compile that part of the code as C++? In that sense, they would be more properly called “C++/Python” hybrid libraries.

raspasov 2025-08-26T04:32:34.807479Z

> The vast majority of AI engineers work with python only. Sure, no debate there.

amano 2025-08-26T04:33:14.475849Z

That's why I mentioned basilisp.

raspasov 2025-08-26T04:33:45.508559Z

What is the Python library of choice for running production inference?

raspasov 2025-08-26T04:34:12.703289Z

(prob move to #off-topic )

amano 2025-08-26T04:34:17.611679Z

Nvidia has its own library. I don't remember the name. There is a GPU-agnostic LLM inference library, too. I don't remember the name as well.

amano 2025-08-26T04:35:23.256399Z

There's enough impedance between python and libpython-clj that I'd rather use plain python directly for production servers. There are also unresolved issues regarding long-running libpython-clj servers.

amano 2025-08-26T04:41:56.452199Z

If basilisp gains project management tooling, it might be quite suitable for python projects. ClojureScript can cover web browser for the foreseeable future.

raspasov 2025-08-26T04:43:18.335849Z

https://github.com/NVIDIA/TensorRT-LLM/blob/rel/docs/source/architecture/overview.md I assume this is the “NVIDIA” library

raspasov 2025-08-26T04:43:25.872289Z

> The C++ runtime is the recommended runtime.

amano 2025-08-26T04:43:34.152669Z

Yes, TensorRT-LLM. That's the nvidia library.

raspasov 2025-08-26T04:51:14.707799Z

Sure, you can call this a Python library. But, afaict, it’s a C++ library with a Python API wrapper. But it also has a C++ API. Which is to say that you can most definitely call that directly from Java. Def not as convenient but it should be possible.

amano 2025-08-26T04:51:39.710319Z

I'd rather just write python. That's far easier.

raspasov 2025-08-26T04:51:50.126409Z

Yeah I’m sure.

amano 2025-08-26T04:52:47.787649Z

I'm a practical guy. Not everything has to be written in clojure or any single language.

raspasov 2025-08-26T04:53:03.202079Z

Yeah sure. They even give you a Docker setup.

raspasov 2025-08-26T04:53:17.626619Z

You barely have to do anything yourself, you can just get JSON out.

phronmophobic 2025-08-25T22:54:07.266729Z

I've always thought error messages would best be addressed by improved tools. Now that I'm building my own IDE, I would like to contribute to the problem. I'm currently on step 0 and am trying to collect information on the topic. I would love any pointers to any resources that I've missed. See 🧵

💯 6
emccue 2025-08-28T16:19:45.842739Z

I'm building my own IDEYou're building your own IDE?

phronmophobic 2025-08-28T16:46:34.443849Z

I am! #easel

emccue 2025-08-28T16:47:52.597229Z

is this a clojure specific ide

emccue 2025-08-28T16:47:59.490599Z

also tracking down your github now

phronmophobic 2025-08-28T16:50:40.952439Z

> is this a clojure specific ide It's an IDE written in clojure and the primary target programming language is clojure. Easel itself has relatively little to say about clojure, but most of the "applets" (I still haven't thought of a better name) are focused on clojure programming. I'm not opposed to supporting other languages, but it's definitely not a priority.

emccue 2025-08-28T16:51:25.894769Z

understood; i'm just working on my java course and want to give people an IDE that doesn't have AI nonsense enabled by default

👍 1
emccue 2025-08-28T16:51:42.677569Z

right now i'm using vscodium but - unideal

phronmophobic 2025-08-28T16:52:35.886239Z

Ah ok. My goal is "IDE as a library" so that anyone could build their own IDE without starting from scratch, but it's not there yet.

emccue 2025-08-28T16:52:46.343899Z

yeah i'll leave you a few years to cook

1
emccue 2025-08-28T16:53:13.459099Z

but either Java or JavaScript would be the natural second languages to support, given those are what clojure is hosted on

emccue 2025-08-28T16:53:32.800079Z

at the very least the ability to click to def/decompiled def on a java library you are using from clojure

phronmophobic 2025-08-28T16:54:01.864609Z

The syntax highlighting is done by tree sitter, so there's already syntax highlighting for java, javascript, and a bunch of other common langs.

phronmophobic 2025-08-28T16:55:28.653389Z

However, it's basically just text mode with syntax highlighting for all non-clojure languages. You would probably want something like LSP support with autocompletion and stuff to make it usable.

phronmophobic 2025-08-28T16:56:58.418739Z

Anyway, once it's generally usable for clojure, it would be interesting to try some other use cases.

daveliepmann 2025-08-26T07:03:43.892069Z

This CIDER discussion touches on different ways to present errors, and has some examples of errors at different stages (ctrl-f repl.cider-error-examples, based on https://clojurians.slack.com/archives/C03S1KBA2/p1683143432992029?thread_ts=1683142572.115519&cid=C03S1KBA2) that I found helpful for testing https://github.com/clojure-emacs/cider/discussions/3338

🔥 1
🙏 1
daveliepmann 2025-08-26T08:53:52.400809Z

Shriram Krishnamurti and the Racket folks also have things to say about IDE error handling https://parentheticallyspeaking.org/articles/pedagogic-ide/ (esp. section 4). IMO their approach is one of the most rigorous. They have the advantage of a large volume of captive subjects to test on.

🚀 1
Gent Krasniqi 2025-08-26T08:55:14.317749Z

There's usually praise for Rust's compiler errors as well, but I think their main inspiration was Elm, which you're already looking at. https://kobzol.github.io/rust/rustc/2025/05/16/evolution-of-rustc-errors.html I would maybe look at the Lem editor if they're doing anything interesting with error messages and/or debugging, since it's a somewhat similar (though less visual) project.

👍 1
gaverhae 2025-08-26T09:21:59.912389Z

If the goal is to make a beginner-friendly IDE with an integrated REPL, I think having a visual distinction between evaluation results and printed output could be really useful. Not exactly error handling, though.

👍 1
💯 1
hrtmt brng 2025-08-26T11:30:06.916669Z

I think, you are asking a more general question. How to do output/error handling? Imagine you develop a function. Sometimes you want to call this functioin from other Clojure code and you want to capture errors. Sometimes you want to call the function from the command line (via Babashka) and you want to see the errors pretty printed and well explained. Sometimes you want to call the function from a GUI and you want the errors be in a logging window. Sometimes you want the errors in a logging system. Sometimes you want a progress bar, sometimes not. There are numerous situations and it would be nice to have one simple approach for all of them. Is this your question?

phronmophobic 2025-08-26T16:10:54.751739Z

"Error Messages" consistently show up at the top of folks' wishlists for clojure. I'm basically trying to figure out what people mean by "Error Messages". I'm working on a clojure IDE and I think there's a big opportunity to make some progress on the problem. Right now, I'm just trying to gather info so that I can start breaking down "Error Messages" into smaller, more tangible problems.

👍 1
2025-08-26T16:18:29.010159Z

in clojure specifically, there are a number of issues with error messages that have persisted across versions, such as incorrect line numbers, java-based exceptions (pointing to java impl code, not user code), spec output being hard to parse, and clojure.core code not being written with an eye for failure (GIGO/"optimized for correct programs")

phronmophobic 2025-08-26T16:21:46.329079Z

@nbtheduke part of the process will be teasing out these different issues. Some (maybe most?) of them can be addressed by the IDE. > clojure.core code not being written with an eye for failure (GIGO/"optimized for correct programs") As an example, one of the interesting ideas I came across was replacing clojure.core at dev time with a version of clojure.core that does more argument checking. Edit: It was this talk by Colin Fleming. Cursive already supports this! The checks in cursive are static, but this could also be done dynamically. https://youtu.be/kt4haSH2xcs?t=1908

phronmophobic 2025-08-26T16:23:26.540319Z

> spec output being hard to parse This is clearly an area where an IDE could help.

2025-08-26T16:29:33.857029Z

i don't think i agree, but i'm interested to see what you come up with

phronmophobic 2025-08-26T16:31:53.067169Z

> i don't think i agree Which part? Is there a link with more info? If not, no problem. It's a long term project and I hope to have more to show in the future.

2025-08-26T16:53:26.191169Z

let me rephrase. i think that a dedicated IDE with a dev-focused version of clojure could do a lot to improve the error situation for its users, but i don't think that it would be generalizable for most clojure devs (i'm never switching from neovim, for example), and I think most of the potential changes you make could or should exist in clojure.core itself instead

2025-08-26T16:54:13.060369Z

and without a patched version of clojure, i don't think most are fixable

2025-08-26T17:01:16.272159Z

line numbers can't be fixed in a library as the bugs come from the Compiler code. spec errors are incomprehensible without documentation, and both spec and the compiler don't support those, so you can't fix it with a library. java-based exceptions could be caught and parsed by the IDE/library but the required checks and manual throws would be fastest and most helpful from within clojure's java code. only the clojure.core itself could be monkeypatched by a library

2025-08-26T17:02:16.373209Z

using a custom version of clojure means incompatibility with other custom clojures, such as flowstorm

phronmophobic 2025-08-26T17:03:50.886759Z

I don't remember ever running into a problem with line numbers. Is there a link for that?

2025-08-26T17:05:05.966549Z

here's one, but i found many working on a recent clojure patch https://ask.clojure.org/index.php/13605/number-reported-exceptions-thrown-generated-destructuring

🙏 1
2025-08-26T17:25:34.790889Z

(here's the one i ran into while writing a patch: https://clojure.atlassian.net/issues/?selectedIssue=CLJ-2822)

👍 1
phronmophobic 2025-08-25T22:54:24.649779Z

In alphabetical order: https://ask.clojure.org/index.php/13044/interest-in-beginner-friendly-variant-of-pst https://ask.clojure.org/index.php/8343/display-clojure-stacktraces-planned-attacked-clojure-version https://cljdoc.org/d/djblue/portal/0.61.0/doc/guides/exceptions?q=exception#exceptions https://cljdoc.org/d/org.clj-commons/pretty/3.6.3/api/clj-commons.format.exceptions https://clojure.atlassian.net/browse/CLJ-2373 https://clojure.atlassian.net/browse/CLJ-2373 https://clojure.atlassian.net/browse/CLJ-2420 https://clojure.github.io/clojure/clojure.main-api.html#clojure.main/ex-triage https://clojure.github.io/clojure/clojure.stacktrace-api.html https://clojure.org/news/2018/12/17/clojure110 https://clojure.org/reference/repl_and_main#_error_printing https://clojurepatterns.com/series/error-handling-patterns-in-clojure/ https://clojureverse.org/t/improving-error-messages-in-clojure-as-a-library/1765 https://clojureverse.org/t/introducing-clem-the-clojure-error-mediator/7468 https://clojureverse.org/t/nice-error-messages/10684/2 https://clojurians.slack.com/archives/C053AK3F9/p1688277848508509 https://developer.apple.com/documentation/xcode/stepping-through-code-and-inspecting-variables-to-isolate-bugs https://docs.cider.mx/cider/usage/dealing_with_errors.html#navigating-stacktraces https://elm-lang.org/news/compiler-errors-for-humans https://ericnormand.me/article/clojure-error-messages-accidental https://ericnormand.me/article/wrangling-clojure-stacktraces https://errors.haskell.org/ https://flow-storm.github.io/flow-storm-debugger/user_guide.html#_exceptions_debugging https://github.com/BetterErrors/better_errors https://github.com/always-be-clojuring/issues/issues/7 https://github.com/bhb/expound https://github.com/clojure-emacs/cider/issues/2443 https://github.com/clojure-emacs/haystack/tree/master https://github.com/clojure/core.specs.alpha https://github.com/elm/error-message-catalog https://github.com/magnars/prone https://github.com/mhuebert/maria/blob/main/friendly/src/maria/friendly/messages.cljs https://github.com/mmcgrana/clj-stacktrace https://github.com/phronmophobic/reveal-exception https://github.com/venantius/pyro https://github.com/yogthos/clojure-error-message-catalog https://gitlab.com/unc-app-lab/clem-repl/ https://insideclojure.org/2018/12/17/errors/ https://insideclojure.org/2019/01/18/journal/#clojuremain-errors https://jank-lang.org/blog/2025-03-28-error-reporting/ https://lambdaisland.com/blog/2022-04-07-Clojure-Error-Messages https://tonsky.me/blog/sublime-clojure/#exceptions https://tutkain.flowthing.me/#dealing-with-exceptions https://www.infoq.com/presentations/Clojure-Stack-Trace/ - https://raw.githubusercontent.com/strangeloop/clojurewest2012-slides/refs/heads/master/StackTraces-Longbottom-Chouser.pdf https://www.reddit.com/r/Clojure/comments/778tc2/is_clojure_19_improving_error_messages/ https://www.reddit.com/r/Clojure/comments/cufp96/whats_the_state_of_error_messages/ https://www.youtube.com/watch?v=kt4haSH2xcs https://www.youtube.com/watch?v=o75g9ZRoLaw https://zencastr.com/z/xrPd6_by

practicalli-johnny 2025-08-26T06:43:39.490909Z

I greatly simplified my logging experience by adopting event logs approach with https://github.com/BrunoBonacci/mulog which also has log publishers for popular log aggregation tools. I also use a publisher to tap> logs to Portal.

👍 1
hkjels 2025-08-26T06:54:24.024979Z

What a cool endeavour. I assume you are writing your IDE in Clojure? We've done something similar as to what @jr0cket mentioned and are pretty happy about it.

👍 2
jyn 2025-08-29T10:54:57.323919Z

> The syntax highlighting is done by tree sitter how did you get that working? i want to use tree-sitter for my project but i ran into a lot of trouble getting started, i would love to compare notes https://clojurians.slack.com/archives/C03S1KBA2/p1756464839508899