ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.33.0 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
ur5us has quit [Ping timeout: 246 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Quit: Leaving]
ur5us has joined #crystal-lang
watzon has joined #crystal-lang
gangstacat has quit [Ping timeout: 272 seconds]
gangstacat has joined #crystal-lang
ur5us has quit [Ping timeout: 246 seconds]
early has quit [Quit: Leaving]
early has joined #crystal-lang
postmodern has quit [Quit: Leaving]
ur5us has joined #crystal-lang
_ht has joined #crystal-lang
tdog has joined #crystal-lang
ur5us has quit [Ping timeout: 246 seconds]
adam12_ has joined #crystal-lang
dom96 has quit [*.net *.split]
adam12 has quit [*.net *.split]
dom96 has joined #crystal-lang
daemonwrangler has quit [Quit: ZNC 1.6.5 - http://znc.in]
daemonwrangler has joined #crystal-lang
<FromGitter> <securefab_gitlab> Hello
<FromGitter> <securefab_gitlab> I'm trying to build a secure web server. When I'm testing my crystal server with testssl.sh, I have the following vulnerability : "Secure Client-Initiated Renegotiation VULNERABLE (NOT ok), DoS threat". Any idea ?
<jhass> no idea but I would guess if you google for that error and look for a solution for OpenSSL in C it'll be something we probably can adapt
<FromGitter> <dscottboggs_gitlab> @securefab_gitlab could you post some example code?
<FromGitter> <securefab_gitlab> Here you go : ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e7216ead7ed052d75d37304]
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 264 seconds]
flaviodesousa has quit [Quit: KVIrc 4.9.3 Aria http://www.kvirc.net/]
adam12_ has quit [Ping timeout: 246 seconds]
cloaked1 has quit [Ping timeout: 246 seconds]
adam12_ has joined #crystal-lang
<FromGitter> <stronny> this is not a security issue https://nvd.nist.gov/vuln/detail/CVE-2011-1473
<FromGitter> <stronny> you may try to turn off reneg, but that may also be problematic https://www.openssl.org/docs/man1.1.0/man3/SSL_get_secure_renegotiation_support.html
return0e_ has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
travis-ci has joined #crystal-lang
<travis-ci> crystal-lang/crystal#e8e3a8d (master - Unicode: update to version 13.0.0 (#8906)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/663964522
travis-ci has left #crystal-lang [#crystal-lang]
<DeBot> https://github.com/crystal-lang/crystal/pull/8906 (Unicode: update to version 13.0.0)
_whitelogger has joined #crystal-lang
postmodern has joined #crystal-lang
<FromGitter> <securefab_gitlab> @stronny thank you
HumanG33k has joined #crystal-lang
HumanGeek has quit [Read error: Connection reset by peer]
<FromGitter> <wout> Is there a Percent Tuple literal? Just like `%w[one, two three]`?
<FromGitter> <Blacksmoke16> `{one, two, three}`?
<FromGitter> <Blacksmoke16> tada?
<FromGitter> <stronny> `{"one", "two", "three"}` though
alexherbo2 has joined #crystal-lang
<FromGitter> <wout> Was just about tho say...
<FromGitter> <stronny> idk, try a macro
<FromGitter> <wout> `Error: undefined local variable or method 'one' for top-level`
<FromGitter> <Blacksmoke16> ah, i was thinking they were variables
<FromGitter> <wout> No, that's an array of strings.
<FromGitter> <Blacksmoke16> yea, would have to use a macro since tuples need to be known at compile time
<FromGitter> <wout> Ok, thanks!
<FromGitter> <j8r> ?
<FromGitter> <j8r> The initial question was is there a percent literal @Blacksmoke16
<FromGitter> <j8r> I don't see how it is not possible
<FromGitter> <Blacksmoke16> right, and there isnt
<FromGitter> <stronny> macros wouldn't allow space delimited list
<FromGitter> <Blacksmoke16> could pass it as one big string and split but meh
<FromGitter> <Blacksmoke16> whats the context you need this for @wout ?
<FromGitter> <wout> I was just wondering if it exists.
<FromGitter> <stronny> ```macro t(node) ⏎ {{ pp! node }} ⏎ end ⏎ t(a b c)``` [https://gitter.im/crystal-lang/crystal?at=5e724ee4ba395549660308fc]
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <stronny> that works, but `t(1 2 3)` doesn't
<FromGitter> <wout> I use percent literals quite often with arrays.
<FromGitter> <Blacksmoke16> just to be clear a tuple is not equivalent to an array, like you cant add/remove/change elements in it
<FromGitter> <wout> Yes, I know. But `%t{one two three}` would be nicer than `{"one", "two", "three"}, especially if they are quite longer.
<FromGitter> <Blacksmoke16> true
<FromGitter> <j8r> Simple helper: ⏎ ⏎ ```macro t(*args) ⏎ {{ args.map &.stringify }} ⏎ end ⏎ ⏎ p t a, b, c #=> {"a", "b", "c"}``` [https://gitter.im/crystal-lang/crystal?at=5e724fce7bba3a76f6291361]
<FromGitter> <stronny> commas
<FromGitter> <stronny> also `t` is an unfortunate "call" for a global namespace
<FromGitter> <j8r> right
<FromGitter> <stronny> I guess the only way is to patch the lexer-parser
<FromGitter> <wout> @stronny I agree on `t`.
<FromGitter> <j8r> @wout generally, if the Tuple is too big - use macros to build it
<FromGitter> <stronny> if the tuple is too big consider using records
<FromGitter> <Blacksmoke16> there is a limit on tuple size as an fyi
<FromGitter> <Blacksmoke16> like 200 iirc
<FromGitter> <j8r> yep
<FromGitter> <j8r> same for ivars, generate them with a macro if too much
<FromGitter> <wout> True.
<FromGitter> <sam0x17> hmm so I have a line that is like `MY_CONST = {{read_file("path/in/my/repo.txt")}}` and it is working fine in the actual shard but when I try requiring the shard in other shards it fails -- saying it can't find the file -- how to fix?
<FromGitter> <Blacksmoke16> what if you do `"#{__DIR__}..."`?
<FromGitter> <sam0x17> I'll try that
renich has joined #crystal-lang
chachasmooth has quit [Ping timeout: 260 seconds]
<FromGitter> <sam0x17> that worked, thanks @Blacksmoke16 !
chachasmooth has joined #crystal-lang
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <stronny> why do you need it?
adam12_ is now known as adam12
<FromGitter> <jwoertink> I'm trying to access this `OPT` constant here. Anyone see what I might be missing?
renich_ has joined #crystal-lang
<FromGitter> <jwoertink> same error if I just do `OPT`
renich has quit [Ping timeout: 250 seconds]
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/8qf9
<FromGitter> <Blacksmoke16> need to escape your macro since its in a macro
<FromGitter> <jwoertink> yeah, I just remembered that 😅 for some reason that just doesn't ever come to mind
<FromGitter> <Blacksmoke16> also might need a `macro finished`
<FromGitter> <jwoertink> thanks
renich has joined #crystal-lang
renich_ has quit [Ping timeout: 250 seconds]
travis-ci has joined #crystal-lang
<travis-ci> crystal-lang/crystal#edcad42 (master - Avoid using the default --exclude-warnings value if some is specified (#8899)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/664045486
travis-ci has left #crystal-lang [#crystal-lang]
<DeBot> https://github.com/crystal-lang/crystal/pull/8899 (Avoid using the default --exclude-warnings value if some is specified)
<FromGitter> <jwoertink> The `@[AlwaysInline]` annotation means that everything inside of that method is basically placed in the spot it's called, right?
<FromGitter> <stronny> that's my understanding
<FromGitter> <jwoertink> Is that a performance boost or compile speed increase?
<FromGitter> <stronny> you should rarely need to control for that manually
<FromGitter> <jwoertink> but it doesn't really tell me why it even exists
<FromGitter> <jwoertink> I figured maybe it's like a secret performance boost or something
<FromGitter> <stronny> there are no secret performance boosts
chachasmooth has quit [Ping timeout: 246 seconds]
<FromGitter> <stronny> there are secret performance pits
<FromGitter> <jwoertink> oh. So it's actually bad to do it?
<FromGitter> <stronny> no
chachasmooth has joined #crystal-lang
<FromGitter> <stronny> I mean it's bad to use something in an unsuitable fashion
<FromGitter> <stronny> if you want to dig around, basically that's a way to avoid a CALL-RET pair
<FromGitter> <jwoertink> what would be considered a suitable use for that annotation?
<FromGitter> <stronny> one of the worst programmers' sins is premature optimization
<FromGitter> <jwoertink> I'm not sure what any of that document says
<FromGitter> <stronny> don't bother with inlining
<FromGitter> <stronny> compiler should do that for you anyway
<FromGitter> <naqvis> that is simply a hint to llvm compiler and there is no guarantee that function you annotated get inline if its missing the pre-requisites. To get better insights on its purpose and usage, take a look at LLVM docs
<FromGitter> <jwoertink> Oh, so that's a LLVM thing, and not a crystal thing
<FromGitter> <naqvis> yeah
<FromGitter> <jwoertink> Ok, that answers my question. Thanks
<FromGitter> <naqvis> ywc
<FromGitter> <wout> @jwoertink I was actually wondering about the same today. Thanks for asking. 😄
<FromGitter> <jwoertink> Yeah. I just want to understand the language a bit better. I don't know C or LLVM at all, so I see these weird things and have no clue what they mean.
<FromGitter> <sam0x17> is there a be_less_than (or something) `Spec` thing that I'm missing somewhere or should I just assert that the inequity `eq true`?
<FromGitter> <wout> @jwoertink I'm the same boat.
<FromGitter> <Blacksmoke16> @sam0x17 you should be able to do like
<FromGitter> <Blacksmoke16> `val.should be < 10`
<FromGitter> <stronny> @wout @jwoertink I would advise writing a nontrivial C program
<FromGitter> <wout> @stronny That might be a good idea.
<FromGitter> <stronny> or maybe trying to just read a C faq
<FromGitter> <wout> I've learend a lot since I started using Crystal (coming from Ruby).
<FromGitter> <wout> Learning a bi of C won't hurt.
<FromGitter> <stronny> C language isn't the point
<FromGitter> <stronny> you'll have to come to terms with hardware like memory
<FromGitter> <stronny> C just exposes that in a ubiquitous way
<FromGitter> <wout> That's exactly what I learend most about.
renich has quit [Ping timeout: 246 seconds]
renich has joined #crystal-lang
renich has quit [Ping timeout: 256 seconds]
renich_ has joined #crystal-lang
chachasmooth has quit [Ping timeout: 256 seconds]
HumanG33k has quit [Remote host closed the connection]
chachasmooth has joined #crystal-lang
HumanG33k has joined #crystal-lang
ur5us has joined #crystal-lang
<FromGitter> <sam0x17> anyone know how to get (insert ORM here) to local development postgres the way rails does -- I have a user role set up with passwordless login, however all the ORMs in crystal are giving me `Unhandled exception: (no message) (DB::ConnectionRefused)`
<FromGitter> <Blacksmoke16> is there some query param you can add to the connection string?
<FromGitter> <sam0x17> I'm just doing `Clear::SQL.init("postgres://#{ENV["USER"]}@localhost/kagi_development", connection_pool_size: 5)`
ua has quit [Quit: Leaving]
ua has joined #crystal-lang
renich has joined #crystal-lang
renich_ has quit [Ping timeout: 256 seconds]
<FromGitter> <hugolgst> Hi
<FromGitter> <hugolgst> I would like to contribute to crystal
<FromGitter> <hugolgst> but I don't really know where to begin
<FromGitter> <hugolgst> what to do on the language
blackbeard420 has quit [Quit: ZNC 1.7.5 - https://znc.in]
blackbeard420 has joined #crystal-lang
tdog has quit [Ping timeout: 246 seconds]
<FromGitter> <sam0x17> @hugolgst a great way is to just work on personal projects and when you find something in the standard library that seems missing or annoying talk to people on gitter and maybe submit a pull request
<FromGitter> <sam0x17> I've got several changes in that way
chachasmooth has quit [Ping timeout: 250 seconds]
_ht has quit [Quit: _ht]
chachasmooth has joined #crystal-lang
<FromGitter> <sam0x17> ok guys what's a good ORM these days
<FromGitter> <sam0x17> my wishlist: a CLI for migrations (i.e. like rake db:migrate etc), only need to support postgresql, as rails-like as possible
<FromGitter> <sam0x17> doesn't have to be an ORM maybe just a migration system
renich has quit [Ping timeout: 264 seconds]
renich has joined #crystal-lang
<FromGitter> <Blacksmoke16> why not just use like micrate and write the raw SQL?
renich has quit [Ping timeout: 250 seconds]
<FromGitter> <Blacksmoke16> should try out some Athena @sam0x17 😉
renich has joined #crystal-lang
<FromGitter> <sam0x17> I might go micrate for that
<FromGitter> <sam0x17> is it micrate or migrate these days wasn't one more up to date?
<FromGitter> <sam0x17> and yeah I'll try Athena
<FromGitter> <Blacksmoke16> not sure, not super familiar with either
<FromGitter> <Blacksmoke16> and nice :) i invited you to the gitter ch. Feel free to ask any questions etc
<FromGitter> <sam0x17> ok thanks!