Fork me on GitHub

@borkdude About SCI ClojureDart support (, let me know if you have tried something already. Otherwise I can try to dig into the code during the nights of this week to see what you had to do to support both CLJ and CLJS (in a first view, it seems they are much more alike to each other than ClojureDart is, is this true?).


Ok, checked here, lots of errors ahahaha, no extend-protocol (but it seems to be a easy macro to do as extend-type already exists), no instance? (existing issue), among others. Will take another look tomorrow


Should we set up a branch to develop in? Instance? Is replaced by something else in cljd


I think that's their README


@U5R6XUARE I have a branch clojure-dart in SCI now, maybe you can start making incremental PRs against that branch and we can discuss each step


I have tried something previously but I haven't saved that code anywhwre


so I'd like to start over


Nice, thanks, Michiel! I've copied the SCI code to a local dart starter project, but I can put it in this branch tonight o/ Let's iterate

👍 1

We can decide to just not support features if the ClojureDart host doesn't yet support them, like multi-methods

👍 1

I'm trying to make something work at (after I get something working, I can push to sci). The approach I am trying is a little fuzzy, just doing whatever is needed to make it work (at least compiling green) on top of the existing SCI code (but acting as if other languages didn't exist) and later we can reconcile it with the existing codebase. I find it easier to find big roadblocks this way. BTW, (reader types ns) seems to be one of these. I will check if we will need to use something completely different or if we can make it work by adding a third env (cljd) to Thinking further, do you think edamame will be a big pain?


@U5R6XUARE What does cljd use to read forms? It may not have a reader at the level of .cljd yet? If so, then that's the first major roadblock, I guess


In the sci.parser namespace we could switch to something else than edamame, if cljd has a reader we can use

👍 1

@U5R6XUARE @U2N9GDB1U kindly answered: > if you look at the ns cljd.test-reader.reader-test in the compiler you have examples

👏 1

Nice, thanks, Michiel and Baptiste! Will take a look tonight


Ok, have been able to compile* a a part of cljd tools reader that SCI uses (, tomorrow or the next day I will start focusing in some edamame-ish code (`sci.impl.parser`). *It's green, but there are some dynamic warnings, I will deal with them later


@U5R6XUARE Awesome. The files you've copied, are they part of clojuredart?


If so, we could just re-use them from there?


No, they are not, I'm following their repo for new changes o/ There is only a that we certainly can use inside the tools reader namespaces. The files there are the SCI namespaces + whatever namespaces from other libraries are needed to make it compile. After everything is green, we can fix the rough bits, take it to the SCI repo, remove non-applicable parts (like defmethoda) and let the tests talk by themselves


@U5R6XUARE We could also focus on just making eval-form work


and then use the reader that comes with clojure-dart - unless I'm not understanding things correctly


but I'm fine with either approach in this experimental phase :)


Yes yes, I will check that, thanks! This one does not depends on the parser (so no need for clojure tools reader or edamame for these?), right? At least not directly in the interpreter ns. Let me know of other low-hang fruits if you remember o/


Yes, eval-form does not depend on the parser


not sure if the namespace organization still requires this, but we can probably do something about that


Awesome! The only thing a little bit hard to read are the interleaved reader conditionals in cljc files for the same form (specially inside defrecord or deftypes), but this is Clojure's fault and, in the end, it becomes less code to maintain. I wish I had more than 1 or 2 hours per day to work on this ahahahahah SCI is such a great project.


@U5R6XUARE Let's take our time, SCI-dart summer of code ;)

❤️ 1

Have been able to compile the code for eval-form, now will try to solve the errors when I try to run it (it should be related to the build warnings)

➜  dartapp git:(test) ✗ dart run

Building package executable...
Failed to build dartapp:dartapp:
lib/cljd-out/sci/impl/vars.dart:250:12: Error: A method declaration needs an explicit list of parameters.
Try adding a parameter list to the method declaration.
dc.dynamic clojure.core/meta(){
lib/cljd-out/sci/impl/vars.dart:250:24: Error: Expected '{' before this.
dc.dynamic clojure.core/meta(){
lib/cljd-out/sci/impl/vars.dart:250:12: Error: The name of a constructor must match the name of the enclosing class.
dc.dynamic clojure.core/meta(){
lib/cljd-out/sci/impl/vars.dart:250:1: Error: Constructors can't have a return type.
Try removing the return type.
dc.dynamic clojure.core/meta(){
lib/cljd-out/sci/impl/vars.dart:250:24: Error: Operator declarations must be preceded by the keyword 'operator'.
Try adding the keyword 'operator'.
dc.dynamic clojure.core/meta(){
lib/cljd-out/sci/impl/vars.dart:250:24: Error: A method declaration needs an explicit list of parameters.
Try adding a parameter list to the method declaration.
dc.dynamic clojure.core/meta(){
lib/cljd-out/sci/impl/vars.dart:250:25: Error: Expected '{' before this.
dc.dynamic clojure.core/meta(){
lib/cljd-out/sci/impl/vars.dart:250:24: Error: Operator '/' should have exactly one parameter.
dc.dynamic clojure.core/meta(){
lib/cljd-out/sci/impl/vars.dart:250:25: Error: 'meta' is already declared in this scope.
dc.dynamic clojure.core/meta(){
lib/cljd-out/sci/impl/vars.dart:238:7: Context: Previous declaration of 'meta'.
final meta;



Trying to workaround some ClojureDart issues, see and (this one for reflection), #70 was 🤯.


I have been able to eval constants for now (do 3) => 3 haeuaehuheuheau not very interesting


It's great that you're uncovering ClojureDart edge cases this way!


Yes, I'm trying to create a custom instance? for SCI just to make it work. dart/is? does not receive accept dynamic class (it has to be known at compile time), this is why I'm checking if it's possible to use dart:mirrors for reflection for now, let's see if it works o/

👍 1

Can I follow this work in a repo somewhere?


You can see at o/ Making SCI work should be the target for every new Clojure runtime from now on ahahahaah

👍 1

It lets you know what you are missing


Now we can parse simple expressions!!!

(ns quickstart.helloworld
   [sci.core :as sci]))

(defn main []
  (println (sci/eval-form (sci/init {})
                          '(+ 1 2))
           (sci/eval-form (sci/init {})
                          '(+ 4 (- 5 1)))
           (sci/eval-form (sci/init {})
                          '(-> (- 5 1)
                               (+ 4)
                               (* 2)
                               (+ 10)))))

;; =>
;; 3
;; 8
;; 26

🎉 1

Great progress!


I've opened and will be updating there (it's using an old src/sci commit, but we can update when this is working). For these next 3 weeks, I will be moving from Brazil to Canada, so things will probably be slower, but I will try to advance as much as I can, it's exciting!


@U5R6XUARE Excellent :) Good luck moving to Canada!


Now I'm more settled here and will be able to start again, right away just bumped at some Dart compilation problem haeuaheuahue will try to figure out what's happening to open an GH issue


Congrats on the moving!


Sorry man, couldn't do anything these days, still trying to figure things out here :/


@U5R6XUARE Oh no problem at all! There is absolutely no pressure from my side :-)

❤️ 1