Live data from Hacker News

Tetris in ClojureScript

shaunlebron.github.io

31–34 of 34 posts

Re: Tetris in ClojureScript

#31
Now I am tempted to share 2D breakout game I built using ClojureScript.

On Slide 3, if you drag piece(cursor) to leftmost or right most side, part of piece is getting chopped.

Great work by the way.

Re: Tetris in ClojureScript

#32

Shaun 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/

As you, I learned scheme first, chicken scheme! I like CLJS, your code will likely be small and expressive. The hot reloading another multiple of productivity added. And having a REPL that can connect to the browser is great. But CLJS has some pitfalls.

It's JS underneath so you still need to know it. Because eventually there is a large enough problem someone else solved and you need to understand their code, shipped as a npm package. When you are solving some problem and researching, most people use JS, so you will have to go through the extra step of translating JS code in your head to CLJS. This could be anything from browser quirks to React Native workarounds.

I don't think the tooling is enough for when complexity grows. It can be difficult to quickly understand how the code glues together, finding references to functions and refactoring. It is a dynamic language, and have all the problems that comes with that.

My assessment is that if you are making a browser only fronted with reagent (and reframe) and limited scope. Of course having a backend in either CLJ or CLJS as well to benefit the most.

Re: Tetris in ClojureScript

#33

Earlier quoted context omitted.

I wrote about my journey covering Clojure's pros and cons: https://medium.com/swlh/what-i-learned-after-writing-clojure...

"It has a slow startup time. Clojure runs on the JVM and has a significantly slower startup time compared to Node. Again, this is only a problem from an outsider’s perspective. We have REPL. You start the app only once, and it keeps running in the background. You can interactively include new changes, without having to startup every time." I've been using Clojure for about 8 years and this is one of the talking point…

If you want fast-starting CLI apps in Clojure, there's a wide variety of options such as:

- CLJS + node

- Babashka

- Graal native compiled Clojure

Here's a fast-starting CLI app I made in CLJS+node:

https://github.com/hugit-project/hugit

Post reply on HN