RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.26.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
scott_tams has quit [Quit: Leaving]
non-aristotelian has quit [Quit: non-aristotelian]
<FromGitter> <newtonapple> is this the expected behavior for module include & extend? https://play.crystal-lang.org/#/r/531a
<FromGitter> <newtonapple> basically you can't override existing instance and class methods via include and extend
<FromGitter> <newtonapple> u can if you add them via macro hooks
<FromGitter> <newtonapple> coming from ruby, this was a bit confusing...
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #crystal-lang
dostoyevsky has quit [Client Quit]
dostoyevsky has joined #crystal-lang
dostoyevsky has quit [Client Quit]
dostoyevsky has joined #crystal-lang
dostoyevsky has quit [Client Quit]
dostoyevsky has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <codenoid> i will add portofolio page
DTZUZO_ has joined #crystal-lang
<FromGitter> <bararchy> lol sorry livcd just got your mention notification
<FromGitter> <bararchy> what's up?
<FromGitter> <Sija> it’s a trove of discussion about this recent “inclusive” idiocracy happening to the world of code, recommended good for all
sevensidedmarble has quit [Ping timeout: 260 seconds]
<FromGitter> <bararchy> :/
sevensidedmarble has joined #crystal-lang
<FromGitter> <j8r> A CoC doesn't have to be complicated: something like "Any negative or irrespectful behavior toward people is forbidden"
<FromGitter> <j8r> A sort of ISC license of this CoC :]
<FromGitter> <bararchy> "irrespectful" is really really broad
Groogy1 has joined #crystal-lang
<FromGitter> <j8r> I personally prefer this than enumerate all cases.
<FromGitter> <j8r> At the end, that's up to the moderator, even with a CoC, there may have different interpretations
<FromGitter> <j8r> I strongly think the community should decide, for e.g. ban/kick
<FromGitter> <codenoid> idk
<FromGitter> <codenoid> about "harassment/racist" it's depend, i think we can't force to make other person do like we want
<FromGitter> <codenoid> i don't really care too 👾
<FromGitter> <bararchy> tbh I don't really care also XD
<FromGitter> <codenoid> a : f*ck you yellow ! ⏎ b : ok ⏎ done
<FromGitter> <bararchy> I think I care much more about getting multi-thread support
<FromGitter> <codenoid> bcoz i'm yellow, so what ?xD
<FromGitter> <j8r> it is the legal problem, it is up to the judge to interpret the law and render a verdict
<FromGitter> <j8r> on legal things are boring :x
<FromGitter> <Sija> @j8r but it’s not
<FromGitter> <Sija> contributing to oss projects as far as I know is not governed by any law, aside of the most general ones
<FromGitter> <bararchy> @Sija I think he meant regarding racisem
<FromGitter> <Sija> oh, in this case yes, it would go under “most general ones” ;)
<FromGitter> <bararchy> btw, @Sija the same people you agree with are the people who needed to "make a point" by trolling the Crystal github issues and posting it in 4chan
<FromGitter> <Sija> I’m not sure I follow @bararchy
<FromGitter> <Sija> what ppl r u talking about?
<FromGitter> <bararchy> I'll try to re-phrase, it seems your stand on the matter is that CoC is uneeded and that adding it is giving too much room for "social activist bullying" right ?
<FromGitter> <Sija> more or less, yes
<FromGitter> <bararchy> TBH I don't really know where I stand on the matter but it seems others who have the same idea as you feel they should "stress the point" by trolling multiple projects with "hyper PC" PRs to show everyone why CoC and the general direction is not a good one
<FromGitter> <Sija> I don’t know about that and I don’t know like being put in some generic basket of “people who have the same idea” because it’s quite unfair
<FromGitter> <Sija> I’m responsible solely for my own actions, and so do “others”
<FromGitter> <Sija> perhaps they do fucked up things with the same ideas in head, that happened before, happens almost everyday, but generalising is always a lie
<FromGitter> <Sija> or maybe I posted but I wasn’t aware of it? if you’d find any of my posts there, please send me a screenshot so I’ll finally get to know what am I doing when I’m unconscius, like sleeping - and I do it a lot ;)
<FromGitter> <Sija> @bararchy if you don’t know where do you stand, just imagine that some trans-sexual person opens up a PR in crystal repo with some rly botched, inefficient code - then, when arguments against it are voiced, instead of concentrating on the meritorical side of them, he/she/it tries to force his/her/it PR through based on arguments of “inclusion”, “diversity”, “tolerance” and similar - did that help to
<FromGitter> ... see what’s cooking?
<FromGitter> <bararchy> @Sija I see the big picture on that, I agree that we need to focus on tech insteead of politics in the decision making, I also didn't see any place where someone from the Crystal community was turned down from doing something because of non-professional reasons
<FromGitter> <Sija> and btw, these so called “social activists” are more like marxist fighters to me
<FromGitter> <Sija> yeah, that’s my point. no reasonable person needs CoC to get along
<FromGitter> <bararchy> TBH it's all feels like American drama to me hahah
<FromGitter> <Sija> certainly it has that feel
<FromGitter> <Sija> unfortunately its tentacles are far-reaching
<FromGitter> <codenoid> who @bararchy
<FromGitter> <codenoid> 4chan link
<FromGitter> <Sija> for example since some time in primary schools in Poland, they teach about homosexuality and other “genders” are sth totally normal, on par with hetero. there are plays about it, games and other bs. in high-schools they introduced sth like “family eduction” because families nowadays can’t educate their children, apparently
<FromGitter> <sekkr1> is there a way to extract all the matched groups from a matchdata?
<FromGitter> <Sija> @sekkr1 `$~[1]`
<FromGitter> <Sija> or `$1` IIRC
<FromGitter> <codenoid> yeah, family education is important
<FromGitter> <Sija> also `$~[“group_name”]` if you defined it in the regex (`(?<group_name>.*?)`)
<FromGitter> <sekkr1> exactly what i was looking for, thx
<FromGitter> <Sija> @sekkr1 I missed `all groups` at first, hence my wrong answers, sorry for confusion! the last links should be what you’re looking for
<FromGitter> <Sija> yw!
ashirase has quit [Ping timeout: 252 seconds]
<FromGitter> <codenoid> i want to move to niceland btw
ashirase has joined #crystal-lang
<FromGitter> <bararchy> niceland :)
<FromGitter> <kingsleyh> just skim read the stuff about CoC - It would be nice if we could avoid what happened to the Ruby community - when it got realy popular - many idiots, trolls and life suckers arrived - you know the ones who stir up trouble and ask questions like - hey somebody help me - how do I create a forum!
<FromGitter> <kingsleyh> they were always trying to ignite people by baiting them on python vs ruby and various other stupid things
<FromGitter> <kingsleyh> these type of people we could do without
Groogy1 has quit [Ping timeout: 272 seconds]
<FromGitter> <kingsleyh> I don't really care about other peoples views as long as they aren't continually stirring up trouble - I'm sure plenty of people have views that are not totally compatible - but they don't go around shouting about them to everyone. Also I think it would be nice (for me anyway) if people didn't swear, call other people names and be disrespectful or bullying. Just my thoughts :)
<FromGitter> <drum445> @Sija I agree, however capitalism is the only model that allows any kind of freedom to coexist. Socialism is just communism taking it's time
<FromGitter> <Sija> @drum445 in theory perhaps, capitalism never existed in its pure form - look at US&A as a prime example of socialism in disguise of capitalism
<FromGitter> <Sija> @kingsleyh 👍
<FromGitter> <Sija> @drum445 EU also has its “trading-card” in a form of no-borders, free movement concept - freedom you think, great! nope, it’s just a smoke screen for all other oppression and state control apparatus
<FromGitter> <SeedyROM> I know I'm not deeply invested in this project, but I think the best way to handle these subversively "political" intrusions is to be 100% transparent with how the core team and contributors feel.
Heaven31415 has joined #crystal-lang
<FromGitter> <SeedyROM> Programmers write code at heart, not political think pieces and ideologies.
<Heaven31415> Hi
<FromGitter> <Sija> @SeedyROM sounds great but it seems they don’t give a damn about the projects, the only thing they do care is forcing their ideology, so racional, honest arguments are not rly working, which is sad :(
<FromGitter> <Sija> Howdy!
<FromGitter> <SeedyROM> Which is why you have to simply pay no attention, and keep your private life outside of said codebase.
<FromGitter> <Sija> @SeedyROM see this for example https://imgur.com/TV8VScL
<FromGitter> <SeedyROM> We as engineers and developers need to put our foot in the sand and ask for an open medium to discuss this stuff.
<FromGitter> <SeedyROM> Not just angry twitter posts and GH issues.
<FromGitter> <Sija> yep, keeping politics out of the codebase is sth worth persuing, that’s for sure :)
<FromGitter> <SeedyROM> Politics aren't completely irrelevant, but they need to be talked about in an open forum. Not a shooting gallery.
Groogy1 has joined #crystal-lang
<FromGitter> <SeedyROM> And definitely not surrounding the work of said authors and community.
<FromGitter> <kingsleyh> @Sija wow that guy was persistent!
<FromGitter> <Sija> @SeedyROM I’d recommend you to check out link I’ve posted, it’s a prime example of inability to communicate with some of the SJW (or whatever they’re called)
<FromGitter> <fenicks> Hi guys, if you are a master in Crystal take look at database/datastore shards, lot of them are not working with new version of Crystal. People couldn't choose Crystal most of the time because of that. I was looking for RethinkDB (I have a cluster) but both shards are broken, I switch to embedded datastore: leveldb, kyotocabinet broken too. Thanks ;-)
<FromGitter> <Sija> @kingsleyh yep, realy nasty fella
<FromGitter> <vladfaust> Regarding to that topic. Sometimes I have to deny pull requests or issues because of efficiency or code style - etc. objective reasons. And I have to be pseudo-polite like "no offence, intended no harm", otherwise OPs whine and cry
<FromGitter> <kingsleyh> @fenicks I was using RethinkDB in a previous version of Crystal - I would like to use it again soon - what was the issue with it?
<FromGitter> <SeedyROM> @vladfaust that's called being sane about building a piece of usable software. You need to trust your gut (git).
<FromGitter> <kingsleyh> @fenicks I was using this one: https://github.com/cubos/rethinkdb.cr
<FromGitter> <kingsleyh> @fenicks if you see in the issues - I asked about the project status - and it seems it won't be worked on by the author for at least a year
<FromGitter> <vladfaust> @SeedyROM yeah
<FromGitter> <SeedyROM> torvalds/linux@8a104f8 Was this the link you mentioned?
<FromGitter> <Sija> @SeedyROM nope, https://imgur.com/TV8VScL
<FromGitter> <vladfaust> BTW, if some really need other shard working, they could hire a dev. I mean, that's why I've created crystaljobs.org
<FromGitter> <fenicks> @kingsleyh With rethinkdb.cr you can't use user and password with `connect` method. With rethibdb-lite it silently fails (never connected) I'll try again this evening for more details
<FromGitter> <Sija> @fenicks there’s also https://github.com/lbguilherme/rethinkdb-lite
<FromGitter> <Sija> @vladfaust most of the shards are still created by individuals
<FromGitter> <SeedyROM> @Sija That awesome-django SC got me bent, who the fuck goes around these communities trying to stir this stuff up in such a negative way. It sounds super fishy to me.
<FromGitter> <Sija> @vladfaust I guess that’s the reason you’ve created “Developers” section first, right? ;)
<FromGitter> <fenicks> @Sija I known, it doesn't works although with 0.24.2 the problem was with `require` but I will try again later at home because I think I can fix them
<FromGitter> <Sija> @SeedyROM that’s the thing - it IS fishy
<FromGitter> <Sija> it’s far from “oh, I was mistreated, let’s fix the world so this won’t happen again” situation
<FromGitter> <Sija> and IMO closer to sth like coordinated attack on social structures
<FromGitter> <vladfaust> I've created https://github.com/vladfaust/tarantool-crystal by request. I didn't need that shard, but I've got my time paid and the funder agreed to OSS the shard. Note that " features and support are paid" is obsolete, gonna remove it soon 😅
<FromGitter> <vladfaust> As a result, the shard is used by a number of small projects in Russia
<FromGitter> <SeedyROM> @vladfaust Where in RS to you work that contracts out Crystal work? I've never seen a single mention of it in the US, and I was Ruby developer 8 years ago.
<FromGitter> <Sija> @vladfaust nice, I certainly do hope there’s gonna be more of those :)
<FromGitter> <fenicks> For now I use a patched version of leveldb because I need to be familiar with Crystal basics. For leveldb this pull request is needed: https://github.com/crystal-community/leveldb/pull/3
<FromGitter> <SeedyROM> Honestly I would like to thank all of you core devs and maintainers for making such succinct and elegant native language. Rust is a pile of tears compared to this, I really hope some CoC issues and interpersonal politics don't get in the way of this project. I honestly love it more than Elixir haha.
<FromGitter> <SeedyROM> :3
<FromGitter> <SeedyROM> I know they don't solve the same problem, but the Ruby syntax just clicks for me! <#
flaviodesousa has joined #crystal-lang
<FromGitter> <fenicks> @SeedyROM exactly 👍
<FromGitter> <j8r> the productivity/performance ratio is incredible :)
<FromGitter> <fenicks> @j8r 👍
lunarfyre7 is now known as lunarkitty
<FromGitter> <vladfaust> Sorry, got issues with wi-fi, use mobile app now, therefore cannot mention
<FromGitter> <vladfaust> Moving apps to Crystal is inevitable, because it’s cheaper to hire a Crystal dev than spin up new servers
<FromGitter> <vladfaust> We need to create such conditions which would allow product owners to look to crystal
<FromGitter> <SeedyROM> I accidentally PrtSrc'n my keyboard without the function key and turn my wifi off too haha.
<FromGitter> <vladfaust> That “not 1.0” stuff is silly argument IMO. I mean, they don’t even look at the language, however it is production-ready. On Unix. Who runs businesses on Windows, huh?
<FromGitter> <SeedyROM> Nobody worth their weight in ash.
<FromGitter> <SeedyROM> @vladfaust haha
<FromGitter> <vladfaust> I notice authors of posts related to crystal always note that “it’s not 1.0 but will be soon”. Myself too, btw
<FromGitter> <vladfaust> We need moar benchmarks, more comparison with other players
<FromGitter> <SeedyROM> As long as future breaking changes aren't too insane, Crystal might attract more devs from other specialties like C or C++. (Maybe D now?)
<Heaven31415> D is a really weird language, for example NaN is a default value for float and double xD
<FromGitter> <SeedyROM> @vladfaust I think having a combination of isolation and interest from real developers, is a better situation than saturation and bastardization of the what's actually trying to be created here.
<FromGitter> <kingsleyh> @fenicks I don't think it would be too hard to support user/password
<FromGitter> <SeedyROM> 1) 0 will happen when it happens, I'm honestly happy building tools that will make people say "Wow!" when this finally gets more mainstream.
<FromGitter> <SeedyROM> And hell if it doesn't, its open source and we can improve anything we like if it all falls apart.
<FromGitter> <SeedyROM> Obviously not easily haha, but it's not the end!
<FromGitter> <kingsleyh> @fenicks I haven't looked at the rethinkdb-lite code - so that may also be fixable
<FromGitter> <codenoid> crystal for android development ✨
<FromGitter> <codenoid> like cordova
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<FromGitter> <fenicks> @kingsleyh Ok. for rethinkdb.cr it doesn't support new connection mechanism appeared in 2.3 but it'd implemented in rethinkdb-lite. Agread.
<FromGitter> <kingsleyh> @fenicks which one you prefer to use?
<FromGitter> <fenicks> I prefer https://github.com/cubos/rethinkdb.cr it looks more complete
<FromGitter> <kingsleyh> yeah it's more complete - I believe the author was slowly migrating towards the rethinkdb-lite but a lot of functionality is missing from lite
<FromGitter> <kingsleyh> so the best approach would be to implement the connection mechanism in cubos/rethinkdb
<FromGitter> <fenicks> Ok
<FromGitter> <fenicks> What's the best idiom inCrystal for a thread safe singleton object: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5baa1654691dc567db9e66e5]
<FromGitter> <drum445> @Sija the EU is awful and if brexit is done right it could be a great step forward, capitalism in it's true form can't work but neither can any of the other models
<FromGitter> <j8r> Usually governments are even worse than the EU
<FromGitter> <j8r> I like inclusive mindsets of those who have built the EU, the European Economic Community, and also communities including OSS in general :)
<FromGitter> <drum445> Python: 4mins ⏎ Crystal: 10seconds
<FromGitter> <drum445> not bad pmsl
<FromGitter> <j8r> for what algorithm?
rohitpaulk has joined #crystal-lang
Groogy1 has quit [Ping timeout: 244 seconds]
DTZUZU has quit [Quit: WeeChat 1.9]
Groogy1 has joined #crystal-lang
<FromGitter> <vladfaust> Do we have JBuilder?
<FromGitter> <fenicks> @vladfaust look at: https://crystal-lang.org/api/0.26.1/JSON.html#build%28io%3AIO%2Cindent%3Dnil%2C%26block%29-class-method
<FromGitter> <vladfaust> Oh, nice, thanks, didn't know about that 👍
<FromGitter> <drum445> work project @j8r, basically involves a lot of for loops
<FromGitter> <j8r> having to evaluate the types in a dict dynamically is likely expensive
<FromGitter> <fenicks> > What's the best idiom inCrystal for a thread safe singleton object: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I probably forget to declare the constructor `private` ? [https://gitter.im/crystal-lang/crystal?at=5baa4812aedb375b9c44ab4d]
DTZUZO_ has quit [Quit: WeeChat 2.0]
TimApple has joined #crystal-lang
<TimApple> I am looking to learn to program, just as a hobby. Was considering crystal.
<TimApple> Good or bad idea?
<FromGitter> <fenicks> TimeApple, it's a pretty good idea and Crystal is awesome
<FromGitter> <yxhuvud> on the other hand, I'd not recommend crystal as a first language due to it being somewhat obscure with not a lot of resources available online.
<FromGitter> <AlexisVisco> hey, I can not find a good development environment with crystal lang, atom ide it's rotten, vscode do not find me the compiler and the jetbrains plugin does not look very advanced ... Crystal to look like a great language but I find access to a way to develop comfortably is complicated. (for comfortably I speak of "jetbrains ide")
<FromGitter> <AlexisVisco> So what do you use ?
<FromGitter> <AlexisVisco> Sorry for my bad english i am french :)
<FromGitter> <fenicks> @AlexisVisco sorry I use vscode or a basic Makefile. Crystal build tool is super easy but I'm agree about that a best integration is possible with the IDEs you listed before
<FromGitter> <fenicks> @kingsleyh I see that you develop the SushiChain project. What about the cryptography in Crystal, did you find all you need ?
Groogy1 has quit [Ping timeout: 240 seconds]
<FromGitter> <AlexisVisco> @fenicks and you now why vscode tell me that it doesnt find my compiler ?
<FromGitter> <AlexisVisco> because, that is not a completion lol
<FromGitter> <AlexisVisco> http://prntscr.com/kyksgk
<FromGitter> <rishavs> Are you on windows? Crystal compiler for windows isn;t ready yet
<FromGitter> <fenicks> probably the crystal binary is not in $PATH or %PATH%
<FromGitter> <AlexisVisco> im on mac
<FromGitter> <AlexisVisco> i can execute crystal
<FromGitter> <AlexisVisco> in my shell
<FromGitter> <AlexisVisco> so i think there is crystal in my path ^^
<FromGitter> <AlexisVisco> And: http://prntscr.com/kykth2
<FromGitter> <bew> @AlexisVisco oh un français ;) proper contextual completion is highly experimental, and is being developed in the scry project, as a language server (compatible with many text editor/ide)
<FromGitter> <AlexisVisco> yes but :
<FromGitter> <AlexisVisco> http://prntscr.com/kyktsn
<FromGitter> <AlexisVisco> i cant dev with that xDD
<FromGitter> <bew> you can read about Scry at https://github.com/crystal-lang-tools/scry
<FromGitter> <bew> it's not enabled by default in the vscode plugin
<FromGitter> <AlexisVisco> okay i will check this
<FromGitter> <AlexisVisco> oh well
<FromGitter> <AlexisVisco> @bew tu as discord ?
<FromGitter> <bew> but don't expect perfect completion
<FromGitter> <AlexisVisco> i would like a minimum
<FromGitter> <bew> yep, mais pas dispo ctaprem ni ce soir
<FromGitter> <AlexisVisco> moi non plus je vais faire de l'escalade là, j'aimerais implementer socket.io en crystal
<FromGitter> <AlexisVisco> je file
<FromGitter> <AlexisVisco> thanks crystal community
<FromGitter> <bew> ah yesss socket.io in crystal would be really nice ;)
<FromGitter> <j8r> Crystal isn't really my first language, I've hasd imperative
<FromGitter> <j8r> With Crystal I've learnt OOP and low level stuff like pointers, slices, C bindings
TimApple is now known as _7im4pple
_7im4pple is now known as {7im4pple}
<FromGitter> <markrjr> Reposting cus this got burried: how do I cross compile from Linux to test the new functionality for Windows? ⏎ To be specific: ⏎ I've made some changes here (https://github.com/markrjr/crystal/blob/886fd269c72b421ec4a69b68ea03da89f17af7b6/src/lib_c/x86_64-windows-msvc/c/ntsysteminfo.cr) and here (https://github.com/markrjr/crystal/commits/markrjr/cpu_count). There's still some work to do, but I want to know
<FromGitter> ... the workflow. That file includes `c/winnt` etc. so that it can get definitions for DWORD and other stuff. ⏎ Should I just drag c/winnt and whatever else I include into the same directory, compile those, and then try to compile/link on Windows, or is there a better workflow? @straight-shoota @RX14 [https://gitter.im/crystal-lang/crystal?at=5baa57baeba8e60bc642b27b]
<FromGitter> <j8r> Crystal or not, I think we should start learning first imperative programming before functional/OOP
<FromGitter> <foi> Hi! Excuse me, someone can help me? - crystal 0.26.1 cannot compile on ubuntu 16.04 - all required libraries are installed - event gc from master branch :( ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5baa586e4d320a463bf07ad7]
<FromGitter> <j8r> what version of openssl have you @foi ?
<RX14> @markrjr i'm not sure what you're asking regarding dragging files
<FromGitter> <foi> @j8r ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5baa58f101fb5f4ae11eb75c]
<RX14> you just edit the files in your checkout of crystal and then cross-compile using bin/crystal
<Yxhuvud> j8r: I disagree. I found common lisp to be great to start with.
{7im4pple} is now known as \7im4pple\
junland has quit [Quit: Disconnected.]
<FromGitter> <girng> @bararchy wow they are targetting godot engine. not nice
junland has joined #crystal-lang
<FromGitter> <vladfaust> Sorry for disturbing. Can anyone help? I'm trying to make this work: https://carc.in/#/r/537c, tuple values should be defined in an outer macro.
<FromGitter> <j8r> @yxhuvud even vs Scheme? I think Python/Ruby/Crystal is good for beginners, Crystal best when learning functions and modules first
<FromGitter> <j8r> you can write simple conditions
<FromGitter> <foi> @j8r https://github.com/crystal-lang/crystal/issues/4680 i've installed pkgconf pkg-config and it's solved my issue
<FromGitter> <girng> @j8r
<FromGitter> <j8r> @foi 👍
<Yxhuvud> j8r: I don't see scheme as an iterative language either.
<FromGitter> <j8r> even Shell is ok to learn the very basics of if, else, case, functions.
sevensidedmarble has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<FromGitter> <vladfaust> If https://carc.in/#/r/537c is resolved, I could finally extract typed params to external shard
wontruefree has joined #crystal-lang
<FromGitter> <vladfaust> Should I open an issue then?
<oprypin> no, you're just writing wrong code
<oprypin> it's explained in docs too
<oprypin> that page has {% begin %} on it
Heaven31415 has quit [Remote host closed the connection]
<FromGitter> <vladfaust> I tried begin, no luck
<FromGitter> <vladfaust> I need to insert code from outer macro into the NamedTuple() call
<FromGitter> <girng> Story of my life (https://i.gyazo.com/960b660fe1e670de03c74b81f2340c59.png)
moei has quit [Quit: Leaving...]
wontruefree has quit [Quit: bye]
<FromGitter> <sdogruyol> roflmao
rohitpaulk has quit [Ping timeout: 252 seconds]
<FromGitter> <bew> 😝
<FromGitter> <drum445> haha
non-aristotelian has joined #crystal-lang
wontruefree has joined #crystal-lang
<FromGitter> <bararchy> LOL
bazaar_ has quit [Quit: Reconnecting]
rohitpaulk has joined #crystal-lang
bazaar has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
Heaven31415 has joined #crystal-lang
<Heaven31415> Hi
<Heaven31415> Can I use is_a? with macro to check type of macro parameter at compile time?
<oprypin> at compile time - yes. in macro context - no.
<oprypin> Heaven31415,
<oprypin> as usual, it's best to work with an example or just saying what you're trying to achieve
<Heaven31415> Sure, I want to check what user is passing to macro and make sure it's what I want and raise otherwise
<oprypin> u should pass the result to a method accepting only a particular type
<oprypin> you cannot do anything with the value because it's not a value but a piece of code
<Heaven31415> so it's too early to check
<oprypin> yes, macros cant check types, you need to produce a piece of code which may or may not produce a compile time type error
<oprypin> now that i think about it, maybe you can just write {{thing}}.as(Type)
<Heaven31415> so maybe something like checking parameter type name and comparing it to what I want?
<oprypin> it's hard to continue in such abstract terms.
<Heaven31415> yeah, maybe I will just tinker with it later, write some example and ask you if I still going to have some problem
<Heaven31415> thanks for help
<FromGitter> <LesterCano> JHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
<FromGitter> ... crystal-lang/crystal?at=5baa930198245f4ae081f7a1]
<FromGitter> ... WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWW ... [https://gitter.im/
<FromGitter> <LesterCano> JHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
<FromGitter> ... crystal-lang/crystal?at=5baa9302eba8e60bc6444638]
<FromGitter> ... WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWW ... [https://gitter.im/
<FromGitter> <LesterCano> JHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
<FromGitter> ... crystal-lang/crystal?at=5baa9303fe37781110f81701]
<FromGitter> ... WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWW ... [https://gitter.im/
<FromGitter> <LesterCano> JHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
<FromGitter> ... WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWW ... [https://gitter.im/
<FromGitter> ... crystal-lang/crystal?at=5baa930498245f4ae081f7ef]
<FromGitter> <LesterCano> JHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
<FromGitter> ... WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWJHASS IS A SJW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWW ... [https://gitter.im/
<FromGitter> <RX14> well thats not very nice
<Heaven31415> there is no honor among spammers
<FromGitter> <r00ster91> its hopefully possible to completely remove issues
<jhass> unfortunately only by github staff
<FromGitter> <hugoabonizio> is there any way to avoid those trolls in issue tracker?
<jhass> report them to github
<RX14> yes
<FromGitter> <r00ster91> its possible to block users from a respository
<RX14> you can lock the issue tracker
<RX14> and ban users from your repo
<RX14> you just need org admin access
<FromGitter> <kirbyfan64> FYI here's the link to report them: https://github.com/contact/report-abuse?report=LesterCano+%28user%29
<FromGitter> <hugoabonizio> crystal-lang is locking issues, it should block this user ASAP
<FromGitter> <HarrisonB> I just reported.
<FromGitter> <HarrisonB> Hopefully this is taken care of quickly enough...
<FromGitter> <HarrisonB> Whoever manages the crystal-lang account, thanks for dealing with this quickly
wontruefree has quit [Quit: bye]
<FromGitter> <kirbyfan64> Well someone just shared the reason they did this: https://boards.4chan.org/pol/thread/186588488#p186588488
<FromGitter> <kirbyfan64> Might want to leave it locked for a bit even when this user gets banned
<FromGitter> <MrSorcus> Crystal repo got attacked again?
<FromGitter> <hugoabonizio> 4chan should've been banned from the internet long time ago
<FromGitter> <kirbyfan64> Yes it should
<FromGitter> <kirbyfan64> TL;DR is that they got mad that the PR related to the "sanity check" and such terminology got merged
wontruefree has joined #crystal-lang
<FromGitter> <kirbyfan64> So they decided to spam issue trackers, pretending they're SJWs when they're actually alt-right
<FromGitter> <hugoabonizio> their lives are really sad
<FromGitter> <HarrisonB> @kirbyfan64 ty for speaking the truth... too many time people fall for the bait :(
<FromGitter> <MrSorcus> Fucking SJW terrorists...
<FromGitter> <HarrisonB> @MrSorcus they're alt-right trolls
<FromGitter> <markrjr> ^
<FromGitter> <kirbyfan64> If SJWs start pretending to be alt-right because the alt-right is pretending to be SJWs this literally became a crappy movie plot and the internet is officially hopeless 🤦
<FromGitter> <HarrisonB> @kirbyfan64 in all my years on the internet, i've yet to see that happen, so I wouldn't hold your breath
<Heaven31415> I cannot find a file method which can tell me that I'm at end of file, I had to roll my own using IO#pos and File#size. I am missing something?
<FromGitter> <jwoertink> `eof?`
<FromGitter> <jwoertink> isn't that a thing?
<Heaven31415> I really don't see it in docs
<Heaven31415> Maybe it's hidden
<FromGitter> <jwoertink> weird. I'm not seeing it either other than in CSV
<FromGitter> <jwoertink> I'd think `IO#eof?` would be a thing
<z64> >>186602915
<FromGitter> <jwoertink> maybe try and see if it magically works?
<Heaven31415> it isn't there
<FromGitter> <jwoertink> weird
<FromGitter> <jwoertink> I guess as a hack you could just `rescue EOFError`? Maybe submit a PR adding that in there?
<FromGitter> <r00ster91> in https://crystal-lang.org/api/0.26.1/IO.html#read%28slice%3ABytes%29-instance-method theres one way described to detect the end of the file
<Heaven31415> I will add PR, I just need to be sure it really isn't there :P
<Heaven31415> Yes, you can detect EOF using other methods
<Heaven31415> but you can't ask for it directly
<FromGitter> <jwoertink> yeah, I'd say since ruby has that, crystal might as well too
<FromGitter> <jwoertink> good catch
<Heaven31415> will you give me a medal? XD
<FromGitter> <bararchy> again with the damn trolling in the issues :\ my email notifications are full lol
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 272 seconds]
<lunarkitty> If you just switched the coc to something more neutral, like the one ruby has, wouldn't that lessen the drama eventually?
<FromGitter> <j8r> A PR can be deleted?!
<FromGitter> <j8r> Hum intersting article, but not why I would like to post 😅
<FromGitter> <j8r> CoCs are useless, that's always up to the "benevolent dictators" to judge and perform the actions
<lunarkitty> true
<lunarkitty> which is why they're irritating, it's extra baggage that simply causes friction
<FromGitter> <j8r> 💯
<lunarkitty> Jerks are going to be jerks either way, but some like to use cccoc as leverage from the looks of it
<lvmbdv> same
<lunarkitty> The internet is a mess these days *eye twitch*
<FromGitter> <j8r> Other topic, does this shard implements an efficient https://github.com/Thor77/tail.cr/blob/master/src/tail.cr
<FromGitter> <j8r> ...tail? I think there is room for more performance
<FromGitter> <ezrast> not efficient at all; it's re-reading the whole file every cycle
<FromGitter> <j8r> We can read a file starting at n bytes you say?
<FromGitter> <ezrast> @j8r https://crystal-lang.org/api/0.26.1/IO/FileDescriptor.html#seek(offset%2Cwhence%3ASeek%3DSeek%3A%3ASet)-instance-method
<FromGitter> <j8r> I don't know if there is a way to listen to events on a fd, or a file, to print only wgen new bytes arrive
<FromGitter> <j8r> Thanks @ezrast , I'll do a shard for it. I'm finishing one to parse and manipulate /etc/passwd, /etc/group and /etc/shadow
<FromGitter> <drum445> Hi all, is there a better way to replicate ruby's send method than this? ⏎ https://play.crystal-lang.org/#/r/53dn
<FromGitter> <j8r> I remember there is `#.raw &.read slice`
<FromGitter> <ezrast> You can just keep calling `gets` or whatever on a file that's at EOF
<jhass> drum445: depends a lot on your actual usecase, if your set of possible methods is huge, branching by prefixes can be a good performance win, likewise sorting common matches into the front etc.
<jhass> in general you often can find a better architecture or be fine with just a hash of procs or so
<FromGitter> <drum445> it's a small amount of properties on the class in question, something like getattr would be perfect but as that doesn't exist I thought that macro would be the best alternative
<FromGitter> <drum445> doesn't seem to have a speed impact but it's just a fair amount of code for what it does I guess
<jhass> I'd even consider forgoing of the domain object and just using a hash
<jhass> or have a to_h on the domain object
<FromGitter> <drum445> How would I implement a to_h method?
<jhass> in the simplest, def to_h; {"foo" => @foo, "bar" => @bar}; end
<FromGitter> <drum445> true, but with around 10-15 attr could get messy
<jhass> of course you could have macro fun there too, either def_to_h @foo, @bar or depending on Class#instance_vars again
<FromGitter> <drum445> yup true
<FromGitter> <drum445> If I'm using macros for to_h I may as well stick with the current one I guess
<FromGitter> <drum445> cheers for the advice though jhass
<jhass> of course all of this is assuming you actually need that kind of dynamic access to a domain objects instance vars, or separate out the values into instance vars in the first place opposed to just keeping them in hash. Either which may not be true
<jhass> sure yw
<FromGitter> <drum445> yep good point, I do need access to my objects dynamically as I have an array of attributes that I need to use for certain functions. I'm also not a big fan of loads of anonymous objects
rohitpaulk has joined #crystal-lang
<jhass> array because it's user input? If not use a tuple and macro for on that
moei has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
wontruef_ has joined #crystal-lang
wontruefree has quit [Ping timeout: 260 seconds]
wontruef_ has quit [Max SendQ exceeded]
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: bye]
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
Heaven31415 has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang