http_GK1wmSU has left #crystal-lang [#crystal-lang]
Split has joined #crystal-lang
[spoiler] has quit [Ping timeout: 276 seconds]
[spoiler] has joined #crystal-lang
bcardiff has joined #crystal-lang
snsei has joined #crystal-lang
bcardiff has quit [Quit: bcardiff]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
snsei has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
Papierkorb has quit [Ping timeout: 246 seconds]
rohitpaulk has quit [Ping timeout: 260 seconds]
<crystal-gh>
[crystal] wmoxam opened pull request #4781: Fixes specs broken on BSD (master...fix-openbsd-specs) https://git.io/v7gGe
rohitpaulk has joined #crystal-lang
Split_ has joined #crystal-lang
Split has quit [Ping timeout: 248 seconds]
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
mark_66 has joined #crystal-lang
Philpax__ has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
Philpax_ has quit [Ping timeout: 276 seconds]
Split__ has joined #crystal-lang
Split_ has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
Philpax has joined #crystal-lang
Philpax__ has quit [Ping timeout: 246 seconds]
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
DTZUZO has quit [Ping timeout: 255 seconds]
hightower2 has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
Split_ has joined #crystal-lang
Split__ has quit [Ping timeout: 240 seconds]
Split_ has quit [Ping timeout: 255 seconds]
<FromGitter>
<piperun> Hello everyone, I'm a little curious about crystal, as far as I know it's a compiled language but I'm wondering if it's possible to use Crystal as a script language in say making video games?
tosmi has joined #crystal-lang
<tosmi>
hi, i'm trying to compile crystal on freebsd 10.3
<tosmi>
any hints what i'm donig wrong here? thanks
<FromGitter>
<bararchy> @piperun there are more then a few people doing game development in Crystal , I don't really understand the Script part in the question though
Anon1546 has joined #crystal-lang
Anon1546 has quit [Quit: Page closed]
hightower2 has quit [Remote host closed the connection]
hightower has joined #crystal-lang
Papierkorb has joined #crystal-lang
saadq has quit [Ping timeout: 260 seconds]
saadq has joined #crystal-lang
flaviodesousa has joined #crystal-lang
<FromGitter>
<straight-shoota> I think @piperun want's to use Crystal as an interpreted language to easily allow custom modifications.
<FromGitter>
<straight-shoota> This would be very difficult and probably not really helpful, because Crystal's type inference for example needs to assess the whole program and not just parts of it.
<FromGitter>
<straight-shoota> @tosmi I don't know if it helps, but does src/lib_c/x86_64-portbld-freebsd/c/dlfcn.cr exist?
<FromGitter>
<straight-shoota> Oh I see you figured that^^
Split has joined #crystal-lang
Split has quit [Client Quit]
rohitpaulk has joined #crystal-lang
<FromGitter>
<piperun> @straight-shoota I see, thanks for the input!
DTZUZO has joined #crystal-lang
<FromGitter>
<straight-shoota> you could probably better use Lua (or somthing similar, maybe mruby). This language was explicitly designed for such tasks. IIRC there are Crystal bindings for liblua.
<tosmi>
but it seems my problem is related with the crystal standard library
<tosmi>
maybe there's no merge! for Set(string) in 0.20.0 but 0.20.1 uses this
<tosmi>
so how do i compile crystal 0.20.1 with 0.20.0?
<FromGitter>
<akzhan> it looks like you got wrong source code: 0.20.1 stdlib introduces merge! method
<FromGitter>
<straight-shoota> but you should be able to compile 0.20.1 with 0.20.0
<tosmi>
i'm using bash here and after compiling 0.20.0 i did a export PATH=.../crystal-0.20.0/bin and tried to compile 0.20.1
<tosmi>
seems to be wrong...
<tosmi>
so my workflow is setting the path, changing to the new crystal version and running gmake
<FromGitter>
<straight-shoota> I guess you could just keep everything in the same directory... make builds compiler into .build/crystal, then checkout next release and make uses .build/crystal from previous build
<tosmi>
@straight-shoota: thanks! looks like that's the issue here. i will try that a little bit later
bcardiff has joined #crystal-lang
w-p has quit [Ping timeout: 276 seconds]
bcardiff has quit [Quit: bcardiff]
tzekid has quit [Remote host closed the connection]
w-p has joined #crystal-lang
bcardiff has joined #crystal-lang
sz0 has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
<crystal-gh>
[crystal] MakeNowJust opened pull request #4784: Parser: allow to use trailing comma after named arguments in index notation (master...fix/crystal-parser/allow-trailing-comma-in-index) https://git.io/v72eM
rohitpaulk has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
alex`` has quit [Ping timeout: 246 seconds]
alex`` has joined #crystal-lang
hightower has quit [Ping timeout: 260 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 258 seconds]
mark_66 has quit [Remote host closed the connection]
<FromGitter>
<eliasjpr> Does crystal have `throw/catch` control flow?
<ANon1543>
Just out of curiousity: nullpointer, nil and false are considered the only falsey. so 0 is also considered a truthy value?
<Papierkorb>
yes
<ANon1543>
that....feels weird
<Papierkorb>
Coming from C/C++?
<ANon1543>
how did it come to that design decision
<ANon1543>
c
<Papierkorb>
Ok. Former C++ developer, before going to Ruby and later Crystal here. It's a non-issue. In C/C++, you often have to check for a zero or non-zero value, right? Yeah, not so much in Crystal or Ruby
<Papierkorb>
Say you have a method which reads some integer value. In C, you might use a pointer argument as target and a bool return type (or int) to tell the caller if the call was successful, right?
<Papierkorb>
Well, in Crystal, you'd just return a `Int32 | Nil`, that is, an Int32 (the call was successful), or `nil` (the call failed)
<Papierkorb>
Done. No `if (!foo()) { /* actually the success path */ }` stuff necessary.
<ANon1543>
Makes sense.
<ANon1543>
Thanks and have a nice day.
ANon1543 has quit [Quit: Page closed]
<FromGitter>
<eliasjpr> <oprypin> raise and rescue serves a diferrent purpose
bcardiff has quit [Ping timeout: 260 seconds]
<FromGitter>
<eliasjpr> catch/throw are not the same as raise/rescue. catch/throw allows you to quickly exit blocks back to a point where a catch is defined for a specific symbol, raise rescue is the real exception handling stuff involving the Exception object.
<FromGitter>
<eliasjpr> raising exception is a little expensive in the case I would like to use it for, throw seems ideal, but I guess I will have to live with raise/rescue
<Papierkorb>
do you mean catch/throw as in ruby's sense?
<FromGitter>
<eliasjpr> yes
<FromGitter>
<eliasjpr> I just wondered if Crystal has that kind of control flow
<Papierkorb>
break etc. - Don't use the exception mechanism for control flow
<FromGitter>
<eliasjpr> I hate using exception for my case, and break just exits the current method, when I really want to do is jump to a different flow
<FromGitter>
<eliasjpr> maybe that’s a feature request?
<Papierkorb>
That feature is barely needed, and would potentionally be hard to do - Not even speaking of doing it right
bcardiff has joined #crystal-lang
<Papierkorb>
If "doing it right" is even possible
<FromGitter>
<eliasjpr> interesting, I gues the dynamic nature of ruby allow this to be done more easily
rohitpaulk has quit [Remote host closed the connection]
<FromGitter>
<straight-shoota> That might be a factor... but I'm not sure if it would be too difficult to add to Crystal . But as I understand it, it is deliberately not a thing because there is no real usecase and it makes things unnecessarily complicated.
<FromGitter>
<eliasjpr> @straight-shoota is there any documentation of the lifecycle when an exception is raised?
<FromGitter>
<straight-shoota> sorry, I don't know