@peterwestmacott has joined the channel
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).I’ve also been curious about that. Looks funny with main being the first function defined! 😃
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.
And I learned here a couple days ago that clojurescript doesn't have vars either, though I'd assume it requires predeclaration.
Lingy has declare implemented, but essentially useless. I guess that means I could "fix" the examples by pre declareing main 😄
I'm not yet aware of if/when Lingy will require predeclaration. Perhaps when it takes on actual compilation.
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.
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.
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.
@phill makes perfect sense to me. I hope we can pull it off!
My goals for lingy come from a few different places. But they are not in any disagreement with you.
Lingy started conceptually as a runtime for YAMLScript, so would want to be whereever YAML is used, which is just about everywhere.
I just happen to be able pull off things most quickly in Perl. (I have 200+ dists on CPAN)
But then I started loving Clojure and wanting it to solve Perl problems like Clojure solved Java probs
And I want core Lingy to differ as littel as possible from core Clojure
Like clojure/core.clj will be used directly
with the necessary Java->Perl class name mapping etc.
I'd also like to figure out a monumental task of compiling lingy code into a "VM" bound into the Perl runtime.
such that Perl stuff written in Lingy was C order of magnitude fast
I've already published CPAN modules writen in Lingy (actually YAMLScript)
Yes, so glad the link to your presentation at Perl + Raku was posted here. So exciting
anyway, I'm glad you have some excitement here and also don't have a perl gag reflex
Oh what I like about Clojure is that it brought some of the Perl wit to the dull JVM!
Larry told me once (in his kitchen the day John McCarthy died) that Perl was most influenced by Lisp.
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"...
And apparently McCarthy was in the audience but Larry didn't know it
And McCarthy was displeased.
But Larry pointed out that he meant exactly the "visual" appeal
And that Lisp was the biggest influence otherwise
But then so many people have a visual gag reflex to Perl 😄
Clojure is good about lessening the paren soup
But yeah the Perl runtime is like a lisp w/ compile time and runtime not cleanly separated
Perl also catches hell for that sometimes
I think that Lingy Perl conf video got noticed by a bot looking for java news or somesuch
It got way more views that the other talks.
I'll have to put the word Java in all my talk descriptions from now on
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.
Great story.
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).
Another goal of Lingy (more recent goal) is to try to get more of its community working with the clojure community somehow.
Starts with 1 I guess 😉
The Lingy nREPL server is coming along slowly but nicely. 😃
I think I'll transfer the lingy repo to the https://github.com/lingy-lang org today
everything redirects when I do that so you probably won't even notice
I did notice that someone else grabbed the lingylang org
but github doesn't show you who owns an org
Not the most active org in human memory.