RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.26.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
Heaven31415 has quit [Quit: Leaving]
baweaver is now known as baweaver_away
Raimondi has quit [Quit: WeeChat 2.2: ยกChau!]
Raimondi has joined #crystal-lang
baweaver_away is now known as baweaver
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
Yxhuvud has quit [Ping timeout: 252 seconds]
rohitpaulk has joined #crystal-lang
return0e has joined #crystal-lang
return0xe has quit [Ping timeout: 244 seconds]
<FromGitter> <bararchy> Hi @veelenga , can we move https://github.com/bararchy/bluetooth to the Crystal community repo? it seems @elorest wishes to work with it and even is ok with paying for it to be maintained, but I have no time.
<FromGitter> <bew> @proyb6 iirc there's an issue open with performance check (in addition to specs) in mind!
<FromGitter> <bararchy> @bew maybe you can help out @elorest too, any idea why the `LibC.read` wont release? : https://github.com/crystal-community/bluetooth/blob/master/spec/hci_spec.cr#L132
Groogy1 has joined #crystal-lang
<FromGitter> <bew> Why would it release?
<FromGitter> <bararchy> It should "return", sorry, release is not the write word
<FromGitter> <bew> Are you sure there is something to read?
rohitpaulk has quit [Ping timeout: 244 seconds]
<FromGitter> <bararchy> Well, looking at the doc examples there should be, unless I totally made a blunder in the socketops
<FromGitter> <bararchy> This is where I took the example on the read
rohitpaulk has joined #crystal-lang
<FromGitter> <proyb6> @bew I see, thanks
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
<FromGitter> <veelenga> @bararchy ๐Ÿ‘
<FromGitter> <bararchy> ๐ŸŽ‰
ashirase has quit [Ping timeout: 268 seconds]
ashirase has joined #crystal-lang
<FromGitter> <vladfaust> https://github.com/github/linguist/pull/4290 make the language's future darker ๐Ÿ‘
Groogy1 has quit [Ping timeout: 260 seconds]
Groogy1 has joined #crystal-lang
thi has joined #crystal-lang
Groogy1 has quit [Ping timeout: 272 seconds]
Groogy1 has joined #crystal-lang
<FromGitter> <bararchy> @vladfaust when do you think the `jobs` section wil be finished ?
<FromGitter> <vladfaust> This week has a 90% chance
<FromGitter> <bararchy> cool! :)
<FromGitter> <vladfaust> Yup
<FromGitter> <Qwerp-Derp> ehh, i personally like the purplish colour
<FromGitter> <Qwerp-Derp> crystal-lang-community's logo is purple isn't it? so are the docs
<FromGitter> <vladfaust> crystal-lang-community is a lesser set than Crystal itself. I guess they took the color from the GitHub's :) And I suppose API docs are to change because black is the *official* brand color
<FromGitter> <Qwerp-Derp> ehh personally don't like the black colour, but i mean if everyone else likes it i can't really do much about it
<FromGitter> <asterite> @roblally_twitter it seems you are using llvm 3.8.1 for some reason (maybe the bin/crystal wrapper has something to do), and that version is unsupported and that's why you get the assertion failed
rohitpaulk has joined #crystal-lang
<jokke> is there a way of bubbling up exceptions raised from a fiber?
<jokke> like in ruby there's Thread.abort_on_exception=true
<jokke> or is this a manual thing of creating a channel and passing it over it
rohitpaulk has quit [Ping timeout: 252 seconds]
<FromGitter> <straight-shoota> Jokke, no. Exceptions that reach the root of a fiber are simply printed to STDERR. You can catch them manually and send over a channel. โŽ See https://gist.github.com/straight-shoota/4437971943bae7000f03fabf3d814a2f#file-spindle-cr-L53 for an example.
<jokke> ic
<FromGitter> <straight-shoota> #6468 proposes to improve this in stdlib
<jokke> thanks :)
<jokke> yeah
<jokke> it'd be great
<jokke> and not hard to implement
<jokke> something like spawn(bubble_exceptions: true)
<jokke> or however that should be called
<FromGitter> <straight-shoota> well, it needs a place where exceptions should bubble up. A concurrency context is a great way to do this and also offers more control for structuring concurrency.
<FromGitter> <j8r> Is there a way to do to what https://en.wikipedia.org/wiki/Inotify do, or do I need to rely on creating bindings?
<FromGitter> <bew> There's a binding for it already iirc
<FromGitter> <j8r> i haven't found it in the stdlib :/
<FromGitter> <bararchy> @j8r https://github.com/petoem/inotify.cr
<FromGitter> <j8r> thanks @bararchy , I will use it in https://github.com/j8r/tail, and fallback to `sleep 0.1` in BSD, macOS and windows. There is only kqueue available for BSD derivatives. (https://forums.freebsd.org/threads/inotify-for-freebsd.38162/). I was looking at https://github.com/fsnotify/fsnotify/blob/master/kqueue.go , but won't do :)
<FromGitter> <j8r> `sleep 0.1` is sleep enough
<FromGitter> <bararchy> @j8r This is a very useful shard! good job!
<FromGitter> <j8r> @bararchy thanks :)
<FromGitter> <j8r> @bararchy what's the diff between https://github.com/crystal-community/bluetooth and https://github.com/NeuraLegion/blue_cr ?
<FromGitter> <bararchy> `blue_cr` uses dbus, while `bluetooth` is a pure c-binding
<FromGitter> <bararchy> @j8r The whole project is `pre-alpha`, much needs to be changed, I allowed access via getter to socket and dev_id in case it would maybe needed to `read` operations
<FromGitter> <j8r> yeah, but this is symbols, not variable - this works too?
<FromGitter> <j8r> btw nice low level job ๐Ÿ˜ฎ ๐Ÿ‘
<FromGitter> <bararchy> @j8r yeha it works, and it looks nicer ;)
<FromGitter> <j8r> Ruby habits, yup?
<FromGitter> <j8r> what's strange is you don't have to anotate, but that's weird because we don't know the type
<FromGitter> <j8r> Except maybe they must be strings...
<FromGitter> <j8r> nvm they are numbers
<FromGitter> <bararchy> Yeha, it's coming from Ruby hehehe
<FromGitter> <j8r> @bararchy what's the best between both BT projects?
<FromGitter> <bararchy> The more mature one is `blue_cr`, but it has the anoying dbus need, I would prefer working on bluetooth as it need nothing other then `bluez` installed.
<FromGitter> <bararchy> as in, if your system don't have dbus you can't use `blue_cr`
<FromGitter> <bararchy> @j8r Do you want to try and help with it ?
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
<FromGitter> <j8r> so the deal is linux only vs having to install bluez?
<FromGitter> <bararchy> pretty much yeha
<FromGitter> <bararchy> btw, not "linux only", there are more then some dist that don't have dbus at all
Yxhuvud has joined #crystal-lang
<FromGitter> <bararchy> so it's "some linux"
<FromGitter> <j8r> there are linuxes that don't have dbus?!
<FromGitter> <j8r> Maybe android, even android I think it has DBus
<FromGitter> <bararchy> I think any who don't have systemd installed
<FromGitter> <j8r> no, I think the main bottleneck is for BSD derivatives
<FromGitter> <j8r> there is also DBus Broker on the way https://github.com/bus1/dbus-broker/wiki
<FromGitter> <j8r> It may come for Linux 5.0, or a bit after
<FromGitter> <proyb6> Who uses Fnv1a algorithms?
<FromGitter> <bararchy> @j8r Hmmmm makes sense
<FromGitter> <j8r> what's systemd specific is the udev device manager https://en.wikipedia.org/wiki/Udev
<FromGitter> <bararchy> @j8r Yeha I saw my error, it seems DBUS is much more common then I thought
<FromGitter> <bararchy> btw it seems that BlueZ is Linux only
<FromGitter> <bararchy> which means `bluetooth` bindings are also Linux only
<FromGitter> <straight-shoota> Isn't Dbus just a middle man between the application and BlueZ?
<FromGitter> <j8r> @bararchy ...I'm now confused ๐Ÿ˜…
<FromGitter> <straight-shoota> So if you don't have bluez, dbus won't help you either. Or you need a different bluetooth stack that uses dbus.
<FromGitter> <bararchy> I hope that DBUS has some kind of 'generic Bluetooth interface' but if not then I guess you will need to do some `if mac` and then choose the stack via dbus ?
<FromGitter> <j8r> there are two projects about bluetooth done by @bararchy , and now, I don't know which one to start ๐Ÿ˜„
<FromGitter> <bararchy> Hahahaha
<FromGitter> <bararchy> I'll tell you what @j8r , do you like parsing XML
<FromGitter> <bararchy> ?
<FromGitter> <bararchy> BTW, the reason I started `bluetooth` was for embedded minimal Linux devices , and I think @elorest needs the c level API
<FromGitter> <bararchy> But we should ask him
Groogy1 has quit [Ping timeout: 252 seconds]
<FromGitter> <j8r> Me, parsing XML? I prefer to parse INI - lol
<FromGitter> <bararchy> Exactly, DBUS is basically XML parsing job ;)
<jokke> vladfaust: i see you've been busy :D
<jokke> vladfaust: did you include my fix for the error classes in atom-web?
<jokke> or is it fixed in some other way?
<FromGitter> <vladfaust> @jokke, nope, I've extracted params into external shard and gave the developer a nessecerity to handle the errors by himself
<jokke> ok that's fine
akaiiro has joined #crystal-lang
<jokke> so there's no Action::Params?
<FromGitter> <j8r> @bararchy sounds like a vocation for you to parse XML @bararchy , doesn't it?
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> Oh god no! I hate XML my life is perfect with JSON and if I really want to go "rad" I'll do TOML too
<jokke> vladfaust: from the docs: # NOTE: Params errors aren't rescued by default, you have to handle [`Params::Error`](http://github.vladfaust.com/params.cr/Params/Error.html) yourself.
<jokke> vladfaust: but _how_ do you handle them?
<FromGitter> <ljuti> Hey, guys. Found Crystal this past weekend and had an absolute blast learning it. Just wanted to thank everyone who have contributed to the language and all the shards. :)
<FromGitter> <bararchy> @ljuti happy to hear another dev using Crystal !
<jokke> vladfaust: params is broken
<FromGitter> <fridgerator> @ljuti ๐Ÿ‘
<jokke> vladfaust: including Atom::Action into an action without a params block raises
<FromGitter> <bararchy> It seems you also play around with ML right?
<FromGitter> <bararchy> I saw you worked on a neural network lib
<jokke> (it calls Params.mapping({}))
<jokke> which obviously doesn't compile
akaiiro has quit [Ping timeout: 260 seconds]
<jokke> i'm a bit frustrated tbh. you could've just kept prism as a repo until atom is bullet proof
<jokke> now i'm forced to update and have to deal with regression
<FromGitter> <ljuti> @bararchy Yeah, although it's been awhile since I last worked on it. Should get back to it eventually.
<FromGitter> <bararchy> @ljuti come help us around with SHAInet then ;) Neural Network in Crystal
<jokke> barachy: nice! :D
<FromGitter> <ljuti> @bararchy Interesting, I've got to take a look at that
<FromGitter> <bararchy> All pure Crystal
<jokke> that's so cool
<FromGitter> <ljuti> I like the OO approach ๐Ÿ‘
<FromGitter> <jwoertink> Anyone know what this error means?
<FromGitter> <jwoertink> ```IO::Error/usr/share/crystal/src/io.cr:128:5 in '???':0 โŽ Closed stream``` [https://gitter.im/crystal-lang/crystal?at=5bbb84ccc7bf7c3662d6aa9b]
<FromGitter> <jwoertink> and how I would fix it?
<FromGitter> <jwoertink> I have 170k reports from bugsnag ๐Ÿ˜ข
<FromGitter> <fridgerator> wowee
<FromGitter> <jwoertink> yeah, no clue what this is, or where to even start looking
<FromGitter> <fridgerator> what are you using as a server?
<FromGitter> <jwoertink> elasticbeanstalk
<FromGitter> <j8r> @bararchy https://github.com/NeuraLegion/shainet/search?q=struct&unscoped_q=struct . You can gain perf gains by avoiding to put pressures in the GC by replacing classes by structs. After a quick look, most can be replaced
<FromGitter> <fridgerator> are you using crystal standard lib or kemal or something?
<FromGitter> <jwoertink> it's really just some docker on an EC2 instance
<FromGitter> <jwoertink> using lucky
<FromGitter> <jwoertink> the first 3 lines from the stack are
<FromGitter> <jwoertink> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bbb85a664cfc273f9b19233]
<FromGitter> <jwoertink> could this maybe be from a stale connection in the pool?
rohitpaulk has quit [Ping timeout: 252 seconds]
<FromGitter> <jwoertink> oh... we're not doing any pooling
<FromGitter> <jwoertink> lol
<FromGitter> <jwoertink> wow
<FromGitter> <jwoertink> how have we made it this far without a connection pool?
<FromGitter> <jwoertink> so it's probably just that single connection that got hit too much
<FromGitter> <bararchy> @j8r good idea! TBH the worst perf hit is the single-threadness of the lang, in the end its mostly math. But moving to structs will provide a much larger network size I guess
<FromGitter> <j8r> If you create lots of objects, this will help.
<FromGitter> <bararchy> We do, I'm sure its gonna help! @j8r wanna help out? ;)
<FromGitter> <j8r> @bararchy Yep
<FromGitter> <j8r> The docs also needs to be clearer to tell when using structs vs classes
<FromGitter> <bararchy> BTW @drujensen has done some amazing work with SHAInet on heart conditions analysis, diabetes research and other cool things
<FromGitter> <bararchy> Anyway @j8r as always , having you help out is a really pleasure !
<FromGitter> <asterite> the error means you are using an IO that is closed
<FromGitter> <jwoertink> interesting
<FromGitter> <jwoertink> Turned out we weren't using a pool at all. So somehow our single DB connection closed, and everything tanked
<FromGitter> <jwoertink> or at least that's my guess.. I don't really know how to confirm that, but hopefully this deploy fixes it lol ๐Ÿ˜‚
ua_ has joined #crystal-lang
ua has quit [Read error: Connection reset by peer]
<FromGitter> <vladfaust> @jokke, it requires crystal master
<jokke> great..
<FromGitter> <vladfaust> You still can use tags
akaiiro has joined #crystal-lang
<FromGitter> <drujensen> @bararchy Thanks for the shoutout! SHAInet is one of the more interesting crystal projects I have been able to play with. I couldnโ€™t get a high enough accuracy using it against Kaggle competitions, but it was a lot of fun trying. I would love to win one of those competitions using crystal instead of python. Just dreaming though. I donโ€™t have the DS skills necessary. ;-)
Heaven31415 has joined #crystal-lang
<Heaven31415> Hi
<Heaven31415> Is there a limit on how big a Crystal program can be?
<FromGitter> <bew> Don't think so..
<FromGitter> <bew> Maybe if you do more than ~2billion symbols (Int32::MAX) ^^
Heaven31415 has quit [Remote host closed the connection]
<FromGitter> <bew> Or some other number maxing (max number of method/objects/...)
<FromGitter> <bew> But for the size of the binary, the limit is your disk
<FromGitter> <j8r> You can easily bloat your binary by adding lot of text inside ๐Ÿ˜‰
<FromGitter> <j8r> *at compile time
<FromGitter> <bararchy> XD
<FromGitter> <bararchy> in macro
<FromGitter> <bararchy> MY_CONSTANT = File.read_to_end("/dev/urandom")
<FromGitter> <bararchy> hahah
<FromGitter> <bew> ๐Ÿ‘Œ
<FromGitter> <j8r> ๐Ÿคฃ
<FromGitter> <straight-shoota> Size of program is not necessarily the size of the compiled binary.
<FromGitter> <j8r> This exacly the problem in my Tail library, /dev/urandom doesn't return
<FromGitter> <j8r> But, what's the point of tailing /dev/urandom?
<FromGitter> <fridgerator> Hey all, i'm wearing crystal shirt to a Kubernetes conference at Google tomorrow. I hope I dont get beat up ๐Ÿ˜Ÿ
<FromGitter> <j8r> Haha the only risky tshirt it "Oracle <3 Java" or anything mentioning Oracle at a Google Android conference x)
<FromGitter> <fridgerator> Yeah that's way worse
<FromGitter> <j8r> They will be jealous @fridgerator , the Crystal logo is way more stylish than the Go one!
<FromGitter> <j8r> IMO Kubernetes is kind of cool, kind of overengineered, like AWS. Using both, there are X network layers, routes...
<FromGitter> <fridgerator> Yeah it's a lot
<FromGitter> <fridgerator> I mostly just use Rancher
<FromGitter> <bew> TIL rancher ;) is there a crystal binding/sth for Kubernetes? (so that you can talk about something)
<FromGitter> <j8r> In fact, there isn't much to talk about languages in containers โ€“ this is completely agnostic
<FromGitter> <j8r> Maybe older Java versions, that had troubles to run inside
<FromGitter> <j8r> And now they have fixed this.
Heaven31415 has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> so I have an object, Tag, which I want to insert into a JSON structure as if it were a string. What should the Tag object's `#to_json` look like?
<FromGitter> <dscottboggs_gitlab> like this?
vikaton has joined #crystal-lang
<FromGitter> <jwoertink> Anyone ever seen this error? `BUG: already had enclosing call`
<FromGitter> <jwoertink> I got this error when trying to compile. I commented out the line it was complaining on, and it still does the same error, just moves where it's being called
<FromGitter> <jwoertink> but I don't know what's actually causing this or what the error means