<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?
<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
<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
<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
<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
<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
<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]
<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
<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
<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>
<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>
<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>
<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> @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
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
<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>
<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.
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>
<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]
<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