asterite changed the topic of #crystal-lang to: #crystal-lang The Crystal programming language | http://crystal-lang.org | Crystal 0.6.1 | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal - Docs: http://crystal-lang.org/docs/ - API: http://crystal-lang.org/api/ - Logs: http://irclog.whitequark.org/crystal-lang
<jhass> >> 020
<DeBot> jhass: 16
ismaelga has joined #crystal-lang
<crystal-gh> [crystal] yyyc514 opened pull request #632: Int#to_s should edge case 1 also (master...int_to_s_edge_cases) http://git.io/vJ9wE
<jeromegn> >> 0x000000
<DeBot> jeromegn: 0
<jeromegn> >> 0x00001
<DeBot> jeromegn: 1
<jeromegn> >> 0xFFFFFF
<DeBot> jeromegn: 16777215
ismael has joined #crystal-lang
ismael is now known as Guest78
ismaelga has quit [Read error: Connection reset by peer]
ismaelga has joined #crystal-lang
<jeromegn> >> 0x02
<DeBot> jeromegn: 2
Guest78 has quit [Ping timeout: 246 seconds]
<jeromegn> >> 0xFF
<DeBot> jeromegn: 255
<jeromegn> >> 0x11
<DeBot> jeromegn: 17
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
<Dreamer3> any easy way to get stats on memory allocation inside crystal?
Cidan is now known as zz_Cidan
bcardiff has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
<Dreamer3> any easy way to get stats on memory allocation inside crystal?
<crystal-gh> [crystal] michelboaventura opened pull request #634: Doc about accessing not allocated array's element (master...master) http://git.io/vJ9hB
ismael has joined #crystal-lang
ismael is now known as Guest45546
ismaelga has quit [Ping timeout: 272 seconds]
ponga has joined #crystal-lang
ismaelga has joined #crystal-lang
Guest45546 has quit [Ping timeout: 256 seconds]
<fowl> >> (x = false) && p 1
<DeBot> fowl: Sorry, that took too long.
<fowl> >> p1
<DeBot> fowl: Error in line 3: undefined local variable or method 'p1'
<fowl> >> (x = false) && p 1
<DeBot> fowl: false
kulelu88 has joined #crystal-lang
willlll has quit [Quit: willlll]
ismaelga has quit [Remote host closed the connection]
vikaton has joined #crystal-lang
vikaton has quit [Client Quit]
DerisiveLogic has joined #crystal-lang
HakanD___ has joined #crystal-lang
HakanD___ has quit [Client Quit]
HakanD___ has joined #crystal-lang
<Dreamer3> no array slice methods?
ismaelga has joined #crystal-lang
ismaelga has quit [Ping timeout: 272 seconds]
k2b6s9j has joined #crystal-lang
<k2b6s9j> hey guys, i'm having some issues linking a library for a binding. can someone help?
bcardiff has joined #crystal-lang
<havenwood> k2b6s9j: Gist the problem you're running into?
<k2b6s9j> havenwood: ok, i'll do that right now. just for reference, you should know this is for my jcrystal project https://github.com/k2b6s9j/jcrystal
<k2b6s9j> havenwood: here's the last build error from trying to link the JNI's dylibs with crystal https://gist.githubusercontent.com/k2b6s9j/54c905c56e85a5eef877/raw/82aacad9148f605c0dd96946526a8ca049bb0b0c/gistfile1.txt
<k2b6s9j> I'll be right back. It appears part of the issue may be that I'm using OS X and not Linux. I'll reboot my machine and see if that makes a difference.
k2b6s9j has quit [Quit: Textual IRC Client: www.textualapp.com]
DerisiveLogic has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
JBat has quit [Ping timeout: 250 seconds]
havenn has joined #crystal-lang
havenwood has quit [Ping timeout: 256 seconds]
JBat has joined #crystal-lang
DeBot has quit [Read error: Connection reset by peer]
kulelu88 has quit [Quit: Leaving]
ponga has quit [Remote host closed the connection]
bcardiff has quit [Quit: Leaving.]
ismaelga has joined #crystal-lang
havenwood has joined #crystal-lang
ismaelga has quit [Ping timeout: 272 seconds]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
havenn has quit []
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
ponga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
ponga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
panga has joined #crystal-lang
ponga has quit [Read error: No route to host]
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
Ven has joined #crystal-lang
HakanD___ has quit [Quit: Be back later ...]
Ven has quit [Read error: Connection reset by peer]
willlll has joined #crystal-lang
<Dreamer3> rofl
<Dreamer3> why would rebooting help
ismaelga has joined #crystal-lang
HakanD___ has joined #crystal-lang
strcmp2 has quit [Ping timeout: 240 seconds]
<fowl> what if you rebooted into a different operating system :o
ismaelga has quit [Ping timeout: 264 seconds]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
<Dreamer3> >> Array(Int).new()
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
<Dreamer3> >> 3
<Dreamer3> where debot
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
willlll has quit [Quit: willlll]
ponga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
vegai has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
DeBot has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
panga has joined #crystal-lang
ponga has quit [Read error: No route to host]
havenwood has quit [Ping timeout: 276 seconds]
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
Ven has joined #crystal-lang
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
Ven has quit [Client Quit]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
Ven has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ismaelga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ismaelga has quit [Ping timeout: 255 seconds]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
panga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
jhass has quit [*.net *.split]
drizz has quit [*.net *.split]
ryanf has quit [*.net *.split]
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
ponga has quit [Read error: No route to host]
jhass has joined #crystal-lang
drizz has joined #crystal-lang
ryanf has joined #crystal-lang
ponga has joined #crystal-lang
panga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
BlaXpirit has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
strcmp1 has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
leafybasil has joined #crystal-lang
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
leafybasil has quit [Read error: Connection reset by peer]
leafybasil has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
ismaelga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ismaelga has quit [Ping timeout: 255 seconds]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
aemadrid has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
panga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
leafybasil has quit []
strcmp1 has quit [Ping timeout: 250 seconds]
ismaelga has joined #crystal-lang
strcmp1 has joined #crystal-lang
blaix has joined #crystal-lang
ismaelga has quit [Ping timeout: 240 seconds]
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
Ven_ has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
blaix has quit [Quit: Leaving.]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
<BlaXpirit> ponga pls
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
aemadrid has quit [Quit: Connection closed for inactivity]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
ismaelga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
HakanD____ has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
HakanD___ has quit [Ping timeout: 244 seconds]
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
bcardiff has joined #crystal-lang
panga has quit [Read error: No route to host]
Ven_ has joined #crystal-lang
ponga has joined #crystal-lang
JBat has quit [Quit: Computer has gone to sleep.]
ponga has quit [Read error: No route to host]
<jeromegn> hye there
ponga has joined #crystal-lang
<jeromegn> so, I’m running my program through Valgrind to figure out why I get a error 11
<jeromegn> I’m fetching values from my BSON object. It works fine the first time around, but the second time, nope! I get Invalid read of size 4
ponga has quit [Read error: No route to host]
<jeromegn> so I’m thinking it’s probably the Iterator
ponga has joined #crystal-lang
<jeromegn> def [](key : String); iterator :: LibBSON::Iterator*; ...
<jeromegn> seems like the second time around, that iterator variable (a pointer) has a weird address
<jeromegn> Pointer(LibBSON::Iterator)@0x1
ponga has quit [Read error: No route to host]
<jeromegn> I probably need to do something different to get a new pointer
ponga has joined #crystal-lang
ismaelga has joined #crystal-lang
Ven_ has quit [Ping timeout: 276 seconds]
ponga has quit [Read error: Connection reset by peer]
HakanD____ has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ismaelga has quit [Remote host closed the connection]
ponga has joined #crystal-lang
ismaelga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
<jhass> jeromegn: iterator :: LibBSON::Iterator* doesn't null it, it just declares the variable pointing to whatever is in memory at that place in time, you need to initialize it
panga has quit [Read error: Connection reset by peer]
<jeromegn> yea, I did that and it seems to work
<jeromegn> now I have another issue though
ponga has joined #crystal-lang
<jeromegn> which I didn’t have before
<jeromegn> Jump to the invalid address stated on the next line
<jeromegn> investigating...
ponga has quit [Client Quit]
<jhass> sounds still like something is pointing to junk
<jeromegn> yea
<jeromegn> I’m doing this: def self.from_bson(bson : LibBSON::Value); String.new(bson.value.v_utf8.str); end
<jeromegn> in class String
<jeromegn> that’s the line where it bombs
havenwood has joined #crystal-lang
<jhass> sounds like either your struct is configured incorrectly or the data it contains is simply junk
<jeromegn> hmm
<jeromegn> Address 0x400000000
<jeromegn> that looks like a problematic address
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
<jeromegn> I did a lot of refactoring, no tests, broke a few things. my bad
<jeromegn> the struct looks alright, I can access all its properties
<jeromegn> I might not have created it properly though
ssvb has quit [Ping timeout: 246 seconds]
ismaelga has joined #crystal-lang
<jeromegn> jhass: if you’re still willing to help :) https://gist.github.com/jeromegn/b54f4c3a3019d4830449#file-bson-cr-L4 basically the second time I call Iterator.new, it bombs due to “Invalid read of size 4” .. “Address 0xd0000000d is not stack'd, malloc'd or (recently) free’d”
<jeromegn> I’m not entirely sure what’s up. what reference I’m losing here..
<jeromegn> oh damn
<jeromegn> I just removed the “@“ in front of “@doc” and now it just works...
<jeromegn> I’m not sure I understand this correctly..
<jhass> jeromegn: mh, that sounds like you still access garbage somewhere
<jhass> you removed the @ from both occurrences I assume
<jhass> so you changed the stack layout
<jhass> which means there's other garbage now
<jhass> that might happen to not crash it
<jeromegn> ugh
<jhass> so LibBSON::Iterator is a struct?
<jeromegn> yes
<jeromegn> empty struct
<jeromegn> it used to be an alias
<jeromegn> but I couldn’t instantiate it
<jeromegn> alias Iterator = Void
<jhass> okay, then that's your issue
<jeromegn> hmm
<jhass> the library for sure doesn't have an empty struct
<jeromegn> right
<jeromegn> well
<jeromegn> it has a struct, but its structure is private ;)
<jeromegn> well considered private by the MongoDB folks
<jeromegn> since it may change
<jeromegn> I can obviously find the details in there
<jhass> yeah, you at least need the correct size
<jeromegn> interesting
<jeromegn> a void alias would not work?
<jeromegn> if I can avoid defining it as a struct that could work for me
<jeromegn> since I never need to access its internal structure
<jhass> you need to allocate the right amount of memory
<jeromegn> I see
<jhass> so easiest is to write a little C program that prints sizeof(bson_iter_t) and then just struct IterT; _data : UInt8[42] end
<jeromegn> I just translated the stuff to the struct
<jeromegn> I guess that’ll work for now
<jeromegn> I’m keeping your trick in mind though
<jeromegn> learning so much… my interpreted world was so comfy!
<jhass> ^^
<jeromegn> jhass: what are you working on? I like DeBot
<jhass> mostly private stuff atm ;)
bcardiff has quit [Quit: Leaving.]
<jeromegn> hehe alright
<jeromegn> given I’m extending Time, String, etc. with from_bson and to_bson methods, where should I put these files in my project? outside src/? I have a libs/ folder with the C bindings, but I’m not sure where the class extensions belong!
<jeromegn> I guess at the root of src/
<jeromegn> src/string.cr
bcardiff has joined #crystal-lang
<jhass> everything should be inside src
<jhass> libs is for dependencies
<jeromegn> yea
<jeromegn> oh
<jeromegn> I shall move it too then
<jeromegn> I guess I can rename it to lib_bson.cr
<jhass> I'd say src/bson/core_ext/ for the core extensions
<jhass> yeah
<jeromegn> ah this is so clean now
<jeromegn> thanks for all the advice
<jeromegn> any way around that ugliness? @[Link("libbson-1.0")]
<jeromegn> I bet that wouldn’t work on many setups
<jeromegn> I just installed the libbson via homebrew and that’s what I got
<jeromegn> I could symlink it
<BlaXpirit> jeromegn, shouldn't it be just "bson"?
<jeromegn> I’m not sure
<jeromegn> ld: library not found for -lbson
<BlaXpirit> i have libcsfml-graphics so i link "csfml-graphics"
<BlaXpirit> is it... liblibbson?
<jeromegn> libbson-1.0 -> ../Cellar/libbson/1.1.0/include/libbson-1.0
<jeromegn> that’s in my /usr/local/include
<BlaXpirit> it's not about include, it's about .so
DeBot has quit [Ping timeout: 272 seconds]
<jeromegn> oh
<jeromegn> :)
<jeromegn> where should I look for those^
<jeromegn> I got dylib
<jeromegn> that’s about it
<BlaXpirit> ooh sorry. on mac it is indeed .dylib
<jeromegn> libbson-1.0.dylib :(
<jeromegn> I’m sure if I built it from source, it would work better
<jeromegn> I mean, it would have the right name
<BlaXpirit> latest version seems to be 1.1
<BlaXpirit> and there definitely should be a versionless .dylib
<jeromegn> yes indeed
<jeromegn> I’ll build from source I think
<jhass> it doesn't find it with @[Link("bson")] ?
<jeromegn> nope
<BlaXpirit> jeromegn, well, i have strange news for you
<jeromegn> :o
<BlaXpirit> i just installed libbson 1.1 on linux
<BlaXpirit> and i have now a file libbson-1.0.so
<jeromegn> haha
<jeromegn> well that’s perfect
<jeromegn> I don’t need to change anything!
<jeromegn> that is indeed strange news
<BlaXpirit> this should work @[Link("bson-1.0")]
<jeromegn> it does indeed
<BlaXpirit> (i don't have versionless .so by the way)
ssvb has joined #crystal-lang
willlll has joined #crystal-lang
DerisiveLogic has joined #crystal-lang
blaix has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
<jeromegn> ugh, again stumbling on Valgrind stuff
<jeromegn> I feel like I have defined all the structs correctly…
<jeromegn> this time “Invalid write of size 8"
<jeromegn> last time was read
JBat has joined #crystal-lang
DeBot has joined #crystal-lang
DeBot has quit [Ping timeout: 272 seconds]
jhass has quit [Quit: Bye]
ssvb has quit [Quit: Leaving]
jhass has joined #crystal-lang
jhass has quit [Ping timeout: 252 seconds]
jhass has joined #crystal-lang
ponga has joined #crystal-lang
ponga has quit [Quit: Leaving...]
bcardiff1 has joined #crystal-lang
bcardiff has quit [Ping timeout: 264 seconds]
HakanD has joined #crystal-lang
kulelu88 has joined #crystal-lang
jhass has quit [Quit: Bye]
jhass has joined #crystal-lang
zz_Cidan is now known as Cidan
Cidan is now known as zz_Cidan
zz_Cidan is now known as Cidan
willlll has quit [Quit: willlll]
jhass has quit [*.net *.split]
drizz has quit [*.net *.split]
ryanf has quit [*.net *.split]
blaix has quit [*.net *.split]
blaix has joined #crystal-lang
jhass has joined #crystal-lang
drizz has joined #crystal-lang
ryanf has joined #crystal-lang
HakanD has quit [Quit: Be back later ...]
willlll has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
willlll has quit [Quit: willlll]
blaix has quit [*.net *.split]
blaix has joined #crystal-lang
<jeromegn> should I assume the “char” c type translates to UInt8?
<jhass> jeromegn: yeah
<jeromegn> I really don’t know what can be causing my new valgrind error
JBat has quit [Quit: Computer has gone to sleep.]
shama has joined #crystal-lang
<jeromegn> why not Char?
<jhass> because we have a proper char type not to be abused for storing a byte
<jhass> and I see no obvious mistakes, assuming the referenced types you didn't show are defined correctly
<fowl> It looks good to me
<jeromegn> odd
<jeromegn> ok, I’ll keep digging
<fowl> Fwiw I couldn't wrap bson for Nim either
<fowl> Always some strange errot
<jeromegn> I tried using the Nim mongo lib 2 weeks ago. didn’t work :(
<jeromegn> couldn’t even get the tests to pass
<jeromegn> there are those weird instructions
<jeromegn> BSON_ALIGNED_BEGIN (8)
<jeromegn> define BSON_ALIGNED_BEGIN(_N)
<jeromegn> define BSON_ALIGNED_END(_N) __attribute__((aligned (_N)))
<jeromegn> I have no idea what they do
<fowl> Alignment can be an issue
<jhass> mh, yeah
<jeromegn> anything I can do about it
<jeromegn> ?
<jhass> do you need to access the fields of that struct?
<jhass> or even allocate it yourself?
DeBot has joined #crystal-lang
<jeromegn> hmm
<jeromegn> there could be a way around it, maybe
<jhass> which of the two?
<kulelu88> Is there a REST framework for Crystal?
<kulelu88> I'd like to compare it to 2 python rest frameworks
<jeromegn> if I remove my structs definitions, I won’t be able to extend the core classes and will have to have a bunch of logic like checking types
<jeromegn> but I will give it a try
DeBot has quit [Ping timeout: 272 seconds]
<jhass> well, if it's not easier than figuring out what that macro is and whether we can emulate it in crystal... ;)
willlll has joined #crystal-lang
HakanD has joined #crystal-lang
<jeromegn> it’s probably easier haha
<jeromegn> alright, I have to go… going to work on that tomorrow.
waterlink has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
<fowl> well
<fowl> it seems that LLVM lets you specify alignment for structs/members
<fowl> so it just needs crystal support
<jhass> I know we already have @[Packed] or something
<fowl> Packed is diff than specifying an alignment afaik
<fowl> Maybe it works tho
<jhass> yeah, more regarding to "general infrastructure probably already exists"
<fowl> Yea
<fowl> Surely easier to add @[packed(8)] than the whole packed attribute
bcardiff1 has quit [Quit: Leaving.]
BlaXpirit has quit [Quit: Quit Konversation]
<crystal-gh> [crystal] asterite pushed 3 new commits to master: http://git.io/vJbKb
<crystal-gh> crystal/master 347e5f3 Ary Borenszweig: Disallow empty C structs and unions. Fixes #633
<crystal-gh> crystal/master e0d9e62 Ary Borenszweig: Disallow Void types in C structs and unions fields
<crystal-gh> crystal/master a86874e Ary Borenszweig: Documented a bit of String
HakanD has quit [Quit: Be back later ...]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vJb6q
<crystal-gh> crystal/master 1815c73 Ary Borenszweig: Small correction in String docs
ismaelga has joined #crystal-lang
_havenn has joined #crystal-lang
havenwood has quit [Ping timeout: 244 seconds]
blaix has quit [Quit: Leaving.]
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
<willlll> with Range, why is it Range(B, E) instead of like Range(B, B) ? Why different types?
<travis-ci> manastech/crystal#2307 (master - a86874e : Ary Borenszweig): The build is still failing.
DerisiveLogic has joined #crystal-lang
<jhass> willlll: Int32...Int64, Int32..Float32 stuff like that can be useful
<willlll> ah, thanks
_havenn is now known as havenwood
<travis-ci> manastech/crystal#2308 (master - 1815c73 : Ary Borenszweig): The build was fixed.
<crystal-gh> [crystal] asterite closed pull request #632: Int#to_s performance (master...int_to_s_edge_cases) http://git.io/vJ9wE
<travis-ci> manastech/crystal#2311 (master - 968e3eb : Ary Borenszweig): The build was broken.
DerisiveLogic has quit [Ping timeout: 245 seconds]
DerisiveLogic has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
DeBot has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
DeBot has quit [Ping timeout: 276 seconds]