This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-19
Channels
- # beginners (55)
- # boot (1)
- # chestnut (1)
- # cider (130)
- # clara (31)
- # cljsrn (1)
- # clojure (12)
- # clojure-dev (4)
- # clojure-india (1)
- # clojure-italy (2)
- # clojure-uk (33)
- # clojureindia (1)
- # clojurescript (12)
- # component (1)
- # datascript (5)
- # datomic (2)
- # duct (2)
- # emacs (16)
- # hoplon (1)
- # jobs (1)
- # lumo (13)
- # off-topic (3)
- # onyx (4)
- # remote-jobs (1)
- # schema (1)
- # shadow-cljs (110)
- # spacemacs (2)
- # specter (44)
- # vim (6)
Hi all. I'd like to know how would you recommend to get started in Web development for a (reasonably smart) newbie? I love clojure, haskell, SICP - so very partial to functional programming. But essentially 0 experience in the web. I want to learn the basics - starting from building a server, deploying some single page apps, security / crypto - to eventually distributed systems - preferably sticking to clojure(script). Could someone be kind enough to suggest a path please? I'm planning to devote a couple of years - so asking for a path. Or you think going via java(script) would be wiser?
FWIW, I succeeded in writing lots of JavaScript-based apps without learning JavaScript. (Honest!)
i've done almost all exercises on 4clojure - so clojure level is decent too. And 4 chaps on SICP - so i get programming. Maybe I'm just hoping I don't need to delve into JS...
for none toy programs I would guess knowing the underlying basics of JS would be really helpful
OK - would you reco a good JS source to teach web? Not the language or programming in general
I didn't delve into JavaScript. I just used my knowledge of Clojure to program in ClojureScript, and muddled through the JavaScript interop when needed.
(To this day, if I had to sit down and actually write a web-based app in JavaScript, I would have a huge ramp-up.)
the thing is most documentation for web stuff is in JS, if you can't read it well you might get frustrated
how about sotnikov's book on web development? @lockdown- - yes I've been glancing at that - but again maybe wishfully trying to avoid JS
You can actually read a programming language without truly knowing how to write in that language.
I'm just saying, you don't need to go off and master JavaScript before learning ClojureScript. Same is true with Java and Clojure. It is possible to start with ClojureScript and Clojure and fill in knowledge in the host languages over time.
there's going to be some cognitive load at the beginning when reading javascript libs documentation
@lockdown- - so you would reco the mozilla route?
OK thanks a lot guys @lockdown-and @mfikes. I'll probably do that then. Start with the mozilla docs, and then see where i get to. Quite keen to move on to cljs though
how are tests for lein test
discovered?
at the moment it just prints out testing user
which is the value of [:profiles :project/dev :repl-options :init-ns]
but it's not collecting any tests.
Even when I run lein test :only path.to.tests/mytest
is it possible, using macro, generate something like that
(defmacro protocol ....)
(protocol cmds
("LIST" (list-handler))
("EXIT" (exit-handler)))
will generate something like
(defn cmds [command]
(condp = command
"LIST" (list-handler)
"EXIT" (exit-handler)))
iâm suffering to generate the condp expressions LIST , EXIT ⌠with macros@oliv What have you got so far?
This might do what you want
(defmacro protocol [name & clauses]
`(defn ~name [~'command] (condp = ~'command ~@clauses)))
I suspect the probably you were running into was that you tried to declare the argument as [command]
and you got a syntax error from defn
? @oliv
let me try to show you, struggling try to âexpandâ the
("LIST" (list-handler))
("EXIT" (exit-handler))
into
(condp
("LIST" (list-handler))
("EXIT" (exit-handler))
that is my first approach but didnât even finished
(defmacro protocol [name & commands]
`(defn ~name [request]
(let [cmd (first request)
arguments (rest request)]
(condp = cmd
~))))
I think ~'
would be a good addition to this section https://clojure.org/guides/weird_characters#unqote
I am working through the Edge project. Currently trying to understand how Juxt is configuring their reloaded-workflow. What is this line doing https://github.com/juxt/edge/blob/master/app/aliases/nrepl/nrepl.clj#L1?
I believe it is related to this https://github.com/juxt/edge/blob/master/app/deps.edn#L66 and my thought is that the above line is telling that ns
to only load when this variable is true? As in, wait for the dependencies you need before you load...because when the nrepl
ns is required, it seems like it is going to immediately run a nrep-server.