This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-18
Channels
- # announcements (17)
- # babashka (42)
- # beginners (34)
- # calva (78)
- # cherry (1)
- # cider (7)
- # clojure (64)
- # clojure-europe (19)
- # clojure-nl (2)
- # clojure-norway (54)
- # clojure-uk (3)
- # clojurescript (21)
- # cloverage (1)
- # conjure (1)
- # core-async (11)
- # cryogen (16)
- # cursive (1)
- # data-oriented-programming (1)
- # datahike (5)
- # fulcro (2)
- # girouette (1)
- # helix (10)
- # hyperfiddle (1)
- # jobs (1)
- # kaocha (4)
- # nbb (7)
- # off-topic (6)
- # pathom (4)
- # polylith (21)
- # rdf (9)
- # releases (2)
- # shadow-cljs (3)
- # sql (12)
- # squint (68)
- # vim (33)
- # xtdb (29)
Published a new version of #clavascript with better JSX support. https://twitter.com/borkdude/status/1560247158774943746 cc @armed (gonna port this to cherry too)
provocative questions:
1. what if we only had transducers, and eschewed map
filter
with the collection passed in?
2. what if we moved transducers to its own namespace?
I would imagine these wild changes would be mutually exclusive, but maybe not!
I can see why that is attractive from a language designer's view to get the best performance out of programs that people write, but I don't find it attractive from a familiarity perspective: I think we should stick to what people know from Clojure/Script as much as possible.
just thinking of ways to enable good tree shaking. otherwise you have to include all of the transducer logic whenever you use map
, even if you never use it as a transducer
I haven't done it yet. been thinking about how I would want to implement transducers
there's the transducer-js protocol that we could use, which is different than the way that Clojure does it with different function arities
I found the usage of the two-arity for map, filter, etc pretty error-prone. I was happy that I finally added linting to clj-kondo to find problems like this: (first (map identity))
I've argued that different functions: mapping
, filtering
etc would have been better for adding the transducer logic
But a different namespace would have the same effect (+ we don't have to teach clj-kondo about new core vars)
(ns foo (:require [clava.transducers :as t]))
(t/into #{} (t/map identity) [1 2 3])
Something like this?if we didn't have the 2-arity version take a collection, then you could have it be composition. so you could do something like:
(->> (map inc) (filter even?) (take 5))
and it would return a transducer functionI suppose the ->>
is only one character less than comp
but for some reason it reads better to me
I'm also going to make an issue for transducers with the separate ns context, and start sketching out the internal design for them
It seems the bundling of vite + solidjs + clava works really well: https://twitter.com/borkdude/status/1560271562569555972 9kb of JS (4kb zipped) for a reactive example
I want to deploy the solidjs example at https://clavascript.github.io/demos/clava/solidjs/ but the problem is that the built solidjs expects to be deployed at the root of the website, I think. So it tries to load assets from https://clavascript.github.io/demos/assets/... Does anyone know what the solution to this could be?
I suspect that you can put the base url somewhere in a config file, but I don't know which
yeah, was about to link to https://vitejs.dev/guide/static-deploy.html#github-pages which says to set the base
property to the repo
@lilactown Well, core.js
is in the root of the project, so maybe just in the root?
I was thinking about writing transducers in clava to force me to get protocols to work right ๐
I think what you should do in this case is just check in the compiled file for distribution
Btw, I'd be fine writing it all in JS to ensure the best perf and and smallest code output
I'd be fine with it too, but I think it would also be cool to figure out how to have protocols be small and performant
at the end of the day, the way that clojure does transducers using different arity produces way less code than using prototype dispatch
code for the above page: https://github.com/clavascript/clavascript/blob/main/examples/solidjs/src/App.cljs
Am I missing something? What do I need to do once I have added a function to core.js
for bump-core-vars
to pick it up?
Thanks, my issue I was using yarn instead of npm and something seemed to have cached
The bb dev task deletes some analysis file which will evict the cache of core functions
could the mutable and immutable options work in tandem? e.g. if you want most of your program to be immutable but critical, interop parts to work directly on JS but with Clojureโs methods it seems like Clava is deviating enough from CLJS that this will not be possible nor intended?
@UPH6EL9DH This is not in scope of clava, but you could use clava's stdlib from ClojureScript