RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.25.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
<FromGitter> <paulcsmith> Looks like it is failing building this file https://github.com/luckyframework/lucky/blob/master/tasks/gen/model.cr 🤔
francisl has quit [Quit: francisl]
francisl has joined #crystal-lang
akaiiro has quit [Ping timeout: 245 seconds]
akaiiro has joined #crystal-lang
DTZUZU has quit [Ping timeout: 244 seconds]
DTZUZU has joined #crystal-lang
DTZUZU has quit [Ping timeout: 240 seconds]
DTZUZU has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 272 seconds]
Raimondii is now known as Raimondi
francisl has quit [Quit: francisl]
akaiiro has quit [Remote host closed the connection]
<FromGitter> <bararchy> @asterite have you seen anything @ysbaddaden did on the multi-threaded fibers? it sounds interesting
<FromGitter> <samof76> @fridgerator thanks... I will check them out.
bmcginty has joined #crystal-lang
return0e has quit [Remote host closed the connection]
return0e has joined #crystal-lang
moei has quit [Quit: Leaving...]
DTZUZO has quit [Ping timeout: 272 seconds]
moei has joined #crystal-lang
fifr[m] has quit [Read error: Connection reset by peer]
olbat[m] has quit [Read error: Connection reset by peer]
kp666[m] has quit [Read error: Connection reset by peer]
Renich[m] has quit [Remote host closed the connection]
Connor[m] has quit [Remote host closed the connection]
<FromGitter> <j8r> for DB SQlite is fine more often than we thought https://news.ycombinator.com/item?id=17766799 (to continue the above discussion, a bit late)
<FromGitter> <drum445> A flat file will surely always have issues with simultaneous access though
ashirase has quit [Ping timeout: 248 seconds]
ashirase has joined #crystal-lang
<FromGitter> <j8r> apparently 16 concurrent read/write are possible, and no limit for read-only
<FromGitter> <drum445> Still now quite sure why you'd pick it over something built for concurrent use
<FromGitter> <drum445> interesting either way though
<RX14> @drum445 you realise that postgres writes to files on the disk too
<RX14> sqlite isn't a flat file
<RX14> a flat file means the file has no indexes
<FromGitter> <drum445> I do, but isn't sqlite a single file
<FromGitter> <drum445> How do you pass command line args to crystal program?
<RX14> a single file can be read by infinitely many processes at the same time
<FromGitter> <drum445> read yes, writes no
<FromGitter> <j8r> The DB can also live in memory.
<RX14> a single file or multiple files makes pretty much no difference to performance
<RX14> why do you say that?
<RX14> if they're writing to different parts of the file they're independant
<FromGitter> <j8r> The article is talking about page lock for concurrent writes
<FromGitter> <drum445> indeed, can I pass command line args to me crystal app guys?
<FromGitter> <j8r> yes with `ARGV`
<FromGitter> <drum445> godbless
alex`` has joined #crystal-lang
ua has quit [Remote host closed the connection]
ua has joined #crystal-lang
<FromGitter> <paulcsmith> Could someone with 0.26 clone https://github.com/luckyframework/lucky_record, run `shards install` and then `crystal spec`? I'm getting a weird compilation error that I can't debug and I wonder if it is just my installation of 0.26 is messed up. I built from source since Homebrew isn't working
<FromGitter> <paulcsmith> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b75576f937eee242325c46c]
<FromGitter> <paulcsmith> And I'm seeing the same error on Travis CI with 0.26 :S
<FromGitter> <paulcsmith> @bcardiff did you see this when testing Lucky with Crystal 0.26? ^
alex`` has quit [Ping timeout: 256 seconds]
<FromGitter> <sdogruyol> @paulcsmith the same error on Arch linux
<FromGitter> <paulcsmith> Thank you for confirming Serdar!
<FromGitter> <paulcsmith> Any ideas how I might debug this? I've tried with --debug and --verbose mode and I don't see any additional info to help figure out what the issue is
<FromGitter> <paulcsmith> I opened an issue here so it is easier to track https://github.com/crystal-lang/crystal/issues/6547 I'm totally stumped on how to debug this because I can't figure out how to get a more thorough trace
DTZUZO has joined #crystal-lang
thews has quit [Ping timeout: 244 seconds]
alex`` has joined #crystal-lang
<FromGitter> <bararchy> RX14 nice! reding it now
<FromGitter> <Qwerp-Derp> I'm trying to compile a .o file with libui in Windows, but it's spewing out a bunch of "unresolved external symbol" messages
<FromGitter> <j8r> same, reading the post right now - and like it :)
<FromGitter> <Grabli66> Hi! I need to trim a string and remove any special symbols from it. How can i do that? I can't find any usefull method in a string for that.
<FromGitter> <Grabli66> Ooops. I found. String#strip :)
thews has joined #crystal-lang
<FromGitter> <j8r> there is also `#gsub`
<FromGitter> <asterite> @bararchy nope, no time/knowledge about that
<FromGitter> <bararchy> @asterite 👍
<RX14>
francisl has joined #crystal-lang
bmcginty has quit [Ping timeout: 268 seconds]
bmcginty has joined #crystal-lang
<FromGitter> <Prutheus> wow brew/crystal still not updated ....
<FromGitter> <vegai> @paulcsmith the error seems to be coming from src/compiler/crystal/types.cr
<FromGitter> <vegai> and from commit 773eecab1d5cf8325a75afefe791fd9bbf565cce
<FromGitter> <vegai> Uh, scratch that. That commit was made after 0.26
<FromGitter> <fridgerator> @Prutheus There is a PR to remove amber, just waiting on the brew team now I belive
<FromGitter> <fridgerator> believe(
<FromGitter> <paulcsmith> https://github.com/crystal-lang/crystal/issues/6547 yeah there is an issue here for Lucky. Hopefully a fix is coming soon :)
<FromGitter> <Prutheus> @fridgerator yeah wating for 8 hours already .... there are productive systems which fails today because the update is missing ...
<FromGitter> <fridgerator> if you really need it, checkout the crystal repo and build it
<FromGitter> <fridgerator> thats what I've done
<FromGitter> <Prutheus> yeah this would be a solution, but i need to perform that on so much osx systems ... not really good ... i thunk i need to wait for the update ... and should be prepared for the next time such issue will happen ...
<FromGitter> <fridgerator> you have production applications that always require the latest crystal version?
<FromGitter> <rishavs> Assuming that Amber, Kemal, Lucky etc are the most popular Crystal libs, why don't we look at implementing an early release channel for them? That way the repo owners will be ready for the new Crystal releases. Maybe it is time to improve upon our release process?
<FromGitter> <rishavs> Pretty much evertime we have a new Crystal release, the community libraries stay broken for a few days
<FromGitter> <bcardiff> We try to catch up this as early as we can. But sometimes nested dependencies and some missing features in shards make it hard some times. In this release that happened a bit.
<FromGitter> <vegai> you’re running production systems on mac os?
<FromGitter> <Prutheus> @fridgerator I have productive systems which automatically updates their shards without a fallback-option and the shards are already updated .... Of course this whole system is full of mistakes by me, but for now I just need the update ...
<FromGitter> <Prutheus> @vegai maybe it sounds strange, but yes. I have vmware esxi osx systems which clients operate on via remote access ... :D
<FromGitter> <rishavs> @Prutheus you are a brave soul.. 🙀
<FromGitter> <straight-shoota> @rishavs Nightly builds are already available, and it's easy to build a compiler yourself. It's up to the maintainers to make their shards ready for the new release. But given that there is often just a single maintainer responsible for a shard, it can take some time.
<FromGitter> <vegai> @Prutheus weird, but that’s always fun!
<FromGitter> <vegai> :)
<FromGitter> <Prutheus> its absolute funny, yeah haha...but now, hundreds of clients were down today ... so i really need that update :D
<FromGitter> <rishavs> @straight-shoota Maybe everytime we close a release and its release notes, if instead of making it public, we only release it for the community developers and then make it public after 1 week, a lot of these issues will be alleviated. I feel that if developers are in the loop about upcoming releases, they will have enough time to fix their own repos. ⏎ Anyway, just throwing ideas out there. I am not clear
<FromGitter> ... about the current process, so apologies if something comes across as presumptuous.
<FromGitter> <straight-shoota> how would you specify "community developers"?
<FromGitter> <straight-shoota> The last releases were on the radar long enough. When a release PR is created, this is a clear sign to expect something coming up. Then is enough time to use a current build to validate shards.
<FromGitter> <straight-shoota> I don't think you need any special release process for this.
<FromGitter> <straight-shoota> @bcardiff even runs https://github.com/bcardiff/test-ecosystem before each release
<FromGitter> <rishavs> Hmmm... For me "community developers" would mean the maintainers of all major crystal libraries like Amber, Lucky, Kemal etc which have a significant number of stars. We can also consider projects which are dependencies for a lot of other projects. Finally, perhaps this can be a self selection process. People who want to be in this ring can opt in.
<FromGitter> <rishavs> > @bcardiff even runs https://github.com/bcardiff/test-ecosystem before each release ⏎ ⏎ Didn't knwo about this one.
<FromGitter> <j8r> I see the end user problem, but this how the package manager (and some other in general) is working. Dependency hell isn't new. ⏎ To solve that, multiple crystal compiler can be used in parallel like on BSD, but most Linux distros and homebrew aren't designed this way
<FromGitter> <rishavs> true.
<FromGitter> <paulcsmith> I’d say this is mostly something that could have been caught earlier by shard maintainers like myself. In the future I’ll be more proactive in updating to make sure everything is up to snuff. One difficulty is that sometimes shards Lucky depends on aren’t updated so I can’t test them. In the future I’ll fork them, make a PR and rely on the fork until the upstream shard is updated. A bit more work
<FromGitter> ... but much more reliable
<FromGitter> <j8r> Running a CI on crystal:master can solve this, but expensive
<FromGitter> <paulcsmith> Also allowing installation of older versions of crystal and being able to specify that easily (like with rbenv) would be wonderful in the long term, but I’m not sure if that’s the best use of time right now. I think that would help a lot though.
<FromGitter> <j8r> A simple option is to do like PHP versions on RedHat: having `crystal-0.26`, `crystal-0.25`, and `crystal` pointing to the latest version , `crystal-0.26`. ⏎ So Amber can depend on the `crystal-0.25` package, and we still have `crystal-0.26` along side
<FromGitter> <paulcsmith> I’ve got Travis running nightly builds but the initial problem was in another shard, so I thought that was the only issue
<FromGitter> <paulcsmith> In the future I’ll fork and make a fix so I can catch things earlier
<FromGitter> <j8r> And the another shard was also running nightly 😄 ?
<FromGitter> <paulcsmith> I’m not sure :P
<FromGitter> <paulcsmith> It’s still not updated so probably not
<FromGitter> <paulcsmith> I’m relying on a fork for it
akaiiro has joined #crystal-lang
<FromGitter> <j8r> This can solve the problem on the Lucky side, but this won't protect people against a shard that isn't actively maintained/not fixed quickly
<FromGitter> <bcardiff> The only way to "avoid" that is avoiding breaking changes and introduce deprecations for 1 release to another. ⏎ ⏎ The only "easy" workaround I see is to ensure shards dependencies can be overrided globaly, so nested dependencias wont block generating patches. Right now dependecies might specify versions/branches and that make it hard to patch for the "upcoming release".
francisl has quit [Quit: francisl]
<FromGitter> <j8r> Agree. But anyway the problem is *only* the fault of the package managers, that miss the feature, not the Crystal compiler/shards devs.
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 272 seconds]
Raimondii is now known as Raimondi
akaiiro has quit [Ping timeout: 268 seconds]
<robacarp> it's a bit of a sticky situation too, because I'm running a macos machine and haven't ever setup building crystal myself. so when amber blocks crystal releases, I can't update amber
<robacarp> incidentally I'm going to try building the crystal compiler on my machine now so I can update my shards
<robacarp> and, eventually, Amber
francisl has joined #crystal-lang
<FromGitter> <vladfaust> Hi, did anyone worked with arrays in crystal-pg? See https://github.com/will/crystal-pg/issues/149, please
<FromGitter> <rishavs> This is how I used the pg arrays. Not sure if it is any help though... ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b75ad255b07ae730ac93468]
alex`` has quit [Ping timeout: 260 seconds]
alex`` has joined #crystal-lang
Raimondi has quit [Remote host closed the connection]
Raimondi has joined #crystal-lang
alex`` has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
francisl has quit [Quit: francisl]
alex`` has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
<FromGitter> <vladfaust> Thanks @rishavs, unfortunately it's does not help
francisl has joined #crystal-lang
<FromGitter> <rishavs> :D
alex``` has joined #crystal-lang
alex`` has quit [Ping timeout: 240 seconds]
alex``` has quit [Client Quit]
Raimondii has joined #crystal-lang
<FromGitter> <Daniel-Worrall> topic needs updating to 0.26
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
akaiiro has joined #crystal-lang
francisl has quit [Quit: francisl]
francisl has joined #crystal-lang
francisl has quit [Quit: francisl]
<FromGitter> <Sevensidedmarble> Whats the best way to read/gets to the end of STDIN even if its emtpy?
<FromGitter> <Sevensidedmarble> STDIN.gets_to_end will just block if there's nothing in stdin
<FromGitter> <Sevensidedmarble> and I just want to know if the user has passed anything in through a pipe basically
<FromGitter> <Sevensidedmarble> it seems like stdin.tty? is the idiom in ruby but that always returns true for STDIN in crystal
francisl has joined #crystal-lang
<robacarp> @sevensidedmarble why do you say #tty? always returns true?
<Yxhuvud> have you tried it in a situation where you don't have a tty?
<FromGitter> <Sevensidedmarble> you're probably right there
<FromGitter> <Sevensidedmarble> maybe I'm misunderstanding about how gets_to_end is supposed to work
<FromGitter> <Sevensidedmarble> it reads everything if there's data in STDIN
<FromGitter> <Sevensidedmarble> but if there's nothing there it just sits there and blocks it seems like
kireevco has joined #crystal-lang
hightower3 has joined #crystal-lang
<robacarp> @sevensidedmarble gets_to_end _usually_ falls back on a regular IO#read, which is a blocking operation
<kireevco> How stable is influxdb driver? anyone has some experience?
<kireevco> Hello, and great to be here :)
<FromGitter> <Sevensidedmarble> it doesn't seem like it blocks if I just pipe some data in and use it
<robacarp> that's because when there's data available, it doesn't need to block
<FromGitter> <Sevensidedmarble> is there a conveinant method that does what I'm looking for? I know I could just read lines from stdin until I've read them all, but I figured there might be a better built in method
<FromGitter> <Sevensidedmarble> get_to_end is very nice if I also had a way to see if there was currently no bytes in the FD
<robacarp> can you describe what you're trying to accomplish?
<FromGitter> <Sevensidedmarble> yeah sorry
<FromGitter> <Sevensidedmarble> I'm trying to write a pager and replicate less's behavior in different scenarios
<FromGitter> <Sevensidedmarble> if you pipe in data to less but also supply a filename itll just read from the file and ignore stdin
<FromGitter> <Sevensidedmarble> and if you pipe in data it'll obviously read that
<FromGitter> <Sevensidedmarble> but if you just type less and don't pipe anything, it displays a message
<FromGitter> <Sevensidedmarble> that's what I'm trying to do, I want to know if the user just ran my binary without piping anything
<FromGitter> <Timbus> ironically, though crystal does non-blocking reads on tty's, I don't think theres a simple builtin way to actually read it nonblocking.
<FromGitter> <Timbus> you can read the file descriptor yourself, with posix calls? Which shoullld return something like an EWOULDBLOCK (off the top of my head). Not the best solution I know
<robacarp> you can set the FD to raw mode and do a read slice on it, which will read at most Slice.size bytes and return immediately
<robacarp> but that's going to get weird if you actually have data
<FromGitter> <Sevensidedmarble> see what confused me is I checked out less's source code and it seems like all it does is check the tty builtin
<FromGitter> <Sevensidedmarble> to know to print that error message
<FromGitter> <Sevensidedmarble> but if I run my program without piping anything and check if stdin.tty? it says true
<FromGitter> <Timbus> in non tty mode, reading a closed pipe/fd will yield EOF or EPIPE
<robacarp> tty? == true when nothing is piped
<FromGitter> <Sevensidedmarble> but if I just run my binary that doesn't seem to happen
<FromGitter> <Sevensidedmarble> I had that backwards
<FromGitter> <Timbus> less has to wait for slow operations, it will print a blank screen if it is waiting for input, so
<FromGitter> <Sevensidedmarble> if it's waiting yeah
<robacarp> @sevensidedmarble, what invocation are you using to run your program?
<FromGitter> <Sevensidedmarble> oh man, maybe running the crystal compiler is setting the terminal to something weird
<FromGitter> <Sevensidedmarble> ok nope, it seems the exact same whether I run "crystal src/mycode.cr" vs building it and running the binary
<FromGitter> <Sevensidedmarble> but either way I'm just starting it with bash in my terminal
<FromGitter> <Timbus> there are subtle differences though, as crystal spawns off a child to eval your code
<robacarp> @sevensidedmarble https://play.crystal-lang.org/#/r/4rd3
<FromGitter> <Timbus> not too add to your confusion
<robacarp> with something like this, I would not use `crystal run`, but a script which builds and runs your program with the correct input. passing arguments through the compiler is easier, but idk the way to stream through it
<FromGitter> <Sevensidedmarble> thanks for the link robacarp
<FromGitter> <Sevensidedmarble> I didn't even think about streams lol
<robacarp> np
francisl has quit [Quit: francisl]
jokke1 is now known as jokke
<FromGitter> <Sevensidedmarble> the docs say gets will "Returns nil if called at the end of this IO." but I'm not sure what that means when stdin is blank
<robacarp> if stdin is a stream (therefore not a tty), it will block. The "end" doesn't happen unless something outside the program closes the FD
<robacarp> a stream (which could be a piped input, or something else) doesn't need to present all it's data immediately
<FromGitter> <Sevensidedmarble> hmm
<FromGitter> <Timbus> I -really- think this is not what you want, but here is a way to read from stdin, determine if it was empty, or would have blocked: `buf = StaticArray(UInt8, 8).new 0; puts LibC.read(STDIN.fd, buf, 1); puts Errno.value == LibC::EWOULDBLOCK; puts buf[0]`
<robacarp> yeah, that's essentially just reading a slice
<FromGitter> <Sevensidedmarble> without putting it into raw mode?
<robacarp> Idk about the EWOULDBLOCK thing
<FromGitter> <Timbus> there are some circumstances where it will block, if thats what you mean
<robacarp> now that I think about it, you probably don't need to put it in raw mode to read a slice
<FromGitter> <Sevensidedmarble> actually yeah, I think the docs say you dont have to
<robacarp> but I don't know the semantics of that blocking or not
<robacarp> @sevensidedmarble, won't the snippet I sent you match all the possible states your pager will start in? I don't know why you'd still need to peek the FD
<FromGitter> <Sevensidedmarble> the issue is if I just run the binary without piping and without passing in a filename
<FromGitter> <Timbus> by read slice do you jsut mean IO.read(slice) ?
<robacarp> @timbus yeah
<FromGitter> <Timbus> if so, that will block on a tty
<robacarp> @sevensidedmarble, I think that case is handled at line 8 of that paste
<robacarp> maybe I'm misunderstanding you
<FromGitter> <Timbus> like under the hood it doesn't block sure. but it yields back to the event loop or whatever
<FromGitter> <Sevensidedmarble> I think you were right actually, I keep mixing up in my head what the tty? check does
<FromGitter> <Sevensidedmarble> I thought that when I was passing in `echo "example" | ./script` that it wasn't saying it was a stream, but it actually was
<FromGitter> <Sevensidedmarble> I just kept thinking that tty? was supposed to do the opposite, that its supposed to return true on a stream
<FromGitter> <Sevensidedmarble> so yeah I think you've solved my problem then thank you lol
<robacarp> :+1:
<robacarp> did I do that right? heh...
<FromGitter> <robacarp> 👍
<robacarp> /o\
<FromGitter> <Sevensidedmarble> 👍
<FromGitter> <diegogub_gitlab> Hello guys, I'm trying to bind to a C lib
<FromGitter> <diegogub_gitlab> and Im getting this kind of error
<FromGitter> <diegogub_gitlab> :Invalid memory access (signal 11) at address 0x8784370 ⏎ [0x10757017b] *CallStack::print_backtrace:Int32 +107 ⏎ [0x10754fff8] __crystal_sigfault_handler +72 ⏎ [0x7fff76d8df5a] _sigtramp +2 [https://gitter.im/crystal-lang/crystal?at=5b75f2d1802bc42c5f2c84f9]
<FromGitter> <diegogub_gitlab> How could I debug it?
<FromGitter> <Sevensidedmarble> whats the source code?
<FromGitter> <diegogub_gitlab> C or Crystal? I'm adding batch support to levelDB driver
<FromGitter> <codenoid> hi crystaller
<FromGitter> <Sevensidedmarble> probably both
<FromGitter> <Timbus> Hmm. Are you allocating buffers for any of the C calls
<oprypin> guessing what's wrong is certainly one way to debug
<oprypin> but you're probably asking about an actual way to debug
<oprypin> tbh, as much as i've worked with c libs, i've never reached a better way of debugging than printing stuff at key points and detecting when the printing stops
<FromGitter> <Timbus> Debugging a memory access error requires heavy tracing to find the real source
hightower3 has quit [Remote host closed the connection]
<FromGitter> <diegogub_gitlab> I see, well. @oprypin you are right, printing stuff took me to the function raising the error
hightower3 has joined #crystal-lang
<hightower3> Hey, did something change in Crecto to affect performance? I am looking at https://github.com/Crecto/crecto/wiki/Performance and the same test which there reportedly takes 2.65s works 16s here. Also, benchmarks which can be seen on https://github.com/Crecto/crecto/wiki/Benchmarks are also much worse here (execution times around 16s except for delete which takes ~40)
<hightower3> I did the test with --release and CPU scheduler in performance mode, and hardware and software newer than mentioned in the tests
<oz> hightower3: I have no idea. Maybe you should ask on their gitter.im channel? https://gitter.im/crecto/Lobby
johndescs has quit [Ping timeout: 256 seconds]
johndescs has joined #crystal-lang
hightower3 has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> ah I get Kemal has encountered an error at http://crystalshards.xyz/?sort=updated&page=1
<FromGitter> <bew> huh seems to be gone, nvm