ChanServ changed the topic of #crystal-lang to: The Crystal programming language | | Crystal 0.22.0 | Fund Crystal's development: | Paste > 3 lines of text to | GH: | Docs: | API: | Logs:
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 260 seconds]
Raimondii is now known as Raimondi
_whitelogger has joined #crystal-lang
<FromGitter> <schoening> Any of you ever read this paper by Sony? ⏎ ⏎ Makes me wonder if there are a lot of "cache misses" with Crystal. But only really wonder. Coz it's not like I actually am working on anything that needs to be that optimized. Interesting read tho.
sz0 has joined #crystal-lang
yogg-saron has joined #crystal-lang
mark_66 has joined #crystal-lang
<oprypin> schoening, that's good stuff. yes, it affects Crystal even worse than modern c++, as with any language that uses heap excessively
thegengen has joined #crystal-lang
thegengen has quit [Quit: Textual IRC Client:]
gewo has joined #crystal-lang
yogg-saron has quit [Quit: Textual IRC Client:]
unshadow has joined #crystal-lang
<FromGitter> <vasilakisfil> following this guide for my new raspberry pi I get these errors after crystal is installed
<FromGitter> <vasilakisfil> any ideas what could it be wrong ?
<FromGitter> <sdogruyol> Anyone up for writing a blog post for #CrystalCodeCamp @johnjansen @drujensen @elorest ?
<FromGitter> <andreaTP> is there also any recording? of #CrystalCodeCamp ?
<FromGitter> <sdogruyol> unfortunately not
<FromGitter> <andreaTP> :-(
<FromGitter> <andreaTP> at least slides or repos about the talks?
<FromGitter> <sdogruyol> there's a repo by @jwaldrip
sz0 has quit [Quit: Connection closed for inactivity]
TheLemonMan has joined #crystal-lang
bjz has joined #crystal-lang
<jokke> hey
<jokke> is " -- " in command line args treated specially?
<jokke> for some reason it disappears from my ARGV
<FromGitter> <bew> it shouldn't disappear...
<jokke> ah
<jokke> it disappears because i shift the ARGV to get rid of the --
<jokke> but it seems crystal does this by default
<jokke> and the last ARGV element is the part after the --
<FromGitter> <bew> how do you run your program.
<FromGitter> <bew> ?*
<jokke> or rather the rest of the ARGV elements
<jokke> foo -h bar baz -- foobar
<jokke> like that
splitty_ has joined #crystal-lang
<FromGitter> <bew> if you run `crystal a b c -- d e f` it will be removed
<FromGitter> <bew> but if you build it first, then run you'll have it
splitty__ has joined #crystal-lang
splitty_ has quit [Ping timeout: 264 seconds]
TheLemon1an has joined #crystal-lang
TheLemonMan has quit [Disconnected by services]
TheLemon1an is now known as TheLemonMan
sz0 has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
LastWhisper____ has joined #crystal-lang
zipR4ND has joined #crystal-lang
pduncan has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
unshadow has quit [Quit: leaving]
GreenF has joined #crystal-lang
Conficker has quit [Ping timeout: 240 seconds]
Kug3lis has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
<FromGitter> <johnjansen> @sdogruyol @drujensen @elorest i have an insane work load right now, so i wont get a chance to write anything about CodeCamp unfortunately
<FromGitter> <sdogruyol> thanks
<FromGitter> <bararchy> Is there a Crystal v.s C# performance somewhere ? I want to sway the votes for a project we work on :)
<oprypin> and maybe you can make some sense of this
<FromGitter> <mverzilli> so in kostya's we should compare against Mono, right? or is ".Net Core for Linux" already a thing?
<FromGitter> <bararchy> .NetCore is in development and will take a year or two to become "stable" .
<FromGitter> <bararchy> Mono is more mature , but buggy as hell
<Papierkorb> I'm not sure if that's already an oxymoron
<FromGitter> <bararchy> Well , its mature by age :)
<FromGitter> <johnjansen> so is trump
wontruefree has joined #crystal-lang
<FromGitter> <bararchy> XD
<FromGitter> <johnjansen> oops did i say that out loud
wontruefree has quit [Client Quit]
wontruefree has joined #crystal-lang
<FromGitter> <fridgerator> heyoooo
<FromGitter> <bararchy> We need to ask kostya to update the crystal version
blufor has left #crystal-lang [#crystal-lang]
<FromGitter> <bararchy> RX14: what does that means ?
<FromGitter> <fridgerator> thats good!
<FromGitter> <bararchy> Yeha but , what is it ? ;) connections per sec ? Total pages ? Traffic ?
<FromGitter> <fridgerator> @bararchy Its from the techempower benchmarks
<RX14> it's really preliminary testing results so we can't conclude much more than the optimizations I made worked
<RX14> there's a bunch of frameworks not tested, so the percentages are not going to be anywhere near the same in the final run
<FromGitter> <fridgerator> @RX14 will that be in round 15 ?
<FromGitter> <johnjansen> @RX14 is there a link to the complete list of languages around crystal
<FromGitter> <johnjansen> just so we can ogle
<Yxhvd> how good is that compared to other frameworks?
<RX14> well you can compare the RPS with the current R14
<Yxhvd> or platforms, rather
<Papierkorb> Yxhvd: it's as 72% as fast as the best one
<RX14> it would be ~15th
<RX14> as I said
<RX14> that benchmark run didn't complete even half the frameworks
<RX14> so ignore the percentage
<FromGitter> <fridgerator> ah ok
<RX14> would be closer to 60% based on R14
<RX14> but again, this is just a testing run
<RX14> it's a preview *of the preview*
<FromGitter> <johnjansen> this was talked about at CodeCamp … would be great to get it completely running
<FromGitter> <bararchy> Is this using the PortReuse function to get more cores working ?
<FromGitter> <bararchy> Cool
<FromGitter> <sdogruyol> WTF
<FromGitter> <sdogruyol> is that for real @RX14
<RX14> well it was run on the "real" benchmarking hardware
<RX14> so... yes I suppose
<FromGitter> <sdogruyol> where did you see it?
<RX14> secret
<FromGitter> <sdogruyol> oh ok :D
<FromGitter> <sdogruyol> it's plain text right?
<FromGitter> <johnjansen> haha, smart ass
<RX14> i'm sure the techempower guys wouldn't want stuff spread around they they didn't want to release
<FromGitter> <bararchy> I just hope we gonna rip the tables apart ;)
<RX14> we're not going to win
<RX14> we havent tried to win yet
<FromGitter> <johnjansen> we should … soonish
<RX14> why?
<RX14> I don't think the multi-core architecture will buy us much
<RX14> may even be a decrease
<FromGitter> <johnjansen> its a major selling point for the language
<FromGitter> <johnjansen> its all about perception
<RX14> I agree
<RX14> but we won't unless we put in the effort
<FromGitter> <johnjansen> agreed
<FromGitter> <johnjansen> priorities :-)
<RX14> our HTTP parsing right now is perfectly simple
<RX14> it's honestly amazing that we're getting this high performance with such little effort
<RX14> it's a very solid foundation for IO
<FromGitter> <bararchy> Right now the biggest bottle neck is the text parsing in the http requests ?
<FromGitter> <drujensen> I added kemalyst to the Framework as well. now we have 3 Crystal frameworks listed
<FromGitter> <drujensen> PR waiting...
<RX14> is github slow for anyone else?
<FromGitter> <bararchy> Not for me
<FromGitter> <drujensen> no issues here
<FromGitter> <bararchy> BTW RX14 , if we want to "win" , what can be done ? Where are the biggest issues ?
<RX14> i'm not sure
<FromGitter> <bararchy> How do we parse http requests ? Regex ? Line by line ?
<FromGitter> <drujensen> params parsing in kemalyst
wontruefree has quit [Quit: Is gone... Just plain old gone]
wontruefree has joined #crystal-lang
<RX14> @bararchy just using string.split and normal string ops
<RX14> ideally parsing HTTP should require 0 string copies and 0 memory allocations
<RX14> but that can't 8really* be done in crystal
<FromGitter> <bararchy> Does the split allocate a new array ? Maybe it can be somehow optimized
<RX14> yeah it does
<RX14> it's a microoptimization
<FromGitter> <bararchy> Why can't it be done in Crystal ?
<RX14> because of the way String is
<RX14> oh actually we could use StringPool
<RX14> hmm, hmm
<RX14> i wonder how much that would save
<FromGitter> <bararchy> Sounds interesting , is it an array of chars instead ?
<RX14> only way is to benchmark really
<RX14> String owns it's pointer
<RX14> to create a crystal String you need to copy the memory
<FromGitter> <johnjansen> anyone know where the parse code is so we can take a look at it without a huge hunt
<RX14> right where @drujensen posted
<RX14> and in http/
<RX14> it's all around really
<FromGitter> <johnjansen> oops missed that
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <johnjansen> StringPool looks interesting
<RX14> yeah I used it in FastIRC
<RX14> it didn't really improve my performance though
<RX14> so I think I ended up taking it out
<FromGitter> <johnjansen> haha, ok
<RX14> it requires benchmarking to see if it's worth it
<FromGitter> <johnjansen> totally
<RX14> the real efficiency optimizations we can do is reducing syscalls
<RX14> we have buffered reading IO so it should be pretty good for when the headers are < 8192 bytes
<RX14> but that might not be as common in the real world
<FromGitter> <johnjansen> im wondering about the IO.gets actually, seeing as its the thing tipping out a string that then needs the split
<FromGitter> <johnjansen> just contemplating
<RX14> well yes it'd be ideal to use IO#peak to tokenise the request, then read the strings right out
<FromGitter> <johnjansen> precisely
<Yxhvd> before looking at that, use valgrind or whatever to find the hotspots.
<RX14> have you actually tried using valgrind :P
<RX14> it's useful in a way but often it's really hard to use unless you have a good idea of exactly what the performance issues are beforehand
<FromGitter> <johnjansen> thats funny, so you need to know whats wrong in order to find whats wrong
<Yxhvd> well, kcachegrind for parsing the output is not all *that* hard to use to figure out where the time is spent.
<RX14> it's useful for sure
<Yxhvd> there may be flamegraph variants as well
<RX14> but it's not magic
<RX14> for microbenchmarks ideally your flamegraph would be flat :P
<Yxhvd> yeah it wold be for the whole request cycle
zipR4ND has quit [Ping timeout: 268 seconds]
<FromGitter> <sdogruyol> i really really like this
<FromGitter> <sdogruyol> these guys are doing community stuff at best
<RX14> mozilla has a LOT of experience managing communities I guess
<FromGitter> <sdogruyol> thanks to MDN
<FromGitter> <sdogruyol> the thing is that they're fixing compile times after 2 years of 1.0
<FromGitter> <sdogruyol> and that's good IMHO
<RX14> i agree
<RX14> we shouldn't prioritise it that much
<FromGitter> <sdogruyol> agreed
<FromGitter> <johnjansen> our priorities need to be on 1) developing the size of the community (evangelism) and 2) increasing the usablilty of the eco-system (adding functionality)
<FromGitter> <sdogruyol> yeah
<FromGitter> <johnjansen> optimizations come later IMO (unless they relate to ability to evangelize)
<FromGitter> <johnjansen> from what i have heard, everyone has roughly the same problem … they need to port some Gem or other
<Papierkorb> runtime performance-wise I think we're already at a pretty good level. I'm still surprised by the speeds you get.
<Papierkorb> Multithreading would be nice though, so that we can port stuff over to work fine with it, and then add sensible primitives for it to the stdlib
<FromGitter> <johnjansen> its ample fast enough for now … and with thread support coming, it seems like the wrong time to perform optimizations
<Papierkorb> And no, "Mutex everything" is not the current state of the art.
<FromGitter> <johnjansen> haha
<FromGitter> <bigDaddyS1oth> Yea the fact that Crystal isn't in 1.0 and doesn't have as many libraries is basically most people's "problem" with Crystal
<FromGitter> <bigDaddyS1oth> Shoot we're not even at 1.0 and in some benchmarks Crystal contends with Go for performance
TheLemonMan has joined #crystal-lang
<FromGitter> <johnjansen> i dont think the version number is any sort of actual problem, maybe a perception one
<FromGitter> <bigDaddyS1oth> perception if anything
<Papierkorb> To me it's stability, in which I also include the compiler. I sometimes still get the compiler to bark at some code while linking
<FromGitter> <johnjansen> its the scarcity of important libs that hits me every time i try to do an actual project
<Papierkorb> johnjansen, someone said that others said (I'm literally 3rd party at this point) at the code camp, that their company will not allow Crystal at all before v1.0 - Not because of features, but because of the number
<FromGitter> <bigDaddyS1oth> Libraries are the biggest thing for every language right now....people don't want to write them they just want them to be there
<FromGitter> <johnjansen> i wasnt privy to that conversation, there were alot of conv’s happening tho, so its not so surprising
<FromGitter> <bigDaddyS1oth> Like D, and Elixir: everyone says "Yea they have good performance, but they don't have as many libraries as {x}"
<FromGitter> <johnjansen> personally i find that an awfully arbitrary argument, but to each their own ;-)
<Papierkorb> johnjansen, I don't entirely agree to that notion, but then, don't expect managers to have any clue. To those, "version 1.0" still means "rock solid and usable"
<FromGitter> <johnjansen> understood, there is once again the `perception` issue
<Papierkorb> however, to be fair, v1.0 at least means a stable stdlib API, which is an actual plus
<FromGitter> <bigDaddyS1oth> I dunno man. If more people flock to the community then more libraries will start to be written and pushed to github
<FromGitter> <sdogruyol> perception indeed
<FromGitter> <johnjansen> what we really need is a Port list, that we can all vote on and prioritize, then cooperate on
<RX14> @bigDaddyS1oth crystal should beat go
<RX14> because it does less
<FromGitter> <johnjansen> its the kind of thing we could add to | org cc: @sdogruyol
<FromGitter> <sdogruyol> @johnjansen port list?
<FromGitter> <johnjansen> Gem’s to port || Add
<FromGitter> <bigDaddyS1oth> @RX14 well yea like I said, we're not even at a version 1 and Go is at 2.x and Crystal already contends it.
<Papierkorb> To me, ports don't cut it. Crystal isn't ruby, many concepts are the same, but others are wildly different
<RX14> no i meant crystal does less than go
<FromGitter> <johnjansen> TOTALLY agreed, but its a concept, not a literal translation
<FromGitter> <bigDaddyS1oth> @RX14 ooooh my bad
<RX14> so it performs better
<RX14> because it does less
wontruefree has quit [Quit: Is gone... Just plain old gone]
<FromGitter> <bigDaddyS1oth> Ports may not matter to us but it does for...well everyone who isn't in this community already :P
<FromGitter> <sdogruyol> @RX14 what do you mean by less?
<RX14> crystal only works on 1 core which means less overhead
<RX14> it also doesn't even try to provide a guarantee that all fibers will make forward progress
<RX14> we use cooperative fibers
<RX14> which means 1 fiber can stall all the others
<RX14> which isn't true in go I would suggest, at least not easilly
<FromGitter> <bigDaddyS1oth> Experienced Rails folk will want puma, pry, rspec, cucumber, hashie, activerecord, sass-rails, jquery-rails, angularjs-rails, coffe-rails, etc etc etc....
<FromGitter> <mverzilli> I guess instead of "ports" what we need is a list of use cases, a wishlist saying "I need a crystal lib to [implement this protocol/connect to this database/write desktop apps for this platform/etc]
<Papierkorb> bigDaddyS1oth, if they're literally looking for "puma", their loss
<FromGitter> <sdogruyol> @mverzilli that'd be great
<RX14> direct ports will be rare I think
<RX14> as @mverzilli said, we need to solve usecases not copy ruby
<FromGitter> <sdogruyol> yeah
<FromGitter> <sdogruyol> i hate rails developers for that kind of behaviour
<RX14> if ruby's solution traslates to crystal go right ahead
<RX14> but often I don't think it will
<FromGitter> <sdogruyol> "Rails" is not the solution for every damn web project
<RX14> yeah
<FromGitter> <johnjansen> @RX14 i agree, you can seldom just `copy`ruby gems, however you can sometimes copy the tests and then work toward functional parity
<FromGitter> <sdogruyol> and in reality %90 of web is php
<RX14> 90%? i wouldn't put it that high
<FromGitter> <bigDaddyS1oth> @sdogruyol lol learning Rails for the past 3-ish weeks I already figured that out
<RX14> there's a good bit of ASP
<FromGitter> <bigDaddyS1oth> and Java
<RX14> ASP and PHP, yeah
<FromGitter> <sdogruyol> probably
<FromGitter> <sdogruyol> i mean Rails is great but it's not just the only thing in the world to do web
<FromGitter> <bigDaddyS1oth> Yup
<Papierkorb> Roda ftw
<FromGitter> <johnjansen> @sdogruyol agreed, what rails does well is rapid development … the rest is arguable
<RX14> isn't toro a roda-inspired thing?
<FromGitter> <bigDaddyS1oth> What happened to Cuba and Camping? Did those just die slowly?
<Papierkorb> RX14: back when I looked at it, inspired, but it didn't cut it for me
<Papierkorb> For some reason, can't remember really
<RX14> I don't really like roda personally
<FromGitter> <crisward> I was using node before crystal, node-mailer is something I miss.
<RX14> it's sure powerful
<Papierkorb> Sequel is fantastic too
<Papierkorb> AR is a joke compared to that
<RX14> but for 99% of projects roda seems overkill based on the example
<FromGitter> <sdogruyol> we definitely need a mail library
<Papierkorb> RX14: overkill? Roda is pretty minimalistic
<FromGitter> <bigDaddyS1oth> @sdogruyol @johnjansen that's why I'm aiming to learn a lot of other languages. Rails is neat but if you're aiming to not just work for startups you need something else
<RX14> Papierkorb, overkill in terms of the code you must write
<FromGitter> <sdogruyol> java is definitely a big one
<FromGitter> <johnjansen> Rails is not the flavor of the month in startups anyway
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master:
<crystal-gh> crystal/master 6930423 João Diogo Costa: Add option to HTTP::StaticFileHandler initializer to disable directory listing (#4403)
<FromGitter> <bigDaddyS1oth> @johnjansen is it Node?
<FromGitter> <sdogruyol> no
<RX14> because it seems very verbose in how it routes requests
<FromGitter> <sdogruyol> Go
<Papierkorb> RX14: from my experience, not really
<FromGitter> <bigDaddyS1oth> Ah doesn't surprise me
<FromGitter> <johnjansen> startups seem to be all Node ATM (although others may disagree)
<FromGitter> <crisward> I've done a small mailgun wrapper, but I think a generic api/interface needs writing that all mailers can emulate.
<RX14> well the example not being hlighlighted doesn't help
<FromGitter> <johnjansen> Go is more for backend work, at least in the valley
<FromGitter> <johnjansen> Python is everywhere in data science
<FromGitter> <bigDaddyS1oth> Go's packaging is kind of weird...
<FromGitter> <johnjansen> ML, AI, NLP etc
<RX14> go is great for backend, node is great for frontend
<FromGitter> <sdogruyol> yeah
<Papierkorb> Being able to run code before "matching" routes is really powerful, e.g. to do authorization before going further
<RX14> but I can see crystal being great for both
<RX14> with some investment
<RX14> for backend it's already pretty good
<FromGitter> <sdogruyol> cool this just landed on master
<RX14> frontend needs some work
<FromGitter> <johnjansen> Crystal has the opportunity to be a unifying language, we just need to flesh out the libs
<RX14> and when wasm really gets going...
<FromGitter> <bigDaddyS1oth> I just wish I could download all the documentation of languages I want to learn permanently into my brain
<RX14> it can be really really unifying lol
<FromGitter> <johnjansen> to my mind, thats why we need to cooperate and hit the stuff thats most needed first
<FromGitter> <sdogruyol> i just did a research on Ruby companies in my country (Turkey)
<RX14> to do frontend my biggest want would be a slang replacement
<FromGitter> <sdogruyol> around 40-ish companies still using Ruby
<RX14> make it based on pug instead of slim
<FromGitter> <johnjansen> wether it be a Gem or an Node Package or whatever, its about the functionality we are missing
<Papierkorb> johnjansen, most needed is hard to pinpoint, everyone needs something different. The thing is, if someone needs something, and has the time, to get their hands dirty and contribute it
<FromGitter> <johnjansen> not the source of inspiration
<FromGitter> <sdogruyol> showing that a lot of companies migrating away or starting with something else
<FromGitter> <crisward> Am I the only one who is desperate for coverage tools?
<RX14> because pug/jade is like slim but it's way more suited for crystal
<FromGitter> <crisward> <RX14> pug would be good
<FromGitter> <bigDaddyS1oth> @sdogruyol Literally every company here in Dallas/Fort Worth, Texas wants Java or .NET
<FromGitter> <sdogruyol> same
<Papierkorb> sdogruyol, many companies over here moved over to NodeJS iirc
<FromGitter> <crisward> It's almost slang + brackets
<FromGitter> <johnjansen> agreed @Papierkorb but if we make a list, we will then know for sure
<Papierkorb> Java is hard to kill, as is PHP
<FromGitter> <sdogruyol> it's like %50 percent is Java, %40 is .NET and the rest in Turkey
<FromGitter> <sdogruyol> oh i forgot php :P
<Papierkorb> Everyone "knows" Java and PHP from uni or because they read about it in a blog. Developers for those two languages are abundant
<FromGitter> <bigDaddyS1oth> @sdogruyol I'm here wanting to do Elixir, Rust, Crystal, Scala and everyone wants the older stuff
<FromGitter> <johnjansen> MS professional services is the primary source of that problem
<FromGitter> <johnjansen> but anyhoo
<Papierkorb> That with java being surprisingly fast makes it a good investment when you have no idea but need someone to build software for you
<FromGitter> <crisward> The big thing php has is it's feedback cycle. If Crystal could somehow compile templates at runtime, during development, it would make a big difference.
<FromGitter> <bigDaddyS1oth> What's the first thing that needs attention?
<FromGitter> <johnjansen> thats what we need to establish
<FromGitter> <mverzilli> would it make sense to have a crystal-lang-contrib org in GitHub or something like that as an umbrella for experimenting with all these ideas? other languages took a similar route
<FromGitter> <bigDaddyS1oth> @crisward doesn't ecr do that? We have Embedded Crystal already
<FromGitter> <bigDaddyS1oth> @crisward or am I misunderstanding?
<FromGitter> <johnjansen> anyone got any suggestions about how best to run a Wants and Needs list
<FromGitter> <sdogruyol> @mverzilli i'd take an inspiration from rust
<FromGitter> <sdogruyol> there's rust-lang-nursery
<Papierkorb> johnjansen, GDocs or some Etherpad instance
<RX14> @mverzilli but what would seperate projects there from personal projects?
<FromGitter> <sdogruyol> and eventually those projects grow into std
<Papierkorb> johnjansen, or a dummy github repository
<RX14> oh for std improvements?
<RX14> sure
<RX14> that sounds great
<FromGitter> <crisward> @bigDaddyS1oth Don't think so... though I could be wrong, I've been using slang as I like the minimal thing...
<FromGitter> <sdogruyol> we did that kind of thingie with your @RX14
<RX14> yeah
<FromGitter> <sdogruyol> it eventually went into std
<FromGitter> <johnjansen> more for shards, but stdlib would be a byproduct i think
<FromGitter> <mverzilli> yeah, for things like
<FromGitter> <sdogruyol> and was a good experience
<FromGitter> <johnjansen> ok next question, would anyone use it?
<RX14> i'm glad we got the API right eventually
<FromGitter> <sdogruyol> great work
<FromGitter> <mverzilli> but not only things that "hope to get into the std"
<FromGitter> <crisward> email could go into std if done well...
<FromGitter> <sdogruyol> agreed
<FromGitter> <mverzilli> for example for things like crystal-db
<FromGitter> <sdogruyol> yeah
<Papierkorb> Isn't the std bloated already?
<RX14> it's pretty large
<RX14> some of the stuff is driven by the compiler's needs
<FromGitter> <mverzilli> agreed
<Papierkorb> stuff like oauth2, markdown, ...
<RX14> markdown could get out of the stdlib if the compiler didn't need it
<FromGitter> <bigDaddyS1oth> Oh yea we need authentication
<RX14> not sure why oauth is in there lol
<FromGitter> <sdogruyol> JWT e.g
<RX14> and there's random stuff like word distance
<Papierkorb> levensthein? that's for the did you mean feature
<FromGitter> <mverzilli> the thing is it's a bit difficult to ensure all those things remain up to date if we start splitting them into separate repos
<FromGitter> <sdogruyol>
<RX14> I think it would be great to provide a way to use shards to allow the crystal compiler to depend on shards
<FromGitter> <sdogruyol> this is great!
<RX14> @mverzilli yeah
<FromGitter> <sdogruyol> they have uuid, simd e.g
<RX14> vendoring is a solution
<FromGitter> <sdogruyol> also thanks website to contributors e.g lol
<FromGitter> <sdogruyol> awesome
<FromGitter> <bigDaddyS1oth> @sdogruyol let's just get as close to copying Rust as we can :P
<FromGitter> <sdogruyol> hahah
<FromGitter> <sdogruyol> right :D
<Papierkorb> mverzilli, otoh, you can pin to a certain version of them instead of hoping a compiler update doesn't break your app without need, and also, these external shards can be developed much faster, and be brought to the user much faster
<FromGitter> <johnjansen> @RX14
<FromGitter> <mverzilli> yeah, in theory that should work. I guess we'll get there eventually :)
<Papierkorb> Maybe a middle-ground could be integrating shards more that it's also used by the compiler, and then have stuff like markdown shipped as part of the standard distribution. That way you can easily use them, but if needed, also use a certain version easily
<RX14> @johnjansen yeah, it's Levenshtein distance that's in the std
<FromGitter> <mverzilli> @sdogruyol any other links to Rust community policies that might be of interest? I'd like to take a look at them
<RX14> because we needed it for typo suggestions
<FromGitter> <johnjansen> @RX14 when did that arrive
<Papierkorb> ages ago
<RX14> aaages ago
<Papierkorb> lol
<FromGitter> <bigDaddyS1oth> @mverzilli you could go the the rust-lang/rust chat room and ask them :P
<FromGitter> <johnjansen> i havent touched that repo for months
<RX14> feb 2014
<RX14> lol
<FromGitter> <mverzilli> @Papierkorb Waj wants to enhance many aspects of shards, so let's see where that takes us
<Papierkorb> mverzilli, that would be fantastic
<FromGitter> <johnjansen> ok hahah
<RX14> I hope shards doesn't get too ehanced though
<FromGitter> <mverzilli> @bigDaddyS1oth yes, but first I'd need to know what are the right questions to ask :P
<RX14> shards is simple and I like it
<FromGitter> <bigDaddyS1oth> Okay so authentication, enchancing shards(maybe)....that's two things
<Papierkorb> apart from being annoying in terms of applications, shards already do pretty much exactly what one needs
<FromGitter> <bigDaddyS1oth> true
<FromGitter> <bigDaddyS1oth> So if we were writing down a list...authentication is one definitive thing on that list so far. :P
<Papierkorb> It's hard to do a list, everyone needs something different
<Papierkorb> And when two people need something similar, they want it differently
<FromGitter> <mverzilli> what do you mean by authentication? sth like warden? (I hate myself for just coming up with that example :P)
<FromGitter> <bigDaddyS1oth> fair enough, we need a starting place though. then once community starts growing people can start tinkering
<FromGitter> <bigDaddyS1oth> @mverzilli like warden, oauth
<FromGitter> <mverzilli> OAuth is already in the std, and it's incredibly easy
<FromGitter> <bigDaddyS1oth> well xP
<FromGitter> <bew> about markdown for exemple, it's used only in `crystal docs` right ?
<RX14> pretty much
<RX14> i'd love to see that rewritten
<RX14> ary himself said he thought markdown could be parsed very simply with a single pass
<RX14> which isn't really true
<RX14> I wish there was a 32bit debian AMI
<RX14> they say use multilib
<RX14> but it just doesn't work
<RX14> at least for crystal
<FromGitter> <johnjansen> OK, create `ISSUES` here for each Need or Want
<FromGitter> <bew> I was thinking: why not make things like `git`, where each command is a different program (`git-push`, `git-pull`, etc...), and have `crystal-build` which would be the compiler, `crystal-docs` would be the doc generator, and in the end, `crystal will be a simple wrapper which only look for `crystal-{command}` for `crystal command`... WDYT?
<RX14> @johnjansen how about a wiki page on the github repo?
<RX14> maybe that's a bit too out of the way
<FromGitter> <johnjansen> its totally out of the way … but im happy to reassign it to an org with more visibility
<FromGitter> <johnjansen> at least there is a list
<FromGitter> <johnjansen> ive added a few wants and needs, please contribute your ideas, we can figure out the ownership of this list at a later date
<FromGitter> <bararchy> @johnjansen why not just open it as an issue in the official git ?
<FromGitter> <bararchy> Also I think the wiki is open for all to edit
<FromGitter> <johnjansen> its not about the language its about other libs needed
<FromGitter> <drujensen> @crisward Kemalyst has mailers
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
wontruefree has joined #crystal-lang
<FromGitter> <johnjansen> can everyone give me their opinion on this approach, i may be off on a complete tangent and would appreciate the input
<FromGitter> <drujensen> sorry coming late to the party. is this for the std library?
<FromGitter> <drujensen> or shards?
<FromGitter> <johnjansen> nope, its for other stuff … like Devise / Warden / Some other external lib
<FromGitter> <johnjansen> yes
<FromGitter> <johnjansen> Shards
<FromGitter> <drujensen> gotcha
<FromGitter> <johnjansen> BTW hi Dru
<FromGitter> <drujensen> hi
<FromGitter> <drujensen> So, I think identifying the needs is a better approach than identifying solutions.
<FromGitter> <drujensen> at the code camp there seemed to be two different groups interested in crystal
<FromGitter> <johnjansen> agreed, did you take a look at the issues list i started
<FromGitter> <drujensen> c developers looking to use a higher level language
<FromGitter> <drujensen> and ruby developers looking for speed
<FromGitter> <bararchy> 2nd group here :)
<FromGitter> <drujensen> i’m in the 2nd group as well
<FromGitter> <johnjansen> almost certainly more of the 2nd
<FromGitter> <bararchy> thougn I fell in love with the Types and lower level work in Crystal
<FromGitter> <drujensen> inference is king
<FromGitter> <johnjansen> so @drujensen you have a few “Wants” can you add them to the list :-)
<FromGitter> <drujensen> clean code with strongly typed language
<FromGitter> <drujensen> yes
<FromGitter> <drujensen> although my list is rails stuff
<FromGitter> <drujensen> and stuff i want in kemalyst
<FromGitter> <drujensen> framework like rails
<FromGitter> <johnjansen> thats ok, label it web … if its possible to modularize
<FromGitter> <johnjansen> i.e. generic
<FromGitter> <drujensen> i can’t label
<Papierkorb> it's kinda becoming a would-be-awesome-crystal list hehe
<FromGitter> <bararchy> XD
wontruefree has quit [Ping timeout: 246 seconds]
<FromGitter> <bararchy> @drujensen did you take a look at ?
<FromGitter> <johnjansen> @drujensen added you as a contrib … anyone else need contrib to manage that list?
<FromGitter> <drujensen> yes. 2 years ago I created amethyst-model for it. It went dark so I moved to Kemal
<FromGitter> <drujensen> then wanted more so created Kemalyst
<FromGitter> <bararchy> Yeha, it's sad that Codecore suddenly disapered :\ tough it seems that he still Merge PR's
<FromGitter> <drujensen> I tried contributing to amethyst but Codecore didn’t have time
<FromGitter> <drujensen> yup
<FromGitter> <bararchy> Maybe you should have forked and take over ?
<FromGitter> <bararchy> Or I guess you wanted to "roll your own" :)
<FromGitter> <drujensen> well, so there were some structural issues and I really liked Kemal
<FromGitter> <drujensen> not really. i just wanted to create a blog. :-)
<FromGitter> <bararchy> that's totally cool , was just interested in what made you decide to do it
<FromGitter> <drujensen> and then i kept on working on it overe the year
<FromGitter> <drujensen> as a side thing
<FromGitter> <bigDaddyS1oth> back to the party. I'm mostly interested in Crystal for it's web stuff (pretty sure some of you already came to that conclusion). It's nice to see that we're not wanting to shove Crystal into a corner and make it only for 1 thing (like how Ruby got shoved into only being used for web development).
<FromGitter> <bararchy> I use it mainly for networking, protocols and byte manipulation :)
<FromGitter> <bararchy> which is what I do in my job
<FromGitter> <sdogruyol> @bararchy that's cool
<FromGitter> <bararchy> @sdogruyol Thanks :) ⏎ Were testing a big move from Ruby to Crystal , right now we seem to have massive boost in performance
<FromGitter> <bigDaddyS1oth> See, we're already at a good spot that we've got a group that's diverse in the fields they're in.
<FromGitter> <drujensen> @bararchy right. i am listing stuff i would need to convert a rails app to crystal at my work. I hate deploying a memory consuming slow web app and requiring huge boxes to keep it running
<FromGitter> <sdogruyol> @bararchy amazing how's the reaction in your company? Are they willing to support maybe sponsor Crystal?
<FromGitter> <bararchy> Yeha, Ruby is mem hungry, and it gets bigger and bigger
<FromGitter> <bararchy> @sdogruyol Your'e from Manas right ?
<FromGitter> <bigDaddyS1oth> Isn't anything on the JVM a memory hog too?
<RX14> the VM itself has an overhead
<RX14> but java isn't too bad on memory
<RX14> it depends on usecase
<FromGitter> <johnjansen> @drujensen if you accept the contrib you should be able to label
<RX14> for CLI tools and desktop use the JVM is terribly emmory hungry
<FromGitter> <bigDaddyS1oth> I think Scala is like the least resource hogger
<RX14> for server use it's really quite acceptable
<RX14> it's vust very conservative at returning memory to the OS
<FromGitter> <bigDaddyS1oth> @RX14 aahh I see
<FromGitter> <bararchy> Yeha , I too see Java is better in mem then Ruby
<FromGitter> <sdogruyol> @bararchy nope I am not from Manas
<FromGitter> <sdogruyol> :smile:
<FromGitter> <bigDaddyS1oth> If there's anything using the JVM I want to learn it's Scala.
<FromGitter> <drujensen> @johnjansen thanks
<FromGitter> <drujensen> Scala is a beast of a language to learn
<FromGitter> <johnjansen> @drujensen are you able to bless other contribs?
<FromGitter> <bararchy> @sdogruyol I see hahah, well , we are thinking of hiring the guys there for a Big Crystal project , something really cool. ⏎ Though sadly I can't talk about it yet
<FromGitter> <johnjansen> out of interest
<FromGitter> <drujensen> @johnjansen no settings showing up
<FromGitter> <johnjansen> ok well if anyone needs contrib, then well, add an issue for it :-)
<FromGitter> <bigDaddyS1oth> @drujensen The languages that seem like they'll take an effort to learn (for me) are Rust and Scala.
<FromGitter> <andreaTP> this is an interesting discussion, why you consider Scala difficoult to learn?
<FromGitter> <sdogruyol> @bararchy awesome! That'd be amazing
<FromGitter> <andreaTP> (I'm a Scala developer looking at Crystal :-) )
<FromGitter> <drujensen> Rust is actually not too bad. Their documentation is horrible though. all math equations.
<FromGitter> <rena1234> hello everyone, could someone tells me how to get float number from console in crystal ?
<FromGitter> <drujensen> neither even come close to Crystal’s beauty imo
<FromGitter> <andreaTP> Rust book is definitely well written!
<FromGitter> <bigDaddyS1oth> @andreaTP it's still Java-ish :P
<RX14> @rena1234 how about `gets.to_f`
<RX14> that will read 1 line and interpret it as a float
<FromGitter> <andreaTP> @bigDaddyS1oth how it couldn't be Java-ish? :-)
<FromGitter> <bigDaddyS1oth> @andreaTP it's the advance concepts and those concepts syntax I worry about in learning any new language. It's the scariest part for me
<FromGitter> <bararchy> I run the tests from localy to see how it is with newest versions: ⏎ ⏎ Test: `Base64` ⏎ ⏎ Mono (C#): ... []
<FromGitter> <sdogruyol> ugh
<FromGitter> <sdogruyol> why is mono that slow?
<FromGitter> <bararchy> Not sure
<RX14> isn;t mono jitted?
<FromGitter> <bararchy> compiled with `mcs test.cs`
<RX14> does it do warmups?
<FromGitter> <bigDaddyS1oth> Awkward, my father's company uses C# in a lot of their stuff
<FromGitter> <bararchy> maybe I'm missing optimizations or stuff ?
<FromGitter> <rena1234> i already tried gets.to_f and got undefined method for Nill
<FromGitter> <sdogruyol> that doesn't mean that it's great @bigDaddyS1oth
<FromGitter> <bigDaddyS1oth> *the company my father works at
<FromGitter> <bigDaddyS1oth> and I know @sdogruyol
<FromGitter> <bararchy> Ruby: ⏎ ⏎ ```ruby test.rb ⏎ encode: 1333333600, 1.098680749 ⏎ decode: 1000000000, 1.104109474 ⏎ ``` []
<FromGitter> <sdogruyol> it's a good language btw :)
<FromGitter> <bigDaddyS1oth> Wait was ruby faster than C#?
<FromGitter> <bigDaddyS1oth> @bararchy
<FromGitter> <bararchy> Yeha XD
<FromGitter> <bararchy> lol
<FromGitter> <bigDaddyS1oth> O
<FromGitter> <bararchy> a few sec faster
<FromGitter> <drujensen> ruby is more than likely binding to a c library
<Yxhvd> it is probably like java, the runtime takes a long time.
<FromGitter> <sdogruyol> probably c
<RX14> @rena1234 `gets.not_nil!.to_f`
<FromGitter> <bararchy> Python: ⏎ ⏎ ```code paste, see link``` []
<Papierkorb> rena1234, explanation:`#gets` returns `String?`, which is short for `String | Nil`. Thus it either returns a String, or nil. All following calls on the result value must be available for all types the value could possibly have. There's `String#to_f`, so that works. But there's no `Nil#to_f`, thus the compiler complaining.
<FromGitter> <bigDaddyS1oth> @bararchy do uuuh....Elixir
<FromGitter> <bigDaddyS1oth> if you can
<FromGitter> <drujensen> I did a benchmark a while back against the top languages in Github against Crystal.
<FromGitter> <bigDaddyS1oth> @drujensen you did Swift? :P
<Papierkorb> Wow what's going on with C#, it shouldn't be that bad
<FromGitter> <drujensen> Yes, I have written several Swift apps and swift is gaining server ground
<FromGitter> <andreaTP> this was my contribution to Crystal benchmark :-)
<FromGitter> <rena1234> thank you, i made it work using: if input = gets; var = input.to_f :smile: )
<FromGitter> <bararchy> @bigDaddyS1oth I don't see elixer test in there
<Yxhvd> papierkorb: probably the runtime. Java also tends to be really slow to start but pretty fast once it is running.
<FromGitter> <bigDaddyS1oth> @bararchy in where?
<Papierkorb> Yxhvd: most likely
<Papierkorb> drujensen, did you try that .Net native stuff?
<FromGitter> <elorest> Wow Elixir is slow.
<FromGitter> <bararchy> @bigDaddyS1oth in the tests repo -->
<FromGitter> <bigDaddyS1oth> @drujensen do people like using Swift?
<FromGitter> <drujensen> I like it. :-) It has some verbosity but in general its not too bad
<FromGitter> <drujensen> and fairly performant
GreenF has quit [Ping timeout: 246 seconds]
<FromGitter> <drujensen> @andreaTP your results are interesting
<FromGitter> <drujensen> nim for the win!
<FromGitter> <andreaTP> I think Swift is potentially a good programming language, it has much of the primitives but it lacks on high level api for functional programming
<FromGitter> <andreaTP> yep nim is winning but is more imperative than crystal implementation
<FromGitter> <bigDaddyS1oth> @bararchy there's one in the brainfuck2 folder but that's about it
<FromGitter> <andreaTP> slightly closer to metal I mean :-)
<FromGitter> <bigDaddyS1oth> @elorest well Elixir is dynamically typed
<FromGitter> <andreaTP> i.e. @drujensen Crystal impl looks much much nicer than nim IMO :-)
<FromGitter> <bigDaddyS1oth> @elorest so is Erlang....I think
<FromGitter> <drujensen> @andreaTP lol, right
<FromGitter> <andreaTP> @bigDaddyS1oth yes Elixir runs on the BEAM
<FromGitter> <bararchy> @drujensen Using your repo: ⏎ ⏎ ```Crystal - 5.55s ⏎ Mono - 10.34s``` []
<FromGitter> <drujensen> you are getting better performance for mono
<FromGitter> <drujensen> which version?
<Papierkorb> drujensen, I get some better or worse times: C/C++ is at 3.596s/3.660s, Java 6.246s, Rust 5.662s and Crystal 5.68s
<FromGitter> <bararchy> @drujensen ⏎ ⏎ ```Mono JIT compiler version 5.0.0 (Stable Fri May 12 07:20:13 UTC 2017)``` []
<FromGitter> <drujensen> I was using 4.2
<FromGitter> <bigDaddyS1oth> But these benchmarks aren't the end all be all, though. Every language has it's place and usage. No language it is going to be the solution for everything ever.
<FromGitter> <andreaTP> <Papierkorb> hardware?
<FromGitter> <bigDaddyS1oth> I have to keep that in mind, at least
<FromGitter> <drujensen> @bigDaddyS1oth right
<FromGitter> <drujensen> just a way to compare but there are many other factors to consider
<FromGitter> <drujensen> ease of development, memory consumption, etc..
<Papierkorb> andreaTP, intel Skylake i5-6600K 4x3.5GHz w/ DDR-4 RAM, compilers "latest" on ArchLinux
<FromGitter> <bararchy> I'm using ⏎ ⏎ ```Intel(R) Xeon(R) CPU E3-1505M v5 @ 2.80GHz ⏎ 4.10.13-1-ARCH ⏎ 16Gb RAM``` []
<FromGitter> <bigDaddyS1oth> @drujensen and some languages allow you to be really specific on how you use your memory.
<FromGitter> <drujensen> @bigDaddyS1oth correct. some let you do bad stuff in memory as well.
<FromGitter> <andreaTP> I guess Linux vs. OsX is a huge variant
<FromGitter> <bigDaddyS1oth> @drujensen like Elixir is slower, but in the Phoenix framework, right out of the box, you can build a chat service that can handle a ton of rooms with a ton of people in them and it's blazing fast.
<Papierkorb> Performance does not equal execuction speed. Speed is generally completely over- and undervalued at the same time.
<RX14> shouldn't elixir be able to be precompiled somewhat
<FromGitter> <bararchy> All in All it seems Crystal is X2 faster then mono at my tests (mono 5, crystal 0.22, Linux)
<FromGitter> <andreaTP> Beam is super performat for distributionand multi-threading, but is really BAD in maths
<Papierkorb> RX14: not more than Java
<RX14> i heard it was able to be precompiled into assembly
<Papierkorb> Well, it compiles to the ErlangVM
<FromGitter> <bigDaddyS1oth> Man we really got off the topic of how we should move Crystal forward :P
<Papierkorb> Not even sure if the channel is a good place for the whole process, a GH issue would be more sound for that
<FromGitter> <bigDaddyS1oth> yea
<RX14> Papierkorb, i thought you could compile erlang directly to machinecode, and based on google you can using a erlang component called "HiPE"
<Papierkorb> RX14: wasn't hipe their jit?
<FromGitter> <andreaTP> Erlang HIPE compiles yes
LastWhisper____ has quit [Quit: Textual IRC Client:]
<RX14> it seems confusing
<FromGitter> <ertw> Hi all, wondering if there is a good way to serve a static page from the command line using Crystal? Something similar to `ruby -run -ehttpd . -p8000` ⏎ I found the below, but it isn't responding to requests: ⏎ `crystal eval 'require "http/server";,".")).listen'`
<RX14> and that noone really uses it
<FromGitter> <kornel_gora_twitter> Hi is crystal good to make with it back end web development ?? Should i start with it as first programming language ??
<RX14> @ertw that snippet works for me
<FromGitter> <johnjansen> there is a room for that now ;-) `crystal-libraries-needed`
<Papierkorb> johnjansen, room? link please
<FromGitter> <ertw> Thanks for testing RX14, I'll keep poking at it.
<FromGitter> <bararchy> @kornel_gora_twitter Sure :)
<FromGitter> <bigDaddyS1oth> @kornel_gora_twitter we got Kemal and Kemalyst for web development already. We don't have a whole lot of libraries at the moment, though
<FromGitter> <axvm> @kornel_gora_twitter learn ruby at first
<Papierkorb> ^
<FromGitter> <kornel_gora_twitter> what about job possibility with this language ?? Is crystal better than elixir or twice are good ??
<FromGitter> <bararchy> Learn ruby first ? not sure it's a good idea, It helped me , but , it also confueses someone to move from Dynamic to static lib
<FromGitter> <bigDaddyS1oth> Uh Crystal is still brand new, so you're not going to find job posting now
<Papierkorb> bararchy, Ruby is a good language all things considered, also, there is a ton of learning material on it, including communities in many languages happy to help out.
<FromGitter> <bararchy> We are right now hiring our First Crystal specific help , but yeha, it's too new for non-niche jobs
<RX14> @kornel_gora_twitter I wouldn't recommend crystal as a first language because there aren't very many learning resources for it
<Papierkorb> bararchy, Not saying Crystal is bad, but as first language to learn? Not yet
<RX14> ^
<Yxhvd> bararchy: where do you live?
<FromGitter> <mverzilli> Python is great as a first programming language
<FromGitter> <bararchy> Papierkorb: True, dodn't think about it like that
<FromGitter> <bararchy> Yxhvd: Israel, why ?
<FromGitter> <mgarciaisaia> I didn't ever get why people thinks Python is a nice language at all :/
<Yxhvd> just wondering. It might have been interesting if you had been in .se :)
<FromGitter> <axvm> @bararchy what do you mean under "Dynamic to static lib"? Ruby and Crystal have different entry levels
<FromGitter> <mgarciaisaia> I'd totally start with Ruby, that's kind of similar, but with a syntax that *works*
<FromGitter> <kornel_gora_twitter> yeah pytho,ruby i can learn but i want lear new future technology so i thinking about learn elixir or crystal.At the time i don't what to choose from this two.
<Papierkorb> kornel_gora_twitter, get solid in Ruby, then you can still look at both. As both are based on Ruby in design, picking either will be easy
<FromGitter> <kornel_gora_twitter> yeah python,ruby i can learn but i want learn new future technology so i thinking about learn elixir or crystal.At the time i don't what to choose from another.
<RX14> the fundamentals of programming transfer between all programming languages, which is why it's best to learn in a langauge with good learning resources and then switch to another if you wish
<Yxhvd> no need to choose. Do a little of each and dig into whichever you like best.
<FromGitter> <mgarciaisaia> I don't recall where did I read that you should always limit your innovation factor to something like 2. Pick your fights. First of all, learn to program. Learn the basics. *Then* go with the best language you find.
<FromGitter> <mgarciaisaia> I love Smalltalk for learning, anyways - but kids these days...
<FromGitter> <axvm> feels like trolling. im fading away. cya~
<FromGitter> <drujensen> my kids are learning using scratch to understand basic constructs and conditionals, loops, etc
<FromGitter> <drujensen> 12years old
<FromGitter> <johnjansen> @drujensen take a look at tynker
<Papierkorb> Heck, even QBASIC is fine
<FromGitter> <bararchy> @axvm I meant that for me , there was some brainfuck while adjusting to a static compiled languge from a dynamic lanague like Ruby, it looks similir true, but when you try to do ⏎ ⏎ ```a = []``` ⏎ ⏎ things get complicated real fast, as in "why do I need to know what is going to be in the array before hand ?!" (Types) or stuf like why can't I just `` and instead I need to pass stuff
<FromGitter> ... over to slice, etc ... ... []
<FromGitter> <mverzilli> @axvm lol
<Papierkorb> Though it's probably so old at this point, that you can't easily run it at all anymore lol
<FromGitter> <drujensen> @johnjansen yeah, tynker is awsome
<Papierkorb> bararchy, shouldn't be that bad though. You make this experience once in your lifetime only, and you're set for any future endeavours
<FromGitter> <drujensen> There is a jump from dynamic to static for sure
<FromGitter> <drujensen> but i think learning basics is best on a dynamic language first
<Papierkorb> bararchy, I actually came from C++ to Ruby, was also weird to me to not being able to write types at all.
<FromGitter> <axvm> same
<FromGitter> <drujensen> that seems like it would be a hardeer jump from static to dynamic, no?
<Papierkorb> Dunno, both are just different
<FromGitter> <johnjansen> im not sure @drujensen, one of the things you should learn is how to express what kinds of things you are dealing with. dynamics adds the `what the hell is it` to any program
<Papierkorb> ^
<FromGitter> <bararchy> Yeha, it's just a different mind set, so if your goal is lets say, Crystal, maybe start with C\C++ or W\E compiled lang, and then move to crystal
<FromGitter> <axvm> @bararchy I started from C, asm, then python and ruby so 4 me things not get complicated
<Papierkorb> johnjansen, drujensen, I think the main thing is they teach vastly different mindsets
<FromGitter> <drujensen> you started with ASM?
<FromGitter> <johnjansen> agreed
<FromGitter> <drujensen> true
<Papierkorb> You use a debugger and stuff in C++, but you fire up pry in Ruby
<RX14> I think going types -> no type is hard
<RX14> sorry
<FromGitter> <drujensen> oh, i want pry for Crystal
<RX14> easy, but the other way is harder
<FromGitter> <drujensen> adding to the list. :-)
<FromGitter> <axvm> in my opinion Crystal is closer to Ruby than to C so better learn ruby then anything else
<RX14> I started with :)
<Papierkorb> drujensen, have a PoC, but it crashes on memory access for some unknown reason yet
<FromGitter> <bararchy> Oh, this too LOL , my first Crystal runtime crash with a sigfault and I was like "WTF do I do now ?!" then I learned to work with ldb and gdb , etc ..
<RX14> quickly went to C# though
<FromGitter> <axvm> @drujensen yea, just after C i went to assembly language and this is most beautiful sex in my life
<RX14> both are typed so i found crystal reasy
<FromGitter> <drujensen> @Papierkorb Share!
<FromGitter> <johnjansen> there is no doubt that dynamic languages have advantages in terms of internal visibility. what is really needed for learning, is a strictly typed interpreted language ;-)
<Papierkorb> drujensen, doesn't fulfill my personal quality requirements because of that yet :(
<FromGitter> <drujensen> @axvm I imagine
<FromGitter> <drujensen> @johnjansen Typescript?
<FromGitter> <johnjansen> ;-)
<FromGitter> <johnjansen> maybe
<Papierkorb> Thinking about it, I didn't try entirely disabling GC (as in, not even linking it in) yet. My best guess thus far was that the guest GC fights with the host GC structures
<FromGitter> <drujensen> that seems like the worst of both worlds to me. your restricted wth types and you are slow as mud
<RX14> I think java and C# are actually pretty ok for learning
<FromGitter> <bararchy> BTW, brainfuck test Ruby v.s Crystal ⏎ ⏎ Crystal ⏎ ⏎ ```code paste, see link``` []
<FromGitter> <johnjansen> haha for learning @drujensen just for learning
<FromGitter> <drujensen> lol
<RX14> types are good for learning
<RX14> because I got used to dynamic typing really easilly, but I see a lot of people struggling the other way
<FromGitter> <drujensen> @RX14 yeah, i think your right about that
<RX14> so I assume that it's beneficial to start typed
<RX14> i don't have any data
<RX14> but
<FromGitter> <johnjansen> i agree
<RX14> it seems logical
<FromGitter> <drujensen> yup
<Papierkorb> in the end, I think one should do cool shit as learning material. Writing fibonacci isn't fun, and won't keep you interested
<RX14> yeah
<FromGitter> <bararchy> RX14 This is true ⏎ ⏎ Static => Dynamic seems to be the eaiser path ⏎ for me Dynamic => Static was really hard and I still have points where I'm grasping []
<RX14> i sat down at a computer, with very very basic previous programming experience and set out to make a minecraft lanuncher
<RX14> when i was 12 or something
<RX14> and i got it working... eventually
<RX14> so learning to program with a big project worked for me
<FromGitter> <bararchy> When I was 12 there was only 52K internet :(
<FromGitter> <johnjansen> dynamic forces the programmer to remember the types or figure them out as they go … static is self documented, leaving less to *remember*
<RX14> although I can't say it's common
<FromGitter> <drujensen> A project to work on makes learning way more fun
<Papierkorb> I built a MSN bot which connected to IRC and a cheatpage cause my 360 only could do MSN but not what I needed lol
<RX14> lol
<Papierkorb> (wasn't the *first* project though)
<Papierkorb> Back then MSN was a really simple protocol, it's vastly different nowadays
<FromGitter> <johnjansen> certainly not setting the 7yo on an MSN bot for starters ;-)
<FromGitter> <johnjansen> might get him onto a little crystal very soon though
<FromGitter> <bararchy> Scratch is cool for 7yo
<FromGitter> <johnjansen> yeah, he is all over tynker which is pretty close
<FromGitter> <axvm> We need to create twitter on crystal
<FromGitter> <bararchy> Twitter bot ?
<FromGitter> <johnjansen> you mean an api client, or the whole thing?
<Papierkorb> axvm, just hook Redis up to a Kemal app and you're golden
<FromGitter> <axvm> nope. whole twitter
<Papierkorb> that'll probably work quite well already
<FromGitter> <johnjansen> we might need a couple more people if its the later … just sayin
<FromGitter> <mverzilli> @johnjansen for your 7yo
<FromGitter> <mverzilli> :P
<FromGitter> <johnjansen> thanks @mverzilli
<FromGitter> <drujensen> haha, there you go
<FromGitter> <johnjansen> offtopic but he wrote an algo the other day for `div by 5` so he could do it in his head x=(n/10)*2
<FromGitter> <johnjansen> i was impressed by that … personally
<FromGitter> <axvm> @johnjansen your son had built-in head code obfuscator?
<FromGitter> <johnjansen> haha, well what he said was `take off the the zero and multiply by 2`
<RX14> but what if it doesn't end in zero...
<FromGitter> <axvm> @johnjansen From the point of view of arithmetic, this is cool; From the point of view of CS/CPU architecture it's terrible :smile:
<RX14> nah, llvm will optimize that one for sure
<RX14> uhh, actually maybe not
<RX14> with int division it's not the same and neither for float I should think
<RX14> so it probably won't
<FromGitter> <axvm> it wont. not smart enough to optimise it
<RX14> it's smart enough lol
<FromGitter> <axvm> just little example why types are important ⏎ ⏎ ```>> 15 / 10 * 2 #=> 2 ⏎ >> 15 / 10.0 * 2 #=> 3.0``` []
<FromGitter> <johnjansen> haha @axvm hes 7 dude ;-)
<FromGitter> <axvm> ruby 2.3.3
<FromGitter> <johnjansen> but this is hysterical ...
<RX14> llvm is definitely smart enough i'm just debating whether it's a valid optimization
<FromGitter> <johnjansen> ill make sure he rethinks his work so as to consider potential compiler optimizations
<FromGitter> <johnjansen> ;-)
<RX14> haha
<FromGitter> <axvm> @johnjansen ok. for 7 y.o its fine :smile:
<FromGitter> <johnjansen> ;-)
<FromGitter> <johnjansen> he shocked the hell out of his grandmother by answering random div by 5’s faster than she could understand the questions
DissonantGuil3 has joined #crystal-lang
<DissonantGuil3> Is there documentation on the shard.yml file? Specifically the 'targets' section?
Ven has joined #crystal-lang
Ven is now known as Guest50585
Guest50585 has quit [Ping timeout: 258 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest873
Guest873 has quit [Ping timeout: 246 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 260 seconds]
Ven_ has joined #crystal-lang
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
<Papierkorb> random, but gotta say, it's really great you get a Time::Span when substracting Times, and not something boring like a Float64 demoting seconds or whatever
<RX14> yup
<RX14> i love crystal's time api
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <bigDaddyS1oth> On the note about evangelism: biggest evangelism is gonna be pushing out real world applications. We can show people numbers and whatnot, but companies and others won't bother looking into Crystal if no one is *actually* and *actively* using it
<Papierkorb> I'm using Crystal for an upcoming project .. which I can't make public lol. Same with many others I fear.
<RX14> well i'm just glad it's getting debugged in the real world
<FromGitter> <andreaTP> I'm waiting for true parallelism to jump on it....
<RX14> well for request-based servers you can approximate it if the server's stateless
<RX14> but yeah true parellelism i hope is coming
<FromGitter> <andreaTP> Nowadays if you are not running in a browser I guess is vital
<FromGitter> <andreaTP> I know, and that's why I'm here :-)
<RX14> i wish there was more solid progress...
<RX14> something I could point out more than fits and starts
<FromGitter> <andreaTP> I cannot wait to have an actor model on top of fibers, and I'm looking forward to contribute it
<FromGitter> <andreaTP> I have seen improvements in the relevant branch
<FromGitter> <andreaTP> I guess they can accelerate if someone starts to use it
<FromGitter> <andreaTP> But I know that lack of "parallelism aware" code in std library is a strong limiting factor
<FromGitter> <bigDaddyS1oth> I'm not a systems guy (would like to be and I think Crystal, Rust, and D will help me with that), but I'll definitely try to push web stuff out. Granted it's not going to be a Facebook built on Crystal, but shoot I'll get better and be able to do more the more I practice. @RX14 is more of your systems guys :P
<RX14> nah, I just know a little of everything and not a lot of anything
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <bigDaddyS1oth> @RX14 eh you got time to learn a lot everything.
<RX14> i hope so :)
<FromGitter> <faustinoaq> @ertw ⏎ ⏎ ```code paste, see link``` []
<FromGitter> <bigDaddyS1oth> Quick question: why does `gets` give a possible output of `String | Nil`? what does that do for compile time? It makes using `gets` feel more...autonomous, I guess is the correct word.
<FromGitter> <bigDaddyS1oth> Not as natural, that's it.
<FromGitter> <johnjansen> lets look at the code ;-)
<FromGitter> <johnjansen> so what happens if you call gets on an IO when the pointer is at the end of the file?
<FromGitter> <johnjansen> @bigDaddyS1oth ;-)
<FromGitter> <bigDaddyS1oth> You get a nil?
<FromGitter> <bigDaddyS1oth> Or looking at the API ( that's what it shows
<FromGitter> <bigDaddyS1oth> hmm that link did something weird
<FromGitter> <johnjansen> ;-)
<FromGitter> <bigDaddyS1oth> oh because there was ) in the link address
<FromGitter> <johnjansen> but yes, you get a nil
<FromGitter> <johnjansen> hence the union type
<FromGitter> <bigDaddyS1oth> ahhhh
<FromGitter> <bigDaddyS1oth> @johnjansen so when we need to get input from a user, we need to tell the compiler that there will be no chance for a `nil` in the union type? Like when we want a user to give a number for some calculations?
<FromGitter> <johnjansen> you need to test the return from gets in some way yes
<FromGitter> <bigDaddyS1oth> so how would you go about that? Something like `gets.no_nil.to_i`or however we specify that the union type won't be `x | Nil`?
<FromGitter> <johnjansen> just looking at it right now
<FromGitter> <bigDaddyS1oth> oh I just found it. `not_nil!`
<FromGitter> <bigDaddyS1oth> So it'd be `gets.not_nil!.to_(x)`
<FromGitter> <johnjansen> `not_nil!` is certainly in the list of choices, depends on your code what reads most cleanly and gives the result you need
<FromGitter> <bigDaddyS1oth> Or specifying that a variable will be a union type of, if an integer, `var : UInt32`? Or am I missing the point of statically assigning a variable with a union type?
<FromGitter> <johnjansen> tiny hack ⏎ ⏎ ```io = ⏎ io << "123" ⏎ io.rewind ⏎ io.gets.not_nil!.to_i``` []
<FromGitter> <johnjansen> Union types are useful, but maybe not in this case … thats up to you to decide
<FromGitter> <faustinoaq> Hi people!, How can i do a WebSocket server using standard library?
<FromGitter> <johnjansen> the problem with the above, is if you dont `rewind` in the demo, you will get an error
<FromGitter> <johnjansen> @faustinoaq dont know the answer, but kemal has it baked in so take a peek at that
<FromGitter> <bigDaddyS1oth> well I doing stuff with user input, unless the user has a choice of inputting different types, union types don't seem too very useful
<FromGitter> <bigDaddyS1oth> *with doing
<FromGitter> <johnjansen> are you coming from a Dynamic language or a Statically typed one?
<FromGitter> <bigDaddyS1oth> dynamic, I'm coming from a Ruby background
<FromGitter> <johnjansen> ok, so you have been let off the hook a lot. alot of ruby code only works because most objects quack like a string … (generalization) … so you should take a moment to think about what situations might leave you with a `nil` and be defensive about those cases
<FromGitter> <johnjansen> so when you say user input, what are we talking about
<FromGitter> <bigDaddyS1oth> Well that's why I'm making sure to learn some statically typed languages. It helps. Essentially we need the possibility of having `nil` is for situations that either aren't mission critical or for when we actually need a `nil`, right?
<FromGitter> <johnjansen> in the case of `gets` at the end of some `IO` there is literally `nil` left to get
<FromGitter> <bigDaddyS1oth> and user input being for programs that need them. Like a login: you either need a user to enter the `String` types that are their username and password, otherwise it returns `nil` and that allows us to throw exceptions
<FromGitter> <johnjansen> depends on how the data arrives, is this a cli app?
<FromGitter> <johnjansen> if its a web post then its most likely already a string
<FromGitter> <bigDaddyS1oth> well yea in the case of needing to get an integer from the user
<FromGitter> <faustinoaq> @johnjansen yes, i read Kemal code but is a quite confusing for me because I know that WebSocket is a handler but How can i manage routes with?
<FromGitter> <bigDaddyS1oth> @faustinoaq with Kemal? You add your routes to the file
<FromGitter> <bigDaddyS1oth> and you use the HTTP protocols like get, post, put, delete, etc
<FromGitter> <johnjansen> so @bigDaddyS1oth String.to_i will work, if its a string, and as long as it can be mapped, otherwise you need to test the string first anyway … i.e. what if the user enters “A” not “1"
<FromGitter> <johnjansen> @faustinoaq you could ask @sdogruyol who wrote kemal … he’s very helpful
<FromGitter> <bigDaddyS1oth> @johnjansen so we set the variable like `x = gets.to_i`?
<FromGitter> <faustinoaq> yes :+1: Im doing some hacking with Kemal code to lean how it works :smile:
<FromGitter> <bigDaddyS1oth> @johnjansen just like Ruby?
<FromGitter> <johnjansen> @bigDaddyS1oth so what if the user enters “a"
<FromGitter> <johnjansen> what do you expect
<FromGitter> <johnjansen>
<FromGitter> <bigDaddyS1oth> well then you can put your `gets` into a loop to ensure that they put in an integer. Or do a `try` block
<FromGitter> <johnjansen> yes, and dont try to cast it till later
<FromGitter> <bigDaddyS1oth> that's what I've done with small ruby cli apps I've made. You set a `while var !==` or `unless var ==`