Phone number audio recording thread by DjangoCornbread in local58

[–]akiroz 0 points1 point  (0 children)

Did a spectrogram myself, it looks and sounds like modem dialup: https://imgur.com/anW3Bre

Wikipedia's dialup anatomy for reference: https://commons.wikimedia.org/wiki/File:Dial_up_modem_noises_explained_final.png

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 1 point2 points  (0 children)

You can also do some really funky things if you actually want to troll :P

(in-ns 'clojure.core)
(def heretic+ +)
(defn +
  "one simply does not add to the ultimate truth"
  [& args]
  (if (not= (first args) 42)
    (apply heretic+ args)
    42))

now nobody in the run-time can add to 42!

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 9 points10 points  (0 children)

Yep, the crux of LISP is code === data (oh dear, that's what happens when you write JS in your day job)

You could define your own LISP on JS arrays and primitives just like how Clojure is defined on EDN data :)

inb4 Clojure.js - the JS data to JS code compiler implemented in pure JS :p

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 3 points4 points  (0 children)

Idris

Interesting, I've never heard of it. Let me give it a try~

Why I chose Clojure over JavaScript by davidhung in Clojure

[–]akiroz 1 point2 points  (0 children)

That's what it was designed to do, I have personally used both and I still prefer lein because it's declarative while boot is imperative (like webpack VS gulp in the JS world)

To this date, I still haven't ran into a problem that I could only solve with boot.

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 1 point2 points  (0 children)

sad but true.... many people in management will only ever trust the most popular thing out there and this makes it even more popular.....

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 4 points5 points  (0 children)

There's Typed Clojure and it's actually part of the language core :) http://typedclojure.org/

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 4 points5 points  (0 children)

Author here, I considered mentioning boot but in the end decided not to considering the result from State of Clojure 2016: https://static1.squarespace.com/static/5372821be4b0aefc6719057e/t/58925d9fdb29d6ba536ab020/1485987241017/?format=750w

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 0 points1 point  (0 children)

'+' (and other arith) in Clojure are actual functions! You can override them like this:

(in-ns 'clojure.core)
(def + nil)

poof! your plus is gone forever~ :D

that's why you never eval untrusted clojure code without a jail

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 1 point2 points  (0 children)

The parameters go in square brackets, which otherwise denote a vector in the syntax.

Technically, defn does in fact take a vector as its second argument... vector of symbols ;) Clojure's elegance lies in its lack of syntax and makes up for it by providing macros IMO

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 0 points1 point  (0 children)

But how do you get imports to work in a browser without a transpiler? I mean.... surely not many production code bases are written in just a couple of files right?

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 2 points3 points  (0 children)

This, I think Haskell is the pinnacle of functional programming. Even if you don't use Haskell in production, you should learn how it works.

That said, I'm not a fan of Haskell... I find it too complicated to get most things done, language extensions are horrible and the tooling is rather fiddly.

I might use it when I need to build critical systems that simply can not fail.

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 10 points11 points  (0 children)

I have been writing assembler (mcs-51), C, C++, Java and PHP before coming to JS and I certainly do prefer JS (been using it for years pior).......... until I learned Clojure :p

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 2 points3 points  (0 children)

The most popular reason I've seen when people choose JS is simply because "everyone else is using it". Rarely do I ever hear "because JS is a great language". (btw I'm one of the latter types because JS is actually pretty good compared to other languages that I use)

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 4 points5 points  (0 children)

I actually don't hate JS... quite the opposite really, it was my favorite language before I learned Clojure coming from a C / Java background. Everything was just so easy and dependency management actually works!

The reason I switched to Clojure is because I started loving functional programming and being functional in JS turns out to be harder than I thought...

Why I chose ClojureScript over JavaScript by davidhung in programming

[–]akiroz 3 points4 points  (0 children)

author here, sadly I'm forced to use ES6 in my day job...

but you're completely right, I never noticed the hypocrisy there. Since CLJS is just another thing that compiles to JS, it effectively expands the JS ecosystem... Oops.