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
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 264 seconds]
A124 has quit [Ping timeout: 240 seconds]
A124 has joined #crystal-lang
andrewzah has quit [Quit: ""]
andrewzah has joined #crystal-lang
andrewzah has quit [Client Quit]
andrewzah has joined #crystal-lang
andrewzah has quit [Client Quit]
andrewzah has joined #crystal-lang
andrewzah has quit [Client Quit]
andrewzah has joined #crystal-lang
andrewzah has quit [Client Quit]
andrewzah has joined #crystal-lang
andrewzah has quit [Quit: ""]
andrewzah has joined #crystal-lang
andrewzah has quit [Client Quit]
andrewzah has joined #crystal-lang
leitoox has joined #crystal-lang
snsei has joined #crystal-lang
<crystal-gh> [crystal] bcardiff opened pull request #4962: Make Tuple and NamedTuples .types to return tuples of metaclasses (master...fix/tuple-types) https://git.io/v5yJN
<crystal-gh> [crystal] samueleaton opened pull request #4963: Adds nilable casting to YAML::Any for greater parity with JSON::Any (master...add-yaml-nilable-casting) https://git.io/v5yUZ
andrewzah has quit [Quit: ""]
andrewzah has joined #crystal-lang
andrewzah has quit [Client Quit]
andrewzah has joined #crystal-lang
andrewzah has quit [Client Quit]
andrewzah has joined #crystal-lang
andrewzah has quit [Client Quit]
andrewzah has joined #crystal-lang
andrewzah has quit [Client Quit]
andrewzah has joined #crystal-lang
andrewzah has quit [Remote host closed the connection]
andrewzah has joined #crystal-lang
rohitpaulk has joined #crystal-lang
andrewzah has quit [Client Quit]
andrewzah has joined #crystal-lang
andrewzah has quit [Client Quit]
andrewzah has joined #crystal-lang
andrewzah has quit [Client Quit]
rohitpaulk has quit [Ping timeout: 260 seconds]
snsei has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
andrewzah has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
andrewzah has quit [Quit: ""]
andrewzah has joined #crystal-lang
wes[phi] has joined #crystal-lang
wes[phi] has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
Papierkorb_ has joined #crystal-lang
<Groogy> Morning!
<FromGitter> <faustinoaq> 2:00 A.M. here :)
rohitpaulk has joined #crystal-lang
<Papierkorb_> Good morning
<FromGitter> <Enether> Hey guys, the tutorial says that `Pointer`s are a good way to implement efficient data structures
<oprypin> k
<FromGitter> <Enether> and it got me thinking, if I have something like a TreeNode which recursively references itself ⏎ ⏎ ```root = TreeNode.new ⏎ root.left = TreeNode.new``` ⏎ ⏎ Does this pass the class by value? No, right, only structs are passed by value ... [https://gitter.im/crystal-lang/crystal?at=59b8dd54bac826f054afb188]
mark_66 has joined #crystal-lang
<FromGitter> <Qwerp-Derp> oprypin: I'm getting an error when running my CrSFML project using Approach 1
<oprypin> Enether, what kind of tutorial says that?
enether has joined #crystal-lang
<oprypin> pointers are low level primitives that make everything work. doesnt mean you have to use them directly
<FromGitter> <Enether> sorry, not the tutorial but the docs
<FromGitter> <Enether> " However, pointers make it possible to interface with C and to implement efficient data structures. For example, both Array and Hash are implemented using pointers."
<FromGitter> <Enether> Or does that sentence mean efficient data structures interfaced through C?
claudiuinberlin has joined #crystal-lang
<oprypin> pointers are low level primitives that make everything work. doesnt mean you have to use them directly
<oprypin> you can use pointers for implementation of extremely specific things and for interfacing with C
<FromGitter> <Enether> yes
<Papierkorb_> Maybe there is a better wording possible in the docs. Can't think of one right now. Still too tired >_<
<FromGitter> <Qwerp-Derp> oprypin?
<FromGitter> <Enether> I know that but how does it compary to normal implicit references that Crystal creates?
<FromGitter> <Enether> like in the example I gave
<oprypin> Qwerp-Derp, what
<FromGitter> <Enether> my code should be as performant if I used a pointer to the tree’s left node
<Groogy> yeah it would
<Papierkorb_> Enether, references are pointers under the hood, they're equivalent in speed, and thus, you should absolutely prefer references and classes over pointers and structs
<FromGitter> <Qwerp-Derp> There's a `cc` error when I try to run my CrSFML project
<Groogy> with ref or with pointer it is the same, pointer is just more dangerous
<FromGitter> <Qwerp-Derp> I followed all the instructions in the README, yet there's still a long chain of errors
<FromGitter> <Qwerp-Derp> should I paste it in the chat?
<oprypin> preferably https://bpaste.net/
<Groogy> even working with C bindings I avoid pointers as much as possible and work with Slices instead for instance
<Papierkorb_> ^
<Groogy> if I am manipulating memory like for buffers to the graphics card
<FromGitter> <Enether> @Papierkorb_ thanks for the information, I just wanted to make sure I wasn’t missing something. Maybe we should consider adding some sort of comment to that doc page
claudiuinberlin has quit [Client Quit]
<FromGitter> <Qwerp-Derp> oprypin: https://bpaste.net/show/997e616cbee2
<Groogy> The doc should say "Used to interface with and to implement near-metal implementations"
<Groogy> or something akin to that, instead of "efficent data structures"
<Papierkorb_> Yeah, though `near-metal` will be confused again by people
<Groogy> ah true dang
<Papierkorb_> most are more scared by `low-level` it seems, so I'd go for that
<oprypin> ye
enether has quit [Quit: Page closed]
<Groogy> "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
<Papierkorb_> It should then mention the implicit #to_unsafe, and how one can use it to make usage more safe without messing with pointers directly
alex`` has quit [Quit: WeeChat 1.9]
<oprypin> Qwerp-Derp, i dont know :(
snsei has joined #crystal-lang
<FromGitter> <bew> Groogy 👍
<FromGitter> <Qwerp-Derp> oprypin: I'll try with v2.4.5, and see if that works - if not, I'll post an issue on GH
<oprypin> it's probably my bad. but i thought it worked fine on mac
<oprypin> problem is i cant do much about it
<Papierkorb_> apple doesn't allow to run their OS on non-apple machines :(
<Papierkorb_> So .. too bad for their users I guess
<FromGitter> <Qwerp-Derp> Yeah, it works with v2.4.5
<FromGitter> <Qwerp-Derp> But not the most recent version
<FromGitter> <crisward> If I wanted to communicate data between two crystal processes, what would be the most efficient way of doing this? I'm thinking something like json would require encoding / parsing. I'm thinking on the same server.
<Papierkorb_> Well, there is the Cannon shard
<Papierkorb_> Still TCP though
<oprypin> Papierkorb_, cant it use file sockets?
<Papierkorb_> oprypin: It could if someone would write the code for it
<oprypin> but i thought it's like totally interchangeable, so tiny change
<Papierkorb_> Correct
<FromGitter> <crisward> Thanks.. taking a look at Cannon now.
<oprypin> Qwerp-Derp, i'll look into it, thanks
<oprypin> so the problem happens when you run `crystal build` ?
<FromGitter> <Qwerp-Derp> I might try with v2.4.10, but I'm just concerned with getting my game to run at the moment
<FromGitter> <Qwerp-Derp> No, it happens when I do `crystal {name of file}`
<oprypin> damn, i cant reproduce that
<oprypin> i was gonna do some Travis abuse lol
<FromGitter> <Qwerp-Derp> I might try `crystal build .` later
A124 has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Ping timeout: 246 seconds]
claudiuinberlin has joined #crystal-lang
A124 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<Papierkorb_> bararchy, I assume your fann crystal bindings use a recent version? Found your comment on the ruby-fann ticket lol
<FromGitter> <faustinoaq> I just realize Crystal have had 14 web framework without been 1.0 yet 😅 ⏎ ⏎ https://crystal.libhunt.com/categories/5128-web-frameworks
<txdv> o everyone wants to create their own framework and be the most used one
<txdv> but they dont realize that they have to maintain it
<FromGitter> <faustinoaq> Yeah, the maintain part is the hardest :)
<txdv> most of the people just want to achieve critical mass and pass it of to some others
<txdv> so they can be the author of the framework but not do anything useful
alex`` has joined #crystal-lang
<FromGitter> <faustinoaq> Yeah, I hope we join efforts in Kemal (like Sinatra minimalist) and Amber (like Rails full featured). ⏎ ⏎ Too much duplicate efforts aren't good.
<FromGitter> <faustinoaq> In fact Amber reuses code and concepts of Kemal and we share optimizations and bugs fixes too.
<FromGitter> <sdogruyol> Morning everyone!
<Papierkorb_> Hi sdogruyol
<FromGitter> <sdogruyol> Yes, that's a great collaboration @faustinoaq 👍
<FromGitter> <sdogruyol> hi @papierkorb how are you?
<Groogy> sdogruyol o/
<FromGitter> <sdogruyol> hey @Groogy
<Papierkorb_> Doing fine, just found out you can use Jupyter notebooks with ruby - It's glorious! And you?
<FromGitter> <sdogruyol> I'm also fine, just writing some Ruby :P
rohitpaulk has quit [Ping timeout: 255 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
<FromGitter> <bew> Papierkorb_, I'm wondering how you use Notebooks? do you do data science or things like that?
<FromGitter> <crisward> Ruby? Is that the thing people use when they want their crystal code to run slowly?
claudiuinberlin has joined #crystal-lang
<FromGitter> <bew> yeah it's for debugging *ok I'm out*
<Papierkorb_> bew, looks like I'll need to do something like that, and figured if so might as well use a nice interface for that
rohitpaulk has quit [Ping timeout: 255 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <bew> cool! jupyter projects are really nice, very configurable, we use them as a base for an online training plateform in data science where I work
rohitpaulk has joined #crystal-lang
Tuxified has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex`` has quit [Quit: WeeChat 1.9]
bmcginty has quit [Ping timeout: 240 seconds]
bmcginty has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
ShalokShalom_ has joined #crystal-lang
hightower3 has joined #crystal-lang
ShalokShalom has quit [Ping timeout: 240 seconds]
hightower4 has quit [Ping timeout: 252 seconds]
ShalokShalom_ is now known as ShalokShalom
<FromGitter> <codenoid> hi, i really need help, about order by or sort in mongo.cr, i want order by age, my document just like this > https://s26.postimg.org/kxr1idkx5/Screen_Shot_2017-09-13_at_17.44.26.png
<oprypin> Qwerp-Derp, can't reproduce on travis. https://travis-ci.org/oprypin/crsfml/jobs/274972336#L1835 it fails but due to lack of audio devices and stdio, gonna skip those examples
Tuxified has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<oprypin> Qwerp-Derp, I suspect that you used Crystal code from one revision and C wrapper from another revision
<oprypin> possibly using leftover globally installed voidcsfml
<FromGitter> <bararchy> Papierkorb_ lol yeha XD
<FromGitter> <bararchy> I use 2.20
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <bararchy> 1) 2.0*
claudiuinberlin has joined #crystal-lang
<FromGitter> <bararchy> Are you interesting in Machine Learning ?
rohitpaulk has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
Tuxified has joined #crystal-lang
<FromGitter> <codenoid> oh, haha i need to improve my debugging skills
Tuxified has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <Rinkana> I have something like this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Is there a way to get the `read_line` line to alway's stay at the bottom of the console while typing? [https://gitter.im/crystal-lang/crystal?at=59b913ac614889d475f16d1f]
<Papierkorb_> bararchy, I always was but never had something I really wanted to pour time in. The current employer wants me to do something with their stuff, so...
<Papierkorb_> Bonus points, as a (previously pure) ruby shop (now some Go), they never used Crystal cause no one knew their way around it. Legend has it that those tools I write here for them in ruby are by pure coincidence easily portable to Crystal.
<FromGitter> <krypton97> One of the best written DOM parser library I've found so far, it's like jQuery :)
<Papierkorb_> Every reasonable html parser lib should support css selection
<FromGitter> <krypton97> It does, I couldn't find anything missing so far.
Tuxified has joined #crystal-lang
alex`` has joined #crystal-lang
<Papierkorb_> bararchy, honestly, isn't AI/ML just an artifact of todays huge amounts of data (most of which have no reason to be collected in the first place), an unspoken cry that we don't have enough time to make sense of that mountain of bytes by ourselves, and thus hope the computer now magically does an infallibly better job? AI/ML sure is a powerful tool, yet something one should not trust by pure belief "in computers". In fact, as we don't understand
<Papierkorb_> what is actually going on, it's actually scary that companies use them for critical tasks.
<Papierkorb_> (Well, for NN and friends we have no idea)
<FromGitter> <bararchy> Papierkorb_ you write well :) ⏎ ⏎ Anyway, yes and no, the big part of machine learning is indeed BigData, but there is so much more, ImageRecognition, User behaviroal analysis, non-liner pattern recognition and even information security. ⏎ It is a very vast field that most likely will automate most modern jobs very shourtly and a field that if I wasn't part of, I would enter ASAP
Tuxified has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <sdogruyol> Ugh, I imagine a lot of middle-man jobs being taken away in next 10 years
<FromGitter> <bararchy> Yap :\
Tuxified has joined #crystal-lang
<FromGitter> <sdogruyol> Not sure what's gonna happen...hopefully not WW3
<FromGitter> <sdogruyol> there's already loads of unemployed people causing trouble
<Papierkorb_> Yes and no. Mankind didn't survive by accident, but by adaption. We'll do fine.
<FromGitter> <sdogruyol> add more unemployed + hungry people, I don't wanna imagine that
<Papierkorb_> On the large scale. Local problems (politicians being idiots? Wow) are a different matter..
<FromGitter> <sdogruyol> adaptions are always have some side effects
<FromGitter> <codenoid> hi, what alternative of `.to_s.to_i`
Tuxified has quit [Client Quit]
<FromGitter> <sdogruyol> that's a good graph @bararchy thanks 👍
<FromGitter> <bararchy> If you don't want to lose your job to automation, take one of the red circles as your future job haha
<FromGitter> <bararchy> Or learn ML\AI ;)
<FromGitter> <sdogruyol> Education 👍
<Papierkorb_> Don't worry, they'll try
<Papierkorb_> And then we'll learn 10 years later we raised a generic bunch of people who don't know anything outside the perfect bubble due to biased ML models. Who knew?
<FromGitter> <sdogruyol> ain't that already the case with generation Y
<FromGitter> <sdogruyol> no need for ML for that :D
<FromGitter> <Qwerp-Derp> Just curious, what do you guys all use for devving Crystal?
<FromGitter> <sdogruyol> < Sublime Text
<FromGitter> <sdogruyol> also Arch Linux
<Papierkorb_> Hard to tell sdogruyol. Where's light there's shadow. I still think centralized social networks is the worst development of the past decade. But while extremists use it to spread their idiocracy and bots their lies, it helps many people.
<Papierkorb_> Atom on ArchLinux
<FromGitter> <bararchy> Sublime Arch
<FromGitter> <bararchy> with the new scry plugin
<FromGitter> <bew> Vim (neovim) Arch
<FromGitter> <bararchy> TBH the more monduane (is that how you write it?) your job is, the more likely it will be taken by Automation, the more imegenative and unpredictable it is, the less likely it will be automated
<FromGitter> <bararchy> Programming is a clear case of "wont be automated fully anytime soon"
<Papierkorb_> they tried for simple things, they failed
<FromGitter> <bararchy> And this is good for us, as we don't really want AI bots re-programming them slef hahah
<Papierkorb_> Oh one of my professors tried to show off a startup (of one of his friends) trying that
<Papierkorb_> Yeah ever heard of a CMS?
<FromGitter> <faustinoaq> > Just curious, what do you guys all use for devving Crystal? ⏎ ⏎ VSCode (https://github.com/crystal-lang-tools/vscode-crystal-lang) 😄
<FromGitter> <faustinoaq> Also see https://github.com/crystal-lang-tools
<FromGitter> <bararchy> Well -> https://github.com/primaryobjects/AI-Programmer
<FromGitter> <faustinoaq> Hey people check this https://willrobotstakemyjob.com/
<FromGitter> <faustinoaq> Is like @bararchy graph but as search engine 😄
<FromGitter> <bararchy> Papierkorb_ because the increase in technology advancment is non-liner (exponential) we have a POC, then half a year later a startup doing it, then huge companies make it the next bit buzzword
<FromGitter> <faustinoaq> > Or learn ML\AI 😉 ⏎ ⏎ Yeah, Maybe In the future ML\AI libraries would be in standard libraries of programming languages. ⏎ ⏎ Also Education and Innovation/Research are good choices. [https://gitter.im/crystal-lang/crystal?at=59b91fdfbac826f054b116cb]
rohitpaulk has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #crystal-lang
<FromGitter> <bararchy> Well
<FromGitter> <faustinoaq> > XD https://willrobotstakemyjob.com/15-1111-computer-and-information-research-scientists ⏎ ⏎ :( https://willrobotstakemyjob.com/13-2011-accountants-and-auditors ⏎ ⏎ Oh, My friend is accountant 😟 Maybe I can tell to him to study programming, never is late. [https://gitter.im/crystal-lang/crystal?at=59b920f1319100804e2d21d0]
<FromGitter> <bararchy> we even got Crystal there
<FromGitter> <faustinoaq> Yeah 👍
<FromGitter> <codenoid> will be robot maintainer
<FromGitter> <bararchy> thats kinda "assembly line repairs" I guess 100% easy to automate
<FromGitter> <bararchy> hhahah
<FromGitter> <bararchy> in the end all those you tube artists will be the only ones with jobs
<FromGitter> <bararchy> hahaha
<FromGitter> <codenoid> lol
<FromGitter> <bew> @bararchy what a beautiful world... x)
<FromGitter> <bararchy> XD
<FromGitter> <faustinoaq> XD
<FromGitter> <faustinoaq> > in the end all those you tube artists will be the only ones with jobs ⏎ ⏎ Yeah, totally safe - https://willrobotstakemyjob.com/27-2012-producers-and-directors
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <faustinoaq> I don't see a VSauce channel managed by an AI 😅
<FromGitter> <bararchy> Humor is very hard to automate ? XD
<FromGitter> <bararchy> Welllllllllll
<FromGitter> <faustinoaq> Well, humor is for humans, is it?
<FromGitter> <bararchy> Also a very funny AI made movie https://www.youtube.com/watch?v=LY7x2Ihqjmc
claudiuinberlin has joined #crystal-lang
<FromGitter> <faustinoaq> > Not bad, A.I. comedian. Not good either, to be fair. But not bad. ⏎ ⏎ So, at the end of the end, We are all doomed 😟
<FromGitter> <bararchy> In a 50-60 year prespective, yeha , I guess we are, Still, I would contribute to the AI raising wihtout a 2nd thought
<FromGitter> <bararchy> It's the next stage of humanity
<FromGitter> <faustinoaq> Crystal would be an AI that would kill us ... or love us ¿?
<Papierkorb_> It'd create a world built out of only semantically pleasing blocks
<FromGitter> <bararchy> Right now it's an AI the has Int default to 32 and float default to 64
<FromGitter> <bararchy> :(
<FromGitter> <bararchy> making my examples look like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59b92578b59d55b823ef08f3]
<FromGitter> <faustinoaq> OMG, so Crystal-AI would kill us in the future 😟
<FromGitter> <bararchy> if an AI would raise , it most likely be made in Python or R
<FromGitter> <bararchy> haha
<Papierkorb_> Ah then we're saved
<FromGitter> <bararchy> Google TensorFlow and Torch
<Papierkorb_> Too slow
<FromGitter> <faustinoaq> XD
<FromGitter> <bararchy> HAHAH
<FromGitter> <faustinoaq> Maybe in in AI future would be written in Julia
<FromGitter> <bararchy> Julia is Java based right ?
<FromGitter> <faustinoaq> No, Julia have Ruby syntax too
<FromGitter> <faustinoaq> and uses a JIT
<Papierkorb_> Julia is LLVM
<FromGitter> <faustinoaq> Yeah
<Papierkorb_> Scala is JVM
<FromGitter> <bararchy> Google is best AI manufacturer right now, with deep mind and alpha go, so, AI will be in Go ?
<FromGitter> <bararchy> Also google self driving cars are better then Teslas
<FromGitter> <bararchy> so GO AI will control the universe
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <faustinoaq> Well, Maybe we will have an AI-diversity in the future, with Crystal-AI, Python-AI, Go-AI and so on.
<FromGitter> <bararchy> each with it's own country ?
<FromGitter> <bararchy> all hating the other ?
<FromGitter> <bararchy> Ruby-AI figthing Python-AI
<Papierkorb_> Rubies are harder than sketches
<FromGitter> <faustinoaq> Maybe AI would be the weapons of the future
<Papierkorb_> They sadly are
<FromGitter> <bararchy> Already are
<FromGitter> <codenoid> or may also be our protector of the future
<FromGitter> <bararchy> sorry @faustinoaq
<FromGitter> <faustinoaq> > each with it's own country ? ⏎ ⏎ Then, Countries would close their knowledge and use it to fight with others. Sadly but true.
<Papierkorb_> That already happens
<FromGitter> <bararchy> LOL yeha
<Papierkorb_> Called military research
<FromGitter> <codenoid> :(
<Papierkorb_> Has happened since mankinds inception
<FromGitter> <bararchy> I know of a few defense contractors working with weaponzing AI
<FromGitter> <bararchy> also, more then a few academic works on the subject
<Papierkorb_> I honestly don't have any respect for anyone personally who does that
<FromGitter> <faustinoaq> > Called military research ⏎ ⏎ So is possible that the hardest problems of parallelism and concurrency, and new stuff inimaginable in programming as quantum programming is already discovered and they are using it silently.
<FromGitter> <bararchy> Yap, it's f**ed up
<Papierkorb_> That is the case
<FromGitter> <bararchy> "possible" ? it is the reality
<FromGitter> <bararchy> also, quantom computers are already a thing
<Papierkorb_> E.g., assymetric cryptography was discovered many many years before by some US agency before a public researcher thought of it too
<FromGitter> <bararchy> @faustinoaq https://www.dwavesys.com/quantum-computing
<oprypin> i dont like where this conversation is going
<FromGitter> <bararchy> hey, I already took out my tin foil hat out
<FromGitter> <bararchy> no going back now
<FromGitter> <bararchy> hahah
<FromGitter> <bararchy> just kidding, let's get back to Crystal ? :)
<FromGitter> <faustinoaq> 😅 Yeah, was a good conversation but I think we should keep in 2017, where Crystal is still a programming language.
<FromGitter> <bararchy> BTW, why is Int default to 32 and Float to 64 ?
<FromGitter> <bararchy> Is it intentional ?
<FromGitter> <codenoid> > hi, what alternative of `.to_s.to_i`
<Papierkorb_> Yes
<Papierkorb_> bararchy, Int32 probably because of x86 `int` (and tbh, it's the most useful of the bunch)
claudiuinberlin has joined #crystal-lang
<FromGitter> <bararchy> TBH I care about why Float64 is default
<FromGitter> <bararchy> maybe I'll recompile lib-fann with dauble as default
<FromGitter> <faustinoaq> 👍
rohitpaulk has joined #crystal-lang
alex`` has quit [Quit: WeeChat 1.9]
alex`` has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
<FromGitter> <Rinkana> @codenoid `Int32.new(value)`
early has quit [Ping timeout: 240 seconds]
early has joined #crystal-lang
byteflame has quit [Ping timeout: 240 seconds]
thelonelyghost has quit [Ping timeout: 240 seconds]
TheGillies has quit [Ping timeout: 240 seconds]
braidn[m] has quit [Ping timeout: 240 seconds]
dtcristo has quit [Ping timeout: 246 seconds]
watzon has quit [Ping timeout: 246 seconds]
olbat[m] has quit [Ping timeout: 255 seconds]
weston_[m] has quit [Ping timeout: 255 seconds]
jplatte has quit [Ping timeout: 264 seconds]
cptaffe has quit [Ping timeout: 264 seconds]
sija[m] has quit [Ping timeout: 246 seconds]
<FromGitter> <faustinoaq> @sdogruyol Do you know How many people filled the Crystal survey ?
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <sdogruyol> yes
<Papierkorb_> lol
<FromGitter> <sdogruyol> the result are gonna be out soon :)
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <faustinoaq> 😄
claudiuinberlin has joined #crystal-lang
olbat[m] has joined #crystal-lang
<FromGitter> <bararchy> how can I itirate a Bytes[] and increase in 1 every 10th byte ?
<RX14> what exact type are you talking about here
<RX14> just Slice(UInt8)? or UInt8[] or what
<FromGitter> <bararchy> Slice
<RX14> ok
<FromGitter> <bararchy> Bytes = Slice(UInt8) no ?
<RX14> yep
<RX14> you said Bytes[]
<FromGitter> <bararchy> Sorry, I mean a Bytes array
<FromGitter> <bararchy> as in Bytes
<RX14> which if taken literally would mean StaticArray(Bytes, ?)
<FromGitter> <bararchy> nvm, my bad
<RX14> yeah lol
<RX14> use each_with_index and check if it's a multiple of 10 with mod
<RX14> if it is then just bytes[i] += 1
<RX14> assuming thats what you mean
<RX14> t
<Papierkorb_> Or: `(1...bytes.size).step(10){|i| bytes[i] = 10u8}`
<RX14> actually yeah
<RX14> thats much better
<RX14> because you dont load each, you only load 1 in 10
<RX14> it wont skip any cachelines if its only 1 in 10 though
<RX14> will save a few cycles
<Papierkorb_> well for this particular example it won't make a difference. Though I guess, that these numbers are not the real world code numbers anyway :P
<RX14> the compiler probably wont be able to elide the loads either because of the fault behaviour
<FromGitter> <bararchy> Can't write to read-only Slice
<FromGitter> <bararchy> Hm...
<RX14> well where did you get the slice from
<FromGitter> <bararchy> File.read
<RX14> ...
<RX14> Fli.e.read returns a string
<FromGitter> <bararchy> trying to distort a png image
<RX14> you can't modify strings
<FromGitter> <bararchy> oh, I did to_slice
<RX14> yes
<Papierkorb_> You're doing it wront (tm)
<RX14> ^
<FromGitter> <bararchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59b93bbcb59d55b823ef9a5c]
<RX14> use File here
<FromGitter> <bararchy> This :)
<RX14> simply navigate to the PNG start, read_byte, +1, write_byte, pos += 10, repeat
<RX14> all in an IO
<RX14> thats actually probably quite slow because of the IO read buffering
<RX14> hmm
<Papierkorb_> Just read it chunked, if it's a large file
<FromGitter> <bararchy> quite small
<FromGitter> <bararchy> a few kilobytes
<Papierkorb_> Then whatever, read as a whole
<RX14> open the file and allocate a slice using File#size
<RX14> then just #read(Bytes) into it
<RX14> modify
<RX14> #write(Bytes) it wout again
<RX14> out*
<Papierkorb_> A `File.read_all` would be quite handy
<RX14> yeah
<Papierkorb_> Or a `IO#read_to_end` in general
<RX14> we have gets_to_end for string
<RX14> and skip_to_end
<Papierkorb_> The String-centric API ain't too useful
<FromGitter> <bew> Papierkorb what would be the diff with File.read?
<RX14> so a read_to_end would fit I think
<FromGitter> <lhz> @bararchy have you looked at https://github.com/stumpycr/stumpy_png ?
<RX14> i wonder what skip_to_end should do on Files
<RX14> should it be a File#pos no-op?
<Papierkorb_> RX14: That might lead people to do gets_to_end.to_slice and then other whacky things
<RX14> or do the semantics require you to actually read and discard
<Papierkorb_> RX14: Like ... barachy did
<Papierkorb_> (kinda)
<RX14> Papierkorb_, hmm?
<FromGitter> <bararchy> :(
<RX14> i don't understand, what change are you referring to
<RX14> currently gets_to_end is what we have
<RX14> read_to_end would return a slice
<Papierkorb_> Not change, but the API is simply too string centric right now
<RX14> yeah
<RX14> i agree
<FromGitter> <bararchy> we need #each_byte_with_index
<FromGitter> <bararchy> :)
<RX14> ??
<RX14> that wouldnt help tho
pduncan has quit [Ping timeout: 252 seconds]
<FromGitter> <bararchy> it will allow me to do ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59b93e19319100804e2dd52b]
<FromGitter> <bararchy> wait... my math is wrong
<FromGitter> <bararchy> lol
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <lhz> https://crystal-lang.org/api/0.23.1/IO.html#each_byte-instance-method and https://crystal-lang.org/api/0.23.1/Iterator.html#with_index(offset%3AInt%3D0%2C%26block)-instance-method should do the trick?
cptaffe has joined #crystal-lang
braidn[m] has joined #crystal-lang
byteflame has joined #crystal-lang
dtcristo has joined #crystal-lang
thelonelyghost has joined #crystal-lang
jplatte has joined #crystal-lang
watzon has joined #crystal-lang
TheGillies has joined #crystal-lang
sija[m] has joined #crystal-lang
weston_[m] has joined #crystal-lang
<FromGitter> <bararchy> Cool , nice idea @lhz
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/v5ydp
<crystal-gh> crystal/master 28484f8 Sam Eaton: adds nilable casting for greater parity with JSON::Any (#4963)
Papierkorb_ has quit [Quit: Konversation terminated!]
claudiuinberlin has joined #crystal-lang
<FromGitter> <bararchy> RX14, does this makes sense ? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59b9415bcfeed2eb6504877a]
<RX14> i would be surprised if that was faster than reading it in, modifying it, and then writing it out again
<RX14> but yes it makes sense
<RX14> you have it and it's probably within a few % of the optimum
<FromGitter> <bararchy> :)
<FromGitter> <bararchy> good enough , it's just to test constant distortion in png
<FromGitter> <bararchy> for image recognition
<RX14> style-wise, use FIle.open with block
<FromGitter> <bararchy> true
<FromGitter> <bararchy> then I wont need to close
<RX14> and skip the ternary
<RX14> just use if
<RX14> unless you use bytes[i] = (ternary)
<RX14> actually yeah thats probably cleanest
<FromGitter> <bararchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59b9428e319100804e2df168]
<FromGitter> <bararchy> Thanks RX14 and Papierkorb_ :)
<FromGitter> <bew> @bararchy maybe you can directly open the file in read-write, so you don't nee to open it twice?
<FromGitter> <bararchy> I dont want to destroy original
<FromGitter> <bararchy> it's not the same file
<FromGitter> <bew> ah right
<FromGitter> <bararchy> 1) image002.png ⏎ 2) image0022.png
<FromGitter> <bararchy> yeha, was lazy naming
<FromGitter> <bararchy> haha
<FromGitter> <bew> you can write `File.write("path", bytes)`
<FromGitter> <faustinoaq> Hey, RX14 are crystal attributed (`@[AlwaysInline], @[Link], etc` documented in some place ?
<FromGitter> <bew> And I think RX14 meant `bytes[i] = i % 10 == 0 ? b + 1 : b` but I'm not sure
<RX14> please, bracket the condition here @bew
<RX14> thats unreadable without
<FromGitter> <faustinoaq> RX14: Thanks you! 😅
<FromGitter> <bew> like `bytes[i] = (i % 10 == 0) ? b + 1 : b`?
<RX14> yes
<RX14> what @bararchy did was what i first suggested
<FromGitter> <bew> indeed, it's better
<RX14> then i changed my suggestaion again
<FromGitter> <bew> (readable)
<travis-ci> crystal-lang/crystal#28484f8 (master - adds nilable casting for greater parity with JSON::Any (#4963)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/275062605
<DeBot_> https://github.com/crystal-lang/crystal/pull/4963 (Adds nilable casting to YAML::Any for greater parity with JSON::Any)
rohitpaulk has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <mverzilli> @crisward this writeup is awesome: https://www.duodesign.co.uk/blog/from-node-to-crystal/
<FromGitter> <mverzilli> I'm currently working on a legacy node.js app for a client, and reading your article felt as though the title should have been "Why you should suggest your client to rewrite this in Crystal, Martin"
<FromGitter> <asterite> Goose bumps when I read "This site is written in crystal"
<FromGitter> <asterite> @crisward Really nice article!
<FromGitter> <bew> sent to my node friends!
<FromGitter> <bew> it's just a matter of time before they come to crystal ^^
LastWhisper____ has joined #crystal-lang
elbuki has joined #crystal-lang
<vegai> how would you guys profile the compiler?
<vegai> I suppose asterite has done that, due to his "why the compiler is slow" issue
<vegai> I'm guessing llvm might have something, but I have no idea
claudiuinberlin has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
<FromGitter> <crisward> @mverzilli Thanks. @asterite We have 5 sites now using crystal... so far so good.
<FromGitter> <rmosolgo> 👋 just stopping by after reading the node-to-crystal post
<FromGitter> <rmosolgo> very jealous to read about crystal in production :) i've done so many little trial projects but haven't had a chance to really build something yet
<FromGitter> <rmosolgo> so thanks for the writeup!
<FromGitter> <Rinkana> I have something like this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Is there a way to get the `read_line` line to always stay at the bottom of the console while typing? [https://gitter.im/crystal-lang/crystal?at=59b95353bac826f054b26a0f]
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> what do you mean?
<FromGitter> <bew> You want a kind of window with output from a fiber, above your input line?
<FromGitter> <bew> I think you'll need something like ncurses to do that
<FromGitter> <bew> it's not *that* easy
Tuxified has joined #crystal-lang
elbuki has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<FromGitter> <Rinkana> Yeah
elbuki has joined #crystal-lang
<FromGitter> <Rinkana> That's indeed what i'm trying to do
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
alex`` has quit [Quit: WeeChat 1.9]
claudiuinberlin has joined #crystal-lang
rohitpaulk has joined #crystal-lang
alex`` has joined #crystal-lang
<elbuki> Is there a reason why the HTTP server wraps request and response into context?
<elbuki> I know it's by design, but is there a reason why it's like that?
<RX14> easier to pass around
alex`` is now known as alexherbo2
<RX14> we have middleware (handlers) so it's much easier for them to replace entire requests
alexherbo2 is now known as alex``
<RX14> otherwise they'd have to take a request and response and return a request and response
<RX14> this way they can just modify the mutable context
Tuxified has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Tuxified has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<elbuki> right, thanks...
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
Tuxified has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<elbuki> Is there a Rubocop equivalent for Crystal?
<FromGitter> <faustinoaq> Not yet, but Crystal compiler itself, do pretty well with formatting, parsing check and helpful messages 😄
<FromGitter> <faustinoaq> Maybe someone can reuse crystal compiler and make a CryCop as static checker for real.
<elbuki> Hmm, that seems interesting...
<FromGitter> <crisward> My blog post is getting a bit of attention...
<FromGitter> <crisward> ah, someone added it to reddit.
<FromGitter> <megatux> awesome post Cris. I posted it ;)
<elbuki> I don't think 'CryCop' would be a good name.
<FromGitter> <crisward> @megatux thanks. Got realtime (crystal) sockets on there, seeing readers popping up from all over the world. Very cool.
<FromGitter> <megatux> @crisward thx to you. I don't want to post in our internal slack channel, it'll start a flamewar with the Node guys :D
<FromGitter> <faustinoaq> @crisward Thanks you for use crystal in the wild 👏
<FromGitter> <faustinoaq> > I don't think 'CryCop' would be a good name. ⏎ ⏎ Maybe CroCop XD
<FromGitter> <georgeu2000> @crisward Is this the post you are referring to? https://www.duodesign.co.uk/blog/from-node-to-crystal/
<FromGitter> <crisward> @georgeu2000 yes
<FromGitter> <georgeu2000> I see you are equating Kemal with Crystal. Does a web app need Kemal?
<FromGitter> <crisward> @georgeu2000 not really, but Crystal doesn't have a router as such. It's also nice to have a common platform to write towards, kemal and other frameworks tend to attract 'compatible' code.
<FromGitter> <crisward> Also one fewer part of the stack to look after.
<FromGitter> <crisward> Im also equating node with Express... perhaps I should be clearer.
<FromGitter> <georgeu2000> I didn't see this part: "A simple controller in Crystal (using the Kemal framework)" ⏎ So, actually you are not equating. Just using Kemal.
<FromGitter> <georgeu2000> Maybe I'll convert my site to Crystal...
<Papierkorb> > The DuoCMS 5 server code is around 15,609 lines of javascript, DuoCMS 6 is closer to 10,186. At this point in time, DuoCMS 6 actually has more features with 30% fewer lines of code and no confusing control flow!
<Papierkorb> This is big
<FromGitter> <megatux> @crisward could you share your shards list ?
<FromGitter> <crisward> @megatux can do, it's not very exciting though...
<FromGitter> <bararchy> @crisward awesome post indeed !
<FromGitter> <sdogruyol> great post @crisward
<FromGitter> <sdogruyol> have you posted anywhere yet?
<FromGitter> <crisward> Someone in our office tweeted it earlier and it's bounced around from there.
<FromGitter> <sdogruyol> care to share the tweet? :P
<FromGitter> <mgarciaisaia> @sdogruyol we've retweeted it from @CrystalLanguage
<FromGitter> <sdogruyol> thanks 👍
<FromGitter> <bararchy> @crisward I guess the single entry from Israel is me ? XD
<FromGitter> <faustinoaq> And the single from Panama is me XD
<FromGitter> <georgeu2000> I'll retweet.
<FromGitter> <crisward> @bararchy @faustinoaq well spotted...
elbuki has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<FromGitter> <eliasjpr> @ysbaddaden I used you selenium webdriver for crystal and was able to put together a system test lib https://github.com/amberframework/system-test
<FromGitter> <eliasjpr> I would like some feedback
rohitpaulk has quit [Ping timeout: 248 seconds]
<Papierkorb> OT, is multi-accounting against twitters ToS?
claudiuinberlin has joined #crystal-lang
<FromGitter> <sdogruyol> nope
<FromGitter> <sdogruyol> what do you mean by multi-accounting?
<Papierkorb> Well, multiple accounts owned by the same person
<FromGitter> <michalbric> > Doesn't have Incremental compilation ( Would be nice, our current system take around 8 seconds to compile after a code change ). ⏎ That's nice. Our main project takes 8 minutes to compile.
<FromGitter> <sdogruyol> that's ok
<FromGitter> <sdogruyol> @michalbric which project?
<FromGitter> <crisward> @sdogruyol Have you posted it on Hacker News?
<FromGitter> <sdogruyol> someone else already did
<Papierkorb> michalbric, is that with `--production`?
<FromGitter> <michalbric> unralted, just java backend. I found it funny that 8 seconds is worth mentioning :D
<Papierkorb> Ah
<FromGitter> <crisward> It may not make it that high, but starting to think I should have put it on a server with slightly less going on
<FromGitter> <sdogruyol> lol
<Papierkorb> michalbric, many come to Crystal from scripting languages, so the "instant feedback, repeat" development cycle is used by many, hence 8sec is noticable :)
<RX14> 8sec isn't the best we can do
<RX14> and that's what really matters i think
<Papierkorb> Yeah would be el neato
<FromGitter> <michalbric> I guess that makes sense, yeah :)
<FromGitter> <crisward> Give it a nudge, see if we can be the first to crash a crystal powered site https://news.ycombinator.com/item?id=15240984 😉
<FromGitter> <sdogruyol> yeah
<Papierkorb> crisward, how complex is *that* page render? static data? or full blown CMS stuff?
<FromGitter> <crisward> @sdogruyol It appeared there first, well after twitter. It's database driven, but has in memory cache for most of it.
<Papierkorb> crisward, I didn't even pay attention to it first, but the load is simply instant. Such pages are becoming rare
<FromGitter> <crisward> If anything is going to die it'll be the socket code which is logging views mysql.
* Papierkorb thinks of drupal pages
<Papierkorb> *shudder*
<Papierkorb> crisard, Redis to the rescue
<FromGitter> <crisward> The page speed is due to lots of browser caching and inlined css.
<Papierkorb> Yeah, looks like decent no-bullshit HTML
<FromGitter> <crisward> We enabled redis for higher traffic sites, especially for sessions. Our site is not a high traffic site... It's also sharing a server with our gitlab instance which eats everything it can.
<FromGitter> <crisward> Hacker news isn't taking off, it should have be posted with a more click baity title - how about "This is the programming language Google don't want you to know" 😉
<FromGitter> <fridgerator> hah
<FromGitter> <fridgerator> "nude programing languages click here"
<Papierkorb> "Speed up your NodeJS site with this one trick they don't want you to know"
<FromGitter> <crisward> Really though, if more programmers tried Crystal, who'd use go-lang, I mean really?
<Papierkorb> I still don't understand why the web folks all fled to Go
<Papierkorb> Sounds like a "Google put this out, it must be good for web, they're a web company right?!"
<FromGitter> <crisward> It probably works well at their scale, there are many things which work well with big teams... You typically want something strict and dull. There is a spate on the web of smaller teams over engineering because they follow google, facebook etc..
<Papierkorb> I mean, if Go is meant as C replacement, then Go is just a inferior version of Rust
<FromGitter> <crisward> 7 votes on hacker news - think I'm fairly safe.
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
LastWhisper____ has joined #crystal-lang
LastWhisper____ has quit [Client Quit]
LastWhisper____ has joined #crystal-lang
<FromGitter> <sdogruyol> wish it goes first page
<FromGitter> <crisward> Me too, don't get a chance to do real world load testing very often.
sz0 has joined #crystal-lang
Tuxified has joined #crystal-lang
Tuxified has quit [Read error: Connection reset by peer]
elbuki has joined #crystal-lang
<crystal-gh> [crystal] samueleaton opened pull request #4967: Fixes "overloads" typo in specs (master...fix-overload-typo) https://git.io/v5SaW
rohitpaulk has joined #crystal-lang
<Yxhuvud> Papierkorb: depends on if they want to get shit done or if they want something that create more or less complete system development solutions.
<Yxhuvud> C has more than one use case, even if the trend goes toward the latter.
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Papierkorb> Oh I really like C and C++. They have ton of use-cases, and considering their age, they're solid
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/v5SKY
<crystal-gh> crystal/master 556c8b1 Sam Eaton: fixes overload typo in specs (#4967)
<FromGitter> <sdogruyol> @crisward also on https://lobste.rs/s/cnkglf/journey_from_node_crystal
<Papierkorb> Wow I really can't hear the "but API calls!" argument anymore
<Papierkorb> “but what if told you that you could implement those api calls also in a fast language”. It's like those milliseconds don't add up fast
<FromGitter> <sdogruyol> lol
<Papierkorb> "case for most alpha languages" ... huh
<Papierkorb> And then rambles about Go being a good option
<Papierkorb> C'mon, what do you want
<FromGitter> <sdogruyol> it's weird
<FromGitter> <sdogruyol> people always tend to like languages coming from big companies no matter why
<crystal-gh> [crystal] asterite opened pull request #4968: Nicer output when an exception bubbles through main (master...feature/better-callstack) https://git.io/v5S6Q
<FromGitter> <sdogruyol> wow a great PR from asterite just landed https://github.com/crystal-lang/crystal/pull/4968 👍
<travis-ci> crystal-lang/crystal#556c8b1 (master - fixes overload typo in specs (#4967)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/275192215
<DeBot_> https://github.com/crystal-lang/crystal/pull/4967 (Fixes "overloads" typo in specs)
leitoox has quit [Remote host closed the connection]
<FromGitter> <Rinkana> Can i create a proc from a static method?
<FromGitter> <georgeu2000> > Hacker news isn't taking off, it should have be posted with a more click baity title ⏎ Yes, everything is click bait now.
<Papierkorb> Rinkana, sure `my_proc = ->self.static_method(SomeArgType, ...)`
<FromGitter> <Rinkana> Hmm odd, i'm getting `undefined method` while i know that the name is correct
alex`` has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] asterite opened pull request #4969: Execute dsymutil on build on macOS (master...feature/dsymutil) https://git.io/v5Sy9
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <Rinkana> @Papierkorb https://imgur.com/a/omOKm clearly i'm doing something wrong but i can't see what
<FromGitter> <Rinkana> I have it working with a block. But somehow a proc won't
<FromGitter> <vonKingsley> @Rinkana in initialize4 try changing `self` to the name of the class
<FromGitter> <georgeu2000> Why does this raise an error? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59b99eff210ac269202a2ad2]
<FromGitter> <georgeu2000> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59b99f0b177fb9fe7eb944f8]
<FromGitter> <georgeu2000> When I comment out `ret.unshift next_num`, I see that ret is `Array(Int32)`.
<FromGitter> <georgeu2000> So, why does it error `undefined method 'unshift' for Nil`, when `ret` is `Array(Int32)`?
<FromGitter> <crisward> Wow - http://www.sublimetext.com/blog/articles/sublime-text-3-point-0 that took a while.
<FromGitter> <Rinkana> @vonKingsley Ah yeah that seems to work now. It's odd that is does not work. And neither did `->self.class.handle_key(...`
<FromGitter> <georgeu2000> Ha, I have been waiting for like 5 years...
<FromGitter> <georgeu2000> Is Sublime Text 3 better?
<Papierkorb> Rinkana, `self` in your context there doesn't work as `self` is the class instance, *not* the class. The static method lives in the class, not in an instance of said class
<FromGitter> <crisward> I've been using 3 forever, this presumably has just dropped the beta and polished a few things. I've been using vscode more often recently just for the quick git integration. Feel as though I should pay for the upgrade though as I've been using 3 beta on my 2 license for a lonnng time.
<Papierkorb> Rinkana, w.r.t. `self.class.X` not working, I consider that a bug on first sight. I'd expect that to work.
<FromGitter> <Rinkana> @Papierkorb https://play.crystal-lang.org/#/r/2pxh
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <kazzkiq> implementing a Crystal version of http://langserver.org/ would do wonders for support in IDEs and famous Text Editors.
<FromGitter> <vonKingsley> @georgeu2000 the compiler is looking at the method collatz_chain_for and sees that it can return an Array(Int32), or Nil, try adding chain at the end of the method
<FromGitter> <faustinoaq> @kazzkiq ☝️
<FromGitter> <kazzkiq> Lololol totally missed it
<Papierkorb> Rinkana, yea I consider that a bug
elbuki has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<FromGitter> <sdogruyol> didn't know about emit_null https://stackoverflow.com/a/46196469/911870
elbuki has joined #crystal-lang
elbuki has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
elbuki has joined #crystal-lang
<FromGitter> <bew> Papierkorb, @Rinkana self.class.X doesn't work because self.class is a call, and the output is not known by the compiler, so I think this is xhy the compiler cannot make a proc from it
<FromGitter> <slava-dzyba> Hey everyone. ⏎ I'm trying to do a usual TCP echo server in Crystal to compare it (on local machine) to the Ruby version. ⏎ Everything is ok in terms of scalabilty, but for some reason no matter how many fibers spawned (or without fibers at all, serving only one connection) I get 44ms response time. To compare: echo server in Ruby (with nio4r in use, but still) gives some microseconds instead, but fails
<FromGitter> ... at serving a lot of connections. ⏎ I've also tried Elixir and again latency was absolutely ok, a few microseconds or so. ⏎ So what can be wrong with Crystal in that case, am I missing something? Here's the snippet I'm using: ... [https://gitter.im/crystal-lang/crystal?at=59b9ba9d319100804e30b1fe]
elbuki has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<FromGitter> <slava-dzyba> also it's worth to mention that using `tcp_nodelay = true` dropped the latency from 88ms to 44ms for me. ⏎ so I might be missing some additional configuration required for a fast connectivity
<FromGitter> <mverzilli> what uri are you using to instance the client? we used to have some issues with DNS resolution, I'm not sure if we still do, but if you're opening the client with "localhost" try replacing that with 127.0.0.1 and see if that changes those metrics
<FromGitter> <slava-dzyba> the same
<FromGitter> <georgeu2000> @vonKingsley - OK, thanks. Now I know what `compile-time type is (Array(Int32) | Nil)` means.
<FromGitter> <bew> @slava-dzyba how do you test the speed? I get something more like 30-40 nanoseconds for this echo server code. my little tester: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Sample output: ` 0.000000 0.000000 0.000000 ( 0.000048)` [https://gitter.im/crystal-lang/crystal?at=59b9be6e7b7d98d30df0e357]
snsei has joined #crystal-lang
<FromGitter> <bew> just tried with Benchmark ips, I got 43-44ms like you, maybe I mis-read the Benchmark measure above.. (need to sleep maybe......)
<FromGitter> <slava-dzyba> That's a disappoinment. It really prevents me from playing with Crystal further and I'm not sure what can I do about it.
<FromGitter> <mverzilli> I guess the best you can do is to open an issue