Hacker News new | past | comments | ask | show | jobs | submit login
Crystal 0.33 (crystal-lang.org)
98 points by Can_Not 8 days ago | hide | past | web | favorite | 42 comments





Crystal is really nice! Cloning Ruby syntax but making it prettier is probably one of the smartest language design decisions that have happened in a long time.

It's definitely gotten further on my radar in the past year or so, though I remember reading this a few years ago and finding it pretty cool then, too:

https://blog.codeship.com/an-introduction-to-crystal-fast-as...

Relevant HN thread: https://news.ycombinator.com/item?id=12223395

Seeing Lilith in (what was, I think) December was what really alerted me to the fact that it had come along so far, I had mostly thought it was dead before.

Lilith: https://github.com/ffwff/lilith

Relevant HN thread on Lilith: https://news.ycombinator.com/item?id=21860713


I just wish that they would had chosen another name for the OS.

https://en.wikipedia.org/wiki/Lilith_(computer)

https://www.cfbsoftware.com/modula2/


The Oberon boon -- especially the 2013 update -- is something that is, unfortunately, uncommon in the field: a total description of a computing system, top to bottom.

If you or anyone reading this has access to that book in epub or similar ereader format I'd greatly appreciate. It seems Wirth published only a PDF (probably from MS Word)


The original books were written in the Oberon System Word Processor, and you can access them as part of Oberon live documentation.

For example by running A2 and starting Oberon System 3 from it.

Regarding converting them into epub, I guess it is a question of copyright, even if Wirth has made the PDF versions freely available, but I am no lawyer.


I recently noticed that frontend language Mint is written in Crystal - https://github.com/mint-lang/mint

I've been playing around with Crystal for some toy projects as well as some data cleaning/munging scripts. I had a fairly large CSV dump that was making Ruby choke to death - porting to Crystal was trivial and it ran amazingly fast!

I'm super interested to see where the concurrency story goes in Crystal. Fingers crossed!


I’ve been using Crystal since 2016, but have recently started to learn Rust. Rust definitely makes me appreciate Crystal’s pretty robust std lib. it’s more like Go in that sense.

What's the state of crystal's concurrency ? I think i've read something on HN saying it wasn't quite there yet..

You mean parallelism? Concurrency has been there for years. Parallelism was available under a flag a few months ago. I do t know the current status since I don’t need it.

sorry yeah i mean parallelism. Is the model an event loop running on single thread , like with with node.js ?

When you say you don't need it, don't you use crystal for developing backend APIs ?


The most interesting Crystal project I've heard of is this x86-64 OS: https://www.reddit.com/r/crystal_programming/comments/djoy8a...

If Crystal can make a case for itself as a systems programming language, I'm very interested.


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.

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.

I'd say crystal really combines the advantages of a powerful type system with the advantages of duck typing.

I've seen a lot of people (myself included) going from ruby to elixir

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?


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.

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.

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


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'.

Crystal does not have mature web frameworks like Rails.

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.

Amber was pretty close last time I used it a year or so ago

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.

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.


I’m waiting for generics to land before I return to Go.

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

Did you have a look at nim?

Maybe I should try it. It seems to be mentioned a lot here. Any recommended book?

https://www.manning.com/books/nim-in-action - from one of the core developers.

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.


n=1 but I am a Rubyist migrating to Julia, FWIW.

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?

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.


> 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.


Most of the people whining about performance and types probably don't actually use Ruby day to day.

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


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.


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.


Crystal is indeed a very nice language, but the only thing that is holding me from using it greatly, is that it still uses the Boehm GC, which makes it hard to compete with other languages in a production setting.

I understand we might get there one day but I'm afraid this is taking far too long.


Pony's ORCA GC is supposed to be the faster than Erlang's BEAM/HiPE and Azul C4. Ideally, it would be extracted from that language and examples given how to integrate it with the likes of LLVM (it's not compatible OOTB with LLVM's API because of different synchronization primitives).

https://www.ponylang.io/media/papers/orca_gc_and_type_system...


Love to see the progress on Crystal, hope that they manage to sustain its development.

Still no first class Win32 support.



Applications are open for YC Summer 2020

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: