News for hackers. Stuff that matters.
Re:Why Crystal Is My Next Language by kodablah on Sunday June 10, 2018 @11:34PM (#17281557)
It's like a language was picked first and then the blog written backwards to come to the conclusion. So there's some languages in bullets and subjective pieces that are reasons not to use them. I can do that with Crystal too...it doesn't even support one of the most popular OS's natively. I mean, the author says C++ is a better language than Go, that Google is the ultimate reason for success, and that Go takes us back to C. That doesn't even make any sense. "doesn't seem to click to me...generally didn't feel...feel the language is rough" etc. How about just use the best language for the problem, instead of choosing the language before the project. As I've mentioned on many of these language-comparison posts (more like tweets) these days, just ignore them and remain wise to your problem space. They are very juvenile.
Re:Why Crystal Is My Next Language by timClicks on Monday June 11, 2018 @12:11AM (#17281708)
In my view, programming language choice is cultural yet is always framed as something objective. It is even possible to "use the best language for the problem"?

Even if it were possible to evaluate all current alternatives, we lack knowledge of the future and therefore can't reliably include important factors such as ability to hire into the team.

Re:Why Crystal Is My Next Language by sjellis on Monday June 11, 2018 @02:04AM (#17282159)
> In my view, programming language choice is cultural yet is always framed as something objective.

I agree, and think that the culture around a programming language is one of the most important attributes, so we should not be afraid to talk about human factors like cultural fit. Your choice of programming language is usually limited to a short list of the ones that have the tools and libraries to support what you are doing, but IMO it's perfectly reasonable to choose a particular language because you and your team like the culture. If you decide to use a programming language in production, you might have to live with it for a long time.

Re:Why Crystal Is My Next Language by kodablah on Monday June 11, 2018 @12:40AM (#17281854)
> It is even possible to "use the best language for the problem"?

Not perfectly because "best" is subjective. My advice is to let the problem and goals help you dictate (yes, even on hobby projects and even if one of the goals is trying said language). In fact, if you are a hobbyist evaluating languages, you should try them all out with reasonable projects where you can instead of write a post saying how you are moving from a single one to another single one.

Re:Why Crystal Is My Next Language by mosselman on Monday June 11, 2018 @03:36AM (#17282485)
I really like this[1] talk from DHH on the subject, where he talks about the misconception of many programmers that we are doing science rather than something creative. While laced with hyperbolic statements it is at the very least thought provoking on some of the things that we do as developers.

1: https://www.youtube.com/watch?v=9LfmrkyP81M

Re:Why Crystal Is My Next Language by Accipitriform on Monday June 11, 2018 @12:53PM (#17286049)
"In my view, programming language choice is cultural yet is always framed as something objective."

I think that's an objectively false statement.

There are many objective metrics by which a programming language may be evaluated. Conciseness, clarity, suitability for realtime applications, and efficiency come to mind.

"It is even possible to "use the best language for the problem"?"

It's certainly possible to use a suitable language for the problem. Some problems are more forgiving than others, of course...

I will say that the idea of a "general purpose" programming language, suitable for most tasks, is a good one. The current multitude of languages, while fun and good for exploring new ideas, is taking a lot of brainpower away from actually producing working systems. Also, I'll claim that there's no reason that most programs shouldn't be written in an efficient language, and in fact there may be a push for that in the name of datacenter efficiency.

It's sad that the most written programming language today is Javascript.

Re:Why Crystal Is My Next Language by sam0x17 on Monday June 18, 2018 @07:49PM (#17342601)
It's a slippery slope though. Conciseness, clarity, many of those are highly subjective..
Re:Why Crystal Is My Next Language by coldtea on Monday June 11, 2018 @03:55AM (#17282563)
>I mean, the author says C++ is a better language than Go, that Google is the ultimate reason for success, and that Go takes us back to C. That doesn't even make any sense.

It makes perfect sense. In fact that's what the Go developers themselves found out -- that C++ programmers, who they thought they would be attracted to Go, passed it over, and instead Go gained dynamic language converts.

Re:Why Crystal Is My Next Language by pjmlp on Monday June 11, 2018 @04:36AM (#17282736)
If they had been more open minded regarding generic programming they would had gotten more from us.
Re:Why Crystal Is My Next Language by coldtea on Monday June 11, 2018 @05:57AM (#17283053)
Agreed. Would make Go much more suited to the kind of stuff I do -- although it still has several drawbacks as a language (warts and idiosyncratic decisions that are not really based on any utility), it hits a good spot of convenience and popularity (which means ecosystem growth) for certain tasks.
Re:Why Crystal Is My Next Language by akavel on Monday June 11, 2018 @05:14AM (#17282884)
Personally, I'm actually a long time C++ programmer (and loving it, at the time!), who abandoned it and run away full steam with Go (loving it even more). So, always when I hear the above claim, I wonder: am I, like, "the only one"? A curious specimen? Or is there more of us, just maybe we don't speak up?
Re:Why Crystal Is My Next Language by coldtea on Monday June 11, 2018 @05:59AM (#17283063)
>I wonder: am I, like, "the only one"? A curious specimen

Considering that Go doesn't even do well (and has horrible library support) for most of the stuff C++ is used for (GUI apps, 3D, AAA games, systems programming, high performance scientific calculations, etc), probably yes.

Now, if you did network servers with C++, probably Go is a better/easier/smaller surface fit.

Re:Why Crystal Is My Next Language by isaachier on Monday June 11, 2018 @08:06AM (#17283551)
I worked as a C++ developer for three years and switched to Go development this year. I used to love making a "generic" solution to a given problem using templates in C++. Now I find myself without even a decent data structure in the Go standard library. Have you seen the way priority queues are implemented? Just a terrible design choice.
Re:Why Crystal Is My Next Language by kodablah on Monday June 11, 2018 @10:29AM (#17284496)
Author said it takes us back to C and you are saying it makes perfect sense that it gained dynamic language converts? By your argument, it is passed over by C programmers too making the original statement also not make sense when framed that way. Or maybe you meant only the first part made perfect sense?
Re:Why Crystal Is My Next Language by Bizarro on Monday June 11, 2018 @12:53AM (#17281913)
Not only all that you mentioned, but picking a language isn't like it was 25 years ago.

Some hypothetical "best language in the world" is irrelevant without the tooling and ecosystem around it. "BLITW" still sucks if might as well write the code in Notepad because the editor/IDE integration sucks. "BLITW" sucks if the community consists of 8 people on github.

I hear of Crystal a couple/3 years ago, and it sounds neat on paper - a statically-typed, fast Ruby. Cool, but it's completely meaningless to me because it doesn't fit into any ecosystem that me or most developers care about.

Re:Why Crystal Is My Next Language by ben0x539 on Monday June 11, 2018 @07:01AM (#17283262)
In practical terms, you're right, of course, but also...

> "BLITW" still sucks if might as well write the code in Notepad because the editor/IDE integration sucks.

We have better editors than notepad that work with any language, and there's plenty of people getting work done with fairly barebones editor setups making no use of language integration at all.

> "BLITW" sucks if the community consists of 8 people on github.

While adoption and library availability are clearly huge factors, they're not necessarily absolute requirements. There are plenty of good (and surely also many bad) reasons why many real-world codebases are practically isolated from the wider community despite being written in a widely adopted language.

If some language was clearly the best in the world, or even just demonstrably superior in a way that is meaningful to whatever your requirements are, it can be a totally reasonable decision to choose that language for your project even though you won't be able to reach to github for a lot of conveniences, you'll have to write code in stock vim and you'll have to invest some extra time to get new contributors up to speed.

I don't know if Crystal is that language, I'm not even in a great hurry to try it to find out, but I feel like if I waited until a language had reached Go levels of mindshare before taking it seriously I'd probably be missing out.

Re:Why Crystal Is My Next Language by p1necone on Monday June 11, 2018 @01:09AM (#17281973)
Absolutely, as an anecdote: I keep coming back to Java for non-trivial projects not because of the language itself at all, but because of Maven Central, Gradle and the rest of the very mature CI ecosystem with Java.
Re:Why Crystal Is My Next Language by fgimian on Monday June 11, 2018 @03:04AM (#17282371)
You make a fair point and I totally respect your opinion.

I was ultimately looking for a versatile language that I could use for my personal projects outside of work and thus I was indeed trying to find a single language that could do everything I wanted. Up until this point, that language has been Python.

Go is clearly sufficient for many very successful and amazing projects (many of which I use daily, like Hugo, Terraform, Docker .etc), so developers can still produce excellent tools with its limitations. But in saying that, the language is not for me, and that's okay; if it works for someone else, then that's okay too. Go does lack various features that many developers want, including me.

Fun fact, the blog post was generated by Hugo ... which is written in Go :)

With regards to Nim, yes, my experience with Nim is limited and I am still hoping to learn it further and do a more thorough evaluation. Hopefully I'll spend a good amount of time with Nim in the future to give it more of a fair go.

Re:Why Crystal Is My Next Language by fileeditview on Monday June 11, 2018 @04:01AM (#17282597)
> Go [...], so developers can still produce excellent tools with its limitations.

I really found "still" to be funny because I think for many Go devs (including me) the simplicity and lack of features especially enables us to create more easily.

It's the opposite of standing in front of giant fridge shelves in the supermarket with 100+ kinds of yoghurt where you have a hard time deciding. You only have a few choices so you just go ahead and pick one/just do it.

Forgive my bad analogy.

Re:Why Crystal Is My Next Language by fgimian on Monday June 11, 2018 @04:09AM (#17282628)
Totally fair point. Minimalism can be extremely liberating and in fact, it's something I apply to many other areas of my life.

But when it came to Go, I personally found myself battling the language as a result, rather than being more productive with it.

Ultimately if it makes you more productive, then that's awesome and that's all that matters.

Re:Why Crystal Is My Next Language by flavio81 on Monday June 11, 2018 @02:17PM (#17286866)
>I really found "still" to be funny because I think for many Go devs (including me) the simplicity and lack of features especially enables us to create more easily.

Yeah man, it must be so fun doing large-scale construction work with just a hammer and a shovel; so easy to use, so easy to learn. Who needs caterpillars, pneumatic drills and such.

Last time I checked, Brainfuck is easier to learn than Go (more simplicity!!!, and runs in even more platforms.

Re:Why Crystal Is My Next Language by fileeditview on Wednesday June 13, 2018 @07:28AM (#17302079)
Your reply seems a little emotional.. I wonder why. Nobody is forcing Go on you. You can do all large-scale construction work with greater tools like Lisp or Haskell as it is commonly done.

I don't agree that Go has only "a hammer and a shovel". It has at least a saw in its toolbox too.

On a more serious note.. fun is highly subjective and the brainfuck / simplicity argument is just useless.

Re:Why Crystal Is My Next Language by ecnahc515 on Monday June 11, 2018 @02:34PM (#17287038)
The Amish manage to build large barns entirely like this in much less time than it would take the average construction firm. It depends heavily on what you're building on if you actually need a lot of those tools.

Just like if you're building a small tool to wrap another you might just choose to use bash over Java, it all comes down to what you need most commonly vs what would "be nice to have".

Re:Why Crystal Is My Next Language by flavio81 on Monday June 11, 2018 @02:46PM (#17287185)
>>large-scale construction work

>build large barns entirely

Not the same 'large-scale' construction work I had in mind.

Re:Why Crystal Is My Next Language by pjmlp on Monday June 11, 2018 @04:41AM (#17282759)
I program since 1986, had lots of fun around 1995 using Oberon system, one of Go's influences.

So naturally I used many programming languages with Go's limited set of features, which doesn't mean I want to return to those days.

Re:Why Crystal Is My Next Language by fileeditview on Monday June 11, 2018 @05:50AM (#17283029)
I'm not sure what your point is.. is it: "More features are better"?

I started programming a few years later than you.. first on Atari ST (Basic) then later in DOS (Pascal). I often wish myself back to these systems when I see today's bloated stacks of crap (obviously this does not apply to everything).

I don't think this is relevant for the original discussion though..

Re:Why Crystal Is My Next Language by pjmlp on Monday June 11, 2018 @06:48AM (#17283213)
My point is ignoring features largely proven in mainstream languages is bad.

Even the last version of Turbo Pascal for MS-DOS (7.0) was more feature rich, ignoring the lack of GC for a moment.

Re:Why Crystal Is My Next Language by sriram_malhar on Monday June 11, 2018 @12:47PM (#17285971)
Wut?
Re:Why Crystal Is My Next Language by flavio81 on Monday June 11, 2018 @02:21PM (#17286896)
What he said. Turbo Pascal 7 a better designed language than Go, for the most part.
Re:Why Crystal Is My Next Language by sriram_malhar on Monday June 11, 2018 @10:51PM (#17290361)
I'd like an example or two.
Re:Why Crystal Is My Next Language by pjmlp on Tuesday June 12, 2018 @02:31AM (#17291140)
Enumerations in Turbo Pascal

    type Colours = (Red, White, Blue);

Enumerations in Go

    type Colours int

    const (
        Red Colours = iota
        White
        Blue
    )

FFI in Turbo Pascal

    function Sin(const num: Integer): Double; external 'ext name';
FFI in Go (requires external help from a C compiler)

   // #include <stdio.h>
   // #include <errno.h>
   import "C"

   func Sin (num uint) float32 {
      return C.sin
   }

Reference parameters in Turbo Pascal with null safety thanks type system

   procedure Swap(var a,b:Integer);
   var
      temp: Integer;
   begin
      temp:=a;
      a:=b;
      b:=temp
   end;

   Swap(x, y)
   Swap(nil, y) { compiler error: Got "Pointer" expected "SmallInt" }
Reference parameters in Go (no type safety via type system, manual testing for nil required)

   func Swap (a *int, b*int) {
      var temp = *a
      *a = *b
      *b = temp
   }

 
   Swap(&x, &y)
   Swap(nil, &y) { runtime error: Invalid memory address or nil pointer dereference }

I was also tempted to move the time scale from 1992 to 2009, but then I wouldn't be able to reproduce the generics from Object Pascal in Go.

Ah, and Turbo Pascal 5.5 was compiling around 34 000 lines/minute in computers whose CPUs were maxed at about 30 MHZ, http://edn.embarcadero.com/article/20803

Re:Why Crystal Is My Next Language by YouAreGreat on Tuesday June 12, 2018 @06:40AM (#17292102)
The way I remember it, Pascal enums were useless.

Regarding nil safety, did Pascal allow something along the line of the following?

    var x: ^int;
    ...
    x^ := nil;
    Swap(x^, y)
Re:Why Crystal Is My Next Language by pjmlp on Tuesday June 12, 2018 @08:27AM (#17292590)
Useless to those that didn't understood how to take advantage of them.

They can be used as indexes, range validation, access control in variant records to simulate sum types.

Enumerations are so useless that majority of modern languages have direct support for them.

Yes, it did allow your contrived example, which seldom occurred in practice because proficient Pascal programmers only used pointers when other type safe alternatives weren't possible.

Re:Why Crystal Is My Next Language by patchguard on Monday June 11, 2018 @01:20PM (#17286375)
Assembly also lacks features.
Re:Why Crystal Is My Next Language by kodablah on Monday June 11, 2018 @09:57AM (#17284204)
I personally recommend choosing the language after you know the personal project you'll be working on. For instance, I hate Go's lack of expressiveness but ended up choosing it for a personal project due to the strength of its crypto libraries. Also, if you can spare the time, creating full blown, open projects in languages can help your well-roundedness. My comment was meant to be less about Go and more about dismissing languages outright. I'm hoping the next post is about how awesome Crystal is sans unfamiliarity of other options.
Re:Why Crystal Is My Next Language by RX14 on Monday June 11, 2018 @08:35AM (#17283695)
I think the best lens to view this blog post through is shown in the quote far down in the article:

> I plan to only use this language in my personal projects

I think this is more a blog post about what language the author finds most interesting and exciting, not the language the author is suggesting people use for work.

Re:Why Crystal Is My Next Language by fgimian on Monday June 11, 2018 @08:47AM (#17283752)
Precisely, at work we use Python and C++, but I wanted to learn a new language in my own time for fun :)

I also tried to highlight its weaknesses in the Caveats section. The language is young and often has breaking changes which would not be suitable for production at this time, particularly in larger organisations.

However, I think the language shows great promise and will appeal to a lot of people as it matures. I'm certainly enjoying it so far! :)

Re:Why Crystal Is My Next Language by glibgil on Monday June 11, 2018 @12:27AM (#17281791)
> C++ is a better language than Go, that Google is the ultimate reason for success, and that Go takes us back to C. That doesn't even make any sense

It make senses to half the users of this site. The other half, well, I guess their jobs depend on it not making sense.

I should add that I have no interest in Crystal. It’s just obvious that Go enjoys more success than it technically merits.

Re:Why Crystal Is My Next Language by kodablah on Monday June 11, 2018 @12:38AM (#17281843)
> It make senses to half the users of this site. The other half, well, I guess their jobs depend on it not making sense.

Not sure what you mean here, but comparing Go and C negatively (even though quite unrelated) whilst praising C++ makes little sense. Even if you frame it in the way the author did that C++ has classes and C and Go doesn't, Go's lack of classes is no more primitive than any other modern lang w/out classes. And that doesn't even get into arguments on conflating OO and classes. These pro/con discussions always devolve into this mess and can be picked apart, that's why they are rarely worth having at such a high level.

> I should add that I have no interest in Crystal

I have interest in all of them.

> It’s just obvious that Go enjoys more success than it technically merits.

You said more success, the post said Google backing is what "ultimately resulted in its success". Those aren't the same thing. I doubt anyone would disagree that it helps, but I doubt anyone reasonable would agree it is the sole reason why.

It's not like D or Kotlin Native or Swift or others got a fair shake here. These just aren't good posts and I struggle to find any benefit in them.

Re:Why Crystal Is My Next Language by sudhirj on Monday June 11, 2018 @05:06AM (#17282848)
The “Go is successful because of Google” is really wearing thin. For this to have any credibility we would have had to see the same effect on any of Angular, Polymer, Dart, Flutter, GWT and whatever else Google put their weight behind that we’ve already forgotten.
Re:Why Crystal Is My Next Language by pjmlp on Monday June 11, 2018 @06:54AM (#17283237)
Angular is widely successful in the enterprise, being the JavaScript framework mostly adopted by Java and .NET developers.

Dart hardly had any major Google backing, it looked like a way to keep some well known VM researchers busy, which were rescued by the AdWords team before the project kind of folded.

Flutter looks like some of those developers trying to find a killer application for Dart, while being allowed some air time on Google's conferences, while Google management is full speed on Android and Web stacks.

Polymer has never about the framework, rather a way to push WebComponents as sane way to do web development, which up to HTML Templates they have been quite successful regarding adoption across browsers.

Re:Why Crystal Is My Next Language by smt88 on Monday June 11, 2018 @06:54AM (#17283234)
Of all those things, Google only really put their weight behind Angular, and Angular 1 was incredibly popular for a while. I still frequently see it in the job postings of other companies.

I doubt Go is only successful because of Google, but a large corporate sponsor seems to make or break most languages.

Re:Why Crystal Is My Next Language by hasahmed on Monday June 11, 2018 @01:26AM (#17282031)
While your grievances are valid, I feel like you're missing the point. Or perhaps you think of programming than he does. It is certainly true that in a situation where all you want to do is get a task done, then what you should really think about is the best tool for completing the task (sometimes its a spreadsheet but programmers will often go for a little python instead). But in the case where your just programming for the sake of programming. Where programming is the ends and the problem you're solving is the means, this is where the nit-picky language comparisons blogs I think start to happen and I think its great.