Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sandelius has joined #crystal-lang
<crystal-gh>
[crystal] technorama opened pull request #1577: Show the directory in the error message when Dir.chdir raises. (master...f/chdir_error_str) http://git.io/vnDki
Ven has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
<jhass>
jokke: with latest shards too= (shards-git from the AUR)
<jhass>
?
<jokke>
jhass: i'll just check
<jokke>
jhass: yeah
<jhass>
issue time then ;)
<jokke>
\o/
ssvb has quit [Ping timeout: 240 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
leafybasil has joined #crystal-lang
leafybas_ has joined #crystal-lang
leafybasil has quit [Read error: Connection reset by peer]
<jokke>
should i make a pull request removing ncurses?
<jokke>
asterite:
leafybas_ has quit []
leafybasil has joined #crystal-lang
<crystal-gh>
[crystal] jreinert opened pull request #1578: remove ncurses bindings from stdlib (master...remove-curses) http://git.io/vnDGW
apt-get has joined #crystal-lang
<jhass>
jokke: issue is that your repo is called ncurses-crystal but you pointed to ncurses in your shard.yml, but it should give a proper error message there
<crystal-gh>
[crystal] jhass closed pull request #1577: Show the directory in the error message when Dir.chdir raises. (master...f/chdir_error_str) http://git.io/vnDki
<jhass>
BlaXpirit: it decodes to handle the offset parameter
<jhass>
then compares bytes
<BlaXpirit>
you're right
<greenarrow>
jhass I can't see where it's happening in the code but on this page I see a random "ml>" at the bottom http://www.crystalweekly.com/about/
<jhass>
mmh
<greenarrow>
just me?
<jhass>
no it's there
<sfcgeorge>
Ooh cool. An "example" newsletter would be nice though.
<jhass>
greenarrow: no idea either
<greenarrow>
so weird
<greenarrow>
so so weird
Ven has joined #crystal-lang
greenarrow has quit [Quit: 500]
<dzv>
how can you print a class variable using lldb?
<crystal-gh>
[crystal] jreinert opened pull request #1580: add github_name option to init config and read from global git config (master...github-user) http://git.io/vnDjq
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ssvb has joined #crystal-lang
<jhass>
asterite: waj so, I basically got a setup where we can do nightlies from, at least for the next couple of months. A few details to discuss about actually doing so of course, ping me if you have time for it
<jokke>
do you think json_mapping could somehow be made polymorphic? i know it's a stretch but i'd imagine it would be very useful.
<jhass>
jokke: you mean sort of autodetection? ImageOrVideo.from_json() #=> Image|Video ?
<jokke>
yes, that and parent class json_mappings merged into the own json_mappings
<jokke>
i guess that would require some serious macro magic and maybe it's not even doable
<jokke>
i have an abstract class here which has certain attributes that will be included in the json of every subclass instance
Ven has joined #crystal-lang
<jokke>
hey
<jokke>
wait a second
<jokke>
it's not that hard maybe
<jhass>
mmh
<jokke>
a few conditional super calls here and there :>
<jhass>
calling super in the constructor might be enough, yeah
<jokke>
but it should be optional
<jokke>
i think
<jhass>
gotta check the constructors of the parent type whether there's one accepting the pull parser, yeah
<jokke>
yeah
<jokke>
jhass: do you think it should be default behavior?
<jhass>
I'm not sure
<jokke>
me neither..
<jhass>
maybe in non_strict mode? not obvious enough I guess
<jokke>
no..
<jokke>
extra param merge_parent?
<jhass>
maybe a constant in the parent?
<jhass>
idk
<jokke>
ah
<jokke>
no
<jokke>
just another macro
<jhass>
or that
<jhass>
but then error if the parent doesn't actually define one
<jokke>
yeah...
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jokke>
jhass: can i somehow access the parent class of @type and check for constants?
<jokke>
i'd like to raise a compile time error if trying to extend the json mapping of a parent that doesn't have one
<crystal-gh>
[crystal] adlerhsieh opened pull request #1581: Refactor case in patterns for Time#to_s (master...master) http://git.io/vny13
<waj>
jhass: that's awesome! I'll review it later but it will be great if we can have nightly builds
bmcginty has joined #crystal-lang
<jhass>
waj: okay, let's start with the easy question. Separate repo? I'd say yes, for reasons coming later, but mainly keeping both in sync would be harder
<dzv>
is there a way to return a compile time string for "#{self.class.to_s}:#{current_method_name}"
<jhass>
waj: currently I have crystal-dist.aeshna.de pointing at the repos, do we want an official domain?
<jhass>
waj: next up: rpm completely screwed up automatic signing. It doesn't allow signing with a signing subkey, so you would have the primary key unprotected (or with cleartext password stored somewhere on the buildserver), so I'd only offer a signed deb repo
<bmcginty>
I've been looking through some of the std specs for Crystal, starting with the string spec. A bunch of the specs are using assert instead of the "it" format. Is there a reason for this?
<jhass>
bmcginty: boilerplate, simply getting rid of it. assert wraps it with a dummy title
<waj>
mm... do we really need nightly packages or only tar.gz ?
<waj>
btw... separate repo for what? omnibus-crystal?
<jhass>
and I'd like at least the deb packages, way easier to install on travis
<bmcginty>
jhass: thanks.
<waj>
I understand
<waj>
ok, I'd say a different repo then
<jhass>
and doing the rpm packages afterwards was a fairly low hanging fruit
<waj>
dzv: I think there is currently no way. What would you use that for? logging?
<jhass>
waj: next up: since I can sign the deb packages I'd like to do so, question is, should I publish my own key for it or would you give me a (dedicated) signing subkey that I would be allowed to store unprotected (that means no passphrase on it) on a buildserver?
<jhass>
(of course I would walk you through creating it ;) )
<jokke>
jhass: i think it should be default and no way to change it
<jokke>
following reason: if i subclass a class that has a json_mapping then i already have all getters and setters of the parent class created by the macro
<jokke>
it would be weird if they wouldn't be included in the mapping by default
<jhass>
asterite: ^ we've been discussing having json_mapping call its super constructor if present, so you could inherit and extend them. Thoughts?
<jokke>
also i could always overwrite keys in the mapping
<jokke>
in the child
<jokke>
only thing i couldn't do is leave keys out completely
<asterite>
I'd need to see some code to understand it
<jokke>
but that's not possible with oo programming and methods either
apt-get has quit [Read error: Connection reset by peer]
apt-get has joined #crystal-lang
Philpax_ has joined #crystal-lang
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vnSgE
<crystal-gh>
crystal/master 90b5c93 Ary Borenszweig: Mark Array, StaticArray and Slice `#[]` and `#[]=` methods with AlwaysInline
Philpax has quit [Ping timeout: 240 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leafybas_ has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
<jokke>
asterite: it's not possible to iterate over a constant of the superclass in a macro right?
<jokke>
which is a Hash literal
<jokke>
i basically would need to merge two hashes together. the one from the current class with the one from its super class
andrew-l has quit [Remote host closed the connection]
<asterite>
Mmm... we'd need a way to turn a Path into a type, I guess
<jokke>
yeah that would be super useful
<jokke>
i've been wrapping my head around this for a while now, but i can't think of any solution to this json_mapping extending that wouldn't sacrifice performance
<jokke>
except if i could merge a hash literal with another hash literal by path
<jokke>
asterite: alot of work? i can't say i understand the compiler that well to being able to poke around
Philpax_ has quit [Ping timeout: 260 seconds]
<jokke>
also what would be the way to access a constant from the superclass?
<jokke>
i see there's `constants`
<jokke>
but i would need something like superclass::FOO
<jhass>
the license looks cumbersome on first look though :/
pragmatism has joined #crystal-lang
<dzv>
i think that's gpl compatible, but it would require open source for any program using it
<crystal-gh>
[crystal] asterite opened pull request #1583: Make empty arrays not allocate memory until needed (master...array_null_pointer) http://git.io/vn9dH
<jhass>
GPL is not exactly good for something like Crystal where you want to do binary distribution from. That's why there's LLVM instead of turning GCC into something equally reusable
<dzv>
so mps isn't viable due to licensing. unless we ask for an exception
<buggs>
i'm curating a regex benchmark, i'm implementing various versions of simple grep
<jokke>
wow, internet on german railroads is so crappy...
<jhass>
yeah
<buggs>
part of the tests are strstr/memmem greps
havenwood has quit [Ping timeout: 244 seconds]
<buggs>
given pcre in crystal it will not be competetive
<jhass>
buggs: if your strings are all ascii it should down to a memcmp
<jhass>
*boil
<buggs>
yes
<sdogruyol>
jhass: yay \-/
<sdogruyol>
jhass: it passed :P
<jhass>
\o/
<buggs>
(with the exception that in c accessing a string beyond '\0' would not be ok but for mem it would)
<buggs>
so what would be the fastest non utf-8 decoding version in crystal
<buggs>
?
<jhass>
buggs: well you can always go lowlevel, get the raw buffers and do whatever
havenwood has joined #crystal-lang
<jhass>
but we try to keep the APIs mostly single purpose in stdlib instead of "fast for special case a, fast for special case b, fast for special case c"
<jhass>
so you won't get String#index_screw_utf8
<buggs>
well in c i also implemented some algorithms and a sse2 based version and a sse4str based one
<buggs>
but fast regexes and ascii/mem compare are quite essential
<buggs>
for many performance oriented tasks
<buggs>
so if you give me multiple strategies to test, i will
<jhass>
how about doing a external lib for now and when we see a lib used like everywhere we can think about integrating it into stdlib
<sdogruyol>
i also agree with an external library first approach
<buggs>
well for crystal, for what i've seen, i guess integrating oniguruma would be one option
<buggs>
external lib, as in C or in native crystal?
<sdogruyol>
buggs: in crystal :)
<jhass>
we don't do C exts :P
NeverDie has joined #crystal-lang
<sdogruyol>
meanwhile is it a good practice to commit shard.lock or not?
<RX14>
it's like Gemfile.lock
<RX14>
i guess
<RX14>
so yes
<jhass>
there's a tiny bit of C++ in the codebase now because LLVM doesn't provide a C api for the debug builder stuff
<jhass>
but that's it
<jhass>
sdogruyol: yeah, better commit it
<sdogruyol>
RX14: that's what i thought
<sdogruyol>
ok :)
<RX14>
unless it's a libray where you have to work with a range of versions ofc
<RX14>
is what I heard sbout Gemfile.lock
<jhass>
I prefer to even then lock it to have consistent results between CI and local
nakilon has joined #crystal-lang
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 240 seconds]
andrew-l has joined #crystal-lang
<dyulax>
“Whenever your Gemfile.lock changes, always check it in to version control. It keeps a history of the exact versions of all third-party code that you used to successfully run your application.”
<dyulax>
“When deploying your code to a staging or production server, first run your tests [...], make sure you have checked in your Gemfile.lock to version control.”
<dyulax>
even if your dependency is restricted to a minor version (2.0.3 instead of 2.*), you can't be sure if all dependency's dependencies are in the exact same version if you don't commit the .lock file.
NeverDie has joined #crystal-lang
vjdhama has quit [Ping timeout: 246 seconds]
nakilon has quit [Ping timeout: 272 seconds]
sdogruyol has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
sdogruyo_ has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
sdogruyo_ has quit [Remote host closed the connection]
nakilon has joined #crystal-lang
<Papierkorb>
Does someone have a hello world Websocket server example lying around?
<Papierkorb>
Someone on the ML said "Yes, but please know that websocket is only partially implemented, so I don't think you'll be able to do a useful app with it right now." - What's missing?
<Papierkorb>
Does the implementation pass the Autobahn Test Suite?
vjdhama_ has joined #crystal-lang
sdogruyol has quit [Ping timeout: 240 seconds]
<jhass>
I don't think anybody tried
<Papierkorb>
Doing that now
<jhass>
there have been a bunch of improvements since though
<Papierkorb>
I recently implemented WS server-side, so I still have that lying around heh
NeverDie has joined #crystal-lang
nakilon has quit [Ping timeout: 250 seconds]
sdogruyol has joined #crystal-lang
pragmatism has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
so you can get it from my OBS repo if you ever (and still) had that
<jhass>
or git checkout 0.8.0; make; git checkout -; make
<jhass>
or use crystal-git from AUR ;)
<sdogruyol>
do you guys use arch?
<Papierkorb>
yup
<sdogruyol>
long time linux user converted to os x here :P
<sdogruyol>
never tried arch
<Papierkorb>
my condolences. arch is like the best thing ever
<sdogruyol>
Papierkorb: why?
<jhass>
sdogruyol: what do you do to install something?
<sdogruyol>
jhass: i use brew
<jhass>
unconditionally?
<Papierkorb>
No crap slowing down your system, always the latest software packages, and barely any extra patches applied to the original sources
<jhass>
does that work out?
<sdogruyol>
jhass: well mostly :)
<jhass>
what do you do if there's no brew package?
<sdogruyol>
jhass: grab the source and make if possible
<sdogruyol>
jhass: but mostly there's a package
<sdogruyol>
jhass: how about arch?
<jhass>
and in arch that's to the extreme, writing packages is so easy that somebody did it before for like everything
<jhass>
and if not there's no reason to pollute your system with a sudo make install, just write a package
mhib has joined #crystal-lang
<Papierkorb>
sdogruyol: if the package is not available from the repo, then it's unusual, but happens. If it's not even in the AUR, maybe the program isn't that important afterall ;)
<jhass>
ended up writing like 30 packages already
<sdogruyol>
jhass: that's the same with brew so simple to add a recipe
<jhass>
want to add a patch to a package? yaourt -G foo; cd foo; vim PKGBUILD; makepkg -si
<jhass>
done
<sdogruyol>
jhass: i'll need to give it a try but dont have a pc only mac :P
<Papierkorb>
It does run on a mac ..
<Papierkorb>
Anyway, how do I debug crystal code?
<sdogruyol>
Papierkorb: dude that's harsh :P
<sdogruyol>
Papierkorb: you can't debug other than stdout for now
<asterite>
buggs: there's String#byte_index
<sdogruyol>
oh ary got me :D
<jhass>
Papierkorb: crystal build -d and throw into gdb. set a breakpoint or add a trap the code by calling debugger
<jhass>
no variable inspection yet though, just stepping through
<Papierkorb>
how do I do a case-insensitive string compare?
<asterite>
jhass: 1394 looks good. You can merge :)
<asterite>
Eventually I'd like to rethink SimpleHash, it's used in the compiler and we put it in src, but maybe it should have a different name or something
<crystal-gh>
[crystal] jhass pushed 5 new commits to master: http://git.io/vnQXt
<crystal-gh>
crystal/master 1c785d7 Russ Bradberry: add select, select!, reject, and reject!, and each_with_object to Hash
<crystal-gh>
crystal/master f3a10e3 Russ Bradberry: Remove delete_if from Array in favor of reject!
<crystal-gh>
crystal/master 115e943 Jonne Haß: Handle signal exits from commands run by the compiler
<Papierkorb>
asterite: a necessary one too, I don't want to litter the code with .to_s.downcase ;)
<asterite>
Maybe there's a better way than a casecmp method? I don't know, we can think alternatives
<Papierkorb>
casecmp itself is a bad name, it sounds more like case-sensitive
<Papierkorb>
I used C++/Qt for almost 4 years, so I came accustomed that the method is called compare()
<jhass>
I'd also love to have full unicode support for case stuff (casecmp, downcase, upcase), but it'll be a bit slower then of course
<Papierkorb>
Is there already code somewhere to check if a string contains illegal UTF-8 codepoints?
<jhass>
unicode normalization methods would be great too
<asterite>
we could have `String#compare(other, insensitive =false)`
<Papierkorb>
tbh I think that having Unicode support is a must
<asterite>
in this case we can go char by char in both strings
<Papierkorb>
I don't have the time anymore to deal with crap like mb_*
<sdogruyol>
don't we have unicode support built-in ?
<jhass>
sdogruyol: String's are UTF-8
<sdogruyol>
jhass: and
<jhass>
but downcase/upcase is still only ASCII
<sdogruyol>
jhass: oh
<jhass>
>> 'ß'.upcase
<Papierkorb>
I could write the unicode point verification, I also did that in C++ as part of my WS stuff. I honestly just don't know if I have the time on my hand for that ..
fowlduck has quit [Remote host closed the connection]
<crystal-gh>
[crystal] technorama opened pull request #1589: Make spawn usage consistent with a single way of calling. (master...f/remove_redundant_spawn) http://git.io/vn7Y5
<asterite>
jokke: I guess they should, please open an issue :-)
<crystal-gh>
[crystal] jhass pushed 3 new commits to master: http://git.io/vn7OB
<crystal-gh>
crystal/master cb1016e Jalyna: Add pick and omit for hashes
<crystal-gh>
crystal/master 2613f17 Sdogruyol: Renamed pick/omit to select/reject
<crystal-gh>
crystal/master 3ad6165 Jonne Haß: Merge pull request #1588 from sdogruyol/add-hash-omit-pick...
<crystal-gh>
[crystal] jhass closed pull request #1183: Add pick and omit for hashes (master...add-hash-omit-pick) http://git.io/v39jy
sdogruyol has quit [Remote host closed the connection]
<dzv>
is it possible to timeout on a channel receive similar to go?
<crystal-gh>
[crystal] jreinert opened pull request #1592: add support for polymorphic macro methods (master...polymorphic-macro-methods) http://git.io/vn7Vn
<jokke>
i'd rather have asterite have a look at it though
rmosolgo has joined #crystal-lang
trapped_ has quit [Read error: Connection reset by peer]
<rmosolgo>
Hi! I'm a Ruby developer and I just heard of this project.
<rmosolgo>
Nice work, it looks really cool
<jokke>
rmosolgo: welcome :)
<rmosolgo>
Thanks :)
<jokke>
rmosolgo: a lot of us are
<rmosolgo>
I'm curious, have you ever seen a Crystal -> Ruby "compiler"?
<jokke>
crystal -> ruby?
<rmosolgo>
I'm thinking I would like to try the language, but everything I use is Ruby
<rmosolgo>
yes
<jokke>
ah you mean for gems and such?
<rmosolgo>
so you can develop with type safety & compiling
<rmosolgo>
but expose your project as Ruby to the outside world
<rmosolgo>
yes
<jokke>
hmm no i haven't seen anything like that
<rmosolgo>
(A bit like using FlowTypes for JavaScript, but then removing the type definitions at compile-time)
<jhass>
that's more writing a Ruby "C" ext with Crystal though
<jokke>
ah i see
<rmosolgo>
that's cool, though, similar!
<sfcgeorge>
I think Crystal macros couldn't be transpiled to Ruby. But there is a subset of Crystal that is valid Ruby and vice vera, so a transpiler should be able to expand upon it
<sfcgeorge>
It's something I've wondered about.
<rmosolgo>
yeah
<rmosolgo>
i'm only part way through the docs so ... I guess finishing that would be a good first step :)
<jokke>
rmosolgo: i think the best option for you is to just start coding crystal and port everything you need over when you need it ;)