ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.31.0 | 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
alex`` has quit [Ping timeout: 245 seconds]
<FromGitter> <naqvis> @j8r yeah, for usage purposes, I reviewed the samples and api documentation of lzma. Used wonderful `crystal_lib` for generating the bindings, did some cleanup, wrapped API calls to crystal IO. Pretty stratight-forward due to presence of `crystal_lib` as that does all of the heavy-lifting of generating C to Crystal bindings, we just need to tweak things afterwards.
_whitelogger has joined #crystal-lang
sorcus has quit [Ping timeout: 246 seconds]
chemist69 has quit [Ping timeout: 264 seconds]
chemist69 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
_whitelogger has joined #crystal-lang
ht_ has joined #crystal-lang
<FromGitter> <xqyww123> Does anyone find version `0.31.0` breaks some C binding caused by `invalid memory access` at runtime, while the same code works nicely in `0.30.0` (Maybe later I submit an issue if I find out the reason
<FromGitter> <naqvis> @xqyww123 by any means are you using `GC.alloc` and/or `GC.free` in your binding code?
<FromGitter> <naqvis> I had similar issues and got that removed and had lib used C `malloc` and/or `free`
<FromGitter> <xqyww123> yeah, some buffer allocated from Crystal is sent to C code. I will try it later
<FromGitter> <naqvis> that's something different. I'm talking about some libraries allowed passing `allocator` and/or `deallocator` which are used by library for allocating/freeing mem
<FromGitter> <naqvis> just an example https://github.com/naqvis/xz.cr/blob/2e54dc00f20aef6e7ddaea0e8bb98e944937f7b5/src/xz/writer.cr#L42 to line 46. Enabling this causes segfault on OSX, but things works good on Linux
<FromGitter> <xqyww123> Ummm, it sounds too advanced. No, I haven't used such cool things.
<FromGitter> <naqvis> then that might be different issue you are encountering.
<FromGitter> <xqyww123> Actually I haven't begun to dive into the bug (I simply downgraded crystal version temporarily :-)
<FromGitter> <naqvis> i would suggest to pin-point the code which is causing that error
<FromGitter> <naqvis> might be something hidden which got figured out by higher version of language
<FromGitter> <xqyww123> Yeah, I will, after my current work
<FromGitter> <naqvis> great
<FromGitter> <naqvis> do share your findings in this channel
<FromGitter> <xqyww123> (while every Chinese programmer is exploited by their boss :D , Of course, I will share :D
<FromGitter> <naqvis> hahaha 😆
<FromGitter> <naqvis> in OSS world you are your own boss 😆
<FromGitter> <xqyww123> (after today the DDL for me to submit the weekly report :D
DTZUZO has quit [Ping timeout: 265 seconds]
<FromGitter> <naqvis> apologies for any offense if any caused. All I meant was to request your sharing after you find the issue and root-cause, as that is definitely going to help all others in this community 👏
<FromGitter> <xqyww123> take it easy and I know. I'm enthusiastic to contribute to the community :-)
<FromGitter> <naqvis> 👏
<FromGitter> <xqyww123> (If my language skill was better I'll even better :D
<FromGitter> <naqvis> practice makes perfect, we all learn from each other, that's the beauty of OSS and sharing
<FromGitter> <xqyww123> (āļ‡ â€ĒĖ€_â€ĒĖ)āļ‡
<FromGitter> <xqyww123> (Actually, my current project will be open-sourced after it finished with already acquired permission from company :)
<FromGitter> <naqvis> great work
DTZUZO has joined #crystal-lang
<FromGitter> <kingsleyh> Hi - does anyone know if it's possible to get crystal to emit LLVM IR bitcode that would work when passed to the `lli` tool to run it JIT style
<FromGitter> <kingsleyh> I did this: `crystal build b.cr --emit llvm-ir`
<FromGitter> <kingsleyh> but the `lli b.ll` complained:
<FromGitter> <kingsleyh> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d90777f66c8b45122395048]
<FromGitter> <xqyww123> try `crystal build b.cr --emit llvm-ir --no-debug`
<FromGitter> <xqyww123> I'm not sure but `DISubprogram` seems related to debug info
<FromGitter> <kingsleyh> ha that resulted in:
<FromGitter> <kingsleyh> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d9077fbd97d8e3549d17ecf]
<FromGitter> <kingsleyh> b.cr - has only `puts "hello"`
<FromGitter> <kingsleyh> maybe I need to pass some flags to lli as well to help
<FromGitter> <xqyww123> Does your way work for other languages like `clang`?
<FromGitter> <kingsleyh> yeah I can convert c file to llvm ir and execute it with lli
<FromGitter> <kingsleyh> I found this as well : https://github.com/Virtual-Machine/ir-examples
<FromGitter> <kingsleyh> it doesn't mention that the ll code can be executed by lli though - or if any dependent shared objects would be required to run it
<FromGitter> <kingsleyh> the ll code on that github does seem to run though
<FromGitter> <kingsleyh> I guess it does not include the prelude tho
<FromGitter> <kingsleyh> I guess it can't print to stout for some reason - I don't know enough about it to understand why though
<FromGitter> <kingsleyh> the C file example does print out to the console though
<FromGitter> <asterite> it's probable that lli's version is from a different LLVM version. The version must match the one in the compiler. LLVM introduces breaking changes by the minute
<FromGitter> <asterite> (well, we are not so different)
ht_ has quit [Ping timeout: 246 seconds]
ht_ has joined #crystal-lang
Yxhuvud has joined #crystal-lang
sorcus has joined #crystal-lang
<FromGitter> <r00ster91> How do I get a https://crystal-lang.org/api/0.31.0/Crystal/Macros/Macro.html object? I don't see any way to receive the class from anything. No method returns it. Is it just there for the compiler's internals?
alex`` has joined #crystal-lang
<FromGitter> <kingsleyh> Thanks @asterite
<FromGitter> <j8r> @naqvis but snappy is a pure Crystal implementation?
<FromGitter> <j8r> I hope the bindings will work on aarch64 musl, I will check it in the following weeks
alex`` has quit [Ping timeout: 268 seconds]
alex`` has joined #crystal-lang
<FromGitter> <naqvis> yeah Snappy is pure Crystal. XZ is bindings, as long as you have xz installed, it should work
<FromGitter> <naqvis> xz-utils comes with installation of lzma
<FromGitter> <j8r> In alpine it will be `xz-dev`, yes it should work :)
<FromGitter> <j8r> I like this format, very efficient for archives and quite widepread
<FromGitter> <j8r> I see no point nowadays using `bz2`
<FromGitter> <kaukas_gitlab> Hi! I need support of `before :all` (specific to a particular `describe`) kind of spec setup. In Crystal 0.28 (?) I achieved that by doing this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ However, on the current release (0.31) all of my setup (`do_setup` and `do_other_setup`) runs before all specs, and then the specs run. So something seems to have changed at some point. How can I achieve `before
<FromGitter> <j8r> You can use a block
<FromGitter> <j8r> `do_setup { it "does something" ... }`
<FromGitter> <j8r> There is also this PR for 0.31.1 https://github.com/crystal-lang/crystal/pull/8238
<oprypin> kaukas_gitlab, so might be worth ignoring 0.31.0 and going for 0.31.1 when it's out
<FromGitter> <Blacksmoke16> That won't really help since that pr just adds methods that run before or after all specs run
<FromGitter> <Blacksmoke16> Not just that specific describe block
<FromGitter> <naqvis> @j8r you shouldn't be required to have `xz-dev` installed, as dev packages are only required when you are building something, like looking into header files or generating bindings.
<FromGitter> <naqvis> that part is done, so you will require to have `lzma` library installed which is required during linking and runtime
Human_G33k has joined #crystal-lang
HumanG33k has quit [Ping timeout: 240 seconds]
<FromGitter> <Val> Is it possible to try Crystal program with arguments (ARGV) in carc.in ?
<FromGitter> <tenebrousedge> why?
<FromGitter> <Val> why not asking?
<FromGitter> <tenebrousedge> answer the question, please
<FromGitter> <Val> to test a program with arguments in carc.in
<FromGitter> <tenebrousedge> why?
<FromGitter> <Val> ...
<FromGitter> <tenebrousedge> what are you trying to test?
<FromGitter> <tenebrousedge> because it clearly does not support that, and because you shouldn't need to test option handling
<FromGitter> <tenebrousedge> and if you do need to test option handling, there are likely better ways
<FromGitter> <Val> Ok thx
<FromGitter> <tenebrousedge> @Val so what are you trying to test?
<FromGitter> <tenebrousedge> 🙄
chachasmooth_ has quit [Ping timeout: 240 seconds]
chachasmooth has joined #crystal-lang
<oprypin> Val, just overwrite ARGV at first :D `ARGV.replace(["a", "b"])`
<FromGitter> <Val> :-D
<FromGitter> <Val> Is it normal that `at_exit` is called before the end of the process when running specs since Crystal 0.31.0 ? See https://carc.in/#/r/7nx1 (Crystal 0.30.1) versus https://carc.in/#/r/7nwz (Crystal 0.31.0)
<FromGitter> <Blacksmoke16> yes
<FromGitter> <Val> 👍
<FromGitter> <Val> Thanks
alex`` has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
<FromGitter> <Blacksmoke16> im not super up to date on the PR, but afaik its so that you can gather all the specs, filter them, then executes the ones that match
<FromGitter> <Blacksmoke16> for the implementation of `focus: true`
<FromGitter> <Val> Well it breaks my spec trick... https://github.com/Val/crun/blob/master/spec/spec_helper.cr#L14
<FromGitter> <Blacksmoke16> just wait till `0.31.1` comes out and use the after_suite method
<FromGitter> <Val> Yup...
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d90e3a373dd29627ed4081d]
<FromGitter> <Blacksmoke16> is what i landed on for now, need to add in the context tho
<FromGitter> <Blacksmoke16> some of the logic is still tied to the format, namely how to read the value from the deserialized data, rest is handled in another method
<FromGitter> <Blacksmoke16> like the exclusion strategies, and callbacks
rohitpaulk has joined #crystal-lang
ht_ has quit [Quit: ht_]
ht_ has joined #crystal-lang
alex`` has quit [Ping timeout: 245 seconds]
alex`` has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 265 seconds]
alex`` has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
alex`` has quit [Ping timeout: 276 seconds]
alex`` has joined #crystal-lang
ht_ has quit [Ping timeout: 246 seconds]
ht_ has joined #crystal-lang
ht_ has quit [Remote host closed the connection]
alex`` has quit [Quit: WeeChat 2.6]
alex`` has joined #crystal-lang
alex`` has quit [Ping timeout: 265 seconds]