News for hackers. Stuff that matters.
Re:Crystal 0.33 by appleiigs on Friday February 14, 2020 @08:05PM (#22332192)
I wonder why Ruby users don’t flock to Crystal, and Python users to Julia. With all the whining about performance and types, they just stay put.
Re:Crystal 0.33 by hnzix on Friday February 14, 2020 @09:25PM (#22332700)
Some devs talk about types as if they're the One True Holy Silver Bullet, but that is far from an objective truth. There are no silver bullets in dev, only sweet spots.
Re:Crystal 0.33 by Can_Not on Saturday February 15, 2020 @06:04PM (#22338655)
I'd say crystal really combines the advantages of a powerful type system with the advantages of duck typing.
Re:Crystal 0.33 by fermuch on Friday February 14, 2020 @08:36PM (#22332417)
I've seen a lot of people (myself included) going from ruby to elixir
Re:Crystal 0.33 by Buttons840 on Friday February 14, 2020 @09:32PM (#22332740)
As an outsider, a non-Ruby-user, I find it strange that Ruby users seem to be migrating to languages that are similar only in syntax but vastly different in nearly every other imaginable way.

Do Ruby users care only about syntax?

Maybe I'm not so different? Maybe my preference for ALGOL syntax just gives me more language options?

Re:Crystal 0.33 by dnautics on Friday February 14, 2020 @10:34PM (#22333027)
It's a "get hooked with the syntax, stay for the features" situation. Elixir leverages the incredible robustness of the erlang virtual machine. So much so, that for me, anyways, it's hard to imagine using anything else without losing sleep anymore.
Re:Crystal 0.33 by bsaul on Saturday February 15, 2020 @02:40AM (#22333933)
i've read a lot about erlang vm, but i'm curious which feature makes it hard for you to imagine using something else, in practice. What are the things that saved you, in your experience.
Re:Crystal 0.33 by dnautics on Saturday February 15, 2020 @02:01PM (#22337162)
I replaced a python/uwsgi stateless stack with an elixir stateful system. Flipped it over and it worked flawlessly, and hasn't died once in several months of operation. Latencies are way down, and operation of it is simpler. Full deploy to the head node is one command, not an ansible script.

I guess part of it is that I'm lazy and haven't learned supervisor strategies like kubernetes (the place I work doesn't deploy kubernetes anyways)

This video is instrumental in giving me the confidence to do what I did: https://youtu.be/JvBT4XBdoUE

Re:Crystal 0.33 by nipinium on Saturday February 15, 2020 @12:21AM (#22333442)
Actually it's more than just syntax, elixir and crystal borrow a lot of ruby's stdlib api design, which in my opinion is way more pleasant than other languages'.
Re:Crystal 0.33 by jwhiz22 on Friday February 14, 2020 @09:11PM (#22332615)
Crystal does not have mature web frameworks like Rails.
Re:Crystal 0.33 by nobleach on Friday February 14, 2020 @11:02PM (#22333156)
It doesn't have battle-tested everything and the kitchen sink like Rails. It has plenty of frameworks though. They just happen to be far more like ExpressJS for node, or Sinatra for Ruby. In this day of microservice/thin JSON API-style apps, Rails might be overkill. I'm not saying it's bad, it just might be a little much.
Re:Crystal 0.33 by jtms on Saturday February 15, 2020 @12:45AM (#22333519)
Amber was pretty close last time I used it a year or so ago
Re:Crystal 0.33 by luhego on Friday February 14, 2020 @09:01PM (#22332557)
I use Python and I just don't like 1-based indexed languages. I would say that a better replacement for Python(at least for backend) is Go.
Re:Crystal 0.33 by nine_k on Friday February 14, 2020 @11:00PM (#22333146)
Go removes so much of the expressive power that writing it after Python is a bit of a pain.

OTOH I realize that many people don't use that expressive power and are happy with copy-pasting stuff.

Re:Crystal 0.33 by jitl on Friday February 14, 2020 @11:15PM (#22333219)
I’m waiting for generics to land before I return to Go.
Re:Crystal 0.33 by veeableful on Saturday February 15, 2020 @02:05AM (#22333820)
One thing I immediately miss from Python after using Go is building a dict (e.g. for writing JSON values). I had to type map[string]interface{} so many times =P
Re:Crystal 0.33 by tyingq on Friday February 14, 2020 @10:12PM (#22332921)
Did you have a look at nim?
Re:Crystal 0.33 by luhego on Saturday February 15, 2020 @01:43PM (#22337040)
Maybe I should try it. It seems to be mentioned a lot here. Any recommended book?
Re:Crystal 0.33 by nimmer on Wednesday February 19, 2020 @10:32AM (#22366320)
https://www.manning.com/books/nim-in-action - from one of the core developers.
Re:Crystal 0.33 by pjmlp on Saturday February 15, 2020 @03:59AM (#22334126)
I fail to see how a bare bones language is a replacement for a language with Lisp/Smalltalk like expressive power.

The only thing missing is having more love for JIT compilers among the Python community.

Re:Crystal 0.33 by robbseaton on Friday February 14, 2020 @10:23PM (#22332970)
n=1 but I am a Rubyist migrating to Julia, FWIW.
Re:Crystal 0.33 by lasagnaphil on Saturday February 15, 2020 @03:37AM (#22334070)
I'm curious what makes you want to move to Julia, because it seems that the overall philosophy of the two languages are quite far from each other. Would you mind if you share?
Re:Crystal 0.33 by socialdemocrat on Saturday February 15, 2020 @04:27AM (#22334222)
robbseaton probably has other reasons but I was a huge Ruby fan years ago and have been using Julia for many years now.

For me both languages have similar types of appeal. Ruby is quick to pick up, allows you to write expressive code and is built on the idea of everything being an object. So Ruby is both clean, easy and expressive.

Julia is EXACTLY the same, but for the modern age. It is easy to learn and expressive. Like Ruby the type system is consistent all over. It is not like Java which has primitive types and objects. Numbers in both Julia and Ruby are treated like any other type.

The primary difference is that Ruby came of age in the most object-oriented hyped period of programming language development and that reflects its heavy OOP design.

Julia came around when OOP was no longer considered the silver bullet. So why Julia has elaborate type hierarchies, it is probably closer to a functional language than an object-oriented one.

When Ruby came out it was a language that appealed to programming language geeks like me. It had a bunch of really powerful features we where not used to.

Julia is kind of the same. Multiple-dispatch and Julia macros is something that appeals to all geeks.

I actually never switched to Julia for performance reasons, but because I loved the language.

Re:Crystal 0.33 by pjmlp on Saturday February 15, 2020 @12:34PM (#22336599)
> Julia came around when OOP was no longer considered the silver bullet.

Julia has multimethods dispatch.

One of the most famous writings about them is called "The Art of MetaObject Protocol".

A book to be read by everyone that thinks OOP is just the Java way.

While at it, reading about BETA and Self would also be illuminating.

Re:Crystal 0.33 by dyeje on Friday February 14, 2020 @08:07PM (#22332202)
Most of the people whining about performance and types probably don't actually use Ruby day to day.
Re:Crystal 0.33 by eropple on Friday February 14, 2020 @09:44PM (#22332787)
I dunno. I used to use a lot of Ruby. The lack of types regularly made my life a real pain. I ended up building frameworks[0] tied really tightly to dry-struct to try to work around that, and it wasn't great.

I use TypeScript for everything I used to use Ruby for, save for the occasional file munging inside of `pry`.

[0]: https://github.com/modern-project/modern-ruby

Re:Crystal 0.33 by jitl on Friday February 14, 2020 @11:17PM (#22333226)
This is pretty much the route I’ve taken, except I used an internal framework at Airbnb for typings instead of “dry-...”.

These days I write Typescript. I’m excited for Deno, which looks like it’ll solve most of the Node bullshit.

Re:Crystal 0.33 by symfoniq on Friday February 14, 2020 @08:31PM (#22332370)
And Ruby 2.6 is already much, much faster than it was in the days when it was too slow for Twitter.

Ruby 3.0 should be much faster still.