jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.7 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
<leafybasil> As soon as I run "crystal doc" I get "Invalid memory access (signal 11) at address 0x7fff579ecfec"
<leafybasil> Happy to create an issue for this, just wondered if this message makes it obvious that I've done something dumb.
<leafybasil> Although I suspect not
Oliphaunte has joined #crystal-lang
<willl> leafybasil: please open an issue. It also may be usful if you can try running `lldb crystal doc` then when the prompt comes up type `run`, and after it segfaults: `bt` and `l`
<leafybasil> I willl do that
<leafybasil> willl: judging by the very limited output, when running with lldb attached, I suspect it just broke differently
Philpax has joined #crystal-lang
paulcsmith_ has joined #crystal-lang
<leafybasil> `bt` dumps a hell of a lot of backtrace, then `l` seemingly does nothing
paulcsmith_ has quit [Client Quit]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vKyIy
<crystal-gh> crystal/master 9b31f54 Ary Borenszweig: Docs: missing handling of named tuples. Fixes #3034
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
<travis-ci> crystal-lang/crystal#9b31f54 (master - Docs: missing handling of named tuples. Fixes #3034): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/146794208
Oliphaunte has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit []
Philpax has quit [Ping timeout: 252 seconds]
snsei has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Oliphaunte has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 250 seconds]
snsei_ has quit [Remote host closed the connection]
Oliphaunte has quit [Remote host closed the connection]
Kilo`byte has quit [Ping timeout: 252 seconds]
Kilo`byte has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 244 seconds]
snsei has joined #crystal-lang
pawnbox has joined #crystal-lang
snsei has quit [Ping timeout: 244 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 250 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 260 seconds]
pawnbox has quit [Ping timeout: 258 seconds]
pawnbox has joined #crystal-lang
zodiak has joined #crystal-lang
zodiak_ has quit [Ping timeout: 258 seconds]
jeromegn has quit [Ping timeout: 264 seconds]
jeromegn has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
pawnbox has quit [Ping timeout: 258 seconds]
pawnbox has joined #crystal-lang
<jhass> jwoertink: should be this one https://github.com/f/crystalshards
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 265 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Philpax has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
<FromGitter> <sdogruyol> hey all
<crystal-gh> [crystal] jhass opened pull request #3035: Add IO#noecho and IO#noecho! (master...noecho) https://git.io/vKyEk
* FromGitter * kofno waves
pawnbox_ has joined #crystal-lang
<FromGitter> <sdogruyol> kofno how you doin'
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox_ has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 276 seconds]
triangles has joined #crystal-lang
trapped has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
pawnbox has joined #crystal-lang
matp has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 276 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 244 seconds]
<jhass> asterite: we gotta do something about read_nonblock. It's broken and there's no way to ask an IO(::FileDescriptor) to "give me up n bytes but don't block in any way to fulfill that". Also do you understand the blocking argument of IO::FileDescriptor.new?
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 264 seconds]
<RX14> jhass, to me it just sets O_NONBLOCK when calling open()
<RX14> which is specified in man pages
<RX14> man 2 open
<jhass> #blocking= does
<RX14> the constructor calls that
<jhass> yes that stuff is what confuses me
rolha has joined #crystal-lang
<RX14> self.blocking = false is self explanitory
<RX14> it sets O_NONBLOCK
<RX14> edge triggerable confuses me but i havent looked at it
<jhass> why is it true for files and non-terminals, but terminals?
<RX14> jhass, O_NONBLOCK has no effect for files
<RX14> because they can't really block
<RX14> it's just disk latency
<RX14> instead of actually being blockable like a pipe or socket
<jhass> how do I get just whatever is available without blocking in any way?
<jhass> Why's there a public #blocking= which doesn't do the same setup as in #initialize?
<jhass> this is all confusing and feels rather undesigned
<RX14> O_NONBLOCK just returns EAGAIN if it can't fill the buffer, not returns partial data
<RX14> so it looks like there isnt really a way at the moment
<jhass> so how would one do a partial read then?
<jhass> in C
<RX14> recv?
<RX14> idk
<RX14> the man pages seem confusing to me
<FromGitter> <kofno> @sdogruyol I'm good. Just went to breakfast with the family and now I'm back!
<jhass> recv is for sockets only, no?
<RX14> yes
<jhass> I want to do it for a terminal but ideally generically
<RX14> isnt that a pipe()
<jhass> no
<jhass> or is it?
<jhass> would surprise me
<RX14> well
<RX14> its a character file?
<RX14> character files behave like pipes it seems
<RX14> based on the man pages it seems read() would return a partial read if it had partial data
<RX14> all the time
<RX14> whether blocking or not
<RX14> then block on the next call
<RX14> we can test this
<jhass> https://p.jhass.eu/4g.cr how terrible is this?
<RX14> uhh
<RX14> jhass, socket.read() does return partial data
<RX14> always
<jhass> guess the raise should restore the buffer
<RX14> i've got it testing witha tcp socket
<RX14> and nc
<RX14> as soon as i press enter to send it shows up on the other end of the socket
<RX14> even if it only reads 3 bytes instead of the 10245 i asked
<RX14> 1024*
<jhass> ok
snsei has joined #crystal-lang
* jhass is afraid to write tests for this...
<RX14> what's your method for anyway
<jhass> good thing we don't have any for IO::FileDescriptor, obviously
<RX14> i'm not quire sure what the problem is
<jhass> fixing samples/2048.cr
<RX14> how is it broken
<jhass> https://p.jhass.eu/4h.cr this does appear to work
<RX14> oh
<jhass> it's broken as that it blocks on pressing esc
<RX14> you need to set therminal modes for that
<jhass> happens, STDIN.raw
<RX14> oh
<RX14> uhh
<jhass> the version I pasted together with the method I pasted does appear to work again
<jhass> the current one doesn't
<jhass> I'm just not too confident whether the read_partially implementation is correct
<RX14> did you write read_partially
<jhass> yes
<jhass> basically copy paste from IO::Buffered#read and IO::FileDescriptor#unbuffered_read
<jhass> sans the wait_readable in the latter
snsei has quit [Ping timeout: 240 seconds]
<jhass> even if it works though, the API is terrible
<jhass> adding gets_partially and what not would be terrible too :/
<RX14> calling read shouldnt block unless there's noting else to read
<jhass> well, that would suck already
<RX14> ???
<RX14> it already does do that
<jhass> I want read_partially to return with 0 if there's nothing to read at all
<RX14> wait so doesn't a file descriptor with blocking: true block the whole process?
<RX14> jhass, i tested with STDLIN.raw and calling read() on it gives me characters as soon as they are typed it just blocks the fiber when there's nothing waiting
<RX14> you mightr be able to do it with fibers
<RX14> the fiber would block but send stuff down a nonblocking channel
<jhass> that seems even more cumbersome
<RX14> yeah but it works
<RX14> oh i've made a huge mistake
<RX14> i can't ^C my crystal program now
<jhass> ^\ should still work
triangles has quit [Quit: Leaving]
<RX14> doesnt work
<jhass> then you have to kill it externally
<jhass> ugh, PointerIO looks dangerous
<RX14> well
<RX14> it does have Pointer in the name
pawnbox has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
willl has joined #crystal-lang
<crystal-gh> [crystal] jhass opened pull request #3036: Remove IO#read_nonblock (master...remove_nonblock) https://git.io/vKyKj
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
jhass has quit [Ping timeout: 240 seconds]
jhass has joined #crystal-lang
Philpax has quit [Ping timeout: 252 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
pawnbox has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
matp has joined #crystal-lang
pawnbox has joined #crystal-lang
kulelu88 has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 240 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
Raimondii is now known as Raimondi
snsei has quit [Ping timeout: 260 seconds]
willl has quit [Quit: Connection closed for inactivity]
Dreamer3 has quit [Read error: Connection reset by peer]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/vKyy1
<crystal-gh> crystal/master 165d230 Jonne Haß: Add IO#noecho and IO#noecho!
<crystal-gh> crystal/master 428acab Ary Borenszweig: Merge pull request #3035 from jhass/noecho...
<crystal-gh> crystal/master 602e24e Jonne Haß: Add some documentation to io/console's methods [ci skip]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vKyyF
<crystal-gh> crystal/master 12648f4 Jonne Haß: Add OptionParser#missing_option and OptionParser#invalid_option...
<crystal-gh> crystal/master 0813841 Ary Borenszweig: Merge pull request #3030 from jhass/option_parser_handlers...
Raimondii is now known as Raimondi
<travis-ci> crystal-lang/crystal#428acab (master - Merge pull request #3035 from jhass/noecho): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/146891426
fnux has quit [Ping timeout: 264 seconds]
fnux has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 240 seconds]
<RX14> what's the best way to test a private method in a class?
<travis-ci> crystal-lang/crystal#0813841 (master - Merge pull request #3030 from jhass/option_parser_handlers): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/146892054
<jhass> RX14: private methods should be implementation details, their behavior is part of the contract the public methods that call them provide
<RX14> sure I can craft inputs to hit these private routines
<RX14> it would be quite easy really
<RX14> but i would rather test them in isolation
<RX14> i would have to create a complete multipart payload which is different only in the Content-Disposition header
<RX14> guess i could create a helper method to do that
<RX14> there should be a way to declare helper methods per test case because currently they have to have unique names and be declared at the top level
zodiak_ has joined #crystal-lang
zodiak has quit [Ping timeout: 244 seconds]
Oliphaunte has joined #crystal-lang
aeosynth has joined #crystal-lang
<aeosynth> any idea when the next crystal release will happen? what is the release process/schedule?
<RX14> aeosynth, whenever it's ready at the moment
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
aeosynth has quit []
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
adam12 is now known as adam
adam is now known as Guest55646
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
jeromegn has quit [Ping timeout: 250 seconds]
jeromegn has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
devinacosta has joined #crystal-lang
<devinacosta> Question, i'm building an application with Crystal using shards, and i have my shard.yml correct, it downloads, but it puts everything into the libs directory, am i suppose to do something specific with the code under "src" directory to be able to use the library?
<RX14> just require it
<RX14> it should work
<devinacosta> Error in ./container.cr:1: while requiring "ssh2": can't find file 'ssh2' relative to '/root/code/crystal/vzcheck/src'
<devinacosta> it keeps wanting to check for it under "src"
<RX14> can you show me your shards.yml
Oliphaunte has joined #crystal-lang
<RX14> where are you running your crystal command?
<RX14> the crystal build
<RX14> or run
<jhass> you do require "ssh2" not require "./ssh2" or anything like that, right?
<devinacosta> i tried within the "src" directory, i now just tried from the project root.
<RX14> i assume that didn't work
<devinacosta> If i try from the root it fails with "/usr/bin/ld: cannot find -lssh2"
<RX14> oh
<RX14> it did
<RX14> another problem
<RX14> you need to install the library
<devinacosta> i did run: crystal deps
<jhass> libssh2 that is
<RX14> the ssh2 library is a wrapper for the libssh2 system library
<RX14> it's a c library
<RX14> uou need to install it from your distribution
<jhass> specifically it's dev package if your on debian based or its devel package if you're on rpm based
<devinacosta> Do i add that to my shard.yml or just install on the system?
<RX14> or what operating system do you use
<jhass> install it to the system
<RX14> you need to install libssh2 with your system package manager
<jhass> the ssh2 shard just provides bindings to the library
<RX14> but the dev version
<devinacosta> Package libssh2-1.4.3-10.el7_2.1.x86_64 already installed and latest version
<jhass> libssh2-devel then
<devinacosta> ahhh
<devinacosta> let me check devel
<devinacosta> ok that fixed my issue.
<devinacosta> thanks so much.
<jhass> yw
<jhass> it scares me a bit that you work as root....
<devinacosta> this is just a VM on my laptop.
<jhass> bad habits leak though ;P
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 250 seconds]
Raimondii is now known as Raimondi
<devinacosta> so one last question, i'm following this example at https://github.com/datanoise/ssh2.cr/blob/master/examples/shell.cr however it complains
<devinacosta> Syntax error in ./src/container.cr:8: unexpected token: :: @buf_space :: UInt8[1024]
<RX14> ah
<RX14> it seems you're using a tutorial from an older version of crystal
<devinacosta> ahhh, so new syntax?
<jhass> devinacosta: that should be @buf_space = uninitialized UInt8[1024] now
<RX14> i couldnt remember if that was uninitialized or class var type syntax
Oliphaunte has quit [Remote host closed the connection]
<devinacosta> so the next variable freaks out with:
<devinacosta> Can't infer the type of instance variable '@buf' of Container @buf = @buf_space.to_slice
<devinacosta> is that because it's uninitialized?
<RX14> you probably want to add @buf : Slice in the class root
<RX14> well
<RX14> @buf : Slice(UInt8)
<jhass> devinacosta: the error message should explain quite throughout why
<jhass> devinacosta: are you sure you want to use instance variables there btw?
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
<devinacosta> ok looks like the latest crystal majorly broke that guys code.
<devinacosta> may have to just revert to Ruby until i can figure out why crystal can be such a pain.
<devinacosta> dispatch_protocol_error: type 90 seq 5
<devinacosta> is what SSH does even just running a simple "uptime" command.
<jhass> well, at least open an issue in the repo ;)
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/vKyxY
<crystal-gh> crystal/master 722198b Ary Borenszweig: Compiler: some simplifications related to C structs and unions
<crystal-gh> crystal/master a009eb4 Ary Borenszweig: std: use chop and chomp in some places
<crystal-gh> crystal/master 2835728 Ary Borenszweig: String: minor refactors and microoptimizations
rolha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 260 seconds]
sp4rrow has joined #crystal-lang
<sp4rrow> just curious why did crystal choose spec syntax over assert syntax in regards to testing ?
<jhass> core dev preference ;)
<sp4rrow> cool :)
<sp4rrow> This is also curious but could crystal lang support a garbage collector and could it self host a garbage collector?
<sp4rrow> seems like there would have to be some lower level tooling added
<sp4rrow> just an interesting thought
<travis-ci> crystal-lang/crystal#2835728 (master - String: minor refactors and microoptimizations): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/146922224
<jhass> sp4rrow: crystal currently uses bohem gc (aka bdwgc), the interface is basic but pluggable see https://github.com/crystal-lang/crystal/tree/master/src/gc
<sp4rrow> I was reading about that today
<sp4rrow> just in general
<jhass> implementing our own (probably precise) GC is a mid to long term goal
<sp4rrow> do you have any plans on how you would implement it?
<jhass> I don't and I haven't seen anything public
<sp4rrow> I mean it is probably still a way off
<sp4rrow> I was just curious
<jhass> there are a couple more important issues, bdwgc works quite well for us atm
<sp4rrow> cool
<sp4rrow> is there a list of important issues
<sp4rrow> just the github issues
<jhass> yeah, no official priority list
<jhass> I'd consider generics and parallelism the most important outstanding ones
<sp4rrow> yeah that seem pretty big things to tackle
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]