code.talks 2019 - No Pain, no Gain: Using Clojure for Web Applications
HTML-код
- Опубликовано: 15 сен 2024
- by Dr. Tobias Schröder
Many of us are really into the paradigms of functional programming. Whether we like streams, mappings, pure functions or just the immutability of variables and objects. But can you use a modern functional programming language like Clojure for web applications? How does it feel when you write HTML with a functional language and which benefits is the backend going to have?
This talk provides a look at a web framework called Component in Clojure, dives into the world of lambda expression, and shows how to develop a To-Do web app with this framework. A live demo and coding will complete our functional lookout.
#clojure #lisp #korma #hiccup #ring #pedestal #carebears #codetalks
thanks this explean a lot very clear, thanks your so much
Very useful for me. Thanks.
Would good to get link in source code
How did you do the flashlight thing? With what software/hardware?
Hey Thomas, I used the Logitech Spotlight presenter with the open source software github.com/jahnf/Projecteur (cause I am on Linux).
15:16 are you not open to SQL injection here?
Mate he said those are prepared statements, those are probably escaped if library controlls that.
@@CvetanSimsic damn a year later, I think I've lost the context ;) He refers to reset! as a "raw statement" so it sounds and looks dangerous. You sound unsure about it too.
@@pryflack3646 The second snippet is definitely not a prepared statement. It's using Clojure's own "format" function, so you're correct in that it's vulnerable to SQL Injection. The first snippet is a properly prepared statement though.
Driving me crazy that you keep calling parentheses, "brackets"
Thats the norm in European English.
Bekause zat ist ze vay ve speak Englisch owuer hier
No, not everything in clojure is a list. There are other data-structures, maps, vectors, sets. You will very rarely actually be working with lists. I think clojure is more accurately described as LISP inspired, or LISP like.
1. I know your comment is old but I have to respond to it...
2. "No, not everything in clojure is a list." - Yes, you're right.
3. "You will very rarely actually be working with lists." - No, you're wrong. Every time when you define or call a function you create a list. (defn me [] "me") is a list, (me) is also a list. Please, note that every function definition or fn call is a data structure itself that is read later when you compile it.
Actually when you work (i.e. write or use) with something like '(defn me [] "me")' you don't really think of it as a list. You perceive it to be a function with a certain type signature. I.e. you abstract away, that means you don't care if the thing which defines your function is a string or a list of expression which themselves are strings or something else.
(Notable exception to this "you abstract away" are situations in which you write macros. But 99% of the time you won't be writing macros.)
Actually, you are all wrong.
Everything in clojure is data.
@@HinaTan250 Not sure if you are trolling, but all programs are data in every language
Native support for vectors and maps doesn't mean that Clojure isn't a Lisp. Common Lisp has arrays and hash maps and it is a Lisp right?