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 :)
<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 crystalshards.xyz | 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: https://git.io/v9dHL
<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
<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
<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>
<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
<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> @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
<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. https://github.com/drujensen/fib
<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>
<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>
<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..
<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.
<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"; HTTP::Server.new(8000, HTTP::StaticFileHandler.new(".")).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>
<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 `socket.read(1024)` and instead I need to pass stuff
<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 VB.net :)
<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
<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>
<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
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.
<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>
<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> 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 yourapp.cr 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"