<Papierkorb>
jwoertink, you can do `Sample.x` - macros behave like a class method in that regard
<FromGitter>
<jwoertink> Oh? hmm.. I had tried that but it threw an error. Maybe the error was related to something else though. I'll give it another shot. Thanks!
sz0 has joined #crystal-lang
<FromGitter>
<drosehn> Might want to put a `{% debug() %}` just before the `end` of your macro to see if it really is producing what you expect it to produce.
<FromGitter>
<jwoertink> What's `debug()`? I haven't seen that yet
<FromGitter>
<jwoertink> Do I need to run with a `--debug` flag or something?
<Papierkorb>
the debug() macro function dumps the output of the macro itself to standard out on compile-time
<Papierkorb>
no need for --debug
<FromGitter>
<jwoertink> oh cool. That will help for sure
olek_poz has quit [Ping timeout: 258 seconds]
<FromGitter>
<drosehn> Note that `{% debug() %}` is only for "seeing inside" macros at compile-time. It isn't related to `--debug`.
bjz has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter>
<jwoertink> You need a space between `client_id` and the `:`
<FromGitter>
<jwoertink> `client_id : String` not `client_id: String`
<FromGitter>
<tekjar> Oh damn. This feels weird. Why did the other non property type declarations work?
<FromGitter>
<jwoertink> You should also add a space after the instance variables, even though the compiler doesn't mind those
<FromGitter>
<jwoertink> because you can't have a : in your instance variable name, so the compiler knew
<FromGitter>
<jwoertink> but with the property name, it doesn't know if you're defining a property, or a hash with symbol keys
<FromGitter>
<jwoertink> and actually, you could get rid of those instance variable declarations since you initialize them with default values https://play.crystal-lang.org/#/r/1p78
bjz has joined #crystal-lang
<FromGitter>
<tekjar> @jwoertink Ohh alright. Thanks a lot :)
<FromGitter>
<jwoertink> :thumbsup:
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cyberarm has joined #crystal-lang
<crystal-gh>
[crystal] Sija opened pull request #4122: Fix typo and NOTE flag in GZIP::Writer doc comment (master...fix-gzip-writer-doc) https://git.io/vyEhh
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
tatey has quit [Ping timeout: 240 seconds]
tatey has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Qchmqs has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
sigipa has joined #crystal-lang
olek_poz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
zaiste has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
olek_poz has quit [Ping timeout: 260 seconds]
_whitelogger has joined #crystal-lang
pawnbox has joined #crystal-lang
olek_poz has joined #crystal-lang
mark_66 has joined #crystal-lang
nickc2 has quit [Ping timeout: 258 seconds]
nickc2 has joined #crystal-lang
gloscombe has joined #crystal-lang
<FromGitter>
<schoening> @sdogruyol i read your 60.000 websocket benchmark. Really impressive for what it is :) but we need a benchmark showing what happens when those people send messages! Server broadcasting and maybe some json manipulation :smile: !!!
<FromGitter>
<schoening> I'm gonna take a look at tsung. I only wish it wasn't xml :worried:
<Qchmqs>
is windows support planned ?
<FromGitter>
<schoening> Yes
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
zaiste has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zaiste has joined #crystal-lang
soveran has quit [Remote host closed the connection]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
Svenskunganka has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
zaiste has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
gloscombe has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
zaiste has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
zaiste has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alxnlssn has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 264 seconds]
zaiste has joined #crystal-lang
<crystal-gh>
[crystal] bcardiff closed pull request #4122: Fix typo and NOTE flag in GZIP::Writer doc comment (master...fix-gzip-writer-doc) https://git.io/vyEhh
pawnbox has joined #crystal-lang
pawnbox_ has quit [Ping timeout: 264 seconds]
zaiste has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 264 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<crystal-gh>
[crystal] Sija opened pull request #4123: Add Crystal::LLVM_VERSION to docs (master...add-crystal-llvm-constant-docs) https://git.io/vyzJp
olek_poz has quit [Ping timeout: 260 seconds]
<FromGitter>
<fridgerator> Is it possible to send an http post request using TLS 1.2? Trying to access Stripe API, won't allow tls 1.x
Qchmqs has quit [Read error: Connection reset by peer]
<FromGitter>
<fridgerator> on OSX
<RX14>
crystal uses openssl
<RX14>
so it depends on your openssl version I would assume
<FromGitter>
<fridgerator> yeah I might have to try and use linux
<FromGitter>
<fridgerator> openssl on mac is old
<FromGitter>
<drosehn> If the user has installed a newer openssl via macports or brew, does crystal use that?
<RX14>
i don't know
<FromGitter>
<fridgerator> I doesn't seem like it
<RX14>
i think if you use brew link or sth but idk
<RX14>
this is why I use linux :)
<RX14>
also lack of money
<FromGitter>
<fridgerator> I just installed openssl 1.0.2k and symlinked to /usr/local/bin, but doesn't seem to work
<FromGitter>
<fridgerator> I've thought about switching back to linux as my main dev machine
<RX14>
well crystal obviously doesn't use the openssl binary
<FromGitter>
<tekjar> @fridgerator So when timeout happen, I should do a n/w write. Is it safe to write again in a different thread using same socket?
<FromGitter>
<tekjar> Especially when TLS is involved where WRITE calls also does READS internally
<RX14>
you can't select on read_bytes
<RX14>
you can set a timeout on the IO
<RX14>
and catch the exception
<RX14>
but that's it
<FromGitter>
<tekjar> So `read_bytes` timeouts after that and I do a n/w write then?
<RX14>
what do you mean n/w
<FromGitter>
<tekjar> Ah sorry. n/w --> network
<FromGitter>
<tekjar> I mean tcp write in this case
<RX14>
you can use an IO from multiple threads
<RX14>
don't timeout the reads, just spawn a seperate fiber
<RX14>
and use that in a loop to send the pings
<RX14>
IO#write calls are atomic as far as I know
<literal>
RX14: crock
<RX14>
so as long as you structure your message as a single IO#write call you'll be fine
<RX14>
literal, hmm
<RX14>
literal, what's your thought process behind the name?
<literal>
doesn't seem to have any technical connotations according to Google
<literal>
RX14: a crock is a container
<literal>
that was the idea
<RX14>
ohh yeah that is indeed a good name
<literal>
crane seemed good too, but there's an open-source project using that name
olek_poz has joined #crystal-lang
<RX14>
hmm
<RX14>
i'll consider both
<RX14>
I thikn creane is easier to get as a name
<literal>
I got both from $(grep ^cr /usr/share/dict/words) :P
<RX14>
that's a very good way to name things
<RX14>
thanks for the idea
<RX14>
I might go with crane as there's no other crystal project called crane
<Papierkorb>
RX14: I have a list of names I get from watching shows or stuff, and when I need one, I most likely pull it from there
<RX14>
heh, i wish I had such a list
<RX14>
I'm always to absorbed in shows to collect names while i'm watching them
<Papierkorb>
Before that I literally said "the first name I hear will be the name of the project" and started a random episode of a series I already watched
<Papierkorb>
it did work to some degree ;)
<RX14>
hah
olek_poz has quit [Ping timeout: 260 seconds]
<RX14>
but yeah, crane will take crystal version from shard.yml as well as .crystal-version, and will be more robust. It'll be able to build crystal and shards from previous releases using only the crystal git repo, and eventually be able to manage entire toolchains for cross-complation
<RX14>
starting with alpine linux for musl libc static compilation support
<RX14>
(hopefully)
<RX14>
thats my goal at least
<FromGitter>
<sdogruyol> what is crane?
<RX14>
@sdogruyol A crenv replacement that i'm about to start working on, @literal gave me a name
<FromGitter>
<sdogruyol> that'd be lovely
<FromGitter>
<sdogruyol> crenv is good but causes lots of hard to debug problems
<RX14>
indeed
<RX14>
i'm going to write it in mostly crystal with some small bits of bash for shell integratiion
<RX14>
probably will have a look at rustup for inspiration too
<FromGitter>
<sdogruyol> i love rustup
<FromGitter>
<sdogruyol> it's grown so big now one can easily cross-compile with it
<RX14>
i've never used it myself
<RX14>
or rust much
<RX14>
maybe you can help out with crane suggestions if you've used rustup :)
<FromGitter>
<sdogruyol> i've started using it when rust was in best in 2015
<FromGitter>
<sdogruyol> it was just there to easily install and switch between versions
<FromGitter>
<sdogruyol> 2 years later it's like the official way to install rust and cross-compile stuff
<FromGitter>
<sdogruyol> and back in the days it was just some shell scripts :P
<RX14>
I'd have liked a little less magic, but in terms of functionality it looks awesome
pawnbox has quit [Ping timeout: 268 seconds]
<FromGitter>
<bcardiff> Cool, we reach the point of "yet another" :-)
<FromGitter>
<tekjar> Hi. I'm thinking about design of my mqtt client library where I need to do `Tcp read`, `Tcp write` and `Ping` concurrently. `Read` should indefinitely run and `Writes` happen when user (through api) want to publish data (which will be alot sometimes).
<FromGitter>
<tekjar> That is how I'm doing `read` and `pings` now
<FromGitter>
<tekjar> I'm planning write on a different fibre and take user requests through a channel
<FromGitter>
<tekjar> Is this tcp read write dance of large data from different fibres (on same socket) safe?
<RX14>
as long as your protocol is stateless wrt ping and you keep your writes atomic that should work
<FromGitter>
<tekjar> RX14: Can you please explain about atomic writes
<RX14>
when you call write_bytes, it's going to write the whole data or error
<RX14>
it won't mix up the data
<RX14>
if there are 2 write calls at the same time
<RX14>
(iirc)
<RX14>
but if your protocol can't handle a "ping message" at any time after startup, you might have problems
<RX14>
for example if there's two-way negotiation
<FromGitter>
<tekjar> The fibre won't context switch and start reading in between?
<RX14>
it could start reading
<RX14>
the write and read calls themselves can interleave however they want
<FromGitter>
<tekjar> Ohhh
<RX14>
but write("foo") and write("bar") will always be foobar or barfoo, not fbooar
<RX14>
i.e. messages won't get corrupted
<RX14>
that's the only guarantee you have
<RX14>
if you have difficulty, you could have a central writer fiber, and then a fiber which just queues a ping command
<FromGitter>
<tekjar> Ohh thanks. Mqtt doesn't expect pings when there is something available to write. This clears my doubt. Thanks :)
<RX14>
yeah you're going to have to do something else than that then
<FromGitter>
<tekjar> I'm asking this question because I remember reading about some issue in rust when sharing a socket across multiple threads when TLS is involved. I'll try to find that
<RX14>
crystal doesn't technically have multiple threads
<RX14>
(not yet)
<FromGitter>
<tekjar> But they will right?
<RX14>
maybe
<RX14>
well
<RX14>
no
<RX14>
yes
<RX14>
they will
<RX14>
it'll be a huge change
<RX14>
everything will subtly break
<RX14>
we'll never release in 2017
<RX14>
maybe end of '18
Raimondi has joined #crystal-lang
<FromGitter>
<tekjar> So not in 1.0?
<RX14>
it'll be in 1.0
<RX14>
i'm just saying 1.0 in 2017 is unrealistic given we havent implemented parellism yet
<FromGitter>
<tekjar> Ohh.. ok
<FromGitter>
<tekjar> Anyway..Here is the issue where rust sslstream was talking about races when trying to share sockets
<FromGitter>
<bcardiff> Just a heads up, ggiraldez and others are working in parellism :-) there is a branch for that. Still WIP. It is the next big feature we aim to.
pawnbox has quit [Ping timeout: 260 seconds]
<FromGitter>
<sdogruyol> @RX14 why not 2017
<FromGitter>
<sdogruyol> @bcardiff yup i'm closely following it :P
<RX14>
because parallelism isn't easy
<FromGitter>
<sdogruyol> any planned date for that
<FromGitter>
<sdogruyol> @RX14 agreed but it's not impossible
<FromGitter>
<sdogruyol> just takes time
<RX14>
no
<RX14>
it's not impossible
<RX14>
but once it's feature complete it's still going to take a long time to be production-ready
<RX14>
getting it working is only half the problem
<RX14>
concurrency code is really hard and it's not going to be possible to run the parallelism code long enough in production to iron remotely enough of the bugs out to release 1.0
<RX14>
before the end of 2017
<FromGitter>
<sdogruyol> IMHO it doesn't have to be perfect in every way to be in 1.0
<FromGitter>
<bcardiff> But it need to be usable :-). We will do our best with the available resources and the community support to reach out goals. We don't have a crystal ball of course.
<RX14>
it doesn't have to be perfect for sure, but I would never feel comfortable releasing 1.0 without crystal being used in production at a large scale for a few months
<RX14>
and I don't think it's realistic to do that before the end of 2017
<FromGitter>
<sdogruyol> @bcardiff yep, usable is good enough
<RX14>
usable is pretty objective
<FromGitter>
<sdogruyol> @RX14 you may be right but let's not keep our hopes low
<BlaXpirit>
it's just funny to me cuz i saw such words in #nim 2 years ago
<RX14>
both sides BlaXpirit?
<RX14>
nim isn't 1.0 yet is it
<BlaXpirit>
it is not
<FromGitter>
<sdogruyol> nim was a failure in that way
<BlaXpirit>
but meh, it's so convoluted it's beyond fixing
<RX14>
nim?
<BlaXpirit>
yes
<RX14>
i've not followed it
<RX14>
what happened to it
<BlaXpirit>
nothing really, it's just weird and has few people joining and the same amount leaving
<RX14>
hmm
<RX14>
well it's quite a fine balance I think on when to release 1.0
<RX14>
too late and the language/community runs out of stream
<RX14>
and dies
<FromGitter>
<sdogruyol> thats what happened with nim yes
<RX14>
too early and it's branded as "buggy" and "incomplete", or we have to release 2.0 within the year
<RX14>
so objectively, releasing too early is the better option
<RX14>
it also depends on how much traction and support you have before 1.0
<RX14>
for example rust, it had mozilla resources (not going to die) so could wait until it was 99% ready to release 1.0
<FromGitter>
<sdogruyol> @RX14 Rust did release very very early and they do release really fast with 6 weeks cycle
<FromGitter>
<sdogruyol> yeah was just gonna say that lol
<dom96>
sdogruyol: citation needed :P
<FromGitter>
<sdogruyol> @dom96 oh wow it's great to have a nim contibutor here :)
<FromGitter>
<crisward> Do what node did, go 8 years, then go from version v0.11 to v4 overnight. That didn't confuse anyone. :smile:
<FromGitter>
<sdogruyol> Hahaha
<FromGitter>
<sdogruyol> IMHO people doesn't care about the version numbers
<FromGitter>
<sdogruyol> If it gets "shit done" they're ok with it. This is proven with PHP and Node already
<FromGitter>
<crisward> I think if I want to convince customers we want to build their next product in a language, a v1 would make them feel more confident.
<FromGitter>
<sdogruyol> yeah that's if they are really interested
bjz has joined #crystal-lang
<FromGitter>
<crisward> Talking of naming, I like to do a crystal module called "Dilithium", just 'cos the geek in me thinks it'd be cool to do it in crystal. I've no idea what it'd do, but it'd be fast...