Here's a little 'game' I'm working on with some simple physics in ClojureScript: https://github.com/celwell/wordsmith
Tetris in ClojureScript
11–20 of 34 posts
Re: Tetris in ClojureScript
#12Shaun Lebron has a bunch of interesting stuff on his github[0] involving closurescript. I haven't toyed with closurescript yet, if anyone has any experience with it, what are its strengths and weaknesses? I' ve been learning scheme/racket for the past year and for learning purposes Dr Racket is more than enough for now, but sometime in the future I'd like to branch out of that. [0]: https://shaunlebron.github.io/
Re: Tetris in ClojureScript
#13Shaun also released the really neat Parinfer package as well: https://shaunlebron.github.io/parinfer/
Re: Tetris in ClojureScript
#14Shaun Lebron has a bunch of interesting stuff on his github[0] involving closurescript. I haven't toyed with closurescript yet, if anyone has any experience with it, what are its strengths and weaknesses? I' ve been learning scheme/racket for the past year and for learning purposes Dr Racket is more than enough for now, but sometime in the future I'd like to branch out of that. [0]: https://shaunlebron.github.io/
Re: Tetris in ClojureScript
#15Shaun also released the really neat Parinfer package as well: https://shaunlebron.github.io/parinfer/
I was surprised to see the repository was Archived. Is it not being maintained now?
Re: Tetris in ClojureScript
#16Absolute awesome work.
I always kept my distance from Clojure because of the reliance on the Java ecosystem but having a productive and stable language that is a pleasure to work in and that transpiles to JavaScript seems like a good deal. Plus a solid REPL-based workflow and rapid prototyping support, something I sometimes miss from more static languages.
Re: Tetris in ClojureScript
#17Shaun Lebron has a bunch of interesting stuff on his github[0] involving closurescript. I haven't toyed with closurescript yet, if anyone has any experience with it, what are its strengths and weaknesses? I' ve been learning scheme/racket for the past year and for learning purposes Dr Racket is more than enough for now, but sometime in the future I'd like to branch out of that. [0]: https://shaunlebron.github.io/
There are several tools available for live-coding (REPL-driven development) such as more recent shadowcljs or the older Figwheel.
Rum is a powerful wrapper over React.js and you can live code and see instantaneous results in the browser (using shadowcljs or figwheel).
ClojureScript's strengths largely stem from Clojure -- collections as fundamental types, REPL, macros, immutable datastructures* and lovely syntax.
As far as cons go, it takes some time to start up a REPL and making release builds is an extra step, but should work just fine unless you're a newbie like me and you leave strange unnecessary lines in your code. Javascript and js/CSS interop is there, but it's not super obvious and takes some getting used to what it looks like -- luckily there are enough online writeups to make that process easier.
The addage "why clojurescript? Because clojure rocks and javascript reaches" sums up nicely the motivation.
You can have largely isomorphic code on the front-end and back-end, which lends nicely to creating server-side rendered versions of SPAs for search engine indexing and fast load times. However, the server-side copy and the client rendered copy must match exactly for this to work, which can be a bit of a "thread the needle" kind of problem.
* immutable datastructures are awesome, contrast with mutable datastructures and "location oriented programming" -- any time you "edit" a value you're actually creating a new datum. This is done with atoms (immutable data stores that need to be dereferenced to retrieve their value) and operations such as swap! and reset! that either apply a function to the current value of an atom, resulting in a fresh new atom with the new value, or overwrite the atom completely with some value, respectively.
So yeah, if you like live-coding and appreciate the power of lisp, it's a really nice fit. Yes, the way to do stuff is "opinionated" but it's opinionated in what many years of trudging through the tar pit* would suggest is the right (only?) way to do things.
* Out of the Tar Pit [http://curtclifton.net/papers/MoseleyMarks06a.pdf]
I highly recommend Rich Hickey's talk "Are we there yet?" to give you an overview of the motivations behind Clojure and subsequently ClojureScript. [https://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hi...]
Re: Tetris in ClojureScript
#18This was the final push I needed to learn Clojurescript. Absolute awesome work. I always kept my distance from Clojure because of the reliance on the Java ecosystem but having a productive and stable language that is a pleasure to work in and that transpiles to JavaScript seems like a good deal. Plus a solid REPL-based workflow and rapid prototyping support, something I sometimes miss from more static languages.
Re: Tetris in ClojureScript
#19Shaun Lebron has a bunch of interesting stuff on his github[0] involving closurescript. I haven't toyed with closurescript yet, if anyone has any experience with it, what are its strengths and weaknesses? I' ve been learning scheme/racket for the past year and for learning purposes Dr Racket is more than enough for now, but sometime in the future I'd like to branch out of that. [0]: https://shaunlebron.github.io/
I wrote about my journey covering Clojure's pros and cons: https://medium.com/swlh/what-i-learned-after-writing-clojure...
Re: Tetris in ClojureScript
#20Shaun Lebron has a bunch of interesting stuff on his github[0] involving closurescript. I haven't toyed with closurescript yet, if anyone has any experience with it, what are its strengths and weaknesses? I' ve been learning scheme/racket for the past year and for learning purposes Dr Racket is more than enough for now, but sometime in the future I'd like to branch out of that. [0]: https://shaunlebron.github.io/
I wrote about my journey covering Clojure's pros and cons: https://medium.com/swlh/what-i-learned-after-writing-clojure...
I've been using Clojure for about 8 years and this is one of the talking points I find most annoying. The slow startup time is a disadvantage, and it should be owned. It disqualifies clojure from a large class of applications and if you're not honest about it you lose credibility, and you retard potential attempts to solve it. It doesn't mean you can't write software with Clojure, but be honest about the fact that it makes lots of types of usage (not all) a poor match.