ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.29.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 [Read error: Connection reset by peer]
alex`` has joined #crystal-lang
alex`` has quit [Read error: Connection reset by peer]
alex`` has joined #crystal-lang
<alex``> > One curly brace can contain multiple unicode characters each separated by a whitespace.
<alex``> > "\u{48 45 4C 4C 4F}" # => "HELLO"
<alex``> I never see that in other langage
<alex``> does it have some inspiration or is an original feature?
DTZUZO has quit [Ping timeout: 248 seconds]
alex`` has quit [Ping timeout: 245 seconds]
alex`` has joined #crystal-lang
early` has quit [Quit: Leaving]
<FromGitter> <watzon> I actually had no idea that was a thing
early has joined #crystal-lang
<FromGitter> <watzon> I present to you, the `markdown` tag ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d09940bbb789747fb3a0bb8]
<FromGitter> <omidathari> @watzon Hi Chris please elaborate. I can pass it the string ? Thanks
<FromGitter> <watzon> Yeah. Basically all I did was add `markd` to my `shard.yml` and then added that code in a file that gets loaded before the pages do. It just adds a `markdown` tag which takes a string, converts the markdown to html, and renders it using the `raw` tag.
<FromGitter> <omidathari> @watzon Sorry I was not clear, Regarding our conversation yesterday about the C function that takes the UInt8* argument, you said I could pass it a string? how do you mean. Thanks
<FromGitter> <Blacksmoke16> i think me means like `MyCLib.my_method("BoB")`
<FromGitter> <Blacksmoke16> the arg that takes `UInt8*` just pass it a string instead
<FromGitter> <Blacksmoke16> from crystal
<FromGitter> <watzon> Oh I see. Yeah if you have a C function that takes a `UInt8*` you should just be able to pass it a string and it will get converted. Take for example my `nacl` library. Here (https://github.com/watzon/nacl/blob/master/src/nacl/sodium/crypto.cr#L81) is a C function and here (https://github.com/watzon/nacl/blob/master/src/nacl/aead/xchacha20poly1305_ietf.cr#L16) is it being called in Crystal. `ciphertext` can be
<FromGitter> ... either a `Pointer(UInt8)`, `Slice(UInt8)`, or a `String`.
<FromGitter> <watzon> It works either way
alex`` has quit [Quit: WeeChat 2.5]
alex`` has joined #crystal-lang
<FromGitter> <omidathari> I see. Well I'll try it tomorrow. Thanks fellows
_whitelogger has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.5]
justinmcp_ has joined #crystal-lang
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
blassin has quit [Quit: The Lounge - https://thelounge.chat]
salvor has quit [Ping timeout: 272 seconds]
blassin has joined #crystal-lang
salvor has joined #crystal-lang
DTZUZO has joined #crystal-lang
laaron- has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <cserb> Does anyone have an opinion on Crest vs Halite as HTTP Client?
<FromGitter> <watzon> Halite is the one I prefer
devil_tux has joined #crystal-lang
<FromGitter> <mamantoha> @cserb just use HTTP::Client from Crystal's standard library if you don’t need additional features like redirection etc
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron- has joined #crystal-lang
devil_tux has quit [Ping timeout: 245 seconds]
laaron- has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<jokke> it's not possible to statically link on mac?
<jokke> ld: library not found for -lcrt0.o (this usually means you need to install the development package for libcrt0.o)
<jokke> clang: error: linker command failed with exit code 1 (use -v to see invocation)
<jokke> Error: execution of command failed with code: 1: `cc "${@}" -o '/Users/case49244/builds/ZMVEsG_i/0/jreinert/fogtrack/bin/fogtrack' -rdynamic -static -lz `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` /usr/local/lib/libpcre.a
<jokke> /usr/local/Cellar/crystal/0.29.0/embedded/lib/libgc.a -lpthread /usr/local/Cellar/crystal/0.29.0/src/ext/libcrystal.a /usr/local/lib/libevent.a -liconv -ldl -L/usr/local/Cellar/crystal/0.29.0/embedded/lib -L/usr/lib -L/usr/local/lib`
<FromGitter> <j8r> how can I use `Colorize` instead of `io << "\e[1;31m"; io << my_var`
<FromGitter> <j8r> hum... I noticed `Object.colorize`, I can do `Exception#colorize` then. solved.
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<jokke> yeah
devil_tux has joined #crystal-lang
alex`` has joined #crystal-lang
devil_tux has quit [Ping timeout: 244 seconds]
<jokke> hm i get certificate validation errors on mac
<jokke> anyone here having experience with using openssl in crystal on mac?
RX14 has quit [Quit: Fuck this shit, I'm out!]
RX14 has joined #crystal-lang
<FromGitter> <r00ster91> so I want to wait at a specific point until in a different fiber a specific thing happened, and for that it would probably be good to use channels but I don't want to wait forever, I want to break up after like 5 seconds. Is there something like `Channel#receive` but with a timeout?
<FromGitter> <r00ster91> or maybe a different way?
waheedi has joined #crystal-lang
<waheedi> Hello
<FromGitter> <r00ster91> hello
<waheedi> what version of llvm does crystal currently support
<waheedi> ?
<waheedi> i'm trying to build on OS X with llvm 8.0 but failing
<FromGitter> <r00ster91> Crystal doesn't support LLVM 7 either
<FromGitter> <r00ster91> but I think Crystal supports LLVM 6
<waheedi> I see, thanks
<waheedi> i think this information needs to be on the GitHub readme page somewhere
<waheedi> there is llvm 9.0 on the way :)
<waheedi> r00ster91: whats documented? its false "When possible, use the latest one."
<FromGitter> <r00ster91> it's documented that LLVM 6 is the latest support version
<waheedi> But this changes the whole story :) "When possible, use the latest one."\
<waheedi> should I remove that sentence?
<FromGitter> <r00ster91> no I think they mean LLVM 6 with "When possible, use the latest one."
<FromGitter> <r00ster91> they don't mean LLVM's latest release but the latest release that Crystal supports so 6
<waheedi> I think you are right, this is what they mean
<waheedi> but its misleading
<waheedi> needs more explaining or maybe just take it out
duane has joined #crystal-lang
<FromGitter> <r00ster91> would probably be cleared when saying "When possible, use the latter."
laaron has quit [Remote host closed the connection]
<waheedi> true, but that's common sense
<waheedi> why would I use 3.4 if 6.0 is possible
<FromGitter> <r00ster91> yeah that's true tho
<FromGitter> <r00ster91> take it out perhaps
<waheedi> i did
<waheedi> thanks a lot
laaron has joined #crystal-lang
flaviodesousa has quit [Remote host closed the connection]
<FromGitter> <Daniel-Worrall> That's not misleading in the slightest. If you were being l
<FromGitter> <Daniel-Worrall> Pedantic, you'd say later of the listed
devil_tux has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<waheedi> what?
<waheedi> pedantic, sounds like pampers
waheedi has quit [Ping timeout: 245 seconds]
waheedi has joined #crystal-lang
waheedi has quit [Ping timeout: 248 seconds]
devil_tux has quit [Ping timeout: 244 seconds]
misaki_m has joined #crystal-lang
lucasb has joined #crystal-lang
jemc has joined #crystal-lang
misaki_m has quit [Quit: Mutter: www.mutterirc.com]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <watzon> Woo someone wrote a blog post about my Tourmaline project :) https://picandocodigo.net/2019/tourmaline-framework-para-bots-de-telegram-en-crystal/
devil_tux has joined #crystal-lang
alex`` has quit [Ping timeout: 245 seconds]
alex`` has joined #crystal-lang
<FromGitter> <bew> 🎉 :D
laaron- has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
devil_tux has quit [Ping timeout: 244 seconds]
alex`` has quit [Ping timeout: 246 seconds]
alex`` has joined #crystal-lang
Raimondi has quit [Quit: WeeChat 2.4: ¡Chau!]
alex`` has quit [Ping timeout: 258 seconds]
Raimondi has joined #crystal-lang
alex`` has joined #crystal-lang
lucasb has quit [Quit: Connection closed for inactivity]
duane has quit [Ping timeout: 248 seconds]
<FromGitter> <watzon> So I've been working on a project which I think could benefit the community. Added an issue about it here https://github.com/crystal-lang/shards/issues/283
<FromGitter> <watzon> Please, maintainers especially, let me know what you think
greengriminal has joined #crystal-lang
alex`` has quit [Ping timeout: 245 seconds]
alex`` has joined #crystal-lang
<FromGitter> <mistergibson> One thing rubygems had severe difficulty with in the beginning is marking gems that are ONLY valid or for one platform -- marked as such in the record, and in the search functions.
<FromGitter> <mistergibson> Eventually, they came up with an idea
<FromGitter> <mistergibson> There may be shards only relevant to Winderz one day ... just say'n
<FromGitter> <watzon> This is true, it would be pretty easy to allow people to register a shard as being platform specific
<FromGitter> <mistergibson> yeah, I'm thinking of platform-specific platform-abstraction-layer adapters etc
<FromGitter> <mistergibson> or conversely : :all-platforms ... just thinking outloud
<FromGitter> <mistergibson> great idea though in general. I was wondering where the registry was ... hehe :)
<FromGitter> <watzon> I feel like it's something that's missing. Being able to install shards from github is great and all, but that approach lacks a bit
greengriminal has quit [Quit: This computer has gone to sleep]
jemc has quit [Ping timeout: 245 seconds]
devil_tux has joined #crystal-lang
ua has quit [Ping timeout: 272 seconds]
ua has joined #crystal-lang
devil_tux has quit [Ping timeout: 245 seconds]
<mps> j8r: we released Alpine 3.10 few hours ago. You can see release notes, could be interesting to you personally :)
waheedi has joined #crystal-lang
<waheedi> I have a question regarding the build process from source, whats the reason behind not being able to configure the source and then making it, instead i have to install the crystal binary for my arch to be able to build using crystal run?
<waheedi> also would I still need the previously installed crystal binary if I get the built one?
<oprypin> waheedi, what do u mean, you are able to just make the source
<oprypin> it's just that first you need to install the prerequisites for it
<oprypin> included but not limited to llvm, crystal
<oprypin> including*
<waheedi> oprypin: yes, I actually made from source, but it complained that I had to have a binary for crystal t run Crystall::run
<waheedi> to* run
<oprypin> what command did you run when it complained that?
<waheedi> make
<waheedi> make -j 4
<oprypin> was the error message "had to have a binary for crystal t run Crystall::run " or "You need to have a crystal executable in your path!"
<waheedi> You need to have a crystal executable in your path!
<oprypin> ok, well crystal is a prerequisite to compile crystal
<waheedi> yeah which is kind of strange
<waheedi> we can't I configure
<waheedi> why*
<oprypin> why would you need to configure
<oprypin> it's just an ancient cargo cult stuff because C is too limited
<waheedi> for not needing to build using crystal
<oprypin> waheedi, Crystal is written in Crystal so that would not be possible
<waheedi> I understand but crystal is written in C
<waheedi> or its not?
<oprypin> no. Crystal is written in Crystal
<FromGitter> <Blacksmoke16> *magic*
<oprypin> also depending on LLVM which is written in C++ but that's a separate topic
<waheedi> so basically written on LLVM which is using C?
<waheedi> and C++
<oprypin> the fact that LLVM is written in C is inconsequential
<oprypin> it gets compiled into a dynamic library with a universal FFI
<oprypin> then crystal depends on the dynamic library without ever involving a piece of C code
<waheedi> good to know oprypin :)
<oprypin> when i said "FFI" i meant "ABI"
<waheedi> got it
<waheedi> would SWIG be on FFI or ABI?
<waheedi> yeah FFI
<waheedi> good stuff oprypin
<waheedi> would I still need the previously installed version of crystal?
<FromGitter> <watzon> Why is is that when using `Crystal::Parser` if you enable comments it gives an error `Unhandled exception: unexpected token: # comment`?
<waheedi> after successfully building one I mean?
<oprypin> waheedi, no, you just need any crystal binary that the source code is compatible with
<oprypin> and it gets automatically substituted
<oprypin> `make` uses "bin/crystal" which uses ".build/crystal" if available or falling back to "crystal" in PATH
<waheedi> yeah I noticed
<waheedi> i think i have an issue after deleting the installed crystal complaining about the linker not being able to find some lib ld: warning: directory not found for option '-L/usr/local/Cellar/crystal/0.29.0/embedded/lib'
<oprypin> and when i say "any crystal binary that the source code is compatible with" - that includes the one that you just built :)
<oprypin> waheedi, that might be a side effect of running .build/crystal directly - you shouldnt do that
alex`` has quit [Ping timeout: 268 seconds]
<waheedi> what should I do ?
<oprypin> "bin/crystal"
<waheedi> whats the difference? bin/crystal will be ./build/crystal
<waheedi> .build/crystal*I
alex`` has joined #crystal-lang
<waheedi> maybe I need to change this CRYSTAL_LIBRARY_PATH
<oprypin> waheedi, well yes, that's among the things that bin/crystal provides
<oprypin> it's non-trivial for a binary to ensure that it always works with relative paths, so it needs some help :p
<waheedi> where can I find these libraries? are they generated somewhere /usr/local/Cellar/crystal/0.29.0/embedded/lib/*
<oprypin> i dont know about mac
<waheedi> i'm on 0.30.0-dev
<oprypin> what i know: first u install crystal in any way you can, then u `make`, then u use `bin/crystal` and it should never look at the previous global install
<oprypin> if u run `bin/crystal` and get complaints about cellar or whatever, something already went wrong
<waheedi> well, that what I did
<oprypin> now just need to figure out what went wrong
<oprypin> again, make sure you're not actually running .build/crystal
<oprypin> directly, that is
<waheedi> I know what went wrong, I deleted the previously installed crystal
<oprypin> but that should be fine
<waheedi> crystal env shows that the path is still pointing to the previously installed crystal bin
<waheedi> the lib path*
<oprypin> that should be ok
<waheedi> that path does not exist anymore
<oprypin> maybe brew populates PATH so u should just reload your terminal session
<waheedi> i think i have to change that path, to point to the build libraries if any were built
<waheedi> I can't find any libraries generated, the only thing I see is the crystal binary generated and a dwarf file
<oprypin> waheedi, it's not that kind of libraries
<oprypin> crystal cant use libraries anyway, it needs to always build everything from source
<oprypin> (well it can use C libraries but that's specifically *for* C libraries)
<waheedi> yeah It seems I have to build the crystal_lib separately
<oprypin> waheedi, i think you know too much for your own good xD
<waheedi> lol, I think yes but its better to communicate
<waheedi> you feel that you are not alone
<waheedi> lol
<waheedi> because my name means "alone"
<oprypin> waheedi, for your reference https://bpaste.net/show/b7181a1ffa41
<oprypin> these are all plaintext source code, not actual "lib"s
<oprypin> and i think that's also what it expects to see there in your case
<waheedi> interesting
<oprypin> but you should have those files right there in the source directory -- ./src
<waheedi> works like a charm man
<oprypin> what, did u just copy the files? because that's not what i meant xD
<waheedi> i just exported the env variable CRYSTAL_LIBRARY_PATH to the src directory
<oprypin> ok
<waheedi> :)
<waheedi> thanks a lot
<oprypin> acceptable, though u shouldnt mess with this manually, ./bin/crystal does it for u
<waheedi> it didn't :) I'm on osx and mostly thats why
greengriminal has joined #crystal-lang
<FromGitter> <watzon> Does anyone know of a shard that does this? https://github.com/sporkmonger/addressable#uri-templates
<FromGitter> <Blacksmoke16> prob wouldnt be that hard
<FromGitter> <Blacksmoke16> looks like just a wrapper of https://crystal-lang.org/api/master/URI.html
<FromGitter> <watzon> Yeah it just provides a parser for URI templates. I don't necessarily need it for the project I'm doing right now because I can just use `gsub`, but I was wondering if anyone had tried to implement it yet
waheedi has quit [Quit: waheedi]