ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.3 | Fund Crystal's 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
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
akwiatkowski has quit [Ping timeout: 264 seconds]
soveran has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
martinium has joined #crystal-lang
soveran has quit [Remote host closed the connection]
sagax has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Ping timeout: 248 seconds]
<crystal-gh> [crystal] MakeNowJust opened pull request #3775: Fix to concat a union of arrays (master...fix/array/concat-type) https://git.io/vMfOe
<TheGillies> is https://github.com/Codcore/Amethyst deprecated? looks like no commits in last year
<TheGillies> what's the best rails like crystal framework?
<martinium> TheGillies I was looking into this as well. Most seem to be alpha stage. Has the kitchen sink but if you prefer something lighter Kemal looks very promising. Very similar to Sinatra
dtzu has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 268 seconds]
dtzu has joined #crystal-lang
<TheGillies> I'm using kemal right now seems the most popular
<TheGillies> crystal is so fast, im lovin it heh
<martinium> I am having trouble finding enough material to learn it properly but I'll keep at it. Yes, the speed is beautiful. High level and speed together
<martinium> will probably make many projects with this language
<martinium> this and Nim seem most interesting to me
<martinium> Merry Christmas to anyone in here who celebrate this holiday!
<TheGillies> Hrm record Request, request_id: String, env: Hash unknown constant Request
<TheGillies> I thought record was a macro?
<TheGillies> oh it doesn't like my spacing
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Quit: Leaving.]
mgarciaisaia has joined #crystal-lang
akwiatkowski has joined #crystal-lang
mgarciaisaia has quit [Client Quit]
bjz has joined #crystal-lang
martinium has joined #crystal-lang
vivus-ignis has joined #crystal-lang
A124 has quit [Ping timeout: 252 seconds]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
soveran has joined #crystal-lang
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<Yxhuvud> yeah the error messages on that one is a bit sparse
<TheGillies> how do I convert C char* to String?
<BlaXpirit> TheGillies, String.new(that)
<TheGillies> should I return UInt8* from my C function?
<TheGillies> Woo it works
<TheGillies> Thanks
<TheGillies> Yay I made my first C binding in crystal, that was super easy
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
A124 has joined #crystal-lang
bjz has joined #crystal-lang
Raimondii has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
pawnbox has quit [Remote host closed the connection]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
bjz has quit [Ping timeout: 245 seconds]
bjz has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<Papierkorb> TheGillies: You can use LibC::Char* instead of UInt8*, but Char is an alias for UInt8, so semantics-wise it's the same
bjz has quit [Ping timeout: 246 seconds]
bjz_ has joined #crystal-lang
sagax has quit [Quit: Konversation terminated!]
sagax has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
sagax has quit [Read error: Connection reset by peer]
sagax_ has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 246 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Chronium has joined #crystal-lang
<crystal-gh> [crystal] splattael closed pull request #3593: Remove `libs` from search path (master...remove-libs) https://git.io/v1kYK
<Chronium> Hello people! Is there anyone who could confirm if I translated some C to Crystal correctly?
<crystal-gh> [crystal] splattael opened pull request #3777: Do not add `libs/` to `.gitignore` (master...dont-ignore-libs) https://git.io/vMf09
<BlaXpirit> Chronium, to avoid double waiting time, paste first, then ask
<Chronium> BlaXpirit: Well, will know the next time
<BlaXpirit> well i don't like this "singleton" thing. just make a module instead
<RX14> where is singleton defined?
<FromGitter> <airinfection> rx14
<FromGitter> <airinfection> im your biggest fan
<BlaXpirit> Chronium, pointerof(instance.@ptr).address - that seems wrong
<Chronium> Here is the singleton
<BlaXpirit> well if you are sure you need a pointer to the pointer then it's ok
<Chronium> I need the address of the pointer
<BlaXpirit> please don't use uninitialized outside of an initializer
<BlaXpirit> this makes it easy to create garbage structs and accidentally use them
<Chronium> Is there any other way to create a static array?
<BlaXpirit> Chronium, write that inside an `initialize` method preferably
<BlaXpirit> agh i'm not sure what's going on here
<Chronium> A GDT structure to pass to the CPU to initialize it :D
<RX14> @airinfection thanks
<Chronium> BlaXpirit: Modified to use an initialize method: http://pastebin.com/FDD0qdvR
<Chronium> Something with the struct isn't right, as the CPU seems to triple fault. And that only means that I don't know how to properly translate C code to Crystal
<RX14> well
<RX14> can't you print the GDT for your C version and the crystal version
<RX14> and observe differencesd
<Chronium> Will try that
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 258 seconds]
<Chronium> RX14: The Crystal structure is completely not correct
<FromGitter> <airinfection> its correct
<FromGitter> <airinfection> Ary Borenszweig does best.
<RX14> Chronium, in what way
<Chronium> Completely different from the C one
<Chronium> RX14: The one at the top is Crystal, the integers are printed backwards, but still, shouldn't matter, and the bottom one is the correct C one https://puu.sh/t0DZ7/66d9bdf60e.png
Philpax has quit [Ping timeout: 248 seconds]
matp has quit [Read error: Connection reset by peer]
<FromGitter> <airinfection> i dont know RX14 is right always
<FromGitter> <airinfection> what he says is right
<FromGitter> <airinfection> he is god
matp_ has joined #crystal-lang
<BlaXpirit> Chronium, wait what? your screenshot is empty anyway
<Chronium> BlaXpirit: There, not empty
kochev has joined #crystal-lang
matp_ is now known as matp
<FromGitter> <airinfection> Chronium is most advanced os ever made
<FromGitter> <airinfection> ChronOS
<Chronium> :|
<FromGitter> <airinfection> I use ChronOS
<FromGitter> <airinfection> for everything.
<Chronium> :| |:
<Chronium> It can't even run executables...
<FromGitter> <airinfection> ahahah
<FromGitter> <airinfection> you lie.
<FromGitter> <airinfection> it run
<FromGitter> <airinfection> everything
* Chronium facepalms
<Yxhuvud> sigh, when did we get trolls in here?
<FromGitter> <airinfection> chronos.org
kochev has quit [Ping timeout: 256 seconds]
matp_ has joined #crystal-lang
matp has quit [Ping timeout: 250 seconds]
<akwiatkowski> Is there any lib adding spec expectations?
<RX14> not that i'm aware of
<RX14> the current expectations seem to cover everything i've ever needed
<akwiatkowski> What if I want check if value is between, greater, lower than?
* RX14 tries not to go on a rant about how much better `assert` is than the current expectations
<RX14> but you should be able to add that
<RX14> well
<akwiatkowski> `(d > 278.70).should be_true` ? :)
<RX14> you could do (1 <= foo <= 10).should be_true
<RX14> or just `assert 1 <= foo <= 10` if we had nice specs
<akwiatkowski> But then in spec result I could get that false is not true
<RX14> akwiatkowski, yeah then you'll have to define a spec thingy
<akwiatkowski> I'd like to use something like `d.should greater 278.70`
<akwiatkowski> Would it be a good feature for crystal?
<RX14> you can mokey patch it in here quite easilly
<RX14> add a Spec::BetweenExpectation(T)
<RX14> then define between in Spec::Be(T)
<RX14> oh sorry
<RX14> ignore that
<RX14> you woulkd define it in Expectations
<akwiatkowski> ok, I'll look at it
<akwiatkowski> https://github.com/crystal-lang/crystal/blob/master/src/spec/expectations.cr#L109 do you know how can I use this? I'm thinking about something else and not read code with full concentration
<RX14> foo.should be < foo
<RX14> foo.should be < 10
<RX14> sorry
<akwiatkowski> thx!
<crystal-gh> [crystal] MakeNowJust opened pull request #3778: Don't remove docs in block yielding of macro (master...feature/crystal/to-s-emit-doc) https://git.io/vMfgL
akwiatkowski has quit [Quit: Konversation terminated!]
akwiatkowski has joined #crystal-lang
Ven has joined #crystal-lang
<Chronium> I have this in a lib: https://puu.sh/t0I36/ef405f19ec.png and it says when I try to get a pointer to a field: can't take address of @gdt.null (example)
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 265 seconds]
<Papierkorb> Chronium: Please don't post screenshots. Use gist.github.com instead.
<Chronium> Making a whole paste for a couple of lines is more than a waste of time
<Papierkorb> ¯\_(ツ)_/¯
<Chronium> And also a waste of space on either GitHub's server or Pastebin's
<Papierkorb> But .. an image requires no space. Aha
<Papierkorb> Well, you know better than me in this case.
<Chronium> Also, ctrl + PtrintScreen is much faster than going on gist or Pastebin to make a paste, set all the correct syntax, make it expire, so on and so forth
<RX14> well
<RX14> i can just SPC g h B to paste my whole buffer to gist :)
<Chronium> What editor?
<RX14> spacemacs
<Chronium> Interesting
<Chronium> But because of Windows reasons, I'll stick to my Visual Studio code
<Chronium> My Arch install stopped going graphical after the last update and I'm too lazy to reinstall the graphics driver :D
<Papierkorb> > Waste of time helping the helper
<Papierkorb> > Expects help
<Papierkorb> No can do.
<RX14> i've had my arch install for 3 years and never had a single problem getting to X11
<RX14> i guess i'm just lucky
<FromGitter> <mjago> How do I do `mpg123_handle *mh;' in my binding to lib_mpg123 ?
<Chronium> Well, I have no idea what's happening, may be nvidia drivers acting weird with the GTX 970. But the kernel module for nvidia won't start
<RX14> mpmpg123_handle will be a struct i guess
<FromGitter> <mjago> Yes
<RX14> so that's mh : Mpg123Handle*
<RX14> where Mpg123Handle is the bound struct
<RX14> in the olib def
<Papierkorb> RX14: 3 years, then had to reinstall (nvidia -> amd broke things weirdly enough), but neither do I now after 1 year on this 'new' install. Only thing that broke was BTRFS (on two machines), so I don't use that anymore
<RX14> i've not really had any issued with btrfs personally
<RX14> well thats not exactly true
<RX14> but the ones I have had have been self inflicted
<RX14> or with filesystems created using the ext4 converter
<FromGitter> <mjago> @RX14 Thanks I'll play with that
<RX14> which i now flat out refuse to use
<RX14> because it's shit
<Papierkorb> It's weird, it was when I updated the system and then shut down the machine right afterwards. This happened on two machines months apart. Only issue I had, but loosing data isn't fun, so I went back to ext4
<RX14> but I run btrfs on my 1TB hdd, and on my home server (running over 2x500gb + 1x1tb drive array in raid1 mode) and it's been great
<RX14> like
<RX14> i've even had drives fail
<RX14> well
<RX14> i was converting my raid1 to a normal array
<RX14> so I could change the drives arounbd
<RX14> and while that was happening one of the drives failed
<RX14> in the btrfs array
<RX14> and so I had to do all sorts of recovery stuff on the failed drive
<Papierkorb> uargh
<RX14> but once that was done
<RX14> the btrfs array worked perfectly
<RX14> even though there was some corrupted data, btrfs detected that and scrub just removed it
<RX14> so yeah
<RX14> i can't really extrapolate from my 2 arrays into it being really reliable
<RX14> but i'm quite enamored with btrfs personally
<RX14> i find it really easy to manage
<Chronium> That moment when your OS is closed source, your laptop's HDD dies and you have no backup of the code, only screenshots left of what it was. It even had executable loading: https://www.dropbox.com/s/g8tblj37gpo0ju2/Screenshot%20-%2004082015%20-%2001%3A58%3A52%20AM.png?dl=0
kochev has joined #crystal-lang
soveran has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 264 seconds]
<FromGitter> <mjago> How do I pass a NULL pointer in crystal... ` fun new = mpg123_new(NULL, Int32*) : Int32* ' - any simple binding examples might help too!
<RX14> well it would be Pointer(Foo).null
<RX14> where Foo is the pointer type
<RX14> but that looks like a binding there
<RX14> not a call
<RX14> so you can't pass null because you're only binding it
<FromGitter> <mjago> Ah ok
<FromGitter> <mjago> Perhaps I should start on something simpler ;)
akwiatkowski has joined #crystal-lang
<Chronium> Is the @[Packed] attribute correct for packing a struct inside a lib?
<RX14> yes
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 265 seconds]
martinium has joined #crystal-lang
pawnbox_ has quit [Remote host closed the connection]
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lacour has joined #crystal-lang
martinium has joined #crystal-lang
soveran has quit [Remote host closed the connection]
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Ping timeout: 252 seconds]
kochev has quit [Remote host closed the connection]
soveran has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden closed pull request #3777: Do not add `libs/` to `.gitignore` (master...dont-ignore-libs) https://git.io/vMf09
soveran has quit [Remote host closed the connection]
matp_ is now known as matp
<travis-ci> crystal-lang/crystal#ee52cce (master - Do not add `libs/` to `.gitignore` (#3777)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/186683078
<DeBot> https://github.com/crystal-lang/crystal/pull/3777 (Do not add `libs/` to `.gitignore`)
_whitelogger has joined #crystal-lang
bjz has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
vivus-ignis has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<TheGillies> It looks like c func takes a char* but it looks like it's passing in an int
<TheGillies> any C people know what's going on?
<RX14> can you show me the actual code link
<TheGillies> https://github.com/jedisct1/libsodium/search?utf8=✓&q=crypto_sign_check_S_lt_L
<RX14> well
<RX14> it is a pointer
<RX14> if you look at sig
<RX14> it's a char*
<RX14> then you + 32
<RX14> which gets you another pointer
<RX14> basically you're adding 32 bytes to the pointer address
<RX14> i'm pretty sure at least
<TheGillies> How do you do that in crystal?
<RX14> add a pointer?
<RX14> pointer + 32
<RX14> exactly the same
<TheGillies> ah
soveran has quit [Remote host closed the connection]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<RX14> TheGillies, are you binding libsodium?
martinium has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 264 seconds]
akwiatkowski has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 250 seconds]
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akwiatkowski has quit [Ping timeout: 264 seconds]
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/vMfMs
<crystal-gh> crystal/master a3ea7ad Ary Borenszweig: Parser: fixed wrong parsing of tuple with one element followed by newline and brace. Fixes #3779
<crystal-gh> crystal/master 56df571 Ary Borenszweig: Fixed double "connection refused" in error message. Fixes #3776
<crystal-gh> crystal/master 08a85b6 Ary Borenszweig: Formatter: use simpler condition
akwiatkowski has joined #crystal-lang
<travis-ci> crystal-lang/crystal#a3ea7ad (master - Parser: fixed wrong parsing of tuple with one element followed by newline and brace. Fixes #3779): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/186701733
<DeBot> https://github.com/crystal-lang/crystal/issues/3779 (Nested tuples syntax, expecting token)
onionhammer has quit [Ping timeout: 246 seconds]