This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-21
Channels
- # announcements (39)
- # architecture (7)
- # aws (9)
- # babashka (111)
- # beginners (139)
- # bristol-clojurians (1)
- # calva (47)
- # chlorine-clover (5)
- # cider (17)
- # clj-kondo (26)
- # clojars (25)
- # clojure (251)
- # clojure-berlin (1)
- # clojure-dev (5)
- # clojure-europe (22)
- # clojure-france (1)
- # clojure-hungary (6)
- # clojure-losangeles (8)
- # clojure-nl (18)
- # clojure-spec (3)
- # clojure-uk (68)
- # clojured (32)
- # clojurescript (32)
- # core-async (10)
- # core-typed (120)
- # cursive (8)
- # datascript (10)
- # datomic (11)
- # docker (2)
- # emacs (6)
- # figwheel-main (4)
- # fulcro (10)
- # graalvm (92)
- # hoplon (2)
- # instaparse (9)
- # jobs (3)
- # jobs-discuss (31)
- # joker (2)
- # kaocha (1)
- # lambdaisland (5)
- # leiningen (10)
- # luminus (1)
- # lumo (14)
- # meander (30)
- # mid-cities-meetup (1)
- # midje (1)
- # off-topic (46)
- # pathom (22)
- # perun (2)
- # re-frame (10)
- # reitit (1)
- # remote-jobs (8)
- # shadow-cljs (71)
- # spacemacs (7)
- # sql (40)
- # tools-deps (31)
- # tree-sitter (11)
- # vim (14)
- # vscode (2)
- # xtdb (5)
@zilti haha good question. depends on your perspective. xD required a good amount of insight but I'm using spec2's extensibility as intended
I managed to verify clojure.core/map
was (All [x y] [[x -> y] (Coll x) -> (Coll y)])
by effectively calling (conform (All [x y] [[x -> y] (Coll x) -> (Coll y)]) map)
but with gnarlier syntax for the spec
instead of generating values, we need to generate types (specs) to instantiate x and y
that would be a super compelling story for typed clojure if I can pull off the runtime side of things
2.0 branch lives here now https://github.com/typedclojure/typedclojure
going back to the typed
groupId and namespace. probably typed/clj
with root namespace typed.clj
and typed/clj.check
with ns typed.clj.check
then library annotations will live in typed.lib/clojure
typed.lib/core.async
etc, with wrappers and stuff living under typed.lib.clojure.core/doseq
typed.lib.clojure.core.async/go
etc
Yea, having core.typed generate specs, mainly for the parts that can't be verified at compile time, would be one helluva feature
Crazy idea.. not sure, is it possible to have a cljc core.typed library? It would be usable from CLJS in the browser, nodejs and Graalvm. We could have type inference in small setting? Not sure if this is stupid to suggest, but I really would like to have it
@jeroenvandijk actually that's behind my obsessive partitioning of typed clojure into "jvm" "js" etc
Awesome!
@jeroenvandijk I really want a web demo, I've wanted one since 2013-ish haha
If I can help somehow with testing please let me know. It think it will be huge
I have no idea. this whole spec2 thing just popped up a few days ago after about 5 years of thinking
since my goal is a one-one spec2<==>typedclojure type correspondance, I assume we can easily write a type->spec2 function
Yea, the conversion should be rather straightforward. I mean, I did/do it by hand for a few types in core.typed 1 currently
the research I need to do now is how to do these properly in spec2: All, TFn, type variables, t/inst
Hmm. I mean, in the end, you can leave it to the user which variant they use. But I found it a bit confusing (maybe because I was using core.typed before) that the :-
notation and the ann
notation differ
but it definitely makes a lot of sense for scoping type variables. you don't want the names of your local type variables to be determined in another file ...
I think I originally wrote the :-
macros back in the day and schema based its syntax on that. then everyone make spec wrappers that work that way.
I also noticed there are still annotations for some clojure.core functions missing in 1.0.0
(t/ann clojure.core/update [Coll Any [Coll -> Any] -> Any])
(t/ann clojure.core/re-pattern [Str -> java.util.regex.Pattern])
(t/ann clojure.core/slurp [Str -> Str])
are the ones I madesomething like (All [m k v o z ...] [m k [(Get m k) z ... z -> o] z ... z -> (Assoc m k o)])
would satisfy me LOL
I have no clue about typescript ^^ (neither about Haskell, even though I've read about it a bit though)
and so many functions in clojure are designed with assoc/get/update as building blocks
I don't know that much about type systems in general, just some silly facts like how Scala's is turing complete apparently
What if you had a tiny subset of Clojure e.g. just (str (+ 2 (inc 4))
. Would that be easy to type check?
so (+ (str "somethin") 2)
woudl fail
@jeroenvandijk as soon as you have if
and fn
you're in trouble
Same with for
?
(if you leave out :when
etc
Ok but you are saying if it's just function calls that's possible?
fn
is interesting because of higher-order functions eg., how to know the type of x in (map (fn [x] ..) ..)
A lot is possible. I mean, you can formally verify that a turing complete subset of the Ada language is bug-free
I think a web demo with the easy cases is already of tremendous value
I think I could use that
one thing I'm not sure about is what the differences need to be between typed.clj
and typed.cljs
My desire is to create a web framework that allow novices to edit stuff via a web editor. They would only be allowed to do the simple stuff. So super useful if it had type checking
what alternative are you thinking about?
yeah for sure that would be an option too
but the web gives the benefit of lower requirements on the client machine
you just need a browser
Actually I am currently looking into creating an editor with syntax highlighting, since there is a mature rich text component with a code edit mode
Well, download and execute is all that's needed these days. At least on MacOS and Linux... Windows, as always, is making lifes difficult
What if you want to edit on your mobile? 🙂
But i definitely see benefits with javafx
Just compile the same app for mobile... Granted, the Graal-based plugin to do that is still under heavy development, but they're on their way
ah 🙂
it has another library called sci underneath. Eval in browser, graal, node etc
you don't feel the difference with normal clojure
#babashka
It's a pretty cool addition to the Clojure community
It's the reason i'm thinking of building a web framework
It's interpreter might also be interesting from a type checking perspective
you can type check per form. I don't know much about type checking but as a noob I feel this makes it easier. Type checking the code while interpreting it
So you don't have to say everything ahead of time
like i said i'm a noob 🙂
i'll leave it to the experts
The cool thing is that you control what functions can be executed. So you could say i don't know what the type it is, let's just try it
If you don't have side effects that would not be a weird strategy
since you can control the fn's that are evaluated you know if there are gonna be side effects
even looping is controlled
I suppose that's different than checking a form in the repl