This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-06
Channels
- # babashka (40)
- # beginners (14)
- # calva (3)
- # cider (7)
- # clerk (40)
- # clj-kondo (8)
- # cljfx (3)
- # clojure (79)
- # clojure-berlin (1)
- # clojure-denver (14)
- # clojure-europe (30)
- # clojure-nl (6)
- # clojure-norway (21)
- # clojure-uk (4)
- # clojurescript (10)
- # conjure (4)
- # data-science (13)
- # emacs (21)
- # events (8)
- # hoplon (7)
- # hyperfiddle (25)
- # lsp (11)
- # matrix (1)
- # off-topic (110)
- # pathom (11)
- # pedestal (7)
- # reagent (13)
- # reitit (16)
- # ring (10)
- # shadow-cljs (6)
- # timbre (3)
- # vim (8)
- # wasm (3)
Beside potential lack of developpers in cljs, are there reasons where typescript would be better than cljs?
1. Programming when leveraging a type system (Typescript) is different from programming when leveraging a REPL (Clojurescript). 2. Different tools have different ergonomics. Typescript with a https://vitejs.dev/ feels different from Clojurescript with https://github.com/thheller/shadow-cljs. Perhaps have a look at each tool's documentation. 3. Typescript has been developed specifically to let users gradually migrate a codebase from javascript to typescript. You can conditionally enable the type system for certain files while you have a mix of javascript and typescript files. Migrating from JavaScript to ClojureScript cannot be done this way, because Clojure syntax is not a superset of JavaScript syntax. > are there reasons where typescript would be better than cljs? This will come down to preference: who is going to create this system? An approach to mitigate risk using technology a team doesn't have prior experience with can be to build the two copies of the same systems simultaneously. One with Typescript, one with Clojurescript. Do that for a month, and evaluate the results. In which codebase is the team more effective?
I have done a bunch of work with the AWS CDK tooling. That focuses on TypeScript as it's default language, but also provides a Java implementation. I've seen a couple of efforts to use that tooling in Clojure/CLJS, and I think they mostly get abandoned. I think that the main reason is that the problem that the cdk is solving is providing an autocomplete system that wraps the inconsistent and confusing aws apis, and doesn't really have any state to update or much information processing to do. The cdk lifecycle means that the code runs, outputs a bunch of json files and then exits. In this case, having an type system guide you through the maze of aws apis provides way more benefit than the good things that Clojure/CLJS can give you (like a working equals implementation, or macros, or protocols, or any of the other great things you might want to use to develop the code you actually run in production). I think that it's always worth thinking about the context in which a tool is being used.
Did a video about Porting single argument function to accept multiple arguments in Clojure https://www.youtube.com/watch?v=cE8oAyCjF_s
Hi everyone, an absolute cljs beginner here looking to develop websites using cljs. Are there any tutorial/courses where I can learn? Also are there any open source websites/ source codes which I can study to learn?
https://github.com/thheller/shadow-cljs shadow is a popular build tool for CLJS and the repo cites many example projects. Also check out the official Clojurescript site http://clojurescript.org! And the #clojurescript channel too for other resources
I'd also add that there's a big difference between "develop websites" and "develop applications". What sort of sites are you looking to develop @U05B761VCAF? Something rich and interactive with most of the work on the client, or something that is mostly static with content stored in a database (like a blog)?
Thanks @U03QBKTVA0N, I'll look more into it. @U04V70XH6 I'm looking to develop more static websites, not overly interactive
For mostly static sites, ClojureScript is probably overkill. Is there a server component to what you're thinking about? Content from a database etc?
just in the experimental stage right now. could switch later on but currently want to learn it to develop static sites
in that case you're probably better off either generating the html server-side with hiccup or using a static site generator (idk if there's one in clojure)
https://cryogenweb.org/ is a nice static website generator that is written in Clojure.
@U05B761VCAF You might want to check out HTMX as well. I had need for a very simple personal web "app" and used HTMX on the frontend with Clojure on the backend. Hiccup makes it easy to generate responses for HTMX.
Ever wondered how to extend a Java interface in Clojure using :gen-class
? See https://github.com/jpalharini/clj-logback-appender of a Logback Appender. 🙂