ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
<FromGitter> <codenoid> btw, i want make a portable app, but how i can symlink the App and OS dependencies ?
<FromGitter> <codenoid> ^^ cool
<FromGitter> <faustinoaq> I love to see crystal icon on my Windows taskbar 😍
<FromGitter> <faustinoaq> If you want to give a try see https://github.com/faustinoaq/crystal-windows-installer
<FromGitter> <codenoid> i dont have a windows computer, ^^ 👍
<FromGitter> <codenoid> but is just for windows 10 @faustinoaq ?
<FromGitter> <mgarciaisaia> @codenoid I think so, because it depends on the Linux Subsystem (the Bash On Ubuntu On Windows), that's only available on Windows 10
<FromGitter> <mgarciaisaia> Lovely, Faustino :)
<FromGitter> <simaoneves> hi, i have a question
<FromGitter> <simaoneves> how can i convert the characters that i read from STDIN in raw mode to something usable?
<FromGitter> <simaoneves> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59a0d208578b44a046ebd267]
<FromGitter> <simaoneves> if i click "j", thats good, but if i do arrow up i get "A"
<FromGitter> <simaoneves> or if i do Ctrl-e i get "\u0005"
<FromGitter> <simaoneves> which is not very helpful
<FromGitter> <picatz> Well, up arrow is `^[[A` a control character or something, right?
<FromGitter> <picatz> Down arrow should be `^[[B` or something like that.
<FromGitter> <simaoneves> yep, it is
<FromGitter> <picatz> So to be clear as I mess around, the `^[[` would make the `A` you get more helpful?
<FromGitter> <picatz> Or, what would you want to see if you hit the up arrow?
<FromGitter> <simaoneves> well, it can be that, or some other representation
<FromGitter> <simaoneves> like a lib that would convert to better format maybe
<FromGitter> <simaoneves> instead of ^[[A, "up" would be cool for example
<FromGitter> <simaoneves> nothing like that in stdlib right? i looked around but didnt found anything
<FromGitter> <faustinoaq> > but is just for windows 10 @faustinoaq ? ⏎ ⏎ @codenoid Yes, just Windows. commonly it uses installers like accept, next, next, finish. ⏎ ⏎ > I think so, because it depends on the Linux Subsystem ... [https://gitter.im/crystal-lang/crystal?at=59a0d33ebc46472974c26d00]
<FromGitter> <picatz> I wouldn't want it in the stdlib if it was there.
<FromGitter> <simaoneves> yeah eheh
<FromGitter> <picatz> I think a separate shard to handle that could be interesting though.
<FromGitter> <faustinoaq> I just update the README to avoid confusions, see: https://github.com/faustinoaq/crystal-windows-installer
<FromGitter> <picatz> And, instead of "up" -- because that could be confusing, right? Because STDIN could literally have "up" typed.
<FromGitter> <picatz> Maybe `:up` or something?
<FromGitter> <simaoneves> yep, sounds about right
<FromGitter> <picatz> Is there a chart that exists of all the possible characters?
<FromGitter> <simaoneves> do you know a website you can point me to that has all the codes
<FromGitter> <simaoneves> ?
<FromGitter> <simaoneves> lol exactly
<FromGitter> <picatz> lolololol
<FromGitter> <simaoneves> one more lib to do eheh
<FromGitter> <picatz> Well, we could very easily use the `cat` command to make one ourselves.
<FromGitter> <picatz> At least for known characters we'd want to make symbols out of.
<FromGitter> <picatz> then just have PR and issues roll in to have the missing edge cases addressed :P
<FromGitter> <picatz> @faustinoaq with the powerful link!
<FromGitter> <picatz> 👏
<FromGitter> <simaoneves> ok, cool! interesting
<FromGitter> <simaoneves> thanks
<FromGitter> <simaoneves> From the documentation of Char
<FromGitter> <simaoneves> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59a0db8fa7b406262dca25ea]
<FromGitter> <simaoneves> might be useful aswell
<FromGitter> <simaoneves> control? and ascii_control?
<FromGitter> <picatz> @simaoneves nice 👍
sz0 has quit [Quit: Connection closed for inactivity]
<brycek> fancy, got a crystal binary for arm-none-eabi built, but i don't have a great way to get output :P
greengriminal has quit [Quit: This computer has gone to sleep]
<brycek> bah
<brycek> tied up in figuring out what parts of the elf are actually needed to load, how to get teensy_cli_loader to parse the .hex file, and using dtrace on arduino.app to figure out what it's doing
Philpax__ has joined #crystal-lang
<FromGitter> <elorest> How do I write a slice to a file without it looking like `Bytes[20, 219, 197, 20, 202, 33, 42, 215, 255, 92, 33, 15, 9, 244, 177, 166]`
alex`` has joined #crystal-lang
<txdv> brycek: good job!
_whitelogger has joined #crystal-lang
maxpowa has quit [Ping timeout: 240 seconds]
maxpowa has joined #crystal-lang
alex`` has quit [Ping timeout: 246 seconds]
<FromGitter> <codenoid> hi, how to make a loop, if the loop is complete, then he automatically starts from above again
<FromGitter> <krypton97> Any process manager for production usage like pm2 or supervisord that doesn't require an runtime like node/py ??
<FromGitter> <codenoid> ^^ in crystal
<FromGitter> <krypton97> What are you guys using?
<FromGitter> <krypton97> Looking to be a binary
<FromGitter> <krypton97> crystal/c/rust etc
<FromGitter> <codenoid> got it, `.cycle`
maxpowa has quit [Ping timeout: 246 seconds]
maxpowa has joined #crystal-lang
bmcginty has quit [Ping timeout: 248 seconds]
bmcginty has joined #crystal-lang
<FromGitter> <sdogruyol> Morning everyone
<FromGitter> <crisward> Morning @sdogruyol , Just had a github pull request accepted after 10 months... must be a record (not crystal btw)
<FromGitter> <bew> Nice performance :p
<FromGitter> <sdogruyol> @crisward that's interesting :D
<vegai> I started looking at hanging pull requests, sorted by time
<FromGitter> <sdogruyol> @vegai Crystal?
<vegai> and continued working on one that was opened on Feb 18, 2016...
<vegai> dunno if I'll ever get it done though. It augments the openssl bindings and those things are black magic to me still
<vegai> sdogruyol: yeah
<vegai> I sometimes wonder about open source projects
<vegai> the more successful you are, the more open issues and pull requests there are
<vegai> it seems to me that if a typical software team working in a company would have over 20 issues in their backlog, they'd ring all sorts of alarms
<vegai> but hundreds is just fine for a github project :P
* vegai shrugs
<vegai> perhaps the crystal team in Manas keeps some sort of a backlog internally?
<FromGitter> <sdogruyol> probably
<vegai> or perhaps this chaos just works :)
<FromGitter> <sdogruyol> Crystal is a big project :)
<vegai> yeah
<FromGitter> <sdogruyol> it's not chaos, it's just unordered :D
<vegai> here's what I put my head into https://github.com/crystal-lang/crystal/pull/2180
<FromGitter> <sdogruyol> openssl = magic to e
<vegai> yeah. I'm not a smart man
<Yxhuvud> vegai: eh, I have so far never worked at a company that had less than 20 open issues.
<vegai> yes, I misspoke a bit
<Yxhuvud> there is always a conflict about adding new stuff and fixing old issues
<vegai> over 20 issues WIP was what I was trying to say
<vegai> on a single project
<vegai> well ok, that happens too, but it's not usually a good thing :)
<Yxhuvud> depends on your developer count.
<crystal-gh> [crystal] porras opened pull request #4886: Document Array#shift? (master...document-array-shift-question-mark) https://git.io/v5ON1
<vegai> over 20 developers in a single team also tastes like a bad idea
<vegai> but of course generalizations like this are often wrong in some sense
<Yxhuvud> well you can have more than one team on a code base.
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
Groogy has joined #crystal-lang
<Groogy> Hiya! o/
<FromGitter> <codenoid> heyoo,~
<FromGitter> <sdogruyol> hey
DTZUZO has joined #crystal-lang
Groogy has quit [Quit: WeeChat 1.9]
<FromGitter> <picatz> 👋
Groogy has joined #crystal-lang
greenbigfrog has quit [Quit: The server of my BNC just shutdown or got killed!!!]
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
<FromGitter> <sdogruyol> So quiet here :D
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
<FromGitter> <fridgerator> shhh
greenbigfrog has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
chamar has joined #crystal-lang
alex`` has joined #crystal-lang
sz0 has joined #crystal-lang
chamar has quit [Read error: Connection reset by peer]
<FromGitter> <maxpert> Hi everyone
<FromGitter> <maxpert> new to crystal lang, have been working with golang and ruby before
<FromGitter> <maxpert> so really excited to try it out
<FromGitter> <maxpert> I am looking for details on GC implementation and if there is a way I can manually do memory management
<FromGitter> <maxpert> ?
<Papierkorb> Crystal uses the BoehmGC, which is a conservative mark&sweep implementation. Why do you want to do manual memory management?
<Papierkorb> maxpert
<Yxhuvud> as for details, https://github.com/crystal-lang/crystal/blob/master/src/gc/boehm.cr . It does include some methods for manual allocation if you want to do that.
<FromGitter> <maxpert> @Papierkorb when interfacing with C I want to do some memory management myself
<FromGitter> <maxpert> wait where is this IRC?
<Papierkorb> maxpert Not if can avoid it. Use the boehmGC C API instead.
<Papierkorb> Freenode #crystal-lang
<FromGitter> <maxpert> let me join IRC
maxpert has joined #crystal-lang
<maxpert> Hi everyone
<maxpert> :)
<maxpert> Happy to join community
<maxpert> I have a personal hobby project
<maxpert> http://raspchat.com/ that has been written in golang right now I am looking forward for a more efficent implementation and thus exploring crystal-lang
<maxpert> Happy to see you guys already have a websocket support
<maxpert> I will be compiling my project for Raspberry pi so need ARMv6 support with some really efficent memory management
<maxpert> I am not sure how good crystal-langs memory management is but willing to give it a shot
<Papierkorb> Raspi's are quite powerful machines. It would surprise me if the GC would actually be a bottleneck.
<Yxhuvud> I seem to remember someone having it working on the pi, but I can't remeber who it was. :(
<maxpert> @Papierkorb yes it can handle 1000s of connections right now
<maxpert> so I can cross-compile for ARM machines
<maxpert> ?
<maxpert> I am looking forward to take 1000s to 10K connections that's where I hit bottle neck
<maxpert> I have done some benchmarks and turns out I was using channels to pass messages
<maxpert> and channels in golang inherently has some overhead
<Papierkorb> A shitty test broker I did which simply broadcasted everything to every connection handled 10K connections just fine on a few megs of RAM. Has been a year since then though
<maxpert> so I will be using something complicated like Disruptor pattern and interfacing a C/C++ library for realtime message distribution
<Papierkorb> That test broker used channels too. You'll want to too, as Crystal has a deep integration with libevent2
<maxpert> @Papierkorb what's recomended way to broadcast in Crystal
<Papierkorb> list_of_clients.each{|c| c.send(..) }
<maxpert> and the send does all the heavy lifting?
<Papierkorb> That's up to you
<maxpert> queueing and sending over ws etc?
<Papierkorb> What's the heavy lifting?
<Yxhuvud> It would be nice to see a nice implementation of the Disruptor. Dunno if you need manual memory management for that though - as long as you don't allocate on the heap the gc shouldn't run IIRC.
<Papierkorb> That's a call to write() away.
<maxpert> @Papierkrob so current implementation is running on golang gorilla ws implementation which is 1 blocking and 2 needs syncronization since it's not threadsafe
<Papierkorb> Never used Go-lang
<Papierkorb> Will have to in a few weeks :/
<maxpert> @Papierkorb so when you say deep integration with libevent2 is send async?
<maxpert> @Papierkorb why :P
<maxpert> ?
<Papierkorb> No idea how #write is implemented. it was always fast enough for me in my tests.
<maxpert> @Yxhuvud would need to interface anyway because I use leveldb as well :P
<maxpert> I might have to change that though
<maxpert> what's the package manager name and where can I search for different packages?
<FromGitter> <krypton97> Seems like many gophers switch to crystal
<maxpert> @krypton97 well I would have stayed I think I have hit the bottleneck trying crystal out since claim is as fast as C
<maxpert> and I love ruby syntax TBH
<maxpert> I mean I drrooool for that
<maxpert> hey does crystal support generics :P
<FromGitter> <krypton97> Yep
<FromGitter> <krypton97> ^
<maxpert> @krypton97 ya still going through it have a lot to read yet so just doing quick questions to know if I am on right track
<maxpert> How far are we from prod ready crystal?
maxpert has quit [Remote host closed the connection]
maxpert has joined #crystal-lang
maxpert has quit [Remote host closed the connection]
maxpert has joined #crystal-lang
<FromGitter> <krypton97> 1-2 years
<FromGitter> <krypton97> Minimum 1 year I'd say
<FromGitter> <krypton97> There'll be newbies with windows that can't use it right now
<FromGitter> <krypton97> And it can't compile for raspberry
<FromGitter> <krypton97> No support for paralelism
<FromGitter> <krypton97> And so on
<watzon> Yeah there's a lot of work to be done, but it's exciting
<watzon> Hey, does anyone know what algorithm `Crypto::Bcrypt` uses?
<watzon> I'm trying to hash using SHA256
<Papierkorb> BCrypt uses bcrypt.
<watzon> Gasp. Is there no support for SHA-2 in Crystal yet?
<Papierkorb> watzon: Hash what? a password?
<watzon> No, I'm trying to teach myself about blockchains by writing one
<Papierkorb> Oh, SHA256 was around
<watzon> I realize now that Bcrypt isn't the right place
<Papierkorb> I needed it for that too
<watzon> All I'm finding right now is https://devdocs.io/crystal/api/0.23.0/digest/sha1
<watzon> But that shite isn't cryptographically secure anymore
<Papierkorb> `OpenSSL::SHA256.hash`
<Papierkorb> watzon: Are you learning for a custom toy "blockchain"?
<Papierkorb> If yes, I don't think that SHA-1 not being that secure anymore would inhibit that :)
<watzon> Basically, so being secure isn't really necessary
<watzon> But still. I wanted to be sure it was possible
<Papierkorb> In fact, exploiting SHA-1 in the blockchain would be a commendable task, the blocks shouldn't be big enough (while still passing all tests)
<Papierkorb> commendable as in, totally worth the coins in the block ;)
<watzon> Hahaha. Yeah I'm just getting into this
<watzon> Thought it sounded like a fun side project
<watzon> For me to start and then drop in a few days
<Papierkorb> If you get hung up by Base58Check, lemme know
<watzon> Will do
<FromGitter> <johnjansen> @watzon id be interested in doing the same … wanna share your work, and for that matter reference you are following?
<Papierkorb> johnjansen, Which part exactly? The theory, if you don't care about the math proof behind it, isn't that hard at all actually
<watzon> Well I just started my researching, but I found this article which is interesting https://medium.com/@lhartikk/a-blockchain-in-200-lines-of-code-963cc1cc0e54
<Papierkorb> johnjansen, if you overlook the DHT part, it's quite easy to build a toy chain in no time
<FromGitter> <johnjansen> i havent mentally connected with blockchain yet .. so i need to start somewhere
maxpert has quit [Remote host closed the connection]
<FromGitter> <johnjansen> very nice, id have a go ;-)
<watzon> There is a plethora of information about blockchains, but very little about creating one of your own
<watzon> Papierkorb: where is `OpenSSL::SHA256` in the docs? All I'm finding is `OpenSSL::SHA1`
<Papierkorb> Ah, I core_ext'd that one
sz0 has quit [Quit: Connection closed for inactivity]
<watzon> Ahh never mind
<Papierkorb> Though you can use any hashing algorithm for a toy chain
<watzon> For a generic cryptographic hash, use SHA-256 via OpenSSL::Digest.new("SHA256")
<watzon> I guess Digest.new defaults to SHA256?
<watzon> That could definitely be better documented haha
<watzon> Or is the "SHA256" setting the algo? I'
<watzon> I'm confused
<crystal-gh> [crystal] luislavena opened pull request #4887: Normalize Flate's block interface to `.open` (master...normalize-flate-api) https://git.io/v538K
alex`` has quit [Ping timeout: 264 seconds]
snsei has joined #crystal-lang
sz0 has joined #crystal-lang
_whitelogger has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]