ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.1 | 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
<cerulean> how long do you think before the mainstream tech picks up crystal?
<cerulean> i want to do crystal professionally
<crystal-gh> [crystal] asterite opened pull request #5036: Parser: error on duplicate case when condition (master...feature/case-when-repeated) https://git.io/vdIMf
<FromGitter> <fridgerator> minimum 2 years
<FromGitter> <fridgerator> j/k, i dont nkow
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
weston1 has quit [Ping timeout: 260 seconds]
weston1 has joined #crystal-lang
<cerulean> id agree tho
weston1 has quit [Ping timeout: 248 seconds]
snsei has joined #crystal-lang
hightower4 has quit [Ping timeout: 240 seconds]
weston1 has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <GavinRay97> I'm a fullstack React/Vue + Ruby/Rails dev
<FromGitter> <GavinRay97> been looking at Crystal recently
<FromGitter> <GavinRay97> how hard would it be to port a Rails API to a Crystal project?
<FromGitter> <faustinoaq> @GavinRay97 We have been working on Amber, it is very similar to Rails and is in active development, take a look https://amberframework.org/
<FromGitter> <faustinoaq> Also if you like something minimalist like Sinatra you can try http://kemalcr.com/
weston1 has quit [Ping timeout: 240 seconds]
<FromGitter> <GavinRay97> @faustinoaq Thanks! I'm looking for the most lightweight API-only setup with simplistic syntax, essentially.
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <faustinoaq> 👍
<FromGitter> <faustinoaq> Papierkorb, qt5.cr is amazing ✨
<FromGitter> <faustinoaq> https://github.com/Papierkorb/qt5.cr
<FromGitter> <faustinoaq> ((https://i.imgur.com/hn732uD.gif "Amazing!"))
weston1 has joined #crystal-lang
weston1 has quit [Ping timeout: 252 seconds]
<FromGitter> <faustinoaq> Hi @bcardiff Can you check https://github.com/bcardiff/crolog/pull/2 ? I think this PR is mergeable I tested on latest crystal version.
weston1 has joined #crystal-lang
<FromGitter> <ekremkaraca> Morning 🌄👋
weston1 has quit [Ping timeout: 246 seconds]
<FromGitter> <faustinoaq> Morning 🙋
snsei has quit [Remote host closed the connection]
<FromGitter> <bararchy> Morning all
snsei has joined #crystal-lang
A124 has quit [Ping timeout: 240 seconds]
A124 has joined #crystal-lang
<FromGitter> <imonmyown> morning guys
alex`` has joined #crystal-lang
alex`` is now known as alexherbo2
alexherbo2 is now known as alex``
_whitelogger has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <bararchy> @faustinoaq that's really cool
rohitpaulk has joined #crystal-lang
Papierkorb_ has joined #crystal-lang
<FromGitter> <bararchy> What's the syntax for method alieas ?
<FromGitter> <bararchy> or is it only for types ?
<Groogy> Morning!
<Papierkorb_> Morning
<Papierkorb_> bararchy, only type aliases. Method aliases are frowned upon. If you meant a delegator, you can use the delegate macro `delegate foo, bar, baz, to: @something`
<FromGitter> <bararchy> I just want to have two names for the same method , let's say I have `.destory`, and I want it to respond to `.close` too, and doing ⏎ ⏎ ```def close ⏎ destory ⏎ end``` ⏎ ⏎ is a little ugly [https://gitter.im/crystal-lang/crystal?at=59c9fe93cfeed2eb654ec47f]
mark_66 has joined #crystal-lang
<Groogy> huh what does the delegate macro do exactly? Not seen that before
<Groogy> also @bararchy a good question would be why do you want two symbols to correspond to the same functionality?
<FromGitter> <bararchy> so that I can conform with the original lib, and also the languge standards
<FromGitter> <bararchy> :)
<Groogy> #destroy is sometihng I usually associate with resources while #close would be something like IO or a window
<Groogy> ah
<Yxhuvud> groogy: it forwards a method call to whatever it delegates to
<Groogy> so it would forward foo.bar to @something.bar?
<Groogy> foo.@something.bar
<Papierkorb_> yes
claudiuinberlin has joined #crystal-lang
<Papierkorb_> bararchy, it looks ugly because aliases are ugly
<Papierkorb_> Ruby has been burnt by it, its stdlib is full of aliases. It sucks.
<Yxhuvud> I kinda like it. YMMV.
<FromGitter> <bararchy> is there a way I can know if an object is being called from the main Fiber or from another spawn ?
balduin has quit [Remote host closed the connection]
<FromGitter> <bararchy> So, started working on TensorFlow bindings for Crystal, if anyone want's to join in: https://github.com/NeuraLegion/tensorflow.cr, it's MIT licensed ofc
<FromGitter> <imonmyown> @bararchy not sure I can be of help, but if I can let me know how
<FromGitter> <imonmyown> sorry, didn't get to `Contributing` section
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <bararchy> :) @imonmyown you can see what is under development, just pick something you want to add, see the referances, and PR
claudiuinberlin has joined #crystal-lang
<FromGitter> <imonmyown> Ok, got it :)
rohitpaulk has quit [Ping timeout: 248 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
DeBot has quit [Ping timeout: 240 seconds]
cerulean has quit [Ping timeout: 255 seconds]
jhass has quit [Ping timeout: 255 seconds]
asterite has quit [Ping timeout: 252 seconds]
asterite has joined #crystal-lang
jhass has joined #crystal-lang
DTZUZO has quit [Ping timeout: 246 seconds]
voloyev has joined #crystal-lang
voloyev has quit [Quit: WeeChat 1.9.1]
voloyev has joined #crystal-lang
<FromGitter> <imonmyown> I don't seem to be able to assign to an element of a newly allocated array ⏎ ⏎ ``` prefix = Array(Int32).new(arr.size.as Int) ⏎ prefix[0] = 1``` ⏎ ⏎ Getting Index out of bounds... [https://gitter.im/crystal-lang/crystal?at=59ca1cdbbc4647297477c00d]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Papierkorb_> As expected. That array is empty. Though your snippet looks like you can #map from it. Otherwise, you can set the initial value to pre-fill the array to the given size.
cerulean has joined #crystal-lang
hightower2 has joined #crystal-lang
<jokke> i was just playing around with crystal to expose c functions to create dynamic libraries
<jokke> for c
<jokke> but i ran into my first problem: crystal redefines main
<jokke> can i circumvent this?
bmcginty has quit [Ping timeout: 255 seconds]
<jokke> Papierkorb_: your into this low level stuff, any ideas? :)
bmcginty has joined #crystal-lang
<Papierkorb_> jokke: It has since been broken, the `empty` prelude began to ship with a `fun main` recently. There's also now way (afaik) to remove a `fun` after defining it somewhere. You can get around this by carefully writing a custom prelude which doesn't `require` anything defining the main()
<Papierkorb_> jokke: Got it.
<Papierkorb_> Hang on..
hightower2 has quit [Ping timeout: 248 seconds]
hightower2 has joined #crystal-lang
<Papierkorb_> Have a look at the real main implementation however, as you'll want to start the garbage collector etc.
<FromGitter> <asterite> We can probably have a flag to not generate main, for example NO_MAIN. But dynamic libraries are very limited right now. For example `is_a?` won't work well.
<Papierkorb_> asterite, I think that would be a useful thing to have. Not for the many, but for the some :)
Qchmqs__ has joined #crystal-lang
<Papierkorb_> No idea about embedded systems, but I can imagine those needing some early configuration before the C code would jump into Crystal-land (and thus, its main)
Qchmqs__ is now known as Qchmqs
<FromGitter> <bew> Nice gist Papierkorb!
<FromGitter> <bew> What do you mean by removing a fun after its definition? How?
hightower2 has quit [Ping timeout: 240 seconds]
<Papierkorb_> bew, there's no`undef_fun` functionality in the language (or the like), which would let you to get rid of the `main()`.
hightower2 has joined #crystal-lang
<Papierkorb_> Not that I want that feature, a --no-main or `--flag NO_MAIN` would be ideal
<jokke> yeah that'd be great
<jokke> and also easy to implement
<Papierkorb_> custom flags would be kinda neat though *cough*
<jokke> well you could just use NO_MAIN=1 ...
<FromGitter> <bew> Oh okay I understood there was a way (you said "there's now way" instead of "no way"! )
<jokke> and then {% if env("NO_MAIN") %}
<jokke> or something similar
<FromGitter> <bew> undef_fun is more interesting than using flags I think
<Papierkorb_> While possible, I'd prefer an "official" solution. Especially as IMHO it would be a nightmare if the stdlib would rely on such ENV checks
<FromGitter> <bew> @asterite what is the issue with `is_a?`, do you mean that multiple Crystal libs will have th ossue that 2 different types may have the same type id?
<Papierkorb_> asterite, is the system configuration somehow exposed as string to the compiled program? Doing that isn't great: https://github.com/Papierkorb/bindgen/blob/next-gen/src/bindgen/config_reader/variables.cr#L20
Qchmqs__ has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
Qchmqs has quit [Ping timeout: 260 seconds]
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 255 seconds]
hightower4 has joined #crystal-lang
hightower3 has quit [Ping timeout: 240 seconds]
hightower3 has joined #crystal-lang
hightower4 has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
hightower3 has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
Qchmqs__ is now known as Qchmqs
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vdLPx
<crystal-gh> crystal/master 2eca01b Faustino Aguilar: Fix example of hexadecimal sequence (#5032)...
hightower2 has joined #crystal-lang
sz0 has joined #crystal-lang
<FromGitter> <ziprandom> @sdogruyol hey is there a way to make kemal stop complaining about command line opts it doesn't know?
hightower3 has joined #crystal-lang
<FromGitter> <bew> For https://github.com/crystal-lang/crystal-book/pull/119 he's trying to merge `master` to `gitbook-3` is it really what should happen? (@asterite @mverzilli) What is this `gitbook-3` branch for?
hightower2 has quit [Ping timeout: 248 seconds]
<FromGitter> <ziprandom> @sdogruyol found it already ..
<FromGitter> <mverzilli> good catch! that's a pretty old branch that Brian used to update gitbook deps
<FromGitter> <mverzilli> I'll kill that branch
<FromGitter> <mverzilli> thanks @bew !
<59NAA20C1> [crystal] ysbaddaden closed pull request #4894: Merge SecureRandom into Random and Random::Secure (master...std-merge-secure-random-into-random) https://git.io/v5GtY
<17SAAOSDC> [crystal] ysbaddaden pushed 3 new commits to master: https://git.io/vdLMW
<17SAAOSDC> crystal/master 27684db Julien Portalier: Merge SecureRandom into Random and Random::Secure...
<17SAAOSDC> crystal/master 79d0358 Oleh Prypin: Reimplement random_bytes to be consistent with endianness
<17SAAOSDC> crystal/master 78b4355 Julien Portalier: Merge pull request #4894 from ysbaddaden/std-merge-secure-random-into-random...
<FromGitter> <bew> you're welcome, I've had issues like this with people new to git(hub) lately, I saw that coming ^^
hightower3 has quit [Ping timeout: 248 seconds]
<FromGitter> <bew> @mverzilli you mistyped the branch in your comment on the PR: `github-3` => `gitbook-3`
<travis-ci> crystal-lang/crystal#2eca01b (master - Fix example of hexadecimal sequence (#5032)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/279948114
voloyev has quit [Quit: WeeChat 1.9.1]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #2634: Merge named tuples (master...merge_named_tuples) https://git.io/vra0e
<travis-ci> crystal-lang/crystal#78b4355 (master - Merge pull request #4894 from ysbaddaden/std-merge-secure-random-into-random): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/279953205
<FromGitter> <eliasjpr> What you guys think ;)
<FromGitter> <Fanna1119> how would i get the value of items inside a 2d kind of a hash array, i honestly don't even know what terminology to use :D ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59ca579c177fb9fe7e046636]
<FromGitter> <bew> @eliasjpr 👍
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <eliasjpr> Im ordering a set of them :)
<FromGitter> <bew> @eliasjpr I was thinking about one with big logo on the back (with Crystal written under) (with my pseudo at the top! ^^) on a little <logo + Crystal> on the front left, but those a great start! :p
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
hightower2 has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
Philpax has joined #crystal-lang
ShalokShalom_ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 252 seconds]
ShalokShalom has quit [Ping timeout: 252 seconds]
<FromGitter> <asterite> `content[:lists].as(Array)`
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
rohitpaulk has quit [Ping timeout: 248 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
<FromGitter> <Fanna1119> @asterite Awesome! Thank You!! :)
Papierkorb_ has quit [Quit: Konversation terminated!]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Qchmqs has quit [Quit: Konversation terminated!]
sp4rrow has joined #crystal-lang
rohitpaulk has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Philpax has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #crystal-lang
rohitpaulk has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <ansarizafar> If a method name is stored in a variable how can I run it?
<FromGitter> <bew> you can't
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <jwaldrip> Crystal is not as meta as ruby.
claudiuinberlin has joined #crystal-lang
<FromGitter> <jwaldrip> @ansarizafar can you provide an example?
<FromGitter> <ansarizafar> After making an unsuccessful attempts of storing a proc in a Hash without specifying return type. Now I am trying to store a class method in a Hash so that I can later run it. ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=59ca739eb59d55b8233c9a93]
<FromGitter> <ansarizafar> > After making several unsuccessful attempts of storing a proc in a Hash without specifying return type. Now I am trying to store a class method in a Hash so that I can later run it.
<FromGitter> <ansarizafar> Like that ⏎ store[key] = User.list
<FromGitter> <ansarizafar> how can I run list method which is store in a hash
<FromGitter> <bew> do you need to pass arguments to thoses methods when calling them?
<FromGitter> <ansarizafar> yes
<FromGitter> <bew> are they known when you add the method to the hash?
<FromGitter> <ansarizafar> no
<FromGitter> <asterite> case key; when "list" then User.list; etc.
<FromGitter> <ansarizafar> I want to make it generic. Is there any syntax that I can use to run the method stored in has directly.
<FromGitter> <jwaldrip> Can the proc/method return any type?
<FromGitter> <ansarizafar> Ideally I would like to store a proc block in has without specifying return type as return type is not known in advance, but I think its not possible.
<FromGitter> <jwaldrip> If you know what the possible types could be you could store them in a union
<FromGitter> <ansarizafar> Like that ⏎ ⏎ ```@@store = {} of String => (Hash(String, JSON::Type) -> _)``` [https://gitter.im/crystal-lang/crystal?at=59ca75e27b7d98d30d3b2de3]
<FromGitter> <jwaldrip> or, let me ask a question... do you expect your method to always return something?
<FromGitter> <jwaldrip> Or are you just trying to invoke a method that may void?
<FromGitter> <bew> @ansarizafar do you need the return value?
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <ansarizafar> yes, It could be a NameTuple or an Array Of NamedTuples
<FromGitter> <jwaldrip> So use a union
<FromGitter> <ansarizafar> Yes I need return value
<FromGitter> <jwaldrip> If you know the various return types, just set it up as a union
<FromGitter> <ansarizafar> Return types are not known in advance. Namedtuple will be generated with the fields return from Postgre Db depending on the query.
<FromGitter> <Willamin> Hi everyone! I've got an absolutely crazy question for you. I want to reopen the Integer structs and add a macro def that throws a compile time exception based on the value of the Integer. I can't find a definitive list of macro variables such as `@type` and `@def`. Can anyone here help?
<FromGitter> <bew> throw a compile time error when doing what @Willamin ?
DTZUZU has quit [Quit: WeeChat 1.9]
<FromGitter> <Willamin> Contrived example: I'd like to add a `.is_this_a_0_at_compile_time` to Integers that throws a compile time error if it's called on a non-zero integer
<FromGitter> <Willamin> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59ca7747f7299e8f5374d8b3]
<FromGitter> <bew> how is this supposed to be used?
DTZUZU has joined #crystal-lang
<FromGitter> <ansarizafar> Here is my current code ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59ca77a632fc8b7e40415526]
<FromGitter> <bew> The syntax you ask is not possible because macros are not methods with a receiver, they're on the class/module/top level, not instance level, but you could have `is_this_a_0_at_compile_time(0)` quite easily
<FromGitter> <ansarizafar> Here is User class ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59ca77ebf7299e8f5374dce8]
<FromGitter> <Willamin> @bew even when it's a macro on a literal struct like an Int32?
<oprypin> eliasjpr, do u have rights to sell Crystal logo?
<FromGitter> <bew> yes, if you write a macro in `Int32`'s struct, you'll be able to call it as `Int32.my_macro` or just `my_macro` when called in the scope of the `Int32` struct
<Papierkorb> William, how should the program know at compile-time, which run-time value the integer will have?
<Papierkorb> Crystal isn't a time machine
<FromGitter> <bew> \o/
<FromGitter> <Willamin> hahaha
claudiuinberlin has joined #crystal-lang
<Papierkorb> A method that takes an integer (or anything) as argument doesn't know if it was passed in as literal or through an variable (or ...), if that's what you mean.
<FromGitter> <Willamin> I was hoping that I would also be able to tell if the *macro* was called from a literal (eg. `0.is_this_a_0_at_compile_time`) vs called from a variable (eg. `x.is_this_a_0_at_compile_time`),
<Papierkorb> No, as a macro is state-less, you can't call it like a member method.
<FromGitter> <bew> @Willamin https://carc.in/#/r/2sqz
<Papierkorb> But a macro, if you pass it as argument to it, can know if it's a literal or not, and then could signal an error to the user
<FromGitter> <Willamin> You can call a macro like a member method, using `macro def`, can you not?
<FromGitter> <bew> @Willamin `macro def` is not really documented iirc, it's not meant for this use I think
<Papierkorb> With a disclaimer
<FromGitter> <bew> ah thanks
<FromGitter> <bew> either way, in a `macro def` you have access to `@type` (`Int32`) but not `self` (`0`) at compile time
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <Willamin> Oh well, thanks anyways! :D
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <sdogruyol> how can I check if a value is truthy outside of a guard clause
<Yxhuvud> What do you want to achieve?
<FromGitter> <eliasjpr> <oprypin> My apologies was never my intention I will remove
<FromGitter> <eliasjpr> I just wanted some tees
<FromGitter> <eliasjpr> <oprypin> removed!
mark_66 has quit [Remote host closed the connection]
<FromGitter> <jose-rodrigues> What is the LICENSE of the crystal logo?
ShalokShalom_ is now known as ShalokShalom
<crystal-gh> [crystal] asterite opened pull request #5038: Fix incorrect type of Int#times iterator (master...bug/5019-int-times-type) https://git.io/vdtOl
<oprypin> eliasjpr, hey it's not my decision either way. but you're supposed to ask permission. see https://crystal-lang.org/media/ bottom of page
<FromGitter> <eliasjpr> 👌🏻👍🏻 thanks
<oprypin> jose-rodrigues, see that link too
<FromGitter> <eliasjpr> I think crystal team should open a store for tees and stuff that would be a nice way to contribute for the crystal cause
<oprypin> for sure
<FromGitter> <kazzkiq> Is `Process.run` a blocking method?
<FromGitter> <kazzkiq> If I run a cURL command via `Proccess.run`, and it takes 10 seconds to return, is my application going to hang for 10 seconds?
<oprypin> kazzkiq, it's a convenience method that wraps Process.new and Process.wait which blocks the current fiber until the process ends
<oprypin> also why run a curl command......
<crystal-gh> [crystal] asterite closed pull request #5038: Fix incorrect type of Int#times iterator (master...bug/5019-int-times-type) https://git.io/vdtOl
claudiuinberlin has joined #crystal-lang
<travis-ci> crystal-lang/crystal#1c859ca (master - Merge pull request #5038 from asterite/bug/5019-int-times-type): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/280064304
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
<FromGitter> <loloof64> Hello everyone 😃 Is there already a binding for WxWidgets for Crystal ? My Google search did not show me suitable result.
<FromGitter> <codenoid> unfortunately @loloof64 http://crystalshards.xyz/?filter=WxWidgets
<FromGitter> <faustinoaq> > huh what does the delegate macro do exactly? Not seen that before ⏎ ⏎ Groogy, check 👉 http://devdocs.io/crystal/api/0.23.0/object#delegate(*methods,toobject)-macro
<FromGitter> <faustinoaq> > Hello everyone 😃 Is there already a binding for WxWidgets for Crystal ? ⏎ >> unfortunately ⏎ ⏎ But you can try Qt bindings 😉 ⏎ ... [https://gitter.im/crystal-lang/crystal?at=59ca95abcfeed2eb65523bdc]
<FromGitter> <kazzkiq> > *<oprypin>** also why run a curl command...... ⏎ Because that's the only way to make Mailgun work with Crystal at the moment
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<FromGitter> <crisward> @kazzkiq I have a mailgun client, just not got around to open sourcing it yet. It's actually mailgun and sendgrid. I use `HTTP::Client`. I want to add a wrapper around SMTP with it to, so it's a common api for however you want to send mail.
ylluminate has joined #crystal-lang
snsei has quit [Remote host closed the connection]
sp4rrow has joined #crystal-lang
<FromGitter> <loloof64> Thanks @codenoid Maybe I'll have to do myself bindings for the functionnalities I need
alex`` has quit [Ping timeout: 252 seconds]
<FromGitter> <loloof64> Or use another GUI framework like libui : http://crystalshards.xyz/?filter=libui
<oprypin> kazzkiq, are you sure about that? crystal's http client should (at least strive to) provide all the same functionality. if it doesnt match that expectation, ask for help / report it
<FromGitter> <loloof64> Thank you also @faustinoaq Maybe Qt binding will be the solution.
<FromGitter> <faustinoaq> Yeah Qt bindings are awesome! ✨
<Papierkorb> <3
<FromGitter> <faustinoaq> 👍
<FromGitter> <faustinoaq> ```A = [] of Nil ⏎ {% A << 0 %} ⏎ {% p A[0] %} # => 0``` ⏎ ⏎ How is this possible ? [https://gitter.im/crystal-lang/crystal?at=59cab1f7bac826f05400db77]
<FromGitter> <faustinoaq> https://carc.in/#/r/2sv3
rohitpaulk has quit [Ping timeout: 255 seconds]
<crystal-gh> [crystal] asterite opened pull request #5040: Compiler: remove `macro def` (master...feature/2565-remove-macro-def) https://git.io/vdtix
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Ping timeout: 248 seconds]
<Papierkorb> lul ^
<FromGitter> <eliasjpr> https://carc.in/#/r/2sv6
<FromGitter> <eliasjpr> 😕
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
<oprypin> yeah not the first time i see this
<FromGitter> <eliasjpr> Maybe is not a bug maybe is a feature :D
<FromGitter> <eliasjpr> maybe this is why https://carc.in/#/r/2sv9
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] n7olkachev opened pull request #5041: Handle malformed http requests (master...bug/4878-malformed-http-headers) https://git.io/vdtM0
ylluminate has quit [Quit: Textual IRC Client: www.textualapp.com]
rohitpaulk has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
<FromGitter> <crisward> Just open sourced this - https://github.com/crisward/mailer
<FromGitter> <asterite> When you don't use a constant it's not typed, so a constant can be used as a placeholder in macros
<FromGitter> <asterite> That is, when you don't use that constant at runtime
<FromGitter> <asterite> Also known has hack #123 (just kidding)
<FromGitter> <asterite> But Elixir does something similar, only with attributes (which only exist at compile-time, I think)
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 248 seconds]
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <vonKingsley> is there a way to tell crystal to always use some link-flags, so i don't forget to pass --link-flags -I/usr/local/opt/openssl/include --link-flags -L/usr/local/opt/openssl/lib each time
Creatornator has joined #crystal-lang
hightower4 has joined #crystal-lang
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <jose-rodrigues> @vonKingsley I don't know if you can configure crystal for that but you can do a shell alias. Or better a makefile.
hightower3 has quit [Ping timeout: 240 seconds]
<FromGitter> <vonKingsley> thanks @jose-rodrigues i think ill add it to a shell alias
hightower4 has quit [Ping timeout: 240 seconds]
<FromGitter> <kazzkiq> @crisward Awesome! Will take a look at it tonight. Thanks!
<FromGitter> <asterite> You can use @[Link] on LibC
hightower2 has joined #crystal-lang
<FromGitter> <crisward> @kazzkiq raise an issue if you have any problems. Took me a while to originally get the apis working ok, but pretty sure everything is there now, except the stuff mentioned in the Readme.
<oprypin> vonKingsley, have u tried `{LD_,}LIBRARY_PATH=/usr/local/opt/openssl/lib crystal run blah`
<oprypin> in which case, `export {LD_,}LIBRARY_PATH=/usr/local/opt/openssl/lib` in your shell and proceed normally
<FromGitter> <vonKingsley> @oprypin I originally just tried `LIBRARY_PATH=/usr/local/opt/openssl/lib crystal run` which didn't work for me
<oprypin> LIBRARY_PATH is for build LD_LIBRARY_PATH is for execution. so have u tried both?
<FromGitter> <vonKingsley> @oprypin just tried it and it still didn't work for me, still links to openssl 0.9.8
<oprypin> vonKingsley, how are you checking that? it does not link to any particular openssl
<oprypin> you must use LD_LIBRARY_PATH when running the resulting binary
<oprypin> that's when the override happens
<FromGitter> <vonKingsley> i was checking two ways 1 with otool -L on the binary. and the other was running a wireshark and checking if it was using tls 1.2, trying to troublshoot an tls issue
<oprypin> ok but did u start those with LD_LIBRARY_PATH
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <vonKingsley> Yeah I tried `LD_LIBRARY_PATH=/usr/local/opt/openssl/lib crystal run tls_test.cr` and it was still using, TLS V1. no worries on it. i got to run but i'll figure something out.
<crystal-gh> [crystal] bmmcginty opened pull request #5042: Cookie expiration (master...cookie_expiration) https://git.io/vdtNf
Creatornator has joined #crystal-lang
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vdtAO
<crystal-gh> crystal/master 2c1bb2d Ary Borenszweig: Compiler: remove `macro def` (#5040)
sz0 has joined #crystal-lang
<travis-ci> crystal-lang/crystal#2c1bb2d (master - Compiler: remove `macro def` (#5040)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/280177647
<FromGitter> <faustinoaq> I know you should use `LIBRARY_PATH` at compile time and `LD_LIBRARY_PATH` at run time. so: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59cadefb177fb9fe7e07c0d7]
<FromGitter> <faustinoaq> > **<oprypin>** LIBRARY_PATH is for build LD_LIBRARY_PATH is for execution. so have u tried both? ⏎ ⏎ I just see it 😅
<FromGitter> <faustinoaq> Does Crystal have something like Intersection Types ? [0] ⏎ ⏎ [0] - https://flow.org/en/docs/types/intersections/
<FromGitter> <bew> @faustinoaq I don't get it, what's the difference with our unions?
<FromGitter> <faustinoaq> I;m a bit confused, because I think unions behave differently [0] ⏎ ⏎ [0] - https://flow.org/en/docs/types/unions/ ⏎ ⏎ Maybe it's not valid to compare Flow & Crystal 😅 [https://gitter.im/crystal-lang/crystal?at=59cae4ef32fc8b7e4043de38]
<crystal-gh> [crystal] MakeNowJust opened pull request #5043: Remove 'macro def' related code from lexer.cr (master...fix/crystal-lexer/follow-remove-macro-def) https://git.io/vdqUL
<FromGitter> <bew> From the given examples, I don't think intersection type is relevant in Crystal
<FromGitter> <ezrast> You might want to require that an object's class includes two different modules
<FromGitter> <bew> oh right
<FromGitter> <ezrast> I don't know what a real use case would look like though
<FromGitter> <bew> no idea too
<oprypin> faustinoaq, what's your use case?
<FromGitter> <mverzilli> when you're augmenting JS with Flow it makes sense because then you can annotate a param as "whatever you send here should have an attribute X and an attribute Y"
<FromGitter> <bew> pinging @asterite will maybe bring a little light here
<FromGitter> <bew> yes @mverzilli that's what I was thinking too
<FromGitter> <mverzilli> in JS it's common to use ad-hoc objects to sort of gimmick named arguments, for example
<FromGitter> <mverzilli> Flow is a huge attempt at reverse engineering common patterns of use in JS and type-check them