<FromGitter>
<picatz> Livin' up to his name once again! :D
<FromGitter>
<jwoertink> totally!
Philpax has joined #crystal-lang
<FromGitter>
<doughsay> hey everyone, what's the state of thread support in crystal? doesn't look like there's been any activity on the `thread-support` branch since march... how likely are we to get something at least experimental soon?
https_GK1wmSU has joined #crystal-lang
https_GK1wmSU has left #crystal-lang [#crystal-lang]
<FromGitter>
<watzon> Also a little Crystal history question if anyone would care to answer it. When Crystal was written in Ruby was it still getting compiled to machine code? Or was it being interpreted at that point?
<crystal-gh>
[crystal] wmoxam opened pull request #4770: Refactor platform specific process path (master...refactor-platform-specific-process-path) https://git.io/v7Boc
_tsound has joined #crystal-lang
<_tsound>
Does crystal have an inline assembler?
<_tsound>
like C++'s "__asm__"
<FromGitter>
<mgarciaisaia> @watzon I wasn't really involved in Crystal at the time, but I'm pretty much sure that LLVM was always around, so I'd say 99.9% sure that it was compiled anyway
<FromGitter>
<mgarciaisaia> The only difference was that the code that invoked LLVM was written in Ruby instead of in Crystal itself
<FromGitter>
<watzon> @mgarciaisaia I figured as much. Thanks :)
<FromGitter>
<mgarciaisaia> About `thread-support`, I once again am not sure about the latest news, but I *think* news may be coming on that (an some other main topics) in the next few months. I'm *really* not saying "It'll be done in two months", I'm saying something like "there will probably be more concrete deadlines & statuses in a couple of months".
<FromGitter>
<mgarciaisaia> I know how it feels to feel no feedback from a team, and I really apologize for getting you into that position. We're juggling a couple of things here, and I personally have a really hard time to not let something slip when I'm focusing on something else. That balance between multiple stuff - I've never done a great job at that.
<FromGitter>
<mgarciaisaia> I am reading the feedback you're sending - haven't replied because I feel I need to think through it instead of just saying something. But believe me Crystal's not dead *at all*, and we're going to be here, supporting it, next year, the other, and (hopefully) many more.
<FromGitter>
<doughsay> Thanks for the update; looking forward to some news! I'm only using Crystal for a hobby project right now, but thread support will be needed to bring it to the next level, so I'm very much looking forward to it. I'm also totally happy to use experimental stuff; as I said, it's only a hobby project...
<FromGitter>
<mgarciaisaia> We're *definitely* getting thread support. We've discussed that a gazillion times, and we know we're doing that. ⏎ That being said - Node & Ruby are two great examples that force me to re-think the *No can't do without it* chain of thought.
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter>
<doughsay> Yeah, good point, but I wouldn't be trying to write a videogame in Node or Ruby. For games the choice is usually C or C++, or an engine like Unity. With Crystal's great speed and ability to call into C libraries, it makes it a potentially good alternative for games. That's what I'm experimenting with.
snsei has joined #crystal-lang
Split has quit [Quit: Leaving]
<FromGitter>
<konovod> Ruby+Gosu is nice for 2d games.
_tsound has quit [Quit: WeeChat 1.9]
snsei has quit [Remote host closed the connection]
<FromGitter>
<bararchy> I think Crystal can be a major player in the game industry , just need more love , but it can get there
snsei has joined #crystal-lang
https___GK1wmSU has joined #crystal-lang
https___GK1wmSU has quit [Excess Flood]
snsei has quit [Remote host closed the connection]
Groogy_ has quit [Read error: Connection reset by peer]
<FromGitter>
<Qwerp-Derp> Uhhh... how do I compile a program to Windows?
<FromGitter>
<Qwerp-Derp> I compiled a program in Mac OS X and it didn't work with Windows (which is probably expected)
ome has quit [Ping timeout: 276 seconds]
ome has joined #crystal-lang
<FromGitter>
<straight-shoota> @Qwerp-Derp Windows is not fully supported yet, but you can cross compile simple programs. Instructions and details on #3582
snsei has joined #crystal-lang
<FromGitter>
<Qwerp-Derp> Oh, I just thought that you can't actually compile anything in Crystal, I didn't know that even compiled programs can't work :(
<FromGitter>
<Qwerp-Derp> Is there a way to get the position of the cursor in the terminal through Crystal?
<FromGitter>
<Qwerp-Derp> Right now this won't compile because `char` can be `Char` or `Nil`, is there any way to run the `line += char` line if `char` is not nil, and the compiler will catch that?
<Yxhuvud>
wrap it in an if statement.
<FromGitter>
<Qwerp-Derp> I did, compiler still trips up
<FromGitter>
<Qwerp-Derp> I changed the line to this: `line += char if char != nil`, compiler still doesn't allow me to run
<Yxhuvud>
doesn't work with infix if for some unknown reason (it probably should)
<RX14>
== can be overriden so the compiler can't use == or !=
<FromGitter>
<Qwerp-Derp> So what do I use?
<RX14>
you can use .nil? or .is_a?
<RX14>
those are special methods that can't be overridden
<RX14>
but really, just use truthiness
<RX14>
unless it's a Bool | Nil
<RX14>
which is rare
<RX14>
line += char if char
rohitpaulk has joined #crystal-lang
<jokke>
hey
<jokke>
(how) can i statically link a crystal binary on arch linux?
<jokke>
if i try with --link-flags static i get /usr/bin/ld: cannot find -lssl etc
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter>
<straight-shoota> @sdogruyol on the survey page 2: *Approximately how large are all the Crystal projects that you work on?* - is this asking for total sum? I think it should be more clearly.
<FromGitter>
<straight-shoota> and page 3: *What editor(s) do you use when writing Crystal?* - asks for plural but you can only select one.
<FromGitter>
<straight-shoota> same for *Which version(s) of Crystal do you use for your applications?*
rohitpaulk has joined #crystal-lang
<FromGitter>
<straight-shoota> and just as a suggestion: *How difficult did you find learning Crystal?* has very little meaning if you don't ask for prior experience with programming and similar languages.
<FromGitter>
<straight-shoota> never mind it is on a later page
<FromGitter>
<sdogruyol> @straight-shoota hey thanks for your valuable feedbacks :)
<FromGitter>
<sdogruyol> I haven't publicly announced the survey yet :P
<FromGitter>
<sdogruyol> @RX14 I'll announce it today with the weekly + other channels
<RX14>
well it was on the crystal-lang blog...
<FromGitter>
<sdogruyol> Yes, I'm aware of that
<FromGitter>
<sdogruyol> Meanwhile we haven't publicly announced it yet some people actually completed survey :)
<FromGitter>
<sdogruyol> That's awesome
<FromGitter>
<straight-shoota> published on https://crystal-lang.org/ should considered publicly announced
<FromGitter>
<sdogruyol> @straight-shoota yes
<FromGitter>
<sdogruyol> I mean we still haven't pushed it to other channels yet
<FromGitter>
<sdogruyol> Which is happening shortly :P
<jokke>
anyone? :/
<FromGitter>
<sdogruyol> sorry @jokke, wish i could help but I'm not using Arch :(
<FromGitter>
<bew> Morning guys!
<FromGitter>
<sdogruyol> Morning @bew
<jokke>
no problem. i'll try building the libs with abs (arch build system)
<FromGitter>
<straight-shoota> jokke, seems like you need libssl as a static library in your library path
<FromGitter>
<straight-shoota> but I really don't know much about linking... just give it a little time, the experts will eventually turn up :D
<jokke>
yeah i figured :)
<RX14>
jokke, i don't think anyone knows how to do static linking
<RX14>
it's not really been done
<RX14>
there are certain libraries which just do not like to be statically linked
<RX14>
and i think openssl is one of them
flaviodesousa has joined #crystal-lang
<jokke>
RX14: i think i'm almost there! i just cloned the archlinux packagebuilds and added options=('staticlibs') to all libs i need to link
<jokke>
RX14: i could compile and link without errors but i still have a few worrying warnings: https://p.jreinert.com/4dClEp/
<RX14>
thats the parts about openssl and libc not liking static linking
<RX14>
glibc uses dlopen even when statically lniked
<RX14>
and if the libraries dlopen finds aren't compatible...
<RX14>
then it blows up
<RX14>
glibc and openssl are essentially useless to statically link
<RX14>
since they blow up more often when statically linked
<Yxhuvud>
you basically need a different libc implementation for that. There are other variants that actually do work to statically link, like musl. IIRC
<RX14>
yup
<RX14>
using alpine linux will help you out here
<Yxhuvud>
(. because using arch is not hiptser enough .)
<RX14>
no because thats what alpine was built around lol
<FromGitter>
<sdogruyol> @RX14 how's alpine package manager though
<FromGitter>
<sdogruyol> I've been itching to dive into alpine but no time yet
<FromGitter>
<sdogruyol> everything statically linked by default?
<RX14>
yes
<RX14>
apk is one of the best package managers i've used
<RX14>
it's blazing fast
<FromGitter>
<sdogruyol> wow, sounds cool
<FromGitter>
<sdogruyol> how come they have everything static by default?
<FromGitter>
<sdogruyol> do they keep their own fork of everything or so?
<RX14>
no...
<RX14>
almost all libraries can be configured to be static easilly
snsei has joined #crystal-lang
<FromGitter>
<codenoid> agree @bararchy
<FromGitter>
<bararchy> woot
<FromGitter>
<bararchy> Agree on what ?
<FromGitter>
<bararchy> Oh, the game indestry thingy ?
<crystal-gh>
[crystal] MakeNowJust opened pull request #4773: Expand: show expanded macro name and its location (master...feature/crystal-expand/show-expanded-macro-name-and-location) https://git.io/v7R44
<FromGitter>
<codenoid> ✨
w-p has quit [Ping timeout: 255 seconds]
<FromGitter>
<bararchy> Is there a way to create github.io with Crystal ?
<FromGitter>
<bararchy> (static site generator)
<crystal-gh>
[crystal] ysbaddaden pushed 1 new commit to master: https://git.io/v7RE7
<crystal-gh>
crystal/master 8f2f505 TSUYUSATO Kitsune: Fix chained comparisons `to_s` to work #4663 (#4708)...
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<crystal-gh>
[crystal] ysbaddaden pushed 1 new commit to master: https://git.io/v7RuW
<crystal-gh>
crystal/master c8cb5cd TSUYUSATO Kitsune: Don't find in CRYSTAL_PATH if required path is relative (#4765)...
thelonelyghost has quit [Ping timeout: 258 seconds]
TheGillies has quit [Ping timeout: 276 seconds]
braidn[m] has quit [Ping timeout: 264 seconds]
olbat[m] has quit [Ping timeout: 255 seconds]
vegai has quit [Ping timeout: 255 seconds]
jplatte has quit [Ping timeout: 255 seconds]
werthen[m] has quit [Ping timeout: 240 seconds]
sija[m] has quit [Ping timeout: 255 seconds]
krigare[m] has quit [Ping timeout: 240 seconds]
Lex[m] has quit [Ping timeout: 246 seconds]
<FromGitter>
<straight-shoota> I have been working on one
<FromGitter>
<bararchy> That's cool , any beta to play with ? I'm sick of jykell lol
<FromGitter>
<straight-shoota> basically working are serving static html files with Crinja templates (there is some limited support for Liquid syntax as well) and rendering SASS/SCSS stylesheets
<FromGitter>
<straight-shoota> oh, and it does not generate the static site yet, it just serves it directly - but blazingly fast
<FromGitter>
<straight-shoota> it proved itself well when I was working on a website project and got sick of waiting for Jekyll to regenerate
<FromGitter>
<bararchy> Oh , I see , is there a way to output the site ? As I want it for github.io pages
kaleido has quit [Read error: Connection reset by peer]
<FromGitter>
<straight-shoota> tremolite looks like a good alternative with a different approach. it is basically a toolkit to create a custom site generator as a Crystal application. If you change things you need to rebuild.
<crystal-gh>
[crystal] wmoxam opened pull request #4774: Add support for max + min intrinsics (master...add-math-operations) https://git.io/v7RNn
<FromGitter>
<straight-shoota> My idea is that you just have an executable and don't need any Crystal coding to use it
<FromGitter>
<straight-shoota> like you don't need to write any ruby to use Jekyyl
sz0 has joined #crystal-lang
<jokke>
in case someone is interested, depite of the warnings my statically linked crystal program seems to run just fine
<jokke>
could be just luck though :)
<FromGitter>
<sdogruyol> wow
<FromGitter>
<sdogruyol> what's it actually doing?
<FromGitter>
<bararchy> jokke did you compile in alpine
<FromGitter>
<bararchy> ?
<jokke>
no i compiled on arch linux
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<jokke>
sdogruyol: it reads from stdin, chunks it up, makes a treehash over the chunks and sends the chunks to aws glacier
<jokke>
all without ever needing more ram/disk space than a single chuk
<jokke>
*chunk
<jokke>
i have to archive a 800GiB database
<jokke>
so i just pipe the db dump output to my crystal program
<FromGitter>
<sdogruyol> Hey everyone please join to our survey to make Crystal more awesome :)
<FromGitter>
<bararchy> Cool !! @sdogruyol awesome work , you help the community march forward
<FromGitter>
<sdogruyol> Thank you @bararchy 😊
mark_66 has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
fenicks has left #crystal-lang [#crystal-lang]
flaviodesousa has quit [Ping timeout: 268 seconds]
<FromGitter>
<bararchy> BTW , if anyone is willing , please push this link as much as you can (tweet, send links , etc..) It can potentially really help Crystal
<FromGitter>
<sdogruyol> Will definitely help :P
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
fiete has quit [Ping timeout: 260 seconds]
fiete has joined #crystal-lang
werthen[m] has quit [Quit: idle]
leandrobighetti has quit [Remote host closed the connection]
leandrobighetti has joined #crystal-lang
leandrobighetti has quit [Ping timeout: 255 seconds]
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter>
<jsilverMDX> im not hooked up with Crystal people outside Gitter but I did it
<FromGitter>
<jsilverMDX> i have spread crystal with livepost tho
<FromGitter>
<sdogruyol> @jsilverMDX awesome 👍
<FromGitter>
<fridgerator> 👍
<FromGitter>
<bararchy> Thanks @jsilverMDX 👍
<FromGitter>
<bararchy> The more the better
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
Split has joined #crystal-lang
<FromGitter>
<jsilverMDX> 👍 :) 💎
kyku has joined #crystal-lang
<kyku>
hi
<FromGitter>
<sdogruyol> hey
<kyku>
I have a newbie question regarding crystal. Is it ok paste a tiny bit of code here?
<Papierkorb>
kyku: Sure - If it's longer than a line, use http://gist.github.com and paste the link
<Papierkorb>
the compile-time variable type doesn't change, as the variable still must be able to store a `nil` there. However, the compiler inside the `if value` can be absolutely sure that at run-time, it won't be nil
<kyku>
in the same 'program':
<kyku>
if valueputs value + 1 end
<Papierkorb>
kyku: It has to do with the in-memory layout of the variable, which doesn't change because of an if. Though in this (common) case, inside the then-branch, the compiler is sure which type the variable will be, so you can use it as that for all things freely
<kyku>
sorry
<kyku>
for the bad formatting, but if I try to "puts value + 1" in the if value
<kyku>
branch, then I'm getting a compile time error:
<kyku>
Error in line 10: undefined method '+' for Nil (compile-time type is (UInt32 | Nil))
<Papierkorb>
kyku: Yes. The issue is that you're catching `value` into a caught-block above (line 6). The code could now use the caught block and run it in parallel, just after the `if value` branch was taken, and change value to `nil` again, producing undefined behaviour
<Papierkorb>
kyku: Which is the real reason for the union-type not changing inside the if branch
<Papierkorb>
You have to somehow ensure that a used variable can't change in type after a type-check occured for it to really affect the variable as intended
<Papierkorb>
in the snippet I do so by stuffing the parsing into a method. The caught variable is not the one returned, so the type-check does what you expected. Another possible way is to initialize value to an UInt32, which is fine if it has a default value
<FromGitter>
<sdogruyol> thanks @papierkorb always something to learn from you :)
<Papierkorb>
sdogruyol, I was more surprised that I didn't run into this before
<FromGitter>
<sdogruyol> me too :D
<Papierkorb>
Which does however raise the importance for a right-of-the-bat type-safe CLI option parser. And to finally set up a github blog, so I can just point at the article if the same question comes up again (and it will). Oh well.
<FromGitter>
<sdogruyol> yeah more reachability and searchability for sure
fenicks has joined #crystal-lang
Lex[m] has left #crystal-lang ["Kicked by @appservice-irc:matrix.org : idle"]
<FromGitter>
<jsilverMDX> Does anyone know how to delete by _id with Mongo.cr?
<FromGitter>
<sdogruyol> nope sorry
sz0 has quit [Quit: Connection closed for inactivity]
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter>
<jsilverMDX> np
rohitpaulk has joined #crystal-lang
mounibec has joined #crystal-lang
Split has quit [Quit: Leaving]
krigare[m] has quit [Quit: idle]
<FromGitter>
<drosehn> yeah, I'm going to have to re-read that section on what `parser.on` is doing there.
<FromGitter>
<jsilverMDX> any CAPTCHA solutions for Crystal?
<FromGitter>
<jsilverMDX> i dont want recaptcha or any APIs
<FromGitter>
<drosehn> Back a bit, @mgarciaisaia wrote: "That being said - Node & Ruby are two great examples that force me to re-think the *No can't do without it* chain of thought." -- I've always thought the main point about getting thread support worked out for version 1.0 is that thread-support might force some incompatible changes to the language. And, for instance, I don't want to push to sort out `signal()` issues until
<FromGitter>
... thread-support is stable.
<Papierkorb>
lawl das iPhone 3G hatte keinen fokus in der kamera, weil die so einen irre tiefenschärfenbereich hatte, dass sie den "nicht brauchten"
<oprypin>
alrighty then
<Papierkorb>
... wrong channel -.-;
<oprypin>
does it have something to do with that comment that camera software on android is bad
leandrobighetti has quit [Remote host closed the connection]
<Papierkorb>
Nothing at all, pure physics. Also, my G4 has an acceptable camera app, including giving me RAWs and being able to put the thing into Manual mode ... if you ever need that on your phone
leandrobighetti has joined #crystal-lang
leandrobighetti has quit [Ping timeout: 240 seconds]
kyku has quit [Quit: Page closed]
kali_ has joined #crystal-lang
<kali_>
hello! i was gogling but i'm coming up with unrelated results :( does crystal-lang have any way to use rijndael encryption? ruby has mcrypt, but i couldn't find anything related to that for crystal
leandrobighetti has joined #crystal-lang
<Papierkorb>
Oh you mean AES
<kali_>
not aes, rijndael. aes uses 128 by default, by i need 256/256 :(
<kali_>
well technically aes is a subset of rijndael :P
<Papierkorb>
it's just a different configuration
<Papierkorb>
Can't find any OOTB bindings, would've expected them as part of the OpenSSL bindings
<kali_>
hm. i've tried the openssl ones in ruby and i couldn't get aes to work with 256. had to use the mcrypt lib to get actual rijndael 256
<kali_>
so i'm guessing it would be the same for crystal (or any other language for that matter)
<Papierkorb>
crystalshards.xyz doesn't know of a binding either
<kali_>
i see :(
<kali_>
ah well, maybe i can use the pure ruby one and see if i can port it over to crystal
<kali_>
but for anyone who can point me to a ready-made library, that would be great so i don't have to reinvent the wheel :)
mounibec has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leandrobighetti has quit []
RX14 has quit [Quit: Fuck this shit, I'm out!]
RX14 has joined #crystal-lang
hightower2 has joined #crystal-lang
<hightower2>
Hey folks, is 'out' supposed to have any special recognition when not used inside lib?
<Papierkorb>
`out` is a keyword, available "everywhere"
<hightower2>
ok, that explains why I had problems naming the variable 'out' ;) thanks
<Papierkorb>
Yeah that'll give you funky compiler errors at call-site..
<hightower2>
in 0.23 it first requires me to put an extra 'end' in the code, and then segfaults
<hightower2>
0.23.0 I mean. But in 0.23.1, it gives a more reasonable error like "out can only be used with lib funs"
<hightower2>
Papierkorb, btw, I used Ruby bindings for Qt a lot (part of qtbindings project) and I submitted patches to it as well. Although that was for Qt4 and they never managed to port 'smoke' (the code parser/extractor) to work with Qt5
<hightower2>
But they did have some ruby-specific workarounds, to solve the problem of ruby not supporting method overloading. For example, on the first call of a Qt function, ruby args would be classified to find the most similar overload in C++, and then that method would be cached, so that the next invocation would directly use the cached version instead of doing the argument type comparison again
<Papierkorb>
Yeah, Crystal can do method overloading though
<hightower2>
But apart from trivia knowledge, not particularly useful/needed in the case of crystal
<hightower2>
yeah
<Papierkorb>
used Qt4 and later Qt5 with C++ a lot before using Ruby. Did my fair share of hacks with it too. God bless that mess. QObject::setUserData() was the best thing ever lul.
<oprypin>
in python you can set arbitrary members on qt objects :p
<oprypin>
so basically as bad as setuserdata but you dont know it's bad
cyberarm has quit [Ping timeout: 260 seconds]
fenicks has left #crystal-lang [#crystal-lang]
cyberarm has joined #crystal-lang
bradleyd has quit [Quit: Leaving]
mounibec has joined #crystal-lang
https_GK1wmSU has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
https_GK1wmSU has left #crystal-lang [#crystal-lang]
rohitpaulk has quit [Remote host closed the connection]
hightower2 has quit [Ping timeout: 246 seconds]
Dreamer3 has quit [Quit: Leaving...]
gloscombe has quit [Quit: WeeChat 1.9]
mounibec has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]