This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-06
Channels
- # adventofcode (99)
- # announcements (9)
- # aws (3)
- # babashka (22)
- # beginners (90)
- # boot (2)
- # calva (22)
- # cider (8)
- # clj-kondo (14)
- # cljsrn (20)
- # clojure (24)
- # clojure-europe (4)
- # clojure-italy (3)
- # clojure-losangeles (1)
- # clojure-nl (83)
- # clojure-spain (1)
- # clojure-spec (46)
- # clojure-uk (43)
- # clojuredesign-podcast (70)
- # clojurescript (40)
- # cursive (25)
- # datomic (9)
- # duct (3)
- # emacs (14)
- # figwheel-main (2)
- # fulcro (61)
- # graalvm (8)
- # juxt (7)
- # kaocha (2)
- # leiningen (19)
- # luminus (5)
- # malli (58)
- # off-topic (4)
- # re-frame (11)
- # reitit (5)
- # rewrite-clj (3)
- # shadow-cljs (63)
- # sql (5)
- # testing (5)
- # tools-deps (26)
- # uncomplicate (2)
- # vim (4)
tonight Iām having a long meeting with Tony Kay for an ambitious but exciting open source project for rapid application development. Iām equal parts excited and mortified to talk with someone with so much experience.
when I offered my help I was more thinking along the lines of writing tests, docs, cleaning up the API, implementing some things. Heās actually involving me in the design and hammock process too to my surprise. So wish me luck!
cool, good luck @yannvahalewyn. does this project already exist somewhere?
Itās in the experimental idea phase, and everything is changing. But there is some kind of a demo online + a conversation between him and me outlining what needs to be done if youāre interested š
ah that Tony Kay, I mixed it up in my head with some Smalltalk or other interactive guru
tldr; RAD aims to allow developers to declare parts of their system and leverage the declaration to remove as much of the boiler plate as possible, but not to force the dev in a certain direction. Think about db queries, pathom resolvers, fulcro mutations, prefab UI components to make forms on admin panels, validation, authorisation, data fetching from multiple data sources, you name it
conceptually all will be open maps and you could extend the system with your specific needs
Like many others Iām really hoping for that killer app to make an appearance š
Iām very excited about this because it aligns well with the direction clojure is taking and with Tonyās decades of experience I think he might bring something great to the table
but for now I just hope I wonāt make an ass off myself #impostersyndrome
Tony Kay is very laid back don't worry
Yeah he is, we talked a bit already and it went ok. You know him?
I met him in Austin, and worked with him. We are long time Fulcro users. From the time it was called Untangled :-p
@mitchelkuijpers ^^^^^^^
I tried explaining it the best I could, but when Steve talks I feel the same way haha
š¤ + ->š§
I'm trying to watch the video but I'm afraid since I don't know much about fulcro it might be hard to follow š
I.. donāt know it yet either š
which is them basically copying all the patterns from rails, but slightly better. But you probably meant the "Rails of Clojure" as in the killer app that makes people want to learn/migrate to clojure.
there is another exciting thing in progress which I can't talk about yet, which could be a clojure killer app
I actually made something even more railsey I think, rails + administrate in ~100 lines of clojure as a proof of concept a couple of weeks ago
all the things, inflection, schema read from the database (horrible idea but railsey š), rest resources (routes + handlers), UI, forms. clojure is insane
nope, same
argh you removed id haha
Donāt worry Iāll do it for you
When using a sql database I need the sql stuff at some point, so I donāt like ORM style of things. But at work we have so much boilerplate in the basic CRUD stuff right now itās annoying
funily Iām actually working on improving this right now. Well I should be but Iām hanging out on slack with you guys
friday life
basically for prototyping it's nice to just modify/generate queries on the fly in the code rather than have to create a query string yourself and figure it out until it works (probably because I'm not great at writing pure sql)
what RAD wants to achieve is indeed to have those tools for minimal boiler plate during greenfield, but you can later rock your own solutions that better fit the projectās needs. Or just pile onto it
@hobosarefriends as long as you can easily override it with manual SQL when you need to, it's fine I guess
exactly
Yeah, active record could do that, I think you could just pass a string or a lambda to where and it would run it directly basically.
Rails seemed to have a philosophy I really liked, which was having defaults that worked for most people most of the time, but it could be overridden all the time.
My talk wednesday is actually called āComposition over conventionā as a wink to Railsā philosophy. Iāve found that overriding things isnāt enough if the framework doesnāt have composability in mind
Either way I have to see what cool patterns and designs the Clojure people come up with now. ā¤ļø
@hobosarefriends Rails is awesome for what it is, but when I started doing it (being used to Clojure) I felt there was so much magic going, on I didn't know where to look when something went wrong or didn't perform well
(I've only done one or two real Rails projects, so take everything I say about it with a grain of salt)
I have done one other project with the Java version of the Play framework which was a horrible experience ORM-wise
Rails is suuuuper magical (I never fully understood a lot of the things, like the asset pipeline/sprockets), but since everyone uses the same magic the problems you tend to encounter tend to be problems other people have already encountered. But yeah Magic has it's downsides.
if you write SQL yourself, do you find other people can also easily read it? I've haven't seen much handwritten stuff in my projects and I always wondered how legible it would be.
@hobosarefriends The sql is usually coupled with a Clojure function that describes what it does, including a docstring. But often the SQL is very simple and readable as well. And what is cool, you can just paste that SQL in a pgadmin somewhere and tinker with it
what's cool about clojure is that you can just combine all these libs and build your own cool thing I guess
this does look pretty compelling:
(-> (insert-into :properties)
(values [{:name "John" :surname "Smith" :age 34}
{:name "Andrew" :surname "Cooper" :age 12}
{:name "Jane" :surname "Daniels" :age 56}])
sql/format)
=> [#sql/regularize
"INSERT INTO properties (name, surname, age)
VALUES (?, ?, ?), (?, ?, ?), (?, ?, ?)"
"John" "Smith" 34
"Andrew" "Cooper" 12
"Jane" "Daniels" 56]
I kind of liked getting down to raw sql with jcbc.next, might try hugsql if I would use it more, for now it where just a couple of functions like this, that basically validate and perform part of the transfer:
(defn transfer-from!
[iban token amount]
(when
(vg/valid-open-iban iban)
(with-open [conn (j/get-connection @datasource)]
(j/execute-one! conn ["
UPDATE balance
SET amount =
CASE WHEN balance.token != ? THEN balance.amount
WHEN balance.amount - ? >= balance.lmt THEN balance.amount - ?
ELSE balance.amount END FROM balance AS old_balance
WHERE balance.iban = ? AND balance.balance_id = old_balance.balance_id
RETURNING balance.*, old_balance.amount as old_amount"
token amount amount iban]))))