News for hackers. Stuff that matters.
Re:Meet Crystal language in its birthday. It is compiled and... by tlb on Friday September 06, 2013 @07:37PM (#6343247)
It's absolutely a feature. It allows testing small parts of a system during a major code change when the rest of the system is broken.
Re:Meet Crystal language in its birthday. It is compiled and... by JoshTriplett on Friday September 06, 2013 @10:50PM (#6343739)
You can easily do that in a statically typed language as well; you just have to do it explicitly. For instance, Haskell has the error function, of type "String -> a"; you can use it absolutely anywhere, no matter the expected type, give it an error message, and if the value it produces is ever actually used, it throws an exception with the specified message.
Re:Meet Crystal language in its birthday. It is compiled and... by tel on Saturday September 07, 2013 @12:08AM (#6343931)
Also the trace module is pretty useful for the kind of dynamic-debugging practice people often do.
Re:Meet Crystal language in its birthday. It is compiled and... by andrewflnr on Saturday September 07, 2013 @01:35AM (#6344084)
Don't discount the value of doing it implicitly. When you're just throwing stuff together (and there is a place for that), it's a distraction to work around parts of the system that won't work yet, both the typing and the mental overhead.
Re:Meet Crystal language in its birthday. It is compiled and... by tel on Friday September 06, 2013 @08:27PM (#6343404)
Then provide compile-time warnings---something still not done. Haskell's GHC now does -fdefer-type-errors
Re:Meet Crystal language in its birthday. It is compiled and... by kyllo on Friday September 06, 2013 @08:26PM (#6343398)
As well as applying patches to a running system without restarting it
Re:Meet Crystal language in its birthday. It is compiled and... by tel on Friday September 06, 2013 @10:55PM (#6343748)
Having done this both with Clojure and Erlang, I find the unversioned, dynamic mode of achieving this is fraught with trouble. It's really easy to end up in complex atypical states during upgrade which can at best be hard to debug and worst corrupt other, longer term state.
Re:Meet Crystal language in its birthday. It is compiled and... by jamii on Saturday September 07, 2013 @07:27AM (#6344743)
Exactly. I think what a lot of people miss is that erlang makes live upgrades possible but certainly not easy. Trying to upgrade a complex application one component at a time (the way erlang/otp promotes) is still insanely hard and not worth the pain unless you're working in a domain where you have absolutely no choice (which is of course why Ericsson developed erlang in the first place). For the vast majority of applications the right choice is to restart the server and accept a few seconds downtime.
Re:Meet Crystal language in its birthday. It is compiled and... by tel on Saturday September 07, 2013 @08:45AM (#6344915)
I think with better documentation I'd actually call Erlang's model "easy" in that its really easy to do things correctly with absolutely minimum chance of corruption/failure/non-repeatability. OTP gives you the tooling—releases, versions thereof, and simultaneous multiple module tenancy being key—to actually do a good job. That's a rare thing.
Re:Meet Crystal language in its birthday. It is compiled and... by xxpor on Saturday September 07, 2013 @12:13AM (#6343941)
There is essentially no reason why this should ever be needed.
Re:Meet Crystal language in its birthday. It is compiled and... by kyllo on Saturday September 07, 2013 @06:22PM (#6346875)
Unless you're an Erlang or maybe Smalltalk programmer