Fork me on GitHub
#off-topic
<
2015-11-15
>
johanatan03:11:57

I haven't really had a need for it: inputs are of deterministic type and conversions are required at obvious sites. @jaen

jaen09:11:46

@johanatan: you mean typing? I dunno, I like compiler telling me "you dun goofed up" when compiling instead of getting "Can't cast ISeq to IFn" during runtime, possibly in a place far removed from where the problem originated. I'm not the smartest or most organised person around, so I like the computer keeping tabs on such menial things like these instead of me. Bonus points for being able to construct the types as to disallow invalid states.

johanatan09:11:01

Yes, I mitigate that by changing small parts/one thing at a time and using constant feedback loop of of execution/live coding. Also trying things out in REPL first. I've had good experience with core.typed although if I wanted to go down that road today I'd just use Prismatic Schemas

jaen09:11:36

Well, separating things into small pieces and exploratory programming in REPL certainly can help, but it can so happen that you chew a bit too much at a time or you didn't realise some interaction will happen and the non-local blow up can still happen even then. I like increased locality of error static typing gives me. I think as cool as core.typed seems, bolting a static typing system onto a dynamic language will always be limiting to both the language and type system - you just won't be able to either type or keep using some common idioms effectively, since languages tend to grow differently depending on presence or absence of a strong static type system. Pristmatic Schema is a nice and helpful library, but still pushes failures to runtime, where I preferably would have no problems.

jaen10:11:00

I really like Clojure, but the times when errors happen that static typing could have avoided still annoy me.

jaen10:11:43

And probably it's a bit related to how much you trust your own programming abilities - I don't trust mine for example and would prefer the type system to stand guard so I don't screw up too much.

jaen10:11:17

It's all a set of trade offs though.

borkdude10:11:58

Of course, static typing has advantages. It's a trade off.

borkdude10:11:40

I tried the Scala console, but what is annoying is that you have to exit it, then recompile and re-enter the console.

borkdude10:11:29

I think in Scala it makes more sense to write tests instead of trying everything from the console. Which might actually be a good thing: it forces you to write tests 😉.

jaen10:11:46

Writing tests is hard, I still can't learn it D :

borkdude10:11:51

The Scala console makes sense when you want to try a library, but not for developing

jaen10:11:32

Well, I didn't write anything big enough in Scala or Haskell to say whether that is true, so I'll take your word for it. Being able to develop without reloading the whole REPL is certainly a nice feature of Clojure.

borkdude10:11:34

I think with JRebel you could get that behavior maybe in Scala, but that's another tool

jaen10:11:16

And paid one at that, I think?

juhoteperi10:11:01

JRebel used to be free for Scala developers but they changed that maybe 1.5 years ago

juhoteperi10:11:19

With Sbt+Scalatra+Jrebel it was possible to get a workflow where file change resulted in recompile and new jetty being started, each recompilation took something like 5 to 60 seconds.

juhoteperi10:11:15

Luckily I haven't had to work with Scala in some time, but I remember seeing some mentions of incremental recompilation being added to core and other frameworks (lift or play?) using that

borkdude11:11:18

@juhoteperi: isn't the idea of JRebel that you shouldn't have to restart your web server

juhoteperi11:11:52

@borkdude: Yes, I guess it's more of container reload instead of jetty restart.

agile_geek11:11:23

Does anyone know of a Clojure library that wraps HBase that will support HBase 1.1.1? I’ve looked at https://github.com/tolitius/cbass and https://github.com/davidsantiago/clojure-hbase and neither seem to work w/ 1.1.1. I was thinking of forking clojure-hbase and looking at upgrading it but I really don’t have the time as I’ve a problem to solve in the next day or so.

rok318:11:33

@agile_geek: Nope, but the code isn’t too ugly when using it via interop. We only needed it for a couple queries at work so just made a few wrapper functions to clean up the API. Your mileage might vary.

agile_geek18:11:50

@rok3 yeah, I've ended up using interoperability.

johanatan19:11:17

@borkdude: there are ways to reload what you need to from within Scala's REPL so that isn't a substantial difference

johanatan19:11:58

@jaen: runtime/compile time doesn't matter to me because I use tight iterations/live coding

jaen19:11:48

@johanatan: well, that is quite orthogonal, when live coding the code still needs to be compiled and less checking during that still can mean uncaught bugs. But I imagine it's certainly less of a problem if you program in small bites

johanatan19:11:24

@jaen: huh? Orthogonal? No, they're integrated. Run happens directly after compile and they both happen on edit

johanatan19:11:49

@jaen: this the phases are indistinguishable

johanatan19:11:40

If you want to think of them as compile, you are free to do that. It's a state of mind

jaen19:11:37

In Clojure they are, it's a compiled language

jaen19:11:27

And it's a difference if you get an error on compile time

jaen19:11:31

(for example wrong arity)

jaen19:11:35

or durign runtime

jaen19:11:40

(mismatched types)

johanatan19:11:35

Ok, you are not understanding what I am saying. Sorry about that

johanatan19:11:16

But out of curiosity why do you care where an error comes from?

jaen19:11:02

I care about how early I can get it, which I think in case of mismatched types for example runtime is too late

jaen19:11:45

Since seqs are lazy the mismatched type can propagate far enough it can be nontrivial to udnerstand the error

jaen19:11:48

At least in my experience

jaen19:11:59

Debugger helps a lot

jaen19:11:14

But having this caught by the type system would have been even better

johanatan19:11:03

In my experience the time span between compile time and runtime is imperceptible

johanatan19:11:01

I've also not seen any vast distance between the source of an error and the actual underlying issue

borkdude19:11:01

if you want to have a good laugh, try this lecture simple_smile https://www.youtube.com/watch?v=3wyd6J3yjcs

borkdude19:11:47

@johanatan: how do I reload code from the Scala console?

jaen20:11:50

I'm not talking about the timespan which, yes is hardly noticeable, but about the conceptual difference. To me it's a big difference to know the code is wrong/right before you run it, or have it crash on runtime at a different place than where the error as introduced.

jaen20:11:46

I've been programming in Ruby mostly (and recently in Clojure) and in my experience there's considerably more action-at-a-distance type of errors I have to back track to figure out why they happened than I encountered in static languages.

jaen20:11:20

(it's kind of funny I've had more problems with it in Clojure than in Ruby, probably mostly due to regular syntax making it easier to inadvertently put things in function call position)

jaen20:11:32

But that all might just be me being an awful programmer : V

borkdude20:11:02

@jaen: it's probably not you

tolitius21:11:41

@agile_geek, are there any specific features you need in HBase 1.1.1? I can bump: https://github.com/tolitius/cbass/blob/master/project.clj#L10 and retest. Just wanted to see what were you looking to get in 1.1.1 that is not in 1.0.0

agile_geek21:11:08

@tolitius no nothing specific

johanatan22:11:05

@jaen: that is surprising to me-- seems like monkey patch etc is further off the beaten path in Clojure and is even less accepted than macros which are advised to be last resort

johanatan22:11:44

I suppose there is a time and place for everything but in my experience, those places are very few and far between

johanatan23:11:00

I think it all comes down to how you are using the language-- and with immutability baked in, it's definitely harder to shoot yourself in Clojure than other dyn langs

jaen23:11:11

Dunno, considering Ruby is mutable to the max and Clojure is immutable I expected to have less problems in Clojure and was surprised how much problems I've had. I basically put off learning Clojure in the large until Cursive got proper debugger support because it was too annoying for me otherwise.