This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-20
Channels
- # announcements (3)
- # babashka (7)
- # beginners (43)
- # biff (19)
- # calva (39)
- # cider (16)
- # clerk (2)
- # clj-yaml (32)
- # cljs-dev (37)
- # clojure (129)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (46)
- # clojure-filipino (1)
- # clojure-gamedev (25)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (2)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (5)
- # clojure-norway (8)
- # clojure-sg (1)
- # clojure-sweden (12)
- # clojure-taiwan (1)
- # clojure-uk (9)
- # clojurescript (14)
- # core-typed (136)
- # cursive (18)
- # duct (9)
- # emacs (12)
- # etaoin (7)
- # events (1)
- # graalvm (3)
- # gratitude (2)
- # humbleui (7)
- # hyperfiddle (99)
- # introduce-yourself (5)
- # jobs (2)
- # leiningen (1)
- # missionary (14)
- # nrepl (2)
- # off-topic (12)
- # polylith (21)
- # rdf (29)
- # re-frame (8)
- # releases (1)
- # shadow-cljs (264)
- # spacemacs (21)
- # sql (7)
- # vscode (1)
Does this work on generic mode with calva? I can't seem to make the switch to cljs.
i believe that button is bugged, the command should work from the command bar
Also doesn't appear to work for me. I am on electric-starter-app. It's not a show stopper for me. Just looking at improving my dev experience where I can and noticed this in the docs.
it is not an electric issue it is a recent calva issue iiuc
the command should work
More good news about my workflow: When I have a working copy of my app locally, I can essentially copy/paste deploy to production. I bet that makes some of you have your hairs stand on end. Oh yeah, gunslinging cowboy coding :face_with_cowboy_hat:
its an interesting question, perhaps it is true in practice, even {:a {:b 42}}
has imperative construction on imperative hardware so i guess it depends how closely you are looking, how many layers deep you want to go and what assumptions we are making about the operational environment
the real world i think is best modeled by differential equations, which is not an imperative model
a more practical world-view would be that declarative means "data parallel" or simply "data"
at this point it gets fuzzy for me, we can ask if data is primitive or if lambda is more primitive, you can implement data out of lambda but I don't think you can implement lambda out of data (if this is even the right framing)
is lambda imperative? I propose it's orthogonal, per this image
more practically, could we say every declarative interface has an ad-hoc etc. managed effects system at its core?
by interface I mean something which facilitates action, not prediction as with equations
the universe performs action and yet is modeled by equations. the challenge is knowing the initial conditions but if you can establish that, prediction == action
digression, but actions are the objects of prediction, i don't see how those can be equivalent
what even is action
our subjective experience?
if you're really bored... https://plato.stanford.edu/entries/action/
do you have any sources from a physicist?
I have a high-school level understanding of physics, you don't want to hear my opinions on physics.. but what does that have to do with anything
because to answer your q, we have to know what "declarative" means, which is closely related to the concept of "data", so now we need to know what data is and in particular if it is separate from "computation" in this context
and then separate "computation" abstractly from the machinery of the computation - e.g. digital computer vs pen and paper
so is user=> 1
an imperative computation? What meaning is it meant to have?
a java lang Long got boxed up and electric power was consumed
we can give it other forms of meaning, abstracting ourselves from the platform
so what is the math of 1
you telll me
well, in language in general a declarative statement doesn't imply any sort of action. I guess for a declarative interface the better mapping would be the subjunctive mood, "The button is blue" vs "Let the button be blue"
i accept that
"let c denote the speed of light"
denote /dɪ'noʊt/ verb have as a meaning
(my-dsl {:button :blue})
is my-dsl going to render this to dom? or is it going to capitalize all keywords?
I think to answer this question you'd need to think about the theory of language in general, because declarative and imperative are properties of language, not physics or anything else.. interestingly the general attributes like idempotence exists in both natural language and programming ("Let the button be this shade of blue" vs "Paint the button with this shade of blue")
I propose that declarative and imperative are properties of computation in the domain of your question?
I think you're right that theory of language is relevant
I think by interface I mean interfaces to computation (flipping transistors?), which are languages
Ok, that means we are abstracted from the execution machinery, which is suitable
lets further specify, for the sake of concreteness, that it's in the context of a language without side effects (you can have IO monad)
here's a dsl to consider - (select-keys x [:a :b])
vs (hash-map :a (get x :a) :b (get x :b))
dsl is [:a :b]
and it can either be interpreted or compiled/macroexpanded
either way it evaluates to some pure computation in our theoretical pure functional language
i'd call it declarative and i wouldn't call that managed effects especially given that we are basically evaluating this on pen and paper not on a digital machine
one might ask "what is hash-map? what is get?" as we haven't denoted it, and i guess we're in philosophy of language again
wikipedia thinks so https://en.wikipedia.org/wiki/Declarative_programming#Definition
yea that article is trash
at this point at least we need to say, "a computation is declarative with respect to X"
electric is declarative with respect to client/server network sync
is haskell declarative with respect to memory usage? Hardly
maybe: in order to be useful, a program needs effects. if that program wants to stay declarative, it needs managed effects
Lisp is declarative in that it is homoiconic which enables userland metaprogramming, but lisp programs also have mutable state
imagine a SQL query planner, the input is the userland sql and the output is the plan, that is data -> data
is "plan" a managed effect? Probably yes, now we ask what is a managed effect?
Data describing an effect?
back to philosophy
what is data, what is an effect, i dont think one needs to actually answer that
its models all the way down, subsitute a virtual cpu for the hardware cpu and now your programs are referentially transparent and you can serialize a VM state and move it over network
you're saying "plan" is a managed effect because it describes some work to be done outside the program?
I thought the idea of managed effects is that the entire lifecycle of that effect is managed within the program. so your sql query planner program couldn't care less if the plan execution threw an exception
Monad is an abstract structure
you can represent effects in many ways
#(println 1)
for example is a value
unsafePerformIO on this value would be invoke
we could demonstrate that there is a Monad instance for this concrete type
join :: Monad m => m (m x) -> m x
(fn [] (fn [] (println 1)))
I mean, you would never think about reaching for abstractions like monads for a referentially transparent program like your query planner
'(println 1)
is just as good, as is [:clojure.core/println 1]
so I don't see how "plan" is any kind of effect, there's a point at which data becomes data describing an effect, and that point has nothing to do with the data itself
well the plan needs to be evaluated
and it has an operational SLA - time budget, disk IO budget
the plan surely encodes concurrency, certain parts of the plan can execute in parallel
the plan probably has control flow (if statements) – it will use heuristics to decide which algorithm to apply
right, but the query planner doesn't care about that.. it doesn't know about network, disk, whatever, just take this string and turn it into that string, so at the point where the data comes out of the query planner, there's no concept of effects yet? it doesn't care about what the plan implies to whatever might interpret it
i think it cares, the whole point of the plan is to be fast, which implies hardware
i think we mapped the problem space well enough to answer the original q quite clearly
in the domain of software engineering, declarative is a property of computation, and all of the computations we are interested in have a performance SLA on real hardware. From this perspective, all commercially useful programming languages are an abstraction over the imperative platform (which is the origin of "control flow" – instruction pointer, goto, jump-if-zero). Declarative languages are a subset of that, therefore all declarative languages in the domain of commercial software engineering (say application development) are ultimately orchestrating platform effects and the question is answered in the affirmitive.
in the domain of mathematical language and denotative semantics (which is a superset of commercial programming languages) we now include computations that can evaluate on pen and paper (or in our minds), for which performance SLA and hardware is not considered, in this domain I can imagine declarative DSL as pure math / algebraic transformations / term rewriting. For example a DSL for symbolic differentiation i.e. Calculus. These declarative DSLs have not been tainted by the imperative platform and therefore the question is also answered with opposite result
The dependence of the result on which domain the question is embedded in, is the link to meaning/denotation and the philosophy of language.
I think we can generalize this further and resolve your bifurcation, unifying both under the concept of a formal system. Mathematics isn't unlimited in what in can model, everything must fit within its axioms. What if we want to talk about things informally? Do we call these informal constructs "effects"?
i’m interested but don’t understand
and even if math has limits, programming languages are within them
no need to give two answers for "in the domain of..." just one answer for "in the domain of formal systems" should work
a statement is declarative, an axiom is a statement taken to be true, a declarative programming language is an axiomatic system just like math
this is NOT true when we have effects, managed effects are a way of bringing these back into the formalism
i don't know what effects look like in math, but I think there must be the equivalent in that domain
I keep saying "effect" but that's because I don't know what the word is for "generalization of an effect"
i think we need to define “effect” at this point
I think effects are only of particular interest today because our programming languages are deficient, in that they can't formally model effects. So we get excited about managed effects systems like missionary because they extend the formal, axiomatic domain of programming to an extent that we're not used to and it lets us reason declaratively about things we weren't able to before
declarative necessarily implies formal. effects contingently imply informal because our programming languages suck. imperative APIs suck because they are informal, we can't reason about them effectively. managed effects make effects formal, making our language capable of being declarative again