by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 23 19:21
    asterite reopened #9771
  • Sep 23 18:35
    mamantoha closed #9771
  • Sep 23 18:20
    zhangkaizhao opened #9772
  • Sep 23 15:39
    mamantoha opened #9771
  • Sep 23 05:00
    caspiano closed #9770
  • Sep 23 01:56
    caspiano opened #9770
  • Sep 22 19:15
    bcardiff labeled #9348
  • Sep 22 19:15
    bcardiff labeled #9438
  • Sep 22 18:35
    bcardiff synchronize #9710
  • Sep 22 13:05
    jhass labeled #9769
  • Sep 22 13:05
    jhass labeled #9769
  • Sep 22 12:58
    z64 edited #9769
  • Sep 22 12:54
    z64 opened #9769
  • Sep 21 09:27
    pynixwang opened #9768
  • Sep 20 08:47
    garyhe0780 closed #9765
  • Sep 19 23:52
    oprypin opened #9767
  • Sep 19 17:01
    Blacksmoke16 closed #9766
  • Sep 19 15:45
    Blacksmoke16 opened #9766
  • Sep 19 04:39
    garyhe0780 opened #9765
  • Sep 18 21:20
    BrucePerens edited #9764
From IRC (bridge bot)
@FromIRC
<oprypin> sdl is probably a lot more of a challenge
Matthew Berry
@mattrberry
Iirc people generate the bindings dor other languages, so I may be able to take some inspiration from those
I haven't really looked into it yet though because I've managed to get just enough to work for my needs
Matthew Berry
@mattrberry
Ary Borenszweig
@asterite
also https://carc.in/#/r/9qt9 (a bit hacky)
George Dietrich
@Blacksmoke16
:thinking:
From IRC (bridge bot)
@FromIRC
<oprypin> O_o
<oprypin> that.. will be helpful for me
<oprypin> thanks
George Dietrich
@Blacksmoke16
looks like a good place for a comment :S
From IRC (bridge bot)
@FromIRC
<oprypin> 😂
From IRC (bridge bot)
@FromIRC
<riffraff169> so if you call f on the class it calls the macro, but on an instance it is a method...weird
George Dietrich
@Blacksmoke16
its not an instance, its a var that is assigned A.class
Ary Borenszweig
@asterite
The thing is, macros can only be called on class types, and they must be known at compile-time
in theory that variable is know to be a class type at compile-time, but the compiler doesn't care: it will only invoke a macro if it's an explicit type, like Foo or Bar, never a variable
(or any other expression, that's why with parens it also calls the method)
Lance Dillon
@riffraff169
ah, ok, hmmm...
From IRC (bridge bot)
@FromIRC
<oprypin> i really like it. oprypin/crystal-imgui@55b3ab7 . thanks @asterite. cc @Blacksmoke16
George Dietrich
@Blacksmoke16
neat
George Dietrich
@Blacksmoke16
made an update to my WIP validation shard. Can now define the constraints in code versus using annotations
class Foo
  include AVD::Validatable

  def self.load_metadata(class_metadata : AVD::Metadata::ClassMetadataBase) : Nil
    class_metadata.add_property_constraint "name", AVD::Constraints::EqualTo.new("foo")
    class_metadata.add_property_constraint "name", AVD::Constraints::Size.new((5..))
  end

  def initialize(@name : String); end
end
From IRC (bridge bot)
@FromIRC
<deimos_> unexpected side effect from coding in crystal, my ruby code is getting much better because i handle the Nil case by default, rather than waiting for runtime errors
Matthew Berry
@mattrberry
I've recently started to write some Ruby at work, prior to which I've never used Ruby. It was pretty easy to pick up thanks to Crystal :)
George Dietrich
@Blacksmoke16
Lovely Invalid memory access (signal 11) at address 0x0
Matthew Berry
@mattrberry
Love it
Matthew Berry
@mattrberry
I had a number of similar errors from the compiler when doing multiple inheritance stuff in cryboy
I also think I remember an error I got that told me I'd found a bug in the compiler lol
George Dietrich
@Blacksmoke16
i think i know what the problem is
well maybe not, hm
Elias Perez
@eliasjpr
I was wondering how long does building the Crystal compiler from source normally takes?
From IRC (bridge bot)
@FromIRC
<yxhuvud> The compiler itself? if in release mode, some 10 minutes for me.
Elias Perez
@eliasjpr
Core I7 32 gb
Ihave more than 10 minutes :(
From IRC (bridge bot)
@FromIRC
<yxhuvud> outside release mode, perhaps 30s?
<yxhuvud> what generation of i7? This was on a AMD 3950x.
Elias Perez
@eliasjpr
I think I have the 10th gen
From IRC (bridge bot)
@FromIRC
<yxhuvud> should be done now anyhow :⁠) How long did it take?
Elias Perez
@eliasjpr
it just hangs
I must be doing something wrong
So I realized that I have to have crystal to compile the project
From IRC (bridge bot)
@FromIRC
<raz> re invalid memory address. i'm pretty sure i've seen that too, but i think only as a transient error (went away on next compile)
George Dietrich
@Blacksmoke16
yea ill have to see if i can reduce
From IRC (bridge bot)
@FromIRC
<oprypin> @Blacksmoke16: the important difference is whether that error happens at run time or compile time
George Dietrich
@Blacksmoke16
runtime
in a spec, so need to see if i can actually reproduce it in a valid way, or if im just doing something unsafe in spec land
George Dietrich
@Blacksmoke16
Invalid memory access (signal 11) at address 0x4b3
[0x560b3cb877d6] *Exception::CallStack::print_backtrace:Int32 +118
[0x560b3cb2f365] __crystal_sigfault_handler +341
[0x7f4ca01a20f0] ???
[0x560b3cc44e5b] *Regex#match_at_byte_index<String, Int32>:(Regex::MatchData | Nil) +59
[0x560b3cba5ce0] *String#gsub<Regex, Hash(String, String)>:String +352
Program exited because of a segmentation fault (11)
is full error :/
George Dietrich
@Blacksmoke16
narrowed it down to one spec, but ofc it doesnt happen when running just that one, or outside of spec
George Dietrich
@Blacksmoke16
lmao
Stack overflow (e.g., infinite or very deep recursion)
[0x557318223246] *Exception::CallStack::print_backtrace:Int32 +118
[0x5573181f03b5] __crystal_sigfault_handler +341
[0x7fef380b80f0] ???
[0x7ffe28e43170] ???