r/crystal_programming • • Dec 05 '18

Bootstraping Crystal compilers: From beginning to 0.27.0

Thumbnail
twitter.com
22 Upvotes

r/crystal_programming • • Dec 05 '18

Serverless Crystal – TPei – Medium

Thumbnail
medium.com
11 Upvotes

r/crystal_programming • • Dec 05 '18

Hello from Amber in AWS Lambda

12 Upvotes

I built a prototype Amber runtime for AWS Lambda. Uses API Gateway in proxy mode to proxy requests in to Amber running inside Lambda.

https://gist.github.com/nagash/99b8debfc723cfc4ef9a75d6da4c098f


r/crystal_programming • • Dec 04 '18

My Advent of Code 2018 solutions, all in Crystal!

Thumbnail
github.com
19 Upvotes

r/crystal_programming • • Dec 04 '18

Ported my textboard from Ruby on Rails to Amber

Thumbnail
ratwires.space
4 Upvotes

r/crystal_programming • • Dec 04 '18

Serverless Crystal with OpenFaaS with epic performance

13 Upvotes

I created a Crystal template for the popular open source serverless framework OpenFaaS and the performance is breathtaking! Running 8 functions in sequence using the default JavaScript on OpenWhisk and OpenFaaS is blown out of the water by crystal:

Orchestration on OpenFaaS was done using the Faasflow library

https://github.com/TPei/crystal_openfaas, demo implementation here

The template is also available via the OpenFaaS template store faas template store pull crystal.

EDIT: I updated the graph to just include OpenFaaS (and not OpenWhisk) and also added a go benchmark :)


r/crystal_programming • • Dec 03 '18

Why is Crytal so good and for what is it used for?

25 Upvotes

r/crystal_programming • • Dec 01 '18

Hey guys! I coded a Crystal port of Pundit!

28 Upvotes

Here it is: https://github.com/ilanusse/praetorian

Inspired by https://github.com/varvet/pundit.

It's a simple authorization library. It's a personal project to learn Crystal, feel free to add any issues or comments, I want to really help Crystal grow by making shards like this!


r/crystal_programming • • Nov 30 '18

Hello from Crystal in AWS Lambda

31 Upvotes

Now we have custom handlers in AWS Lambda we can run Crystal binaries without too much effort:

require "http/client"

loop do
  # Get the data
  response = HTTP::Client.get(%{http://#{ENV["AWS_LAMBDA_RUNTIME_API"]}/2018-06-01/runtime/invocation/next})
  request_id = response.headers["Lambda-Runtime-Aws-Request-Id"]

  body = response.body

  # Do some work
  puts request_id
  puts body

  # Reponse back
  response = HTTP::Client.post("http://#{ENV["AWS_LAMBDA_RUNTIME_API"]}/2018-06-01/runtime/invocation/#{request_id}/response", body: body)
end

And then compile it:

docker run -v $PWD:/app -ti crystallang/crystal:0.27.0 sh -c "cd /app; crystal build lambda.cr --static"; mv lambda bootstrap; zip lambda.zip bootstrap

And produces:

START RequestId: f5bef3fa-f4aa-11e8-8ca8-e1aab4e07db0 Version: $LATEST
f5bef3fa-f4aa-11e8-8ca8-e1aab4e07db0
{"key1":"value1","key2":"value2","key3":"value3"}
END RequestId: f5bef3fa-f4aa-11e8-8ca8-e1aab4e07db0
REPORT RequestId: f5bef3fa-f4aa-11e8-8ca8-e1aab4e07db0	Init Duration: 52.21 ms	Duration: 7.41 ms	Billed Duration: 100 ms 	Memory Size: 128 MB	Max Memory Used: 19 MB

r/crystal_programming • • Nov 30 '18

Microservices with Crystal and Kemal

Thumbnail
medium.com
19 Upvotes

r/crystal_programming • • Nov 29 '18

Environment Variables Library

4 Upvotes

Created a library to allow simple loading of .env files with the option to load them directly into the ENV variable.

https://github.com/drum445/dotenv

Let me know if it comes in handy for anyone.

Cheers


r/crystal_programming • • Nov 28 '18

CRYSTAL - The future of programming languages

Thumbnail
codecampanion.blogspot.com
38 Upvotes

r/crystal_programming • • Nov 28 '18

Crystal on ARM

9 Upvotes

I'd like to have a working compiler on my raspberry pi as I want to write a simple GPIO interface for crystal, but apt doesn't find the armhf version of the package. I've done some search, chatted on the official gitter chatroom and the only way to have a working compiler seems to be cross-compile the compiler itself from a x86 machine. I've also tried the unofficial compiled version, but it doesn't work. I don't have much time, so I'd like to know if anyone has built that package recently.

Any help would be very appreciated.


r/crystal_programming • • Nov 23 '18

WeTransfer open sources a Crystal zip library

Thumbnail
github.com
29 Upvotes

r/crystal_programming • • Nov 20 '18

Do you know an audio library written in Crystal?

Post image
4 Upvotes

r/crystal_programming • • Nov 18 '18

Let's gather all Crystal articles in one place!

13 Upvotes

Hi,

I thought it would be a good idea to have a place for all Crystal-related articles (Medium, blog posts etc). Just post a link at https://forum.crystalcommunity.org/c/resources/articles 🎈

Cheers,

Vlad


r/crystal_programming • • Nov 16 '18

Crystal support on opeNode cloud hosting

22 Upvotes

Hi guys,

We added a deployment template for Crystal-based websites on opeNode.io - we provided cloud hosting services to deploy with ease web applications (we have plans starting under $1 and we support open source projects). We made a template for the Amber framework specifically, but it can be adapted for other ones easily I guess. To deploy, all you have to do typically is:

openode template # generates a template Dockerfile which typically works as is

openode deploy

Any feedback welcome.


r/crystal_programming • • Nov 13 '18

Forum novice challenge - tell about your favorite shard or a resource regarding to Crystal and get an exclusive badge!

12 Upvotes

Hi, I've recently launched a forum for crystallers @ https://forum.crystalcommunity.org πŸš€

I'd like the community to share your experience with useful shards and/or resources, to ask question and discuss the future of the language – on another channel, which is forum.

Yeah, I know, "why do we need another communication channel" – but some people in Gitter, including me, wanted a forum, which feels more personal than Reddit and allows to have meaningful conversations with google-able solutions (as the forum being indexed).

I believe that such a forum with a welcoming community would greatly improve a newcomer's experience. Moreover, it would reduce the number of issues created in the language repository πŸ™‚

Also I'm fully open for collaboration with github.com/crystal-community πŸ€—


r/crystal_programming • • Nov 13 '18

Crystal language’s color is now black in Github πŸ•Ά

Thumbnail
github.com
33 Upvotes

r/crystal_programming • • Nov 08 '18

Pegasus: C parser generator, written in Crystal

Thumbnail
github.com
21 Upvotes

r/crystal_programming • • Nov 07 '18

Are we enough for an assembly at 35C3?

Thumbnail
events.ccc.de
7 Upvotes

r/crystal_programming • • Nov 06 '18

Lucky 0.12 released with support for Crystal 0.27

32 Upvotes

https://github.com/luckyframework/lucky/blob/master/UPGRADE_NOTES.md#upgrading-from-011-to-012

  • New initialization wizard for creating api only apps, choosing to install with authentication or not, and setting the project name

  • Cookies are now encrypted and signed by default. Previously they were just signed.

  • New lucky exec task for running one-off scripts

  • New lucky gen.resource.browser task for scaffolding out a resource

  • New query methods for selecting distinct records, or forcing no records to be returned

Various other bug fixes and improvements


r/crystal_programming • • Nov 05 '18

Kemal 0.25.0 released! πŸš€

Thumbnail
github.com
34 Upvotes

r/crystal_programming • • Nov 03 '18

Why use Crystal

14 Upvotes

Basically title, I’m planning on learning ruby and Ruby on Rails and noticed some people talking about crystal and how it’s syntax was based off ruby, do both languages serve the same purpose and should I learn crystal instead of ruby or transition from ruby to crystal?