dev-tooling

borkdude 2023-07-18T10:31:30.291959Z

From this perspective, it makes sense that the streaming "envelope" format is bencode and not json: https://clojurians.slack.com/archives/C02165ZDU9E/p1689466408927169 I've tried several JSON parsers in the clojure ecosystem for streaming but none of them seem to support it well without a lot of hoop jumping. I've never encountered this problem with bencode in any language and even if I did, it's possible to hand-roll something in one afternoon

👍 1
bozhidar 2023-07-21T12:38:00.135059Z

Yeah, streaming JSON is really hard. That's why I've never been very fond of it.

borkdude 2023-07-21T13:50:13.182509Z

"That's why I've been very fond of it." => bencode, you mean, right?

bozhidar 2023-07-21T13:50:49.115209Z

+ never 🙂 This was for JSON.

bozhidar 2023-07-21T13:50:55.875619Z

I'm a master of crazy typos. 😄

borkdude 2023-07-21T13:51:07.975949Z

👍

borkdude 2023-07-21T13:51:27.646119Z

I'm also re-confirmed in my decision to blindly copy bencode for bb pods ;)

pez 2023-07-18T11:37:43.221329Z

☝️ @ingy

Ingy döt Net 2023-07-18T13:35:20.892799Z

Greetings! My name is https://github.com/ingydotnet/ and I was invited here by @pez. I helped invent and currently maintain the https://yaml.org/. A few months ago I started writing a Clojure platform called https://github.com/ingydotnet/lingy. Lingy intends to target host languages currently lacking a Clojure, starting with Perl. Lingy wants to take Clojure concepts deep into Perl including compiling to some JITing VM (tbd). @pez already has me working on an nREPL implementation for integration with Calva and other Clojure editors! I also started a sister language called https://github.com/yaml/yamlscript that is really just an alternate syntax reader for Clojure platforms. At https://tprc.to/tprc-2023-tor/ last week I gave a talk about https://www.youtube.com/watch?v=9OcFh-HaCyI. I'm extremely pleased that it got noticed by @pez and led me to this amazing place. Among other things, a top goal of both Lingy and YAMLScript is to bring more programming communities together. Please stop by the new #lingy and #yamlscript channels and let's chat!

2
👋 4
snoe 2023-07-21T21:06:16.995399Z

It'd be great if you could also see what it would take to get kondo / clojure-lsp analysis working for your new host dialects. Often it's just making it aware of interop differences and missing/added core functions.

🙏 1
pez 2023-07-21T21:12:44.718019Z

@snoe (and everyone, really). The Discussions are enabled for the Lingy repo: https://github.com/lingy-lang/lingy/discussions I have started some threads there, with things I have started to think about needs addressing. Would be great with input like ^that^ there as well.

👍 1
👍🏻 1
lread 2023-07-18T13:45:12.306019Z

Welcome @ingy! You might be interested in https://github.com/clj-commons/clj-yaml, a thin wrapper over SnakeYAML, usable from Clojure and Babashka. #clj-yaml

Ingy döt Net 2023-07-18T14:04:32.659659Z

Hi @lee! I'm very familiar with SnakeYAML. I am more interested to know if there is a more pure (lisp) YAML implementation in Clojure. If there is then I could easily port it to YAMLScript, and thus have a YAML framework written in YAML 😄

Ingy döt Net 2023-07-18T14:05:12.770099Z

But great to know about clj-yaml for real usage.

lread 2023-07-18T14:06:38.602389Z

I don't know of anyone who has taken on writing a YAML implementation in Clojure. So you could be the first!

oyakushev 2023-07-18T14:14:25.156039Z

@ingy It is common in Clojure world to leverage high-quality Java libraries, either directly via interop or through thin idiomatic wrappers, instead of rolling a pure Clojure implementation.

oyakushev 2023-07-18T14:15:11.356129Z

There are 2 reasons for that: 1. The performance is usually better in a Java implementation. 2. This compensates for the Clojure community being significantly smaller than Java's.

Ingy döt Net 2023-07-18T14:18:04.341019Z

@alexyakushev that makes sense. And I Lingy can already use Perl's YAML modules directly. But a pure Lisp reference parser would be a valuable learning tool. And encoding that in YAML would be a pretty cool asset for YAML framework authors to reference.

oyakushev 2023-07-18T14:19:11.248309Z

Of course, writing something from scratch is often a good learning exercise :).

Ingy döt Net 2023-07-18T14:19:48.680639Z

I've written a YAML reference parser https://github.com/yaml/yaml-reference-parser in multiple languages. Would like to have a functional lisp version in there. 🙂

👍 1
seancorfield 2023-07-18T16:07:56.986809Z

@alexyakushev Another reason for a pure Clojure implementation would be a potential ClojureScript port...

Ingy döt Net 2023-07-18T16:15:17.447199Z

Good point. And thus Lingy (Perl, etc) implementation!

Ingy döt Net 2023-07-18T16:16:32.853709Z

Implementing YAML correctly is... hard.

Ingy döt Net 2023-07-18T16:17:17.572549Z

Maybe porting from another functional framework like HsYAML is the best approach.

oyakushev 2023-07-18T16:22:22.451199Z

@seancorfield Sure! Not dissuading, just explaining why things are the way they are now.

👍 1
👍🏻 1
Ingy döt Net 2023-07-18T16:26:17.713139Z

related to that, does Clojure bind well to FFI / C-based shared libs?

Ingy döt Net 2023-07-18T16:26:54.774339Z

I'd guess it's possible but not preferred

Ingy döt Net 2023-07-18T16:33:19.870329Z

I'm in the planning phase of a project I call YAMLStar which is a full-yaml-stack framework implementation ported to 42 languages (I often say "42 languages" to mean all langs I can) such that they all are fully correct, compatible and expose the same functionalities.

Ingy döt Net 2023-07-18T16:35:02.096079Z

Most of the work is done by libfyaml, with a thin veneer in the hosting language. But for JVM languages maybe I should do this as a clojar.

Ingy döt Net 2023-07-18T16:36:36.602369Z

Speaking of which, I have yet to publish a JVM package. Anyone know where to look here or elsewhere to make that easier?

Ingy döt Net 2023-07-18T16:38:30.737129Z

I do have a sonatype account setup. But I recall maven publishing and clojars publishing being a lot of work last time I tried, and didn't get it all figured out.

oyakushev 2023-07-18T16:48:18.936889Z

> does Clojure bind well to FFI / C-based shared libs? Clojure's story is exactly equal to Java's, and the latter is... not optimal. You can do it if you must, but it's not very convenient, has certain limitations and performance tradeoffs. And certainly not beginner-friendly (for the person that has to write the bindings).

Ingy döt Net 2023-07-18T16:49:05.569679Z

What I expected 🙂

oyakushev 2023-07-18T16:51:07.188579Z

Publishing to Clojars is very easy if you use either Leiningen or tools.deps as a build tool. All those repositories (Sonatype, Maven Central, Clojars) have the same API, and the same tools/commands are used to publish to either. The difference is only in the amount of organizational ceremony at the repository side. Clojars is probably the easiest to push to (doesn't require signing, gives a groupId by default that doesn't need domain name verification, etc) from scratch.

Ingy döt Net 2023-07-18T16:52:29.140869Z

Not requiring signing is 👍 for me making progress. thanks

oyakushev 2023-07-18T16:52:45.345079Z

This is the tutorial how to do it with Leiningen, with tools.deps it's a bit of "make your own build tool from parts", but similar guides exist for it. https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md#publishing-libraries

👍 1
Ingy döt Net 2023-07-18T16:55:17.335139Z

I will try again very soon.

seancorfield 2023-07-18T16:56:29.341029Z

https://clojure-doc.org/articles/cookbooks/cli_build_projects/ for deps.edn / tools.build (which links to the official guides which you'll need to read first).

✅ 1