Fork me on GitHub
#babashka
<
2022-07-25
>
teodorlu12:07:51

Is there something like warn-on-reflection for sci / babashka that warns the user when they are using some part of Clojure that isn't supported by sci + friends? Or perhaps something linter-based? I feel like there's this subset of Clojure now that you can choose to stay within. And if you choose to stay within it, you gain portability. Yet, I'm not certain what this subset is. Curious the journey to learn what this subset is should/could be. Just being able to copy a piece of Clojure code into a #scittle powered webapp is such a nice option to have.

borkdude12:07:17

Most of Clojure is supported, but there are some grey areas around protocols/reify/defrecord/deftype when you combine those things with one or more Java interfaces. Since in a native image you cannot create new Java types on the fly.

👍 1
borkdude12:07:39

Maybe we could open a wiki-page where we keep a list or so

borkdude12:07:44

Feel free to do so

borkdude12:07:25

Here is the official list: https://book.babashka.org/#differences-with-clojure Although deftype is now supported somewhat, if you don't add Java interfaces in the mix

💯 1
teodorlu12:07:31

Thanks! 😊

teodorlu12:07:21

Does this look right?

teodorlu12:07:09

(please show some good faith about the borders, the overlap isn’t perfect)

borkdude12:07:41

What does "safe SCI" mean?

borkdude12:07:34

SCI that works everywhere?

teodorlu12:07:44

the subset of Clojure i can use use as JVM Clojure, Clojurescript, Clojure as interpreted by Scittle, Clojure as interpreted by Sci in babashka, Clojure as interpreted by sci as a JVM lib

borkdude12:07:58

Right, yeah makes sense

👍 1
borkdude12:07:10

"Common SCI" :)

😉 1
teodorlu13:07:13

> defprotocol and defrecord are implemented using multimethods and regular maps. Ostensibly they work the same, but under the hood there are no Java classes that correspond to them. Can I generally count on defrecord and defprotocol being available in “Common SCI”?

ordnungswidrig15:07:38

That diagram is lacking SCI on arduino 😉 😈

teodorlu16:07:26

@U054UD60U do you have a link to a sci runtime for arduino?

ordnungswidrig16:07:51

I was snarky and I'd love to see one. At least for ESP32 and more powerful µP 🙂

😄 1
borkdude17:07:07

This came up on Twitter recently with Mike Fikes. I'd try it if I had such a device

ordnungswidrig17:07:10

I have worked with Mike on running clojurescript on ESP32. But you need a large memory version for the simplest task and it's rather slow

ordnungswidrig17:07:42

@U04V15CAJ the esp modules come as dev boards with USB for cheap. I can dig you up a link if interested

borkdude17:07:01

@U054UD60U I think you tried self-hosted CLJS right? This is a much larger JS blob than SCI

👀 1
ordnungswidrig13:07:23

Yes, it's kind of self hosting but very limited.

borkdude13:07:59

This is why trying SCI may be worth a go

ordnungswidrig20:07:53

How would that work? SCI hosted in JS or a native SCI on that platform?

borkdude20:07:29

I assumed that device could run JS?

borkdude20:07:44

you can also compile SCI to a shared C lib if that's useful

ordnungswidrig11:07:09

Oh, how would this work? thinking-face

ordnungswidrig14:07:24

Is there a way to "transpile" java to C sources? The devices I wanted to use do not support graalvm 😞

ordnungswidrig19:07:16

The ESP32 has an Xtensa architecture.

ordnungswidrig19:07:03

And the most recent ones have Risk-V IIRC

borkdude19:07:40

Yeah, no luck there then with graalvm stuff. Perhaps with SCI compiled to JS

ordnungswidrig21:07:00

That's sounds like a plan worth to explore.