6 ms·
Coast on Clojure
- phtrivier 4y agoUnless I missed something in the doc, it seems like it's the "Fullest full stack framework" as long as you're only interested in the "handling web server request and reply with html" part of the full stack. Any reason why this should be used instead of cooking up ring / hickup / whatever ?
- exdsq 4y agoSomeone elsewhere mentioned that this seems to be ring, hiccup, and a DB connection packaged as one. Pinch of salt needed, I’ve not used it :)
- swlkr 4y agoThis is mostly ring / hiccup, just a layer on top to make it easier for beginners. I would say if you’re not new to clojure, roll your own.
- cube2222 4y agoSlightly OT, but whenever I see Clojure projects I think: "I'd love to write something bigger in Clojure one day, experience it, and see if it's all it was promised to be." That said, I don't really have any good use case for it right now, whether at work, or among my side projects.
- ravi-delia 4y agoI definitely recommend messing around with it, even just for a toy, but yeah I'm in a pretty similar boat. Can't think of any specific use case that I don't prefer another language for. On the lookout though!
- curuinor 4y agoI'm a year and change into my job at metabase (metabase.com) writing clojure all day every day and I am still terribly surprised that basically it is all that it's promised to be. That said, you do need to actually use the repl and be repling all the time because the startup times suck and the stack traces are gigantic all the time. That's pretty much it for complaints. You would expect things that aren't apparent in 30 minutes looking at the language to come up after an entire year, but nothing so far.
- giraffe_lady 4y agoOh wow yeah I forgot about the stack traces. Clojure was the second programming language I ever learned, after self-teaching ruby. lmao ruby does not prepare you for a 700-line stack trace full of java classes you've never even heard of because they're deep in the implementation. Does it still do that? I remember "better error messages" being a supposedly-coming-soon thing for the couple years I was using it. I eventually got used to it but damn what a hostile experience. In retrospect I'm pretty surprised I stuck with it. For better or worse I don't have that same tolerance & resilience now.
- ashes-of-sol 4y agoError messages are much easier to parse now!
- capableweb 4y ago(Seems your comment was dead, but I vouched for it as it's contributing to the discussion) Yeah, with the arrival of clojure.spec, some error messages has indeed gotten easier to both read and parse (for humans and machines alike), although when you use Clojure JVM so still come across the odd huge Java stack-trace (or with ClojureScript, a pretty sizable JavaScript stack-trace).
- ARandomerDude 4y agoReact and ReactNative in Clojure(Script) are amazing if you work in that area. Honestly, I'd never go back to a JS implementation. Reagent [1] provides a seamless interface for components, classes, hooks, etc. and ShadowCljs [2] is a fantastic build tool for the ecosystem. Re-frame [3] is a popular framework in this space. [1] https://reagent-project.github.io/ https://reagent-project.github.io/ [2] https://github.com/thheller/shadow-cljs https://github.com/thheller/shadow-cljs [3] https://github.com/day8/re-frame https://github.com/day8/re-frame
- Jonovono 4y agoThis is exactly what I just set up! Super cool - coming from doing Redux sagas and hooks and redux and all that stuff on RN it's been really interesting. Would you recommend Shadow vs Krell? I have tried both and so far Shadow was the most seamless, but Krell seems the most lightweight. If you care to share, i'd love to learn what you are building with it.
- ARandomerDude 4y agoI haven't used Krell, but Shadow has been great for me. Been on it a couple years now. My company is in the smarthome/IOT space and we use React(Native) + Clojure and ClojureScript for all our apps, dashboards, servers, etc.
- jcadam 4y agoI did clojure as a hobbyist for years and have only recently taken a job where I'm working full time in Clojure on a large codebase (i.e., first time having to maintain somebody else's Clojure code). It's not a golden hammer by any means, but I'd definitely take it over Java (or Scala) any day.
- LesZedCB 4y agoany experience with rails or django to compare with?
- hangonhn 4y agoNot to be pedantic but you’re asking for a comparison of language vs. frameworks. Not sure if you’ll get a good answer to that. That said, I’ve actually used Rails and Django in the past and written a small project in Clojure so I can try. I actually really love Clojure and had really positive experiences wit Django though I’ve come to favor lighter frameworks like Starlette. Programming in Clojure is quite interesting because it’s functional programming so all the information you need to reason about the function is generally passed in as parameters. It made code comparatively easy to reason about simply by reading the code for the specific function. Clojure also has good support for REPL. I don’t have to do a lot of hunting around for “outside” code to understand what’s going on inside a function. This is the polar opposite of Java, especially when dealing with giant frameworks like Spring, where there is a lot of layers being combined just to do one thing. Coding in Java/Spring, Rails, and even Django can feel a lot like dealing with those nesting dolls. Like the grandparent, I wish to do more with Clojure some day.
- jcadam 4y agoCorrect. I like ruby the language. Rails, not so much.
- LesZedCB 4y agosorry, i also use clojure for hobby projects and am familiar with clojure/repl/etc. i guess i assumed that since this thread was about web frameworks that their large clojure code base was also a web application. though i see that isn't necessarily implied.
- Jonovono 4y agoSame here! I wanted to learn it and Overtone years ago, tried to, realised my brain was just not prepared ;p. I have a bit of time now and I am diving in again and am more determined this time! I got clojurescript going with react native, and having fun so far. If you need inspiration check out Rich Hickleys talks. He keeps me going through the hard times!
- gleenn 4y agoI always struggle with the idea that "frameworks are bad, combine libraries instead," it makes sense and makes orthogonal libraries not step on each other or make things more complicated. The thing lost is having an easy time getting up and running quickly. I was always a big Liminus champion fir this reason, they tried really hard to group a good set of libraries and document it all well. Bur this work is also fantastic. Sometimes, you really just want to get something done, and the batteries included solution might be the thing that gets your project done. I came from Ruby on Rails and will always miss that ability to get a DB connected, Javascript enabled, dynamic website onto something like Heroku from 0 to production in like... 20 minutes. So thanks for Coast, looks like it will help fill in an important part of the tooling spectrum.
- andrewzah 4y agoAgreed, that's why I find it so difficult to leave rails/ruby. I really like Clojure+Datomic+Clojurescript but I can't justify the extra work needed compared to the extensive tooling and library support that rails has since it's mature and widely used.
- adamkl 4y agoAgree. There is a lot of value in the "easy, batteries included" solution which is why Rails gets so much love from the start-up community. The problem always seems to be that the same things that makes Rails easy to get started with (cough ActiveRecord cough) also make it easy to create foot-guns in the future (provided your start-up lasts long enough to get to that point). Combining a Rails like framework that makes things easy with a language who's idioms prioritize simplicity seems like a great combination.
- slowmovintarget 4y agoTo quote Rich Hickey: "gem install hairball"
- adamkl 4y agoI like that quote, but it's the Rails idioms and conventions that make hairballs, not the fact that it includes a bunch of batteries.
- maxfurman 4y agoThis looks very nice! Happy to see something batteries-included for the Clojure crowd. How does this compare to Luminus?
- the-alchemist 4y agoLooks great! I also like the informal, conversational tone of the documentation. :)
- swlkr 4y agoAlways nice when one of my projects makes it to the front page! I haven’t worked on this one much lately, but I’m happy to answer any questions!
- janetacarr 4y agoThis is cool, but, aside from error messages, it resembles Clojure's biggest problem right now: Everyone keeps trying to re-invent the wheel with respect to creating the "Rails" for Clojure. We have several production grade libraries and frameworks for serving webpages. Reitit(router), yada(http standards), bidi(router), aleph (netty wrapper), ring (jetty wrapper), pedestal (bundle of libraries), luminus (self described micro-framework), the list goes on, yet Clojure's biggest pain point is the lack of other production grade libraries for other/mundane things. If the libraries do exist, they can barely cut a stable release (like 2.0.0-alpha24) or keep up with changes to prevent software rot.
- jwr 4y agoHmm. Can you give some examples of those missing libraries? I've been developing and running a large SaaS for the last several years and never found lack of libraries to be a problem.
- janetacarr 4y agoWell, the biggest glaring thing is Clojure.spec. It's quite literally still in alpha (clojure.spec.alpha), and is a core part of Clojure, but everyone uses it in production anyways. (I might be biased here, I have opinions on whether or not clojure.spec should even be part of Clojure) For example, things like clj-stripe, Matchbox(firebase lib) Onyx(MapReduce lib), and Cortex(ML lib) are all out of date. One thing I see a lot from companies using Clojure(script) is they fork open source projects, extend them for their needs, and never contribute back. Clojurescript libraries in particular are extremely bad for this. For example, re-frame-firebase has suffered some serious bit rot lately, the core repo uses firebase sdk 5.7, and hasn't ever really been used in a production setting! Anyways, not trying to call out these library maintainers because I do understand maintaining libraries is time consuming. I'm trying to call out companies taking from the community and not giving back.
- jwr 4y agoHmm, interesting. As for spec, I use it in production, despite its shortcomings. And I think some of the shortcomings require very careful thinking and design, so I guess I'm fine with the authors taking their time. The libraries you mentioned are something I never needed, but I understand what you mean now.
- mark_l_watson 4y agoThanks for posting this. I might want to give it a try with my very old 'smart' nutrition and cooking website [1] that I wrote in Clojure about 10 years ago and have not touched it in years. I wanted to update it a few years ago but the Clojure web libraries/frameworks I used are no longer supported. [1] http://cookingspace.com http://cookingspace.com
- phyrex 4y agoI loved Coast and wrote at least one production app with it (and very quickly and pleasantly at that), but it needs to be said that swlkr is the only developer, and he seems to have mostly moved on to Janet (https://janet-lang.org/ https://janet-lang.org/). Case in point, the last real updates to Coast were 2 years ago, and - unlike other Clojure libraries - not because this project was /finished/.
- pull_my_finger 4y agoHe made a similar framework for Janet lang in Joy Framework[1] and it's unironically a joy to work with. Joy is one of those tools that is almost enough to make you use a different language imo. Got it where it counts, but still minimal and low mental overhead. [1]: https://joy.swlkr.com/ https://joy.swlkr.com/
- swlkr 4y agoYeah, I did move on, but if someone were to pick up the torch, I would help out any way I can!
- rawoke083600 4y agojanet looks really really good ! I like the use of channels for m.t Any good HTTP/JSON/Crawler examples or libraries ?
- capableweb 4y agolibcurl wrapper - https://github.com/sepisoad/jurl https://github.com/sepisoad/jurl json encoder/decoder - https://github.com/janet-lang/json https://github.com/janet-lang/json Not aware of any HTML parsers/traverses (if that's what you mean with "Crawler") but interfacing with C libraries is easy so grab any C library you'd like for that task.
- phyrex 4y agoId actually love to hear what made you move on, if you have a few minutes to spare!
- 0xferruccio 4y agoLove to see Coast getting some attention again! I got my start into Clojure with it working with Sean on small web apps written in Coast. I even gave a talk about it at the Berlin Clojure conference https://youtu.be/24PRtDJGvW8 https://youtu.be/24PRtDJGvW8 The first project we built together with it was called magehash, and it was an app to monitor websites for Magecart attacks (code injection stealing credit card data). That project ended up not working out, but I’m using a lot of the lessons I learned with Sean at my new project (https://www.june.so https://www.june.so) which is ironically a Rails app and we keep in touch on Twitter regularly
- swlkr 4y agoSo much fun working on that project! Turns out it's really hard to beat the productivity of rails
- elwell 4y agoPerhaps I'm being too quick to judge, but it appears to basically be ring/compojure.