ChanServ changed the topic of #crystal-lang to: The Crystal programming language | | Crystal 0.23.1 | Fund Crystal's development: | GH: | Docs: | API: | Gitter:
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
DTZUZO has quit [Ping timeout: 255 seconds]
greengriminal has quit [Ping timeout: 264 seconds]
greengriminal has joined #crystal-lang
<FromGitter> <opensas> Yo
greengriminal has quit [Quit: This computer has gone to sleep]
DTZUZO has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
alex`` has joined #crystal-lang
alex`` has quit [Quit: WeeChat 1.9]
<FromGitter> <ansarizafar> @uSide Mutable NamedTuple would be easier to understand for devs coming from other languages. A feature request for the core teams.
alex`` has joined #crystal-lang
alex`` is now known as alexherbo2
alexherbo2 is now known as alex``
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> Groogy I suddenly had a question , your game engine is pure crystal , how much sprites do you think could live independently until you will start having "lag" because of single threading ?
<txdv> Groogy: you got a game engine written with crystal?
<FromGitter> <bararchy> txdv
<txdv> @bararchy there is a lot to code and to optimize before you hit that limit
<FromGitter> <bararchy> I'm sure , still interesting , let's say you have a strategy like game , where each unit should have its own "logic" , and might be controlled differently, how does other game engines do it ? A thread each ? Sounds crazy
<FromGitter> <faustinoaq> > Mutable NamedTuple would be easier to understand for devs coming from other languages. ⏎ ⏎ I disagree, currently we have Tuple && Nametuples as inmutables sequences and Arrays && Hash as mutable ones, I think is ok as is, we just need a better documentation 😉
rohitpaulk has quit [Ping timeout: 240 seconds]
Papierkorb_ has joined #crystal-lang
<vegai> hmmh :P
<vegai> morning
<vegai> so ... is there any standardish way to output compile-time warnings?
<vegai> from stdlib code
rohitpaulk has joined #crystal-lang
<FromGitter> <ansarizafar> @faustinoaq Muatable NamedTuple are easy to understand, define (user = {count: Int32, name: String}) and use, specially for Developers coming from Nodjes/Javascript and in my opinion many Nodejs developers would like to switch after V1 release as less memory/CPU usage and performance gains will be huge.
<vegai> I guess {{ p "WARN" }} would do it at least, but that doesn't seem like the correct solution
<Groogy> Morning!
<Groogy> txdv I sure do!
<Groogy> Well under development, working on text rendering right now, next is UI then I'll start porting my game from c++
<Groogy> @bararchy it depends on what you mean and define as "how many sprites" ;D
<Groogy> There's tons of tricks you can do, for instance in a tilemap, you can render like 8x8 over a surface of 1600x1200 which normally would be 30 000 sprites (and kill ANYTHING)
<Groogy> but you could do that with only one single draw call and just construct the data needed in the shader
<Papierkorb_> ansarizafar, why do you insist on named tuples? Just use a real class.
<Papierkorb_> Named tuples are *not* for what you try to use them.
<vegai> hmm, perhaps I don't even want compile time warnings actually
<Groogy> Eh what d oyou mean compile time warnings?
<Groogy> You mean like C++ #message preprocessor command?
<Papierkorb_> vegai: The stance is "don't warn, error instead"
<Groogy> also yeah ^
<Papierkorb_> vegai: If you want to error out, you can use `raise` in a {{ }}
<Groogy> If you bother enough to warn about this, then something is wrong and it should be fixed, not ignored
<Papierkorb_> vegai: Even better, you can use `raise` on a macro variable, try this: `macro foo(x); {{ x.raise "Nope nope nope" }}; end; foo("Something")` - That'll show a compile-time error and point at the macro argument
<FromGitter> <ansarizafar> Mutable NamedTuples For simplicity, ease of use without boilerplate code and for the benefit of huge number of Nodejs devs who can become Crystal devs afetr v1 release. Switching to a new language is not easy specially at the beginning .
<Papierkorb_> That's correct, because you have to learn the language.
<Papierkorb_> And what you're trying is not how Crystal works. Use an actual class.
<Papierkorb_> And simplicity? Huh? How is `foo[:bar]` not much worse than ``, while a proper type, with all of its benefits, is just a single `class Foo` away?
<Papierkorb_> Not to mention that you'll have much fun to store named tuples in an @instance variable, and if you change anything, change all of these occurences. That alone should tell you that you're doing something not in the intended way
claudiuinberlin has joined #crystal-lang
<Papierkorb_> Don't expect a paradigm from language A to be the exactly same in language B. This even holds true for people coming from Ruby, who have to learn quite a few new things, as many paradigms from our "mother" language don't port over so well - The biggest driving factor behind this being the step from a dynamic to static type system.
<Groogy> I've only used tuples in Crystal for metaprogramming stuff pretty much
claudiuinberlin has quit [Client Quit]
<Papierkorb_> Which is mostly how it should be. You can count the valid use-cases of tuples in user-code on a single hand
claudiuinberlin has joined #crystal-lang
<Groogy> Also Papier what was the next-gen branch? Did it support C?
<Groogy> didn't see it until I got to work
<Papierkorb_> Currently working on cleanly porting all-the-features over. C support requires additional logic in the Clang tool too, but it's one of the things I totally want to look into. And with a custom processor (If the configuration stuff isn't enough by then), you can do the mapping magic without messing with anything but that
<Groogy> ah the #define is not done?
<Papierkorb_> #define is a story on its own, but atm, the tool doesn't support reporting global methods at all
<FromGitter> <sdogruyol> Morning everyone
rohitpaulk has quit [Ping timeout: 240 seconds]
<Groogy> o/ sdogruyol
<Groogy> Yeh #define is nessecity for all the c based bindings I use :(
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Groogy> reading through the TEMPLATE.yml now to get a better view of how things work
claudiuinberlin has joined #crystal-lang
<FromGitter> <bararchy> morning @sdogruyol
<FromGitter> <bararchy> Groogy, that's cool, it's an interesting subject
<FromGitter> <bararchy> btw, what do you think of this as a fellow gamer ? ->
<Groogy> It's a bit eh "the hype right now" without any point really
<Groogy> learning ai is trying to solve a problem which doesn't merge well with games
<Groogy> So it is just riding on a "AI Hype wave" caused by AlphaGo but it has no practical application within games
<Papierkorb_> The only gain will be creating a system which automatically repacks cosmetic DLCs to generate more money
<Papierkorb_> As if they're not already plain cash grabs for something you got for the price of the game. You know, back when you bought a game, and actually had it?
rohitpaulk has joined #crystal-lang
<FromGitter> <sdogruyol> we should also build a toy blockchain with Crystal
<FromGitter> <sdogruyol> WDYT?
<Papierkorb_> It's not hard to build a "toy blockchain" at all
<FromGitter> <bararchy> Groogy, don't you think that maybe using Neural nets you can create an enemy AI which can rival human players ? something like evolving enemy mode, where each level or "wave" the enemy is smarter (it's cooler then just "have more units" or "you have less resources")
<FromGitter> <sdogruyol> it's for demonstration purposes @Papierkorb
<Papierkorb_> What most people think it's just a structure with a parent hash, some data on its own, and a hash on its own lower than some target value
<Groogy> @bararchy you don't want an AI that rivals human players in games
<Papierkorb_> Hasn't anyone built one already sdogruyol?
<Groogy> you want an AI that *entertains* human players
<FromGitter> <ansarizafar> @Papierkorb plz check this
<Papierkorb_> ansarizafar, I think I know the implications of different data structures. A mutable named tuple doesn't magically produce a fast program. If you're under that impression, you're misled.
<Papierkorb_> Or you tell me how a tuple and a structure are not the same thing on machine level. Hint: There's none.
<Groogy> besides the performance gain is only if the struct/tuple is a temp object that is recreated a lot
<Groogy> and a bit of memory locality
<Groogy> but then you are microoptimizing
<Papierkorb_> Insane how I actually pull out this quote unironically: "For 97% of your code, premature performance optimizations is the root of all evil. In the other 3% however, it's a good thing". Now, does your web (!) application consist solely of that 3%? The chance is pretty high that no.
<Groogy> As an example @bararchy on AI that enterains the player, in Crusader Kings II, the code that just makes choices on who to assasinate, who to marry etc. that build more of a narrative for the player is way more complex than the part of the AI that moves troops
<FromGitter> <ansarizafar> Ok. I am new to Crystal lang. Just trying to learn from you guys.
<Groogy> because that part of the AI looks at "Alright I am greedy, so I am gonna make this mistake, or I am honest so I am gonna be naive", which is what the player really wants/expects and not that the AI minmax and tries to beat you
<Groogy> which to be honest, is way easier to do, even without neural netowrks
<Groogy> @ansarizafar Javascript and Lua goes by Prototype based object orientation, Crystal/Ruby etc are Class based object orientation
<Groogy> they are fundamentally different languages by its very core so what might have been good praxis in Node.js, is definetly not going to be so in another language
<Papierkorb_> Groogy: I think the more interesting aspect of deep learning (sic) AI would be that it has to sabotage itself to not be overpowered
<Groogy> I believe more in expanding on what Valve did with Left 4 Dead and explore that more
<Groogy> Automated AI Direction
<Groogy> An AI whose only job is to make sure the player is having fun
<Papierkorb_> And then, how it does so. A badly learned AI would make the game a laughing stock real quick. And I'd imagine, intentionally building an idiot isn't that easy at all :)
<Papierkorb_> Yeah that worked for the most part
<Groogy> It wasn't perfect, but I feel the idea is the right path and I've been trying to push internally we should look more to that
<Papierkorb_> Though it stopped too early. Had to force it to trigger panics 100% of the time for us to do something hehe :P
<Groogy> one of our problems is event spam where while you are in high pressure situation (war) you get bombarded by events or something at a cruical moment
<Groogy> an AI that guides that stuff would be way better
<Papierkorb_> But yes, the concept worked fine
<Groogy> @bararchy not saying self-learning AI doesn't have its purpose etc. But when it comes to games, as in a random player is trying to enjoy himself. That is not it in my opinion
<Papierkorb_> Groogy: If it does away with difficulty levels, that'd be great. I as player don't know how good I'm before getting into the game. And once i'm in, i'm reluctant to change. But as I'm uncertain, I'd never choose e.g. Hard.
<Groogy> I always play all the games at hardest available and move it down to find my "sweet spot"
Philpax__ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 246 seconds]
<FromGitter> <ansarizafar> @Groogy Got it. Thanks for explanation.
<Groogy> To put in context, Tuples mainly from my experience in Crystal (I am also fairly new compared ot these guys) is more as language constructs
<Groogy> Like with macros, generics and for variadic argument calls
sz0 has joined #crystal-lang
<Groogy> I would say in Crystal using a class or struct is always better because it provides you a lot more safety from doing things wrong in the long run
<Groogy> While tuple is more seen as a very temporary construct, if you need to reference its type directly then you probably need to rethink what you are doing or hell is going to break loose on you
rohitpaulk has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #crystal-lang
mark_66 has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
flaviodesousa has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmcginty has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #crystal-lang
bmcginty has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master:
<crystal-gh> crystal/master 79fd84e Luis Lavena: Support LLVM 4.0 postfixed versions...
<crystal-gh> crystal/master 02fca17 Ary Borenszweig: Merge pull request #5013 from luislavena/support-llvm-config-4.0...
<FromGitter> <sdogruyol> I'll never understand why Boost is so big...
<FromGitter> <sdogruyol> (both in size and dependencies)
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Papierkorb_> Boost has everything in it, and can do (almost) everything. It's bound to be huge
<FromGitter> <sdogruyol> almost everything?
<Papierkorb_> No GUI
ShalokShalom_ has joined #crystal-lang
<Papierkorb_> Apart from that, it abstracts pretty much everything. Oh and then it extends the C++ language through insane templates.
ShalokShalom has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
<FromGitter> <ekremkaraca> Good afternoon guys
<travis-ci> crystal-lang/crystal#02fca17 (master - Merge pull request #5013 from luislavena/support-llvm-config-4.0): The build passed.
<DeBot_> (Support LLVM 4.0 postfixed versions)
<FromGitter> <ekremkaraca> @bararchy אחר צהריים טובים
<FromGitter> <ekremkaraca> Guys, I made some screencast but I don't know how to contribute the language.
<FromGitter> <ekremkaraca> What do I need to know about contributing?
<FromGitter> <ekremkaraca> For example, do I need to learn C or C++ languages?
rohitpaulk has quit [Ping timeout: 246 seconds]
<Papierkorb_> You need to learn Crystal to contribute - We're self hosted! <3
<FromGitter> <sdogruyol> @ekremkaraca Crystal is written in Crystal, you can start contributing asap :P
<FromGitter> <ekremkaraca> Ok, got it.Thanks
<FromGitter> <sdogruyol> I really like Crystal being self-hosted
<FromGitter> <sdogruyol> You can contribute back to Crystal itself from day 1
<Papierkorb_> mfw more HTML than C++
<FromGitter> <sdogruyol> lol
greengriminal has joined #crystal-lang
<FromGitter> <krypton97> just messed up with boost, forgot how cpp feels like
<Papierkorb_> I never used Boost.
<Papierkorb_> Qt's stuff was perfectly fine. And much faster to compile (in C++ terms) too.
<FromGitter> <bararchy> @ekremkaraca your Hebrew is good :) I wish I knew Turkish, only know some basic Arabic
rohitpaulk has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
ShalokShalom_ is now known as ShalokShalom
rohitpaulk has quit [Ping timeout: 240 seconds]
hightower4 has joined #crystal-lang
hightower3 has quit [Ping timeout: 240 seconds]
lapinferoce has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <ekremkaraca> @bararchy no problem, sometimes I get help from Google translate :)
<FromGitter> <ekremkaraca> I just know the alphabet and some phrases
snsei has quit [Remote host closed the connection]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
LastWhisper____ has joined #crystal-lang
snsei has joined #crystal-lang
Papierkorb_ has quit [Quit: Konversation terminated!]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
greengriminal has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
alex`` has quit [Quit: WeeChat 1.9]
rohitpaulk has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
LastWhisper____ has joined #crystal-lang
ylluminate has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
lapinferoce has quit [Quit: Lost terminal]
weston1 has joined #crystal-lang
weston1 has quit [Ping timeout: 240 seconds]
mark_66 has quit [Remote host closed the connection]
<FromGitter> <crisward> I'm parsing json, but sometimes a value is null, sometimes its a float and sometimes its an int. I'm checking for null, but `as_f` breaks if it's an int. Is there a nice way of handling this without lots of begin rescue blocks?
<FromGitter> <sdogruyol> doesn't .as(Float32) works all the time?
<FromGitter> <sdogruyol> what's the actual type?
<Groogy> do you mean compile time?
<Papierkorb> crisward, how are you parsing JSON?
<Papierkorb> crisward, JSON.mapping?
<FromGitter> <crisward> Badly 😢
<FromGitter> <crisward> One second
<FromGitter> <crisward> ```code paste, see link``` []
<FromGitter> <crisward> Ips is an object with a json mapping
<Papierkorb> You want to use JSON.mapping always if possible. Makes working with JSON and friends much more fun after the initial "cost" of writing the host class
<FromGitter> <sdogruyol> json["latitude"].as(YourType) ?
<Papierkorb> crisward, if it has JSON.mapping, then just do `Ips.from_json(res.body)`
<FromGitter> <crisward> my ips object was using mapping, but I'm pretty sure the above was a hack to stop it breaking with the api's output
<Papierkorb> mapping will automatically do the integer <-> floating stuff for you. And if you set a `default: 0.0`, it'll also cope with null OOTB.
<FromGitter> <crisward> if there a difference between `as_f`and `.as(Float32)` ?
<Papierkorb> `as()` is a language feature, `#as_f` a normal method
<FromGitter> <crisward> I'll give mapping another go then, thanks.
<Papierkorb> on that, `#as` being a language feature also means you can't create a method named `#as`.
<oprypin> what did i miss in the last few days
<FromGitter> <sdogruyol> never done that
<Papierkorb> ary pushed another ton of commits (or opened PRs, same to me). apart from that, nothing much i guess oprypin
<oprypin> thx
<FromGitter> <sdogruyol> we had `number as(Int32)` back in the days
<Papierkorb> Yeah. Good we got rid of that :)
<FromGitter> <sdogruyol> :D
<oprypin> sdogruyol, no brackets
<FromGitter> <sdogruyol> @oprypin welcome back
<FromGitter> <sdogruyol> yeah
<oprypin> thx
rohitpaulk has quit [Ping timeout: 255 seconds]
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium]
snsei has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
<FromGitter> <simaoneves> hey again
<FromGitter> <simaoneves> is there any consensus regarding the definitive ncurses lib port shard?
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
ylluminate has quit [Quit: Textual IRC Client:]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
Philpax__ has quit [Ping timeout: 246 seconds]
Philpax has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <bararchy> @simaoneves This one seems more active + examples :
rohitpaulk has joined #crystal-lang
<FromGitter> <Rinkana> Does Crystal have something like the `final` keyword? So methods can't be overwritten
<FromGitter> <bew> no
<FromGitter> <simaoneves> @bararchy Thanks mate, i was looking at that one
rohitpaulk has quit [Ping timeout: 246 seconds]
<FromGitter> <ziprandom> hey does this "can't define abstract def on metaclass" mean that I can't define an abstract class method?
<FromGitter> <bew> yes, only for methods, not class methods
<FromGitter> <ziprandom> to bad
<FromGitter> <bew> I don't know why though
<FromGitter> <faustinoaq> @ziprandom just use modules ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ []
<Papierkorb> bew, it doesn't make a lot of sense really. an abstract method is guaranteed to be implemented by an instance. a sub-class isn't an instance of an (abstract) class, it's a provider for an implementation
<FromGitter> <bew> yeah I agree it doesn't make a lot of sense, but then we don't have a way to force the user to define a class method (when they include my module)
<FromGitter> <bew> other than writing dumb methods that raises at compile time (and I'm not even sure it's possible)
<Papierkorb> raising at compile time is forcing the user to do that, isn't it?
Groogy has quit [Disconnected by services]
Groogy2 is now known as Groogy
<Groogy> Aaw yiz, one of our expansions launched without too much of a problem today! \o/
Groogy_ has joined #crystal-lang
<Papierkorb> "Nothing crashed and burned" \m/
<Groogy> exactly
<Papierkorb> that's my kind of humor :D
<Groogy> love our trailers
<FromGitter> <bew> is it even possible to raise on class method use, unless it is overriden?
<FromGitter> <bew> Groogy looks cool!
<Groogy> my absolute favorite trailer, can you see the "twist" in it? :P
<oprypin> bew, yeah, you just do it
<oprypin> bew, make a method that raises and overriding it will override that raise
<FromGitter> <bew> but this is runtime raise?
<FromGitter> <bew> oprypin sth like
<FromGitter> <bew> But it seems you can't even "include" class methods :/
<Groogy> no you use extend
<Groogy> don't you?
<FromGitter> <bew> yeah but it feels counter intuitive to write it like that
<FromGitter> <bew> (a little)
<oprypin> bew, class methods don't participare in inheritance. abstract class methods are impossible and that's not a coincidence
<FromGitter> <bew> yeah I agree it doesn't make sens to call them abstract class method
<FromGitter> <bew> but in case of a module, it ensures that classes including this module implement this or that method, would be interesting to also have this for class methods
<oprypin> it's not about the name. you see that abstract class method does not exist then you try to do a workaround with the same functionality but it also doesnt work
<oprypin> im not against abstract class methods but that's just how it is
claudiuinberlin has joined #crystal-lang
<FromGitter> <Rinkana> @Googy are you going to the GDC next year?
<FromGitter> <Rinkana> Groogy*
<Groogy> Maybe
<Groogy> I'll ask for it but if there's a junior that has never been I'm gonna let them go first
<Groogy> I might just go for my own money though instead
<FromGitter> <Rinkana> Alright. if you are going please hit me up. I'm probably going too
<Groogy> Oh cool, where do you work?
<FromGitter> <Rinkana> Creative Group. In The Netherlands. I was this year too @ GDC. I'm building my own engine in Crystal so it's all in my spare time (any money)
<FromGitter> <Rinkana> And the GDC is not cheap either...
<Groogy> oh cool
<Groogy> You have your engine on github?
<FromGitter> <Rinkana> Yeah
<FromGitter> <Rinkana>
<Groogy> feel free to steal stuff from me ^^
<FromGitter> <Rinkana> It's still very much WIP
<FromGitter> <Rinkana> It barely renders a cube atm
<FromGitter> <Rinkana> But it's getting there :P
<Groogy> I am currently working on text rendering with free-type :/
<Groogy> that library seriously suuuuuuuck
rohitpaulk has joined #crystal-lang
<Groogy> also huh you are using GLEW in your project?
<Groogy> how are you using it?
<FromGitter> <bew> TIL that you can use a variable and a method with same name in the same scope, like
<FromGitter> <bew> feels weird ^^
<Groogy> yeah I try to avoid it as much as possible
<Groogy> I would prefer compile error over it :/
<FromGitter> <bew> me too, I'd see `::bla bla` for top level method, and `self.bla bla` for instance methods
<FromGitter> <bew> but compile error for `bla bla`
<FromGitter> <Rinkana> Groogy. I'm building everything by myself. Including the bindings. However I've only made the glew repo. It's not being used atm.
<FromGitter> <Rinkana> I do see that we have two completely different coding styles
<Groogy> yeah I noticed since everything is lazily bound you don't need GLEW
<Groogy> since GLEW is there to help you avoid linkage errors
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Groogy> When Papierkorb gets closer to finish his bindgen tool I will probably make a opengl binding that does the GLEW linkage error handling for you
<Groogy> I'm too lazy to deal with bindings
<FromGitter> <Rinkana> But if you go to the gdc, let me know I loved it this year but next year I want to get more in depth with people that are in the industry
<FromGitter> <Rinkana> My idea is to later convert it to a vulkan engine. But that's hard when you can't run it on a mac
<Groogy> yeah also Vulkan is specificly targetted at like Ubisoft, DICE, etc.
<Groogy> I have built mine with the thought it should *eventually* support Vulkan but really if you just want something on screen it isn't really worth it more than a "it is fun to do"
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <Rinkana> Yeah, true that.
<FromGitter> <Rinkana> It's somewhat awesome that I've found someone who is somewhat like minded about crystal and it's 3d capeabilities 😄
<Groogy> Yeah ^^
<Groogy> I tried doing 3D in Ruby, code looked really nice...
<Groogy> problem was math...
<Papierkorb> Groogy: Favorite chars from a game you worked on?
<Groogy> fuuuck, I think FreeType needs me to also map the internal structures of the structs to work properly...
<Groogy> Papierkorb our games don't really have chars... but maybe the shy molluscoid?
<Groogy> was a bug that became a meme on reddit
<Papierkorb> Embedded structures? Of course, they need to be there .. Well, in more actual terms, their bytes needs to be their. If you don't care about them, and only want to make it work, `internal_foo: UInt8[<Correct run-time byte size here>]` is your friend.
greengriminal has quit [Quit: This computer has gone to sleep]
claudiuinberlin has joined #crystal-lang
<Papierkorb> That's the "Dear Library, look how much I care: Just do it" hack
<Groogy> Papierkorb, need to get this to work: error = FT_Render_Glyph( face->glyph, render_mode ) in Crystal
<Groogy> and face so far has been like a handle :/
<Papierkorb> Yeah fun times ahead
<Papierkorb> Though to be precise, you just need the correct pointer to that.
<Papierkorb> I mean copying the structure is totally how you're supposed to do it!
<Papierkorb> No one forces you though lul
<Groogy> :(
<Groogy> gonna see if I can find something like FT_Get_Glyph_Slot or something
<Papierkorb> If it's a scary big struct, you can 1) write a C wrapper function 2) just copy enough of the struct to make it work 3) do it the correct way and copy the whole thing 4) manually do pointerof + offset
<Papierkorb> „God bless this mess“
<Groogy> :flip:
<Groogy> (ノ `Д´)ノ ~┻━┻
<Papierkorb> Oh and for 1), as Crystal uses gcc as "linker", you can go lazy mode: Write the wrapper, and @Link directly your wrapper.c, instead of compiling it manually lul.
<Papierkorb> I don't recommend it, but for PoC's .. who cares.
<Groogy> I hate this sooo much ;_;
<Papierkorb> Am packing stuff can't really look into it, sorry
<Groogy> no I am just moaning about it to ease the pain
rohitpaulk has joined #crystal-lang
LastWhisper____ has quit [Quit: Textual IRC Client:]
<FromGitter> <crisward> Don't mean to jump the gun, but this looks like an easy close ?
<Papierkorb> Yes. No way in hell this would ship.
<Groogy> ;_;
<Groogy> why is the struct so big
<Papierkorb> Huh?
<Papierkorb> Nothing a surgical regex replace in your favorite editor can't fix in a few substitutions
<Groogy> I need to access *only* glyph member in that struct
<Papierkorb> `s/FT_(U?(?:Short|Int))/LibC::\1/`
<Groogy> yeah but most of those members are not defined in my binding
<Groogy> since I am just doing "exactly what I need" to get by
<Groogy> eh members I mean types of the members
<Papierkorb> I'd really just regex the sh.. out of that. Pointers are easy to wrap (Just use Void*)
<FromGitter> <bew> could maybe hack it and declare a struct with 2 fields: `padding : UInt8[<offset_until_glyph>]` and `glyph : WhateverType`
<FromGitter> <crisward> @mverzilli 👏 Back to 399!
<Papierkorb> +1
<crystal-gh> [crystal] RX14 pushed 1 new commit to master:
<crystal-gh> crystal/master 8042d98 Ary Borenszweig: Let HTML.escape only escape &<>"' (#5012)
<FromGitter> <bew> ahahah, rules is to keep it under 400?
<FromGitter> <bew> ^^
<Groogy> yeah will prob just do the padding :/
claudiuinberlin has quit [Quit: Textual IRC Client:]
<FromGitter> <mverzilli> :P
<FromGitter> <crisward> Just triaging 400 issues has got to take forever, never mind fixing them.
<Groogy> do I have some easy way to get exact byte offset of that struct member? :/
<Groogy> offsetof(FT_FaceRec::glyph)
<Groogy> would that work?
<crystal-gh> [crystal] asterite pushed 2 new commits to master:
<crystal-gh> crystal/master bf016e7 Sokolov Yura aka funny_falcon: use Crystal::Hasher and open addressing with quadratic probing in StringPool...
<crystal-gh> crystal/master 9ec8327 Ary Borenszweig: Merge pull request #5000 from akzhan/stringpool-openaddressing...
<FromGitter> <bew> in which language? C?
<Groogy> its written in C yeah
<Groogy> but I got 152 from offsetof(FT_FaceRec, glyph)
<Groogy> this confuses me a bit on the example
<Groogy> it says the double is 8 bytes away?
<Groogy> that can't be right?
<FromGitter> <bew> Groogy seems broken, or a weird compiler... try on yours?
<Groogy> or they just wrote wrong result
<Groogy> the stackoverflow shows what I would expect
<FromGitter> <bew> weird, I got the same, maybe it's in bits not bytes
<Groogy> huh you got 8 bits with the example?
<FromGitter> <bew> yes
<Groogy> could also be padding :/
<Groogy> if I do a struct with two ints, I get 4 bytes as result
<Groogy> so pretty sure it is in bytes
<Groogy> at least using clang++
<FromGitter> <bew> doc says it's bytes
<Groogy> yeah and two members of ints, with second returning 4 means it is bytes
<Groogy> so in that example the compiler is adding padding
<FromGitter> <bew> ah you may be right
<travis-ci> crystal-lang/crystal#8042d98 (master - Let HTML.escape only escape &<>"' (#5012)): The build passed.
<DeBot_> (Let HTML.escape only escape &<>"')
rohitpaulk has quit [Ping timeout: 240 seconds]
<travis-ci> crystal-lang/crystal#9ec8327 (master - Merge pull request #5000 from akzhan/stringpool-openaddressing): The build passed.
<DeBot_> (use Crystal::Hasher and openaddressing in StringPool)
thews has quit [Read error: No route to host]
<Groogy> uuugh now I have to have access to the face->glyph->bitmap
<Groogy> ;_;
<Groogy> make good API pls
<Groogy> think of the poor programmers
<Groogy> eeh I'll tackle this some other day
thews has joined #crystal-lang
thews has joined #crystal-lang
thews has quit [Changing host]
thews has quit [Read error: No route to host]
thews has joined #crystal-lang
thews has quit [Changing host]
thews has joined #crystal-lang
_whitelogger has joined #crystal-lang
foca has quit [Ping timeout: 260 seconds]
foca has joined #crystal-lang
jhass has joined #crystal-lang
<crystal-gh> [crystal] crisward opened pull request #5016: updated error message, closes #4831 (master...fix_4831)
jokke has joined #crystal-lang
greengriminal has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master:
<crystal-gh> crystal/master fc62908 Cris Ward: updated error message, closes #4831
<crystal-gh> crystal/master 355cbc8 Ary Borenszweig: Merge pull request #5016 from crisward/fix_4831...
snsei has joined #crystal-lang
<travis-ci> crystal-lang/crystal#355cbc8 (master - Merge pull request #5016 from crisward/fix_4831): The build passed.
<DeBot> (updated error message, closes #4831)
<crystal-gh> [crystal] RX14 pushed 1 new commit to master:
<crystal-gh> crystal/master 88da972 Rubi Jihantoro: change .hexdigest to .digest for wanted output example (#4993)...
<crystal-gh> [crystal] RX14 pushed 1 new commit to master:
<crystal-gh> crystal/master 788e069 James Dinsdale: Fix 12hr time formatting (#4988)...
greengriminal has quit [Quit: This computer has gone to sleep]
<crystal-gh> [crystal] asterite pushed 2 new commits to master:
<crystal-gh> crystal/master 3ca5428 Ary Borenszweig: Merge pull request #4995 from asterite/feature/macro-resolve-alias...
<crystal-gh> crystal/master 1a3edaa Ary Borenszweig: Macros: automatically resolve alias in types. Fixes #4301
<crystal-gh> [crystal] asterite closed pull request #4996: Semantic: don't find type parameter in alias (master...bug/3502-type-parameter-in-alias)
<FromGitter> <bew> useless but fun
<FromGitter> <bew> (use oneline & multiline block in the same line)
<travis-ci> crystal-lang/crystal#88da972 (master - change .hexdigest to .digest for wanted output example (#4993)): The build passed.
<DeBot> (change .hexdigest to .digest for wanted output example)
<travis-ci> crystal-lang/crystal#788e069 (master - Fix 12hr time formatting (#4988)): The build passed.
<DeBot> (Fix 12hr time formatting)
<crystal-gh> [crystal] asterite closed pull request #4798: Expose alt_name for redefine_main (master...alt_name_for_redefine_main)
<crystal-gh> [crystal] asterite pushed 2 new commits to master:
<crystal-gh> crystal/master 7085f3c Akzhan Abdulin: Introduce crystal --stdin-filename source flag to compile source from STDIN, closes #4561....
<crystal-gh> crystal/master a214c8d Ary Borenszweig: Merge pull request #4571 from akzhan/introduce-crystal-compiler-flag---fake-source-source-path...