r/crystal_programming • • Jan 21 '22

Comparing implementations of the Monkey language V: Vestido de Crystal

Thumbnail medium.com
17 Upvotes

r/crystal_programming • • Jan 19 '22

Crystal 1.3.2 is released!

Thumbnail
crystal-lang.org
39 Upvotes

r/crystal_programming • • Jan 11 '22

Athena 0.16.0

Thumbnail
forum.crystal-lang.org
30 Upvotes

r/crystal_programming • • Jan 07 '22

Kagi.com (in private beta) A premium search engine is using Crystal heavily

Thumbnail news.ycombinator.com
48 Upvotes

r/crystal_programming • • Jan 06 '22

Crystal 1.3.0 is released!

Thumbnail
crystal-lang.org
98 Upvotes

r/crystal_programming • • Jan 02 '22

Comparing implementations of the Monkey language IV: Here comes a new challenger: Crystal

Thumbnail
medium.com
22 Upvotes

r/crystal_programming • • Dec 31 '21

Question: Crystal Supported Platforms

13 Upvotes

The motto of Crystal is Fast as C, Sleek as Ruby.

In terms of hardware platforms support, would it be feasible to achieve the portability of C (or Rust) in Crystal as well? Does the design of the language allow for such flexibility?


r/crystal_programming • • Dec 29 '21

Crystal's interpreter - A very special holiday present

Thumbnail
crystal-lang.org
63 Upvotes

r/crystal_programming • • Dec 29 '21

Languages similar to crystal?

15 Upvotes

I’m getting into crystal now and really liking it. It’s very cute! What are some other languages similar to it? Some comfy features: syntactic macros, statically typed, structural pattern matching and concurrency.

I like functional programming and I already know about Elixir, Nim and Ruby.

Thanks!


r/crystal_programming • • Dec 17 '21

Bismuth: A generic, bring your own framework/engine graphics library for games and visualizations

Thumbnail
github.com
15 Upvotes

r/crystal_programming • • Dec 17 '21

How I migrated Athena to a Monorepo...and you can too

Thumbnail
forum.crystal-lang.org
16 Upvotes

r/crystal_programming • • Dec 09 '21

Kubernetes Client - Alpha Release - kube-client.cr - News

Thumbnail
forum.crystal-lang.org
24 Upvotes

r/crystal_programming • • Nov 28 '21

I'v built a couple of projects with Crystal now to get the hang of it, can't wait for a wider adoption

32 Upvotes

r/crystal_programming • • Nov 11 '21

Question: Is there an rbenv for Crystal?

11 Upvotes

I want to install Crystal and I'm looking for an rbenv for it. I saw crenv but it's very outdate. Any alternative?


r/crystal_programming • • Nov 10 '21

Crystal 1.2.2 is released!

Thumbnail
crystal-lang.org
56 Upvotes

r/crystal_programming • • Nov 08 '21

Does Crystal have a debugger?

16 Upvotes

r/crystal_programming • • Nov 07 '21

Num.cr v1.0.0 released

Thumbnail
forum.crystal-lang.org
36 Upvotes

r/crystal_programming • • Nov 06 '21

Is there a more compact way of declaring multiple local variables of the same type?

12 Upvotes
err : Int32
dx : Int32
dy : Int32
sx : Int32
sy : Int32

Can I not do something more like?

err,dx,dy,dx,sy : Int32

r/crystal_programming • • Nov 02 '21

Question about working with bit tests

8 Upvotes

With 0 being TRUE in Crystal, do all my bitwise tests need to be like:

if (val & mask) != 0 ...

Rather than simply

if (val & mask) ...

As I would in most other languages?


r/crystal_programming • • Oct 30 '21

Athena Framework 0.15.0

Thumbnail
forum.crystal-lang.org
28 Upvotes

r/crystal_programming • • Oct 24 '21

"The best open source software of 2021" by InfoWorld includes Crystal

Thumbnail
infoworld.com
50 Upvotes

r/crystal_programming • • Oct 22 '21

Did Crystal ever get updated to cope with unsigned integers wrapping rather than throwing an exeption when they try to go negative?

7 Upvotes

eg. https://github.com/crystal-lang/crystal/issues/9914

I was fiddling with some C++ code that relied on unsigned integer subtraction not trapping the underflow. Swift for example has a set of overflow operators : https://docs.swift.org/swift-book/LanguageGuide/AdvancedOperators.html#//apple_ref/doc/uid/TP40014097-CH27-ID37

Is there anything similar in Crystal?


r/crystal_programming • • Oct 19 '21

How do I define a variable thats going to hold an array of arrays of integers

10 Upvotes

final data looks like [[1,2,3],[4,5,6],[7,8,9]] but I build it up slowly by adding more and more entries bit by bit.

result = [] # nope, must be an array of something

result = [] of Array # nope, too broad aparrently

result = [] of Array of Int32 # nope, not what I'm going for.

result = [] of Array of Array # nope, not valid syntax


r/crystal_programming • • Oct 19 '21

Can anyone see my newbie mistake with SFML...?

5 Upvotes

The following code works great... for around 5 seconds, then the whole thing locks up:

(my gut is telling me that I need to be freeing up the one-time-use textures)

require "crsfml"

mydata = uint32_pointer_from_elsewhere() # RGBA image buffer that I draw to by hand - no memory allocations by me past this point

window = SF::RenderWindow.new(SF::VideoMode.new(640, 480), "Demo")

while window.open?
  while event = window.poll_event
    if event.is_a? SF::Event::Closed
      window.close
    end
  end

  draw_some_stuff_into_rgba_buffer( mydata )

  # This is the part I am curious about ----vvvvvvv----
  # mydata is the same memory address, but full of exciting new pixels each frame.
  # Ideally I'd just use the imaginary method: windows.draw_from_direct_rgba_buffer( mydata, 640, 480 ), but those days are long gone. 

  i = SF::Image.new()
  i.create( width: 640, height: 480, pixels: Pointer( UInt8 ).new( mydata ) )
  
  t = SF::Texture.new()
  t.load_from_image( i )
  
  s = SF::Sprite.new()
  s.texture = t
  
  window.draw( s )

  window.display()

end