Live data from Hacker News

Crystal 0.25.1 released

crystal-lang.org

141–150 of 154 posts

Re: Crystal 0.25.1 released

#141
post #136

I've played around with a number of languages and settled on Crystal because: * Speed * Pleasant to use type system * Doesn't get in my way * Catches lots of bugs * Fun! I wrote http://luckyframework.org/ to write web applications with minimal boilerplate and as few runtime errors as possible. Take a look and let me know what you think

From https://luckyframework.org/guides/installing/ >To get Lucky, you need to install these first. >Install one of these process managers: Overmind (recommended), Heroku CLI (great if you plan to use Heroku to deploy), forego, or foreman. >Node. Requires at least v6 >Yarn >Crystal. Requires at least v0.25 >Postgres (macOS/Others) Why are those dependencies needed, except Crystal, particularly Node? And does Lucky onl…

You can use Lucky without a database, but if you use one, Postgres is the only support database.

You don't need node or yarn if you are using API mode. You can generate an API only app with `lucky init --api`

The process manager is used to start the watcher process. You can use Lucky without it by running `lucky watch` instead of `lucky dev`, but using the process manager is nice because you can also run asset compilation, job queues and whatever other processes you app needs to run.

Lucky can be stripped down further still, but the documentation focuses on the more opinionated route

Re: Crystal 0.25.1 released

#142

I've played around with a number of languages and settled on Crystal because: * Speed * Pleasant to use type system * Doesn't get in my way * Catches lots of bugs * Fun! I wrote http://luckyframework.org/ to write web applications with minimal boilerplate and as few runtime errors as possible. Take a look and let me know what you think

That looks really nice. When I clicked the link, I wasn't expecting a good looking page and all of those docs, it was a nice surprise. I look forward to checking it out :)

I'm glad you were pleasantly surprised. Feel free to hop on https://gitter.im/luckyframework/Lobby if you have any questions or comments!

Re: Crystal 0.25.1 released

#143

Only noticed this in the release post, but the `record` feature is neat: https://crystal-lang.org/api/0.25.1/toplevel.html#record(nam...

It's been around for a long time, but perhaps not documented.

The clever bit seems to be that, being a macro, it can accept an undefined constant as if it was an argument, and then define that constant. Neat.

Re: Crystal 0.25.1 released

#144
post #99

Earlier quoted context omitted.

> wouldn't write a webapp in Rust https://rocket.rs looks nice ;)

What other people subject themselves to is none of my business :) And there is need for HTTP frameworks in Rust, for example embedded stuff often hosts HTTP servers. However, just like C we frameworks, it's my opinion they're not for the average use case.

Have you looked into iron/hyper? I’ve used them extensively and find them great and fast as hell.

Re: Crystal 0.25.1 released

#145

Earlier quoted context omitted.

Just dug out the code and tried again It's 80 lines and depends on kemal, radix and kilt `shards build --no-debug --release --link-flags "-static"` takes ~60s I can't send the full code atm, but it basically just fetches json from an endpoint, stores it in memory, and returns it in a different format on an http endpoint

Oh, release builds do take longer. My point of view is that while developing you don't need the `--release` flag, so you can get a more or less fluent experience. The few times where you need to release an app it takes longer, but for me that's acceptable.

I always like flipping on the release flag at then end of my work day. I treat it like a stopping point in my code, where I get to see how fast it is compared to the slow running debug executables I’d been working with all day. Great way to end a coding session.

Re: Crystal 0.25.1 released

#146
post #74

Earlier quoted context omitted.

Interesting! I’m surprised you didn’t move to Elixir given the syntax similarities to Ruby

The syntax similarities between Elixir and Ruby stop as soon as one moves on from reading short blog post to writing real code. They are extremely different languages. Knowing Ruby helps only to remember the names of some standard library modules and functions, which were designed on purpose to match the name of the corresponding Ruby modules and methods, but not all of them. A vanilla example: $ iex > "1 2 3" |> Str…

I hear this a lot but I keep seeing more and more Ruby devs moving to it trivially and as someone who reads-not-writes Ruby code I find it just as trivial to grok it.

So I think the differences are there but they’re being overstated from a transfer of skills standpoint.

Re: Crystal 0.25.1 released

#147

Earlier quoted context omitted.

Your example doesn't do the same thing. The same as grandparent, in crystal: "1 2 3".split.map &.to_i.*(2)

I believe that Ruby also has that & shortcut (or similar) but it's totally unreadable. I never used it and I don't even want to check the exact syntax. Is it the only way it works in Crystal?

It being readable is a matter of getting used to it. I find it more readable than the block version as there is less syntactic boilerplate. YMMV.

Ruby has a similar version using colon instead of dot but that version isn't chainable and doesn't take arguments so it can't do the *2.

And no, you can write out the full block just as you did in the Ruby version.

Re: Crystal 0.25.1 released

#148
post #137

Earlier quoted context omitted.

openssl and libz are particularly fussy

I could definitely see openssl being tricky (libz not so much, but I might very well be naive here) - but how does changing the libc help with either?

glibc has some plugins which make it not easy to statically link. Musl doesn't have that. And alpine compiles openssl etc. with a config amenable to static linking. It's all about distro choices.

Re: Crystal 0.25.1 released

#149

Earlier quoted context omitted.

Oh, release builds do take longer. My point of view is that while developing you don't need the `--release` flag, so you can get a more or less fluent experience. The few times where you need to release an app it takes longer, but for me that's acceptable.

I always like flipping on the release flag at then end of my work day. I treat it like a stopping point in my code, where I get to see how fast it is compared to the slow running debug executables I’d been working with all day. Great way to end a coding session.

I rarely notice the difference between release and debug executables unless i'm benchmarking or doing something super CPU heavy. I've so far deployed most of my crystal apps in debug mode because it makes the stack traces nicer because of the lack of aggressive inlining.

Re: Crystal 0.25.1 released

#150
post #136

Earlier quoted context omitted.

From https://luckyframework.org/guides/installing/ >To get Lucky, you need to install these first. >Install one of these process managers: Overmind (recommended), Heroku CLI (great if you plan to use Heroku to deploy), forego, or foreman. >Node. Requires at least v6 >Yarn >Crystal. Requires at least v0.25 >Postgres (macOS/Others) Why are those dependencies needed, except Crystal, particularly Node? And does Lucky onl…

You can use Lucky without a database, but if you use one, Postgres is the only support database. You don't need node or yarn if you are using API mode. You can generate an API only app with `lucky init --api` The process manager is used to start the watcher process. You can use Lucky without it by running `lucky watch` instead of `lucky dev`, but using the process manager is nice because you can also run asset compil…

Thanks for the info.
Post reply on HN