WRT the persistent data structures. In Clojure they were implemented in Java, and based on Java interfaces. In Clojurescript, they’re all implemented in Clojure and based on protocols. I think the latter is preferable. One would then end up in a world where Perl was missing an implementation of persistent data structures, but that could be addressed in other ways :)
Also, depending on a lot of things, there is clojure.tools.reader and clojure.tools.analyzer which are the reader and analyzer implemented in Clojure.
indeed
to fast track lingy, we will want to get deftype and defprotocol nailed down first, and then we can take most of CLJS' implementation of clojure.core
This took a few minutes to sync in but getting it now.
s/sync/sink/ # really not awake yet
(also fun fact -- deftype was originally intended to make implementing "clojure in clojure" possible, but that never happened)
@slipset can you give me a good urls about protocols? I don't think I'm familiar...
You can think of them as Java Interfaces.
wasn't sure if that was a clojure, java or js thing
is there a tool to transform java interfaces to protocols?
Don’t think so.
I'm using "I just opened my eyes a few minutes ago" as an excuse to why it took most of those minutes to see where you both were going.
We can implement the Clojure Java classes in Lingy after we have defprotocol (interfaces) and deftype (lingy implementations). Right?
(And we steal the implementations for ClojureScript)
making coffee brb
Adjusting my mental models for Lingy.
I was working towards Lingy's lingy/core.ly being Clojure's clojure/core.clj verbatim (or close)
Assuming that's what ClojureScript did...
But cljs/core.cljs is not the same at all.
TIL 🙂
core.cljs is 50% bigger because (I assume) it implements the primitives in clojure (not Java)
not only that but theres extra things that dont exist in java, like converting ES6 iterators to seqs
@slipset @hifumi123 https://github.com/orgs/lingy-lang/projects/1/views/1?pane=issue&itemId=34473699 hope that's ok...
I'm sussing out the dependency chain to implement those 2 in Lingy
Implementing the deps for clojure/core_deftype.clj looks overwhelming at the moment 😕
I think I am right to concentrate immediately on porting the ASeq based classes as so much depends on them
And to make the dependency graph generator program for the clojure source code.
Which could give a pretty clear answer for questions like: "If I want to implement defprotocol now in Lingy's current state, what work is involved?"
I suppose deftype and defprotocol are areas in which the other hosts' implementations might be not directly applicable to a new host. The key is how protocols and types would work in Perl. Suppose each protocol and each type is a Perl package. Types extend (`@ISA`?) protocols. Instances are blessed as a type. But Clojure also allows protocols to be extended to instances regardless of their type (https://clojure.org/reference/protocols#_extend_via_metadata). Maybe that means a common Lingy base package that all Lingy deftype packages cite as a super, and the Lingy base package does something to dispatch method calls to an instance's extra protocols? Or maybe an instance with protocol metadata makes Lingy make a new, single-purpose Perl package?
Nod. Lots of ways to get that done in Perl.
I think gen-class in Perl will likely want some kind of meta field to specify which of the 50 ways in Perl you want that class genned 😕
with a very bare-bones default
@stephan.renatus has joined the channel