lingy

Rachel Westmacott 2023-07-20T09:10:36.376599Z

@peterwestmacott has joined the channel

Rachel Westmacott 2023-07-20T09:12:01.301049Z

I came here because I'm intriuged that the

example in the lingy readme is able to call functions that have not yet been declared (without forward declaration).

pez 2023-07-20T09:33:44.109449Z

I’ve also been curious about that. Looks funny with main being the first function defined! 😃

Ingy döt Net 2023-07-20T13:14:59.333249Z

I've read https://gist.github.com/reborg/dc8b0c96c397a56668905e2767fd697f#why-clojure-compiler-is-single-pass-arent-many-possible-optimizations-lost-this-way Lingy (this first Perl implementation) evolved from code I wrote for a Mal https://github.com/kanaka/mal implementation. Mal evaluation does not need pre-declaration either. https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L2793 just def unbound vars. Mal doesn't have vars (to keep things simple I guess) and Lingy has not yet implemented vars.

Ingy döt Net 2023-07-20T13:16:24.945159Z

And I learned here a couple days ago that clojurescript doesn't have vars either, though I'd assume it requires predeclaration.

Ingy döt Net 2023-07-20T13:17:52.895299Z

Lingy has declare implemented, but essentially useless. I guess that means I could "fix" the examples by pre declareing main 😄

Ingy döt Net 2023-07-20T13:20:32.317559Z

I'm not yet aware of if/when Lingy will require predeclaration. Perhaps when it takes on actual compilation.

pez 2023-07-20T13:25:09.737589Z

I think that at some point it should be that any code written for Lingy 1.0.0 should keep working in Lingy 9999.99.99, to stay true to the philosophy of Clojure.

😂 1
✅ 1
2023-07-20T23:29:39.944709Z

People say JS has "reach", but Perl has reach and threads. Not offshore "workers" but actual threads! Right? So, we're talking, like, one-quarter of the use-cases for Clojure that could be fulfilled best-of-all by a Perl host for Clojure programs. Browsers are ClojureScript, heavy-duty servers are Clojure, mobile apps are ClojureDart... but the (mis)use of ClojureScript for its quick startup, in Node.js, for uses in the general genre of "things Perl is good at" is a disease.

2023-07-20T23:32:29.358959Z

If the Clojurish-in-Perl modules also ran in Clojure, or in other words, if no features peculiar to Lingy were used, then I could apply modules conceived from laziness, impatience and hubris in apps of all kinds everywhere. Maybe this is what they had in mind with the recent Clojure build tool that pulls source from Github, skipping the middleman of Maven or NPM. I have recently dazzled myself with the thrill of applying one core "cljc" module in apps (with distinct interfaces) in Clojure, ClojureScript (browser), ClojureScript (Node), and ClojureDart. It is almost unbelievable! However, already, little differences between those dialects create a headwind for common modules. For example ClojureScript's different rules about case and Clojure's lack of ClojureScript's :default catch already require would-be cross-host contributors to put in extra effort.

Ingy döt Net 2023-07-20T23:35:25.808759Z

@phill makes perfect sense to me. I hope we can pull it off!

Ingy döt Net 2023-07-20T23:36:48.406749Z

My goals for lingy come from a few different places. But they are not in any disagreement with you.

Ingy döt Net 2023-07-20T23:38:30.916729Z

Lingy started conceptually as a runtime for YAMLScript, so would want to be whereever YAML is used, which is just about everywhere.

Ingy döt Net 2023-07-20T23:39:36.044619Z

I just happen to be able pull off things most quickly in Perl. (I have 200+ dists on CPAN)

Ingy döt Net 2023-07-20T23:40:26.214409Z

But then I started loving Clojure and wanting it to solve Perl problems like Clojure solved Java probs

Ingy döt Net 2023-07-20T23:41:20.379409Z

And I want core Lingy to differ as littel as possible from core Clojure

Ingy döt Net 2023-07-20T23:41:56.597469Z

Like clojure/core.clj will be used directly

Ingy döt Net 2023-07-20T23:42:34.490519Z

with the necessary Java->Perl class name mapping etc.

Ingy döt Net 2023-07-20T23:43:46.231579Z

I'd also like to figure out a monumental task of compiling lingy code into a "VM" bound into the Perl runtime.

Ingy döt Net 2023-07-20T23:44:17.389669Z

such that Perl stuff written in Lingy was C order of magnitude fast

Ingy döt Net 2023-07-20T23:45:01.155429Z

I've already published CPAN modules writen in Lingy (actually YAMLScript)

2023-07-20T23:45:34.310609Z

Yes, so glad the link to your presentation at Perl + Raku was posted here. So exciting

Ingy döt Net 2023-07-20T23:45:38.648279Z

anyway, I'm glad you have some excitement here and also don't have a perl gag reflex

2023-07-20T23:45:59.097229Z

Oh what I like about Clojure is that it brought some of the Perl wit to the dull JVM!

Ingy döt Net 2023-07-20T23:47:34.525549Z

Larry told me once (in his kitchen the day John McCarthy died) that Perl was most influenced by Lisp.

Ingy döt Net 2023-07-20T23:49:15.027039Z

What he actually said was that way back when in the early days of Perl he was giving a talk and said that "Lisp has all the visual appeal of oatmeal with fingernail clippings mixed in"...

Ingy döt Net 2023-07-20T23:49:35.784589Z

And apparently McCarthy was in the audience but Larry didn't know it

Ingy döt Net 2023-07-20T23:49:50.961899Z

And McCarthy was displeased.

Ingy döt Net 2023-07-20T23:50:35.617149Z

But Larry pointed out that he meant exactly the "visual" appeal

Ingy döt Net 2023-07-20T23:50:59.806089Z

And that Lisp was the biggest influence otherwise

Ingy döt Net 2023-07-20T23:51:30.443219Z

But then so many people have a visual gag reflex to Perl 😄

Ingy döt Net 2023-07-20T23:52:13.297079Z

Clojure is good about lessening the paren soup

Ingy döt Net 2023-07-20T23:53:32.907829Z

But yeah the Perl runtime is like a lisp w/ compile time and runtime not cleanly separated

Ingy döt Net 2023-07-20T23:53:50.779139Z

Perl also catches hell for that sometimes

Ingy döt Net 2023-07-20T23:54:58.817079Z

I think that Lingy Perl conf video got noticed by a bot looking for java news or somesuch

Ingy döt Net 2023-07-20T23:55:25.652429Z

It got way more views that the other talks.

Ingy döt Net 2023-07-20T23:55:57.203069Z

I'll have to put the word Java in all my talk descriptions from now on

2023-07-21T00:00:39.951069Z

The VM is an interesting prospect. But you never know. I made one program in Java, and it took 8 hours to run. I used concurrency and got it down to 1 hour but every once in a blue moon it hung up and never terminated, a bug I never tracked down. I ported it to Clojure, taking advantage of the Clojure ways of doing things, and the program ran in 10 minutes. Same JVM. The difference is, that when you can easily let the machine "work smarter, not harder", without doing crazy-inefficient things like making "safe copies" or delegating to XSLT for structured data, it sometimes turns out that the big job was not such a big job after all; the hardness came from the tool, not the task.

✅ 1
Ingy döt Net 2023-07-21T00:01:37.313989Z

Great story.

Ingy döt Net 2023-07-21T00:05:30.532069Z

Lingy values are immutable now, but using terrible techniques for performance and memory. I'm working to get stuff on par with Clojure HAMTs and the like. The tricky part is to also make them close to first class on the perl side (in CPAN modules and stuff unaware of being called by Lingy).

➕ 1
Ingy döt Net 2023-07-21T00:07:03.204379Z

Another goal of Lingy (more recent goal) is to try to get more of its community working with the clojure community somehow.

Ingy döt Net 2023-07-21T00:07:14.136829Z

Starts with 1 I guess 😉

pez 2023-07-20T09:35:48.148759Z

The Lingy nREPL server is coming along slowly but nicely. 😃

Ingy döt Net 2023-07-20T19:57:20.885349Z

I think I'll transfer the lingy repo to the https://github.com/lingy-lang org today

Ingy döt Net 2023-07-20T19:57:56.093159Z

everything redirects when I do that so you probably won't even notice

Ingy döt Net 2023-07-20T19:58:22.306719Z

I did notice that someone else grabbed the lingylang org

Ingy döt Net 2023-07-20T19:58:47.206659Z

but github doesn't show you who owns an org

pez 2023-07-20T20:59:44.125549Z

Not the most active org in human memory.