<FromGitter>
<faustinoaq> > Write SDL2 games in Crystal. Support for desktop applications for now, but Android shouldn't be hard to achieve. β β π Wow, well, at least the code is done, maybe in the future the repos java.cr (https://github.com/ysbaddaden/java.cr) and android.cr (https://github.com/ysbaddaden/android.cr) get more attention by the community π
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<FromGitter>
<PlayLights_twitter> first i have to read what thats about π thanks mate
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
faustinoaq has quit [Ping timeout: 256 seconds]
That_Guy_Anon1 has joined #crystal-lang
That_Guy_Anon has quit [Ping timeout: 265 seconds]
<FromGitter>
<LWFlouisa> BBL
<FromGitter>
<girng> i love CRYSTAL!
<FromGitter>
<girng> @watzon btw using your json to class website, it rocks!
<FromGitter>
<girng> i was curious. for people running crystal on WSL. how long does it take to load up an app using `crystal src/App.cr`? for me, takes 5 seconds but i remember it used to be faster
<FromGitter>
<girng> is there a custom argument i can send to maybe bypass something to make it go a bit faster?
<FromGitter>
<girng> although, im sure it's prob cuz i'm on WSL. but i mean im noit complaining i just was curious if maybe it could be faster :) 5 seconds is actually quite fast, but i do remember it being faster that's all :P
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
faustinoaq has joined #crystal-lang
Groogy has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
<FromGitter>
<bew> What? The 123?
<FromGitter>
<bew> 123 is a Value type, so it's on stack, and gets copied when assigned
alex`` has joined #crystal-lang
<FromGitter>
<girng> @bew thank you
<FromGitter>
<girng> yeah the 123
<FromGitter>
<girng> @bew im doing property equipment = {"Ring" = > 123} in my class. and when a player logs in, i need to basically overwrite all those values to w/e they have saved in my db
<FromGitter>
<girng> so im going to use a hash for this, hope it's ok :)
<FromGitter>
<girng> well, aactually it'll be `property equipment = {} of String => Int32`. then i assign the keys when they choose their character
<FromGitter>
<bararchy> @girng I answered, I hope it makes sense
<FromGitter>
<bararchy> it's really early so maybe I could have phrased it better XD
<FromGitter>
<sdogruyol> Morning everyone π
<FromGitter>
<girng> good morning!!
<FromGitter>
<girng> i love HASHES
<FromGitter>
<bararchy> Morning @sdogruyol :)
<FromGitter>
<girng> gonna go mess with my 30$ vr headset in bed :D :D. gn see u all tomorow
<livcd>
how did the stream go yesterday ? do we already have a windows version for crystal ? :D
<FromGitter>
<bararchy> RX14 finished Windows support and moved to multi-thread as he had 20 min more for stream, he then finished multi-thread support and added a full IDE written in Crystal in 30 sec at the end
<FromGitter>
<bararchy> 3 hours of pure RX14 crystal joy
<RX14>
Well you guys enjoyed it more than I expected haha
<livcd>
especially when you finished all those things the community was asking for
<livcd>
:3
<FromGitter>
<bararchy> RX14 it's something I can do while on train from
<FromGitter>
<bararchy> or to work
<FromGitter>
<bararchy> i
<FromGitter>
<bararchy> so it's nice
<RX14>
Cool
<livcd>
bararchy: how long does it take you to get to work ? All those security checks must slow you down a lot
<FromGitter>
<bararchy> livcd secuirty checks?
That_Guy_Anon has quit [Ping timeout: 256 seconds]
That_Guy_Anon has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter>
<faustinoaq> Sometimes crystal `require` is a bit confusing, Maybe I miss a bit the explicit Python `import`system π β β Because you don't know where a symbol come from until you compile or search for it in all the project π β β Well, I guess we inherited the Ruby require system, at least my code looks cleaner without a bunch of requires and lines like `import foo, bar from baz` ...
<FromGitter>
<r00ster91> So i'm making a library right now and I would like to use Colorize in it to make the errors a bit more fancy. But then I thought: What if the guy who is using my library already required Colorize? I'm trying to prevent that it's getting required two times because I find that inefficient. So far I tried: β β ```{% if !Colorize %} β require "colorize" β {% end %}``` β β but that doesn't works. You
<FromGitter>
... can't require dynamically... So is there no way? Do I really need to live with this inefficiency? Or is Crystal actually internally not making a second require of the same library? [https://gitter.im/crystal-lang/crystal?at=5ad4a66a15c9b0311401012d]
<FromGitter>
<straight-shoota> There is no inefficiency. Crystal organizes the require paths and will only parse the file once.
<FromGitter>
<straight-shoota> you can add `require "colorize"` in your program as many times as you want.
<FromGitter>
<r00ster91> aah! thats nice. Thanks
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Ping timeout: 264 seconds]
faustinoaq has quit [Remote host closed the connection]
<FromGitter>
<eliasjpr> Last year around this time the Amber project was in its inception and far from being something usable, today we have reached a milestone, Amber hit the 1k stars milestone π β¨ π₯ π And I wanted to personally thank you on behalf of the Amber team, thank you for supporting and making this project possible, our work heavily is inspired and movitated by the Crystal community culture and approaches to
<FromGitter>
... solve problems, Amber would have not been possible without your contributions, and for that we will be always thankful π https://github.com/amberframework/amber
That_Guy_Anon has quit [Ping timeout: 260 seconds]
<FromGitter>
<sdogruyol> I still clearly remember the day Amber is announced :)
<FromGitter>
<sdogruyol> I was there when @drujensen and @elorest was building the first Amber release :) What a great time to be a Crystalian π
<FromGitter>
<eliasjpr> Thank you @sdogruyol as you can see it was not long ago, fresh memory
<FromGitter>
<sdogruyol> nearly 1 year
<FromGitter>
<eliasjpr> Without @elorest and @drujensen the project would have not reach the status that is in today. I am proud and happy to be part of the same team and with no further due @faustinoaq @marksiemers @robacarp @fridgerator and new member @jwaldrip π β¨ :shipit:
<FromGitter>
<eliasjpr> It feels like the oscars π
<FromGitter>
<sdogruyol> Amber is the biggest OSS Crystal codebase, right @eliasjpr ?
<FromGitter>
<bararchy> is it bigger then the compiler ?
<FromGitter>
<sdogruyol> probably not
<FromGitter>
<sdogruyol> I saw @faustinoaq posting something like 30k LOC for Amber
<FromGitter>
<straight-shoota> I count 10k
<FromGitter>
<straight-shoota> in src
<FromGitter>
<eliasjpr> > Amber is the biggest OSS Crystal codebase, right @eliasjpr ? β β I cannot make that claim not sure :)
<FromGitter>
<j8r> does the specs can be counted?
<FromGitter>
<sdogruyol> good question
<FromGitter>
<eliasjpr> Honestly if Amber has 30k loc of Crystal code, Im not sure if I can be proud of that, in the sense that we should accomplish the work with less code :) if you know what I mean
<FromGitter>
<eliasjpr> Maybe with Granite and the other shards has that many
<FromGitter>
<straight-shoota> it doesn't
<FromGitter>
<straight-shoota> but 10k is not that much
<FromGitter>
<eliasjpr> yeah 10k is reasonably good number
<FromGitter>
<yxhuvud> The compiler should easily be the biggest crystal project, no?
<FromGitter>
<straight-shoota> probably
<FromGitter>
<straight-shoota> the compiler itself is about 73k loc
<FromGitter>
<straight-shoota> plus stdlib with 90k
<FromGitter>
<faustinoaq> ((https://image.ibb.co/dZCXe7/Screenshot_20180416_131043.png "Amber Framework Organization")) β β ^^ These lines of code aren't just for amber, but amberframework organization. Amber is not just the web framework but also the organization itself π
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter>
<faustinoaq> Oh, almost forgot it π β β Thank you @fridgerator, the author of `amber.js`, the out-the-box support for `Amber.Socket` and `Amber.Channel`inn the browser, pretty nice! π π β β Thank you @samueleaton, the creator of Sentry, this shard was the foundation to create `amber watch` π π ... [https://gitter.im/crystal-lang/crystal?at=5ad4e94d102fac7b7b1b202e]
<FromGitter>
<schoening> Hi everyone, I am just playing around a bit while avoiding doing actually programming work :) β I have a question: β Why does the compiler not infer that "data" is Int64 inside the if block? The compiler will complain about JSON::Any type if I just put data * data, but isnt it implied by the if block that it is Int64? β β ```code paste, see link``` [https://
<FromGitter>
<straight-shoota> `data.raw` is a method call, and the compiler can't know if it will return the same value twice
<oprypin>
schoening, could you tell me, why *would* the compiler infer it? you just called a bunch of methods on some object
<oprypin>
for inference there is exact syntax for it: `if variable.is_a? Type` - here `is_a?` is a compiler construct (.class doesnt work and is a runtime call anyway), and `variable` actually needs to be a local variable, not a method call, because [see what @straight-shoota said]
<FromGitter>
<faustinoaq> > I saw @faustinoaq posting something like 30k LOC for Amber β β @sdogruyol I tweeted that, then I deleted the tweet because it had some typos, I had tweeted an image saying that Amber is 10K of code π β β IMO I think the amount of lines are not relevant here, but the community and the framework organization itself π [https://gitter.im/crystal-lang/crystal?at=5ad4ef6c5d7286b43a35de9a]
<oprypin>
schoening, well it's entirely different, i guess. in this code the compiler doesnt even have any chance to throw any error
<oprypin>
you just made an edit in gitter, people in IRC don't see it
<FromGitter>
<schoening> I did not know that, I only changed the phrasing slightly on my last sentence to be more descriptive: "knowing that the return type is incorrect?"
<oprypin>
oh.. well I guess return annotations are ignored
<oprypin>
until you actually try to use the value
<oprypin>
maybe a bug, maybe not, but not an inconsistency
<FromGitter>
<schoening> The "some_fn_returning_boolean" function infers the type as I would expect. But I do not understand the problem in my test_function with the raw.class comparison. @straight-shoota mentioned that its because it is a method call and it cannot infer if its the same value twice. But then I sort of throw my hands in the air and ask what the point of static typing was if I cant be certain of return value types.
<FromGitter>
<schoening> Doesnt crystals magical compiler go through and checks what the return types of everything is?
<oprypin>
please re-read my initial replies and the documentation
<FromGitter>
<schoening> I don't think I have a problem with the "how-to" but the "why-is-it-the-way-it-is" knowing that I should do is_a instead of == comparison to get something done is great! But I struggle with understanding the underlying differences. is_a looks like a method call to me... Perhaps I am asking in the wrong place here, I dont know..
<oprypin>
schoening, is_a? looks like a method call but is a compiler construct, as described in compiler docs
<oprypin>
actually doesnt sound too reassuring in the docs :/ so i see the confusion
<FromGitter>
<straight-shoota> is_a? also matches subclasses while `==` does not
txdv has quit [Ping timeout: 256 seconds]
<oprypin>
schoening, what the compiler knows: you're calling the `==` method of `(Array(JSON::Any):Class | Bool:Class | Float64:Class | Hash(String, JSON::Any):Class | Int64:Class | Nil:Class | String:Class)`. what the compiler doesn't know: how this `==` method is implemented.
<oprypin>
while in this very specific case it could be made to know, that is intentionally not implemented. instead only constructs documented at /docs/ work
<FromGitter>
<schoening> That makes things a little clearer thanks guys :)
<FromGitter>
<watzon> @girng Thanks!
txdv has joined #crystal-lang
<FromGitter>
<schoening> Uhm.. if you have time.. where does *typeof* fit into all of this? I read in the docs it does not evaluate the expression. But again, I am unsure what those things actually mean when running code. β I did a puts typeof(data) on my JSON::Any object and it lists all possible types. β β In TypeScript I can write: β ... [https://gitter.im/crystal-lang/crystal?at=5ad4f6741130fe3d36e36d16]
<FromGitter>
<straight-shoota> typeof in javascript/typescript is similar to `#class` in crystal. It returns the *actual* type of a value.
<FromGitter>
<straight-shoota> `typeof` in Crystal on the other hand returns the union of all possible types an expression can return. For this, the expression itself isn't even evaluated.
<FromGitter>
<straight-shoota> simply put, `class` gives you the runtime type, `typeof`the compile time type
<FromGitter>
<girng> @oprypin the only problem i had with stack overflow is the e-peen moderation. however, in 2015, 2016 and so on i've asked tons of questions related to javascript/nodejs and i've always received help. but i mean this was 3 years ago so i might times could have changed, and this is just anecdotal experience (not proof)
<FromGitter>
<jlebray> Anyone know what is the lnfd library ? The linker canβt find it and neither can I π β ```ld: library not found for -lnfd```
<oprypin>
actually is nfd
<oprypin>
and no, i dont know. please add more context
<FromGitter>
... explanation", which he's undermining the entire system and all the questioners. that's not nice
<FromGitter>
<girng> "He doesn't care to learn anything, typically, he just wants to move on with his day. Maybe he'll try to RTFM the second time" i googled RTFM = "read the f**cking manual". β β when i make questions on SO i try to learn / understand how the solution is actually solving my problem. Hans is basically throwing me under the bus and claiming people who post questions "just want the solution and not the
<oprypin>
you hand picked the least relevant and the most rude post
<FromGitter>
<girng> cause is triggered me the most
<FromGitter>
<girng> i do agree with his other answers though, too
<FromGitter>
<girng> this guy is rude all over lol
<FromGitter>
<fridgerator> its stack overflow, everyone is rude
<FromGitter>
<girng> Hassan certainly isn't helping the cause π
rohitpaulk has joined #crystal-lang
That_Guy_Anon has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
<FromGitter>
<faustinoaq> > its stack overflow, everyone is rude β β Reddit is the same, People should be careful on those kind of platforms, because are useful but not very kind π
duane has quit [Ping timeout: 246 seconds]
duane has joined #crystal-lang
<Vexatos>
I mean I have gotten good advice from way less polite websites
<Vexatos>
Where everyone insults you and your family before actually telling you how to solve a problem