News for hackers. Stuff that matters.
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.