ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
<FromGitter> <moe:busyloop.net> i don't get the hype either. i can see how the safety is mighty useful for certain apps. but for >90% of my apps i really don't want to manually manage my memory or think about "borrows".
<FromGitter> <moe:busyloop.net> in the same way that i don't want every second line to read `if err`. it just makes it hard to see what the code actually does...
<FromGitter> <wwalker> crystal seems to be the best of all the worlds. Only if you need true parallelism does crystal seem to fall short. I've used it (`-Dpreview_mt`) with crystal, successfully, but most of the parallel CPU execution was being eaten by "system" so they must be making crazy amounts of context switching. I found it was actually better to just use 1 normal, single threaded process, than to use `mt`. That was back
<FromGitter> ... on 1.6.2, I've not retried it with 1.7.x yet.
<FromGitter> <Blacksmoke16> My understanding it's best suited to IO versus CPU bottlenecks
straight-shoota has quit [Ping timeout: 252 seconds]
straight-shoota has joined #crystal-lang
<FromGitter> <wwalker> yep, I use fibers for blocking IO stuff, and they work great. currently I have a few severely CPU bound processes, so I have a controller (lots of Fibers) spawning separate crystal processes to handle the CPU intensive stuff. the combination is working very close to 100% usage of all the CPUs with very little lost to "system"
alexherbo2 has joined #crystal-lang
_ht has joined #crystal-lang
jmdaemon has quit [Ping timeout: 255 seconds]
<FromGitter> <moe:busyloop.net> yup, MT is hard when you don't bake it into the language from version 0
<FromGitter> <moe:busyloop.net> but in most cases i'd still rather go multiprocess instead of moving an entire project to go or rust just for that. baby vs bathwater
alexherbo2 has quit [Remote host closed the connection]
<FromGitter> <ober> especially M:N
<FromGitter> <mjblack> It didnt work for me but I was able to get WinDbg to work
hightower2 has joined #crystal-lang
alexherbo2 has joined #crystal-lang
renich has joined #crystal-lang
<renich> Hey crystal wizards! 0/
<renich> I was wondering, is there a one-liner in crystal to serve files via HTTP? Something like this: https://gist.github.com/willurd/5720255
<renich> jokingly, I posted mine as a comment there.
<renich> If not, this should be the #1 priority for the next release.
<renich> :D
<renich> I mean, PHP is way ahead of us with their `php -S localhost:8080` line...
<FromGitter> <Blacksmoke16> would prob just want to use https://crystal-lang.org/api/master/HTTP/StaticFileHandler.html
<renich> ruby has a one-liner as well: `ruby -run -ehttpd . -p8000` (requires WEBrick)
<FromGitter> <Blacksmoke16> could prob make it a one liner, but :shrug:
<renich> Blacksmoke16: you mean remove the logger and error handler?
<FromGitter> <Blacksmoke16> hm? those arent used by default
<FromGitter> <Blacksmoke16> so just need to create an `HTTP::Server` with that static file handler and run it
<renich> Yep, I confirm it works Blacksomke16.
<renich> This works: `crystal eval 'require "http/server"; server = HTTP::Server.new( [HTTP::StaticFileHandler.new("./")] ); server.bind_tcp "127.0.0.1", 8081; server.listen'`
<FromGitter> <Blacksmoke16> 👍
<renich> The logger's cool, though.
taupiqueur1 has joined #crystal-lang
taupiqueur has quit [Ping timeout: 252 seconds]
jmdaemon has joined #crystal-lang
_ht has quit [Quit: _ht]
alexherbo2 has quit [Remote host closed the connection]
Sankalp has quit [Ping timeout: 268 seconds]
Sankalp- has joined #crystal-lang
Sankalp- is now known as Sankalp
ur5us_ has joined #crystal-lang